diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/Block.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/Block.java.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/Block.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/Block.java.patch new file mode 100644 index 0000000000..9f70065941 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/Block.java.patch @@ -0,0 +1,52 @@ +--- a/net/minecraft/world/level/block/Block.java ++++ b/net/minecraft/world/level/block/Block.java +@@ -351,8 +348,14 @@ + if (!level.isClientSide && !itemstack.isEmpty() && level.getGameRules().getBoolean(GameRules.RULE_DOBLOCKDROPS)) { + ItemEntity itementity = (ItemEntity) supplier.get(); + +- itementity.setDefaultPickUpDelay(); +- level.addFreshEntity(itementity); ++ entityitem.setDefaultPickUpDelay(); ++ // CraftBukkit start ++ if (level.captureDrops != null) { ++ level.captureDrops.add(entityitem); ++ } else { ++ level.addFreshEntity(entityitem); ++ } ++ // CraftBukkit end + } + } + +@@ -378,8 +381,8 @@ + + public void playerDestroy(Level level, Player player, BlockPos blockpos, BlockState blockstate, @Nullable BlockEntity blockentity, ItemStack itemstack) { + player.awardStat(Stats.BLOCK_MINED.get(this)); +- player.causeFoodExhaustion(0.005F); +- dropResources(blockstate, level, blockpos, blockentity, player, itemstack); ++ player.causeFoodExhaustion(0.005F, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.BLOCK_MINED); // CraftBukkit - EntityExhaustionEvent ++ dropResources(state, level, pos, blockEntity, player, tool); + } + + public void setPlacedBy(Level level, BlockPos blockpos, BlockState blockstate, @Nullable LivingEntity livingentity, ItemStack itemstack) {} +@@ -518,7 +518,8 @@ + return this.builtInRegistryHolder; + } + +- protected void tryDropExperience(ServerLevel serverlevel, BlockPos blockpos, ItemStack itemstack, IntProvider intprovider) { ++ // CraftBukkit start ++ protected int tryDropExperience(ServerLevel worldserver, BlockPos blockposition, ItemStack itemstack, IntProvider intprovider) { + if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) { + int i = intprovider.sample(serverlevel.random); + +@@ -529,6 +532,11 @@ + + } + ++ public int getExpDrop(IBlockData iblockdata, ServerLevel worldserver, BlockPos blockposition, ItemStack itemstack, boolean flag) { ++ return 0; ++ } ++ // CraftBukkit end ++ + public static final class BlockStatePairKey { + + private final BlockState first; |