Combine inventory listener server and client into one listener. Seeing as they don't need to be seperate and actually cuts down on code

This commit is contained in:
libraryaddict
2014-06-04 12:47:52 +12:00
parent 297dcd351f
commit 4e441493c1
2 changed files with 121 additions and 127 deletions

View File

@@ -51,6 +51,40 @@ public class DisguiseConfig {
return maxClonedDisguises;
}
public static void initConfig(ConfigurationSection config) {
setSoundsEnabled(config.getBoolean("DisguiseSounds"));
setVelocitySent(config.getBoolean("SendVelocity"));
setViewDisguises(config.getBoolean("ViewSelfDisguises"));
setHearSelfDisguise(config.getBoolean("HearSelfDisguise"));
setHideArmorFromSelf(config.getBoolean("RemoveArmor"));
setHideHeldItemFromSelf(config.getBoolean("RemoveHeldItem"));
setAddEntityAnimations(config.getBoolean("AddEntityAnimations"));
setNameOfPlayerShownAboveDisguise(config.getBoolean("ShowNamesAboveDisguises"));
setNameAboveHeadAlwaysVisible(config.getBoolean("NameAboveHeadAlwaysVisible"));
setModifyBoundingBox(config.getBoolean("ModifyBoundingBox"));
setMonstersIgnoreDisguises(config.getBoolean("MonstersIgnoreDisguises"));
setDisguiseBlownOnAttack(config.getBoolean("BlowDisguises"));
setDisguiseBlownMessage(ChatColor.translateAlternateColorCodes('&',
config.getString("BlownDisguiseMessage")));
setKeepDisguiseOnPlayerDeath(config.getBoolean("KeepDisguises.PlayerDeath"));
setKeepDisguiseOnPlayerLogout(config.getBoolean("KeepDisguises.PlayerLogout"));
setKeepDisguiseOnEntityDespawn(config.getBoolean("KeepDisguises.EntityDespawn"));
setMiscDisguisesForLivingEnabled(config.getBoolean("MiscDisguisesForLiving"));
setMovementPacketsEnabled(config.getBoolean("PacketsEnabled.Movement"));
setWitherSkullPacketsEnabled(config.getBoolean("PacketsEnabled.WitherSkull"));
setEnquipmentPacketsEnabled(config.getBoolean("PacketsEnabled.Enquipment"));
setAnimationPacketsEnabled(config.getBoolean("PacketsEnabled.Animation"));
setBedPacketsEnabled(config.getBoolean("PacketsEnabled.Bed"));
setRidingPacketsEnabled(config.getBoolean("PacketsEnabled.Riding"));
setEntityStatusPacketsEnabled(config.getBoolean("PacketsEnabled.EntityStatus"));
setCollectPacketsEnabled(config.getBoolean("PacketsEnabled.Collect"));
setMetadataPacketsEnabled(config.getBoolean("PacketsEnabled.Metadata"));
setMaxHealthDeterminedByDisguisedEntity(config.getBoolean("MaxHealthDeterminedByEntity"));
setDisguiseEntityExpire(config.getInt("DisguiseEntityExpire"));
setDisguiseCloneExpire(config.getInt("DisguiseCloneExpire"));
setMaxClonedDisguises(config.getInt("DisguiseCloneSize"));
}
public static boolean isAnimationPacketsEnabled() {
return animationEnabled;
}
@@ -347,38 +381,4 @@ public class DisguiseConfig {
private DisguiseConfig() {
}
public static void initConfig(ConfigurationSection config) {
setSoundsEnabled(config.getBoolean("DisguiseSounds"));
setVelocitySent(config.getBoolean("SendVelocity"));
setViewDisguises(config.getBoolean("ViewSelfDisguises"));
setHearSelfDisguise(config.getBoolean("HearSelfDisguise"));
setHideArmorFromSelf(config.getBoolean("RemoveArmor"));
setHideHeldItemFromSelf(config.getBoolean("RemoveHeldItem"));
setAddEntityAnimations(config.getBoolean("AddEntityAnimations"));
setNameOfPlayerShownAboveDisguise(config.getBoolean("ShowNamesAboveDisguises"));
setNameAboveHeadAlwaysVisible(config.getBoolean("NameAboveHeadAlwaysVisible"));
setModifyBoundingBox(config.getBoolean("ModifyBoundingBox"));
setMonstersIgnoreDisguises(config.getBoolean("MonstersIgnoreDisguises"));
setDisguiseBlownOnAttack(config.getBoolean("BlowDisguises"));
setDisguiseBlownMessage(ChatColor.translateAlternateColorCodes('&',
config.getString("BlownDisguiseMessage")));
setKeepDisguiseOnPlayerDeath(config.getBoolean("KeepDisguises.PlayerDeath"));
setKeepDisguiseOnPlayerLogout(config.getBoolean("KeepDisguises.PlayerLogout"));
setKeepDisguiseOnEntityDespawn(config.getBoolean("KeepDisguises.EntityDespawn"));
setMiscDisguisesForLivingEnabled(config.getBoolean("MiscDisguisesForLiving"));
setMovementPacketsEnabled(config.getBoolean("PacketsEnabled.Movement"));
setWitherSkullPacketsEnabled(config.getBoolean("PacketsEnabled.WitherSkull"));
setEnquipmentPacketsEnabled(config.getBoolean("PacketsEnabled.Enquipment"));
setAnimationPacketsEnabled(config.getBoolean("PacketsEnabled.Animation"));
setBedPacketsEnabled(config.getBoolean("PacketsEnabled.Bed"));
setRidingPacketsEnabled(config.getBoolean("PacketsEnabled.Riding"));
setEntityStatusPacketsEnabled(config.getBoolean("PacketsEnabled.EntityStatus"));
setCollectPacketsEnabled(config.getBoolean("PacketsEnabled.Collect"));
setMetadataPacketsEnabled(config.getBoolean("PacketsEnabled.Metadata"));
setMaxHealthDeterminedByDisguisedEntity(config.getBoolean("MaxHealthDeterminedByEntity"));
setDisguiseEntityExpire(config.getInt("DisguiseEntityExpire"));
setDisguiseCloneExpire(config.getInt("DisguiseCloneExpire"));
setMaxClonedDisguises(config.getInt("DisguiseCloneSize"));
}
}