Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion SpongeAPI
Submodule SpongeAPI updated 26 files
+1 −1 gradle.properties
+2 −0 src/main/java/org/spongepowered/api/advancement/criteria/trigger/Triggers.java
+1 −1 src/main/java/org/spongepowered/api/data/Keys.java
+1 −1 src/main/java/org/spongepowered/api/data/type/ItemActionType.java
+2 −0 src/main/java/org/spongepowered/api/effect/potion/PotionEffectTypes.java
+134 −0 src/main/java/org/spongepowered/api/effect/sound/SoundTypes.java
+1 −1 src/main/java/org/spongepowered/api/entity/Angerable.java
+13 −1 src/main/java/org/spongepowered/api/entity/EntityTypes.java
+33 −0 src/main/java/org/spongepowered/api/entity/living/animal/Nautilus.java
+35 −0 src/main/java/org/spongepowered/api/entity/living/animal/NautilusLike.java
+34 −0 src/main/java/org/spongepowered/api/entity/living/animal/ZombieNautilus.java
+2 −1 src/main/java/org/spongepowered/api/entity/living/animal/camel/Camel.java
+32 −0 src/main/java/org/spongepowered/api/entity/living/animal/camel/CamelHusk.java
+32 −0 src/main/java/org/spongepowered/api/entity/living/monster/skeleton/Parched.java
+2 −0 src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageTypes.java
+34 −0 src/main/java/org/spongepowered/api/item/ItemTypes.java
+8 −0 src/main/java/org/spongepowered/api/item/enchantment/EnchantmentTypes.java
+2 −0 src/main/java/org/spongepowered/api/item/inventory/equipment/EquipmentConditions.java
+1 −1 src/main/java/org/spongepowered/api/registry/RegistryTypes.java
+2 −0 src/main/java/org/spongepowered/api/statistic/Statistics.java
+2 −10 src/main/java/org/spongepowered/api/tag/BiomeTags.java
+2 −0 src/main/java/org/spongepowered/api/tag/BlockTypeTags.java
+8 −0 src/main/java/org/spongepowered/api/tag/EntityTypeTags.java
+17 −1 src/main/java/org/spongepowered/api/tag/ItemTypeTags.java
+0 −1 src/main/java/org/spongepowered/api/world/biome/Biome.java
+59 −61 src/main/java/org/spongepowered/api/world/gamerule/GameRules.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static List<Path[]> resolve() {

final AtomicBoolean hasAPISourceSet = new AtomicBoolean(false);

boolean skipMixinExtras = false;
for (final String str : cp) {
final Path path = Paths.get(str);
if (!Files.exists(path)) {
Expand Down Expand Up @@ -96,6 +97,9 @@ public static List<Path[]> resolve() {
}
break;
case "", "vanilla", "forge", "neoforge":
if ("forge".equals(projectName)) {
skipMixinExtras = true;
}
final WeightedPath weightedPath = new WeightedPath(projectName.isEmpty() ? 1 : 2, path);
switch (sourceSet.name()) {
case "applaunchConfig":
Expand Down Expand Up @@ -132,6 +136,14 @@ public static List<Path[]> resolve() {
}
continue;
}
// We need to skip mixinextras-common in Forge's UserDev mode as this will cause duplicate module
// errors with JPMS.
if (fileName.startsWith("mixinextras-common") && skipMixinExtras) {
if (Bootstrap.DEBUG) {
System.out.println("Ignored: " + path);
}
continue;
}

if (bootNames.contains(fileName) || fileName.startsWith("org.jacoco.core-") || fileName.startsWith("mockito-") || fileName.startsWith("objenesis-")) {
if (Bootstrap.DEBUG) {
Expand All @@ -158,7 +170,7 @@ public static List<Path[]> resolve() {
final List<Path[]> classpath = new ArrayList<>();

for (final Path lib : bootLibs) {
classpath.add(new Path[] { lib });
classpath.add(new Path[]{lib});
}

for (final List<WeightedPath> sourceSets : bootUnions.values()) {
Expand Down
2 changes: 1 addition & 1 deletion forge/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ name=SpongeForge
implementation=Forge
description=The SpongeAPI implementation for MinecraftForge

forgeVersion=60.0.1
forgeVersion=61.0.1
mixinConfigs=mixins.spongeforge.accessors.json,mixins.spongeforge.api.json,mixins.spongeforge.inventory.json,mixins.spongeforge.inventory.shared.json,mixins.spongeforge.core.json,mixins.spongeforge.core.shared.json,mixins.spongeforge.tracker.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraftforge.network.ForgePayload;
import org.spongepowered.api.ResourceKey;
import org.spongepowered.common.hooks.ChannelHooks;
Expand All @@ -46,6 +46,6 @@ public void registerPlatformChannels(final Consumer<CustomPacketPayload.Type<Spo
@Override
public CustomPacketPayload createRegisterPayload(final Set<ResourceKey> channels) {
final FriendlyByteBuf payload = (FriendlyByteBuf) RegisterChannelUtil.encodePayload(channels);
return new ForgePayload((ResourceLocation) (Object) Constants.Channels.REGISTER_KEY, null, b -> b.writeBytes(payload));
return new ForgePayload((Identifier) (Object) Constants.Channels.REGISTER_KEY, null, b -> b.writeBytes(payload));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import com.google.common.collect.Maps;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraftforge.registries.ForgeRegistry;
import net.minecraftforge.registries.IForgeRegistry;
import org.spongepowered.api.ResourceKey;
Expand Down Expand Up @@ -55,10 +55,10 @@ public abstract class ForgeRegistryMixin_Forge<V> {
private final Map<ResourceKey, RegistryBridge<V>> forge$parents = Maps.newHashMap();
private boolean forge$warnedIfNoParent;

@Inject(method = "add(ILnet/minecraft/resources/ResourceLocation;Ljava/lang/Object;Ljava/lang/String;)I", at = @At("TAIL"))
public void forge$writeToParent(final int id, final ResourceLocation key, final V value, final String owner, final CallbackInfoReturnable<Integer> cir) {
@Inject(method = "add(ILnet/minecraft/resources/Identifier;Ljava/lang/Object;Ljava/lang/String;)I", at = @At("TAIL"))
public void forge$writeToParent(final int id, final Identifier key, final V value, final String owner, final CallbackInfoReturnable<Integer> cir) {
final ResourceKey root = (ResourceKey) (Object) this.key.registry();
final ResourceKey location = (ResourceKey) (Object) this.key.location();
final var location = (ResourceKey) (Object) this.key.identifier();

if (!this.forge$warnedIfNoParent && this.forge$parents.isEmpty()) {
// We only care about minecraft namespaced registries, as that is what we've got parents for.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
package org.spongepowered.forge.mixin.core.minecraftforge.registries;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraftforge.registries.ForgeRegistry;
import net.minecraftforge.registries.RegistryManager;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -39,7 +39,7 @@ public class RegistryManagerMixin_Forge {

@SuppressWarnings("UnstableApiUsage")
@Inject(method = "takeSnapshot", at = @At("RETURN"))
public void forge$dontSendSpongeDataToClient(boolean savingToDisc, CallbackInfoReturnable<Map<ResourceLocation, ForgeRegistry.Snapshot>> cir) {
public void forge$dontSendSpongeDataToClient(boolean savingToDisc, CallbackInfoReturnable<Map<Identifier, ForgeRegistry.Snapshot>> cir) {
if (savingToDisc) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraftforge.network.NetworkRegistry;
import org.spongepowered.api.ResourceKey;
import org.spongepowered.api.Sponge;
Expand All @@ -49,7 +49,7 @@ public abstract class ClientboundCustomPayloadPacketMixin_Forge {
// @formatter: on

@Inject(method = { "lambda$static$0", "lambda$static$2" }, at = @At("HEAD"), cancellable = true)
private static void forge$getSpongeCustomPacketPayload(final ResourceLocation channelKey, final CallbackInfoReturnable<StreamCodec<FriendlyByteBuf, ? extends CustomPacketPayload>> cir) {
private static void forge$getSpongeCustomPacketPayload(final Identifier channelKey, final CallbackInfoReturnable<StreamCodec<FriendlyByteBuf, ? extends CustomPacketPayload>> cir) {
if (NetworkRegistry.findTarget(channelKey) != null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraftforge.network.NetworkRegistry;
import org.spongepowered.api.ResourceKey;
import org.spongepowered.api.Sponge;
Expand All @@ -49,7 +49,7 @@ public abstract class ServerboundCustomPayloadPacketMixin_Forge {
// @formatter: on

@Inject(method = { "lambda$static$0" }, at = @At("HEAD"), cancellable = true)
private static void forge$getSpongeCustomPacketPayload(final ResourceLocation channelKey, final CallbackInfoReturnable<StreamCodec<FriendlyByteBuf, ? extends CustomPacketPayload>> cir) {
private static void forge$getSpongeCustomPacketPayload(final Identifier channelKey, final CallbackInfoReturnable<StreamCodec<FriendlyByteBuf, ? extends CustomPacketPayload>> cir) {
if (NetworkRegistry.findTarget(channelKey) != null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import net.minecraft.server.RegistryLayer;
import net.minecraft.server.ReloadableServerResources;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.server.permissions.PermissionSet;
import net.minecraft.world.flag.FeatureFlagSet;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -44,9 +45,13 @@
@Mixin(ReloadableServerResources.class)
public abstract class ReloadableServerResourcesMixin_Forge {

@WrapOperation(method = "lambda$loadResources$1", at = @At(value = "NEW", target = "(Lnet/minecraft/core/LayeredRegistryAccess;Lnet/minecraft/core/HolderLookup$Provider;Lnet/minecraft/world/flag/FeatureFlagSet;Lnet/minecraft/commands/Commands$CommandSelection;Ljava/util/List;I)Lnet/minecraft/server/ReloadableServerResources;"))
private static ReloadableServerResources impl$onCreateResources(final LayeredRegistryAccess<RegistryLayer> $$0, final HolderLookup.Provider $$1, final FeatureFlagSet $$2,
final Commands.CommandSelection $$3, final List<?> $$4, final int $$5, final Operation<ReloadableServerResources> original, final @Local(argsOnly = true) ResourceManager resourceManager) {
@WrapOperation(method = "lambda$loadResources$1", at = @At(value = "NEW",
target = "(Lnet/minecraft/core/LayeredRegistryAccess;Lnet/minecraft/core/HolderLookup$Provider;Lnet/minecraft/world/flag/FeatureFlagSet;Lnet/minecraft/commands/Commands$CommandSelection;Ljava/util/List;Lnet/minecraft/server/permissions/PermissionSet;)Lnet/minecraft/server/ReloadableServerResources;"
))
private static ReloadableServerResources impl$onCreateResources(
final LayeredRegistryAccess<RegistryLayer> $$0, final HolderLookup.Provider $$1, final FeatureFlagSet $$2,
final Commands.CommandSelection $$3, final List<?> $$4, final PermissionSet $$5,
final Operation<ReloadableServerResources> original, final @Local(argsOnly = true) ResourceManager resourceManager) {
final ReloadableServerResources instance = original.call($$0, $$1, $$2, $$3, $$4, $$5);
if (instance.getCommands().getDispatcher() instanceof final DelegatingCommandDispatcher delegatingCommandDispatcher) {
delegatingCommandDispatcher.permissionService(((ResourceManagerBridge) resourceManager).bridge$services().permissionService());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.tags.TagEntry;
import net.minecraft.tags.TagLoader;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -56,7 +56,7 @@ public abstract class TagLoaderMixin_Forge<T> implements TagLoaderBridge<T> {
}

@Inject(method = "lambda$build$6", at = @At("HEAD"))
private void forge$onStartBuildingTag(final TagEntry.Lookup<T> $$0x, final Map<ResourceLocation, Collection<T>> $$1x, final ResourceLocation $$2x,
private void forge$onStartBuildingTag(final TagEntry.Lookup<T> $$0x, final Map<Identifier, Collection<T>> $$1x, final Identifier $$2x,
final @Coerce Object $$3x, final CallbackInfo ci) {
this.bridge$buildingTagKey($$2x);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.forge.mixin.core.world.entity.vehicle;
package org.spongepowered.forge.mixin.core.world.entity.vehicle.boat;

import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.vehicle.AbstractBoat;
import net.minecraft.world.entity.vehicle.boat.AbstractBoat;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ public abstract class AbstractFurnaceBlockEntityMixin_Forge implements AbstractF
final Cause cause = PhaseTracker.getInstance().currentCause();
if (entity.cookingTimer == 0) { // Start
final CookingEvent.Start event = SpongeEventFactory.createCookingEventStart(cause, (FurnaceBlockEntity) entityIn, Optional.of(fuel),
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()));
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().identifier()));
SpongeCommon.post(event);
return !event.isCancelled();
} else { // Tick up
final ItemStackSnapshot cooking = ItemStackUtil.snapshotOf(entity.items.getFirst());
final CookingEvent.Tick event = SpongeEventFactory.createCookingEventTick(cause, (FurnaceBlockEntity) entityIn, cooking, Optional.of(fuel),
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()));
Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().identifier()));
SpongeCommon.post(event);
return !event.isCancelled();
}
Expand All @@ -122,7 +122,7 @@ public abstract class AbstractFurnaceBlockEntityMixin_Forge implements AbstractF
final var recipe = entity.bridge$getCurrentRecipe();
final ItemStackSnapshot cooking = ItemStackUtil.snapshotOf(entity.items.get(0));
final CookingEvent.Tick event = SpongeEventFactory.createCookingEventTick(cause, (FurnaceBlockEntity) entityIn, cooking, Optional.of(fuel),
recipe.map(r -> (CookingRecipe) r.value()), recipe.map(r -> (ResourceKey) (Object) r.id().location()));
recipe.map(r -> (CookingRecipe) r.value()), recipe.map(r -> (ResourceKey) (Object) r.id().identifier()));
SpongeCommon.post(event);
if (event.isCancelled()) {
return entity.cookingTimer; // dont tick down
Expand Down Expand Up @@ -174,7 +174,7 @@ public abstract class AbstractFurnaceBlockEntityMixin_Forge implements AbstractF
}
final Optional<ItemStackSnapshot> fuel = hasFuel && !slots.get(1).isEmpty() ? Optional.of(ItemStackUtil.snapshotOf(slots.get(1))) : Optional.empty();
final CookingEvent.Finish event = SpongeEventFactory.createCookingEventFinish(PhaseTracker.getInstance().currentCause(), entity,
fuel, Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().location()), Collections.unmodifiableList(transactions));
fuel, Optional.of((CookingRecipe) recipe.value()), Optional.of((ResourceKey) (Object) recipe.id().identifier()), Collections.unmodifiableList(transactions));
SpongeCommon.post(event);

for (final SlotTransaction transaction : transactions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
package org.spongepowered.forge.mixin.tracker.world.level.block;


import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -42,7 +42,7 @@ public abstract class BlockMixin_Forge_Tracker extends BlockBehaviorMixin_Forge_
//@formatter:on

@Override
protected void forgeTracker$initializeTrackingState(CallbackInfoReturnable<ResourceLocation> cir) {
protected void forgeTracker$initializeTrackingState(CallbackInfoReturnable<Identifier> cir) {
// TODO Not the best check but the tracker options only matter during block ticks...
if (this.isRandomlyTicking(this.defaultBlockState())) {
this.bridge$refreshTrackerStates();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
package org.spongepowered.forge.mixin.tracker.world.level.block.state;


import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -46,6 +46,6 @@ public abstract class BlockBehaviorMixin_Forge_Tracker {
remap = false
)
)
protected void forgeTracker$initializeTrackingState(CallbackInfoReturnable<ResourceLocation> cir) {
protected void forgeTracker$initializeTrackingState(CallbackInfoReturnable<Identifier> cir) {
}
}
2 changes: 1 addition & 1 deletion forge/src/mixins/resources/mixins.spongeforge.core.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"world.entity.LivingEntityMixin_Forge_Damage",
"world.entity.item.ItemEntityMixin_Forge",
"world.entity.player.PlayerMixin_Forge_Damage",
"world.entity.vehicle.BoatMixin_Forge",
"world.entity.vehicle.boat.BoatMixin_Forge",
"world.level.ServerExplosionMixin_Forge",
"world.level.block.FireBlockMixin_Forge",
"world.level.block.entity.AbstractFurnaceBlockEntityMixin_Forge"
Expand Down
Loading
Loading