Resolve merge conflict.

This commit is contained in:
Major-
2015-03-06 22:09:41 +00:00
12 changed files with 13 additions and 24 deletions
+1 -3
View File
@@ -176,9 +176,7 @@ public final class IndexedFileSystem implements Closeable {
int nextBlock = (header[4] & 0xFF) << 16 | (header[5] & 0xFF) << 8 | header[6] & 0xFF;
int nextType = header[7] & 0xFF;
if (i != curChunk) {
Preconditions.checkArgument(i == curChunk, "Chunk id mismatch.");
}
Preconditions.checkArgument(i == curChunk, "Chunk id mismatch.");
int chunkSize = size - read;
if (chunkSize > FileSystemConstants.CHUNK_SIZE) {
@@ -23,7 +23,7 @@ public final class BankMessageHandler extends MessageHandler<ItemActionMessage>
* @return The amount.
* @throws IllegalArgumentException If the option is invalid.
*/
private static final int optionToAmount(int option) {
private static int optionToAmount(int option) {
switch (option) {
case 1:
return 1;
@@ -161,8 +161,7 @@ public final class CollisionMatrix {
@Override
public String toString() {
return MoreObjects.toStringHelper(this).add("width", width).add("length", length).add("matrix", Arrays.toString(matrix))
.toString();
return MoreObjects.toStringHelper(this).add("width", width).add("length", length).add("matrix", Arrays.toString(matrix)).toString();
}
/**
@@ -89,8 +89,7 @@ public final class GameObject extends Entity {
@Override
public String toString() {
return MoreObjects.toStringHelper(this).add("id", getId()).add("type", getType()).add("orientation", getOrientation())
.toString();
return MoreObjects.toStringHelper(this).add("id", getId()).add("type", getType()).add("orientation", getOrientation()).toString();
}
}
@@ -209,7 +209,7 @@ public final class SkillSet {
* @return The total level.
*/
public int getTotalLevel() {
return Arrays.stream(skills).map(skill -> skill.getMaximumLevel()).reduce(0, (total, level) -> total + level);
return Arrays.stream(skills).map(Skill::getMaximumLevel).reduce(0, (total, level) -> total + level);
}
/**
@@ -121,9 +121,7 @@ public final class WalkingQueue {
points.clear();
oldPoints.clear();
for (Position travelBackPosition : travelBackQueue) {
addStep(travelBackPosition);
}
travelBackQueue.forEach(this::addStep);
addStep(clientPosition);
return true;
@@ -15,7 +15,7 @@ public final class NumericalAttribute extends Attribute<Number> {
* @param value The value of this attribute.
* @return The type.
*/
private static final AttributeType typeOf(Number value) {
private static AttributeType typeOf(Number value) {
return value instanceof Double ? AttributeType.DOUBLE : AttributeType.LONG;
}
@@ -24,7 +24,7 @@ public final class EventListenerChainSet {
public <E extends Event> boolean notify(E event) {
@SuppressWarnings("unchecked")
EventListenerChain<E> chain = (EventListenerChain<E>) chains.get(event.getClass());
return (chain == null) ? true : chain.notify(event);
return (chain == null) || chain.notify(event);
}
/**
@@ -79,10 +79,7 @@ public final class InterfaceSet {
* @return {@code true} if the message handler chain should be broken.
*/
public boolean buttonClicked(int button) {
if (dialogueListener.isPresent()) {
return dialogueListener.get().buttonClicked(button);
}
return false;
return dialogueListener.isPresent() && dialogueListener.get().buttonClicked(button);
}
/**
@@ -102,7 +102,7 @@ public final class BinaryPlayerSerializer implements PlayerSerializer {
for (int slot = 0; slot < style.length; slot++) {
style[slot] = in.readUnsignedByte();
}
int[] colors = new int[5];
for (int slot = 0; slot < colors.length; slot++) {
colors[slot] = in.readUnsignedByte();
@@ -33,8 +33,7 @@ public final class PlayerLoaderResponse {
* {@link LoginConstants#STATUS_RECONNECTION_OK}.
*/
public PlayerLoaderResponse(int status) {
Preconditions.checkArgument(status != LoginConstants.STATUS_OK && status != LoginConstants.STATUS_RECONNECTION_OK,
"Player required for this status code.");
Preconditions.checkArgument(status != LoginConstants.STATUS_OK && status != LoginConstants.STATUS_RECONNECTION_OK, "Player required for this status code.");
this.status = status;
player = Optional.empty();
}
@@ -48,8 +47,7 @@ public final class PlayerLoaderResponse {
* @throws NullPointerException If the specified player is null.
*/
public PlayerLoaderResponse(int status, Player player) {
Preconditions.checkArgument(status == LoginConstants.STATUS_OK || status == LoginConstants.STATUS_RECONNECTION_OK,
"Player not required for this status code.");
Preconditions.checkArgument(status == LoginConstants.STATUS_OK || status == LoginConstants.STATUS_RECONNECTION_OK, "Player not required for this status code.");
this.status = status;
this.player = Optional.of(player);
}
@@ -32,7 +32,7 @@ public final class PrivateChatMessageDecoder extends MessageDecoder<PrivateChatM
byte[] recompressed = new byte[length];
TextUtil.compress(decompressed, recompressed);
return new PrivateChatMessage(username, new String(decompressed), recompressed);
return new PrivateChatMessage(username, decompressed, recompressed);
}
}