Skip to content

Commit

Permalink
Merge pull request #7 from Aranyalma2/master
Browse files Browse the repository at this point in the history
Fix crashing by turtle unequip
  • Loading branch information
Patbox authored Jun 2, 2024
2 parents 5ed76d0 + bfc0f6d commit d88119d
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 d88119d

Please sign in to comment.