Search in sources :

Example 1 with EntityFishingHook

use of net.minecraft.server.v1_8_R3.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();
    }
}
Also used : EntityHumanNPC(net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC) NPC(net.citizensnpcs.api.npc.NPC) EntityFishingHook(net.minecraft.server.v1_10_R1.EntityFishingHook)

Example 2 with EntityFishingHook

use of net.minecraft.server.v1_8_R3.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();
    }
}
Also used : EntityHumanNPC(net.citizensnpcs.nms.v1_8_R3.entity.EntityHumanNPC) NPC(net.citizensnpcs.api.npc.NPC) EntityFishingHook(net.minecraft.server.v1_8_R3.EntityFishingHook)

Example 3 with EntityFishingHook

use of net.minecraft.server.v1_8_R3.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();
    }
}
Also used : EntityShulkerNPC(net.citizensnpcs.nms.v1_11_R1.entity.ShulkerController.EntityShulkerNPC) NPC(net.citizensnpcs.api.npc.NPC) EntityHumanNPC(net.citizensnpcs.nms.v1_11_R1.entity.EntityHumanNPC) EntityFishingHook(net.minecraft.server.v1_11_R1.EntityFishingHook)

Example 4 with EntityFishingHook

use of net.minecraft.server.v1_8_R3.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();
    }
}
Also used : NPC(net.citizensnpcs.api.npc.NPC) EntityHumanNPC(net.citizensnpcs.nms.v1_12_R1.entity.EntityHumanNPC) EntityFishingHook(net.minecraft.server.v1_12_R1.EntityFishingHook)

Aggregations

NPC (net.citizensnpcs.api.npc.NPC)4 EntityHumanNPC (net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_11_R1.entity.EntityHumanNPC)1 EntityShulkerNPC (net.citizensnpcs.nms.v1_11_R1.entity.ShulkerController.EntityShulkerNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_12_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_8_R3.entity.EntityHumanNPC)1 EntityFishingHook (net.minecraft.server.v1_10_R1.EntityFishingHook)1 EntityFishingHook (net.minecraft.server.v1_11_R1.EntityFishingHook)1 EntityFishingHook (net.minecraft.server.v1_12_R1.EntityFishingHook)1 EntityFishingHook (net.minecraft.server.v1_8_R3.EntityFishingHook)1