mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-28 23:15:53 -04:00
Command fixes, command removing
This commit is contained in:
@@ -35,6 +35,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.Vector;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.Executors;
|
||||
@@ -72,6 +73,7 @@ import protocol.swg.chat.ChatOnConnectAvatar;
|
||||
import protocol.swg.chat.ChatOnGetFriendsList;
|
||||
import protocol.swg.chat.ChatRoomList;
|
||||
import protocol.swg.chat.ChatServerStatus;
|
||||
import protocol.swg.objectControllerObjects.ShowFlyText;
|
||||
import protocol.swg.objectControllerObjects.UiPlayEffect;
|
||||
import engine.clientdata.ClientFileManager;
|
||||
import engine.clientdata.visitors.CrcStringTableVisitor;
|
||||
@@ -590,6 +592,32 @@ public class ObjectService implements INetworkDispatch {
|
||||
|
||||
}
|
||||
|
||||
public SWGObject getObjectByFirstName(String customName) {
|
||||
|
||||
synchronized(objectList) {
|
||||
|
||||
for(SWGObject obj : objectList.values()) {
|
||||
if(obj.getCustomName() == null)
|
||||
continue;
|
||||
if(obj.getCustomName().startsWith(customName))
|
||||
return obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EntityCursor<CreatureObject> cursor = core.getCreatureODB().getCursor(Long.class, CreatureObject.class);
|
||||
|
||||
Iterator<CreatureObject> it = cursor.iterator();
|
||||
|
||||
while(it.hasNext()) {
|
||||
if(it.next().getCustomName().startsWith(customName))
|
||||
return it.next();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public CreatureObject getCreatureFromDB(long objectId) {
|
||||
return core.getCreatureODB().get(new Long(objectId), Long.class, CreatureObject.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user