Compiler issues v3

This commit is contained in:
Bjarne Koll 2024-10-25 14:55:49 +02:00
parent 6fb86bb20a
commit 918ca965d9
No known key found for this signature in database
GPG key ID: 27F6CCCF55D2EE62
53 changed files with 154 additions and 124 deletions

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerShearBlockEvent
diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
index 7e2a39a1ee092b46ab46caec0214255d9c333536..a5b84e6844e16cf1fdfb6f45efb8a7a165757d1c 100644
index 7e2a39a1ee092b46ab46caec0214255d9c333536..20f705c90a0a96321cfe29c0cf564013dcccd18f 100644
--- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
@@ -141,7 +141,7 @@ public class BeehiveBlock extends BaseEntityBlock {
@ -25,7 +25,7 @@ index 7e2a39a1ee092b46ab46caec0214255d9c333536..a5b84e6844e16cf1fdfb6f45efb8a7a1
+ io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(stack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>());
+ event.getDrops().add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(new ItemStack(Items.HONEYCOMB, 3)));
+ if (!event.callEvent()) {
+ return ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION;
+ return InteractionResult.PASS;
+ }
+ // Paper end
world.playSound(player, player.getX(), player.getY(), player.getZ(), SoundEvents.BEEHIVE_SHEAR, SoundSource.BLOCKS, 1.0F, 1.0F);
@ -39,7 +39,7 @@ index 7e2a39a1ee092b46ab46caec0214255d9c333536..a5b84e6844e16cf1fdfb6f45efb8a7a1
flag = true;
world.gameEvent((Entity) player, (Holder) GameEvent.SHEAR, pos);
diff --git a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java
index dad7a610286b0ab6b916a6169fa8f6f641deb39a..42413723b3c826debb310ef1d5d2c9f80a616e86 100644
index dad7a610286b0ab6b916a6169fa8f6f641deb39a..2b43c77d5aa609d4716df827cefcf008dfd13a06 100644
--- a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java
@@ -38,16 +38,24 @@ public class PumpkinBlock extends Block {
@ -50,7 +50,7 @@ index dad7a610286b0ab6b916a6169fa8f6f641deb39a..42413723b3c826debb310ef1d5d2c9f8
+ io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(stack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>());
+ event.getDrops().add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(new ItemStack(Items.PUMPKIN_SEEDS, 4)));
+ if (!event.callEvent()) {
+ return ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION;
+ return InteractionResult.PASS;
+ }
+ // Paper end - Add PlayerShearBlockEvent
Direction direction = hit.getDirection();