Clean up some moar
This commit is contained in:
parent
f7878f411d
commit
f4d0af190c
@ -118,7 +118,6 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand {
|
|||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
sendCommandUsage(sender);
|
sendCommandUsage(sender);
|
||||||
return true;
|
return true;
|
||||||
// sender.sendMessage(ChatColor.RED + "/disguisehelp <Disguise> <Option>");
|
|
||||||
} else {
|
} else {
|
||||||
EnumHelp help = null;
|
EnumHelp help = null;
|
||||||
for (EnumHelp s : enumHelp) {
|
for (EnumHelp s : enumHelp) {
|
||||||
|
@ -46,6 +46,10 @@ import com.comphenix.protocol.wrappers.WrappedDataWatcher;
|
|||||||
import com.comphenix.protocol.wrappers.WrappedWatchableObject;
|
import com.comphenix.protocol.wrappers.WrappedWatchableObject;
|
||||||
|
|
||||||
public class PacketsManager {
|
public class PacketsManager {
|
||||||
|
/**
|
||||||
|
* This is a fix for the stupidity that is
|
||||||
|
* "I can't separate the sounds from the sounds the player heard, and the sounds of the entity tracker heard"
|
||||||
|
*/
|
||||||
private static boolean cancelSound;
|
private static boolean cancelSound;
|
||||||
private static PacketListener inventoryListenerClient;
|
private static PacketListener inventoryListenerClient;
|
||||||
private static PacketListener inventoryListenerServer;
|
private static PacketListener inventoryListenerServer;
|
||||||
@ -160,7 +164,7 @@ public class PacketsManager {
|
|||||||
spawnPackets[i + 2] = packets.get(i);
|
spawnPackets[i + 2] = packets.get(i);
|
||||||
}
|
}
|
||||||
Location loc = disguisedEntity.getLocation().clone().add(0, getYModifier(disguisedEntity, disguise.getType()), 0);
|
Location loc = disguisedEntity.getLocation().clone().add(0, getYModifier(disguisedEntity, disguise.getType()), 0);
|
||||||
byte yaw = getYaw(disguise.getType(), disguise.getEntity().getType(), (byte) (int) (loc.getYaw() * 256.0F / 360.0F));
|
byte yaw = getYaw(disguise.getType(), disguisedEntity.getType(), (byte) (int) (loc.getYaw() * 256.0F / 360.0F));
|
||||||
|
|
||||||
if (disguise.getType() == DisguiseType.EXPERIENCE_ORB) {
|
if (disguise.getType() == DisguiseType.EXPERIENCE_ORB) {
|
||||||
|
|
||||||
@ -271,7 +275,7 @@ public class PacketsManager {
|
|||||||
// This won't actually work.
|
// This won't actually work.
|
||||||
// But if someone constructing the disguise uses it properly. It will work.
|
// But if someone constructing the disguise uses it properly. It will work.
|
||||||
if (disguise.getType() == DisguiseType.FISHING_HOOK)
|
if (disguise.getType() == DisguiseType.FISHING_HOOK)
|
||||||
data = disguise.getEntity().getEntityId();
|
data = disguisedEntity.getEntityId();
|
||||||
/* else if (disguise.getType() == DisguiseType.ITEM_FRAME) {
|
/* else if (disguise.getType() == DisguiseType.ITEM_FRAME) {
|
||||||
data = (int) loc.getYaw();
|
data = (int) loc.getYaw();
|
||||||
if (data < 0)
|
if (data < 0)
|
||||||
@ -367,7 +371,7 @@ public class PacketsManager {
|
|||||||
case WITHER_SKULL:
|
case WITHER_SKULL:
|
||||||
value -= 128;
|
value -= 128;
|
||||||
break;
|
break;
|
||||||
// case ITEM_FRAME:
|
case ITEM_FRAME:
|
||||||
case ARROW:
|
case ARROW:
|
||||||
value = (byte) -value;
|
value = (byte) -value;
|
||||||
break;
|
break;
|
||||||
@ -393,7 +397,7 @@ public class PacketsManager {
|
|||||||
case WITHER_SKULL:
|
case WITHER_SKULL:
|
||||||
value += 128;
|
value += 128;
|
||||||
break;
|
break;
|
||||||
// case ITEM_FRAME:
|
case ITEM_FRAME:
|
||||||
case ARROW:
|
case ARROW:
|
||||||
value = (byte) -value;
|
value = (byte) -value;
|
||||||
break;
|
break;
|
||||||
@ -487,14 +491,14 @@ public class PacketsManager {
|
|||||||
if (entity instanceof LivingEntity) {
|
if (entity instanceof LivingEntity) {
|
||||||
try {
|
try {
|
||||||
obj = LivingEntity.class.getMethod("getHealth").invoke(entity);
|
obj = LivingEntity.class.getMethod("getHealth").invoke(entity);
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if (obj instanceof Double ? (Double) obj == 0 : (Integer) obj == 0) {
|
if (obj instanceof Double ? (Double) obj == 0 : (Integer) obj == 0) {
|
||||||
soundType = SoundType.DEATH;
|
soundType = SoundType.DEATH;
|
||||||
} else {
|
} else {
|
||||||
obj = null;
|
obj = null;
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
boolean hasInvun = false;
|
boolean hasInvun = false;
|
||||||
@ -624,14 +628,14 @@ public class PacketsManager {
|
|||||||
if (entity instanceof LivingEntity) {
|
if (entity instanceof LivingEntity) {
|
||||||
try {
|
try {
|
||||||
obj = LivingEntity.class.getMethod("getHealth").invoke(entity);
|
obj = LivingEntity.class.getMethod("getHealth").invoke(entity);
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if (obj instanceof Double ? (Double) obj == 0 : (Integer) obj == 0) {
|
if (obj instanceof Double ? (Double) obj == 0 : (Integer) obj == 0) {
|
||||||
soundType = SoundType.DEATH;
|
soundType = SoundType.DEATH;
|
||||||
} else {
|
} else {
|
||||||
obj = null;
|
obj = null;
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
soundType = SoundType.HURT;
|
soundType = SoundType.HURT;
|
||||||
|
Loading…
Reference in New Issue
Block a user