Thread: [OSRSPK] Getting definitions names

Results 1 to 2 of 2
  1. #1 [OSRSPK] Getting definitions names 
    Registered Member
    Join Date
    Apr 2017
    Posts
    301
    Thanks given
    34
    Thanks received
    59
    Rep Power
    65
    Pretty basic, but nice to use in certain cases.

    Can be used for lots of different stuff. Anyways.

    ItemDefinition class
    Code:
    	public final String getNameOfItem(int itemId) {
    		return itemId == getId() ? getName() : null;
    	}
    Objectdefinition class
    Code:
    	public final String getNameOfObject(int object) {
    		GameObject gameObject = new GameObject(object, null);
    		return object == gameObject.getId() ? getName() : null;
    	}
    NPCDefintions class
    Code:
    	public final String getNameOfNPC(int npcId) {
    		return npcId == getId() ? getName() : null;
    	}
    For those who don't know what it does, simply just spits out the name for example on the ObjectDefinitions class
    Code:
    INFO: Elvarg is now online on port 43595!
    [World] Registering player - [username, host] : [Venom, 127.0.0.1]
    Altar
    Stand
    Tree
    Reply With Quote  
     

  2. #2  
    Theory Wins?
    Greyfield's Avatar
    Join Date
    Nov 2008
    Age
    32
    Posts
    1,585
    Thanks given
    61
    Thanks received
    265
    Rep Power
    310
    Should just return an empty Optional rather than directly referencing null. Just an opinion though



    Reply With Quote  
     

  3. Thankful user:



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Getting item name from id
    By JacobiYounger in forum Help
    Replies: 6
    Last Post: 12-09-2013, 02:40 AM
  2. Get Item name by Id?
    By drizzy212 in forum Help
    Replies: 1
    Last Post: 06-23-2013, 08:22 AM
  3. Get item name in RS2HD...
    By Anthony-| in forum Help
    Replies: 2
    Last Post: 03-28-2010, 11:56 PM
  4. how do i get the name of a item as a string
    By Dragonking in forum Help
    Replies: 0
    Last Post: 12-22-2009, 06:08 AM
  5. Get Weapon Name
    By Guthan in forum Tutorials
    Replies: 12
    Last Post: 08-01-2008, 06:29 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •