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

@ -103,7 +103,7 @@ PacketsEnabled:
Collect: true Collect: true
# This disables a fix for when a disguised entity wearing armor dies, if the disguise can wear armor. It drops unpickupable items to anyone watching. # This disables a fix for when a disguised entity wearing armor dies, if the disguise can wear armor. It drops unpickupable items to anyone watching.
EntityStatus: true EntityStatus: true
# Entity enquipment is the packets that are sent to ensure that a disguise has or doesn't have armor, and their held item. # Entity equipment is the packets that are sent to ensure that a disguise has or doesn't have armor, and their held item.
# Disabling this means that any disguises which can wear armor or hold items will show the armor/held item that the disguised is wearing. # Disabling this means that any disguises which can wear armor or hold items will show the armor/held item that the disguised is wearing.
Enquipment: true Enquipment: true
# This doesn't actually disable the packet. It would introduce problems. Instead it does the next best thing and caches the data. # This doesn't actually disable the packet. It would introduce problems. Instead it does the next best thing and caches the data.

View File

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

View File

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

View File

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