Spigot 1.21.3 Support: Fix block states

Leaves fix was applied to 1.21 as well. getMaterial() was removed in 1.20 so has been removed from that version onwards as well.
This commit is contained in:
jacob1 2024-11-09 22:17:04 -05:00
parent abf7332cb4
commit 6586f7b392
6 changed files with 8 additions and 13 deletions

View file

@ -171,12 +171,12 @@ public class BukkitVersionHelperSpigot121_3 extends BukkitVersionHelper {
//Log.info("statename=" + bname + "[" + sb + "], lightAtten=" + lightAtten);
// Fill in base attributes
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.y().c()) && ((bd.b() instanceof BlockFluids) == false)) { // Test if fluid type for block is not empty
if (bd.e()) { bld.setSolid(); } // isSolid
if (bd.l()) { bld.setAir(); } // isAir
if (bd.a(TagsBlock.t)) { bld.setLog(); } // is(OVERWORLD_NATURAL_LOGS)
if (bd.a(TagsBlock.Q)) { bld.setLeaves(); } // is(LEAVES)
// getFluidState.isEmpty(), getBlock
if (!bd.y().c() && ((bd.b() instanceof BlockFluids) == false)) { // Test if fluid type for block is not empty
bld.setWaterlogged();
//Log.info("statename=" + bname + "[" + sb + "] = waterlogged");
}