fix issue with generated wool
This commit is contained in:
@@ -20,7 +20,8 @@ public class BlockChangeMixin {
|
||||
|
||||
@Inject(at = @At("RETURN"), method = "onBlockChanged")
|
||||
private void init(BlockPos pos, BlockState oldBlock, BlockState newBlock, CallbackInfo info) {
|
||||
if(((ServerWorld) (Object) this).isDebugWorld())
|
||||
ServerWorld world = (ServerWorld) (Object) this;
|
||||
if(world.isDebugWorld()|| !world.isChunkLoaded(pos))
|
||||
return;
|
||||
// This code is injected into the end of ServerWorld.onBlockChanged()V
|
||||
if (oldBlock.getBlock() != newBlock.getBlock()) {
|
||||
@@ -28,14 +29,14 @@ public class BlockChangeMixin {
|
||||
LOGGER.info("onBlockNew {} -> {}", oldBlock, newBlock);
|
||||
Identifier blockId = Registries.BLOCK.getId(newBlock.getBlock());
|
||||
ColourfulPortalsMod.LOGGER.info("Block change, new portal block: " + blockId);
|
||||
PortalManager.onPortalBlockPlaced(((ServerWorld) (Object) this), pos, blockId);
|
||||
PortalManager.onPortalBlockPlaced(world, pos, blockId);
|
||||
|
||||
}
|
||||
if (PORTAL_BLOCKS.contains(Registries.BLOCK.getId(oldBlock.getBlock()))) {
|
||||
LOGGER.info("onBlockOld {} -> {}", oldBlock, newBlock);
|
||||
Identifier blockId = Registries.BLOCK.getId(oldBlock.getBlock());
|
||||
ColourfulPortalsMod.LOGGER.info("Block change, removed portal block: " + blockId);
|
||||
PortalManager.onPortalBlockBroken(((ServerWorld) (Object) this), pos, blockId);
|
||||
PortalManager.onPortalBlockBroken(world, pos, blockId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user