Skip to content

Commit

Permalink
fix rocket scanner crash
Browse files Browse the repository at this point in the history
  • Loading branch information
screret committed Oct 23, 2023
1 parent 943e133 commit 8b3e342
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package argent_matter.gcys.common.machine.multiblock;

import argent_matter.gcys.api.space.planet.Planet;
import argent_matter.gcys.common.data.GCySBlocks;
import argent_matter.gcys.common.data.GCySEntities;
import argent_matter.gcys.common.data.GCySItems;
Expand Down Expand Up @@ -115,8 +116,11 @@ public void handleDisplayClick(String componentData, ClickData clickData) {
private void onSaveSlotChanged() {
ItemStack saveStack = this.configSaveSlot.getStackInSlot(0);
if (GCySItems.ID_CHIP.isIn(saveStack)) {
Planet planet = PlanetIdChipBehaviour.getPlanetFromStack(saveStack);
if (planet == null) return;

ItemStack keyCardStack = GCySItems.KEYCARD.asStack(1);
KeyCardBehaviour.setSavedStation(keyCardStack, PlanetIdChipBehaviour.getSpaceStationId(saveStack), PlanetIdChipBehaviour.getPlanetFromStack(saveStack));
KeyCardBehaviour.setSavedStation(keyCardStack, PlanetIdChipBehaviour.getSpaceStationId(saveStack), planet);
this.configLoadSlot.setStackInSlot(0, keyCardStack);
}
}
Expand Down

0 comments on commit 8b3e342

Please sign in to comment.