summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit
diff options
context:
space:
mode:
authorWarren Loo <evilseph@gmail.com>2012-03-27 11:37:00 -0400
committerWarren Loo <evilseph@gmail.com>2012-03-27 20:04:26 -0400
commitc100e20d605a0dde2c2e149954324e1659a6108b (patch)
treeca98a2be106bb69031bd94a5486bb702b599c77b /src/main/java/org/bukkit
parentc16bf07e85feb5e7bcb3e4a98048de36fe7859f2 (diff)
downloadcraftbukkit-c100e20d605a0dde2c2e149954324e1659a6108b.tar
craftbukkit-c100e20d605a0dde2c2e149954324e1659a6108b.tar.gz
craftbukkit-c100e20d605a0dde2c2e149954324e1659a6108b.tar.lz
craftbukkit-c100e20d605a0dde2c2e149954324e1659a6108b.tar.xz
craftbukkit-c100e20d605a0dde2c2e149954324e1659a6108b.zip
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
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftWorld.java1
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java3
-rw-r--r--src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java46
3 files changed, 1 insertions, 49 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 602f806f..25967d91 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1056,7 +1056,6 @@ public class CraftWorld implements World {
int blockZ = block.getZ();
// following code is lifted from Explosion.a(boolean), and modified
net.minecraft.server.Block.byId[blockId].dropNaturally(this.world, blockX, blockY, blockZ, block.getData(), yield, 0);
- net.minecraft.server.Block.byId[blockId].doActualDrop(this.world, blockX, blockY, blockZ);
block.setType(org.bukkit.Material.AIR);
// not sure what this does, seems to have something to do with the 'base' material of a block.
// For example, WOODEN_STAIRS does something with WOOD in this method
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 6e89ef4d..368cea99 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -18,7 +18,6 @@ import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.PistonMoveReaction;
import org.bukkit.craftbukkit.CraftChunk;
-import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
@@ -348,7 +347,7 @@ public class CraftBlock implements Block {
setTypeId(Material.AIR.getId());
if (block != null) {
- block.b(chunk.getHandle().world, x, y, z, data, 0);
+ block.dropNaturally(chunk.getHandle().world, x, y, z, data, 1.0F, 0);
return true;
}
return false;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index bee08c37..df942185 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -20,7 +20,6 @@ import net.minecraft.server.InventoryCrafting;
import net.minecraft.server.Item;
import net.minecraft.server.ItemStack;
import net.minecraft.server.Packet101CloseWindow;
-import net.minecraft.server.Packet53BlockChange;
import net.minecraft.server.World;
import net.minecraft.server.WorldServer;
@@ -511,49 +510,4 @@ public class CraftEventFactory {
Bukkit.getPluginManager().callEvent(event);
return event;
}
-
- private static final List<org.bukkit.inventory.ItemStack> drops = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
-
- public static boolean callBlockBreakEvent(World world, int x, int y, int z, int id, int data, boolean creative, EntityHuman player) {
- net.minecraft.server.Block blockType = net.minecraft.server.Block.byId[id];
- if (blockType == null) { // Illegal block ID
- return true;
- }
-
- // Tell client the block is gone immediately then process events
- if (world.getTileEntity(x, y, z) == null) {
- Packet53BlockChange packet = new Packet53BlockChange(x, y, z, world);
-
- packet.material = 0;
- packet.data = 0;
- ((EntityPlayer) player).netServerHandler.sendPacket(packet);
- }
-
- Block block = world.getWorld().getBlockAt(x, y, z);
- List<ItemStack> toDrop = blockType.calculateDrops(world, player, x, y, z, data);
- drops.clear();
-
- if (!creative && player.b(blockType)) {
- for (ItemStack stack : toDrop) {
- drops.add(new CraftItemStack(stack));
- }
- }
-
- BlockBreakEvent event = new BlockBreakEvent(block, (org.bukkit.entity.Player) player.getBukkitEntity(), drops);
- world.getServer().getPluginManager().callEvent(event);
-
- if (event.isCancelled()) {
- toDrop.clear();
- // Let the client know the block still exists
- ((EntityPlayer) player).netServerHandler.sendPacket(new Packet53BlockChange(x, y, z, world));
- return true;
- }
-
- toDrop.clear();
- for (org.bukkit.inventory.ItemStack stack : drops) {
- toDrop.add(CraftItemStack.createNMSItemStack(stack));
- }
-
- return false; // Event not cancelled
- }
}