mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Implement knockback event
This commit is contained in:
parent
da19c909fe
commit
ed9230c680
@ -8,11 +8,13 @@ import org.bukkit.entity.Bat;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityBat;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_10_R1.SoundEffect;
|
||||
@ -57,6 +59,14 @@ public class BatController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.Blaze;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityBlaze;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_10_R1.SoundEffect;
|
||||
@ -54,6 +56,14 @@ public class BlazeController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.CaveSpider;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityCaveSpider;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -63,6 +65,14 @@ public class CaveSpiderController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Chicken;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityChicken;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -74,6 +76,14 @@ public class ChickenController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Cow;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityCow;
|
||||
import net.minecraft.server.v1_10_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_10_R1.EnumHand;
|
||||
@ -78,6 +80,14 @@ public class CowController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) {
|
||||
if (npc == null || !npc.isProtected())
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Creeper;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityCreeper;
|
||||
import net.minecraft.server.v1_10_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_10_R1.EntityLightning;
|
||||
@ -50,6 +52,7 @@ public class CreeperController extends MobEntityController {
|
||||
|
||||
public static class EntityCreeperNPC extends EntityCreeper implements NPCHolder {
|
||||
private boolean allowPowered;
|
||||
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public EntityCreeperNPC(World world) {
|
||||
@ -68,6 +71,14 @@ public class CreeperController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) {
|
||||
return npc == null || !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.EnderDragon;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityEnderDragon;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_10_R1.SoundEffect;
|
||||
@ -54,6 +56,14 @@ public class EnderDragonController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Enderman;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityEnderman;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -63,6 +65,14 @@ public class EndermanController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Endermite;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityEndermite;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -63,6 +65,14 @@ public class EndermiteController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -104,11 +104,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
public float a(PathType pathtype) {
|
||||
return this.bz.containsKey(pathtype) ? this.bz.get(pathtype).floatValue() : pathtype.a();
|
||||
return this.bz.containsKey(pathtype) ? this.bz.get(pathtype) : pathtype.a();
|
||||
}
|
||||
|
||||
public void a(PathType pathtype, float f) {
|
||||
this.bz.put(pathtype, Float.valueOf(f));
|
||||
this.bz.put(pathtype, f);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.Ghast;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityGhast;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_10_R1.SoundEffect;
|
||||
@ -40,6 +42,14 @@ public class GhastController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Giant;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityGiantZombie;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class GiantController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Guardian;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityGuardian;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class GuardianController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -9,6 +9,7 @@ import org.bukkit.entity.Horse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -17,6 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityHorse;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -72,6 +74,14 @@ public class HorseController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.IronGolem;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityIronGolem;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class IronGolemController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.MagmaCube;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.PlayerControllerMove;
|
||||
@ -15,6 +16,7 @@ import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_10_R1.EntityMagmaCube;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
@ -55,6 +57,14 @@ public class MagmaCubeController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.MushroomCow;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_10_R1.EntityMushroomCow;
|
||||
import net.minecraft.server.v1_10_R1.EnumHand;
|
||||
@ -64,6 +66,14 @@ public class MushroomCowController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) {
|
||||
if (npc == null || !npc.isProtected())
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Ocelot;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityOcelot;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -60,6 +62,14 @@ public class OcelotController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Pig;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityLightning;
|
||||
import net.minecraft.server.v1_10_R1.EntityPig;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
@ -61,6 +63,14 @@ public class PigController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.PigZombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityPigZombie;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -50,6 +52,14 @@ public class PigZombieController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.PolarBear;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityPolarBear;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_10_R1.SoundEffect;
|
||||
@ -51,6 +53,14 @@ public class PolarBearController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Rabbit;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityLiving;
|
||||
import net.minecraft.server.v1_10_R1.EntityRabbit;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
@ -61,6 +63,14 @@ public class RabbitController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntitySheep;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -60,6 +62,14 @@ public class SheepController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Shulker;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityAIBodyControl;
|
||||
import net.minecraft.server.v1_10_R1.EntityShulker;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
@ -50,6 +52,14 @@ public class ShulkerController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Silverfish;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntitySilverfish;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SilverfishController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Skeleton;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntitySkeleton;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SkeletonController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.Slime;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.PlayerControllerMove;
|
||||
@ -15,6 +16,7 @@ import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_10_R1.EntitySlime;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
@ -55,6 +57,14 @@ public class SlimeController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Snowman;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntitySnowman;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SnowmanController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Spider;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntitySpider;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SpiderController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Squid;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntitySquid;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SquidController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Villager;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_10_R1.EntityLightning;
|
||||
import net.minecraft.server.v1_10_R1.EntityVillager;
|
||||
@ -36,6 +38,7 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
|
||||
private boolean blockingATrade;
|
||||
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public EntityVillagerNPC(World world) {
|
||||
@ -65,6 +68,14 @@ public class VillagerController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) {
|
||||
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Witch;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityWitch;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class WitchController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.Wither;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityWither;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_10_R1.SoundEffect;
|
||||
@ -40,6 +42,14 @@ public class WitherController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -9,12 +9,14 @@ import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityLiving;
|
||||
import net.minecraft.server.v1_10_R1.EntityWolf;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
@ -62,6 +64,14 @@ public class WolfController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Zombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_10_R1.Entity;
|
||||
import net.minecraft.server.v1_10_R1.EntityZombie;
|
||||
import net.minecraft.server.v1_10_R1.IBlockData;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class ZombieController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -89,15 +89,6 @@ public class BoatController extends MobEntityController {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(float f, float f1) {
|
||||
if (npc == null) {
|
||||
super.setSize(f, f1);
|
||||
} else {
|
||||
NMSImpl.setSize(this, f, f1, justCreated);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void m() {
|
||||
if (npc != null) {
|
||||
@ -106,5 +97,14 @@ public class BoatController extends MobEntityController {
|
||||
super.m();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(float f, float f1) {
|
||||
if (npc == null) {
|
||||
super.setSize(f, f1);
|
||||
} else {
|
||||
NMSImpl.setSize(this, f, f1, justCreated);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -63,11 +63,6 @@ public class EggController extends AbstractEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
public EntityEggNPC(World world, NPC npc, double d0, double d1, double d2) {
|
||||
super(world, d0, d1, d2);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -83,6 +78,11 @@ public class EggController extends AbstractEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
|
@ -47,11 +47,6 @@ public class EnderCrystalController extends MobEntityController {
|
||||
this(world, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
public EntityEnderCrystalNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -67,6 +62,11 @@ public class EnderCrystalController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
|
@ -47,11 +47,6 @@ public class EnderSignalController extends MobEntityController {
|
||||
this(world, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
public EntityEnderSignalNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -67,6 +62,11 @@ public class EnderSignalController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
|
@ -38,11 +38,6 @@ public class FireworkController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
@ -53,6 +48,11 @@ public class FireworkController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
|
@ -75,15 +75,6 @@ public class LargeFireballController extends MobEntityController {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(float f, float f1) {
|
||||
if (npc == null) {
|
||||
super.setSize(f, f1);
|
||||
} else {
|
||||
NMSImpl.setSize(this, f, f1, justCreated);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void m() {
|
||||
if (npc != null) {
|
||||
@ -95,6 +86,15 @@ public class LargeFireballController extends MobEntityController {
|
||||
super.m();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(float f, float f1) {
|
||||
if (npc == null) {
|
||||
super.setSize(f, f1);
|
||||
} else {
|
||||
NMSImpl.setSize(this, f, f1, justCreated);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class LargeFireballNPC extends CraftLargeFireball implements NPCHolder {
|
||||
|
@ -38,11 +38,6 @@ public class PaintingController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
@ -53,6 +48,11 @@ public class PaintingController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
|
@ -26,20 +26,6 @@ public class SnowballController extends MobEntityController {
|
||||
return (Snowball) super.getBukkitEntity();
|
||||
}
|
||||
|
||||
public static class SnowballNPC extends CraftSnowball implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public SnowballNPC(EntitySnowballNPC entity) {
|
||||
super((CraftServer) Bukkit.getServer(), entity);
|
||||
this.npc = entity.npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NPC getNPC() {
|
||||
return npc;
|
||||
}
|
||||
}
|
||||
|
||||
public static class EntitySnowballNPC extends EntitySnowball implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
@ -47,11 +33,6 @@ public class SnowballController extends MobEntityController {
|
||||
this(world, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
public EntitySnowballNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -67,6 +48,11 @@ public class SnowballController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
@ -97,4 +83,18 @@ public class SnowballController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class SnowballNPC extends CraftSnowball implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public SnowballNPC(EntitySnowballNPC entity) {
|
||||
super((CraftServer) Bukkit.getServer(), entity);
|
||||
this.npc = entity.npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NPC getNPC() {
|
||||
return npc;
|
||||
}
|
||||
}
|
||||
}
|
@ -33,11 +33,6 @@ public class TNTPrimedController extends MobEntityController {
|
||||
this(world, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
public EntityTNTPrimedNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -53,6 +48,11 @@ public class TNTPrimedController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
|
@ -33,11 +33,6 @@ public class WitherSkullController extends MobEntityController {
|
||||
this(world, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
public EntityWitherSkullNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -53,6 +48,11 @@ public class WitherSkullController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
|
@ -1353,7 +1353,7 @@ public class NMSImpl implements NMSBridge {
|
||||
@Override
|
||||
public void update() {
|
||||
updateNavigation(navigation);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private static class NavigationIterable implements Iterable<Vector> {
|
||||
|
@ -130,13 +130,7 @@ public class PlayerNavigation extends NavigationAbstract {
|
||||
if (d1 * paramDouble1 + d2 * paramDouble2 >= 0.0D) {
|
||||
PathType localPathType = this.e.a(this.b, k, paramInt2 - 1, m, this.a, paramInt4, paramInt5,
|
||||
paramInt6, true, true);
|
||||
if (localPathType == PathType.WATER) {
|
||||
return false;
|
||||
}
|
||||
if (localPathType == PathType.LAVA) {
|
||||
return false;
|
||||
}
|
||||
if (localPathType == PathType.OPEN) {
|
||||
if ((localPathType == PathType.WATER) || (localPathType == PathType.LAVA) || (localPathType == PathType.OPEN)) {
|
||||
return false;
|
||||
}
|
||||
localPathType = this.e.a(this.b, k, paramInt2, m, this.a, paramInt4, paramInt5, paramInt6, true,
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.Bat;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityBat;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_11_R1.SoundEffect;
|
||||
@ -57,6 +59,14 @@ public class BatController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.Blaze;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityBlaze;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_11_R1.SoundEffect;
|
||||
@ -54,6 +56,14 @@ public class BlazeController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.CaveSpider;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityCaveSpider;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -63,6 +65,14 @@ public class CaveSpiderController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Chicken;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityChicken;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -74,6 +76,14 @@ public class ChickenController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Cow;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityCow;
|
||||
import net.minecraft.server.v1_11_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_11_R1.EnumHand;
|
||||
@ -78,6 +80,14 @@ public class CowController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
if (npc == null || !npc.isProtected())
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Creeper;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityCreeper;
|
||||
import net.minecraft.server.v1_11_R1.EntityLightning;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
@ -47,6 +49,7 @@ public class CreeperController extends MobEntityController {
|
||||
|
||||
public static class EntityCreeperNPC extends EntityCreeper implements NPCHolder {
|
||||
private boolean allowPowered;
|
||||
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public EntityCreeperNPC(World world) {
|
||||
@ -65,6 +68,14 @@ public class CreeperController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.EnderDragon;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityEnderDragon;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_11_R1.SoundEffect;
|
||||
@ -54,6 +56,14 @@ public class EnderDragonController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Enderman;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityEnderman;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -63,6 +65,14 @@ public class EndermanController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Endermite;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityEndermite;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -63,6 +65,14 @@ public class EndermiteController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -106,11 +106,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
public float a(PathType pathtype) {
|
||||
return this.bz.containsKey(pathtype) ? this.bz.get(pathtype).floatValue() : pathtype.a();
|
||||
return this.bz.containsKey(pathtype) ? this.bz.get(pathtype) : pathtype.a();
|
||||
}
|
||||
|
||||
public void a(PathType pathtype, float f) {
|
||||
this.bz.put(pathtype, Float.valueOf(f));
|
||||
this.bz.put(pathtype, f);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Evoker;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityEvoker;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class EvokerController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.Ghast;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityGhast;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_11_R1.SoundEffect;
|
||||
@ -40,6 +42,14 @@ public class GhastController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Giant;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityGiantZombie;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class GiantController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Guardian;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityGuardian;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class GuardianController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.ElderGuardian;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityGuardianElder;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class GuardianElderController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -9,6 +9,7 @@ import org.bukkit.entity.Horse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -17,6 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityHorse;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -72,6 +74,14 @@ public class HorseController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -9,6 +9,7 @@ import org.bukkit.entity.Donkey;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -17,6 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityHorseDonkey;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -72,6 +74,14 @@ public class HorseDonkeyController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -9,6 +9,7 @@ import org.bukkit.entity.Mule;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -17,6 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityHorseMule;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -72,6 +74,14 @@ public class HorseMuleController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -9,6 +9,7 @@ import org.bukkit.entity.SkeletonHorse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -17,6 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityHorseSkeleton;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -73,6 +75,14 @@ public class HorseSkeletonController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -9,6 +9,7 @@ import org.bukkit.entity.ZombieHorse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -17,6 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityHorseZombie;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -73,6 +75,14 @@ public class HorseZombieController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.IronGolem;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityIronGolem;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class IronGolemController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -9,6 +9,7 @@ import org.bukkit.entity.Llama;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
@ -17,6 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityLlama;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -72,6 +74,14 @@ public class LlamaController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.MagmaCube;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.PlayerControllerMove;
|
||||
@ -15,6 +16,7 @@ import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_11_R1.EntityMagmaCube;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
@ -55,6 +57,14 @@ public class MagmaCubeController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
super.A_();
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.MushroomCow;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_11_R1.EntityMushroomCow;
|
||||
import net.minecraft.server.v1_11_R1.EnumHand;
|
||||
@ -63,6 +65,14 @@ public class MushroomCowController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
if (npc == null || !npc.isProtected())
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Ocelot;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityOcelot;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -60,6 +62,14 @@ public class OcelotController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Pig;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityLightning;
|
||||
import net.minecraft.server.v1_11_R1.EntityPig;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
@ -61,6 +63,14 @@ public class PigController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.PigZombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityPigZombie;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -50,6 +52,14 @@ public class PigZombieController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.PolarBear;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityPolarBear;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_11_R1.SoundEffect;
|
||||
@ -51,6 +53,14 @@ public class PolarBearController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Rabbit;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityLiving;
|
||||
import net.minecraft.server.v1_11_R1.EntityRabbit;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
@ -61,6 +63,14 @@ public class RabbitController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntitySheep;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -60,6 +62,14 @@ public class SheepController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -9,12 +9,14 @@ import org.bukkit.entity.Shulker;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityAIBodyControl;
|
||||
import net.minecraft.server.v1_11_R1.EntityShulker;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
@ -51,6 +53,14 @@ public class ShulkerController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Silverfish;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntitySilverfish;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SilverfishController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Skeleton;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntitySkeleton;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SkeletonController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Stray;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntitySkeletonStray;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SkeletonStrayController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.WitherSkeleton;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntitySkeletonWither;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SkeletonWitherController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.Slime;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.PlayerControllerMove;
|
||||
@ -15,6 +16,7 @@ import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_11_R1.EntitySlime;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
@ -55,6 +57,14 @@ public class SlimeController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
super.A_();
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Snowman;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntitySnowman;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SnowmanController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Spider;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntitySpider;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SpiderController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Squid;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntitySquid;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class SquidController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.Vex;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityVex;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_11_R1.SoundEffect;
|
||||
@ -43,6 +45,14 @@ public class VexController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -10,12 +10,14 @@ import org.bukkit.entity.Villager;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_11_R1.EntityLightning;
|
||||
import net.minecraft.server.v1_11_R1.EntityVillager;
|
||||
@ -38,6 +40,7 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
|
||||
private boolean blockingATrade;
|
||||
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public EntityVillagerNPC(World world) {
|
||||
@ -67,6 +70,14 @@ public class VillagerController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Vindicator;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityVindicator;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -60,6 +62,14 @@ public class VindicatorController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Witch;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityWitch;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class WitchController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,11 +8,13 @@ import org.bukkit.entity.Wither;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityWither;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_11_R1.SoundEffect;
|
||||
@ -40,6 +42,14 @@ public class WitherController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -9,12 +9,14 @@ import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityLiving;
|
||||
import net.minecraft.server.v1_11_R1.EntityWolf;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
@ -62,6 +64,14 @@ public class WolfController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Zombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityZombie;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class ZombieController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.Husk;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityZombieHusk;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class ZombieHuskController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -8,12 +8,14 @@ import org.bukkit.entity.ZombieVillager;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
import net.citizensnpcs.api.event.NPCKnockbackEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_11_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityZombieVillager;
|
||||
import net.minecraft.server.v1_11_R1.IBlockData;
|
||||
import net.minecraft.server.v1_11_R1.NBTTagCompound;
|
||||
@ -49,6 +51,14 @@ public class ZombieVillagerController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity entity, float strength, double dx, double dz) {
|
||||
NPCKnockbackEvent event = new NPCKnockbackEvent(npc, strength, dx, dz);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
Vector kb = event.getKnockbackVector();
|
||||
super.a(entity, (float) event.getStrength(), kb.getX(), kb.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
|
@ -53,6 +53,18 @@ public class DragonFireballController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.A_();
|
||||
}
|
||||
} else {
|
||||
super.A_();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_11_R1.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
@ -89,18 +101,6 @@ public class DragonFireballController extends MobEntityController {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.A_();
|
||||
}
|
||||
} else {
|
||||
super.A_();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(float f, float f1) {
|
||||
if (npc == null) {
|
||||
|
@ -63,16 +63,23 @@ public class EggController extends AbstractEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
public EntityEggNPC(World world, NPC npc, double d0, double d1, double d2) {
|
||||
super(world, d0, d1, d2);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.A_();
|
||||
}
|
||||
} else {
|
||||
super.A_();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_11_R1.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
@ -83,6 +90,11 @@ public class EggController extends AbstractEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void f(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
@ -103,17 +115,5 @@ public class EggController extends AbstractEntityController {
|
||||
public NPC getNPC() {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.A_();
|
||||
}
|
||||
} else {
|
||||
super.A_();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -47,16 +47,20 @@ public class EnderCrystalController extends MobEntityController {
|
||||
this(world, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
public EntityEnderCrystalNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
} else {
|
||||
super.A_();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_11_R1.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
@ -67,6 +71,11 @@ public class EnderCrystalController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void f(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
@ -87,14 +96,5 @@ public class EnderCrystalController extends MobEntityController {
|
||||
public NPC getNPC() {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
} else {
|
||||
super.A_();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -52,6 +52,18 @@ public class EnderPearlController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.A_();
|
||||
}
|
||||
} else {
|
||||
super.A_();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_11_R1.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
@ -87,17 +99,5 @@ public class EnderPearlController extends MobEntityController {
|
||||
public NPC getNPC() {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.A_();
|
||||
}
|
||||
} else {
|
||||
super.A_();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -47,16 +47,20 @@ public class EnderSignalController extends MobEntityController {
|
||||
this(world, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
public EntityEnderSignalNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
} else {
|
||||
super.A_();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_11_R1.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
@ -67,6 +71,11 @@ public class EnderSignalController extends MobEntityController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean d(NBTTagCompound save) {
|
||||
return npc == null ? super.d(save) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void f(double x, double y, double z) {
|
||||
Vector vector = Util.callPushEvent(npc, x, y, z);
|
||||
@ -87,14 +96,5 @@ public class EnderSignalController extends MobEntityController {
|
||||
public NPC getNPC() {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void A_() {
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
} else {
|
||||
super.A_();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user