mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-24 14:06:42 +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
1 changed files with 4 additions and 4 deletions
|
@ -35,18 +35,18 @@ public class ExtractorMovementBehaviour extends MovementBehaviour {
|
||||||
ItemStack filter = getFilter(context);
|
ItemStack filter = getFilter(context);
|
||||||
int amount = getFilterAmount(context);
|
int amount = getFilterAmount(context);
|
||||||
ItemStack dropped = ItemHelper.extract(context.contraption.inventory,
|
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())
|
if (dropped.isEmpty())
|
||||||
return;
|
return;
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Vec3d entityPos = VecHelper.getCenterOf(pos).add(0, -0.5f, 0);
|
Vec3d entityPos = context.position;
|
||||||
Entity entityIn = null;
|
Entity entityIn = null;
|
||||||
Direction facing = AttachedLogisticalBlock.getBlockFacing(context.state);
|
Direction facing = AttachedLogisticalBlock.getBlockFacing(context.state);
|
||||||
if (facing == Direction.DOWN)
|
if (facing != Direction.DOWN)
|
||||||
entityPos = entityPos.add(0, .5, 0);
|
entityPos = entityPos.add(0, -0.5f, 0);
|
||||||
|
|
||||||
entityIn = new ItemEntity(world, entityPos.x, entityPos.y, entityPos.z, dropped);
|
entityIn = new ItemEntity(world, entityPos.x, entityPos.y, entityPos.z, dropped);
|
||||||
entityIn.setMotion(Vec3d.ZERO);
|
entityIn.setMotion(Vec3d.ZERO);
|
||||||
|
|
Loading…
Reference in a new issue