summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityBoat.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityBoat.java')
-rw-r--r--src/main/java/net/minecraft/server/EntityBoat.java53
1 files changed, 29 insertions, 24 deletions
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java
index acafa6cb..7c9b2733 100644
--- a/src/main/java/net/minecraft/server/EntityBoat.java
+++ b/src/main/java/net/minecraft/server/EntityBoat.java
@@ -53,14 +53,14 @@ public class EntityBoat extends Entity {
this.height = this.length / 2.0F;
}
- protected boolean f_() {
+ protected boolean e_() {
return false;
}
protected void a() {
this.datawatcher.a(17, new Integer(0));
this.datawatcher.a(18, new Integer(1));
- this.datawatcher.a(19, new Integer(0));
+ this.datawatcher.a(19, new Float(0.0F));
}
public AxisAlignedBB g(Entity entity) {
@@ -92,7 +92,7 @@ public class EntityBoat extends Entity {
return (double) this.length * 0.0D - 0.30000001192092896D;
}
- public boolean damageEntity(DamageSource damagesource, int i) {
+ public boolean damageEntity(DamageSource damagesource, float f) {
if (this.isInvulnerable()) {
return false;
} else if (!this.world.isStatic && !this.dead) {
@@ -100,7 +100,7 @@ public class EntityBoat extends Entity {
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
org.bukkit.entity.Entity attacker = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity();
- VehicleDamageEvent event = new VehicleDamageEvent(vehicle, attacker, i);
+ VehicleDamageEvent event = new VehicleDamageEvent(vehicle, attacker, (double) f);
this.world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -109,19 +109,19 @@ public class EntityBoat extends Entity {
// i = event.getDamage(); // TODO Why don't we do this?
// CraftBukkit end
- this.h(-this.h());
- this.b(10);
- this.setDamage(this.getDamage() + i * 10);
+ this.c(-this.h());
+ this.a(10);
+ this.setDamage(this.getDamage() + f * 10.0F);
this.J();
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
- if (flag || this.getDamage() > 40) {
+ if (flag || this.getDamage() > 40.0F) {
// CraftBukkit start
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker);
this.world.getServer().getPluginManager().callEvent(destroyEvent);
if (destroyEvent.isCancelled()) {
- this.setDamage(40); // Maximize damage so this doesn't get triggered again right away
+ this.setDamage(40F); // Maximize damage so this doesn't get triggered again right away
return true;
}
// CraftBukkit end
@@ -157,12 +157,12 @@ public class EntityBoat extends Entity {
// CraftBukkit end
super.l_();
- if (this.g() > 0) {
- this.b(this.g() - 1);
+ if (this.e() > 0) {
+ this.a(this.e() - 1);
}
- if (this.getDamage() > 0) {
- this.setDamage(this.getDamage() - 1);
+ if (this.getDamage() > 0.0F) {
+ this.setDamage(this.getDamage() - 1.0F);
}
this.lastX = this.locX;
@@ -248,9 +248,14 @@ public class EntityBoat extends Entity {
this.motY += 0.007000000216066837D;
}
- if (this.passenger != null) {
- this.motX += this.passenger.motX * this.b;
- this.motZ += this.passenger.motZ * this.b;
+ if (this.passenger != null && this.passenger instanceof EntityLiving) {
+ d4 = (double) ((EntityLiving) this.passenger).bf;
+ if (d4 > 0.0D) {
+ d5 = -Math.sin((double) (this.passenger.yaw * 3.1415927F / 180.0F));
+ d10 = Math.cos((double) (this.passenger.yaw * 3.1415927F / 180.0F));
+ this.motX += d5 * this.b * 0.05000000074505806D;
+ this.motZ += d10 * this.b * 0.05000000074505806D;
+ }
}
// CraftBukkit start - Support unoccupied deceleration
else if (unoccupiedDeceleration >= 0) {
@@ -420,7 +425,7 @@ public class EntityBoat extends Entity {
protected void a(NBTTagCompound nbttagcompound) {}
- public boolean a_(EntityHuman entityhuman) {
+ public boolean c(EntityHuman entityhuman) {
if (this.passenger != null && this.passenger instanceof EntityHuman && this.passenger != entityhuman) {
return true;
} else {
@@ -432,23 +437,23 @@ public class EntityBoat extends Entity {
}
}
- public void setDamage(int i) {
- this.datawatcher.watch(19, Integer.valueOf(i));
+ public void setDamage(float f) {
+ this.datawatcher.watch(19, Float.valueOf(f));
}
- public int getDamage() {
- return this.datawatcher.getInt(19);
+ public float getDamage() {
+ return this.datawatcher.getFloat(19);
}
- public void b(int i) {
+ public void a(int i) {
this.datawatcher.watch(17, Integer.valueOf(i));
}
- public int g() {
+ public int e() {
return this.datawatcher.getInt(17);
}
- public void h(int i) {
+ public void c(int i) {
this.datawatcher.watch(18, Integer.valueOf(i));
}