fix NPE with the builder robot
This commit is contained in:
parent
a2abe40d91
commit
9d4f92e668
1 changed files with 7 additions and 4 deletions
|
@ -34,12 +34,15 @@ public class BuildingSlotMapIterator {
|
|||
this.slots = slots;
|
||||
this.impIterator = slots.keySet().iterator();
|
||||
this.buildStageOccurences = buildStageOccurences;
|
||||
this.isCreative = builder.getWorldObj().getWorldInfo().getGameType() == WorldSettings.GameType.CREATIVE;
|
||||
this.isCreative = builder == null
|
||||
|| builder.getWorldObj().getWorldInfo().getGameType() == WorldSettings.GameType.CREATIVE;
|
||||
|
||||
// Generate available pairs
|
||||
availablePairs.add(new BuilderItemMetaPair(null));
|
||||
for (int i = 0; i < builder.getSizeInventory(); i++) {
|
||||
availablePairs.add(new BuilderItemMetaPair(builder.getStackInSlot(i)));
|
||||
if (builder != null) {
|
||||
availablePairs.add(new BuilderItemMetaPair(null));
|
||||
for (int i = 0; i < builder.getSizeInventory(); i++) {
|
||||
availablePairs.add(new BuilderItemMetaPair(builder.getStackInSlot(i)));
|
||||
}
|
||||
}
|
||||
|
||||
findNewCurrent();
|
||||
|
|
Loading…
Reference in a new issue