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

@ -185,11 +185,10 @@ public class BukkitVersionHelperSpigot121 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.e()) { bld.setSolid(); }
if (bd.i()) { bld.setAir(); }
if (bd.a(TagsBlock.t)) { bld.setLog(); }
if (bd.a(TagsBlock.O)) { bld.setLeaves(); }
if (bd.a(TagsBlock.P)) { 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");