Skip to content

Commit f8db8dd

Browse files
committed
Use getBaseValue instead of getValue for max health attribute
1 parent 2047b6f commit f8db8dd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/main/java/org/mvplugins/multiverse/inventories/share

src/main/java/org/mvplugins/multiverse/inventories/share/Sharables.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ public boolean updatePlayer(Player player, ProfileData profile) {
191191
/**
192192
* Sharing Max Health.
193193
*/
194+
//todo: maybe store attribute modifier as well
194195
public static final Sharable<Double> MAX_HEALTH = new Sharable.Builder<>("max_hit_points", Double.class,
195196
new SharableHandler<Double>() {
196197
@Override
@@ -257,7 +258,7 @@ public boolean updatePlayer(Player player, ProfileData profile) {
257258

258259
private static double getMaxHealth(Player player) {
259260
return Option.of(maxHealthAttr).map(player::getAttribute)
260-
.map(AttributeInstance::getValue)
261+
.map(AttributeInstance::getBaseValue)
261262
.getOrElse(PlayerStats.MAX_HEALTH);
262263
}
263264

0 commit comments

Comments
 (0)