diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueHandler.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueHandler.java index ba638028b..54f1df414 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueHandler.java @@ -47,8 +47,6 @@ public class SuperGlueHandler { if (entity == null || world == null || pos == null) return; - if (event.isCanceled()) - return; if (world.isRemote()) return; @@ -79,7 +77,7 @@ public class SuperGlueHandler { new RayTraceContext(start, end, RayTraceContext.BlockMode.OUTLINE, RayTraceContext.FluidMode.NONE, placer)); Direction face = ray.getFace(); - if (ray == null || face == null || ray.getType() == Type.MISS) + if (face == null || ray.getType() == Type.MISS) return; if (!ray.getPos() diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java b/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java index 727e78ef0..5a72085bc 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java @@ -20,16 +20,15 @@ import net.minecraft.entity.projectile.ProjectileHelper; import net.minecraft.item.Item; import net.minecraft.item.Rarity; import net.minecraft.nbt.CompoundNBT; -import net.minecraft.util.DamageSource; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.EntityRayTraceResult; -import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult.Type; import net.minecraft.util.math.Vec3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.event.InputEvent.ClickInputEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingKnockBackEvent; import net.minecraftforge.event.entity.player.AttackEntityEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -64,8 +63,6 @@ public class ExtendoGripItem extends Item { public static void holdingExtendoGripIncreasesRange(LivingUpdateEvent event) { if (!(event.getEntity() instanceof PlayerEntity)) return; - if (event.isCanceled()) - return; PlayerEntity player = (PlayerEntity) event.getEntityLiving(); String marker = "createExtendo"; @@ -149,23 +146,14 @@ public class ExtendoGripItem extends Item { } @SubscribeEvent - public static void attacksByExtendoGripHaveMoreKnockback(AttackEntityEvent event) { - Entity entity = event.getEntity(); + public static void attacksByExtendoGripHaveMoreKnockback(LivingKnockBackEvent event) { + Entity entity = event.getAttacker(); if (!(entity instanceof PlayerEntity)) return; PlayerEntity player = (PlayerEntity) entity; if (!isHoldingExtendoGrip(player)) return; - Entity target = event.getTarget(); - if (target instanceof ItemFrameEntity || !target.attackEntityFrom(DamageSource.causePlayerDamage(player), 0)) - return; - int strength = 2; - float yaw = entity.rotationYaw * ((float) Math.PI / 180F); - if (target instanceof LivingEntity) { - ((LivingEntity) target).knockBack(entity, strength, MathHelper.sin(yaw), -MathHelper.cos(yaw)); - return; - } - target.addVelocity(-MathHelper.sin(yaw) * strength, 0.1D, MathHelper.cos(yaw) * strength); + event.setStrength(event.getStrength() + 2); } private static boolean isUncaughtClientInteraction(Entity entity, Entity target) { diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperRenderHandler.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperRenderHandler.java index 1093c1be4..fe428b05d 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperRenderHandler.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperRenderHandler.java @@ -141,8 +141,6 @@ public class ZapperRenderHandler { ItemStack heldItem = event.getItemStack(); if (!(heldItem.getItem() instanceof ZapperItem)) return; - if (event.isCanceled()) - return; Minecraft mc = Minecraft.getInstance(); boolean rightHand = event.getHand() == Hand.MAIN_HAND ^ mc.player.getPrimaryHand() == HandSide.LEFT;