Patient Stalling

- Items on belts now stall under empty-handed Deployers targeting them
This commit is contained in:
simibubi 2021-09-27 12:49:45 +02:00
parent 994fe29021
commit fa7039a04a

View file

@ -45,6 +45,11 @@ public class BeltDeployerCallbacks {
if (deployerTileEntity.redstoneLocked)
return ProcessingResult.PASS;
DeployerFakePlayer player = deployerTileEntity.getPlayer();
ItemStack held = player == null ? ItemStack.EMPTY : player.getMainHandItem();
if (held.isEmpty())
return ProcessingResult.HOLD;
if (deployerTileEntity.getRecipe(s.stack) == null)
return ProcessingResult.PASS;
@ -60,6 +65,12 @@ public class BeltDeployerCallbacks {
BlockState blockState = deployerTileEntity.getBlockState();
if (!blockState.hasProperty(FACING) || blockState.getValue(FACING) != Direction.DOWN)
return ProcessingResult.PASS;
DeployerFakePlayer player = deployerTileEntity.getPlayer();
ItemStack held = player == null ? ItemStack.EMPTY : player.getMainHandItem();
if (held.isEmpty())
return ProcessingResult.HOLD;
IRecipe<?> recipe = deployerTileEntity.getRecipe(s.stack);
if (recipe == null)
return ProcessingResult.PASS;
@ -68,10 +79,10 @@ public class BeltDeployerCallbacks {
activate(s, i, deployerTileEntity, recipe);
return ProcessingResult.HOLD;
}
if (deployerTileEntity.state == State.WAITING) {
if (deployerTileEntity.redstoneLocked)
return ProcessingResult.PASS;
return ProcessingResult.PASS;
deployerTileEntity.start();
}
@ -92,6 +103,10 @@ public class BeltDeployerCallbacks {
copy.angle = centered ? 180 : Create.RANDOM.nextInt(360);
return copy;
})
.map(t -> {
t.locked = false;
return t;
})
.collect(Collectors.toList());
TransportedItemStack left = transported.copy();