MOdified method signature
This commit is contained in:
parent
fe0d058160
commit
c994315060
|
@ -36,7 +36,6 @@ import net.citizensnpcs.api.jnbt.CompoundTag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
import net.citizensnpcs.api.util.EntityDim;
|
import net.citizensnpcs.api.util.EntityDim;
|
||||||
import net.citizensnpcs.npc.ai.MCNavigationStrategy.MCNavigator;
|
import net.citizensnpcs.npc.ai.MCNavigationStrategy.MCNavigator;
|
||||||
|
@ -156,7 +155,7 @@ public interface NMSBridge {
|
||||||
|
|
||||||
public void removeFromWorld(org.bukkit.entity.Entity entity);
|
public void removeFromWorld(org.bukkit.entity.Entity entity);
|
||||||
|
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity);
|
public void removeHookIfNecessary(FishHook entity);
|
||||||
|
|
||||||
public void replaceTrackerEntry(Entity entity);
|
public void replaceTrackerEntry(Entity entity);
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1045,11 +1044,11 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
||||||
if (hook.hooked == null)
|
if (hook.hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hook.hooked.getBukkitEntity());
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return;
|
return;
|
||||||
if (npc.isProtected()) {
|
if (npc.isProtected()) {
|
||||||
|
|
|
@ -94,7 +94,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1103,11 +1102,11 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
||||||
if (hook.hooked == null)
|
if (hook.hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hook.hooked.getBukkitEntity());
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return;
|
return;
|
||||||
if (npc.isProtected()) {
|
if (npc.isProtected()) {
|
||||||
|
|
|
@ -94,7 +94,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1115,11 +1114,11 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
||||||
if (hook.hooked == null)
|
if (hook.hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hook.hooked.getBukkitEntity());
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return;
|
return;
|
||||||
if (npc.isProtected()) {
|
if (npc.isProtected()) {
|
||||||
|
|
|
@ -95,7 +95,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1152,11 +1151,11 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
||||||
if (hook.hooked == null)
|
if (hook.hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hook.hooked.getBukkitEntity());
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return;
|
return;
|
||||||
if (npc.isProtected()) {
|
if (npc.isProtected()) {
|
||||||
|
|
|
@ -93,7 +93,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1177,11 +1176,11 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
||||||
if (hook.hooked == null)
|
if (hook.hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hook.hooked.getBukkitEntity());
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return;
|
return;
|
||||||
if (npc.isProtected()) {
|
if (npc.isProtected()) {
|
||||||
|
|
|
@ -93,7 +93,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1194,11 +1193,11 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
||||||
if (hook.hooked == null)
|
if (hook.hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hook.hooked.getBukkitEntity());
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return;
|
return;
|
||||||
if (npc.isProtected()) {
|
if (npc.isProtected()) {
|
||||||
|
|
|
@ -95,7 +95,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1218,7 +1217,7 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
if (FISHING_HOOK_HOOKED == null)
|
if (FISHING_HOOK_HOOKED == null)
|
||||||
return;
|
return;
|
||||||
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
||||||
|
@ -1230,7 +1229,7 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
if (hooked == null)
|
if (hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hooked.getBukkitEntity());
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return;
|
return;
|
||||||
if (npc.isProtected()) {
|
if (npc.isProtected()) {
|
||||||
|
|
|
@ -92,7 +92,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1218,12 +1217,12 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
FishingHook hook = (FishingHook) NMSImpl.getHandle(entity);
|
FishingHook hook = (FishingHook) NMSImpl.getHandle(entity);
|
||||||
Entity hooked = hook.getHookedIn();
|
Entity hooked = hook.getHookedIn();
|
||||||
if (hooked == null)
|
if (hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hooked.getBukkitEntity());
|
||||||
if (npc != null && npc.isProtected()) {
|
if (npc != null && npc.isProtected()) {
|
||||||
hook.hookedIn = null;
|
hook.hookedIn = null;
|
||||||
hook.getBukkitEntity().remove();
|
hook.getBukkitEntity().remove();
|
||||||
|
|
|
@ -93,7 +93,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1226,12 +1225,12 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
FishingHook hook = (FishingHook) NMSImpl.getHandle(entity);
|
FishingHook hook = (FishingHook) NMSImpl.getHandle(entity);
|
||||||
Entity hooked = hook.getHookedIn();
|
Entity hooked = hook.getHookedIn();
|
||||||
if (hooked == null)
|
if (hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hooked.getBukkitEntity());
|
||||||
if (npc != null && npc.isProtected()) {
|
if (npc != null && npc.isProtected()) {
|
||||||
hook.hookedIn = null;
|
hook.hookedIn = null;
|
||||||
hook.getBukkitEntity().remove();
|
hook.getBukkitEntity().remove();
|
||||||
|
|
|
@ -98,7 +98,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1326,12 +1325,12 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
FishingHook hook = (FishingHook) getHandle(entity);
|
FishingHook hook = (FishingHook) getHandle(entity);
|
||||||
Entity hooked = hook.getHookedIn();
|
Entity hooked = hook.getHookedIn();
|
||||||
if (hooked == null)
|
if (hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hooked.getBukkitEntity());
|
||||||
if (npc != null && npc.isProtected()) {
|
if (npc != null && npc.isProtected()) {
|
||||||
hook.hookedIn = null;
|
hook.hookedIn = null;
|
||||||
hook.getBukkitEntity().remove();
|
hook.getBukkitEntity().remove();
|
||||||
|
|
|
@ -97,7 +97,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
import net.citizensnpcs.api.trait.TraitInfo;
|
import net.citizensnpcs.api.trait.TraitInfo;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
|
@ -1327,12 +1326,12 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
FishingHook hook = (FishingHook) getHandle(entity);
|
FishingHook hook = (FishingHook) getHandle(entity);
|
||||||
Entity hooked = hook.getHookedIn();
|
Entity hooked = hook.getHookedIn();
|
||||||
if (hooked == null)
|
if (hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hooked.getBukkitEntity());
|
||||||
if (npc != null && npc.isProtected()) {
|
if (npc != null && npc.isProtected()) {
|
||||||
hook.hookedIn = null;
|
hook.hookedIn = null;
|
||||||
hook.getBukkitEntity().remove();
|
hook.getBukkitEntity().remove();
|
||||||
|
|
|
@ -91,7 +91,6 @@ import net.citizensnpcs.api.jnbt.Tag;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker;
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
||||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
import net.citizensnpcs.api.util.BoundingBox;
|
||||||
import net.citizensnpcs.api.util.EntityDim;
|
import net.citizensnpcs.api.util.EntityDim;
|
||||||
import net.citizensnpcs.api.util.Messaging;
|
import net.citizensnpcs.api.util.Messaging;
|
||||||
|
@ -976,11 +975,11 @@ public class NMSImpl implements NMSBridge {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
|
public void removeHookIfNecessary(FishHook entity) {
|
||||||
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
|
||||||
if (hook.hooked == null)
|
if (hook.hooked == null)
|
||||||
return;
|
return;
|
||||||
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
|
NPC npc = CitizensAPI.getNPCRegistry().getNPC(hook.hooked.getBukkitEntity());
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return;
|
return;
|
||||||
if (npc.isProtected()) {
|
if (npc.isProtected()) {
|
||||||
|
|
Loading…
Reference in New Issue