Reverting the Drop API for now, we need to re-evalute this as it is causing too many issues and blocking releases.
This reverts commits: - d2d03afc8854394aeefb40ea5ebf224c8032b19f - 6245746e91123dd8ef70e5f15b7cdfc7e36d8e8c - 41fae5c613e9e69a8f6bdf33b23bb09d7f407433 - c34bdecab42cf4098054a5ea43e1c2958d44ae92 - d7445084ac9a90fa0b66d8b050b8d0d2a062eaf3 - 6a6ed2e6ae2328a8a791bcc6857c44dc6c6a7030 - a783bc4dc95da8e26c673abe48fad96b550aba28 - cb50fd68766df8e07631ba5be85759f8257e8068 - 34dfff2ad5c407c712b2783f02960aac5e8649f2 - f33b513820de987b49a4338e85df80968217a601 - 5fd9fdfde055e6eb6a83db246d009b69377b7c94 - 2795b116f40d06551fbb7b96d1963c0ddbeac384
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.bukkit.event.vehicle.VehicleCreateEvent;
|
||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||
@@ -113,19 +111,7 @@ public class EntityBoat extends Entity {
|
||||
this.aW();
|
||||
if (this.getDamage() > 40) {
|
||||
// CraftBukkit start
|
||||
List<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
|
||||
int j;
|
||||
|
||||
for (j = 0; j < 3; ++j) {
|
||||
drops.add(new CraftItemStack(Block.WOOD.id, 1));
|
||||
}
|
||||
|
||||
for (j = 0; j < 2; ++j) {
|
||||
drops.add(new CraftItemStack(Item.STICK.id,1));
|
||||
}
|
||||
|
||||
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker, drops);
|
||||
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker);
|
||||
this.world.getServer().getPluginManager().callEvent(destroyEvent);
|
||||
|
||||
if (destroyEvent.isCancelled()) {
|
||||
@@ -138,7 +124,6 @@ public class EntityBoat extends Entity {
|
||||
this.passenger.mount(this);
|
||||
}
|
||||
|
||||
/* CraftBukkit - This logic has been moved up before the event firing
|
||||
int j;
|
||||
|
||||
for (j = 0; j < 3; ++j) {
|
||||
@@ -148,14 +133,8 @@ public class EntityBoat extends Entity {
|
||||
for (j = 0; j < 2; ++j) {
|
||||
this.a(Item.STICK.id, 1, 0.0F);
|
||||
}
|
||||
// */
|
||||
|
||||
this.die();
|
||||
// CraftBukkit start
|
||||
for (org.bukkit.inventory.ItemStack stack : drops) {
|
||||
this.a(CraftItemStack.createNMSItemStack(stack), 0.0f);
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -322,39 +301,25 @@ public class EntityBoat extends Entity {
|
||||
this.move(this.motX, this.motY, this.motZ);
|
||||
if (this.positionChanged && d3 > 0.2D) {
|
||||
if (!this.world.isStatic) {
|
||||
// CraftBukkit start
|
||||
List<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
/* CraftBukkit end
|
||||
this.die();
|
||||
// CraftBukkit - deferred to after the event */
|
||||
|
||||
int k;
|
||||
|
||||
for (k = 0; k < 3; ++k) {
|
||||
/* CraftBukkit - add to drop list instead of immediately dropping
|
||||
this.a(Block.WOOD.id, 1, 0.0F);
|
||||
// */
|
||||
drops.add(new CraftItemStack(Block.WOOD.id, 1));
|
||||
}
|
||||
|
||||
for (k = 0; k < 2; ++k) {
|
||||
/* CraftBukkit - add to drop list instead of immediately dropping
|
||||
this.a(Item.STICK.id, 1, 0.0F);
|
||||
// */
|
||||
drops.add(new CraftItemStack(Item.STICK.id,1));
|
||||
}
|
||||
// CraftBukkit start
|
||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, null, drops);
|
||||
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, null);
|
||||
this.world.getServer().getPluginManager().callEvent(destroyEvent);
|
||||
|
||||
if (!destroyEvent.isCancelled()) {
|
||||
this.die();
|
||||
for (org.bukkit.inventory.ItemStack stack : drops) {
|
||||
this.a(CraftItemStack.createNMSItemStack(stack), 0.0f);
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.die();
|
||||
|
||||
int k;
|
||||
|
||||
for (k = 0; k < 3; ++k) {
|
||||
this.a(Block.WOOD.id, 1, 0.0F);
|
||||
}
|
||||
|
||||
for (k = 0; k < 2; ++k) {
|
||||
this.a(Item.STICK.id, 1, 0.0F);
|
||||
}
|
||||
} // CraftBukkit
|
||||
}
|
||||
} else {
|
||||
this.motX *= 0.9900000095367432D;
|
||||
|
||||
Reference in New Issue
Block a user