use of client.MapleClient in project HeavenMS by ronancpl.
the class MapleMap method searchItemReactors.
public void searchItemReactors(final MapleReactor react) {
if (react.getReactorType() == 100) {
Pair<Integer, Integer> reactProp = react.getReactItem(react.getEventState());
int reactItem = reactProp.getLeft(), reactQty = reactProp.getRight();
Rectangle reactArea = react.getArea();
List<MapleMapItem> list = new ArrayList<>();
objectRLock.lock();
try {
for (MapleMapItem mmi : droppedItems.keySet()) {
if (!mmi.isPickedUp()) {
list.add(mmi);
}
}
} finally {
objectRLock.unlock();
}
for (final MapleMapItem drop : list) {
final Item item = drop.getItem();
if (item != null && reactItem == item.getItemId() && reactQty == item.getQuantity()) {
if (reactArea.contains(drop.getPosition())) {
MapleClient owner = drop.getOwnerClient();
if (owner != null) {
TimerManager.getInstance().schedule(new ActivateItemReactor(drop, react, owner), 5000);
}
}
}
}
}
}
Aggregations