use of net.minecraft.server.v1_13_R2.EntityFishingHook in project Citizens2 by CitizensDev.
the class NMSImpl method removeHookIfNecessary.
@Override
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
if (hook.hooked == null)
return;
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
if (npc == null)
return;
if (npc.isProtected()) {
hook.hooked = null;
hook.die();
}
}
use of net.minecraft.server.v1_13_R2.EntityFishingHook in project Citizens2 by CitizensDev.
the class NMSImpl method removeHookIfNecessary.
@Override
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
if (hook.hooked == null)
return;
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
if (npc == null)
return;
if (npc.isProtected()) {
hook.hooked = null;
hook.die();
}
}
use of net.minecraft.server.v1_13_R2.EntityFishingHook in project Citizens2 by CitizensDev.
the class NMSImpl method removeHookIfNecessary.
@Override
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
if (FISHING_HOOK_HOOKED == null)
return;
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
Entity hooked = null;
try {
hooked = (Entity) FISHING_HOOK_HOOKED.invoke(hook);
} catch (Throwable e) {
e.printStackTrace();
}
if (hooked == null)
return;
NPC npc = npcRegistry.getNPC(hooked.getBukkitEntity());
if (npc == null)
return;
if (npc.isProtected()) {
try {
FISHING_HOOK_HOOKED_SETTER.invoke(hook, null);
} catch (Throwable e) {
e.printStackTrace();
}
hook.die();
}
}
use of net.minecraft.server.v1_13_R2.EntityFishingHook in project Citizens2 by CitizensDev.
the class NMSImpl method removeHookIfNecessary.
@Override
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
if (hook.hooked == null)
return;
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
if (npc == null)
return;
if (npc.isProtected()) {
hook.hooked = null;
hook.die();
}
}
use of net.minecraft.server.v1_13_R2.EntityFishingHook in project Citizens2 by CitizensDev.
the class NMSImpl method removeHookIfNecessary.
@Override
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity) {
EntityFishingHook hook = (EntityFishingHook) NMSImpl.getHandle(entity);
if (hook.hooked == null)
return;
NPC npc = npcRegistry.getNPC(hook.hooked.getBukkitEntity());
if (npc == null)
return;
if (npc.isProtected()) {
hook.hooked = null;
hook.die();
}
}
Aggregations