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

@@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.entity.Painting;
import org.bukkit.event.painting.PaintingBreakByEntityEvent;
import org.bukkit.event.painting.PaintingBreakEvent.RemoveCause;
@@ -126,8 +125,6 @@ public class EntityPainting extends Entity {
this.f = 0;
if (!this.dead && !this.survives()) {
// CraftBukkit start
List<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
drops.add(new CraftItemStack(Item.PAINTING.id, 1));
Material material = this.world.getMaterial((int) this.locX, (int) this.locY, (int) this.locZ);
RemoveCause cause;
if (material.equals(Material.WATER)) {
@@ -138,7 +135,7 @@ public class EntityPainting extends Entity {
} else {
cause = RemoveCause.PHYSICS;
}
PaintingBreakEvent event = new PaintingBreakEvent((Painting) this.getBukkitEntity(), cause, drops);
PaintingBreakEvent event = new PaintingBreakEvent((Painting) this.getBukkitEntity(), cause);
this.world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled() || dead) {
@@ -147,12 +144,7 @@ public class EntityPainting extends Entity {
// CraftBukkit end
this.die();
// CraftBukkit start - replace following line with the loop
//this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING)));
for (org.bukkit.inventory.ItemStack stack : drops) {
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, CraftItemStack.createNMSItemStack(stack)));
}
// CraftBukkit end
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING)));
}
}
}
@@ -222,14 +214,12 @@ public class EntityPainting extends Entity {
public boolean damageEntity(DamageSource damagesource, int i) {
if (!this.dead && !this.world.isStatic) {
// CraftBukkit start
List<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
drops.add(new CraftItemStack(Item.PAINTING.id, 1));
PaintingBreakEvent event = null;
if (damagesource.getEntity() != null) {
event = new PaintingBreakByEntityEvent((Painting) this.getBukkitEntity(), damagesource.getEntity().getBukkitEntity(), drops);
event = new PaintingBreakByEntityEvent((Painting) this.getBukkitEntity(), damagesource.getEntity() == null ? null : damagesource.getEntity().getBukkitEntity());
} else {
if (damagesource == DamageSource.FIRE) {
event = new PaintingBreakEvent((Painting) this.getBukkitEntity(), RemoveCause.FIRE, drops);
event = new PaintingBreakEvent((Painting) this.getBukkitEntity(), RemoveCause.FIRE);
}
// TODO: Could put other stuff here?
}
@@ -246,12 +236,7 @@ public class EntityPainting extends Entity {
this.die();
this.aW();
// CraftBukkit start - replace following line with the loop
//this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING)));
for (org.bukkit.inventory.ItemStack stack : drops) {
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, CraftItemStack.createNMSItemStack(stack)));
}
// CraftBukkit end
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING)));
}
return true;
@@ -300,7 +285,7 @@ public class EntityPainting extends Entity {
public void b_(double d0, double d1, double d2) {
/* CraftBukkit start - not needed for paintings
if (!this.world.isStatic && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) {
if (!this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) {
this.die();
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING)));
}