Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Commit

Permalink
Fix VehicleDamageEvent.setDamage() not working for boats
Browse files Browse the repository at this point in the history
  • Loading branch information
sameer committed Feb 17, 2016
1 parent 90e34df commit 64f19a8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions patches/net/minecraft/entity/item/EntityBoat.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}

public double getMountedYOffset()
@@ -97,6 +134,19 @@
@@ -97,6 +134,20 @@
}
else if (!this.worldObj.isRemote && !this.isDead)
{
Expand All @@ -74,11 +74,12 @@
+ }
+
+ // f = event.getDamage(); // TODO Why don't we do this?
+ if((float)event.getDamage() != p_70097_2_ ) p_70097_2_ = event.getDamage(); // Thermos - wow that's sad, maybe we should implement instead of leaving it at "TODO"
+ // CraftBukkit end
this.setForwardDirection(-this.getForwardDirection());
this.setTimeSinceHit(10);
this.setDamageTaken(this.getDamageTaken() + p_70097_2_ * 10.0F);
@@ -105,6 +155,18 @@
@@ -105,6 +156,18 @@

if (flag || this.getDamageTaken() > 40.0F)
{
Expand All @@ -97,7 +98,7 @@
if (this.riddenByEntity != null)
{
this.riddenByEntity.mountEntity(this);
@@ -181,6 +243,13 @@
@@ -181,6 +244,13 @@

public void onUpdate()
{
Expand All @@ -111,7 +112,7 @@
super.onUpdate();

if (this.getTimeSinceHit() > 0)
@@ -303,7 +372,25 @@
@@ -303,7 +373,25 @@
this.motionX += -Math.sin((double)(f * (float)Math.PI / 180.0F)) * this.speedMultiplier * (double)entitylivingbase.moveForward * 0.05000000074505806D;
this.motionZ += Math.cos((double)(f * (float)Math.PI / 180.0F)) * this.speedMultiplier * (double)entitylivingbase.moveForward * 0.05000000074505806D;
}
Expand All @@ -137,7 +138,7 @@
d2 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);

if (d2 > 0.35D)
@@ -347,18 +434,32 @@
@@ -347,18 +435,32 @@

if (block == Blocks.snow_layer)
{
Expand Down Expand Up @@ -171,7 +172,7 @@
{
this.motionX *= 0.5D;
this.motionY *= 0.5D;
@@ -371,17 +472,27 @@
@@ -371,17 +473,27 @@
{
if (!this.worldObj.isRemote && !this.isDead)
{
Expand Down Expand Up @@ -206,7 +207,7 @@
}
}
else
@@ -415,7 +526,22 @@
@@ -415,7 +527,22 @@

this.rotationYaw = (float)((double)this.rotationYaw + d7);
this.setRotation(this.rotationYaw, this.rotationPitch);
Expand All @@ -229,7 +230,7 @@
if (!this.worldObj.isRemote)
{
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
@@ -435,6 +561,7 @@
@@ -435,6 +562,7 @@

if (this.riddenByEntity != null && this.riddenByEntity.isDead)
{
Expand Down

2 comments on commit 64f19a8

@Bogdan-G
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VehicleDamageEvent.setDamage() - it from where?

@sameer
Copy link
Member Author

@sameer sameer commented on 64f19a8 Feb 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bukkit

Please sign in to comment.