Merge remote-tracking branch 'origin/master' into Wave_Entertainer

Conflicts:
	src/services/BuffService.java
	src/services/collections/CollectionService.java
This commit is contained in:
Waverunner
2014-03-23 14:32:45 -04:00
118 changed files with 862 additions and 314 deletions
+18 -15
View File
@@ -222,13 +222,10 @@ public class CollectionService implements INetworkDispatch {
BitSet bitValue = new BitSet(64);
bitValue.set(64-bits, 64);
BitSet maxValue = new BitSet(64);
maxValue.set(64-maxSlotValue, 64);
/*if (bitValue.toLongArray()[0] < maxValue.toLongArray()[0]) {
System.out.println(slotName + ", row " + c + ": counter-type slot uses " + bits + " bits, which can only hold a max value of " + bitValue.toLongArray()[0] + ", which is less than the specified max value of " + maxValue.toLongArray()[0]);
if (bitValue.toLongArray()[0] < maxSlotValue) {
System.out.println(slotName + ", row " + c + ": counter-type slot uses " + bits + " bits, which can only hold a max value of " + bitValue.toLongArray()[0] + ", which is less than the specified max value of " + maxSlotValue);
throw new Exception();
}*/
}
}
} else {
bits = 1;
@@ -293,14 +290,20 @@ public class CollectionService implements INetworkDispatch {
}
}
if (bits > 1) {
if (maxSlotValue > -1) {
BitSet value = BitSet.valueOf(new long[] { collections.get(beginSlotId, (endSlotId + 1)).toLongArray()[0]++ });
for (int i = beginSlotId; i <= endSlotId; i++) {
collections.set(i, value.get((i - beginSlotId)));
}
} else if (bits > 1) {
int nextBit = collections.get(beginSlotId, (endSlotId + 1)).previousClearBit(endSlotId);
if (nextBit == -1) {
return false;
}
collections.set((beginSlotId + nextBit));
collections.set(nextBit);
} else {
collections.set(beginSlotId);
}
@@ -439,7 +442,6 @@ public class CollectionService implements INetworkDispatch {
String bookName = "";
String pageName = "";
String collectionName = "";
boolean collectionComplete = false;
collections = BitSet.valueOf(player.getCollections());
@@ -595,14 +597,15 @@ public class CollectionService implements INetworkDispatch {
BitSet bitValue = new BitSet(64);
bitValue.set(64-bits, 64);
BitSet maxValue = new BitSet(64);
maxValue.set(64-maxSlotValue, 64);
if (bitValue.toLongArray()[0] < maxValue.toLongArray()[0]) {
System.out.println(slotName + ", row " + c + ": counter-type slot uses " + bits + " bits, which can only hold a max value of " + bitValue.toLongArray()[0] + ", which is less than the specified max value of " + maxValue.toLongArray()[0]);
if (bitValue.toLongArray()[0] < maxSlotValue) {
System.out.println(slotName + ", row " + c + ": counter-type slot uses " + bits + " bits, which can only hold a max value of " + bitValue.toLongArray()[0] + ", which is less than the specified max value of " + maxSlotValue);
throw new Exception();
}
}
if (maxSlotValue > 0) {
return (int) collections.get(beginSlotId, (endSlotId + 1)).toLongArray()[0];
} else {
return collections.get(beginSlotId, (endSlotId + 1)).cardinality();
}
} else {