2 * Decompiled with CFR 0.151.
4 * Could not load the following classes:
5 * com.wurmonline.client.renderer.Color
6 * com.wurmonline.client.renderer.PickRenderer
7 * com.wurmonline.client.renderer.PickRenderer$CustomPickFillDepthRender
8 * com.wurmonline.client.renderer.PickRenderer$CustomPickFillRender
9 * com.wurmonline.client.renderer.PickRenderer$CustomPickOutlineRender
10 * com.wurmonline.client.renderer.PickableUnit
11 * com.wurmonline.client.renderer.backend.Primitive$BlendMode
12 * com.wurmonline.client.renderer.backend.Primitive$TestFunc
13 * com.wurmonline.client.renderer.backend.Queue
14 * com.wurmonline.client.renderer.backend.RenderState
16 package net
.encode
.wurmesp
;
18 import com
.wurmonline
.client
.game
.World
;
19 import com
.wurmonline
.client
.renderer
.Color
;
20 import com
.wurmonline
.client
.renderer
.PickRenderer
;
21 import com
.wurmonline
.client
.renderer
.PickableUnit
;
22 import com
.wurmonline
.client
.renderer
.WorldRender
;
23 import com
.wurmonline
.client
.renderer
.backend
.Primitive
;
24 import com
.wurmonline
.client
.renderer
.backend
.Queue
;
25 import com
.wurmonline
.client
.renderer
.backend
.RenderState
;
26 import net
.encode
.wurmesp
.util
.ReUtils
;
31 private String modelName
;
32 private String hoverName
;
33 private PickableUnit pickableUnit
;
34 private float[] color
= new float[]{0.0f, 0.0f, 0.0f};
35 private float[] conditionedcolor
= new float[]{0.0f, 0.0f, 0.0f};
36 private String condition
;
37 public static float[] colorPlayers
= new float[]{0.0f, 0.0f, 0.0f};
38 public static float[] colorPlayersEnemy
= new float[]{0.0f, 0.0f, 0.0f};
39 public static float[] colorMobs
= new float[]{0.0f, 0.0f, 0.0f};
40 public static float[] colorMobsAggro
= new float[]{0.0f, 0.0f, 0.0f};
41 public static float[] colorSpecials
= new float[]{0.0f, 0.0f, 0.0f};
42 public static float[] colorSpotted
= new float[]{0.0f, 0.0f, 0.0f};
43 public static float[] colorUniques
= new float[]{0.0f, 0.0f, 0.0f};
44 public static float[] colorAlert
= new float[]{0.0f, 0.0f, 0.0f};
45 public static float[] colorAngry
= new float[]{0.0f, 0.0f, 0.0f};
46 public static float[] colorChampion
= new float[]{0.0f, 0.0f, 0.0f};
47 public static float[] colorDiseased
= new float[]{0.0f, 0.0f, 0.0f};
48 public static float[] colorFierce
= new float[]{0.0f, 0.0f, 0.0f};
49 public static float[] colorGreenish
= new float[]{0.0f, 0.0f, 0.0f};
50 public static float[] colorHardened
= new float[]{0.0f, 0.0f, 0.0f};
51 public static float[] colorLurking
= new float[]{0.0f, 0.0f, 0.0f};
52 public static float[] colorRaging
= new float[]{0.0f, 0.0f, 0.0f};
53 public static float[] colorScared
= new float[]{0.0f, 0.0f, 0.0f};
54 public static float[] colorSlow
= new float[]{0.0f, 0.0f, 0.0f};
55 public static float[] colorSly
= new float[]{0.0f, 0.0f, 0.0f};
56 public static String
[] aggroMOBS
;
57 public static String
[] uniqueMOBS
;
58 public static String
[] specialITEMS
;
59 public static String
[] spottedITEMS
;
60 public static String
[] conditionedMOBS
;
62 public Unit(World world
, long id
, PickableUnit pickableUnit
, String modelName
, String hoverName
) {
65 this.pickableUnit
= pickableUnit
;
66 this.modelName
= modelName
;
67 this.hoverName
= hoverName
;
68 this.determineColor();
75 public PickableUnit
getPickableUnit() {
76 return this.pickableUnit
;
79 public float[] getColor() {
83 public float[] getConditionedColor() {
84 return this.conditionedcolor
;
87 public String
getHoverName() {
88 return this.hoverName
;
91 public String
getModelName() {
92 return this.modelName
;
95 public boolean isPlayer() {
96 return this.getModelName().contains("model.creature.humanoid.human.player") && !this.getModelName().contains("zombie");
99 public boolean isEnemyPlayer() {
100 return this.getModelName().contains("ENEMY");
103 public boolean isMob() {
104 return this.getModelName().contains("model.creature") && !this.getModelName().contains("humanoid.human");
107 public boolean isAggroMob() {
108 for (String mob
: aggroMOBS
) {
109 if (!this.getHoverName().contains(mob
)) continue;
115 public boolean isChampion() {
116 return this.getHoverName().contains("champion");
119 public boolean isConditioned() {
120 for (String condition
: conditionedMOBS
) {
121 if (!this.getHoverName().contains(condition
)) continue;
122 this.condition
= condition
;
128 public boolean isUnique() {
129 for (String mob
: uniqueMOBS
) {
130 if (!this.getHoverName().contains(mob
)) continue;
136 public boolean isSpecial() {
137 for (String item
: specialITEMS
) {
138 if (this.getHoverName().contains(item
)) {
141 if (!this.getModelName().contains(WurmEspMod
.search
)) continue;
147 public boolean isSpotted() {
148 for (String item
: spottedITEMS
) {
149 if (this.getHoverName().contains(item
)) {
152 if (!this.getModelName().contains(WurmEspMod
.search
)) continue;
155 if (WurmEspMod
.searchType
== WurmEspMod
.SEARCHTYPE
.HOVER
) {
156 if (this.getHoverName().contains(WurmEspMod
.search
)) {
159 } else if (WurmEspMod
.searchType
== WurmEspMod
.SEARCHTYPE
.MODEL
) {
160 if (this.getModelName().contains(WurmEspMod
.search
)) {
163 } else if (WurmEspMod
.searchType
== WurmEspMod
.SEARCHTYPE
.BOTH
) {
164 if (this.getHoverName().contains(WurmEspMod
.search
)) {
167 if (this.getModelName().contains(WurmEspMod
.search
)) {
174 private void determineColor() {
175 if (this.isPlayer()) {
176 this.color
= !this.isEnemyPlayer() ? colorPlayers
: colorPlayersEnemy
;
177 } else if (this.isUnique()) {
178 this.color
= colorUniques
;
179 } else if (this.isAggroMob()) {
180 this.color
= colorMobsAggro
;
181 } else if (this.isMob()) {
182 this.color
= colorMobs
;
183 } else if (this.isSpecial()) {
184 this.color
= colorSpecials
;
185 } else if (this.isSpotted()) {
186 this.color
= colorSpotted
;
188 if (this.isConditioned()) {
189 float[] color
= new float[]{0.0f, 0.0f, 0.0f};
190 switch (this.condition
) {
200 color
= colorChampion
;
204 color
= colorDiseased
;
212 color
= colorGreenish
;
216 color
= colorHardened
;
220 color
= colorLurking
;
239 this.conditionedcolor
= color
;
243 public void renderUnit(Queue queue
, boolean showconditioned
) {
244 if (this.pickableUnit
== null) {
248 RenderState renderStateFill
= new RenderState();
249 RenderState renderStateFillDepth
= new RenderState();
250 RenderState renderStateOutline
= new RenderState();
251 Color color
= new Color();
252 if (this.isConditioned() && showconditioned
) {
253 color
.set(this.conditionedcolor
[0], this.conditionedcolor
[1], this.conditionedcolor
[2]);
255 color
.set(this.color
[0], this.color
[1], this.color
[2]);
257 renderStateFill
.alphaval
= color
.a
= br
;
258 color
.a
*= this.pickableUnit
.getOutlineColor().a
;
260 WorldRender worldRenderer
= (WorldRender
)ReUtils
.getField(this.world
, "worldRenderer");
261 PickRenderer
.CustomPickFillRender customPickFill
= (PickRenderer
.CustomPickFillRender
)ReUtils
.getField(worldRenderer
, "customPickFill");
262 PickRenderer
.CustomPickFillDepthRender customPickFillDepth
= (PickRenderer
.CustomPickFillDepthRender
)ReUtils
.getField(worldRenderer
, "customPickFillDepth");
263 PickRenderer
.CustomPickOutlineRender customPickOutline
= (PickRenderer
.CustomPickOutlineRender
)ReUtils
.getField(worldRenderer
, "customPickOutline");
264 renderStateFill
.twosided
= false;
265 renderStateFill
.depthtest
= Primitive
.TestFunc
.ALWAYS
;
266 renderStateFill
.depthwrite
= true;
267 renderStateFill
.customstate
= customPickFill
;
268 this.pickableUnit
.renderPicked(queue
, renderStateFill
, color
);
269 renderStateOutline
.alphaval
= color
.a
= br
* 0.25f;
270 color
.a
*= this.pickableUnit
.getOutlineColor().a
;
271 renderStateOutline
.twosided
= false;
272 renderStateOutline
.depthtest
= Primitive
.TestFunc
.LESS
;
273 renderStateOutline
.depthwrite
= false;
274 renderStateOutline
.blendmode
= Primitive
.BlendMode
.ALPHABLEND
;
275 renderStateOutline
.customstate
= customPickOutline
;
276 this.pickableUnit
.renderPicked(queue
, renderStateOutline
, color
);
277 renderStateFillDepth
.customstate
= customPickFillDepth
;
278 renderStateFillDepth
.depthtest
= Primitive
.TestFunc
.ALWAYS
;
279 this.pickableUnit
.renderPicked(queue
, renderStateFillDepth
, color
);