diff --git a/gradle.properties b/gradle.properties index 2611bda1..9ee5d9fe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html - minecraft_version=1.16-pre2 - yarn_mappings=1.16-pre2+build.29 + minecraft_version=1.16-pre3 + yarn_mappings=1.16-pre3+build.1 loader_version=0.8.7+build.201 # Mod Properties diff --git a/src/main/java/carpet/commands/PlayerCommand.java b/src/main/java/carpet/commands/PlayerCommand.java index 454a93b6..feb59dea 100644 --- a/src/main/java/carpet/commands/PlayerCommand.java +++ b/src/main/java/carpet/commands/PlayerCommand.java @@ -237,7 +237,7 @@ public class PlayerCommand source::getRotation ); RegistryKey dimType = tryGetArg( - () -> DimensionArgumentType.getDimensionArgument(context, "dimension"), + () -> DimensionArgumentType.getDimensionArgument(context, "dimension").getRegistryKey(), () -> source.getWorld().getRegistryKey() // dimension.getType() ); GameMode mode = GameMode.CREATIVE; diff --git a/src/main/java/carpet/commands/SpawnCommand.java b/src/main/java/carpet/commands/SpawnCommand.java index 7b5064df..46a80aea 100644 --- a/src/main/java/carpet/commands/SpawnCommand.java +++ b/src/main/java/carpet/commands/SpawnCommand.java @@ -17,6 +17,7 @@ import net.minecraft.entity.SpawnGroup; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; import net.minecraft.util.DyeColor; import net.minecraft.util.math.BlockPos; import net.minecraft.util.registry.RegistryKey; @@ -260,9 +261,9 @@ public class SpawnCommand return 1; } - private static int mobcapsForDimension(ServerCommandSource source, RegistryKey dim) + private static int mobcapsForDimension(ServerCommandSource source, ServerWorld world) { - Messenger.send(source, SpawnReporter.printMobcapsForDimension(source.getMinecraftServer().getWorld(dim), true)); + Messenger.send(source, SpawnReporter.printMobcapsForDimension(world, true)); return 1; } diff --git a/src/main/java/carpet/mixins/Entity_portalSuffocationMixin.java b/src/main/java/carpet/mixins/Entity_portalSuffocationMixin.java index 0c787e2f..4f1676a0 100644 --- a/src/main/java/carpet/mixins/Entity_portalSuffocationMixin.java +++ b/src/main/java/carpet/mixins/Entity_portalSuffocationMixin.java @@ -2,10 +2,9 @@ package carpet.mixins; import carpet.CarpetSettings; import net.minecraft.entity.Entity; +import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; -import net.minecraft.util.registry.RegistryKey; -import net.minecraft.world.dimension.DimensionType; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; @@ -22,7 +21,7 @@ public abstract class Entity_portalSuffocationMixin value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getLastNetherPortalDirection()Lnet/minecraft/util/math/Direction;" )) - private void registerEntityDimensionChange(RegistryKey newDimension, CallbackInfoReturnable cir) + private void registerEntityDimensionChange(ServerWorld serverWorld, CallbackInfoReturnable cir) { if (CarpetSettings.portalSuffocationFix) { @@ -44,7 +43,7 @@ public abstract class Entity_portalSuffocationMixin } @Inject(method = "changeDimension", at = @At("RETURN")) - private void removeEntity(RegistryKey newDimension, CallbackInfoReturnable cir) + private void removeEntity(ServerWorld serverWorld, CallbackInfoReturnable cir) { CarpetSettings.currentTelepotingEntityBox = null; CarpetSettings.fixedPosition = null; diff --git a/src/main/java/carpet/mixins/ServerPlayerEntity_scarpetEventMixin.java b/src/main/java/carpet/mixins/ServerPlayerEntity_scarpetEventMixin.java index 7e7c8cb2..d05cebaf 100644 --- a/src/main/java/carpet/mixins/ServerPlayerEntity_scarpetEventMixin.java +++ b/src/main/java/carpet/mixins/ServerPlayerEntity_scarpetEventMixin.java @@ -8,6 +8,7 @@ import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; import net.minecraft.stat.Stat; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; @@ -92,24 +93,24 @@ public abstract class ServerPlayerEntity_scarpetEventMixin extends PlayerEntity private RegistryKey previousDimension; @Inject(method = "changeDimension", at = @At("HEAD")) - private void logPreviousCoordinates(RegistryKey newDimension, CallbackInfoReturnable cir) + private void logPreviousCoordinates(ServerWorld serverWorld, CallbackInfoReturnable cir) { previousLocation = getPos(); previousDimension = world.getRegistryKey(); //dimension type } @Inject(method = "changeDimension", at = @At("RETURN")) - private void atChangeDimension(RegistryKey newDimension, CallbackInfoReturnable cir) + private void atChangeDimension(ServerWorld newWorld, CallbackInfoReturnable cir) { if (PLAYER_CHANGES_DIMENSION.isNeeded()) { ServerPlayerEntity player = (ServerPlayerEntity) (Object)this; Vec3d to = null; - if (!notInAnyWorld || previousDimension != World.END || newDimension != World.OVERWORLD) // end ow + if (!notInAnyWorld || previousDimension != World.END || newWorld.getRegistryKey() != World.OVERWORLD) // end ow { to = getPos(); } - PLAYER_CHANGES_DIMENSION.onDimensionChange(player, previousLocation, to, previousDimension, newDimension); + PLAYER_CHANGES_DIMENSION.onDimensionChange(player, previousLocation, to, previousDimension, newWorld.getRegistryKey()); } }