@SubscribeEvent
public void eventBreakEvent(BlockEvent.BreakEvent event) {
World world = event.world;
int x = event.x;
int y = event.y;
int z = event.z;
EntityPlayer player = event.getPlayer();
if (player != null && player.getHeldItem() != null && player.getHeldItem().getItem() == Items.stick) {
if (TOConfig.debugEnable && TOConfig.debugRemover && !world.isRemote
&& player.capabilities.isCreativeMode) {
int radius = TOConfig.debugRemoverScannerRadius;
for (int xx = x - radius; xx < x + radius; xx++)
for (int zz = z - radius; zz < z + radius; zz++)
for (int yy = 0; yy < 257; yy++)
if (!(world.getBlock(xx, yy, zz) instanceof BlockInfusedBlockOre))
world.setBlock(xx, yy, zz, Blocks.air, 0, 2);
String text = "[DEBUG " + ThaumOresMod.NAME + "] Removed blocks at " + x + ";" + z + " with radius "
+ radius;
player.addChatMessage(new ChatComponentText(text));
ThaumOresMod.log.info(text);
}
}
}
TOEvents.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:ThaumOres
作者:
评论列表
文章目录