mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-14 15:33:50 +01:00
Merge pull request #4478 from EdrowsLuo/fix-4477
- Fixed crash when Schematicannon gets placed by another Schematicannon
This commit is contained in:
commit
0959e4408c
1 changed files with 6 additions and 5 deletions
|
@ -155,7 +155,8 @@ public class SchematicannonTileEntity extends SmartTileEntity implements MenuPro
|
||||||
schematicProgress = compound.getFloat("Progress");
|
schematicProgress = compound.getFloat("Progress");
|
||||||
bookPrintingProgress = compound.getFloat("PaperProgress");
|
bookPrintingProgress = compound.getFloat("PaperProgress");
|
||||||
fuelLevel = compound.getFloat("Fuel");
|
fuelLevel = compound.getFloat("Fuel");
|
||||||
state = State.valueOf(compound.getString("State"));
|
String stateString = compound.getString("State");
|
||||||
|
state = stateString.isEmpty() ? State.STOPPED : State.valueOf(compound.getString("State"));
|
||||||
blocksPlaced = compound.getInt("AmountPlaced");
|
blocksPlaced = compound.getInt("AmountPlaced");
|
||||||
blocksToPlace = compound.getInt("AmountToPlace");
|
blocksToPlace = compound.getInt("AmountToPlace");
|
||||||
|
|
||||||
|
@ -458,7 +459,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements MenuPro
|
||||||
sendUpdate = true;
|
sendUpdate = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (printer.isWorldEmpty()) {
|
if (printer.isWorldEmpty()) {
|
||||||
state = State.STOPPED;
|
state = State.STOPPED;
|
||||||
statusMsg = "schematicExpired";
|
statusMsg = "schematicExpired";
|
||||||
|
@ -675,10 +676,10 @@ public class SchematicannonTileEntity extends SmartTileEntity implements MenuPro
|
||||||
ItemStack paper = inventory.extractItem(BookInput, 1, true);
|
ItemStack paper = inventory.extractItem(BookInput, 1, true);
|
||||||
boolean outputFull = inventory.getStackInSlot(BookOutput)
|
boolean outputFull = inventory.getStackInSlot(BookOutput)
|
||||||
.getCount() == inventory.getSlotLimit(BookOutput);
|
.getCount() == inventory.getSlotLimit(BookOutput);
|
||||||
|
|
||||||
if (printer.isErrored())
|
if (printer.isErrored())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!printer.isLoaded()) {
|
if (!printer.isLoaded()) {
|
||||||
if (!blueprint.isEmpty())
|
if (!blueprint.isEmpty())
|
||||||
initializePrinter(blueprint);
|
initializePrinter(blueprint);
|
||||||
|
@ -817,7 +818,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements MenuPro
|
||||||
blocksToPlace += printer.markAllBlockRequirements(checklist, level, this::shouldPlace);
|
blocksToPlace += printer.markAllBlockRequirements(checklist, level, this::shouldPlace);
|
||||||
printer.markAllEntityRequirements(checklist);
|
printer.markAllEntityRequirements(checklist);
|
||||||
}
|
}
|
||||||
|
|
||||||
checklist.gathered.clear();
|
checklist.gathered.clear();
|
||||||
findInventories();
|
findInventories();
|
||||||
for (LazyOptional<IItemHandler> cap : attachedInventories) {
|
for (LazyOptional<IItemHandler> cap : attachedInventories) {
|
||||||
|
|
Loading…
Reference in a new issue