Enquipment -> Equipment

This commit is contained in:
riking
2014-06-14 18:09:14 -07:00
parent 2b86c98fbb
commit 4ddded6b06
4 changed files with 18 additions and 14 deletions

View File

@@ -42,7 +42,7 @@ public class DisguiseAPI {
return constructDisguise(entity, true, true, true);
}
public static Disguise constructDisguise(Entity entity, boolean doEnquipment, boolean doSneak, boolean doSprint) {
public static Disguise constructDisguise(Entity entity, boolean doEquipment, boolean doSneak, boolean doSprint) {
DisguiseType disguiseType = DisguiseType.getType(entity);
Disguise disguise;
if (disguiseType.isMisc()) {
@@ -64,10 +64,10 @@ public class DisguiseAPI {
if (entity.getFireTicks() > 0) {
watcher.setBurning(true);
}
if (doEnquipment && entity instanceof LivingEntity) {
EntityEquipment enquip = ((LivingEntity) entity).getEquipment();
watcher.setArmor(enquip.getArmorContents());
watcher.setItemInHand(enquip.getItemInHand());
if (doEquipment && entity instanceof LivingEntity) {
EntityEquipment equip = ((LivingEntity) entity).getEquipment();
watcher.setArmor(equip.getArmorContents());
watcher.setItemInHand(equip.getItemInHand());
if (disguiseType.getEntityType() == EntityType.HORSE) {
Horse horse = (Horse) entity;
HorseInventory horseInventory = horse.getInventory();

View File

@@ -14,7 +14,7 @@ public class DisguiseConfig {
private static String disguiseBlownMessage;
private static int disguiseCloneExpire;
private static int disguiseEntityExpire;
private static boolean enquipmentEnabled;
private static boolean equipmentEnabled;
private static boolean entityAnimationsAdded;
private static boolean entityStatusEnabled;
private static boolean hearSelfDisguise;
@@ -105,9 +105,13 @@ public class DisguiseConfig {
return blowDisguisesOnAttack;
}
public static boolean isEnquipmentPacketsEnabled() {
return enquipmentEnabled;
public static boolean isEquipmentPacketsEnabled() {
return equipmentEnabled;
}
/**
* @deprecated Spelling mistake.
*/
@Deprecated public static boolean isEnquipmentPacketsEnabled() { return equipmentEnabled; }
public static boolean isEntityAnimationsAdded() {
return entityAnimationsAdded;
@@ -262,8 +266,8 @@ public class DisguiseConfig {
}
public static void setEnquipmentPacketsEnabled(boolean enabled) {
if (enabled != isEnquipmentPacketsEnabled()) {
enquipmentEnabled = enabled;
if (enabled != isEquipmentPacketsEnabled()) {
equipmentEnabled = enabled;
PacketsManager.setupMainPacketsListener();
}
}

View File

@@ -120,7 +120,7 @@ public class PacketsManager {
ArrayList<PacketContainer> packets = new ArrayList<PacketContainer>();
// This sends the armor packets so that the player isn't naked.
// Please note it only sends the packets that wouldn't be sent normally
if (DisguiseConfig.isEnquipmentPacketsEnabled()) {
if (DisguiseConfig.isEquipmentPacketsEnabled()) {
for (int nmsSlot = 0; nmsSlot < 5; nmsSlot++) {
int armorSlot = nmsSlot - 1;
if (armorSlot < 0)
@@ -1126,8 +1126,8 @@ public class PacketsManager {
packetsToListen.add(PacketType.Play.Server.ENTITY_HEAD_ROTATION);
packetsToListen.add(PacketType.Play.Server.ENTITY_TELEPORT);
}
// Add enquipment packet
if (DisguiseConfig.isEnquipmentPacketsEnabled()) {
// Add equipment packet
if (DisguiseConfig.isEquipmentPacketsEnabled()) {
packetsToListen.add(PacketType.Play.Server.ENTITY_EQUIPMENT);
}
// Add the packet that ensures if they are sleeping or not