Update buildscript to Gradle 2.14 & Forge to 1.9.4 (1965)

This commit is contained in:
Kenzie Togami 2016-06-18 00:32:17 -07:00
parent f689d53d62
commit 5afd2bbbf3
7 changed files with 43 additions and 48 deletions

View File

@ -1,6 +1,6 @@
println """ println """
******************************************* *******************************************
You are building WorldEdit! You are building WorldEdit!
If you encounter trouble: If you encounter trouble:
1) Read COMPILING.md if you haven't yet 1) Read COMPILING.md if you haven't yet
@ -27,7 +27,7 @@ buildscript {
dependencies { dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' 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' classpath 'org.ajoberstar:gradle-git:1.4.2'
} }
} }
@ -50,12 +50,34 @@ if (!project.hasProperty("gitCommitHash")) {
ext.gitCommitHash = "no_git_id" 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 { subprojects {
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'maven' apply plugin: 'maven'
apply plugin: 'checkstyle' apply plugin: 'checkstyle'
apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.jfrog.artifactory-upload' apply plugin: 'com.jfrog.artifactory'
group = 'com.sk89q.worldedit' group = 'com.sk89q.worldedit'
version = '6.1.3-SNAPSHOT' version = '6.1.3-SNAPSHOT'
@ -117,26 +139,4 @@ subprojects {
exclude '.cache' exclude '.cache'
exclude 'LICENSE*' 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
}
}
}
} }

View File

@ -7,7 +7,7 @@ buildscript {
} }
dependencies { 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" //version = "6.1.2"
ext.forgeVersion = "12.16.1.1891" ext.forgeVersion = "12.17.0.1965"
//ext.internalVersion = version + ";" + gitCommitHash //ext.internalVersion = version + ";" + gitCommitHash
minecraft { minecraft {
version = "1.9-${project.forgeVersion}" version = "1.9.4-${project.forgeVersion}"
mappings = "snapshot_20160505" mappings = "snapshot_20160617"
runDir = 'run' runDir = 'run'
replaceIn "com/sk89q/worldedit/forge/ForgeWorldEdit.java" replaceIn "com/sk89q/worldedit/forge/ForgeWorldEdit.java"

View File

@ -23,10 +23,9 @@ import com.sk89q.worldedit.world.biome.BaseBiome;
import com.sk89q.worldedit.world.biome.BiomeData; import com.sk89q.worldedit.world.biome.BiomeData;
import com.sk89q.worldedit.world.registry.BiomeRegistry; import com.sk89q.worldedit.world.registry.BiomeRegistry;
import net.minecraft.world.biome.BiomeGenBase;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.world.biome.Biome;
/** /**
* Provides access to biome data in Forge. * Provides access to biome data in Forge.
@ -41,29 +40,29 @@ class ForgeBiomeRegistry implements BiomeRegistry {
@Override @Override
public List<BaseBiome> getBiomes() { public List<BaseBiome> getBiomes() {
List<BaseBiome> list = new ArrayList<BaseBiome>(); List<BaseBiome> list = new ArrayList<BaseBiome>();
for (BiomeGenBase biome : BiomeGenBase.REGISTRY) { for (Biome biome : Biome.REGISTRY) {
list.add(new BaseBiome(BiomeGenBase.getIdForBiome(biome))); list.add(new BaseBiome(Biome.getIdForBiome(biome)));
} }
return list; return list;
} }
@Override @Override
public BiomeData getData(BaseBiome biome) { public BiomeData getData(BaseBiome biome) {
return new ForgeBiomeData(BiomeGenBase.getBiome(biome.getId())); return new ForgeBiomeData(Biome.getBiome(biome.getId()));
} }
/** /**
* Cached biome data information. * Cached biome data information.
*/ */
private static class ForgeBiomeData implements BiomeData { private static class ForgeBiomeData implements BiomeData {
private final BiomeGenBase biome; private final Biome biome;
/** /**
* Create a new instance. * Create a new instance.
* *
* @param biome the base biome * @param biome the base biome
*/ */
private ForgeBiomeData(BiomeGenBase biome) { private ForgeBiomeData(Biome biome) {
this.biome = biome; this.biome = biome;
} }

View File

@ -119,7 +119,7 @@ public class ForgePlayer extends AbstractPlayerActor {
} }
PacketBuffer buffer = new PacketBuffer(Unpooled.copiedBuffer(send.getBytes(WECUIPacketHandler.UTF_8_CHARSET))); PacketBuffer buffer = new PacketBuffer(Unpooled.copiedBuffer(send.getBytes(WECUIPacketHandler.UTF_8_CHARSET)));
SPacketCustomPayload packet = new SPacketCustomPayload(ForgeWorldEdit.CUI_PLUGIN_CHANNEL, buffer); SPacketCustomPayload packet = new SPacketCustomPayload(ForgeWorldEdit.CUI_PLUGIN_CHANNEL, buffer);
this.player.playerNetServerHandler.sendPacket(packet); this.player.connection.sendPacket(packet);
} }
@Override @Override
@ -154,7 +154,7 @@ public class ForgePlayer extends AbstractPlayerActor {
@Override @Override
public void setPosition(Vector pos, float pitch, float yaw) { 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 @Override

View File

@ -59,9 +59,9 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; 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.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderServer; import net.minecraft.world.gen.ChunkProviderServer;
@ -205,7 +205,7 @@ public class ForgeWorld extends AbstractWorld {
@Override @Override
public BaseBiome getBiome(Vector2D position) { public BaseBiome getBiome(Vector2D position) {
checkNotNull(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 @Override
@ -260,7 +260,7 @@ public class ForgeWorld extends AbstractWorld {
} }
ChunkProviderServer chunkServer = (ChunkProviderServer) provider; ChunkProviderServer chunkServer = (ChunkProviderServer) provider;
for (Vector2D coord : chunks) { for (Vector2D coord : chunks) {
long pos = ChunkCoordIntPair.chunkXZ2Int(coord.getBlockX(), coord.getBlockZ()); long pos = ChunkPos.chunkXZ2Int(coord.getBlockX(), coord.getBlockZ());
Chunk mcChunk; Chunk mcChunk;
if (chunkServer.chunkExists(coord.getBlockX(), coord.getBlockZ())) { if (chunkServer.chunkExists(coord.getBlockX(), coord.getBlockZ())) {
mcChunk = chunkServer.loadChunk(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.droppedChunksSet.remove(pos);
chunkServer.id2ChunkMap.remove(pos); chunkServer.id2ChunkMap.remove(pos);
mcChunk = chunkServer.provideChunk(coord.getBlockX(), coord.getBlockZ()); mcChunk = chunkServer.provideChunk(coord.getBlockX(), coord.getBlockZ());
chunkServer.id2ChunkMap.add(pos, mcChunk); chunkServer.id2ChunkMap.put(pos, mcChunk);
chunkServer.loadedChunks.add(mcChunk);
if (mcChunk != null) { if (mcChunk != null) {
mcChunk.onChunkLoad(); mcChunk.onChunkLoad();
mcChunk.populateChunk(chunkServer, chunkServer.chunkGenerator); mcChunk.populateChunk(chunkServer, chunkServer.chunkGenerator);

View File

@ -96,7 +96,7 @@ final class TileEntityUtils {
static void setTileEntity(World world, Vector position, @Nullable NBTTagCompound tag) { static void setTileEntity(World world, Vector position, @Nullable NBTTagCompound tag) {
if (tag != null) { if (tag != null) {
updateForSet(tag, position); updateForSet(tag, position);
TileEntity tileEntity = TileEntity.createTileEntity(world.getMinecraftServer(), tag); TileEntity tileEntity = TileEntity.create(tag);
if (tileEntity != null) { if (tileEntity != null) {
world.setTileEntity(new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()), tileEntity); world.setTileEntity(new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()), tileEntity);
} }

View File

@ -1,4 +1 @@
public net.minecraft.world.gen.ChunkProviderServer field_73248_b # droppedChunksSet 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