Few minor tweaks to WNA that don't modify behaviour but bring it more inline with how MC works

This commit is contained in:
Matthew Miller 2020-08-24 22:15:46 +10:00
parent 42eddd2d4e
commit 4123eddff1

View File

@ -59,8 +59,8 @@ default <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 position,
if (sideEffects.shouldApply(SideEffect.VALIDATION)) {
newState = getValidBlockForPosition(newState, pos);
}
NBS successState = setBlockState(chunk, pos, newState);
boolean successful = successState != null;
NBS lastValue = setBlockState(chunk, pos, newState);
boolean successful = lastValue != null;
// Create the TileEntity
if (successful || old == newState) {
@ -84,7 +84,7 @@ default <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 position,
if (sideEffects.getState(SideEffect.LIGHTING) == SideEffect.State.ON) {
updateLightingForBlock(pos);
}
markAndNotifyBlock(pos, chunk, old, newState, sideEffects);
markAndNotifyBlock(pos, chunk, lastValue, newState, sideEffects);
}
return successful;
@ -183,7 +183,7 @@ default void markAndNotifyBlock(NP pos, NC chunk, NBS oldState, NBS newState, Si
}
// Seems used only for PoI updates
onBlockStateChange(pos, oldState, newState);
onBlockStateChange(pos, oldState, blockState1);
}
}