2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/Block.java
|
|
|
|
+++ b/net/minecraft/server/Block.java
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -427,7 +427,8 @@
|
|
|
|
}
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
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);
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
return iblockdata.a(loottableinfo_builder);
|
|
|
|
}
|
|
|
|
@@ -481,7 +482,13 @@
|
2017-07-28 09:23:39 +02:00
|
|
|
EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack);
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
entityitem.defaultPickupDelay();
|
2017-07-28 09:23:39 +02:00
|
|
|
- world.addEntity(entityitem);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (world.captureDrops != null) {
|
|
|
|
+ world.captureDrops.add(entityitem);
|
|
|
|
+ } else {
|
|
|
|
+ world.addEntity(entityitem);
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -678,6 +685,12 @@
|
|
|
|
return block == Blocks.DIRT || block == Blocks.COARSE_DIRT || block == Blocks.PODZOL;
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
2016-02-29 22:32:46 +01:00
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
2019-04-23 04:00:00 +02:00
|
|
|
+ public int getExpDrop(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2016-02-29 22:32:46 +01:00
|
|
|
+
|
2019-04-23 04:00:00 +02:00
|
|
|
public static enum EnumRandomOffset {
|
2018-08-26 04:00:00 +02:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
NONE, XZ, XYZ;
|