readd debugstick check

This commit is contained in:
Lulu13022002
2024-12-15 15:55:13 +01:00
parent 9346db2844
commit ac9ac5e7ea
13 changed files with 111 additions and 113 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/ExperienceBottleItem.java
+++ b/net/minecraft/world/item/ExperienceBottleItem.java
@@ -21,22 +_,38 @@
@@ -21,22 +_,36 @@
@Override
public InteractionResult use(Level level, Player player, InteractionHand hand) {
ItemStack itemInHand = player.getItemInHand(hand);
@@ -23,8 +23,8 @@
+ if (event.callEvent() && thrownExperienceBottle.attemptSpawn()) {
+ if (event.shouldConsume()) {
+ itemInHand.consume(1, player);
+ } else if (player instanceof net.minecraft.server.level.ServerPlayer) {
+ ((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity().updateInventory();
+ } else {
+ player.containerMenu.sendAllDataToRemote();
+ }
+
+ level.playSound(
@@ -38,9 +38,7 @@
+ 0.4F / (level.getRandom().nextFloat() * 0.4F + 0.8F)
+ );
+ } else {
+ if (player instanceof net.minecraft.server.level.ServerPlayer) {
+ ((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity().updateInventory();
+ }
+ player.containerMenu.sendAllDataToRemote();
+ return InteractionResult.FAIL;
+ }
+ // Paper end - PlayerLaunchProjectileEvent