mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-02-19 08:35:33 +01:00
Patient Stalling
- Items on belts now stall under empty-handed Deployers targeting them
This commit is contained in:
parent
994fe29021
commit
fa7039a04a
1 changed files with 17 additions and 2 deletions
|
@ -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;
|
||||||
|
@ -68,10 +79,10 @@ public class BeltDeployerCallbacks {
|
||||||
activate(s, i, deployerTileEntity, recipe);
|
activate(s, i, deployerTileEntity, recipe);
|
||||||
return ProcessingResult.HOLD;
|
return ProcessingResult.HOLD;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deployerTileEntity.state == State.WAITING) {
|
if (deployerTileEntity.state == State.WAITING) {
|
||||||
if (deployerTileEntity.redstoneLocked)
|
if (deployerTileEntity.redstoneLocked)
|
||||||
return ProcessingResult.PASS;
|
return ProcessingResult.PASS;
|
||||||
deployerTileEntity.start();
|
deployerTileEntity.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
|
Loading…
Add table
Reference in a new issue