Skip to content

Commit

Permalink
Upgrade to 1.13.2
Browse files Browse the repository at this point in the history
  • Loading branch information
irtimaled committed Nov 21, 2019
1 parent 8b82c83 commit 2c5510e
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion src/main/java/com/irtimaled/bbor/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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@");

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/irtimaled/bbor/client/PlayerCoords.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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<WorldServer> worlds) {
for (WorldServer world : worlds) {
loadWorld(world);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ServerPlayer {
private final Consumer<Packet<?>> packetConsumer;

public ServerPlayer(EntityPlayerMP player) {
this.dimensionId = player.dimension;
this.dimensionId = player.dimension.getId();
this.packetConsumer = player.connection::sendPacket;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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;
import org.spongepowered.asm.mixin.injection.At;
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<DimensionType, WorldServer> 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"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/irtimaled/bbor/server/ServerRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ServerRunner {
private static final ThrowableConsumer<URL> 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
Expand Down

0 comments on commit 2c5510e

Please sign in to comment.