From cc648f2372ab09d3ace7c4b4d7900083a964828b Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Fri, 14 Oct 2016 19:07:37 +0100 Subject: [PATCH] Fixed the Kindle lens not being able to close nether portals. --- .../botania/common/item/lens/LensFire.java | 23 +++++++++++-------- .../resources/assets/botania/lang/en_US.lang | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/main/java/vazkii/botania/common/item/lens/LensFire.java b/src/main/java/vazkii/botania/common/item/lens/LensFire.java index 43444f38c..74c006369 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensFire.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensFire.java @@ -25,24 +25,27 @@ import vazkii.botania.common.block.tile.TileIncensePlate; public class LensFire extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult rtr, boolean isManaBlock, boolean dead, ItemStack stack) { BlockPos coords = burst.getBurstSourceBlockPos(); - if(!entity.worldObj.isRemote && pos.getBlockPos() != null && !coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) { - EnumFacing dir = pos.sideHit; + BlockPos pos = rtr.getBlockPos(); + if(!entity.worldObj.isRemote && pos != null && !coords.equals(pos) && !burst.isFake() && !isManaBlock) { + EnumFacing dir = rtr.sideHit; - BlockPos pos_ = pos.getBlockPos().offset(dir); + BlockPos offPos = pos.offset(dir); - Block blockAt = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock(); - Block blockAt_ = entity.worldObj.getBlockState(pos_).getBlock(); + Block blockAt = entity.worldObj.getBlockState(pos).getBlock(); + Block blockAtOffset = entity.worldObj.getBlockState(offPos).getBlock(); if(blockAt == Blocks.PORTAL) - entity.worldObj.setBlockState(pos.getBlockPos(), Blocks.AIR.getDefaultState()); + entity.worldObj.setBlockState(pos, Blocks.AIR.getDefaultState()); + if(blockAtOffset == Blocks.PORTAL) + entity.worldObj.setBlockState(offPos, Blocks.AIR.getDefaultState()); else if(blockAt == ModBlocks.incensePlate) { - TileIncensePlate plate = (TileIncensePlate) entity.worldObj.getTileEntity(pos.getBlockPos()); + TileIncensePlate plate = (TileIncensePlate) entity.worldObj.getTileEntity(pos); plate.ignite(); VanillaPacketDispatcher.dispatchTEToNearbyPlayers(plate); - } else if(blockAt_.isAir(entity.worldObj.getBlockState(pos_), entity.worldObj, pos_)) - entity.worldObj.setBlockState(pos_, Blocks.FIRE.getDefaultState()); + } else if(blockAtOffset.isAir(entity.worldObj.getBlockState(offPos), entity.worldObj, offPos)) + entity.worldObj.setBlockState(offPos, Blocks.FIRE.getDefaultState()); } return dead; diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 31f0c343d..c79c5f4f4 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -2170,7 +2170,7 @@ botania.page.lens28=The &1Influence Lens&0 allows the &4Mana Burst&0 to have inf botania.page.lens29=Influence Lens botania.page.lens30=The &1Weight Lens&0 carries a strong burden on the &4Mana Burst&0, making any block hit by it, if there doesn't happen to be a block below it, fall, similarly to how &1Sand&0 and &1Gravel&0 do. botania.page.lens31=Weight Lens -botania.page.lens32=The &1Kindle Lens&0 is infused with a burning spark, when it hits a block it'll set it on fire. It has the ability to both ignite and close &1Nether Portals&0. It doesn't seem to set any living beings on fire, though. +botania.page.lens32=The &1Kindle Lens&0 is infused with a burning spark, when it hits a block it'll set it on fire. It doesn't seem to set any living beings on fire, though.
It has the ability to both ignite and close &1Nether Portals&0, but to close them it needs to be aimed at the frame, lest the burst it carries end up going through the portal. botania.page.lens33=Kindle Lens botania.page.lens34=The &1Force Lens&0 acts as a &1Piston&0, when it hits a block that a piston can move, it'll do just so. botania.page.lens35=Force Lens