mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-09 20:31:28 +01:00
Use double to store health
This commit is contained in:
parent
f266f00412
commit
6b70e71abb
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>dungeonsxl</artifactId>
|
||||
<version>0.11.3</version>
|
||||
<version>0.11.4</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>DungeonsXL</name>
|
||||
<url>https://dre2n.github.io</url>
|
||||
|
@ -99,15 +99,13 @@ public class DGamePlayer extends DGlobalPlayer {
|
||||
|
||||
this.world = world;
|
||||
|
||||
double health = player.getHealth();
|
||||
|
||||
if (!Version.andHigher(Version.MC1_9).contains(CompatibilityHandler.getInstance().getVersion())) {
|
||||
savePlayer = new DSavePlayer(player.getName(), player.getUniqueId(), player.getLocation(), player.getInventory().getContents(), player.getInventory().getArmorContents(), null, player.getLevel(),
|
||||
player.getTotalExperience(), (int) health, player.getFoodLevel(), player.getFireTicks(), player.getGameMode(), player.getActivePotionEffects());
|
||||
player.getTotalExperience(), player.getHealth(), player.getFoodLevel(), player.getFireTicks(), player.getGameMode(), player.getActivePotionEffects());
|
||||
|
||||
} else {
|
||||
savePlayer = new DSavePlayer(player.getName(), player.getUniqueId(), player.getLocation(), player.getInventory().getContents(), player.getInventory().getArmorContents(), player.getInventory().getItemInOffHand(), player.getLevel(),
|
||||
player.getTotalExperience(), (int) health, player.getFoodLevel(), player.getFireTicks(), player.getGameMode(), player.getActivePotionEffects());
|
||||
player.getTotalExperience(), player.getHealth(), player.getFoodLevel(), player.getFireTicks(), player.getGameMode(), player.getActivePotionEffects());
|
||||
}
|
||||
this.editing = editing;
|
||||
|
||||
|
@ -58,13 +58,13 @@ public class DSavePlayer {
|
||||
private ItemStack oldOffHand;
|
||||
private int oldLvl;
|
||||
private int oldExp;
|
||||
private int oldHealth;
|
||||
private double oldHealth;
|
||||
private int oldFoodLevel;
|
||||
private int oldFireTicks;
|
||||
private GameMode oldGameMode;
|
||||
private Collection<PotionEffect> oldPotionEffects;
|
||||
|
||||
public DSavePlayer(String name, UUID uuid, Location oldLocation, ArrayList<ItemStack> oldInventory, ArrayList<ItemStack> oldArmor, ItemStack oldOffHand, int oldLvl, int oldExp, int oldHealth, int oldFoodLevel, int oldFireTicks,
|
||||
public DSavePlayer(String name, UUID uuid, Location oldLocation, ArrayList<ItemStack> oldInventory, ArrayList<ItemStack> oldArmor, ItemStack oldOffHand, int oldLvl, int oldExp, double oldHealth, int oldFoodLevel, int oldFireTicks,
|
||||
GameMode oldGameMode, Collection<PotionEffect> oldPotionEffects) {
|
||||
this.name = name;
|
||||
this.uuid = uuid.toString();
|
||||
@ -85,7 +85,7 @@ public class DSavePlayer {
|
||||
dPlayers.addDSavePlayer(this);
|
||||
}
|
||||
|
||||
public DSavePlayer(String name, UUID uuid, Location oldLocation, ItemStack[] oldInventory, ItemStack[] oldArmor, ItemStack oldOffHand, int oldLvl, int oldExp, int oldHealth, int oldFoodLevel, int oldFireTicks,
|
||||
public DSavePlayer(String name, UUID uuid, Location oldLocation, ItemStack[] oldInventory, ItemStack[] oldArmor, ItemStack oldOffHand, int oldLvl, int oldExp, double oldHealth, int oldFoodLevel, int oldFireTicks,
|
||||
GameMode oldGameMode, Collection<PotionEffect> oldPotionEffects) {
|
||||
this(name, uuid, oldLocation, new ArrayList<>(Arrays.asList(oldInventory)), new ArrayList<>(Arrays.asList(oldArmor)), oldOffHand, oldLvl, oldExp, oldHealth, oldFoodLevel, oldFireTicks, oldGameMode, oldPotionEffects);
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class DSavePlayer {
|
||||
/**
|
||||
* @return the old health
|
||||
*/
|
||||
public int getOldHealth() {
|
||||
public double getOldHealth() {
|
||||
return oldHealth;
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ public class DSavePlayer {
|
||||
* @param health
|
||||
* the health to set
|
||||
*/
|
||||
public void setOldHealth(int health) {
|
||||
public void setOldHealth(double health) {
|
||||
oldHealth = health;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user