mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-15 15:33:40 +01:00
Stability fix for backup itemstack on catched null TE errors
This commit is contained in:
parent
c81e105964
commit
f1cad974aa
1 changed files with 2 additions and 3 deletions
|
@ -39,8 +39,7 @@ public class DispenserMovementBehaviour extends DropperMovementBehaviour {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
int count = itemstack.getCount();
|
||||
ItemStack backup = itemstack.copy();
|
||||
// If none is there, try vanilla registry
|
||||
try {
|
||||
Vec3d facingVec = new Vec3d(context.state.get(DispenserBlock.FACING).getDirectionVec());
|
||||
|
@ -54,7 +53,7 @@ public class DispenserMovementBehaviour extends DropperMovementBehaviour {
|
|||
return;
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
itemstack.setCount(count); // Something went wrong with the TE being null in ContraptionBlockSource, reset the stack
|
||||
itemstack = backup; // Something went wrong with the TE being null in ContraptionBlockSource, reset the stack
|
||||
}
|
||||
|
||||
defaultBehaviour.dispense(itemstack, context, pos); // the default: launch the item
|
||||
|
|
Loading…
Reference in a new issue