mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
41 lines
2.0 KiB
Diff
41 lines
2.0 KiB
Diff
--- a/net/minecraft/server/Block.java
|
|
+++ b/net/minecraft/server/Block.java
|
|
@@ -435,7 +435,8 @@
|
|
}
|
|
|
|
public static List<ItemStack> getDrops(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, @Nullable TileEntity tileentity, Entity entity, ItemStack itemstack) {
|
|
- LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder(worldserver)).a(worldserver.random).set(LootContextParameters.POSITION, blockposition).set(LootContextParameters.TOOL, itemstack).set(LootContextParameters.THIS_ENTITY, entity).setOptional(LootContextParameters.BLOCK_ENTITY, tileentity);
|
|
+ // CraftBukkit - make entity optional
|
|
+ LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder(worldserver)).a(worldserver.random).set(LootContextParameters.POSITION, blockposition).set(LootContextParameters.TOOL, itemstack).setOptional(LootContextParameters.THIS_ENTITY, entity).setOptional(LootContextParameters.BLOCK_ENTITY, tileentity);
|
|
|
|
return iblockdata.a(loottableinfo_builder);
|
|
}
|
|
@@ -489,7 +490,13 @@
|
|
EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack);
|
|
|
|
entityitem.defaultPickupDelay();
|
|
- world.addEntity(entityitem);
|
|
+ // CraftBukkit start
|
|
+ if (world.captureDrops != null) {
|
|
+ world.captureDrops.add(entityitem);
|
|
+ } else {
|
|
+ world.addEntity(entityitem);
|
|
+ }
|
|
+ // CraftBukkit end
|
|
}
|
|
}
|
|
|
|
@@ -686,6 +693,12 @@
|
|
return block == Blocks.DIRT || block == Blocks.COARSE_DIRT || block == Blocks.PODZOL;
|
|
}
|
|
|
|
+ // CraftBukkit start
|
|
+ public int getExpDrop(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
|
|
+ return 0;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
public static enum EnumRandomOffset {
|
|
|
|
NONE, XZ, XYZ;
|