Search in sources :

Example 6 with EntityFishingHook

use of net.minecraft.server.v1_16_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_11_R1.entity.EntityHumanNPC) EntityFishingHook(net.minecraft.server.v1_11_R1.EntityFishingHook)

Example 7 with EntityFishingHook

use of net.minecraft.server.v1_16_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_15_R1.entity.EntityHumanNPC) NPC(net.citizensnpcs.api.npc.NPC) EntityFishingHook(net.minecraft.server.v1_15_R1.EntityFishingHook)

Example 8 with EntityFishingHook

use of net.minecraft.server.v1_16_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)8 EntityHumanNPC (net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_11_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_12_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_13_R2.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_14_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_15_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_16_R3.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_8_R3.entity.EntityHumanNPC)1 SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)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_13_R2.EntityFishingHook)1 EntityFishingHook (net.minecraft.server.v1_14_R1.EntityFishingHook)1 EntityFishingHook (net.minecraft.server.v1_15_R1.EntityFishingHook)1 Entity (net.minecraft.server.v1_16_R3.Entity)1 EntityFishingHook (net.minecraft.server.v1_16_R3.EntityFishingHook)1 PathEntity (net.minecraft.server.v1_16_R3.PathEntity)1 EntityFishingHook (net.minecraft.server.v1_8_R3.EntityFishingHook)1