From 2c5510ede73b569611a3c9de4d7f60934267ab74 Mon Sep 17 00:00:00 2001 From: Irtimaled Date: Wed, 20 Nov 2019 20:52:47 -0800 Subject: [PATCH] Upgrade to 1.13.2 --- build.gradle | 2 +- gradle.properties | 2 +- src/main/java/com/irtimaled/bbor/Main.java | 1 - .../java/com/irtimaled/bbor/client/PlayerCoords.java | 2 +- .../com/irtimaled/bbor/client/gui/SettingsScreen.java | 2 +- .../irtimaled/bbor/client/interop/BiomeBorderHelper.java | 3 ++- .../com/irtimaled/bbor/client/interop/ClientInterop.java | 2 +- .../bbor/client/interop/SpawningSphereHelper.java | 2 +- .../com/irtimaled/bbor/common/interop/CommonInterop.java | 3 ++- .../com/irtimaled/bbor/common/models/ServerPlayer.java | 2 +- .../bbor/mixin/client/renderer/MixinEntityRenderer.java | 4 ++-- .../bbor/mixin/server/MixinMinecraftServer.java | 9 +++++++-- .../java/com/irtimaled/bbor/server/ServerRunner.java | 2 +- 13 files changed, 21 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index c84131da..55fa7ef4 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ dependencies { minecraft { version = project.mcVersion - mappings = 'snapshot_20180908' + mappings = 'snapshot_20190227' runDir = 'run' tweakClass = 'com.irtimaled.bbor.launch.ClientTweaker' makeObfSourceJar = false diff --git a/gradle.properties b/gradle.properties index 1e16e9f1..d279fba8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ name=bbor buildVersion=1.0.14 # leave a space to reduce merge conflicts on version change -mcVersion=1.13 +mcVersion=1.13.2 diff --git a/src/main/java/com/irtimaled/bbor/Main.java b/src/main/java/com/irtimaled/bbor/Main.java index 0449b17a..4d706b6c 100644 --- a/src/main/java/com/irtimaled/bbor/Main.java +++ b/src/main/java/com/irtimaled/bbor/Main.java @@ -12,7 +12,6 @@ public static void main(String... args) throws IOException { ServerRunner.run("@MC_VERSION@", Arrays.asList(args).subList(1, args.length)); } else { Installer.install("@VERSION@", "@MC_VERSION@"); - } } } diff --git a/src/main/java/com/irtimaled/bbor/client/PlayerCoords.java b/src/main/java/com/irtimaled/bbor/client/PlayerCoords.java index d7e7455d..8075dcb7 100644 --- a/src/main/java/com/irtimaled/bbor/client/PlayerCoords.java +++ b/src/main/java/com/irtimaled/bbor/client/PlayerCoords.java @@ -14,7 +14,7 @@ public static void setPlayerPosition(double partialTicks, EntityPlayer entityPla x = entityPlayer.lastTickPosX + (entityPlayer.posX - entityPlayer.lastTickPosX) * partialTicks; y = entityPlayer.lastTickPosY + (entityPlayer.posY - entityPlayer.lastTickPosY) * partialTicks; z = entityPlayer.lastTickPosZ + (entityPlayer.posZ - entityPlayer.lastTickPosZ) * partialTicks; - dimensionId = entityPlayer.dimension; + dimensionId = entityPlayer.dimension.getId(); } static void setActiveY() { diff --git a/src/main/java/com/irtimaled/bbor/client/gui/SettingsScreen.java b/src/main/java/com/irtimaled/bbor/client/gui/SettingsScreen.java index 2626b016..f2af58f5 100644 --- a/src/main/java/com/irtimaled/bbor/client/gui/SettingsScreen.java +++ b/src/main/java/com/irtimaled/bbor/client/gui/SettingsScreen.java @@ -39,7 +39,7 @@ private int getY(double row) { private void addControl(IRenderableControl control) { this.controls.add(control); - TypeHelper.doIfType(control, IGuiEventListener.class, this.eventListeners::add); + TypeHelper.doIfType(control, IGuiEventListener.class, this.children::add); } private void addTabs(String... labels) { diff --git a/src/main/java/com/irtimaled/bbor/client/interop/BiomeBorderHelper.java b/src/main/java/com/irtimaled/bbor/client/interop/BiomeBorderHelper.java index fbc24423..07cf63e1 100644 --- a/src/main/java/com/irtimaled/bbor/client/interop/BiomeBorderHelper.java +++ b/src/main/java/com/irtimaled/bbor/client/interop/BiomeBorderHelper.java @@ -3,6 +3,7 @@ import com.irtimaled.bbor.common.models.Coords; import net.minecraft.client.Minecraft; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.registry.IRegistry; import net.minecraft.world.biome.Biome; public class BiomeBorderHelper { @@ -13,6 +14,6 @@ public static int getBiomeId(Coords coords) { public static int getBiomeId(int x, int y, int z) { BlockPos pos = new BlockPos(x, y, z); Biome biome = Minecraft.getInstance().world.getBiome(pos); - return Biome.getIdForBiome(biome); + return IRegistry.BIOME.getId(biome); } } diff --git a/src/main/java/com/irtimaled/bbor/client/interop/ClientInterop.java b/src/main/java/com/irtimaled/bbor/client/interop/ClientInterop.java index ddcf85ef..b313e2db 100644 --- a/src/main/java/com/irtimaled/bbor/client/interop/ClientInterop.java +++ b/src/main/java/com/irtimaled/bbor/client/interop/ClientInterop.java @@ -29,7 +29,7 @@ public static void disconnectedFromRemoteServer() { public static void render(float partialTicks, EntityPlayerSP player) { PlayerCoords.setPlayerPosition(partialTicks, player); - EventBus.publish(new Render(player.dimension)); + EventBus.publish(new Render(player.dimension.getId())); } public static boolean interceptChatMessage(String message) { diff --git a/src/main/java/com/irtimaled/bbor/client/interop/SpawningSphereHelper.java b/src/main/java/com/irtimaled/bbor/client/interop/SpawningSphereHelper.java index fd8653a2..c3116ce7 100644 --- a/src/main/java/com/irtimaled/bbor/client/interop/SpawningSphereHelper.java +++ b/src/main/java/com/irtimaled/bbor/client/interop/SpawningSphereHelper.java @@ -60,7 +60,7 @@ private static boolean isSpawnable(int x, int y, int z) { BlockPos pos = new BlockPos(x, y, z); Biome biome = world.getBiome(pos); return biome.getSpawningChance() > 0 && - !biome.getSpawnableList(EnumCreatureType.MONSTER).isEmpty() && + !biome.getSpawns(EnumCreatureType.MONSTER).isEmpty() && isSpawnable(pos, world); } diff --git a/src/main/java/com/irtimaled/bbor/common/interop/CommonInterop.java b/src/main/java/com/irtimaled/bbor/common/interop/CommonInterop.java index ed16c7c5..f0a82190 100644 --- a/src/main/java/com/irtimaled/bbor/common/interop/CommonInterop.java +++ b/src/main/java/com/irtimaled/bbor/common/interop/CommonInterop.java @@ -16,6 +16,7 @@ import net.minecraft.world.chunk.Chunk; import java.io.File; +import java.util.Collection; public class CommonInterop { public static void init() { @@ -26,7 +27,7 @@ public static void chunkLoaded(Chunk chunk) { EventBus.publish(new ChunkLoaded(chunk)); } - public static void loadWorlds(WorldServer[] worlds) { + public static void loadWorlds(Collection worlds) { for (WorldServer world : worlds) { loadWorld(world); } diff --git a/src/main/java/com/irtimaled/bbor/common/models/ServerPlayer.java b/src/main/java/com/irtimaled/bbor/common/models/ServerPlayer.java index d4c5eba8..1496b16a 100644 --- a/src/main/java/com/irtimaled/bbor/common/models/ServerPlayer.java +++ b/src/main/java/com/irtimaled/bbor/common/models/ServerPlayer.java @@ -11,7 +11,7 @@ public class ServerPlayer { private final Consumer> packetConsumer; public ServerPlayer(EntityPlayerMP player) { - this.dimensionId = player.dimension; + this.dimensionId = player.dimension.getId(); this.packetConsumer = player.connection::sendPacket; } diff --git a/src/main/java/com/irtimaled/bbor/mixin/client/renderer/MixinEntityRenderer.java b/src/main/java/com/irtimaled/bbor/mixin/client/renderer/MixinEntityRenderer.java index 44f66c11..ac93d665 100644 --- a/src/main/java/com/irtimaled/bbor/mixin/client/renderer/MixinEntityRenderer.java +++ b/src/main/java/com/irtimaled/bbor/mixin/client/renderer/MixinEntityRenderer.java @@ -2,7 +2,7 @@ import com.irtimaled.bbor.client.interop.ClientInterop; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.GameRenderer; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -@Mixin(EntityRenderer.class) +@Mixin(GameRenderer.class) public class MixinEntityRenderer { @Shadow @Final diff --git a/src/main/java/com/irtimaled/bbor/mixin/server/MixinMinecraftServer.java b/src/main/java/com/irtimaled/bbor/mixin/server/MixinMinecraftServer.java index 6c2a90d7..21a1b4ae 100644 --- a/src/main/java/com/irtimaled/bbor/mixin/server/MixinMinecraftServer.java +++ b/src/main/java/com/irtimaled/bbor/mixin/server/MixinMinecraftServer.java @@ -3,20 +3,25 @@ import com.irtimaled.bbor.common.interop.CommonInterop; import net.minecraft.server.MinecraftServer; import net.minecraft.world.WorldServer; +import net.minecraft.world.dimension.DimensionType; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import java.util.Map; + @Mixin(MinecraftServer.class) public class MixinMinecraftServer { @Shadow - public WorldServer[] worlds; + @Final + private Map worlds; @Inject(method = "initialWorldChunkLoad", at = @At("HEAD")) private void initialWorldChunkLoad(CallbackInfo ci) { - CommonInterop.loadWorlds(worlds); + CommonInterop.loadWorlds(worlds.values()); } @Inject(method = "tick", at = @At("RETURN")) diff --git a/src/main/java/com/irtimaled/bbor/server/ServerRunner.java b/src/main/java/com/irtimaled/bbor/server/ServerRunner.java index d92819a4..4ae6f48a 100644 --- a/src/main/java/com/irtimaled/bbor/server/ServerRunner.java +++ b/src/main/java/com/irtimaled/bbor/server/ServerRunner.java @@ -29,7 +29,7 @@ public class ServerRunner { private static final ThrowableConsumer addURL; static { - VANILLA_SERVER_JARS.put("1.13", "https://launcher.mojang.com/v1/objects/d0caafb8438ebd206f99930cfaecfa6c9a13dca0/server.jar"); + VANILLA_SERVER_JARS.put("1.13.2", "https://launcher.mojang.com/v1/objects/3737db93722a9e39eeada7c27e7aca28b144ffa7/server.jar"); try { Method method = URLClassLoader.class