mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-27 21:29:14 +01:00
Implement NPCCollisionEvent, made EntityType matching more sane
This commit is contained in:
parent
4294758937
commit
bb812f699e
@ -28,6 +28,7 @@ import net.citizensnpcs.trait.VillagerProfession;
|
||||
import net.citizensnpcs.util.Messaging;
|
||||
import net.citizensnpcs.util.Paginator;
|
||||
import net.citizensnpcs.util.StringHelper;
|
||||
import net.citizensnpcs.util.Util;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -36,6 +37,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Ageable;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Villager.Profession;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
@ -139,10 +141,14 @@ public class NPCCommands {
|
||||
}
|
||||
EntityType type = EntityType.PLAYER;
|
||||
if (args.hasValueFlag("type")) {
|
||||
type = EntityType.fromName(args.getFlag("type"));
|
||||
String inputType = args.getFlag("type");
|
||||
type = Util.matchEntityType(inputType);
|
||||
if (type == null) {
|
||||
Messaging.sendError(player, "'" + args.getFlag("type")
|
||||
+ "' is not a valid mob type. Using default NPC.");
|
||||
Messaging.sendError(player, "'" + inputType
|
||||
+ "' is not a valid mob type. Using default type.");
|
||||
type = EntityType.PLAYER;
|
||||
} else if (!LivingEntity.class.isAssignableFrom(type.getEntityClass())) {
|
||||
Messaging.sendError(player, "'%s' is not a living entity type. Using default type.");
|
||||
type = EntityType.PLAYER;
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,4 @@ import net.citizensnpcs.api.npc.NPC;
|
||||
|
||||
public interface NPCHolder {
|
||||
public NPC getNPC();
|
||||
|
||||
boolean isPushable();
|
||||
|
||||
void setPushable(boolean pushable);
|
||||
}
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityBlaze;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Blaze;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensBlazeNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensBlazeNPC extends CitizensMobNPC {
|
||||
public static class EntityBlazeNPC extends EntityBlaze implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityBlazeNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensBlazeNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -59,15 +67,5 @@ public class CitizensBlazeNPC extends CitizensMobNPC {
|
||||
public NPC getNPC() {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityCaveSpider;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.CaveSpider;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensCaveSpiderNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensCaveSpiderNPC extends CitizensMobNPC {
|
||||
public static class EntityCaveSpiderNPC extends EntityCaveSpider implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityCaveSpiderNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -37,7 +38,14 @@ public class CitizensCaveSpiderNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -48,16 +56,6 @@ public class CitizensCaveSpiderNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityChicken;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Chicken;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensChickenNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensChickenNPC extends CitizensMobNPC {
|
||||
public static class EntityChickenNPC extends EntityChicken implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityChickenNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensChickenNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,16 +60,6 @@ public class CitizensChickenNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityCow;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Cow;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensCowNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensCowNPC extends CitizensMobNPC {
|
||||
public static class EntityCowNPC extends EntityCow implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityCowNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensCowNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,16 +60,6 @@ public class CitizensCowNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,15 +1,18 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityCreeper;
|
||||
import net.minecraft.server.EntityWeatherLighting;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Creeper;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensCreeperNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,7 +27,6 @@ public class CitizensCreeperNPC extends CitizensMobNPC {
|
||||
|
||||
public static class EntityCreeperNPC extends EntityCreeper implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityCreeperNPC(World world) {
|
||||
this(world, null);
|
||||
@ -47,7 +49,14 @@ public class CitizensCreeperNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -58,16 +67,6 @@ public class CitizensCreeperNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityEnderDragon;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.EnderDragon;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensEnderDragonNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensEnderDragonNPC extends CitizensMobNPC {
|
||||
public static class EntityEnderDragonNPC extends EntityEnderDragon implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityEnderDragonNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -37,7 +38,14 @@ public class CitizensEnderDragonNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -62,14 +70,5 @@ public class CitizensEnderDragonNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.trait.trait.Equipment;
|
||||
import net.citizensnpcs.editor.Equipable;
|
||||
@ -7,6 +8,7 @@ import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Messaging;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityEnderman;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
@ -16,6 +18,7 @@ import org.bukkit.entity.Enderman;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensEndermanNPC extends CitizensMobNPC implements Equipable {
|
||||
|
||||
@ -62,8 +65,6 @@ public class CitizensEndermanNPC extends CitizensMobNPC implements Equipable {
|
||||
public static class EntityEndermanNPC extends EntityEnderman implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityEndermanNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -79,7 +80,14 @@ public class CitizensEndermanNPC extends CitizensMobNPC implements Equipable {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -104,14 +112,5 @@ public class CitizensEndermanNPC extends CitizensMobNPC implements Equipable {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityGhast;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Ghast;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensGhastNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensGhastNPC extends CitizensMobNPC {
|
||||
public static class EntityGhastNPC extends EntityGhast implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityGhastNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensGhastNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -59,15 +67,5 @@ public class CitizensGhastNPC extends CitizensMobNPC {
|
||||
public NPC getNPC() {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityGiantZombie;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Giant;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensGiantNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensGiantNPC extends CitizensMobNPC {
|
||||
public static class EntityGiantNPC extends EntityGiantZombie implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityGiantNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -37,7 +38,14 @@ public class CitizensGiantNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,15 +60,5 @@ public class CitizensGiantNPC extends CitizensMobNPC {
|
||||
public NPC getNPC() {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityIronGolem;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.IronGolem;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensIronGolemNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensIronGolemNPC extends CitizensMobNPC {
|
||||
public static class EntityIronGolemNPC extends EntityIronGolem implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityIronGolemNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -37,7 +38,14 @@ public class CitizensIronGolemNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -48,16 +56,6 @@ public class CitizensIronGolemNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityMagmaCube;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.MagmaCube;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensMagmaCubeNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensMagmaCubeNPC extends CitizensMobNPC {
|
||||
public static class EntityMagmaCubeNPC extends EntityMagmaCube implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityMagmaCubeNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -42,7 +43,14 @@ public class CitizensMagmaCubeNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -60,15 +68,5 @@ public class CitizensMagmaCubeNPC extends CitizensMobNPC {
|
||||
public NPC getNPC() {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityMushroomCow;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.MushroomCow;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensMushroomCowNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensMushroomCowNPC extends CitizensMobNPC {
|
||||
public static class EntityMushroomCowNPC extends EntityMushroomCow implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityMushroomCowNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensMushroomCowNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,16 +60,6 @@ public class CitizensMushroomCowNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityOcelot;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Ocelot;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensOcelotNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensOcelotNPC extends CitizensMobNPC {
|
||||
public static class EntityOcelotNPC extends EntityOcelot implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityOcelotNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensOcelotNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,16 +60,6 @@ public class CitizensOcelotNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.editor.Equipable;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
@ -8,6 +9,7 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.trait.Saddle;
|
||||
import net.citizensnpcs.util.Messaging;
|
||||
import net.citizensnpcs.util.StringHelper;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityPig;
|
||||
import net.minecraft.server.EntityWeatherLighting;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
@ -17,6 +19,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.entity.Pig;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensPigNPC extends CitizensMobNPC implements Equipable {
|
||||
|
||||
@ -51,8 +54,6 @@ public class CitizensPigNPC extends CitizensMobNPC implements Equipable {
|
||||
public static class EntityPigNPC extends EntityPig implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityPigNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -74,7 +75,14 @@ public class CitizensPigNPC extends CitizensMobNPC implements Equipable {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -85,16 +93,6 @@ public class CitizensPigNPC extends CitizensMobNPC implements Equipable {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityPigZombie;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.PigZombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensPigZombieNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensPigZombieNPC extends CitizensMobNPC {
|
||||
public static class EntityPigZombieNPC extends EntityPigZombie implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityPigZombieNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensPigZombieNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -60,14 +68,5 @@ public class CitizensPigZombieNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.editor.Equipable;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
@ -9,6 +10,7 @@ import net.citizensnpcs.trait.Sheared;
|
||||
import net.citizensnpcs.trait.WoolColor;
|
||||
import net.citizensnpcs.util.Messaging;
|
||||
import net.citizensnpcs.util.StringHelper;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntitySheep;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
@ -18,6 +20,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensSheepNPC extends CitizensMobNPC implements Equipable {
|
||||
|
||||
@ -62,8 +65,6 @@ public class CitizensSheepNPC extends CitizensMobNPC implements Equipable {
|
||||
public static class EntitySheepNPC extends EntitySheep implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntitySheepNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -79,7 +80,14 @@ public class CitizensSheepNPC extends CitizensMobNPC implements Equipable {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -90,16 +98,6 @@ public class CitizensSheepNPC extends CitizensMobNPC implements Equipable {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntitySilverfish;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Silverfish;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensSilverfishNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensSilverfishNPC extends CitizensMobNPC {
|
||||
public static class EntitySilverfishNPC extends EntitySilverfish implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntitySilverfishNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensSilverfishNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,16 +60,6 @@ public class CitizensSilverfishNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntitySkeleton;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Skeleton;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensSkeletonNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensSkeletonNPC extends CitizensMobNPC {
|
||||
public static class EntitySkeletonNPC extends EntitySkeleton implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntitySkeletonNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensSkeletonNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,16 +60,6 @@ public class CitizensSkeletonNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntitySlime;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Slime;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensSlimeNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensSlimeNPC extends CitizensMobNPC {
|
||||
public static class EntitySlimeNPC extends EntitySlime implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntitySlimeNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -42,7 +43,14 @@ public class CitizensSlimeNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -53,16 +61,6 @@ public class CitizensSlimeNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntitySnowman;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Snowman;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensSnowmanNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensSnowmanNPC extends CitizensMobNPC {
|
||||
public static class EntitySnowmanNPC extends EntitySnowman implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntitySnowmanNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
@ -37,7 +38,14 @@ public class CitizensSnowmanNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -48,16 +56,6 @@ public class CitizensSnowmanNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntitySpider;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Spider;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensSpiderNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensSpiderNPC extends CitizensMobNPC {
|
||||
public static class EntitySpiderNPC extends EntitySpider implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntitySpiderNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensSpiderNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,16 +60,6 @@ public class CitizensSpiderNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntitySquid;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Squid;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensSquidNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensSquidNPC extends CitizensMobNPC {
|
||||
public static class EntitySquidNPC extends EntitySquid implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntitySquidNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensSquidNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -60,14 +68,5 @@ public class CitizensSquidNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityVillager;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Villager;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensVillagerNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensVillagerNPC extends CitizensMobNPC {
|
||||
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityVillagerNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensVillagerNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,16 +60,6 @@ public class CitizensVillagerNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityWolf;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Wolf;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensWolfNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensWolfNPC extends CitizensMobNPC {
|
||||
public static class EntityWolfNPC extends EntityWolf implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityWolfNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensWolfNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,16 +60,6 @@ public class CitizensWolfNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -1,14 +1,17 @@
|
||||
package net.citizensnpcs.npc.entity;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensMobNPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityZombie;
|
||||
import net.minecraft.server.PathfinderGoalSelector;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.entity.Zombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CitizensZombieNPC extends CitizensMobNPC {
|
||||
|
||||
@ -24,8 +27,6 @@ public class CitizensZombieNPC extends CitizensMobNPC {
|
||||
public static class EntityZombieNPC extends EntityZombie implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityZombieNPC(World world) {
|
||||
this(world, null);
|
||||
}
|
||||
@ -41,7 +42,14 @@ public class CitizensZombieNPC extends CitizensMobNPC {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -52,16 +60,6 @@ public class CitizensZombieNPC extends CitizensMobNPC {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void z_() {
|
||||
super.z_();
|
||||
|
@ -2,12 +2,14 @@ package net.citizensnpcs.npc.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.npc.network.NPCNetHandler;
|
||||
import net.citizensnpcs.npc.network.NPCNetworkManager;
|
||||
import net.citizensnpcs.npc.network.NPCSocket;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.EntityPlayer;
|
||||
import net.minecraft.server.ItemInWorldManager;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@ -16,11 +18,11 @@ import net.minecraft.server.NetHandler;
|
||||
import net.minecraft.server.NetworkManager;
|
||||
import net.minecraft.server.World;
|
||||
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||
private CitizensNPC npc;
|
||||
|
||||
private boolean pushable = false;
|
||||
|
||||
public EntityHumanNPC(MinecraftServer minecraftServer, World world, String string,
|
||||
ItemInWorldManager itemInWorldManager, NPC npc) {
|
||||
super(minecraftServer, world, string, itemInWorldManager);
|
||||
@ -46,7 +48,14 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||
|
||||
@Override
|
||||
public void b_(double x, double y, double z) {
|
||||
if (npc == null || pushable)
|
||||
if (npc == null) {
|
||||
super.b_(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCCollisionEvent.getHandlerList().getRegisteredListeners().length == 0)
|
||||
return;
|
||||
NPCCollisionEvent event = Util.callCollisionEvent(npc, new Vector(x, y, z));
|
||||
if (!event.isCancelled())
|
||||
super.b_(x, y, z);
|
||||
// when another entity collides, b_ is called to push the NPC
|
||||
// so we prevent b_ from doing anything.
|
||||
@ -72,11 +81,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||
return npc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
return pushable;
|
||||
}
|
||||
|
||||
private void moveOnCurrentHeading() {
|
||||
getControllerMove().c();
|
||||
getControllerLook().a();
|
||||
@ -101,8 +105,4 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||
X = yaw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushable(boolean pushable) {
|
||||
this.pushable = pushable;
|
||||
}
|
||||
}
|
@ -7,6 +7,8 @@ import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.minecraft.server.Packet;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
@ -15,7 +17,9 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.Maps;
|
||||
@ -28,6 +32,12 @@ public class Util {
|
||||
|
||||
private static final Map<Class<?>, Class<?>> primitiveClassMap = Maps.newHashMap();
|
||||
|
||||
public static NPCCollisionEvent callCollisionEvent(NPC npc, Vector vector) {
|
||||
NPCCollisionEvent event = new NPCCollisionEvent(npc, vector);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
return event;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a set of instantiation parameters, attempts to find a matching
|
||||
* constructor with the greatest number of matching class parameters and
|
||||
@ -50,8 +60,9 @@ public class Util {
|
||||
}
|
||||
}
|
||||
|
||||
private static <T> T createInstance0(Class<? extends T> clazz, Object[] params) throws InstantiationException,
|
||||
IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
||||
private static <T> T createInstance0(Class<? extends T> clazz, Object[] params)
|
||||
throws InstantiationException, IllegalAccessException, IllegalArgumentException,
|
||||
InvocationTargetException {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Constructor<? extends T>[] constructors = (Constructor<? extends T>[]) clazz.getConstructors();
|
||||
@ -98,6 +109,20 @@ public class Util {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static EntityType matchEntityType(String toMatch) {
|
||||
EntityType type = EntityType.fromName(toMatch);
|
||||
if (type != null)
|
||||
return type;
|
||||
for (EntityType check : EntityType.values()) {
|
||||
if (check.name().matches(toMatch) || check.name().replace('_', '-').equals(toMatch)) {
|
||||
type = check;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
private static boolean searchInterfaces(Class<?> class1, Class<?> class2) {
|
||||
for (Class<?> test : class1.getInterfaces())
|
||||
if (test == class2)
|
||||
|
Loading…
Reference in New Issue
Block a user