mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-02-23 22:40:46 +00:00
Apply fix to buffered items
This commit is contained in:
parent
953d120fc6
commit
f3a88b6afb
@ -119,22 +119,7 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
|
|||||||
inv.decrStackSize(index, toSend);
|
inv.decrStackSize(index, toSend);
|
||||||
stack.stackSize = toSend;
|
stack.stackSize = toSend;
|
||||||
|
|
||||||
EntityMovingItem moving = new EntityMovingItem(worldObj);
|
sendItem(stack, belt, outputSide);
|
||||||
Vec3 pos = Vec3.createVectorHelper(xCoord + 0.5 + outputSide.offsetX * 0.55, yCoord + 0.5 + outputSide.offsetY * 0.55, zCoord + 0.5 + outputSide.offsetZ * 0.55);
|
|
||||||
Vec3 snap = belt.getClosestSnappingPosition(worldObj, xCoord + outputSide.offsetX, yCoord + outputSide.offsetY, zCoord + outputSide.offsetZ, pos);
|
|
||||||
moving.setPosition(snap.xCoord, snap.yCoord, snap.zCoord);
|
|
||||||
moving.setItemStack(stack);
|
|
||||||
worldObj.spawnEntityInWorld(moving);
|
|
||||||
|
|
||||||
if (b instanceof IEnterableBlock) {
|
|
||||||
IEnterableBlock enterable = (IEnterableBlock) b;
|
|
||||||
|
|
||||||
if(enterable.canItemEnter(worldObj, xCoord + outputSide.offsetX, yCoord + outputSide.offsetY, zCoord + outputSide.offsetZ, outputSide.getOpposite(), moving)) {
|
|
||||||
enterable.onItemEnter(worldObj, xCoord + outputSide.offsetX, yCoord + outputSide.offsetY, zCoord + outputSide.offsetZ, outputSide.getOpposite(), moving);
|
|
||||||
moving.setDead();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hasSent = true;
|
hasSent = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -154,12 +139,7 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
|
|||||||
decrStackSize(i, toSend);
|
decrStackSize(i, toSend);
|
||||||
stack.stackSize = toSend;
|
stack.stackSize = toSend;
|
||||||
|
|
||||||
EntityMovingItem moving = new EntityMovingItem(worldObj);
|
sendItem(stack, belt, outputSide);
|
||||||
Vec3 pos = Vec3.createVectorHelper(xCoord + 0.5 + outputSide.offsetX * 0.55, yCoord + 0.5 + outputSide.offsetY * 0.55, zCoord + 0.5 + outputSide.offsetZ * 0.55);
|
|
||||||
Vec3 snap = belt.getClosestSnappingPosition(worldObj, xCoord + outputSide.offsetX, yCoord + outputSide.offsetY, zCoord + outputSide.offsetZ, pos);
|
|
||||||
moving.setPosition(snap.xCoord, snap.yCoord, snap.zCoord);
|
|
||||||
moving.setItemStack(stack);
|
|
||||||
worldObj.spawnEntityInWorld(moving);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -171,6 +151,24 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendItem(ItemStack stack, IConveyorBelt belt, ForgeDirection outputSide) {
|
||||||
|
EntityMovingItem moving = new EntityMovingItem(worldObj);
|
||||||
|
Vec3 pos = Vec3.createVectorHelper(xCoord + 0.5 + outputSide.offsetX * 0.55, yCoord + 0.5 + outputSide.offsetY * 0.55, zCoord + 0.5 + outputSide.offsetZ * 0.55);
|
||||||
|
Vec3 snap = belt.getClosestSnappingPosition(worldObj, xCoord + outputSide.offsetX, yCoord + outputSide.offsetY, zCoord + outputSide.offsetZ, pos);
|
||||||
|
moving.setPosition(snap.xCoord, snap.yCoord, snap.zCoord);
|
||||||
|
moving.setItemStack(stack);
|
||||||
|
worldObj.spawnEntityInWorld(moving);
|
||||||
|
|
||||||
|
if (belt instanceof IEnterableBlock) {
|
||||||
|
IEnterableBlock enterable = (IEnterableBlock) belt;
|
||||||
|
|
||||||
|
if(enterable.canItemEnter(worldObj, xCoord + outputSide.offsetX, yCoord + outputSide.offsetY, zCoord + outputSide.offsetZ, outputSide.getOpposite(), moving)) {
|
||||||
|
enterable.onItemEnter(worldObj, xCoord + outputSide.offsetX, yCoord + outputSide.offsetY, zCoord + outputSide.offsetZ, outputSide.getOpposite(), moving);
|
||||||
|
moving.setDead();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void serialize(ByteBuf buf) {
|
public void serialize(ByteBuf buf) {
|
||||||
super.serialize(buf);
|
super.serialize(buf);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user