mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-05 09:09:40 +01:00
Remove more redundant actions
This commit is contained in:
parent
23303952b4
commit
bb0ac727bf
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -748,7 +748,7 @@ public class PacketsManager {
|
||||
StructureModifier<Object> mods = packet.getModifier();
|
||||
mods.write(0, observer.getEntityId());
|
||||
List<WrappedWatchableObject> watchableList = new ArrayList<WrappedWatchableObject>();
|
||||
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));
|
||||
|
Loading…
Reference in New Issue
Block a user