Added config option ContactMojangServers which disables player skins, but stops the plugin from pinging Mojang servers.
This commit is contained in:
		| @@ -44,6 +44,8 @@ import me.libraryaddict.disguise.utilities.Metrics; | |||||||
|  |  | ||||||
| public class LibsDisguises extends JavaPlugin { | public class LibsDisguises extends JavaPlugin { | ||||||
|      |      | ||||||
|  |     public static LibsDisguises instance; //I'm sorry Sun MicroSystems and all mighty Java God | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public void onEnable() { |     public void onEnable() { | ||||||
|         saveDefaultConfig(); |         saveDefaultConfig(); | ||||||
| @@ -103,6 +105,7 @@ public class LibsDisguises extends JavaPlugin { | |||||||
|         getCommand("disguiseclone").setExecutor(new DisguiseCloneCommand(listener)); |         getCommand("disguiseclone").setExecutor(new DisguiseCloneCommand(listener)); | ||||||
|         getCommand("libsdisguises").setExecutor(new LibsDisguisesCommand()); |         getCommand("libsdisguises").setExecutor(new LibsDisguisesCommand()); | ||||||
|         registerValues(); |         registerValues(); | ||||||
|  |         instance = this; | ||||||
|         try { |         try { | ||||||
|             Metrics metrics = new Metrics(this); |             Metrics metrics = new Metrics(this); | ||||||
|             metrics.start(); |             metrics.start(); | ||||||
|   | |||||||
| @@ -5,6 +5,7 @@ import org.bukkit.entity.Entity; | |||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
|  |  | ||||||
| import com.comphenix.protocol.wrappers.WrappedGameProfile; | import com.comphenix.protocol.wrappers.WrappedGameProfile; | ||||||
|  | import me.libraryaddict.disguise.LibsDisguises; | ||||||
|  |  | ||||||
| import me.libraryaddict.disguise.disguisetypes.watchers.PlayerWatcher; | import me.libraryaddict.disguise.disguisetypes.watchers.PlayerWatcher; | ||||||
| import me.libraryaddict.disguise.utilities.DisguiseUtilities; | import me.libraryaddict.disguise.utilities.DisguiseUtilities; | ||||||
| @@ -153,6 +154,9 @@ public class PlayerDisguise extends TargetedDisguise { | |||||||
|  |  | ||||||
|     public PlayerDisguise setSkin(String skinToUse) { |     public PlayerDisguise setSkin(String skinToUse) { | ||||||
|         this.skinToUse = skinToUse; |         this.skinToUse = skinToUse; | ||||||
|  |         if (!LibsDisguises.instance.getConfig().getBoolean("ContactMojangServers")) { | ||||||
|  |             return this; | ||||||
|  |         } | ||||||
|         if (skinToUse == null) { |         if (skinToUse == null) { | ||||||
|             this.currentLookup = null; |             this.currentLookup = null; | ||||||
|             this.gameProfile = null; |             this.gameProfile = null; | ||||||
| @@ -161,7 +165,6 @@ public class PlayerDisguise extends TargetedDisguise { | |||||||
|                 this.skinToUse = skinToUse.substring(0, 16); |                 this.skinToUse = skinToUse.substring(0, 16); | ||||||
|             } |             } | ||||||
|             currentLookup = new LibsProfileLookup() { |             currentLookup = new LibsProfileLookup() { | ||||||
|  |  | ||||||
|                 @Override |                 @Override | ||||||
|                 public void onLookup(WrappedGameProfile gameProfile) { |                 public void onLookup(WrappedGameProfile gameProfile) { | ||||||
|                     if (currentLookup == this && gameProfile != null) { |                     if (currentLookup == this && gameProfile != null) { | ||||||
|   | |||||||
| @@ -91,6 +91,9 @@ MiscDisguisesForLiving: true | |||||||
| # Turn this to true to have players undisguised when switching worlds | # Turn this to true to have players undisguised when switching worlds | ||||||
| UndisguiseOnWorldChange: false | UndisguiseOnWorldChange: false | ||||||
|  |  | ||||||
|  | # Contact Mojang's servers? Disabling this option will disable player skin disguises! | ||||||
|  | ContactMojangServers: true | ||||||
|  |  | ||||||
| # This will help performance, especially with CPU | # This will help performance, especially with CPU | ||||||
| # Due to safety reasons, self disguises can never have their packets disabled. | # Due to safety reasons, self disguises can never have their packets disabled. | ||||||
| PacketsEnabled: | PacketsEnabled: | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| name: LibsDisguises | name: LibsDisguises | ||||||
| main: me.libraryaddict.disguise.LibsDisguises | main: me.libraryaddict.disguise.LibsDisguises | ||||||
| version: 8.4 | version: 8.3.1 | ||||||
| author: libraryaddict | author: libraryaddict | ||||||
| authors: [Byteflux, Navid K.] | authors: [Byteflux, Navid K.] | ||||||
| depend: [ProtocolLib] | depend: [ProtocolLib] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user