MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / getTransportIndex

Method getTransportIndex

src/main/java/images/RosterIcons.java:65–83  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

63 }
64
65 public int getTransportIndex(String name){
66 if (transports == null) return 0;
67 Object o=transports.get(name);
68 if (o instanceof String) {
69 if (o == "none") return 0;
70 int index=(transpSkins.size()+1)<<24;
71 // loading additional skin
72 ImageList customTransp=new ImageList((String) o, 1, ICONS_IN_ROW);
73 // customTransp loading success?
74 if (customTransp.getHeight()==0) customTransp=this;
75
76 transpSkins.addElement( customTransp );
77 transports.put(name, new Integer(index) );
78
79 return index;
80 } else {
81 return (o==null)?0:((Integer)o).intValue();
82 }
83 }
84
85
86 public void drawImage(Graphics g, int index, int x, int y) {

Callers 3

processPresenceMethod · 0.80
ContactMethod · 0.80
cloneMethod · 0.80

Calls 4

getHeightMethod · 0.95
addElementMethod · 0.80
putMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected