Added config option ContactMojangServers which disables player skins, but stops the plugin from pinging Mojang servers.

This commit is contained in:
NavidK0 2015-03-28 19:59:42 -04:00
parent 4beb5fa730
commit a33bb0b139
4 changed files with 11 additions and 2 deletions

View File

@ -44,6 +44,8 @@ import me.libraryaddict.disguise.utilities.Metrics;
public class LibsDisguises extends JavaPlugin {
public static LibsDisguises instance; //I'm sorry Sun MicroSystems and all mighty Java God
@Override
public void onEnable() {
saveDefaultConfig();
@ -103,6 +105,7 @@ public class LibsDisguises extends JavaPlugin {
getCommand("disguiseclone").setExecutor(new DisguiseCloneCommand(listener));
getCommand("libsdisguises").setExecutor(new LibsDisguisesCommand());
registerValues();
instance = this;
try {
Metrics metrics = new Metrics(this);
metrics.start();

View File

@ -5,6 +5,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import me.libraryaddict.disguise.LibsDisguises;
import me.libraryaddict.disguise.disguisetypes.watchers.PlayerWatcher;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
@ -153,6 +154,9 @@ public class PlayerDisguise extends TargetedDisguise {
public PlayerDisguise setSkin(String skinToUse) {
this.skinToUse = skinToUse;
if (!LibsDisguises.instance.getConfig().getBoolean("ContactMojangServers")) {
return this;
}
if (skinToUse == null) {
this.currentLookup = null;
this.gameProfile = null;
@ -161,7 +165,6 @@ public class PlayerDisguise extends TargetedDisguise {
this.skinToUse = skinToUse.substring(0, 16);
}
currentLookup = new LibsProfileLookup() {
@Override
public void onLookup(WrappedGameProfile gameProfile) {
if (currentLookup == this && gameProfile != null) {

View File

@ -91,6 +91,9 @@ MiscDisguisesForLiving: true
# Turn this to true to have players undisguised when switching worlds
UndisguiseOnWorldChange: false
# Contact Mojang's servers? Disabling this option will disable player skin disguises!
ContactMojangServers: true
# This will help performance, especially with CPU
# Due to safety reasons, self disguises can never have their packets disabled.
PacketsEnabled:

View File

@ -1,6 +1,6 @@
name: LibsDisguises
main: me.libraryaddict.disguise.LibsDisguises
version: 8.4
version: 8.3.1
author: libraryaddict
authors: [Byteflux, Navid K.]
depend: [ProtocolLib]