use of com.teamresourceful.resourcefulbees.block.multiblocks.apiary.ApiaryStorageBlock in project ResourcefulBees by Resourceful-Bees.
the class ApiaryController method validateBlocks.
private boolean validateBlocks(AtomicBoolean isStructureValid, Level worldIn, @Nullable ServerPlayer validatingPlayer) {
structureBlocks.forEach(pos -> {
Block block = worldIn.getBlockState(pos).getBlock();
if (block.is(BeeInfoUtils.getValidApiaryTag()) || block instanceof ApiaryBreederBlock || block instanceof ApiaryStorageBlock || block instanceof ApiaryBlock) {
BlockEntity tile = worldIn.getBlockEntity(pos);
linkStorageAndBreeder(tile);
} else {
isStructureValid.set(false);
if (validatingPlayer != null)
validatingPlayer.displayClientMessage(new TextComponent(String.format("Block at position (X: %1$s Y: %2$s Z: %3$s) is invalid!", pos.getX(), pos.getY(), pos.getZ())), false);
}
});
return isStructureValid.get();
}
Aggregations