Minecraft 1.6 compatibility.

Update health references to use double-precision floating point numbers instead
of integers due to minecraft spec change. Update Java to 1.6. Update bukkit
version.
This commit is contained in:
cmastudios 2013-07-26 22:22:27 -10:00
parent fb375002de
commit bf3795ded1
3 changed files with 8 additions and 8 deletions

View File

@ -48,8 +48,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
@ -81,7 +81,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.4.7-R1.0</version>
<version>1.6.1-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.kitteh</groupId>

View File

@ -540,8 +540,8 @@ public class WarPlayerListener implements Listener {
// Monuments
if (playerTeam != null && playerWarzone.nearAnyOwnedMonument(playerLoc, playerTeam) && player.getHealth() < 20 && player.getHealth() > 0 // don't heal the dead
&& this.random.nextInt(7) == 3) { // one chance out of many of getting healed
int currentHp = player.getHealth();
int newHp = Math.min(20, currentHp + locZone.getWarzoneConfig().getInt(WarzoneConfig.MONUMENTHEAL));
double currentHp = player.getHealth();
double newHp = Math.min(20, currentHp + locZone.getWarzoneConfig().getInt(WarzoneConfig.MONUMENTHEAL));
player.setHealth(newHp);
String isS = "s";

View File

@ -16,14 +16,14 @@ public class PlayerState {
private final float exhaustion;
private final float saturation;
private final int foodLevel;
private final int health;
private final double health;
private final GameMode gamemode;
private final Collection<PotionEffect> potionEffects;
private final String playerTitle;
private final float exp;
private final int level;
public PlayerState(GameMode gamemode, ItemStack[] contents, ItemStack helmet, ItemStack chest, ItemStack legs, ItemStack feet, int health, float exhaustion, float saturation, int foodLevel, Collection<PotionEffect> potionEffects, String playerTitle, int level, float exp) {
public PlayerState(GameMode gamemode, ItemStack[] contents, ItemStack helmet, ItemStack chest, ItemStack legs, ItemStack feet, double health, float exhaustion, float saturation, int foodLevel, Collection<PotionEffect> potionEffects, String playerTitle, int level, float exp) {
this.gamemode = gamemode;
this.health = health;
this.exhaustion = exhaustion;
@ -92,7 +92,7 @@ public class PlayerState {
return foodLevel;
}
public int getHealth() {
public double getHealth() {
return health;
}