From 67afe74250ecc16a2c76112f590675538da63f21 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Mon, 22 Nov 2021 02:11:36 +0100 Subject: [PATCH] Contraption launcher - Fixed Contraptions being affected by Weighted Ejectors --- .../logistics/block/depot/EjectorTileEntity.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorTileEntity.java index 28f3ec109..34dd2634b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorTileEntity.java @@ -31,6 +31,7 @@ import com.simibubi.create.foundation.utility.animation.LerpedFloat.Chaser; import net.minecraft.block.BlockState; import net.minecraft.block.ObserverBlock; +import net.minecraft.block.material.PushReaction; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.item.ItemEntity; @@ -149,6 +150,8 @@ public class EjectorTileEntity extends KineticTileEntity { continue; if (entity instanceof ItemEntity) continue; + if (entity.getPistonPushReaction() == PushReaction.IGNORE) + continue; entity.onGround = false; @@ -379,9 +382,14 @@ public class EjectorTileEntity extends KineticTileEntity { protected void nudgeEntities() { for (Entity entity : level.getEntitiesOfClass(Entity.class, - new AxisAlignedBB(worldPosition).inflate(-1 / 16f, 0, -1 / 16f))) + new AxisAlignedBB(worldPosition).inflate(-1 / 16f, 0, -1 / 16f))) { + if (!entity.isAlive()) + continue; + if (entity.getPistonPushReaction() == PushReaction.IGNORE) + continue; if (!(entity instanceof PlayerEntity)) entity.setPos(entity.getX(), entity.getY() + .125f, entity.getZ()); + } } protected void ejectIfTriggered() {