mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
Improve Block#breakNaturally API
Adds bool parameter to play world effect on block break Adds bool parameter to drop xp from blocks Fixes fluid-logged blocks not leaving fluid behind if broken Handles special cases for ice and turtle eggs == AT == public net.minecraft.world.level.block.TurtleEggBlock decreaseEggs(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;)V Co-authored-by: William Blake Galbreath <Blake.Galbreath@GMail.com>
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
--- a/net/minecraft/world/level/block/IceBlock.java
|
||||
+++ b/net/minecraft/world/level/block/IceBlock.java
|
||||
@@ -60,6 +60,11 @@
|
||||
@@ -36,6 +36,11 @@
|
||||
@Override
|
||||
public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack tool) {
|
||||
super.playerDestroy(world, player, pos, state, blockEntity, tool);
|
||||
+ // Paper start - Improve Block#breakNaturally API
|
||||
+ this.afterDestroy(world, pos, tool);
|
||||
+ }
|
||||
+ public void afterDestroy(Level world, BlockPos pos, ItemStack tool) {
|
||||
+ // Paper end - Improve Block#breakNaturally API
|
||||
if (!EnchantmentHelper.hasTag(tool, EnchantmentTags.PREVENTS_ICE_MELTING)) {
|
||||
if (world.dimensionType().ultraWarm()) {
|
||||
world.removeBlock(pos, false);
|
||||
@@ -60,6 +65,11 @@
|
||||
}
|
||||
|
||||
protected void melt(BlockState state, Level world, BlockPos pos) {
|
||||
|
Reference in New Issue
Block a user