From 49a8513ec5d5f11219d9f7b0856ad8393e9ee1a0 Mon Sep 17 00:00:00 2001 From: Rogiel Date: Sun, 22 May 2011 14:55:54 -0300 Subject: [PATCH] Removed object capabilities Signed-off-by: Rogiel --- data/script/ai/script/ai/CharacterAI.java | 8 +- .../template/item/AdenaItemTemplate.java | 5 +- .../item/LargaFireworkItemTemplate.java | 5 +- .../armor/AbstractGradeAArmorTemplate.java | 20 +--- .../item/armor/Dummy2ArmorTemplate.java | 24 ---- .../item/armor/DummyArmorTemplate.java | 16 --- .../item/potion/RedPotionTemplate.java | 7 -- .../item/weapon/LongSwordTemplate.java | 8 -- .../item/weapon/ShortSwordTemplate.java | 8 -- .../template/skill/TestSkillTemplate.java | 7 -- .../db/dao/mysql5/MySQL5CharacterDAO.java | 4 +- .../client/CharacterAttackRequestPacket.java | 2 +- .../packet/client/CharacterCreatePacket.java | 4 +- .../packet/server/ActorChatMessagePacket.java | 2 +- .../packet/server/ActorMovementPacket.java | 2 +- .../server/CharacterTargetSelectedPacket.java | 2 +- .../packet/server/SystemMessagePacket.java | 2 +- .../com/l2jserver/model/AbstractModel.java | 7 +- .../java/com/l2jserver/model/game/Skill.java | 2 +- .../l2jserver/model/id/object/ActorID.java | 2 +- .../model/template/ActorTemplate.java | 4 +- .../model/template/ItemTemplate.java | 16 --- .../l2jserver/model/template/NPCTemplate.java | 22 ++-- .../model/template/SkillTemplate.java | 4 +- .../model/template/capability/Castable.java | 33 ----- .../model/template/capability/Consumable.java | 31 ----- .../model/template/capability/Defendable.java | 36 ------ .../template/capability/Depositable.java | 31 ----- .../model/template/capability/Dropable.java | 4 +- .../template/capability/Enchantable.java | 2 +- .../model/template/capability/Equipable.java | 31 ----- .../{Attackable.java => Interactable.java} | 24 ++-- .../model/template/capability/Penalty.java | 30 ----- .../model/template/capability/Sellable.java | 4 +- .../model/template/capability/Stackable.java | 29 ----- .../model/template/capability/Tradable.java | 4 +- .../model/template/capability/Usable.java | 29 ----- .../model/template/item/ArmorTemplate.java | 3 +- .../template/item/ConsumableTemplate.java | 4 +- .../model/template/item/PotionTemplate.java | 4 +- .../model/template/item/WeaponTemplate.java | 3 +- .../world/{AbstractActor.java => Actor.java} | 113 +----------------- .../java/com/l2jserver/model/world/Clan.java | 13 +- .../java/com/l2jserver/model/world/Item.java | 40 +------ .../l2jserver/model/world/L2Character.java | 1 - .../java/com/l2jserver/model/world/NPC.java | 2 +- .../java/com/l2jserver/model/world/Party.java | 58 --------- .../java/com/l2jserver/model/world/Pet.java | 16 +-- .../com/l2jserver/model/world/Player.java | 5 +- .../Dropable.java => PositionableObject.java} | 36 ++++-- .../model/world/actor/ActorEffects.java | 2 +- .../model/world/actor/ActorExperience.java | 2 +- .../world/actor/ActorSkillContainer.java | 2 +- .../model/world/actor/event/ActorEvent.java | 2 +- .../world/actor/event/ActorSpawnEvent.java | 6 +- .../model/world/capability/Actor.java | 44 ------- .../model/world/capability/Attackable.java | 30 ----- .../model/world/capability/Attacker.java | 29 ----- .../model/world/capability/Castable.java | 28 ----- .../model/world/capability/Caster.java | 29 ----- .../model/world/capability/Consumable.java | 29 ----- .../model/world/capability/Conversable.java | 28 ----- .../model/world/capability/Damagable.java | 32 ----- .../model/world/capability/Enchantable.java | 41 ------- .../model/world/capability/Equipable.java | 29 ----- .../model/world/capability/Equiper.java | 38 ------ .../model/world/capability/Invisible.java | 30 ----- .../model/world/capability/Joinable.java | 42 ------- .../model/world/capability/Killable.java | 36 ------ .../model/world/capability/Levelable.java | 40 ------- .../model/world/capability/Mana.java | 32 ----- .../world/capability/ObjectCapability.java | 29 ----- .../model/world/capability/Playable.java | 29 ----- .../model/world/capability/Pointable.java | 32 ----- .../model/world/capability/Positionable.java | 31 ----- .../model/world/capability/Spawnable.java | 31 ----- .../model/world/capability/Summonable.java | 31 ----- .../model/world/capability/Talker.java | 27 ----- .../model/world/character/CharacterClass.java | 2 +- .../event/CharacterEnterWorldEvent.java | 2 +- .../event/CharacterLeaveWorldEvent.java | 2 +- .../character/event/CharacterMoveEvent.java | 2 +- .../event/CharacterRunningEvent.java | 2 +- .../event/CharacterStopMoveEvent.java | 2 +- .../event/CharacterTargetDeselectedEvent.java | 2 +- .../event/CharacterTargetSelectedEvent.java | 2 +- .../event/CharacterWalkingEvent.java | 2 +- .../model/world/event/SpawnEvent.java | 4 - .../model/world/item/ItemDropEvent.java | 2 +- .../model/world/party/PartyEvent.java | 30 ----- .../model/world/party/PartyListener.java | 39 ------ .../player/event/PlayerTeleportingEvent.java | 2 +- .../l2jserver/service/game/ai/AIService.java | 2 +- .../service/game/ai/AIServiceImpl.java | 2 +- .../game/ai/script/AttackAIScript.java | 4 +- .../game/ai/script/ProximityAIScript.java | 4 +- .../game/ai/script/WalkingAIScript.java | 4 +- .../ActorIsNotAttackableServiceException.java | 2 +- .../game/character/CharacterService.java | 2 +- .../game/character/CharacterServiceImpl.java | 10 +- .../service/game/region/RegionService.java | 2 +- .../service/game/spawn/SpawnService.java | 10 +- .../service/game/spawn/SpawnServiceImpl.java | 28 ++--- .../service/game/world/WorldService.java | 4 +- .../service/game/world/WorldServiceImpl.java | 6 +- .../world/filter/impl/KnownListFilter.java | 8 +- .../game/world/filter/impl/RangeFilter.java | 10 +- .../CharacterTemplateConverter.java | 2 +- .../npctemplate/NPCTemplateConverter.java | 2 +- 109 files changed, 158 insertions(+), 1569 deletions(-) delete mode 100644 src/main/java/com/l2jserver/model/template/capability/Castable.java delete mode 100644 src/main/java/com/l2jserver/model/template/capability/Consumable.java delete mode 100644 src/main/java/com/l2jserver/model/template/capability/Defendable.java delete mode 100644 src/main/java/com/l2jserver/model/template/capability/Depositable.java delete mode 100644 src/main/java/com/l2jserver/model/template/capability/Equipable.java rename src/main/java/com/l2jserver/model/template/capability/{Attackable.java => Interactable.java} (58%) delete mode 100644 src/main/java/com/l2jserver/model/template/capability/Penalty.java delete mode 100644 src/main/java/com/l2jserver/model/template/capability/Stackable.java delete mode 100644 src/main/java/com/l2jserver/model/template/capability/Usable.java rename src/main/java/com/l2jserver/model/world/{AbstractActor.java => Actor.java} (62%) delete mode 100644 src/main/java/com/l2jserver/model/world/Party.java rename src/main/java/com/l2jserver/model/world/{capability/Dropable.java => PositionableObject.java} (59%) delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Actor.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Attackable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Attacker.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Castable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Caster.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Consumable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Conversable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Damagable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Enchantable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Equipable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Equiper.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Invisible.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Joinable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Killable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Levelable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Mana.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/ObjectCapability.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Playable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Pointable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Positionable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Spawnable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Summonable.java delete mode 100644 src/main/java/com/l2jserver/model/world/capability/Talker.java delete mode 100644 src/main/java/com/l2jserver/model/world/party/PartyEvent.java delete mode 100644 src/main/java/com/l2jserver/model/world/party/PartyListener.java diff --git a/data/script/ai/script/ai/CharacterAI.java b/data/script/ai/script/ai/CharacterAI.java index f5178c94e..30e8526c7 100644 --- a/data/script/ai/script/ai/CharacterAI.java +++ b/data/script/ai/script/ai/CharacterAI.java @@ -20,9 +20,9 @@ import script.AIInterest; import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.packet.server.ActorMovementPacket; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; -import com.l2jserver.model.world.capability.Attackable; -import com.l2jserver.model.world.capability.Positionable; +import com.l2jserver.model.world.PositionableObject; import com.l2jserver.model.world.character.event.CharacterMoveEvent; import com.l2jserver.service.game.ai.AIScript; import com.l2jserver.service.game.ai.script.AttackAIScript; @@ -119,10 +119,10 @@ public class CharacterAI implements AIScript, WalkingAIScript, AttackAIScript { } @Override - public void follow(Positionable positionable) { + public void follow(PositionableObject positionable) { } @Override - public void attack(Attackable target) { + public void attack(Actor target) { } } diff --git a/data/script/template/script/template/item/AdenaItemTemplate.java b/data/script/template/script/template/item/AdenaItemTemplate.java index a369e5493..a5d097ce3 100644 --- a/data/script/template/script/template/item/AdenaItemTemplate.java +++ b/data/script/template/script/template/item/AdenaItemTemplate.java @@ -18,12 +18,9 @@ package script.template.item; import com.google.inject.Inject; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; -import com.l2jserver.model.template.capability.Stackable; import com.l2jserver.model.template.item.EtcItemTemplate; -import com.l2jserver.model.world.Item; -public class AdenaItemTemplate extends EtcItemTemplate implements - Stackable { +public class AdenaItemTemplate extends EtcItemTemplate { public static final int ID = 57; @Inject diff --git a/data/script/template/script/template/item/LargaFireworkItemTemplate.java b/data/script/template/script/template/item/LargaFireworkItemTemplate.java index 03dd43f8e..784724ecc 100644 --- a/data/script/template/script/template/item/LargaFireworkItemTemplate.java +++ b/data/script/template/script/template/item/LargaFireworkItemTemplate.java @@ -19,12 +19,9 @@ package script.template.item; import com.google.inject.Inject; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; import com.l2jserver.model.id.template.provider.SkillTemplateIDProvider; -import com.l2jserver.model.template.capability.Stackable; import com.l2jserver.model.template.item.SkillEtcItemTemplate; -import com.l2jserver.model.world.Item; -public class LargaFireworkItemTemplate extends SkillEtcItemTemplate implements - Stackable { +public class LargaFireworkItemTemplate extends SkillEtcItemTemplate { public static final int ID = 6407; @Inject diff --git a/data/script/template/script/template/item/armor/AbstractGradeAArmorTemplate.java b/data/script/template/script/template/item/armor/AbstractGradeAArmorTemplate.java index 0aaab566a..bd9ea1730 100644 --- a/data/script/template/script/template/item/armor/AbstractGradeAArmorTemplate.java +++ b/data/script/template/script/template/item/armor/AbstractGradeAArmorTemplate.java @@ -18,29 +18,11 @@ package script.template.item.armor; import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.template.capability.Enchantable; -import com.l2jserver.model.template.capability.Penalty; import com.l2jserver.model.template.item.ArmorTemplate; -import com.l2jserver.model.world.capability.Equiper; public abstract class AbstractGradeAArmorTemplate extends ArmorTemplate - implements Enchantable, Penalty { + implements Enchantable { public AbstractGradeAArmorTemplate(ItemTemplateID id) { super(id); } - - @Override - public void enchant(com.l2jserver.model.world.capability.Enchantable target) { - target.setEnchantLevel(target.getEnchantLevel() + 1); - } - - @Override - public void penalty(Equiper user) { - // if (!(user instanceof Levelable) && !(user instanceof Castable)) - // return; - // final Levelable levelable = (Levelable) user; - // final Castable castable = (Castable) user; - // if (levelable.getLevel() < 20) { - // - // } - } } diff --git a/data/script/template/script/template/item/armor/Dummy2ArmorTemplate.java b/data/script/template/script/template/item/armor/Dummy2ArmorTemplate.java index 37d82bce2..1bcb04e4b 100644 --- a/data/script/template/script/template/item/armor/Dummy2ArmorTemplate.java +++ b/data/script/template/script/template/item/armor/Dummy2ArmorTemplate.java @@ -18,9 +18,6 @@ package script.template.item.armor; import com.google.inject.Inject; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; -import com.l2jserver.model.world.capability.Attackable; -import com.l2jserver.model.world.capability.Attacker; -import com.l2jserver.model.world.capability.Enchantable; public class Dummy2ArmorTemplate extends AbstractGradeAArmorTemplate { public static final int ID = 10; @@ -33,25 +30,4 @@ public class Dummy2ArmorTemplate extends AbstractGradeAArmorTemplate { public Dummy2ArmorTemplate(ItemTemplateIDProvider factory) { super(factory.createID(ID)); } - - @Override - public void defend(Attacker source, Attackable target) { - } - - @Override - public void enchant(Enchantable target) { - if (target.getEnchantLevel() >= MAX_ENCHANT) - return; - super.enchant(target); - } - - @Override - public int getPhysicalDefense() { - return REDUCED_DAMAGE_PHYSICAL; - } - - @Override - public int getMagicalDefense() { - return REDUCED_DAMAGE_MAGICAL; - } } diff --git a/data/script/template/script/template/item/armor/DummyArmorTemplate.java b/data/script/template/script/template/item/armor/DummyArmorTemplate.java index c0633df7f..59e55a11f 100644 --- a/data/script/template/script/template/item/armor/DummyArmorTemplate.java +++ b/data/script/template/script/template/item/armor/DummyArmorTemplate.java @@ -18,8 +18,6 @@ package script.template.item.armor; import com.google.inject.Inject; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; -import com.l2jserver.model.world.capability.Attackable; -import com.l2jserver.model.world.capability.Attacker; public class DummyArmorTemplate extends AbstractNoGradeArmorTemplate { public static final int ID = 20; @@ -31,18 +29,4 @@ public class DummyArmorTemplate extends AbstractNoGradeArmorTemplate { public DummyArmorTemplate(ItemTemplateIDProvider factory) { super(factory.createID(ID)); } - - @Override - public void defend(Attacker source, Attackable target) { - } - - @Override - public int getPhysicalDefense() { - return REDUCED_DAMAGE_PHYSICAL; - } - - @Override - public int getMagicalDefense() { - return REDUCED_DAMAGE_MAGICAL; - } } diff --git a/data/script/template/script/template/item/potion/RedPotionTemplate.java b/data/script/template/script/template/item/potion/RedPotionTemplate.java index 0048d81b2..6b9b427f1 100644 --- a/data/script/template/script/template/item/potion/RedPotionTemplate.java +++ b/data/script/template/script/template/item/potion/RedPotionTemplate.java @@ -19,8 +19,6 @@ package script.template.item.potion; import com.google.inject.Inject; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; import com.l2jserver.model.template.item.PotionTemplate; -import com.l2jserver.model.world.capability.Attackable; -import com.l2jserver.model.world.capability.Attacker; public class RedPotionTemplate extends PotionTemplate { public static final int ID = 15; @@ -32,9 +30,4 @@ public class RedPotionTemplate extends PotionTemplate { this.price = 40; } - - @Override - public void consume(Attacker source, Attackable target) { - // TODO Auto-generated method stub - } } diff --git a/data/script/template/script/template/item/weapon/LongSwordTemplate.java b/data/script/template/script/template/item/weapon/LongSwordTemplate.java index 15907f56e..c87dc79f4 100644 --- a/data/script/template/script/template/item/weapon/LongSwordTemplate.java +++ b/data/script/template/script/template/item/weapon/LongSwordTemplate.java @@ -23,8 +23,6 @@ import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeTy import com.google.inject.Inject; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; -import com.l2jserver.model.world.capability.Attackable; -import com.l2jserver.model.world.capability.Attacker; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; public class LongSwordTemplate extends AbstractNoGradeWeaponTemplate { @@ -49,10 +47,4 @@ public class LongSwordTemplate extends AbstractNoGradeWeaponTemplate { this.soulshots = 2; this.spiritshots = 2; } - - @Override - public void attack(Attacker source, Attackable target) { - source.attack(target, this); - target.receiveAttack(source, this); - } } diff --git a/data/script/template/script/template/item/weapon/ShortSwordTemplate.java b/data/script/template/script/template/item/weapon/ShortSwordTemplate.java index b827ea80f..21e0c0827 100644 --- a/data/script/template/script/template/item/weapon/ShortSwordTemplate.java +++ b/data/script/template/script/template/item/weapon/ShortSwordTemplate.java @@ -23,8 +23,6 @@ import static com.l2jserver.model.template.item.WeaponTemplate.WeaponAttributeTy import com.google.inject.Inject; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; -import com.l2jserver.model.world.capability.Attackable; -import com.l2jserver.model.world.capability.Attacker; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; public class ShortSwordTemplate extends AbstractNoGradeWeaponTemplate { @@ -52,10 +50,4 @@ public class ShortSwordTemplate extends AbstractNoGradeWeaponTemplate { this.soulshots = 1; this.spiritshots = 1; } - - @Override - public void attack(Attacker source, Attackable target) { - source.attack(target, this); - target.receiveAttack(source, this); - } } diff --git a/data/script/template/script/template/skill/TestSkillTemplate.java b/data/script/template/script/template/skill/TestSkillTemplate.java index 578d316bf..6a22e7e3e 100644 --- a/data/script/template/script/template/skill/TestSkillTemplate.java +++ b/data/script/template/script/template/skill/TestSkillTemplate.java @@ -19,8 +19,6 @@ package script.template.skill; import com.google.inject.Inject; import com.l2jserver.model.id.template.provider.SkillTemplateIDProvider; import com.l2jserver.model.template.SkillTemplate; -import com.l2jserver.model.world.capability.Castable; -import com.l2jserver.model.world.capability.Caster; import com.l2jserver.model.world.character.CharacterClass; public class TestSkillTemplate extends SkillTemplate { @@ -36,9 +34,4 @@ public class TestSkillTemplate extends SkillTemplate { public CharacterClass[] getClasses() { return new CharacterClass[] { CharacterClass.HUMAN_FIGHTER }; } - - @Override - public void cast(Caster caster, Castable... targets) { - // TODO do casting - } } diff --git a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterDAO.java b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterDAO.java index f56934f3b..f2ca866c3 100644 --- a/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterDAO.java +++ b/src/dao/mysql5/com/l2jserver/db/dao/mysql5/MySQL5CharacterDAO.java @@ -33,8 +33,8 @@ import com.l2jserver.model.id.provider.AccountIDProvider; import com.l2jserver.model.id.template.CharacterTemplateID; import com.l2jserver.model.id.template.provider.CharacterTemplateIDProvider; import com.l2jserver.model.template.CharacterTemplate; -import com.l2jserver.model.world.AbstractActor.Race; -import com.l2jserver.model.world.AbstractActor.Sex; +import com.l2jserver.model.world.Actor.Race; +import com.l2jserver.model.world.Actor.Sex; import com.l2jserver.model.world.Clan; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.character.CharacterAppearance; diff --git a/src/main/java/com/l2jserver/game/net/packet/client/CharacterAttackRequestPacket.java b/src/main/java/com/l2jserver/game/net/packet/client/CharacterAttackRequestPacket.java index 9d4c6bc70..2fead2f30 100644 --- a/src/main/java/com/l2jserver/game/net/packet/client/CharacterAttackRequestPacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/client/CharacterAttackRequestPacket.java @@ -27,8 +27,8 @@ import com.l2jserver.game.net.packet.server.ActionFailedPacket; import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.object.ActorID; import com.l2jserver.model.id.object.provider.ObjectIDResolver; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; -import com.l2jserver.model.world.capability.Actor; import com.l2jserver.service.game.character.ActorIsNotAttackableServiceException; import com.l2jserver.service.game.character.CannotSetTargetServiceException; import com.l2jserver.service.game.character.CharacterService; diff --git a/src/main/java/com/l2jserver/game/net/packet/client/CharacterCreatePacket.java b/src/main/java/com/l2jserver/game/net/packet/client/CharacterCreatePacket.java index b3a49447e..2fe0c9cfa 100644 --- a/src/main/java/com/l2jserver/game/net/packet/client/CharacterCreatePacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/client/CharacterCreatePacket.java @@ -31,8 +31,8 @@ import com.l2jserver.model.id.object.provider.CharacterIDProvider; import com.l2jserver.model.id.template.CharacterTemplateID; import com.l2jserver.model.id.template.provider.CharacterTemplateIDProvider; import com.l2jserver.model.template.CharacterTemplate; -import com.l2jserver.model.world.AbstractActor.Race; -import com.l2jserver.model.world.AbstractActor.Sex; +import com.l2jserver.model.world.Actor.Race; +import com.l2jserver.model.world.Actor.Sex; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.character.CharacterAppearance.CharacterFace; import com.l2jserver.model.world.character.CharacterAppearance.CharacterHairColor; diff --git a/src/main/java/com/l2jserver/game/net/packet/server/ActorChatMessagePacket.java b/src/main/java/com/l2jserver/game/net/packet/server/ActorChatMessagePacket.java index 644c25ffd..e52de9d1e 100644 --- a/src/main/java/com/l2jserver/game/net/packet/server/ActorChatMessagePacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/server/ActorChatMessagePacket.java @@ -21,8 +21,8 @@ import org.jboss.netty.buffer.ChannelBuffer; import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.packet.AbstractServerPacket; import com.l2jserver.game.net.packet.server.CharacterCreateFailPacket.Reason; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; -import com.l2jserver.model.world.capability.Actor; import com.l2jserver.service.game.chat.ChatMessageDestination; import com.l2jserver.util.BufferUtils; diff --git a/src/main/java/com/l2jserver/game/net/packet/server/ActorMovementPacket.java b/src/main/java/com/l2jserver/game/net/packet/server/ActorMovementPacket.java index 794f4b340..b43599916 100644 --- a/src/main/java/com/l2jserver/game/net/packet/server/ActorMovementPacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/server/ActorMovementPacket.java @@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer; import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.packet.AbstractServerPacket; import com.l2jserver.game.net.packet.server.CharacterCreateFailPacket.Reason; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; import com.l2jserver.util.dimensional.Coordinate; /** diff --git a/src/main/java/com/l2jserver/game/net/packet/server/CharacterTargetSelectedPacket.java b/src/main/java/com/l2jserver/game/net/packet/server/CharacterTargetSelectedPacket.java index 4df7e3ab1..c3de83852 100644 --- a/src/main/java/com/l2jserver/game/net/packet/server/CharacterTargetSelectedPacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/server/CharacterTargetSelectedPacket.java @@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer; import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.packet.AbstractServerPacket; import com.l2jserver.game.net.packet.server.CharacterCreateFailPacket.Reason; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; /** * This packet notifies the client that the chosen character has been diff --git a/src/main/java/com/l2jserver/game/net/packet/server/SystemMessagePacket.java b/src/main/java/com/l2jserver/game/net/packet/server/SystemMessagePacket.java index b4d319f4b..bf147b0bb 100644 --- a/src/main/java/com/l2jserver/game/net/packet/server/SystemMessagePacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/server/SystemMessagePacket.java @@ -27,8 +27,8 @@ import com.l2jserver.model.game.Fort; import com.l2jserver.model.game.Skill; import com.l2jserver.model.template.ItemTemplate; import com.l2jserver.model.template.SkillTemplate; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.Item; -import com.l2jserver.model.world.capability.Actor; import com.l2jserver.util.BufferUtils; import com.l2jserver.util.factory.CollectionFactory; diff --git a/src/main/java/com/l2jserver/model/AbstractModel.java b/src/main/java/com/l2jserver/model/AbstractModel.java index 3e76d03be..1d2408775 100644 --- a/src/main/java/com/l2jserver/model/AbstractModel.java +++ b/src/main/java/com/l2jserver/model/AbstractModel.java @@ -16,11 +16,13 @@ */ package com.l2jserver.model; +import com.google.common.base.Preconditions; import com.l2jserver.model.id.ID; /** - * @author Rogiel + * Simple model interface implementing {@link ID} related methods * + * @author Rogiel */ public class AbstractModel> implements Model { /** @@ -35,8 +37,7 @@ public class AbstractModel> implements Model { @Override public void setID(T ID) { - if (this.id != null) - throw new IllegalStateException("ID is already set"); + Preconditions.checkState(id == null, "ID is already set"); this.id = ID; } diff --git a/src/main/java/com/l2jserver/model/game/Skill.java b/src/main/java/com/l2jserver/model/game/Skill.java index f80385374..61874990d 100644 --- a/src/main/java/com/l2jserver/model/game/Skill.java +++ b/src/main/java/com/l2jserver/model/game/Skill.java @@ -19,7 +19,7 @@ package com.l2jserver.model.game; import com.l2jserver.model.id.object.ActorID; import com.l2jserver.model.id.template.SkillTemplateID; import com.l2jserver.model.template.SkillTemplate; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; /** * Register the state of a skill known by an {@link Actor}. diff --git a/src/main/java/com/l2jserver/model/id/object/ActorID.java b/src/main/java/com/l2jserver/model/id/object/ActorID.java index 89ad38450..6c0e32f35 100644 --- a/src/main/java/com/l2jserver/model/id/object/ActorID.java +++ b/src/main/java/com/l2jserver/model/id/object/ActorID.java @@ -19,7 +19,7 @@ package com.l2jserver.model.id.object; import com.google.inject.Inject; import com.google.inject.assistedinject.Assisted; import com.l2jserver.model.id.ObjectID; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; /** * An {@link ObjectID} instance representing an {@link Actor} object diff --git a/src/main/java/com/l2jserver/model/template/ActorTemplate.java b/src/main/java/com/l2jserver/model/template/ActorTemplate.java index 652e63400..e4ecb67b5 100644 --- a/src/main/java/com/l2jserver/model/template/ActorTemplate.java +++ b/src/main/java/com/l2jserver/model/template/ActorTemplate.java @@ -20,9 +20,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.l2jserver.model.id.template.ActorTemplateID; -import com.l2jserver.model.world.AbstractActor.Race; +import com.l2jserver.model.world.Actor; +import com.l2jserver.model.world.Actor.Race; import com.l2jserver.model.world.actor.ActorAttributes; -import com.l2jserver.model.world.capability.Actor; /** * Template for {@link Actor} diff --git a/src/main/java/com/l2jserver/model/template/ItemTemplate.java b/src/main/java/com/l2jserver/model/template/ItemTemplate.java index 3a5dfbf05..f0499b6d9 100644 --- a/src/main/java/com/l2jserver/model/template/ItemTemplate.java +++ b/src/main/java/com/l2jserver/model/template/ItemTemplate.java @@ -23,12 +23,10 @@ import com.google.inject.Inject; import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.template.ItemTemplateID; -import com.l2jserver.model.template.capability.Depositable; import com.l2jserver.model.template.capability.Dropable; import com.l2jserver.model.template.capability.Enchantable; import com.l2jserver.model.template.capability.Sellable; import com.l2jserver.model.template.capability.Tradable; -import com.l2jserver.model.template.capability.Usable; import com.l2jserver.model.world.Item; import com.l2jserver.model.world.L2Character; import com.l2jserver.service.network.NetworkService; @@ -117,20 +115,6 @@ public abstract class ItemTemplate extends AbstractTemplate { return (this instanceof Tradable); } - /** - * @return the usable - */ - public boolean isUsable() { - return (this instanceof Usable); - } - - /** - * @return the usable - */ - public boolean isDepositable() { - return (this instanceof Depositable); - } - /** * @return the weight */ diff --git a/src/main/java/com/l2jserver/model/template/NPCTemplate.java b/src/main/java/com/l2jserver/model/template/NPCTemplate.java index 9debcfae5..3a4a5787e 100644 --- a/src/main/java/com/l2jserver/model/template/NPCTemplate.java +++ b/src/main/java/com/l2jserver/model/template/NPCTemplate.java @@ -23,10 +23,11 @@ import com.l2jserver.game.net.packet.server.NPCHtmlMessagePacket; import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.id.template.NPCTemplateID; import com.l2jserver.model.id.template.provider.ItemTemplateIDProvider; -import com.l2jserver.model.world.AbstractActor.Race; +import com.l2jserver.model.template.capability.Interactable; +import com.l2jserver.model.world.Actor; +import com.l2jserver.model.world.Actor.Race; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.NPC; -import com.l2jserver.model.world.capability.Actor; import com.l2jserver.service.game.character.CannotSetTargetServiceException; import com.l2jserver.service.game.character.CharacterService; import com.l2jserver.service.network.NetworkService; @@ -39,7 +40,8 @@ import com.l2jserver.util.html.markup.HtmlTemplate; * * @author Rogiel */ -public abstract class NPCTemplate extends ActorTemplate { +public abstract class NPCTemplate extends ActorTemplate implements + Interactable { /** * The {@link NetworkService} */ @@ -93,17 +95,7 @@ public abstract class NPCTemplate extends ActorTemplate { super(id, null); } - /** - * Performs an interaction with this NPC. This is normally invoked from - * npc instance. - * - * @param character - * the interacting character - * @param args - * the action arguments - * @throws L2Exception - * any {@link L2Exception} - */ + @Override public void action(NPC npc, L2Character character, String... args) throws L2Exception { Preconditions.checkNotNull(npc, "npc"); @@ -140,7 +132,7 @@ public abstract class NPCTemplate extends ActorTemplate { * the action arguments * @throws L2Exception */ - public void talk(NPC npc, L2Character character, Lineage2Connection conn, + protected void talk(NPC npc, L2Character character, Lineage2Connection conn, String... args) throws L2Exception { if (args.length == 0 || (args.length >= 1 && args[0].equals("Chat"))) { String name = ""; diff --git a/src/main/java/com/l2jserver/model/template/SkillTemplate.java b/src/main/java/com/l2jserver/model/template/SkillTemplate.java index f3d2ffb67..5f12f453b 100644 --- a/src/main/java/com/l2jserver/model/template/SkillTemplate.java +++ b/src/main/java/com/l2jserver/model/template/SkillTemplate.java @@ -18,7 +18,6 @@ package com.l2jserver.model.template; import com.l2jserver.model.game.Skill; import com.l2jserver.model.id.template.SkillTemplateID; -import com.l2jserver.model.template.capability.Castable; import com.l2jserver.model.world.character.CharacterClass; /** @@ -26,8 +25,7 @@ import com.l2jserver.model.world.character.CharacterClass; * * @author Rogiel */ -public abstract class SkillTemplate extends AbstractTemplate implements - Castable { +public abstract class SkillTemplate extends AbstractTemplate { /** * The maximum level supported by this skill */ diff --git a/src/main/java/com/l2jserver/model/template/capability/Castable.java b/src/main/java/com/l2jserver/model/template/capability/Castable.java deleted file mode 100644 index dee14ab55..000000000 --- a/src/main/java/com/l2jserver/model/template/capability/Castable.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.template.capability; - -import com.l2jserver.model.template.Template; -import com.l2jserver.model.world.capability.Caster; - -/** - * Defines an {@link Template template} {@link TemplateCapability capability} - * that an {@link Caster} can cast on an - * {@link com.l2jserver.model.world.capability.Castable}. - * - * @author Rogiel - * - */ -public interface Castable extends TemplateCapability { - void cast(Caster caster, - com.l2jserver.model.world.capability.Castable... targets); -} diff --git a/src/main/java/com/l2jserver/model/template/capability/Consumable.java b/src/main/java/com/l2jserver/model/template/capability/Consumable.java deleted file mode 100644 index 3df231e96..000000000 --- a/src/main/java/com/l2jserver/model/template/capability/Consumable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.template.capability; - -import com.l2jserver.model.template.Template; -import com.l2jserver.model.world.capability.Attacker; - -/** - * Defines an {@link Template template} {@link TemplateCapability capability} - * that can be consumed. - * - * @author Rogiel - */ -public interface Consumable extends TemplateCapability { - void consume(Attacker source, - com.l2jserver.model.world.capability.Attackable target); -} diff --git a/src/main/java/com/l2jserver/model/template/capability/Defendable.java b/src/main/java/com/l2jserver/model/template/capability/Defendable.java deleted file mode 100644 index 0466e8f3e..000000000 --- a/src/main/java/com/l2jserver/model/template/capability/Defendable.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.template.capability; - -import com.l2jserver.model.template.Template; -import com.l2jserver.model.world.capability.Attacker; - -/** - * Defines an {@link Template template} {@link TemplateCapability capability} - * that an {@link com.l2jserver.model.world.capability.Attackable} can use to - * defend from an {@link Attacker}. - * - * @author Rogiel - */ -public interface Defendable extends TemplateCapability { - void defend(Attacker source, - com.l2jserver.model.world.capability.Attackable target); - - int getPhysicalDefense(); - - int getMagicalDefense(); -} diff --git a/src/main/java/com/l2jserver/model/template/capability/Depositable.java b/src/main/java/com/l2jserver/model/template/capability/Depositable.java deleted file mode 100644 index 6b7207205..000000000 --- a/src/main/java/com/l2jserver/model/template/capability/Depositable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.template.capability; - -import com.l2jserver.model.template.Template; -import com.l2jserver.model.world.capability.Attacker; - -/** - * Defines an {@link Template template} {@link TemplateCapability capability} - * that can be selled. - * - * @author Rogiel - */ -public interface Depositable extends TemplateCapability { - void sell(Attacker source, - com.l2jserver.model.world.capability.Attackable target); -} diff --git a/src/main/java/com/l2jserver/model/template/capability/Dropable.java b/src/main/java/com/l2jserver/model/template/capability/Dropable.java index b10c183fe..ad065e41c 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Dropable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Dropable.java @@ -17,7 +17,6 @@ package com.l2jserver.model.template.capability; import com.l2jserver.model.template.Template; -import com.l2jserver.model.world.capability.Attacker; /** * Defines an {@link Template template} {@link TemplateCapability capability} @@ -26,6 +25,5 @@ import com.l2jserver.model.world.capability.Attacker; * @author Rogiel */ public interface Dropable extends TemplateCapability { - void sell(Attacker source, - com.l2jserver.model.world.capability.Attackable target); + } diff --git a/src/main/java/com/l2jserver/model/template/capability/Enchantable.java b/src/main/java/com/l2jserver/model/template/capability/Enchantable.java index 951388198..82aee465e 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Enchantable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Enchantable.java @@ -25,5 +25,5 @@ import com.l2jserver.model.template.Template; * @author Rogiel */ public interface Enchantable extends TemplateCapability { - void enchant(com.l2jserver.model.world.capability.Enchantable target); + } diff --git a/src/main/java/com/l2jserver/model/template/capability/Equipable.java b/src/main/java/com/l2jserver/model/template/capability/Equipable.java deleted file mode 100644 index f0d0f3f73..000000000 --- a/src/main/java/com/l2jserver/model/template/capability/Equipable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.template.capability; - -import com.l2jserver.model.template.Template; -import com.l2jserver.model.world.capability.Equiper; - -/** - * Defines an {@link Template template} {@link TemplateCapability capability} - * for an object that acn be equipable by an {@link Equiper}. - * - * @author Rogiel - * - */ -public interface Equipable extends TemplateCapability { - void equip(Equiper equiper); -} diff --git a/src/main/java/com/l2jserver/model/template/capability/Attackable.java b/src/main/java/com/l2jserver/model/template/capability/Interactable.java similarity index 58% rename from src/main/java/com/l2jserver/model/template/capability/Attackable.java rename to src/main/java/com/l2jserver/model/template/capability/Interactable.java index 2121a520d..7ad780a8c 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Attackable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Interactable.java @@ -17,17 +17,27 @@ package com.l2jserver.model.template.capability; import com.l2jserver.model.template.Template; -import com.l2jserver.model.world.capability.Attacker; +import com.l2jserver.model.world.L2Character; +import com.l2jserver.model.world.WorldObject; +import com.l2jserver.util.exception.L2Exception; /** - * Defines an {@link Template template} {@link TemplateCapability capability} - * that an {@link Attacker} can use to attack an - * {@link com.l2jserver.model.world.capability.Attackable} + * Defines an {@link Template} which the player can interact with * * @author Rogiel * */ -public interface Attackable extends TemplateCapability { - void attack(Attacker source, - com.l2jserver.model.world.capability.Attackable target); +public interface Interactable extends TemplateCapability { + /** + * Performs an interaction with this template. + * + * @param character + * the interacting character + * @param args + * the action arguments + * @throws L2Exception + * any {@link L2Exception} + */ + void action(T object, L2Character character, String... args) + throws L2Exception; } diff --git a/src/main/java/com/l2jserver/model/template/capability/Penalty.java b/src/main/java/com/l2jserver/model/template/capability/Penalty.java deleted file mode 100644 index dc787e5a0..000000000 --- a/src/main/java/com/l2jserver/model/template/capability/Penalty.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.template.capability; - -import com.l2jserver.model.template.AbstractTemplate; -import com.l2jserver.model.world.capability.Equiper; - -/** - * Indicated than an {@link AbstractTemplate} can add penalties to an given - * {@link Equiper}. - * - * @author Rogiel - */ -public interface Penalty extends TemplateCapability { - void penalty(Equiper user); -} diff --git a/src/main/java/com/l2jserver/model/template/capability/Sellable.java b/src/main/java/com/l2jserver/model/template/capability/Sellable.java index f33afa02b..0097fe327 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Sellable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Sellable.java @@ -17,7 +17,6 @@ package com.l2jserver.model.template.capability; import com.l2jserver.model.template.Template; -import com.l2jserver.model.world.capability.Attacker; /** * Defines an {@link Template template} {@link TemplateCapability capability} @@ -26,6 +25,5 @@ import com.l2jserver.model.world.capability.Attacker; * @author Rogiel */ public interface Sellable extends TemplateCapability { - void sell(Attacker source, - com.l2jserver.model.world.capability.Attackable target); + } diff --git a/src/main/java/com/l2jserver/model/template/capability/Stackable.java b/src/main/java/com/l2jserver/model/template/capability/Stackable.java deleted file mode 100644 index 1691a4ca4..000000000 --- a/src/main/java/com/l2jserver/model/template/capability/Stackable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.template.capability; - -import com.l2jserver.model.world.WorldObject; - -/** - * Defines an template that can be stacked (i.e. more then one item per slot in - * the inventory) - * - * @author Rogiel - */ -public interface Stackable extends TemplateCapability { - void stack(T... object); -} diff --git a/src/main/java/com/l2jserver/model/template/capability/Tradable.java b/src/main/java/com/l2jserver/model/template/capability/Tradable.java index 44cb96eeb..ed1ca453f 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Tradable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Tradable.java @@ -17,7 +17,6 @@ package com.l2jserver.model.template.capability; import com.l2jserver.model.template.Template; -import com.l2jserver.model.world.capability.Attacker; /** * Defines an {@link Template template} {@link TemplateCapability capability} @@ -26,6 +25,5 @@ import com.l2jserver.model.world.capability.Attacker; * @author Rogiel */ public interface Tradable extends TemplateCapability { - void sell(Attacker source, - com.l2jserver.model.world.capability.Attackable target); + } diff --git a/src/main/java/com/l2jserver/model/template/capability/Usable.java b/src/main/java/com/l2jserver/model/template/capability/Usable.java deleted file mode 100644 index 2e5408278..000000000 --- a/src/main/java/com/l2jserver/model/template/capability/Usable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.template.capability; - -import com.l2jserver.model.template.Template; - -/** - * Defines an {@link Template template} {@link TemplateCapability capability} - * that can be used. - * - * @author Rogiel - */ -public interface Usable extends TemplateCapability { - void canUse(); -} diff --git a/src/main/java/com/l2jserver/model/template/item/ArmorTemplate.java b/src/main/java/com/l2jserver/model/template/item/ArmorTemplate.java index 141a8ef20..c5ddcec26 100644 --- a/src/main/java/com/l2jserver/model/template/item/ArmorTemplate.java +++ b/src/main/java/com/l2jserver/model/template/item/ArmorTemplate.java @@ -18,7 +18,6 @@ package com.l2jserver.model.template.item; import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.template.ItemTemplate; -import com.l2jserver.model.template.capability.Defendable; import com.l2jserver.model.world.Item; /** @@ -26,7 +25,7 @@ import com.l2jserver.model.world.Item; * * @author Rogiel */ -public abstract class ArmorTemplate extends ItemTemplate implements Defendable { +public abstract class ArmorTemplate extends ItemTemplate { public ArmorTemplate(ItemTemplateID id) { super(id); } diff --git a/src/main/java/com/l2jserver/model/template/item/ConsumableTemplate.java b/src/main/java/com/l2jserver/model/template/item/ConsumableTemplate.java index a785749c6..8383d6086 100644 --- a/src/main/java/com/l2jserver/model/template/item/ConsumableTemplate.java +++ b/src/main/java/com/l2jserver/model/template/item/ConsumableTemplate.java @@ -18,7 +18,6 @@ package com.l2jserver.model.template.item; import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.template.ItemTemplate; -import com.l2jserver.model.template.capability.Consumable; import com.l2jserver.model.world.Item; /** @@ -26,8 +25,7 @@ import com.l2jserver.model.world.Item; * * @author Rogiel */ -public abstract class ConsumableTemplate extends ItemTemplate implements - Consumable { +public abstract class ConsumableTemplate extends ItemTemplate { public ConsumableTemplate(ItemTemplateID id, String icon, ItemMaterial material) { super(id, icon, material); diff --git a/src/main/java/com/l2jserver/model/template/item/PotionTemplate.java b/src/main/java/com/l2jserver/model/template/item/PotionTemplate.java index 4200205e9..f6af6844f 100644 --- a/src/main/java/com/l2jserver/model/template/item/PotionTemplate.java +++ b/src/main/java/com/l2jserver/model/template/item/PotionTemplate.java @@ -17,7 +17,6 @@ package com.l2jserver.model.template.item; import com.l2jserver.model.id.template.ItemTemplateID; -import com.l2jserver.model.template.capability.Stackable; import com.l2jserver.model.world.Item; /** @@ -25,8 +24,7 @@ import com.l2jserver.model.world.Item; * * @author Rogiel */ -public abstract class PotionTemplate extends ConsumableTemplate implements - Stackable { +public abstract class PotionTemplate extends ConsumableTemplate { public PotionTemplate(ItemTemplateID id, String icon) { super(id, icon, ItemMaterial.LIQUID); } diff --git a/src/main/java/com/l2jserver/model/template/item/WeaponTemplate.java b/src/main/java/com/l2jserver/model/template/item/WeaponTemplate.java index 00cee8a58..84ef53f85 100644 --- a/src/main/java/com/l2jserver/model/template/item/WeaponTemplate.java +++ b/src/main/java/com/l2jserver/model/template/item/WeaponTemplate.java @@ -21,7 +21,6 @@ import java.util.Map.Entry; import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.template.ItemTemplate; -import com.l2jserver.model.template.capability.Attackable; import com.l2jserver.model.world.Item; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; import com.l2jserver.util.calculator.Calculator; @@ -38,7 +37,7 @@ import com.l2jserver.util.factory.CollectionFactory; * * @author Rogiel */ -public abstract class WeaponTemplate extends ItemTemplate implements Attackable { +public abstract class WeaponTemplate extends ItemTemplate { /** * The paperldoll slot used by this weapon */ diff --git a/src/main/java/com/l2jserver/model/world/AbstractActor.java b/src/main/java/com/l2jserver/model/world/Actor.java similarity index 62% rename from src/main/java/com/l2jserver/model/world/AbstractActor.java rename to src/main/java/com/l2jserver/model/world/Actor.java index 46905aeef..c0155beb5 100644 --- a/src/main/java/com/l2jserver/model/world/AbstractActor.java +++ b/src/main/java/com/l2jserver/model/world/Actor.java @@ -17,15 +17,8 @@ package com.l2jserver.model.world; import com.l2jserver.model.id.object.ActorID; -import com.l2jserver.model.template.SkillTemplate; -import com.l2jserver.model.template.capability.Attackable; import com.l2jserver.model.world.actor.ActorEffects; import com.l2jserver.model.world.actor.ActorSkillContainer; -import com.l2jserver.model.world.capability.Actor; -import com.l2jserver.model.world.capability.Attacker; -import com.l2jserver.model.world.capability.Castable; -import com.l2jserver.model.world.capability.Equipable; -import com.l2jserver.model.world.capability.Equiper; import com.l2jserver.util.dimensional.Coordinate; import com.l2jserver.util.dimensional.Point; @@ -34,7 +27,7 @@ import com.l2jserver.util.dimensional.Point; * * @author Rogiel */ -public abstract class AbstractActor extends AbstractObject implements Actor { +public abstract class Actor extends PositionableObject { /** * The actor race */ @@ -124,78 +117,14 @@ public abstract class AbstractActor extends AbstractObject implements Actor { */ protected final ActorSkillContainer skills = new ActorSkillContainer(this); - @Override - public void receiveDamage(int damage) { - // TODO Auto-generated method stub - - } - - @Override public int getHP() { return hp; } - @Override public void setHP(int hp) { this.hp = hp; } - @Override - public void receiveAttack(Attacker attacker, Attackable weapon) { - // TODO - } - - @Override - public void attack(com.l2jserver.model.world.capability.Attackable target, - Attackable weapon) { - // TODO - } - - @Override - public void cast() { - // TODO - } - - @Override - public void cast(SkillTemplate skill, Castable cast) { - // TODO - } - - @Override - public void spawn(Coordinate coordinate) { - // TODO - } - - @Override - public boolean isSpawned() { - return false; - } - - /** - * @return the coordinate point - */ - public Point getPoint() { - return point; - } - - /** - * @param point - * the coordinate point to set - */ - public void setPoint(Point point) { - this.point = point; - } - - @Override - public Coordinate getPosition() { - return point.getCoordinate(); - } - - @Override - public void setPosition(Coordinate coord) { - this.point = new Point(coord, (point != null ? point.getAngle() : 0)); - } - /** * @return the race */ @@ -226,12 +155,10 @@ public abstract class AbstractActor extends AbstractObject implements Actor { this.sex = sex; } - @Override public int getLevel() { return level; } - @Override public void setLevel(int level) { this.level = level; } @@ -239,52 +166,14 @@ public abstract class AbstractActor extends AbstractObject implements Actor { /** * @return the active effects on this actor */ - @Override public ActorEffects getEffects() { return effects; } - @Override public ActorSkillContainer getSkills() { return skills; } - @Override - public void die(WorldObject killer) { - // TODO - } - - @Override - public void equip(Equipable equipable) { - // TODO - } - - @Override - public boolean isEquiped(Equipable equipment) { - return false; - } - - @Override - public boolean isEquiped( - com.l2jserver.model.template.capability.Equipable equipable) { - return false; - } - - @Override - public void setEquipment(Object slot, Equipable equipment) { - // TODO - } - - @Override - public void getEquipment(Object slot) { - // TODO - } - - @Override - public void equip(Equiper equiper) { - // TODO - } - @Override public ActorID getID() { return (ActorID) super.getID(); diff --git a/src/main/java/com/l2jserver/model/world/Clan.java b/src/main/java/com/l2jserver/model/world/Clan.java index 624a01844..aa4b4c78d 100644 --- a/src/main/java/com/l2jserver/model/world/Clan.java +++ b/src/main/java/com/l2jserver/model/world/Clan.java @@ -21,7 +21,6 @@ import java.util.Iterator; import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.object.ClanID; import com.l2jserver.model.id.object.iterator.WorldObjectIterator; -import com.l2jserver.model.world.capability.Joinable; import com.l2jserver.model.world.clan.ClanMembers; /** @@ -29,7 +28,7 @@ import com.l2jserver.model.world.clan.ClanMembers; * * @author Rogiel */ -public class Clan extends AbstractObject implements Joinable { +public class Clan extends AbstractObject implements Iterable { /** * Clan leader */ @@ -40,16 +39,6 @@ public class Clan extends AbstractObject implements Joinable { */ private final ClanMembers members = new ClanMembers(this); - @Override - public void join(L2Character member) { - members.add(member); - } - - @Override - public void leave(L2Character member) { - members.remove(member); - } - /** * @return the leaderID */ diff --git a/src/main/java/com/l2jserver/model/world/Item.java b/src/main/java/com/l2jserver/model/world/Item.java index e7b1296e2..f970026c6 100644 --- a/src/main/java/com/l2jserver/model/world/Item.java +++ b/src/main/java/com/l2jserver/model/world/Item.java @@ -19,9 +19,6 @@ package com.l2jserver.model.world; import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.template.ItemTemplateID; import com.l2jserver.model.template.ItemTemplate; -import com.l2jserver.model.world.capability.Dropable; -import com.l2jserver.model.world.capability.Playable; -import com.l2jserver.model.world.capability.Spawnable; import com.l2jserver.model.world.character.CharacterInventory.InventoryLocation; import com.l2jserver.model.world.character.CharacterInventory.InventoryPaperdoll; import com.l2jserver.util.dimensional.Coordinate; @@ -47,8 +44,7 @@ import com.l2jserver.util.dimensional.Point; * * @author Rogiel */ -public class Item extends AbstractObject implements Playable, Spawnable, - Dropable { +public class Item extends PositionableObject { /** * The {@link ItemTemplate} ID */ @@ -80,33 +76,6 @@ public class Item extends AbstractObject implements Playable, Spawnable, this.templateID = templateID; } - @Override - public void drop(Coordinate position) { - this.coordinate = position; - this.location = null; - this.paperdoll = null; - } - - @Override - public void spawn(Coordinate coordinate) { - this.drop(coordinate); - } - - @Override - public boolean isSpawned() { - return (location != null); - } - - @Override - public Coordinate getPosition() { - return coordinate; - } - - @Override - public void setPosition(Coordinate coord) { - this.coordinate = coord; - } - /** * @return the count */ @@ -176,17 +145,10 @@ public class Item extends AbstractObject implements Playable, Spawnable, this.ownerID = ownerID; } - /* - * (non-Javadoc) - * - * @see com.l2jserver.model.world.capability.Pointable#getPoint() - */ - @Override public Point getPoint() { return null; } - @Override public void setPoint(Point point) { } diff --git a/src/main/java/com/l2jserver/model/world/L2Character.java b/src/main/java/com/l2jserver/model/world/L2Character.java index cdce67e9b..a181f218e 100644 --- a/src/main/java/com/l2jserver/model/world/L2Character.java +++ b/src/main/java/com/l2jserver/model/world/L2Character.java @@ -25,7 +25,6 @@ import com.l2jserver.model.id.object.ClanID; import com.l2jserver.model.id.object.PetID; import com.l2jserver.model.template.CharacterTemplate; import com.l2jserver.model.world.actor.ActorAttributes; -import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.character.CharacterAppearance; import com.l2jserver.model.world.character.CharacterCalculatedAttributes; import com.l2jserver.model.world.character.CharacterClass; diff --git a/src/main/java/com/l2jserver/model/world/NPC.java b/src/main/java/com/l2jserver/model/world/NPC.java index a5677d7eb..531734e16 100644 --- a/src/main/java/com/l2jserver/model/world/NPC.java +++ b/src/main/java/com/l2jserver/model/world/NPC.java @@ -29,7 +29,7 @@ import com.l2jserver.service.game.ai.AIScript; * * @author Rogiel */ -public class NPC extends AbstractActor { +public class NPC extends Actor { /** * The NPC template ID */ diff --git a/src/main/java/com/l2jserver/model/world/Party.java b/src/main/java/com/l2jserver/model/world/Party.java deleted file mode 100644 index b43c55764..000000000 --- a/src/main/java/com/l2jserver/model/world/Party.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world; - -import java.util.Iterator; -import java.util.List; - -import com.l2jserver.model.id.object.CharacterID; -import com.l2jserver.model.id.object.ClanID; -import com.l2jserver.model.id.object.iterator.WorldObjectIterator; -import com.l2jserver.model.world.capability.Joinable; -import com.l2jserver.util.factory.CollectionFactory; - -/** - * This class represents an Party in Lineage II world - * - * @author Rogiel - */ -public class Party extends AbstractObject implements Joinable { - /** - * Active party members - */ - private final List members = CollectionFactory.newList(); - - @Override - public void join(L2Character member) { - members.add(member.getID()); - } - - @Override - public ClanID getID() { - return (ClanID) super.getID(); - } - - @Override - public void leave(L2Character member) { - - } - - @Override - public Iterator iterator() { - return new WorldObjectIterator(members.iterator()); - } -} diff --git a/src/main/java/com/l2jserver/model/world/Pet.java b/src/main/java/com/l2jserver/model/world/Pet.java index 661ff9413..1844c0586 100644 --- a/src/main/java/com/l2jserver/model/world/Pet.java +++ b/src/main/java/com/l2jserver/model/world/Pet.java @@ -18,15 +18,13 @@ package com.l2jserver.model.world; import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.object.ItemID; -import com.l2jserver.model.world.capability.Summonable; -import com.l2jserver.util.dimensional.Coordinate; /** * This class represents an Pet in the Lineage II World * * @author Rogiel */ -public class Pet extends Player implements Summonable { +public class Pet extends Player { /** * The {@link CharacterID} pet's owner */ @@ -36,18 +34,6 @@ public class Pet extends Player implements Summonable { */ private ItemID itemID; - @Override - public void summon(Coordinate coordinate) { - // TODO Auto-generated method stub - - } - - @Override - public boolean isSummoned() { - // TODO Auto-generated method stub - return false; - } - /** * @return the owner ID */ diff --git a/src/main/java/com/l2jserver/model/world/Player.java b/src/main/java/com/l2jserver/model/world/Player.java index 1a22eca51..58180b511 100644 --- a/src/main/java/com/l2jserver/model/world/Player.java +++ b/src/main/java/com/l2jserver/model/world/Player.java @@ -16,15 +16,12 @@ */ package com.l2jserver.model.world; -import com.l2jserver.model.world.capability.Actor; -import com.l2jserver.model.world.capability.Playable; - /** * {@link Player} is any object that can be controlled by the player. The most * common implementation is {@link L2Character}. * * @author Rogiel */ -public abstract class Player extends AbstractActor implements Playable, Actor { +public abstract class Player extends Actor { } diff --git a/src/main/java/com/l2jserver/model/world/capability/Dropable.java b/src/main/java/com/l2jserver/model/world/PositionableObject.java similarity index 59% rename from src/main/java/com/l2jserver/model/world/capability/Dropable.java rename to src/main/java/com/l2jserver/model/world/PositionableObject.java index ee9602b3f..674b2289a 100644 --- a/src/main/java/com/l2jserver/model/world/capability/Dropable.java +++ b/src/main/java/com/l2jserver/model/world/PositionableObject.java @@ -14,22 +14,38 @@ * You should have received a copy of the GNU General Public License * along with l2jserver. If not, see . */ -package com.l2jserver.model.world.capability; +package com.l2jserver.model.world; -import com.l2jserver.model.world.AbstractObject; import com.l2jserver.util.dimensional.Coordinate; +import com.l2jserver.util.dimensional.Point; /** - * Defines an {@link AbstractObject} that can be dropped on the ground. - * * @author Rogiel + * */ -public interface Dropable extends Positionable { +public abstract class PositionableObject extends AbstractObject { + private Point point; + /** - * When an item is dropped its position will be set as position - * - * @param position - * the position + * @return the coordinate point */ - void drop(Coordinate position); + public Point getPoint() { + return point; + } + + /** + * @param point + * the coordinate point to set + */ + public void setPoint(Point point) { + this.point = point; + } + + public Coordinate getPosition() { + return point.getCoordinate(); + } + + public void setPosition(Coordinate coord) { + this.point = new Point(coord, (point != null ? point.getAngle() : 0)); + } } diff --git a/src/main/java/com/l2jserver/model/world/actor/ActorEffects.java b/src/main/java/com/l2jserver/model/world/actor/ActorEffects.java index 9563ffed5..11619ba72 100644 --- a/src/main/java/com/l2jserver/model/world/actor/ActorEffects.java +++ b/src/main/java/com/l2jserver/model/world/actor/ActorEffects.java @@ -16,7 +16,7 @@ */ package com.l2jserver.model.world.actor; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; /** * Class controlling active effects on an {@link Actor}. diff --git a/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java b/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java index e676048d9..1208d221c 100644 --- a/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java +++ b/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java @@ -16,7 +16,7 @@ */ package com.l2jserver.model.world.actor; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; /** * This enumeration maps for each level the minimum experience required. diff --git a/src/main/java/com/l2jserver/model/world/actor/ActorSkillContainer.java b/src/main/java/com/l2jserver/model/world/actor/ActorSkillContainer.java index b0863bbc7..3370b333a 100644 --- a/src/main/java/com/l2jserver/model/world/actor/ActorSkillContainer.java +++ b/src/main/java/com/l2jserver/model/world/actor/ActorSkillContainer.java @@ -23,7 +23,7 @@ import java.util.List; import com.l2jserver.model.game.Skill; import com.l2jserver.model.id.template.SkillTemplateID; import com.l2jserver.model.template.SkillTemplate; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; import com.l2jserver.util.factory.CollectionFactory; /** diff --git a/src/main/java/com/l2jserver/model/world/actor/event/ActorEvent.java b/src/main/java/com/l2jserver/model/world/actor/event/ActorEvent.java index f7c2c9675..7f8e1b516 100644 --- a/src/main/java/com/l2jserver/model/world/actor/event/ActorEvent.java +++ b/src/main/java/com/l2jserver/model/world/actor/event/ActorEvent.java @@ -16,7 +16,7 @@ */ package com.l2jserver.model.world.actor.event; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; import com.l2jserver.service.game.world.event.WorldEvent; /** diff --git a/src/main/java/com/l2jserver/model/world/actor/event/ActorSpawnEvent.java b/src/main/java/com/l2jserver/model/world/actor/event/ActorSpawnEvent.java index 4ce7f2783..8b77650a2 100644 --- a/src/main/java/com/l2jserver/model/world/actor/event/ActorSpawnEvent.java +++ b/src/main/java/com/l2jserver/model/world/actor/event/ActorSpawnEvent.java @@ -17,8 +17,8 @@ package com.l2jserver.model.world.actor.event; import com.l2jserver.model.id.ObjectID; -import com.l2jserver.model.world.capability.Actor; -import com.l2jserver.model.world.capability.Spawnable; +import com.l2jserver.model.world.Actor; +import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.event.SpawnEvent; import com.l2jserver.util.dimensional.Point; @@ -51,7 +51,7 @@ public class ActorSpawnEvent implements ActorEvent, SpawnEvent { } @Override - public Spawnable getObject() { + public WorldObject getObject() { return actor; } diff --git a/src/main/java/com/l2jserver/model/world/capability/Actor.java b/src/main/java/com/l2jserver/model/world/capability/Actor.java deleted file mode 100644 index bdda7fe15..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Actor.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.id.object.ActorID; -import com.l2jserver.model.world.AbstractObject; -import com.l2jserver.model.world.actor.ActorEffects; -import com.l2jserver.model.world.actor.ActorSkillContainer; - -/** - * Defines an {@link AbstractObject} that defines an Actor (NPC, player, pet, - * etc...) - * - * @author Rogiel - */ -public interface Actor extends Spawnable, Pointable, Damagable, Attackable, - Attacker, Castable, Caster, Levelable, Killable, Equiper, Equipable { - /** - * @return the actor effects - */ - ActorEffects getEffects(); - - /** - * @return the actor skills - */ - ActorSkillContainer getSkills(); - - @Override - ActorID getID(); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Attackable.java b/src/main/java/com/l2jserver/model/world/capability/Attackable.java deleted file mode 100644 index a2cc9a5c5..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Attackable.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can receive attacks from an - * {@link Attacker}. - * - * @author Rogiel - */ -public interface Attackable extends ObjectCapability { - void receiveAttack(Attacker attacker, - com.l2jserver.model.template.capability.Attackable weapon); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Attacker.java b/src/main/java/com/l2jserver/model/world/capability/Attacker.java deleted file mode 100644 index f48eae944..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Attacker.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can attack an {@link Attackable}. - * - * @author Rogiel - */ -public interface Attacker extends ObjectCapability { - void attack(Attackable target, - com.l2jserver.model.template.capability.Attackable weapon); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Castable.java b/src/main/java/com/l2jserver/model/world/capability/Castable.java deleted file mode 100644 index af867005e..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Castable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can receive skill castings. - * - * @author Rogiel - */ -public interface Castable extends ObjectCapability { - void cast(); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Caster.java b/src/main/java/com/l2jserver/model/world/capability/Caster.java deleted file mode 100644 index b88475fa1..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Caster.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.template.SkillTemplate; -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can cast skills. - * - * @author Rogiel - */ -public interface Caster extends ObjectCapability { - void cast(SkillTemplate skill, Castable cast); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Consumable.java b/src/main/java/com/l2jserver/model/world/capability/Consumable.java deleted file mode 100644 index a92866bb3..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Consumable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.template.ItemTemplate; -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can be consumed. - * - * @author Rogiel - */ -public interface Consumable extends ObjectCapability { - void consume(ItemTemplate item, Castable target); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Conversable.java b/src/main/java/com/l2jserver/model/world/capability/Conversable.java deleted file mode 100644 index 413cc2997..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Conversable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that an player can talk to. - * - * @author Rogiel - */ -public interface Conversable extends ObjectCapability { - void talk(Talker talker); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Damagable.java b/src/main/java/com/l2jserver/model/world/capability/Damagable.java deleted file mode 100644 index 68774ab3c..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Damagable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can be damaged (HP) - * - * @author Rogiel - */ -public interface Damagable extends ObjectCapability { - void receiveDamage(int damage); - - int getHP(); - - void setHP(int hp); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Enchantable.java b/src/main/java/com/l2jserver/model/world/capability/Enchantable.java deleted file mode 100644 index 2d8865bef..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Enchantable.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can be enchanted. - * - * @author Rogiel - */ -public interface Enchantable extends ObjectCapability { - /** - * Get the current enchant level in the object - * - * @return the enchant level - */ - int getEnchantLevel(); - - /** - * Set the new enchant level in the object - * - * @param level - * the enchant level - */ - void setEnchantLevel(int level); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Equipable.java b/src/main/java/com/l2jserver/model/world/capability/Equipable.java deleted file mode 100644 index 0f2435b96..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Equipable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can be equipped into an - * {@link Equiper}. - * - * @author Rogiel - */ -public interface Equipable extends ObjectCapability { - void equip(Equiper equiper); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Equiper.java b/src/main/java/com/l2jserver/model/world/capability/Equiper.java deleted file mode 100644 index 20556023e..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Equiper.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can be equipped with {@link Equipable} - * instances. - * - * @author Rogiel - */ -public interface Equiper extends ObjectCapability { - void equip(Equipable equipable); - - boolean isEquiped(Equipable equipment); - - boolean isEquiped( - com.l2jserver.model.template.capability.Equipable equipable); - - void setEquipment(Object slot, Equipable equipment); - - void getEquipment(Object slot); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Invisible.java b/src/main/java/com/l2jserver/model/world/capability/Invisible.java deleted file mode 100644 index 48ea57d86..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Invisible.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can become invisible to other objects. - * - * @author Rogiel - */ -public interface Invisible extends ObjectCapability { - boolean isInvisible(); - - void setInvisible(); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Joinable.java b/src/main/java/com/l2jserver/model/world/capability/Joinable.java deleted file mode 100644 index 83f3ecb2e..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Joinable.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that other objects can join to. - * - * @author Rogiel - */ -public interface Joinable extends ObjectCapability, Iterable { - /** - * Join an member to this object. - * - * @param member - * the entering member - */ - void join(T member); - - /** - * Removes the joined member from this object - * - * @param member - * the exiting member - */ - void leave(T member); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Killable.java b/src/main/java/com/l2jserver/model/world/capability/Killable.java deleted file mode 100644 index b859a6942..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Killable.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; -import com.l2jserver.model.world.WorldObject; - -/** - * Defines an {@link AbstractObject} that can be killed. - * - * @author Rogiel - */ -public interface Killable extends ObjectCapability { - /** - * Process the dying routines. Note that if the object killed himself, - * killer must be his instance. - * - * @param killer - * the killer. Can be null if unknown. - */ - void die(WorldObject killer); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Levelable.java b/src/main/java/com/l2jserver/model/world/capability/Levelable.java deleted file mode 100644 index 68a72500b..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Levelable.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that has levels. - * - * @author Rogiel - */ -public interface Levelable extends ObjectCapability { - /** - * Get this object`s level - * - * @return the level - */ - int getLevel(); - - /** - * Set this object's level - * - * @param level - */ - void setLevel(int level); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Mana.java b/src/main/java/com/l2jserver/model/world/capability/Mana.java deleted file mode 100644 index dfca691b7..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Mana.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can be damaged (HP) - * - * @author Rogiel - */ -public interface Mana extends ObjectCapability { - void consumeMana(int amount); - - int getMP(); - - void setMP(int mana); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/ObjectCapability.java b/src/main/java/com/l2jserver/model/world/capability/ObjectCapability.java deleted file mode 100644 index 6e4b583c3..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/ObjectCapability.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; -import com.l2jserver.model.world.WorldObject; - -/** - * Defines an base interface for all capabilities for {@link AbstractObject} - * instances. No implementing class need to implement this interface. - * - * @author Rogiel - */ -public interface ObjectCapability extends WorldObject { -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Playable.java b/src/main/java/com/l2jserver/model/world/capability/Playable.java deleted file mode 100644 index 0e457758d..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Playable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can be played (i.e. controlled by the - * player) - * - * @author Rogiel - */ -public interface Playable extends ObjectCapability { - -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Pointable.java b/src/main/java/com/l2jserver/model/world/capability/Pointable.java deleted file mode 100644 index d3c293a4a..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Pointable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; -import com.l2jserver.util.dimensional.Point; - -/** - * Defines an {@link AbstractObject} that can be positioned and pointed in the - * world. - * - * @author Rogiel - */ -public interface Pointable extends Positionable { - Point getPoint(); - - void setPoint(Point point); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Positionable.java b/src/main/java/com/l2jserver/model/world/capability/Positionable.java deleted file mode 100644 index 2190f6a60..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Positionable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; -import com.l2jserver.util.dimensional.Coordinate; - -/** - * Defines an {@link AbstractObject} that can be positioned in the world. - * - * @author Rogiel - */ -public interface Positionable extends ObjectCapability { - Coordinate getPosition(); - - void setPosition(Coordinate coord); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Spawnable.java b/src/main/java/com/l2jserver/model/world/capability/Spawnable.java deleted file mode 100644 index d39672eba..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Spawnable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; -import com.l2jserver.util.dimensional.Coordinate; - -/** - * Represents an {@link AbstractObject} that can be spawned. - * - * @author Rogiel - */ -public interface Spawnable extends ObjectCapability, Positionable, Pointable { - void spawn(Coordinate coordinate); - - boolean isSpawned(); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Summonable.java b/src/main/java/com/l2jserver/model/world/capability/Summonable.java deleted file mode 100644 index a2427d109..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Summonable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; -import com.l2jserver.util.dimensional.Coordinate; - -/** - * Represents an {@link AbstractObject} that can be summoned. - * - * @author Rogiel - */ -public interface Summonable extends Spawnable { - void summon(Coordinate coordinate); - - boolean isSummoned(); -} diff --git a/src/main/java/com/l2jserver/model/world/capability/Talker.java b/src/main/java/com/l2jserver/model/world/capability/Talker.java deleted file mode 100644 index ee9e7d9b2..000000000 --- a/src/main/java/com/l2jserver/model/world/capability/Talker.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.capability; - -import com.l2jserver.model.world.AbstractObject; - -/** - * Defines an {@link AbstractObject} that can talk to an {@link Conversable}. - * - * @author Rogiel - */ -public interface Talker extends ObjectCapability { -} diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterClass.java b/src/main/java/com/l2jserver/model/world/character/CharacterClass.java index 2e3e91504..4bc994360 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterClass.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterClass.java @@ -16,7 +16,7 @@ */ package com.l2jserver.model.world.character; -import com.l2jserver.model.world.AbstractActor.Race; +import com.l2jserver.model.world.Actor.Race; /** * Defines all the possible classes for an character diff --git a/src/main/java/com/l2jserver/model/world/character/event/CharacterEnterWorldEvent.java b/src/main/java/com/l2jserver/model/world/character/event/CharacterEnterWorldEvent.java index a13e4e6ed..e85e36423 100644 --- a/src/main/java/com/l2jserver/model/world/character/event/CharacterEnterWorldEvent.java +++ b/src/main/java/com/l2jserver/model/world/character/event/CharacterEnterWorldEvent.java @@ -19,10 +19,10 @@ package com.l2jserver.model.world.character.event; import java.util.Date; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Actor; /** * Event triggered once a character logs-in. diff --git a/src/main/java/com/l2jserver/model/world/character/event/CharacterLeaveWorldEvent.java b/src/main/java/com/l2jserver/model/world/character/event/CharacterLeaveWorldEvent.java index d31a61fb4..615a012ae 100644 --- a/src/main/java/com/l2jserver/model/world/character/event/CharacterLeaveWorldEvent.java +++ b/src/main/java/com/l2jserver/model/world/character/event/CharacterLeaveWorldEvent.java @@ -19,10 +19,10 @@ package com.l2jserver.model.world.character.event; import java.util.Date; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Actor; /** * Event triggered once a character logs-out. diff --git a/src/main/java/com/l2jserver/model/world/character/event/CharacterMoveEvent.java b/src/main/java/com/l2jserver/model/world/character/event/CharacterMoveEvent.java index 2e7be5de6..ac5689bf9 100644 --- a/src/main/java/com/l2jserver/model/world/character/event/CharacterMoveEvent.java +++ b/src/main/java/com/l2jserver/model/world/character/event/CharacterMoveEvent.java @@ -17,10 +17,10 @@ package com.l2jserver.model.world.character.event; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Actor; import com.l2jserver.util.dimensional.Point; /** diff --git a/src/main/java/com/l2jserver/model/world/character/event/CharacterRunningEvent.java b/src/main/java/com/l2jserver/model/world/character/event/CharacterRunningEvent.java index f0939d70d..2d6df2fcb 100644 --- a/src/main/java/com/l2jserver/model/world/character/event/CharacterRunningEvent.java +++ b/src/main/java/com/l2jserver/model/world/character/event/CharacterRunningEvent.java @@ -17,10 +17,10 @@ package com.l2jserver.model.world.character.event; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Actor; /** * Event triggered once a character starts running diff --git a/src/main/java/com/l2jserver/model/world/character/event/CharacterStopMoveEvent.java b/src/main/java/com/l2jserver/model/world/character/event/CharacterStopMoveEvent.java index 87195794c..74427e05a 100644 --- a/src/main/java/com/l2jserver/model/world/character/event/CharacterStopMoveEvent.java +++ b/src/main/java/com/l2jserver/model/world/character/event/CharacterStopMoveEvent.java @@ -17,10 +17,10 @@ package com.l2jserver.model.world.character.event; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Actor; import com.l2jserver.util.dimensional.Point; /** diff --git a/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetDeselectedEvent.java b/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetDeselectedEvent.java index 1260911fa..7944702c7 100644 --- a/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetDeselectedEvent.java +++ b/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetDeselectedEvent.java @@ -17,10 +17,10 @@ package com.l2jserver.model.world.character.event; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Actor; /** * Event triggered once a character moves diff --git a/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetSelectedEvent.java b/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetSelectedEvent.java index 62bb55a3d..601bab9df 100644 --- a/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetSelectedEvent.java +++ b/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetSelectedEvent.java @@ -17,10 +17,10 @@ package com.l2jserver.model.world.character.event; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Actor; /** * Event triggered once a character moves diff --git a/src/main/java/com/l2jserver/model/world/character/event/CharacterWalkingEvent.java b/src/main/java/com/l2jserver/model/world/character/event/CharacterWalkingEvent.java index 18cdd349b..49c766856 100644 --- a/src/main/java/com/l2jserver/model/world/character/event/CharacterWalkingEvent.java +++ b/src/main/java/com/l2jserver/model/world/character/event/CharacterWalkingEvent.java @@ -17,10 +17,10 @@ package com.l2jserver.model.world.character.event; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Actor; /** * Event triggered once a character starts walking diff --git a/src/main/java/com/l2jserver/model/world/event/SpawnEvent.java b/src/main/java/com/l2jserver/model/world/event/SpawnEvent.java index fb16a5805..440e7606e 100644 --- a/src/main/java/com/l2jserver/model/world/event/SpawnEvent.java +++ b/src/main/java/com/l2jserver/model/world/event/SpawnEvent.java @@ -16,7 +16,6 @@ */ package com.l2jserver.model.world.event; -import com.l2jserver.model.world.capability.Spawnable; import com.l2jserver.service.game.world.event.WorldEvent; import com.l2jserver.util.dimensional.Point; @@ -26,9 +25,6 @@ import com.l2jserver.util.dimensional.Point; * @author Rogiel */ public interface SpawnEvent extends WorldEvent { - @Override - Spawnable getObject(); - /** * @return the spawning point */ diff --git a/src/main/java/com/l2jserver/model/world/item/ItemDropEvent.java b/src/main/java/com/l2jserver/model/world/item/ItemDropEvent.java index 96db7c187..163cfa5e0 100644 --- a/src/main/java/com/l2jserver/model/world/item/ItemDropEvent.java +++ b/src/main/java/com/l2jserver/model/world/item/ItemDropEvent.java @@ -17,10 +17,10 @@ package com.l2jserver.model.world.item; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.Item; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.player.event.PlayerEvent; /** diff --git a/src/main/java/com/l2jserver/model/world/party/PartyEvent.java b/src/main/java/com/l2jserver/model/world/party/PartyEvent.java deleted file mode 100644 index 20e1592d9..000000000 --- a/src/main/java/com/l2jserver/model/world/party/PartyEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.party; - -import com.l2jserver.model.world.Clan; -import com.l2jserver.model.world.Party; -import com.l2jserver.service.game.world.event.WorldEvent; - -/** - * Base event for {@link Party} objects - * - * @author Rogiel - */ -public interface PartyEvent extends WorldEvent { - Clan getClan(); -} diff --git a/src/main/java/com/l2jserver/model/world/party/PartyListener.java b/src/main/java/com/l2jserver/model/world/party/PartyListener.java deleted file mode 100644 index bfc6209f7..000000000 --- a/src/main/java/com/l2jserver/model/world/party/PartyListener.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of l2jserver . - * - * l2jserver is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver. If not, see . - */ -package com.l2jserver.model.world.party; - -import com.l2jserver.service.game.world.event.WorldEvent; -import com.l2jserver.service.game.world.event.WorldListener; - -/** - * This listener will filter to only dispatch {@link PartyEvent} events. - * - * @author Rogiel - */ -public abstract class PartyListener implements WorldListener { - @Override - public boolean dispatch(WorldEvent e) { - if (!(e instanceof PartyEvent)) - return false; - return dispatch((PartyEvent) e); - } - - /** - * @see WorldListener#dispatch(WorldEvent) - */ - protected abstract boolean dispatch(PartyEvent e); -} diff --git a/src/main/java/com/l2jserver/model/world/player/event/PlayerTeleportingEvent.java b/src/main/java/com/l2jserver/model/world/player/event/PlayerTeleportingEvent.java index 912147c37..1ea4fa7f8 100644 --- a/src/main/java/com/l2jserver/model/world/player/event/PlayerTeleportingEvent.java +++ b/src/main/java/com/l2jserver/model/world/player/event/PlayerTeleportingEvent.java @@ -17,9 +17,9 @@ package com.l2jserver.model.world.player.event; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.Actor; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Actor; import com.l2jserver.util.dimensional.Point; /** diff --git a/src/main/java/com/l2jserver/service/game/ai/AIService.java b/src/main/java/com/l2jserver/service/game/ai/AIService.java index c10902153..7f9b9b148 100644 --- a/src/main/java/com/l2jserver/service/game/ai/AIService.java +++ b/src/main/java/com/l2jserver/service/game/ai/AIService.java @@ -16,7 +16,7 @@ */ package com.l2jserver.service.game.ai; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; import com.l2jserver.service.Service; import com.l2jserver.util.dimensional.Coordinate; diff --git a/src/main/java/com/l2jserver/service/game/ai/AIServiceImpl.java b/src/main/java/com/l2jserver/service/game/ai/AIServiceImpl.java index 56339700d..d0a65e90e 100644 --- a/src/main/java/com/l2jserver/service/game/ai/AIServiceImpl.java +++ b/src/main/java/com/l2jserver/service/game/ai/AIServiceImpl.java @@ -17,7 +17,7 @@ package com.l2jserver.service.game.ai; import com.google.inject.Inject; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; import com.l2jserver.service.AbstractService; import com.l2jserver.service.AbstractService.Depends; import com.l2jserver.service.ServiceStartException; diff --git a/src/main/java/com/l2jserver/service/game/ai/script/AttackAIScript.java b/src/main/java/com/l2jserver/service/game/ai/script/AttackAIScript.java index 9527572a0..0472df10f 100644 --- a/src/main/java/com/l2jserver/service/game/ai/script/AttackAIScript.java +++ b/src/main/java/com/l2jserver/service/game/ai/script/AttackAIScript.java @@ -16,12 +16,12 @@ */ package com.l2jserver.service.game.ai.script; -import com.l2jserver.model.world.capability.Attackable; +import com.l2jserver.model.world.Actor; import com.l2jserver.service.game.ai.AIScript; /** * @author Rogiel( + final WorldListener broadcastListener = new FilteredWorldListener( new KnownListFilter(character)) { @Override - protected boolean dispatch(WorldEvent e, Positionable object) { + protected boolean dispatch(WorldEvent e, PositionableObject object) { if (e instanceof NPCSpawnEvent) { conn.write(new NPCInformationPacket((NPC) object)); } else if (e instanceof CharacterMoveEvent) { @@ -175,7 +175,7 @@ public class CharacterServiceImpl extends AbstractService implements } else if (e instanceof PlayerTeleportedEvent || e instanceof CharacterEnterWorldEvent) { // TODO this should not be here! - for (final WorldObject o : worldService + for (final PositionableObject o : worldService .iterable(new KnownListFilter(character))) { if (o instanceof NPC) { conn.write(new NPCInformationPacket((NPC) o)); diff --git a/src/main/java/com/l2jserver/service/game/region/RegionService.java b/src/main/java/com/l2jserver/service/game/region/RegionService.java index 3760bc774..b075bdaca 100644 --- a/src/main/java/com/l2jserver/service/game/region/RegionService.java +++ b/src/main/java/com/l2jserver/service/game/region/RegionService.java @@ -16,7 +16,7 @@ */ package com.l2jserver.service.game.region; -import com.l2jserver.model.world.capability.Actor; +import com.l2jserver.model.world.Actor; import com.l2jserver.service.Service; /** diff --git a/src/main/java/com/l2jserver/service/game/spawn/SpawnService.java b/src/main/java/com/l2jserver/service/game/spawn/SpawnService.java index 0150967fd..233f4130f 100644 --- a/src/main/java/com/l2jserver/service/game/spawn/SpawnService.java +++ b/src/main/java/com/l2jserver/service/game/spawn/SpawnService.java @@ -17,7 +17,7 @@ package com.l2jserver.service.game.spawn; import com.l2jserver.model.world.Player; -import com.l2jserver.model.world.capability.Spawnable; +import com.l2jserver.model.world.PositionableObject; import com.l2jserver.model.world.event.SpawnEvent; import com.l2jserver.model.world.player.event.PlayerTeleportingEvent; import com.l2jserver.service.Service; @@ -36,7 +36,7 @@ public interface SpawnService extends Service { * An {@link SpawnEvent} will be dispatched and the object will be * registered in the world (if it isn't already) * - * @param spawnable + * @param object * the spawnable object * @param point * the spawning point. If null, will try to use @@ -47,7 +47,7 @@ public interface SpawnService extends Service { * @throws AlreadySpawnedServiceException * if the object is already spawned in the world */ - void spawn(Spawnable spawnable, Point point) + void spawn(PositionableObject object, Point point) throws SpawnPointNotFoundServiceException, AlreadySpawnedServiceException; @@ -75,7 +75,7 @@ public interface SpawnService extends Service { * @param spawnable * the spawnable object */ - void scheduleRespawn(Spawnable spawnable); + void scheduleRespawn(PositionableObject spawnable); /** * Unspawns an object from the world @@ -85,5 +85,5 @@ public interface SpawnService extends Service { * @throws NotSpawnedServiceException * if the object is not spawned */ - void unspawn(Spawnable spawnable) throws NotSpawnedServiceException; + void unspawn(PositionableObject spawnable) throws NotSpawnedServiceException; } diff --git a/src/main/java/com/l2jserver/service/game/spawn/SpawnServiceImpl.java b/src/main/java/com/l2jserver/service/game/spawn/SpawnServiceImpl.java index a5c794c2a..50770aaf9 100644 --- a/src/main/java/com/l2jserver/service/game/spawn/SpawnServiceImpl.java +++ b/src/main/java/com/l2jserver/service/game/spawn/SpawnServiceImpl.java @@ -28,7 +28,7 @@ import com.l2jserver.model.world.L2Character; import com.l2jserver.model.world.L2Character.CharacterState; import com.l2jserver.model.world.NPC; import com.l2jserver.model.world.Player; -import com.l2jserver.model.world.capability.Spawnable; +import com.l2jserver.model.world.PositionableObject; import com.l2jserver.model.world.event.SpawnEvent; import com.l2jserver.model.world.npc.event.NPCSpawnEvent; import com.l2jserver.model.world.player.event.PlayerTeleportingEvent; @@ -74,32 +74,32 @@ public class SpawnServiceImpl extends AbstractService implements SpawnService { } @Override - public void spawn(Spawnable spawnable, Point point) + public void spawn(PositionableObject object, Point point) throws SpawnPointNotFoundServiceException { - Preconditions.checkNotNull(spawnable, "spawnable"); + Preconditions.checkNotNull(object, "object"); // sanitize if (point == null) // retrieving stored point - point = spawnable.getPoint(); + point = object.getPoint(); if (point == null) { // not point send and no point stored, aborting throw new SpawnPointNotFoundServiceException(); } // set the spawning point - spawnable.setPoint(point); + object.setPoint(point); // register object in the world - if (!worldService.add(spawnable)) + if (!worldService.add(object)) // TODO this should throw an exception // object was already in world return; // create the SpawnEvent SpawnEvent event = null; - if (spawnable instanceof NPC) { - final NPC npc = (NPC) spawnable; + if (object instanceof NPC) { + final NPC npc = (NPC) object; event = new NPCSpawnEvent(npc, point); - } else if (spawnable instanceof L2Character) { + } else if (object instanceof L2Character) { event = null; } @@ -114,7 +114,7 @@ public class SpawnServiceImpl extends AbstractService implements SpawnService { public void teleport(Player player, Coordinate coordinate) { Preconditions.checkNotNull(player, "player"); Preconditions.checkNotNull(coordinate, "coordinate"); - System.out.println("teleport: "+coordinate); + System.out.println("teleport: " + coordinate); player.setPosition(coordinate); if (player instanceof L2Character) { final Lineage2Connection conn = networkService @@ -132,15 +132,15 @@ public class SpawnServiceImpl extends AbstractService implements SpawnService { } @Override - public void scheduleRespawn(Spawnable spawnable) { - Preconditions.checkNotNull(spawnable, "spawnable"); + public void scheduleRespawn(PositionableObject object) { + Preconditions.checkNotNull(object, "object"); // TODO Auto-generated method stub } @Override - public void unspawn(Spawnable spawnable) { - Preconditions.checkNotNull(spawnable, "spawnable"); + public void unspawn(PositionableObject object) { + Preconditions.checkNotNull(object, "object"); // TODO Auto-generated method stub } diff --git a/src/main/java/com/l2jserver/service/game/world/WorldService.java b/src/main/java/com/l2jserver/service/game/world/WorldService.java index 5f6de6627..db13ce379 100644 --- a/src/main/java/com/l2jserver/service/game/world/WorldService.java +++ b/src/main/java/com/l2jserver/service/game/world/WorldService.java @@ -20,8 +20,8 @@ import java.util.Iterator; import java.util.List; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.PositionableObject; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Positionable; import com.l2jserver.service.Service; import com.l2jserver.service.game.world.event.WorldEventDispatcher; import com.l2jserver.service.game.world.filter.WorldObjectFilter; @@ -79,7 +79,7 @@ public interface WorldService extends Service, Iterable { * @param callback * the callback */ - void knownlist(Positionable object, KnownListCallback callback); + void knownlist(PositionableObject object, KnownListCallback callback); /** * The KnownList callback is used to execute an action for each object know diff --git a/src/main/java/com/l2jserver/service/game/world/WorldServiceImpl.java b/src/main/java/com/l2jserver/service/game/world/WorldServiceImpl.java index 93cad9eed..652c2114f 100644 --- a/src/main/java/com/l2jserver/service/game/world/WorldServiceImpl.java +++ b/src/main/java/com/l2jserver/service/game/world/WorldServiceImpl.java @@ -26,8 +26,8 @@ import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import com.google.inject.Inject; import com.l2jserver.model.id.ObjectID; +import com.l2jserver.model.world.PositionableObject; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Positionable; import com.l2jserver.service.AbstractService; import com.l2jserver.service.AbstractService.Depends; import com.l2jserver.service.ServiceStartException; @@ -122,10 +122,10 @@ public class WorldServiceImpl extends AbstractService implements WorldService { } @Override - public void knownlist(Positionable object, KnownListCallback callback) { + public void knownlist(PositionableObject object, KnownListCallback callback) { Preconditions.checkNotNull(object, "object"); Preconditions.checkNotNull(callback, "callback"); - for (Positionable known : iterable(new KnownListFilter(object))) { + for (PositionableObject known : iterable(new KnownListFilter(object))) { callback.knownObject(known); } } diff --git a/src/main/java/com/l2jserver/service/game/world/filter/impl/KnownListFilter.java b/src/main/java/com/l2jserver/service/game/world/filter/impl/KnownListFilter.java index b79cea2f9..6129bb1fc 100644 --- a/src/main/java/com/l2jserver/service/game/world/filter/impl/KnownListFilter.java +++ b/src/main/java/com/l2jserver/service/game/world/filter/impl/KnownListFilter.java @@ -16,8 +16,8 @@ */ package com.l2jserver.service.game.world.filter.impl; +import com.l2jserver.model.world.PositionableObject; import com.l2jserver.model.world.WorldObject; -import com.l2jserver.model.world.capability.Positionable; import com.l2jserver.service.game.world.filter.AndFilter; /** @@ -26,12 +26,12 @@ import com.l2jserver.service.game.world.filter.AndFilter; * * @author Rogiel */ -public class KnownListFilter extends AndFilter { +public class KnownListFilter extends AndFilter { public static final int KNOWNLIST_RANGE = 2000; @SuppressWarnings("unchecked") - public KnownListFilter(Positionable object) { - super(new InstanceFilter(Positionable.class), + public KnownListFilter(PositionableObject object) { + super(new InstanceFilter(PositionableObject.class), new RangeFilter(object, KNOWNLIST_RANGE)); } } diff --git a/src/main/java/com/l2jserver/service/game/world/filter/impl/RangeFilter.java b/src/main/java/com/l2jserver/service/game/world/filter/impl/RangeFilter.java index 8b44e4993..04d31cf90 100644 --- a/src/main/java/com/l2jserver/service/game/world/filter/impl/RangeFilter.java +++ b/src/main/java/com/l2jserver/service/game/world/filter/impl/RangeFilter.java @@ -17,7 +17,7 @@ package com.l2jserver.service.game.world.filter.impl; import com.google.common.base.Preconditions; -import com.l2jserver.model.world.capability.Positionable; +import com.l2jserver.model.world.PositionableObject; import com.l2jserver.service.game.world.filter.WorldObjectFilter; /** @@ -25,11 +25,11 @@ import com.l2jserver.service.game.world.filter.WorldObjectFilter; * * @author Rogiel */ -public class RangeFilter implements WorldObjectFilter { +public class RangeFilter implements WorldObjectFilter { /** * The coordinate point */ - private final Positionable object; + private final PositionableObject object; /** * The desired maximum distance of the object */ @@ -43,7 +43,7 @@ public class RangeFilter implements WorldObjectFilter { * @param range * the desired maximum distance of the object */ - public RangeFilter(final Positionable object, final int range) { + public RangeFilter(final PositionableObject object, final int range) { Preconditions.checkNotNull(object, "object"); Preconditions.checkState(range >= 0, "range < 0"); this.object = object; @@ -51,7 +51,7 @@ public class RangeFilter implements WorldObjectFilter { } @Override - public boolean accept(Positionable other) { + public boolean accept(PositionableObject other) { if (other == null) return false; return other.getPosition().getDistance(object.getPosition()) <= range; diff --git a/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateConverter.java b/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateConverter.java index 057ba63d5..4d7a96470 100644 --- a/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateConverter.java +++ b/src/tool/java/com/l2jserver/tool/conversor/chartemplate/CharacterTemplateConverter.java @@ -29,7 +29,7 @@ import java.util.regex.Pattern; import org.apache.commons.io.IOUtils; -import com.l2jserver.model.world.AbstractActor.Race; +import com.l2jserver.model.world.Actor.Race; import com.l2jserver.model.world.character.CharacterClass; import com.l2jserver.util.factory.CollectionFactory; diff --git a/src/tool/java/com/l2jserver/tool/conversor/npctemplate/NPCTemplateConverter.java b/src/tool/java/com/l2jserver/tool/conversor/npctemplate/NPCTemplateConverter.java index e19674292..281d75353 100644 --- a/src/tool/java/com/l2jserver/tool/conversor/npctemplate/NPCTemplateConverter.java +++ b/src/tool/java/com/l2jserver/tool/conversor/npctemplate/NPCTemplateConverter.java @@ -29,7 +29,7 @@ import java.util.regex.Pattern; import org.apache.commons.io.IOUtils; -import com.l2jserver.model.world.AbstractActor.Race; +import com.l2jserver.model.world.Actor.Race; import com.l2jserver.model.world.character.CharacterClass; import com.l2jserver.util.factory.CollectionFactory;