Repackage NMS

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-03-16 09:00:00 +11:00
parent 18496e998f
commit 9da047989c
968 changed files with 5448 additions and 5050 deletions

View File

@@ -1,14 +1,15 @@
--- a/net/minecraft/server/ItemFishingRod.java
+++ b/net/minecraft/server/ItemFishingRod.java
@@ -1,5 +1,7 @@
package net.minecraft.server;
--- a/net/minecraft/world/item/ItemFishingRod.java
+++ b/net/minecraft/world/item/ItemFishingRod.java
@@ -10,6 +10,8 @@
import net.minecraft.world.item.enchantment.EnchantmentManager;
import net.minecraft.world.level.World;
+import org.bukkit.event.player.PlayerFishEvent; // CraftBukkit
+
public class ItemFishingRod extends Item implements ItemVanishable {
public ItemFishingRod(Item.Info item_info) {
@@ -21,12 +23,23 @@
@@ -31,12 +33,23 @@
world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_RETRIEVE, SoundCategory.NEUTRAL, 1.0F, 0.4F / (ItemFishingRod.RANDOM.nextFloat() * 0.4F + 0.8F));
} else {
@@ -26,7 +27,7 @@
+
+ if (playerFishEvent.isCancelled()) {
+ entityhuman.hookedFish = null;
+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
+ return InteractionResultWrapper.pass(itemstack);
+ }
+ world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.RANDOM.nextFloat() * 0.4F + 0.8F));
+ world.addEntity(entityfishinghook);