Fix SkyStone placement not immediately updating the compass.

This commit is contained in:
Sebastian Hartte
2020-08-03 13:05:05 +02:00
parent 469a1e205b
commit ba85da2c72
@@ -18,10 +18,13 @@
package appeng.decorative.solid;
import javax.annotation.Nullable;
import net.minecraft.block.BlockState;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import net.minecraft.world.WorldAccess;
@@ -67,6 +70,17 @@ public class SkyStoneBlock extends AEBaseBlock {
return super.getStateForNeighborUpdate(stateIn, facing, facingState, worldIn, currentPos, facingPos);
}
@Override
public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer,
ItemStack itemStack) {
super.onPlaced(world, pos, state, placer, itemStack);
if (world instanceof ServerWorld) {
ServerWorld serverWorld = (ServerWorld) world;
WorldData.instance().compassData().service().notifyBlockChange(serverWorld, pos);
}
}
@Override
public void onStateReplaced(BlockState state, World w, BlockPos pos, BlockState newState, boolean isMoving) {
if (newState.getBlock() == state.getBlock()) {