Alliances & Pet autopot improvement + Crafters patch
Improved Alliance invitations now using "invite popups" just like buddy, party and guild invites. Pet autopot now properly uses up pots from the inventory, fetching from other inventory slots when one place has been completely used up but the "stop criteria" hasn't been fulfilled yet. Pet autopot now properly detects pots with healing factor defined by the character's pool. Fixed old exploit with mineral/jewel crafters. Patched Doorway's questlines.
This commit is contained in:
@@ -345,7 +345,7 @@ public class Commands {
|
||||
public static boolean executeHeavenMsCommandLv0(Channel cserv, Server srv, MapleClient c, String[] sub) { //Player
|
||||
MapleCharacter player = c.getPlayer();
|
||||
|
||||
switch(sub[0]) {
|
||||
switch(sub[0]) {
|
||||
case "help":
|
||||
case "commands":
|
||||
case "playercommands":
|
||||
|
||||
@@ -121,13 +121,14 @@ public class Item implements Comparable<Item> {
|
||||
this.petid = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Item other) {
|
||||
if (this.id < other.getItemId()) {
|
||||
return -1;
|
||||
} else if (this.id > other.getItemId()) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,8 +24,10 @@ package client.inventory;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Map;
|
||||
@@ -178,9 +180,36 @@ public class MapleInventory implements Iterable<Item> {
|
||||
ret.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret.size() > 1) {
|
||||
Collections.sort(ret);
|
||||
Collections.sort(ret, new Comparator<Item>() {
|
||||
@Override
|
||||
public int compare(Item i1, Item i2) {
|
||||
return i1.getPosition() - i2.getPosition();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<Item> linkedListById(int itemId) {
|
||||
List<Item> ret = new LinkedList<>();
|
||||
for (Item item : list()) {
|
||||
if (item.getItemId() == itemId) {
|
||||
ret.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret.size() > 1) {
|
||||
Collections.sort(ret, new Comparator<Item>() {
|
||||
@Override
|
||||
public int compare(Item i1, Item i2) {
|
||||
return i1.getPosition() - i2.getPosition();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user