From 3f063134c13b3a6cf64cae313feaf95b9180db6b Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sat, 19 Sep 2015 22:56:43 +0100 Subject: [PATCH] The Thorn and Flare Chakrams now pass through leaves and folliage. Closes #1382 --- .../botania/common/entity/EntityThornChakram.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java b/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java index 8b1f626e7..6b0938b3b 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java +++ b/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java @@ -10,6 +10,9 @@ */ package vazkii.botania.common.entity; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBush; +import net.minecraft.block.BlockLeaves; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -17,6 +20,7 @@ import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -106,7 +110,12 @@ public class EntityThornChakram extends EntityThrowable { protected void onImpact(MovingObjectPosition pos) { if(noClip) return; - + + Block block = worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); + TileEntity tile = worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); + if(block instanceof BlockBush || block instanceof BlockLeaves) + return; + boolean fire = isFire(); EntityLivingBase thrower = getThrower(); if(pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && pos.entityHit != thrower) {