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:
Warren Loo
2012-03-27 11:37:00 -04:00
parent c16bf07e85
commit c100e20d60
23 changed files with 65 additions and 901 deletions

View File

@@ -1,9 +1,9 @@
package net.minecraft.server;
import java.util.List;
// CraftBukkit start
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.HumanEntity;
@@ -18,7 +18,6 @@ import org.bukkit.event.vehicle.VehicleUpdateEvent;
import org.bukkit.util.Vector;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
// CraftBukkit end
public class EntityMinecart extends Entity implements IInventory {
@@ -148,35 +147,21 @@ public class EntityMinecart extends Entity implements IInventory {
this.aW();
this.setDamage(this.getDamage() + i * 10);
if (this.getDamage() > 40) {
// CraftBukkit start
List<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
drops.add(new CraftItemStack(Item.MINECART.id,1));
if (this.type == 1) {
drops.add(new CraftItemStack(Block.CHEST.id,1));
} else if (this.type == 2) {
drops.add(new org.bukkit.inventory.ItemStack(Block.FURNACE.id,1));
if (this.passenger != null) {
this.passenger.mount(this);
}
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, passenger, drops);
// CraftBukkit start
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, passenger);
this.world.getServer().getPluginManager().callEvent(destroyEvent);
if (destroyEvent.isCancelled()) {
this.setDamage(40); // Maximize damage so this doesn't get triggered again right away
return true;
}
// CraftBukkit end
if (this.passenger != null) {
this.passenger.mount(this);
}
this.die();
// CraftBukkit start - Drop items from the event
for(org.bukkit.inventory.ItemStack stack : drops) {
this.a(CraftItemStack.createNMSItemStack(stack), 0.0f);
}
// CraftBukkit end
// this.a(Item.MINECART.id, 1, 0.0F); // CraftBukkit - handled by main drop loop
this.a(Item.MINECART.id, 1, 0.0F);
if (this.type == 1) {
EntityMinecart entityminecart = this;
@@ -208,9 +193,9 @@ public class EntityMinecart extends Entity implements IInventory {
}
}
// this.a(Block.CHEST.id, 1, 0.0F); // CraftBukkit - handled by main drop loop
this.a(Block.CHEST.id, 1, 0.0F);
} else if (this.type == 2) {
// this.a(Block.FURNACE.id, 1, 0.0F); // CraftBukkit - handled by main drop loop
this.a(Block.FURNACE.id, 1, 0.0F);
}
}