Fix biome water coloring in 1.16.1

This commit is contained in:
Mike Primm 2020-06-27 11:47:45 -05:00
parent 17cbfb97ec
commit ea3cb28a90

View File

@ -28,6 +28,7 @@ import org.dynmap.utils.MapChunkCache;
import org.dynmap.utils.Polygon; import org.dynmap.utils.Polygon;
import net.minecraft.server.v1_16_R1.BiomeBase; import net.minecraft.server.v1_16_R1.BiomeBase;
import net.minecraft.server.v1_16_R1.BiomeFog;
import net.minecraft.server.v1_16_R1.Block; import net.minecraft.server.v1_16_R1.Block;
import net.minecraft.server.v1_16_R1.BlockFluids; import net.minecraft.server.v1_16_R1.BlockFluids;
import net.minecraft.server.v1_16_R1.BlockRotatable; import net.minecraft.server.v1_16_R1.BlockRotatable;
@ -42,8 +43,8 @@ public class BukkitVersionHelperSpigot116 extends BukkitVersionHelperGeneric {
private Field watercolorfield; private Field watercolorfield;
public BukkitVersionHelperSpigot116() { public BukkitVersionHelperSpigot116() {
Class biomebase = getNMSClass("net.minecraft.server.BiomeBase"); Class biomefog = getNMSClass("net.minecraft.server.BiomeFog");
watercolorfield = getPrivateField(biomebase, new String[] { "t" }, int.class); watercolorfield = getPrivateField(biomefog, new String[] { "c" }, int.class);
} }
/** /**
@ -151,7 +152,7 @@ public class BukkitVersionHelperSpigot116 extends BukkitVersionHelperGeneric {
@Override @Override
public int getBiomeBaseWaterMult(Object bb) { public int getBiomeBaseWaterMult(Object bb) {
try { try {
return (int) watercolorfield.get(bb); return (int) watercolorfield.get(((BiomeBase)bb).q());
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
} }