Refactor setTargetable function
This commit is contained in:
parent
69c7ba3d39
commit
84534e3ceb
@ -499,7 +499,7 @@ public class ControlHandler {
|
||||
controls.get(DATA_STRING_INPUT_CODE_DEBUG_SPAWN_ITEM).setState(true);
|
||||
} else {
|
||||
if(controls.get(DATA_STRING_INPUT_CODE_DEBUG_SPAWN_ITEM).isState() == true){
|
||||
Entity bow = ItemUtils.spawnBasicItem("Bow");
|
||||
Entity bow = ItemUtils.spawnBasicItem("Katana");
|
||||
EntityUtils.getPosition(bow).set(1, 5, 2);
|
||||
CollisionObjUtils.positionCharacter(bow, new Vector3f(1, 5, 2));
|
||||
}
|
||||
|
||||
@ -620,8 +620,8 @@ public class LoadingThread extends Thread {
|
||||
// //give evil goblin sword
|
||||
// Entity goblinSword = ItemUtils.spawnBasicItem("Katana");
|
||||
// AttachUtils.attachEntityToEntityAtBone(goblin, goblinSword, "Bone.031");
|
||||
// //attach ai to evil goblin
|
||||
// MindlessAttacker.attachToCreature(goblin);
|
||||
//attach ai to evil goblin
|
||||
MindlessAttacker.attachToCreature(goblin);
|
||||
|
||||
// goblin = CreatureUtils.spawnBasicCreature("Goblin");
|
||||
// CollisionObjUtils.positionCharacter(goblin, new Vector3f(3, 0, 4));
|
||||
|
||||
@ -282,4 +282,13 @@ public class EntityManager {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setTargetable(Entity target, boolean status){
|
||||
if(status){
|
||||
targetableList.add(target);
|
||||
} else {
|
||||
targetableList.remove(target);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ public class EquipState {
|
||||
CollisionObject rigidBody = (CollisionObject)toEquip.getData(EntityDataStrings.PHYSICS_COLLISION_BODY);
|
||||
Globals.collisionEngine.deregisterPhysicsObject(rigidBody);
|
||||
}
|
||||
Crosshair.setTargetable(equipPrimary, false);
|
||||
Globals.entityManager.setTargetable(equipPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ public class EquipState {
|
||||
CollisionObject rigidBody = (CollisionObject)equipPrimary.getData(EntityDataStrings.PHYSICS_COLLISION_BODY);
|
||||
Globals.collisionEngine.registerPhysicsObject(rigidBody);
|
||||
}
|
||||
Crosshair.setTargetable(equipPrimary, true);
|
||||
Globals.entityManager.setTargetable(equipPrimary, true);
|
||||
equipPrimary = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,13 +98,4 @@ public class Crosshair {
|
||||
return currentTarget;
|
||||
}
|
||||
|
||||
public static void setTargetable(Entity target, boolean status){
|
||||
if(status){
|
||||
Globals.entityManager.getTargetables().add(target);
|
||||
} else {
|
||||
Globals.entityManager.getTargetables().remove(target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user