From 5004b9b31102234326f758a8793d56f3c6ebc0d3 Mon Sep 17 00:00:00 2001 From: GirafiStudios Date: Tue, 2 Oct 2018 00:50:44 +0200 Subject: [PATCH] Fixed BoP boats not being breakable by hand Fixed BoP boat creative pick result --- .../common/entities/item/EntityBOPBoat.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/biomesoplenty/common/entities/item/EntityBOPBoat.java b/src/main/java/biomesoplenty/common/entities/item/EntityBOPBoat.java index d241bfdea..72b2c4c15 100644 --- a/src/main/java/biomesoplenty/common/entities/item/EntityBOPBoat.java +++ b/src/main/java/biomesoplenty/common/entities/item/EntityBOPBoat.java @@ -10,6 +10,7 @@ package biomesoplenty.common.entities.item; import java.util.List; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.google.common.collect.Lists; @@ -42,10 +43,7 @@ import net.minecraft.util.EntitySelectors; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.SoundEvent; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.*; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -144,7 +142,7 @@ public class EntityBOPBoat extends EntityBoat } @Override - public boolean attackEntityFrom(DamageSource source, float amount) + public boolean attackEntityFrom(@Nonnull DamageSource source, float amount) { if (this.isEntityInvulnerable(source)) { @@ -160,7 +158,7 @@ public class EntityBOPBoat extends EntityBoat { this.setForwardDirection(-this.getForwardDirection()); this.setTimeSinceHit(10); - this.setDamageTaken(this.getDamageTaken() + amount * 10.0F); + this.setDamageTaken(this.getDamageTaken() + (amount * 1.5F) * 10.0F); this.markVelocityChanged(); boolean flag = source.getTrueSource() instanceof EntityPlayer && ((EntityPlayer)source.getTrueSource()).capabilities.isCreativeMode; @@ -240,6 +238,13 @@ public class EntityBOPBoat extends EntityBoat } } + @Override + @Nonnull + public ItemStack getPickedResult(RayTraceResult target) + { + return new ItemStack(this.getItemBoat()); + } + @SideOnly(Side.CLIENT) @Override public void performHurtAnimation()