Skip to content

Commit

Permalink
Added in hand based temperatures
Browse files Browse the repository at this point in the history
  • Loading branch information
Masstrix committed Apr 15, 2020
1 parent 399d9ae commit fe9d47a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/me/masstrix/eternalnature/data/UserData.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ public final void tick() {
emission += tempData.getArmorModifier(i.getType());
}

// Add temperature depending on what the player is holding
Material mainHand = player.getInventory().getItemInMainHand().getType();
Material offHand = player.getInventory().getItemInOffHand().getType();
if (mainHand != Material.AIR) {
float mainTemp = tempData.getBlockEmission(mainHand);
emission += mainTemp / 10;
}
if (offHand != Material.AIR) {
float offTemp = tempData.getBlockEmission(offHand);
emission += offTemp / 10;
}

if (!Float.isInfinite(emission) && !Float.isNaN(emission)) {
this.tempExact = emission;
tempData.updateMinMaxTempCache(tempExact);
Expand Down

0 comments on commit fe9d47a

Please sign in to comment.