Skip to content

Commit

Permalink
Fix crashing by turtle unequip
Browse files Browse the repository at this point in the history
Fix NullPointerException by upgrade.getCraftingItem()
  • Loading branch information
Aranyalma2 committed Jun 2, 2024
1 parent 5ed76d0 commit bfc0f6d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ public void setUpgrades(TurtleBrain brain, ITurtleUpgrade left, ITurtleUpgrade r
}

private ItemStack getUpgradeModel(ITurtleUpgrade upgrade, TurtleBrain brain, TurtleSide turtleSide) {
if(upgrade == null){
return ItemStack.EMPTY;
}
if (upgrade instanceof TurtleModemAccessor modem) {
var type = modem.isAdvanced() ? ADVANCED_MODEM_MODEL : NORMAL_MODEM_MODEL;
var x = brain.getUpgradeData(turtleSide).get(ModRegistry.DataComponents.ON.get());
Expand Down

0 comments on commit bfc0f6d

Please sign in to comment.