2 * Decompiled with CFR 0.151.
4 * Could not load the following classes:
5 * com.wurmonline.client.renderer.GroundItemData
6 * org.gotti.wurmunlimited.modloader.ReflectionUtil
8 package net
.encode
.wurmesp
.feature
.hook
;
10 import java
.lang
.reflect
.Field
;
11 import java
.util
.logging
.Level
;
13 import org
.gotti
.wurmunlimited
.modloader
.ReflectionUtil
;
15 import com
.wurmonline
.client
.renderer
.GroundItemData
;
17 import net
.encode
.wurmesp
.Unit
;
18 import net
.encode
.wurmesp
.WurmEspMod
;
20 public class GroundItemCellRenderableRemove
22 public GroundItemCellRenderableRemove() {
23 this.prepareHook("com.wurmonline.client.renderer.cell.GroundItemCellRenderable", "removed", "(Z)V", () -> (proxy
, method
, args
) -> {
24 method
.invoke(proxy
, args
);
25 Class
<?
> cls
= proxy
.getClass();
26 GroundItemData item
= (GroundItemData
)ReflectionUtil
.getPrivateField((Object
)proxy
, (Field
)ReflectionUtil
.getField(cls
, (String
)"item"));
27 for (Unit unit
: WurmEspMod
.pickableUnits
) {
28 if (unit
.getId() != item
.getId()) continue;
29 WurmEspMod
.toRemove
.add(unit
);
31 for (Unit unit
: WurmEspMod
.toRemove
) {
32 if (unit
.getId() != item
.getId()) continue;
33 WurmEspMod
.pickableUnits
.remove(unit
);
35 WurmEspMod
.toRemove
.clear();
38 WurmEspMod
.logger
.log(Level
.INFO
, "[WurmEspMod] GroundItemCellRenderable.removed hooked");