Arclight
Arclight copied to clipboard
fix(core): prevent firing the event if the to block is < 0
Fixes https://github.com/IzzelAliz/Arclight/issues/627 (tested by @nicholasrobertm and confirmed to work)
I have a slight feeling this would conflict with mods like Twilight Forest that do work below 0.
This should not be the proper fix. I would prefer just wrap the notifyBlockUpdate call in CraftBlockState:
public boolean update(boolean force, boolean applyPhysics) {
if (!this.isPlaced()) {
return true;
} else {
CraftBlock block = this.getBlock();
if (block.getType() != this.getType() && !force) {
return false;
} else {
net.minecraft.block.BlockState newBlock = this.data;
if (block.setTypeAndData(newBlock, applyPhysics)) // wrap with if
this.world.getHandle().notifyBlockUpdate(this.position, block.getNMS(), newBlock, 3);
return true;
}
}
}
Please test if it's working.
Please test if it's working.
Works fine, tysm!