2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/world/item/ItemTrident.java
|
|
|
|
+++ b/net/minecraft/world/item/ItemTrident.java
|
2024-04-24 01:15:00 +10:00
|
|
|
@@ -72,7 +72,7 @@
|
2018-09-15 19:07:03 +10:00
|
|
|
|
2019-04-23 12:00:00 +10:00
|
|
|
if (k <= 0 || entityhuman.isInWaterOrRain()) {
|
2018-09-15 19:07:03 +10:00
|
|
|
if (!world.isClientSide) {
|
2024-04-24 01:15:00 +10:00
|
|
|
- itemstack.hurtAndBreak(1, entityhuman, EntityLiving.getSlotForHand(entityliving.getUsedItemHand()));
|
|
|
|
+ // itemstack.hurtAndBreak(1, entityhuman, EntityLiving.getSlotForHand(entityliving.getUsedItemHand())); // CraftBukkit - moved down
|
2018-09-15 19:07:03 +10:00
|
|
|
if (k == 0) {
|
|
|
|
EntityThrownTrident entitythrowntrident = new EntityThrownTrident(world, entityhuman, itemstack);
|
|
|
|
|
2024-04-24 01:15:00 +10:00
|
|
|
@@ -81,11 +81,26 @@
|
2021-06-11 15:00:00 +10:00
|
|
|
entitythrowntrident.pickup = EntityArrow.PickupStatus.CREATIVE_ONLY;
|
2018-09-15 15:31:39 +10:00
|
|
|
}
|
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
- world.addFreshEntity(entitythrowntrident);
|
2018-09-15 15:31:39 +10:00
|
|
|
+ // CraftBukkit start
|
2021-11-22 09:00:00 +11:00
|
|
|
+ if (!world.addFreshEntity(entitythrowntrident)) {
|
2021-03-16 09:00:00 +11:00
|
|
|
+ if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
|
|
|
|
+ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
2018-09-15 15:31:39 +10:00
|
|
|
+ }
|
|
|
|
+ return;
|
|
|
|
+ }
|
2018-09-15 19:07:03 +10:00
|
|
|
+
|
2024-04-24 01:15:00 +10:00
|
|
|
+ itemstack.hurtAndBreak(1, entityhuman, EntityLiving.getSlotForHand(entityliving.getUsedItemHand()));
|
2023-12-06 03:40:00 +11:00
|
|
|
+ entitythrowntrident.pickupItemStack = itemstack.copy(); // SPIGOT-4511 update since damage call moved
|
2018-09-15 15:31:39 +10:00
|
|
|
+ // CraftBukkit end
|
|
|
|
+
|
2021-06-11 15:00:00 +10:00
|
|
|
world.playSound((EntityHuman) null, (Entity) entitythrowntrident, SoundEffects.TRIDENT_THROW, SoundCategory.PLAYERS, 1.0F, 1.0F);
|
2024-04-24 01:15:00 +10:00
|
|
|
if (!entityhuman.hasInfiniteMaterials()) {
|
2021-11-22 09:00:00 +11:00
|
|
|
entityhuman.getInventory().removeItem(itemstack);
|
2019-12-17 12:22:53 +11:00
|
|
|
}
|
2021-01-31 10:08:41 +11:00
|
|
|
+ // CraftBukkit start - SPIGOT-5458 also need in this branch :(
|
|
|
|
+ } else {
|
2024-04-24 01:15:00 +10:00
|
|
|
+ itemstack.hurtAndBreak(1, entityhuman, EntityLiving.getSlotForHand(entityliving.getUsedItemHand()));
|
2021-01-31 10:08:41 +11:00
|
|
|
+ // CraftBukkkit end
|
|
|
|
}
|
2019-12-17 12:22:53 +11:00
|
|
|
}
|
2018-08-02 09:38:52 +10:00
|
|
|
|
2024-04-24 01:15:00 +10:00
|
|
|
@@ -102,6 +117,7 @@
|
2024-03-10 09:27:44 +11:00
|
|
|
f2 *= f6 / f5;
|
|
|
|
f3 *= f6 / f5;
|
|
|
|
f4 *= f6 / f5;
|
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerRiptideEvent(entityhuman, itemstack, f2, f3, f4); // CraftBukkit
|
|
|
|
entityhuman.push((double) f2, (double) f3, (double) f4);
|
|
|
|
entityhuman.startAutoSpinAttack(20);
|
|
|
|
if (entityhuman.onGround()) {
|