fix rotation not calling onDirectionChanged (#2718)

* fix rotation not calling onDirectionChanged

* changelog
This commit is contained in:
Darkere
2020-10-24 14:35:33 +02:00
committed by GitHub
parent 9d48419403
commit 951acf1c99
2 changed files with 7 additions and 0 deletions

View File

@@ -12,6 +12,12 @@ public class ColoredNetworkBlock extends NetworkNodeBlock {
@Override
public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) {
if (state.getBlock().getClass().equals(newState.getBlock().getClass())) {
//From BaseBlock#onReplaced as this gets skipped otherwise
if (getDirection() != BlockDirection.NONE &&
state.getBlock() == newState.getBlock() &&
state.get(getDirection().getProperty()) != newState.get(getDirection().getProperty())) {
onDirectionChanged(world, pos, newState.get(getDirection().getProperty()));
}
return;
}