Skip to content

Commit

Permalink
Get Curios LA Socket Slots Working
Browse files Browse the repository at this point in the history
  • Loading branch information
VT-14 committed Sep 28, 2023
1 parent 131015f commit 2b91d72
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/wayoftime/bloodmagic/compat/CuriosCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,20 @@ public NonNullList<ItemStack> getCuriosInventory(Player player)

public int recalculateCuriosSlots(Player player)
{
Map<String, ICurioStacksHandler> curiosMap = CuriosApi.getCuriosInventory(player).resolve().get().getCurios();
ICurioStacksHandler livingArmourSockets = CuriosApi.getCuriosInventory(player).resolve().get().getCurios().get("living_armour_socket");
if (LivingUtil.hasFullSet(player))
{
Double amount = 0.0;
LivingStats stats = LivingStats.fromPlayer(player);
int curiosLevel = (stats != null) ? stats.getLevel(LivingArmorRegistrar.UPGRADE_CURIOS_SOCKET.get().getKey()) : 0;
livingArmourSockets.removeModifier(player.getUUID());
if (curiosLevel != 0)
{
amount = Double.valueOf(LivingArmorRegistrar.UPGRADE_CURIOS_SOCKET.get().getBonusValue("slots", curiosLevel).intValue());
livingArmourSockets.addTransientModifier(new AttributeModifier(player.getUUID(), "legacy", Double.valueOf(LivingArmorRegistrar.UPGRADE_CURIOS_SOCKET.get().getBonusValue("slots", curiosLevel).intValue()), AttributeModifier.Operation.ADDITION));
}
curiosMap.get("living_armour_socket").addTransientModifier(new AttributeModifier(player.getUUID(), "legacy", amount, AttributeModifier.Operation.ADDITION));
return curiosLevel;
} else
{
curiosMap.get("living_armour_socket").addTransientModifier(new AttributeModifier(player.getUUID(), "legacy", 0.0, AttributeModifier.Operation.ADDITION));
livingArmourSockets.removeModifier(player.getUUID());
return 0;
}
}
Expand Down

0 comments on commit 2b91d72

Please sign in to comment.