feat: 1.20.1

This commit is contained in:
Lexi Larkin
2023-06-30 14:54:32 -04:00
parent 3edba7dac4
commit 17e63ac792
42 changed files with 783 additions and 828 deletions

View File

@@ -8,19 +8,10 @@ to easily get the items being dropped by any
block instead of only blocks broken by players.
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..c357e09705c5405dc8fac666fc39c993febdee50 100644
index 9522e646529f3d849471931b4b3c0d133e7fcfc5..cbdcbfed03afbdf194243d4472e69a664dcf71b9 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -306,7 +306,7 @@ public class Block extends BlockBehaviour implements ItemLike {
ServerLevel worldserver = lootContext.getLevel();
BlockPos blockposition = BlockPos.containing((Position) lootContext.getParameter(LootContextParams.ORIGIN));
- state.getDrops(lootContext).forEach((itemstack) -> {
+ org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(worldserver, blockposition, state.getDrops(lootContext)).forEach((itemstack) -> { // Parchment
Block.popResource(worldserver, blockposition, itemstack);
});
state.spawnAfterBreak(worldserver, blockposition, ItemStack.EMPTY, true);
@@ -314,7 +314,7 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -302,7 +302,7 @@ public class Block extends BlockBehaviour implements ItemLike {
public static void dropResources(BlockState state, Level world, BlockPos pos) {
if (world instanceof ServerLevel) {
@@ -29,7 +20,7 @@ index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..c357e09705c5405dc8fac666fc39c993
Block.popResource(world, pos, itemstack);
});
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
@@ -324,7 +324,7 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -312,7 +312,7 @@ public class Block extends BlockBehaviour implements ItemLike {
public static void dropResources(BlockState state, LevelAccessor world, BlockPos pos, @Nullable BlockEntity blockEntity) {
if (world instanceof ServerLevel) {
@@ -38,21 +29,20 @@ index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..c357e09705c5405dc8fac666fc39c993
Block.popResource((ServerLevel) world, pos, itemstack);
});
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
@@ -351,7 +351,8 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -339,7 +339,7 @@ public class Block extends BlockBehaviour implements ItemLike {
public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, Entity entity, ItemStack tool) {
public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool) {
if (world instanceof ServerLevel) {
- Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool).forEach((itemstack1) -> {
+
+ org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(world, pos, Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool)).forEach((itemstack1) -> { // Parchment
Block.popResource(world, pos, itemstack1);
});
state.spawnAfterBreak((ServerLevel) world, pos, tool, true);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 7f6266a0b4703a580571928fa4aa1a5b0caf0a39..7681fc8163f6ac17a7d26fd6f5c5113eb634640e 100644
index eaa47fc7d5e6b8a3213f219a4146765750b2a234..ab9515e472ebce9814c34b37cece3da8f673e1e3 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1993,5 +1993,19 @@ public class CraftEventFactory {
@@ -2047,5 +2047,19 @@ public class CraftEventFactory {
}
});
}