Disable name / skin overrides by default
This commit is contained in:
parent
e5a9c1b04d
commit
b617dd4d54
@ -7,6 +7,7 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import party._2a03.mc.util.Config;
|
||||
import party._2a03.mc.util.Database;
|
||||
import party._2a03.mc.util.PlayerData;
|
||||
|
||||
@ -24,6 +25,8 @@ public class MixinGameProfile {
|
||||
UUID uuid = ((GameProfile)(Object)this).getId();
|
||||
if (uuid == null) // wait until UUID is set
|
||||
return;
|
||||
if (!Config.getBool("overrideNames"))
|
||||
return;
|
||||
if (this.server_name == "") {
|
||||
PlayerData playerdata = Database.getPlayer(uuid.toString());
|
||||
this.server_name = playerdata.getName();
|
||||
|
@ -19,6 +19,8 @@ import party._2a03.mc.util.PlayerData;
|
||||
public abstract class MixinPlayerManager {
|
||||
@Inject(method = "onPlayerConnect", at = @At(value = "HEAD"))
|
||||
void onConnect(ClientConnection connection, ServerPlayerEntity player, CallbackInfo ci) {
|
||||
if (!Config.getBool("overrideSkins"))
|
||||
return;
|
||||
PlayerData playerdata = Database.getPlayer(player.getGameProfile().getId());
|
||||
PropertyMap map = player.getGameProfile().getProperties();
|
||||
map.removeAll("textures");
|
||||
|
@ -35,6 +35,8 @@ public class Config {
|
||||
json = new JSONObject();
|
||||
}
|
||||
|
||||
setDefault("overrideNames", false);
|
||||
setDefault("overrideSkins", false);
|
||||
setDefault("persistentFlight", false);
|
||||
setDefault("disableFlyCommand", true);
|
||||
setDefault("disableTntExplosions", false);
|
||||
|
Loading…
Reference in New Issue
Block a user