mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 20:45:10 +01:00
- Fix extractor couldn't drop items when it attaches to a moving blcoks (#317)
This commit is contained in:
parent
f662a1c805
commit
3544b981ee
@ -35,18 +35,18 @@ public class ExtractorMovementBehaviour extends MovementBehaviour {
|
||||
ItemStack filter = getFilter(context);
|
||||
int amount = getFilterAmount(context);
|
||||
ItemStack dropped = ItemHelper.extract(context.contraption.inventory,
|
||||
stack -> FilterItem.test(context.world, stack, filter), amount == 0 ? -1 : amount, false);
|
||||
stack -> FilterItem.test(context.world, stack, filter), amount == 0 ? 64 : amount, false);
|
||||
|
||||
if (dropped.isEmpty())
|
||||
return;
|
||||
if (world.isRemote)
|
||||
return;
|
||||
|
||||
Vec3d entityPos = VecHelper.getCenterOf(pos).add(0, -0.5f, 0);
|
||||
Vec3d entityPos = context.position;
|
||||
Entity entityIn = null;
|
||||
Direction facing = AttachedLogisticalBlock.getBlockFacing(context.state);
|
||||
if (facing == Direction.DOWN)
|
||||
entityPos = entityPos.add(0, .5, 0);
|
||||
if (facing != Direction.DOWN)
|
||||
entityPos = entityPos.add(0, -0.5f, 0);
|
||||
|
||||
entityIn = new ItemEntity(world, entityPos.x, entityPos.y, entityPos.z, dropped);
|
||||
entityIn.setMotion(Vec3d.ZERO);
|
||||
|
Loading…
Reference in New Issue
Block a user