From 5afd2bbbf3e3c467bd2994c94ea40db205e394c8 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sat, 18 Jun 2016 00:32:17 -0700 Subject: [PATCH] Update buildscript to Gradle 2.14 & Forge to 1.9.4 (1965) --- build.gradle | 50 +++++++++---------- worldedit-forge/build.gradle | 8 +-- .../worldedit/forge/ForgeBiomeRegistry.java | 13 +++-- .../sk89q/worldedit/forge/ForgePlayer.java | 4 +- .../com/sk89q/worldedit/forge/ForgeWorld.java | 11 ++-- .../worldedit/forge/TileEntityUtils.java | 2 +- .../main/resources/META-INF/worldedit_at.cfg | 3 -- 7 files changed, 43 insertions(+), 48 deletions(-) diff --git a/build.gradle b/build.gradle index b526a2647..462e3eb4b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ println """ ******************************************* - You are building WorldEdit! + You are building WorldEdit! If you encounter trouble: 1) Read COMPILING.md if you haven't yet @@ -27,7 +27,7 @@ buildscript { dependencies { classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' - classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1' + classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0' classpath 'org.ajoberstar:gradle-git:1.4.2' } } @@ -50,12 +50,34 @@ if (!project.hasProperty("gitCommitHash")) { ext.gitCommitHash = "no_git_id" } +apply plugin: 'com.jfrog.artifactory' +artifactory { + contextUrl = "${artifactory_contextUrl}" + publish { + repository { + repoKey = project.version.contains("SNAPSHOT") ? 'libs-snapshot-local' : 'libs-release-local' + username = "${artifactory_user}" + password = "${artifactory_password}" + maven = true + } + } + + resolve { + repository { + repoKey = 'repo' + username = "${artifactory_user}" + password = "${artifactory_password}" + maven = true + } + } +} + subprojects { apply plugin: 'java' apply plugin: 'maven' apply plugin: 'checkstyle' apply plugin: 'com.github.johnrengelman.shadow' - apply plugin: 'com.jfrog.artifactory-upload' + apply plugin: 'com.jfrog.artifactory' group = 'com.sk89q.worldedit' version = '6.1.3-SNAPSHOT' @@ -117,26 +139,4 @@ subprojects { exclude '.cache' exclude 'LICENSE*' } - - artifactory { - contextUrl = "${artifactory_contextUrl}" - publish { - repository { - repoKey = project.version.contains("SNAPSHOT") ? 'libs-snapshot-local' : 'libs-release-local' - username = "${artifactory_user}" - password = "${artifactory_password}" - maven = true - - } - } - - resolve { - repository { - repoKey = 'repo' - username = "${artifactory_user}" - password = "${artifactory_password}" - maven = true - } - } - } } diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index eeee8ab31..88ea79405 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' } } @@ -27,12 +27,12 @@ repositories { } //version = "6.1.2" -ext.forgeVersion = "12.16.1.1891" +ext.forgeVersion = "12.17.0.1965" //ext.internalVersion = version + ";" + gitCommitHash minecraft { - version = "1.9-${project.forgeVersion}" - mappings = "snapshot_20160505" + version = "1.9.4-${project.forgeVersion}" + mappings = "snapshot_20160617" runDir = 'run' replaceIn "com/sk89q/worldedit/forge/ForgeWorldEdit.java" diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java index 6dd3d515d..e637138f9 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBiomeRegistry.java @@ -23,10 +23,9 @@ import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BiomeData; import com.sk89q.worldedit.world.registry.BiomeRegistry; -import net.minecraft.world.biome.BiomeGenBase; - import java.util.ArrayList; import java.util.List; +import net.minecraft.world.biome.Biome; /** * Provides access to biome data in Forge. @@ -41,29 +40,29 @@ class ForgeBiomeRegistry implements BiomeRegistry { @Override public List getBiomes() { List list = new ArrayList(); - for (BiomeGenBase biome : BiomeGenBase.REGISTRY) { - list.add(new BaseBiome(BiomeGenBase.getIdForBiome(biome))); + for (Biome biome : Biome.REGISTRY) { + list.add(new BaseBiome(Biome.getIdForBiome(biome))); } return list; } @Override public BiomeData getData(BaseBiome biome) { - return new ForgeBiomeData(BiomeGenBase.getBiome(biome.getId())); + return new ForgeBiomeData(Biome.getBiome(biome.getId())); } /** * Cached biome data information. */ private static class ForgeBiomeData implements BiomeData { - private final BiomeGenBase biome; + private final Biome biome; /** * Create a new instance. * * @param biome the base biome */ - private ForgeBiomeData(BiomeGenBase biome) { + private ForgeBiomeData(Biome biome) { this.biome = biome; } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java index d01c7f6e6..6a9027e69 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgePlayer.java @@ -119,7 +119,7 @@ public class ForgePlayer extends AbstractPlayerActor { } PacketBuffer buffer = new PacketBuffer(Unpooled.copiedBuffer(send.getBytes(WECUIPacketHandler.UTF_8_CHARSET))); SPacketCustomPayload packet = new SPacketCustomPayload(ForgeWorldEdit.CUI_PLUGIN_CHANNEL, buffer); - this.player.playerNetServerHandler.sendPacket(packet); + this.player.connection.sendPacket(packet); } @Override @@ -154,7 +154,7 @@ public class ForgePlayer extends AbstractPlayerActor { @Override public void setPosition(Vector pos, float pitch, float yaw) { - this.player.playerNetServerHandler.setPlayerLocation(pos.getX(), pos.getY(), pos.getZ(), yaw, pitch); + this.player.connection.setPlayerLocation(pos.getX(), pos.getY(), pos.getZ(), yaw, pitch); } @Override diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index 73db996d1..30cd3793e 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -59,9 +59,9 @@ import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.util.math.ChunkPos; import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.ChunkProviderServer; @@ -205,7 +205,7 @@ public class ForgeWorld extends AbstractWorld { @Override public BaseBiome getBiome(Vector2D position) { checkNotNull(position); - return new BaseBiome(BiomeGenBase.getIdForBiome(getWorld().getBiomeGenForCoords(new BlockPos(position.getBlockX(), 0, position.getBlockZ())))); + return new BaseBiome(Biome.getIdForBiome(getWorld().getBiomeForCoordsBody(new BlockPos(position.getBlockX(), 0, position.getBlockZ())))); } @Override @@ -260,7 +260,7 @@ public class ForgeWorld extends AbstractWorld { } ChunkProviderServer chunkServer = (ChunkProviderServer) provider; for (Vector2D coord : chunks) { - long pos = ChunkCoordIntPair.chunkXZ2Int(coord.getBlockX(), coord.getBlockZ()); + long pos = ChunkPos.chunkXZ2Int(coord.getBlockX(), coord.getBlockZ()); Chunk mcChunk; if (chunkServer.chunkExists(coord.getBlockX(), coord.getBlockZ())) { mcChunk = chunkServer.loadChunk(coord.getBlockX(), coord.getBlockZ()); @@ -269,8 +269,7 @@ public class ForgeWorld extends AbstractWorld { chunkServer.droppedChunksSet.remove(pos); chunkServer.id2ChunkMap.remove(pos); mcChunk = chunkServer.provideChunk(coord.getBlockX(), coord.getBlockZ()); - chunkServer.id2ChunkMap.add(pos, mcChunk); - chunkServer.loadedChunks.add(mcChunk); + chunkServer.id2ChunkMap.put(pos, mcChunk); if (mcChunk != null) { mcChunk.onChunkLoad(); mcChunk.populateChunk(chunkServer, chunkServer.chunkGenerator); diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java index 0ac31b951..074b42b96 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java @@ -96,7 +96,7 @@ final class TileEntityUtils { static void setTileEntity(World world, Vector position, @Nullable NBTTagCompound tag) { if (tag != null) { updateForSet(tag, position); - TileEntity tileEntity = TileEntity.createTileEntity(world.getMinecraftServer(), tag); + TileEntity tileEntity = TileEntity.create(tag); if (tileEntity != null) { world.setTileEntity(new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()), tileEntity); } diff --git a/worldedit-forge/src/main/resources/META-INF/worldedit_at.cfg b/worldedit-forge/src/main/resources/META-INF/worldedit_at.cfg index a15c42170..837da7c36 100644 --- a/worldedit-forge/src/main/resources/META-INF/worldedit_at.cfg +++ b/worldedit-forge/src/main/resources/META-INF/worldedit_at.cfg @@ -1,4 +1 @@ public net.minecraft.world.gen.ChunkProviderServer field_73248_b # droppedChunksSet -public net.minecraft.world.gen.ChunkProviderServer field_73244_f # id2ChunkMap -public net.minecraft.world.gen.ChunkProviderServer field_73245_g # loadedChunks -public net.minecraft.world.gen.ChunkProviderServer field_186029_c # chunkGenerator