From bb0ac727bfef71a60f25a5e3fb2c958d953ae287 Mon Sep 17 00:00:00 2001 From: riking Date: Wed, 4 Jun 2014 09:17:47 -0700 Subject: [PATCH] Remove more redundant actions --- src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java | 4 ++-- .../disguise/disguisetypes/watchers/MinecartWatcher.java | 4 ++-- src/me/libraryaddict/disguise/utilities/PacketsManager.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java index b24f2b1b..1cc2c388 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java @@ -55,7 +55,7 @@ public class FlagWatcher { } private byte addEntityAnimations(byte originalValue, byte entityValue) { - byte valueByte = (Byte) originalValue; + byte valueByte = originalValue; for (int i = 0; i < 6; i++) { if ((entityValue & 1 << i) != 0 && !modifiedEntityAnimations.contains(i)) { valueByte = (byte) (valueByte | 1 << i); @@ -66,7 +66,7 @@ public class FlagWatcher { } public FlagWatcher clone(Disguise owningDisguise) { - FlagWatcher cloned = null; + FlagWatcher cloned; try { cloned = getClass().getConstructor(Disguise.class).newInstance(getDisguise()); } catch (Exception e) { diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/MinecartWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/MinecartWatcher.java index e8622f3d..eeab69cd 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/MinecartWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/MinecartWatcher.java @@ -12,7 +12,7 @@ public class MinecartWatcher extends FlagWatcher { } public ItemStack getBlockInCart() { - int id = (Integer) getValue(20, 0) & '\uffff'; + int id = (Integer) getValue(20, 0) & 0xffff; int data = (Integer) getValue(20, 0) >> 16; return new ItemStack(id, 1, (short) data); } @@ -32,7 +32,7 @@ public class MinecartWatcher extends FlagWatcher { public void setBlockInCart(ItemStack item) { int id = item.getTypeId(); int data = item.getDurability(); - setValue(20, (int) (id & '\uffff' | data << 16)); + setValue(20, (int) (id & 0xffff | data << 16)); sendData(20); setViewBlockInCart(true); } diff --git a/src/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/me/libraryaddict/disguise/utilities/PacketsManager.java index 6e2d7ee2..97d4b154 100644 --- a/src/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -748,7 +748,7 @@ public class PacketsManager { StructureModifier mods = packet.getModifier(); mods.write(0, observer.getEntityId()); List watchableList = new ArrayList(); - byte b = (byte) (0 | 1 << 5); + byte b = (byte) 1 << 5; if (observer.isSprinting()) b = (byte) (b | 1 << 3); watchableList.add(new WrappedWatchableObject(0, b));