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

@@ -3,6 +3,7 @@
### 1.9.8 ### 1.9.8
- Fixed server crash when scrolling in Grid (Darkere) - Fixed server crash when scrolling in Grid (Darkere)
- Fixed various issues with Grid interactions working without power (Darkere) - Fixed various issues with Grid interactions working without power (Darkere)
- Fixed rotation not updating blocks (Darkere)
- Added a JEI synchronized (two-way) search box mode to the Grid (ScoreUnder) - Added a JEI synchronized (two-way) search box mode to the Grid (ScoreUnder)
- Added a nag message when a player joins the world that asks the player to enable the experimental Forge lighting - Added a nag message when a player joins the world that asks the player to enable the experimental Forge lighting
pipeline to ensure correct rendering (raoulvdberge) pipeline to ensure correct rendering (raoulvdberge)

View File

@@ -12,6 +12,12 @@ public class ColoredNetworkBlock extends NetworkNodeBlock {
@Override @Override
public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) { public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) {
if (state.getBlock().getClass().equals(newState.getBlock().getClass())) { 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; return;
} }