diff --git a/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/BukkitVersionHelperSpigot120.java b/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/BukkitVersionHelperSpigot120.java index 5c082cd1..b8b33635 100644 --- a/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/BukkitVersionHelperSpigot120.java +++ b/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/BukkitVersionHelperSpigot120.java @@ -43,6 +43,7 @@ import net.minecraft.nbt.NBTTagString; import net.minecraft.resources.MinecraftKey; import net.minecraft.nbt.NBTBase; import net.minecraft.server.MinecraftServer; +import net.minecraft.tags.TagsBlock; import net.minecraft.world.level.BlockAccessAir; import net.minecraft.world.level.biome.BiomeBase; import net.minecraft.world.level.block.Block; @@ -189,13 +190,15 @@ public class BukkitVersionHelperSpigot120 extends BukkitVersionHelper { int lightAtten = b.g(bd, BlockAccessAir.a, BlockPosition.b); // getLightBlock //Log.info("statename=" + bname + "[" + sb + "], lightAtten=" + lightAtten); // Fill in base attributes - bld.setBaseState(lastbs).setStateIndex(idx).setBlockName(bname).setStateName(sb).setMaterial(mat.toString()).setAttenuatesLight(lightAtten); - if (mat.b()) { bld.setSolid(); } - if (b instanceof BlockAir) { bld.setAir(); } - if (b instanceof BlockRotatable) { bld.setLog(); } - if (b instanceof BlockLeaves) { bld.setLeaves(); } - if ((!bd.r().c()) && ((bd.b() instanceof BlockFluids) == false)) { // Test if fluid type for block is not empty + bld.setBaseState(lastbs).setStateIndex(idx).setBlockName(bname).setStateName(sb).setAttenuatesLight(lightAtten); + if (bd.w() != null) { bld.setMaterial(bd.w().toString()); } + if (bd.e()) { bld.setSolid(); } + if (bd.i()) { bld.setAir(); } + if (bd.a(TagsBlock.t)) { bld.setLog(); } + if (bd.a(TagsBlock.O)) { bld.setLeaves(); } + if ((!bd.u().c()) && ((bd.b() instanceof BlockFluids) == false)) { // Test if fluid type for block is not empty bld.setWaterlogged(); + //Log.info("statename=" + bname + "[" + sb + "] = waterlogged"); } DynmapBlockState dbs = bld.build(); // Build state @@ -338,12 +341,12 @@ public class BukkitVersionHelperSpigot120 extends BukkitVersionHelper { @Override public long getInhabitedTicks(Chunk c) { - return ((CraftChunk)c).getHandle(ChunkStatus.o).u(); + return ((CraftChunk)c).getHandle(ChunkStatus.n).u(); } @Override public Map getTileEntitiesForChunk(Chunk c) { - return ((CraftChunk)c).getHandle(ChunkStatus.o).i; + return ((CraftChunk)c).getHandle(ChunkStatus.n).k; } @Override @@ -398,7 +401,7 @@ public class BukkitVersionHelperSpigot120 extends BukkitVersionHelper { return ((NBTTagByteArray)val).d(); } else if(val instanceof NBTTagString) { - return ((NBTTagString)val).f_(); + return ((NBTTagString)val).m_(); } else if(val instanceof NBTTagIntArray) { return ((NBTTagIntArray)val).f(); diff --git a/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/MapChunkCache119_4.java b/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/MapChunkCache119_4.java index ce863234..8b654825 100644 --- a/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/MapChunkCache119_4.java +++ b/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/MapChunkCache119_4.java @@ -3,7 +3,7 @@ package org.dynmap.bukkit.helper.v120; import net.minecraft.world.level.biome.BiomeBase; import net.minecraft.world.level.biome.BiomeFog; import org.bukkit.World; -import org.bukkit.craftbukkit.v1_19_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_20_R1.CraftWorld; import org.dynmap.DynmapChunk; import org.dynmap.bukkit.helper.BukkitVersionHelper; import org.dynmap.bukkit.helper.BukkitWorld; @@ -53,7 +53,7 @@ public class MapChunkCache119_4 extends GenericMapChunkCache { CraftWorld cw = (CraftWorld) w; if (!cw.isChunkLoaded(chunk.x, chunk.z)) return null; Chunk c = cw.getHandle().getChunkIfLoaded(chunk.x, chunk.z); - if (c == null || !c.o) return null; // c.loaded + if (c == null || !c.q) return null; // c.loaded NBTTagCompound nbt = ChunkRegionLoader.a(cw.getHandle(), c); return nbt != null ? parseChunkFromNBT(new NBT.NBTCompound(nbt)) : null; } @@ -85,7 +85,7 @@ public class MapChunkCache119_4 extends GenericMapChunkCache { ChunkCoordIntPair cc = new ChunkCoordIntPair(chunk.x, chunk.z); GenericChunk gc = null; try { // BUGBUG - convert this all to asyn properly, since now native async - nbt = cw.getHandle().k().a.f(cc).join().get(); // playerChunkMap + nbt = cw.getHandle().k().a.e(cc).join().get(); // playerChunkMap } catch (CancellationException cx) { } catch (NoSuchElementException snex) { } diff --git a/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/NBT.java b/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/NBT.java index c914e59e..97de3da8 100644 --- a/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/NBT.java +++ b/bukkit-helper-120/src/main/java/org/dynmap/bukkit/helper/v120/NBT.java @@ -82,7 +82,7 @@ public class NBT { } @Override public String getAsString(String s) { - return obj.c(s).f_(); + return obj.c(s).m_(); } @Override public GenericBitStorage makeBitStorage(int bits, int count, long[] data) { diff --git a/forge-1.20/build.gradle b/forge-1.20/build.gradle index 3df760d4..ab9e6331 100644 --- a/forge-1.20/build.gradle +++ b/forge-1.20/build.gradle @@ -34,7 +34,7 @@ minecraft { } } -project.archivesBaseName = "${project.archivesBaseName}-forge-1.19.3" +project.archivesBaseName = "${project.archivesBaseName}-forge-1.20" dependencies { implementation project(path: ":DynmapCore", configuration: "shadow") diff --git a/settings.gradle b/settings.gradle index 1c64e246..a5747342 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,7 +22,7 @@ include ':bukkit-helper-118-2' include ':bukkit-helper-119' include ':bukkit-helper-119-3' include ':bukkit-helper-119-4' -//include ':bukkit-helper-120' +include ':bukkit-helper-120' include ':bukkit-helper' include ':dynmap-api' include ':DynmapCore' @@ -61,7 +61,7 @@ project(':bukkit-helper-118-2').projectDir = "$rootDir/bukkit-helper-118-2" as F project(':bukkit-helper-119').projectDir = "$rootDir/bukkit-helper-119" as File project(':bukkit-helper-119-3').projectDir = "$rootDir/bukkit-helper-119-3" as File project(':bukkit-helper-119-4').projectDir = "$rootDir/bukkit-helper-119-4" as File -//project(':bukkit-helper-120').projectDir = "$rootDir/bukkit-helper-120" as File +project(':bukkit-helper-120').projectDir = "$rootDir/bukkit-helper-120" as File project(':bukkit-helper').projectDir = "$rootDir/bukkit-helper" as File project(':dynmap-api').projectDir = "$rootDir/dynmap-api" as File project(':DynmapCore').projectDir = "$rootDir/DynmapCore" as File diff --git a/spigot/build.gradle b/spigot/build.gradle index 1eda1f14..024067a0 100644 --- a/spigot/build.gradle +++ b/spigot/build.gradle @@ -72,6 +72,9 @@ dependencies { implementation(project(':bukkit-helper-119-4')) { transitive = false } + implementation(project(':bukkit-helper-120')) { + transitive = false + } } processResources { @@ -108,6 +111,7 @@ shadowJar { include(dependency(':bukkit-helper-119')) include(dependency(':bukkit-helper-119-3')) include(dependency(':bukkit-helper-119-4')) + include(dependency(':bukkit-helper-120')) } relocate('org.bstats', 'org.dynmap.bstats') destinationDir = file '../target' diff --git a/spigot/src/main/java/org/dynmap/bukkit/Helper.java b/spigot/src/main/java/org/dynmap/bukkit/Helper.java index fdbe83f0..c38868df 100644 --- a/spigot/src/main/java/org/dynmap/bukkit/Helper.java +++ b/spigot/src/main/java/org/dynmap/bukkit/Helper.java @@ -18,6 +18,7 @@ import org.dynmap.bukkit.helper.v118_2.BukkitVersionHelperSpigot118_2; import org.dynmap.bukkit.helper.v119.BukkitVersionHelperSpigot119; import org.dynmap.bukkit.helper.v119_3.BukkitVersionHelperSpigot119_3; import org.dynmap.bukkit.helper.v119_4.BukkitVersionHelperSpigot119_4; +import org.dynmap.bukkit.helper.v120.BukkitVersionHelperSpigot120; public class Helper { @@ -43,6 +44,9 @@ public class Helper { Log.info("Loading Glowstone support"); BukkitVersionHelper.helper = new BukkitVersionHelperGlowstone(); } + else if (v.contains("(MC: 1.20")) { + BukkitVersionHelper.helper = new BukkitVersionHelperSpigot120(); + } else if (v.contains("(MC: 1.19)") || v.contains("(MC: 1.19.1)") || v.contains("(MC: 1.19.2)")) { BukkitVersionHelper.helper = new BukkitVersionHelperSpigot119(); }