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