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) if (deployerTileEntity.redstoneLocked)
return ProcessingResult.PASS; 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) if (deployerTileEntity.getRecipe(s.stack) == null)
return ProcessingResult.PASS; return ProcessingResult.PASS;
@ -60,6 +65,12 @@ public class BeltDeployerCallbacks {
BlockState blockState = deployerTileEntity.getBlockState(); BlockState blockState = deployerTileEntity.getBlockState();
if (!blockState.hasProperty(FACING) || blockState.getValue(FACING) != Direction.DOWN) if (!blockState.hasProperty(FACING) || blockState.getValue(FACING) != Direction.DOWN)
return ProcessingResult.PASS; 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); IRecipe<?> recipe = deployerTileEntity.getRecipe(s.stack);
if (recipe == null) if (recipe == null)
return ProcessingResult.PASS; return ProcessingResult.PASS;
@ -92,6 +103,10 @@ public class BeltDeployerCallbacks {
copy.angle = centered ? 180 : Create.RANDOM.nextInt(360); copy.angle = centered ? 180 : Create.RANDOM.nextInt(360);
return copy; return copy;
}) })
.map(t -> {
t.locked = false;
return t;
})
.collect(Collectors.toList()); .collect(Collectors.toList());
TransportedItemStack left = transported.copy(); TransportedItemStack left = transported.copy();