From 60c9d8b66c65dfb79603e066ceb198daa9b30828 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sat, 27 Apr 2019 15:58:07 -0500 Subject: [PATCH] Update forge 1.13.2 version --- forge-1.13.2/build.gradle | 8 ++------ .../org/dynmap/forge_1_13_2/ChunkSnapshot.java | 14 +++++++------- .../java/org/dynmap/forge_1_13_2/DynmapPlugin.java | 4 ++-- .../dynmap/forge_1_13_2/ForgeMapChunkCache.java | 6 +++--- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/forge-1.13.2/build.gradle b/forge-1.13.2/build.gradle index 461a03bf..026cac9d 100644 --- a/forge-1.13.2/build.gradle +++ b/forge-1.13.2/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'eclipse' dependencies { compile project(":DynmapCore") compile project(":DynmapCoreAPI") - minecraft 'net.minecraftforge:forge:1.13.2-25.0.74' + minecraft 'net.minecraftforge:forge:1.13.2-25.0.191' } sourceCompatibility = 1.8 @@ -33,16 +33,12 @@ repositories { } minecraft { - mappings channel: 'snapshot', version: '20180921-1.13' - + mappings channel: 'snapshot', version: '20190415-1.13.2' runs { server { workingDirectory project.file('run').canonicalPath } } - replaceIn "Version.java" - replace "@VERSION@", project.version + '-' + project.ext.buildNumber - replace "@BUILD_NUMBER@", project.ext.buildNumber } project.archivesBaseName = "${project.archivesBaseName}-forge-1.13.2" diff --git a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ChunkSnapshot.java b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ChunkSnapshot.java index d42b4264..b7b2fb94 100644 --- a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ChunkSnapshot.java +++ b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ChunkSnapshot.java @@ -124,7 +124,7 @@ public class ChunkSnapshot this.captureFulltime = 0; this.hmap = nbt.getIntArray("HeightMap"); this.sectionCnt = worldheight / 16; - if (nbt.hasKey("InhabitedTime")) { + if (nbt.contains("InhabitedTime")) { this.inhabitedTicks = nbt.getLong("InhabitedTime"); } else { @@ -150,7 +150,7 @@ public class ChunkSnapshot this.section[secnum] = cursect; DynmapBlockState[] states = cursect.states; // JEI format - if (sec.hasKey("Palette")) { + if (sec.contains("Palette")) { int[] p = sec.getIntArray("Palette"); // Palette is list of state values, where Blocks=bit 11-4 of index, Data=bit 3-0 byte[] msb_bytes = sec.getByteArray("Blocks"); @@ -179,7 +179,7 @@ public class ChunkSnapshot } // Get any additional ID data byte[] addid = null; - if (sec.hasKey("Add")) { /* If additional data, add it */ + if (sec.contains("Add")) { /* If additional data, add it */ addid = sec.getByteArray("Add"); if (addid.length < (BLOCKS_PER_SECTION / 2)) { addid = Arrays.copyOf(addid, (BLOCKS_PER_SECTION / 2)); @@ -187,7 +187,7 @@ public class ChunkSnapshot } // Check for NEID additional additional ID data byte[] addid2 = null; - if (sec.hasKey("Add2")) { /* If additional data (NEID), add it */ + if (sec.contains("Add2")) { /* If additional data (NEID), add it */ addid2 = sec.getByteArray("Add2"); if (addid2.length < (BLOCKS_PER_SECTION / 2)) { addid2 = Arrays.copyOf(addid2, (BLOCKS_PER_SECTION / 2)); @@ -195,7 +195,7 @@ public class ChunkSnapshot } // Get meta nibble data byte[] bd = null; - if (sec.hasKey("Data")) { + if (sec.contains("Data")) { bd = sec.getByteArray("Data"); if (bd.length < (BLOCKS_PER_SECTION / 2)) { bd = Arrays.copyOf(bd, (BLOCKS_PER_SECTION / 2)); @@ -230,13 +230,13 @@ public class ChunkSnapshot } } cursect.emitlight = sec.getByteArray("BlockLight"); - if (sec.hasKey("SkyLight")) { + if (sec.contains("SkyLight")) { cursect.skylight = sec.getByteArray("SkyLight"); } } /* Get biome data */ this.biome = new int[COLUMNS_PER_CHUNK]; - if (nbt.hasKey("Biomes")) { + if (nbt.contains("Biomes")) { byte[] b = nbt.getByteArray("Biomes"); if (b != null) { for (int i = 0; i < b.length; i++) { diff --git a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapPlugin.java b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapPlugin.java index 740739a2..b08d367d 100644 --- a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapPlugin.java +++ b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapPlugin.java @@ -1452,8 +1452,8 @@ public class DynmapPlugin loadWorlds(); /* Initialized the currently loaded worlds */ - if(server.func_212370_w() != null) { - for (WorldServer world : server.func_212370_w()) { + if(server.getWorlds() != null) { + for (WorldServer world : server.getWorlds()) { ForgeWorld w = this.getWorld(world); /*NOTYET - need rest of forge if(DimensionManager.getWorld(world.provider.getDimensionId()) == null) { // If not loaded diff --git a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ForgeMapChunkCache.java b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ForgeMapChunkCache.java index 3d64c4b9..a64fe0f0 100644 --- a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ForgeMapChunkCache.java +++ b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/ForgeMapChunkCache.java @@ -1163,7 +1163,7 @@ public class ForgeMapChunkCache extends MapChunkCache HashMap vmap = new HashMap(); for (Object t : tc.keySet()) { String st = (String) t; - INBTBase tg = tc.getTag(st); + INBTBase tg = tc.get(st); vmap.put(st, getNBTValue(tg)); } val = vmap; @@ -1257,7 +1257,7 @@ public class ForgeMapChunkCache extends MapChunkCache if(te_fields != null) { vals.clear(); for(String id: te_fields) { - INBTBase v = tc.getTag(id); /* Get field */ + INBTBase v = tc.get(id); /* Get field */ if(v != null) { Object val = getNBTValue(v); if(val != null) { @@ -1312,7 +1312,7 @@ public class ForgeMapChunkCache extends MapChunkCache if (vis) { // If visible NBTTagCompound nbt = new NBTTagCompound(); try { - writechunktonbt.invoke(cps.chunkLoader, cps.provideChunk(chunk.x, chunk.z, false, false), w, nbt); + writechunktonbt.invoke(cps.chunkLoader, cps.getChunk(chunk.x, chunk.z, false, false), w, nbt); } catch (IllegalAccessException e) { } catch (IllegalArgumentException e) { } catch (InvocationTargetException e) {