aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0483-Add-EntityLoadCrossbowEvent.patch
diff options
context:
space:
mode:
authormaxcom1 <[email protected]>2024-03-23 22:26:17 +0100
committerGitHub <[email protected]>2024-03-23 17:26:17 -0400
commitb6001403e9703cadaa6e8c8558e732b91c3c6d6e (patch)
treea8c57bbc334a8ad48d4ad2b43db335667b142bee /patches/server/0483-Add-EntityLoadCrossbowEvent.patch
parent9ec7dfcbc41c6e625de0050b6997160a75df9f44 (diff)
downloadPaper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.tar.gz
Paper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.zip
Add methods to change entity physics (#10334)
Diffstat (limited to 'patches/server/0483-Add-EntityLoadCrossbowEvent.patch')
-rw-r--r--patches/server/0483-Add-EntityLoadCrossbowEvent.patch44
1 files changed, 0 insertions, 44 deletions
diff --git a/patches/server/0483-Add-EntityLoadCrossbowEvent.patch b/patches/server/0483-Add-EntityLoadCrossbowEvent.patch
deleted file mode 100644
index ae4000c9dc..0000000000
--- a/patches/server/0483-Add-EntityLoadCrossbowEvent.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: JRoy <[email protected]>
-Date: Wed, 7 Oct 2020 12:04:01 -0400
-Subject: [PATCH] Add EntityLoadCrossbowEvent
-
-
-diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java
-index ba570f1c9654e1004e068a1efe2118f36c954505..f3a428f80c265639250114498b10067b4bf1ada1 100644
---- a/src/main/java/net/minecraft/world/item/CrossbowItem.java
-+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java
-@@ -89,7 +89,14 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable {
- int j = this.getUseDuration(stack) - remainingUseTicks;
- float f = CrossbowItem.getPowerForTime(j, stack);
-
-- if (f >= 1.0F && !CrossbowItem.isCharged(stack) && CrossbowItem.tryLoadProjectiles(user, stack)) {
-+ // Paper start - Add EntityLoadCrossbowEvent
-+ if (f >= 1.0F && !CrossbowItem.isCharged(stack) /*&& CrossbowItem.tryLoadProjectiles(entityliving, itemstack)*/) {
-+ final io.papermc.paper.event.entity.EntityLoadCrossbowEvent event = new io.papermc.paper.event.entity.EntityLoadCrossbowEvent(user.getBukkitLivingEntity(), stack.asBukkitMirror(), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(user.getUsedItemHand()));
-+ if (!event.callEvent() || !tryLoadProjectiles(user, stack, event.shouldConsumeItem())) {
-+ if (user instanceof ServerPlayer player) player.containerMenu.sendAllDataToRemote();
-+ return;
-+ }
-+ // Paper end - Add EntityLoadCrossbowEvent
- CrossbowItem.setCharged(stack, true);
- SoundSource soundcategory = user instanceof Player ? SoundSource.PLAYERS : SoundSource.HOSTILE;
-
-@@ -98,10 +105,16 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable {
-
- }
-
-+ @io.papermc.paper.annotation.DoNotUse // Paper - Add EntityLoadCrossbowEvent
- private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow) {
-+ // Paper start - Add EntityLoadCrossbowEvent
-+ return CrossbowItem.tryLoadProjectiles(shooter, crossbow, true);
-+ }
-+ private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow, boolean consume) {
-+ // Paper end - Add EntityLoadCrossbowEvent
- int i = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.MULTISHOT, crossbow);
- int j = i == 0 ? 1 : 3;
-- boolean flag = shooter instanceof Player && ((Player) shooter).getAbilities().instabuild;
-+ boolean flag = !consume || shooter instanceof Player && ((Player) shooter).getAbilities().instabuild; // Paper - Add EntityLoadCrossbowEvent
- ItemStack itemstack1 = shooter.getProjectile(crossbow);
- ItemStack itemstack2 = itemstack1.copy();
-