mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-19 06:13:49 -07:00
[Bleeding] Added getting and setting drops to all appropriate events. Fixes BUKKIT-397 and fixes BUKKIT-1252
- Allows drops in creative mode by adding items to the getDrops() list - Contents of containers are not reported - Contents of storage minecarts are not reported
This commit is contained in:
committed by
EvilSeph
parent
8d62de7055
commit
5ba8928041
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.ArrayList; // CraftBukkit
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockLongGrass extends BlockFlower {
|
||||
@@ -26,9 +27,25 @@ public class BlockLongGrass extends BlockFlower {
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
if (!world.isStatic && entityhuman.T() != null && entityhuman.T().id == Item.SHEARS.id) {
|
||||
entityhuman.a(StatisticList.C[this.id], 1);
|
||||
/* CraftBukkit start - moved this line into calculateDrops
|
||||
this.a(world, i, j, k, new ItemStack(Block.LONG_GRASS, 1, l));
|
||||
*/
|
||||
this.doActualDrop(world, entityhuman, i, j, k, l);
|
||||
// CraftBukkit end
|
||||
} else {
|
||||
super.a(world, entityhuman, i, j, k, l);
|
||||
}
|
||||
}
|
||||
|
||||
// CraftBukkit start - Calculate drops
|
||||
public ArrayList<ItemStack> calculateDrops(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
if (!world.isStatic && entityhuman.T() != null && entityhuman.T().id == Item.SHEARS.id) {
|
||||
super.dropList = new ArrayList<ItemStack>();
|
||||
this.a(world, i, j, k, new ItemStack(Block.LONG_GRASS, 1, l));
|
||||
return super.dropList;
|
||||
} else {
|
||||
return super.calculateDrops(world, entityhuman, i, j, k, l);
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
Reference in New Issue
Block a user