Browse Source

Let users set their own homes, disabled logging on something

master
flewkey 3 years ago
parent
commit
43b81556bf
Signed by: flewkey GPG Key ID: 94F56ADFD848851E
  1. 2
      patches/net/minecraft/command/impl/GameModeCommand.patch
  2. 18
      src/party/_2a03/command/HomeCommand.java

2
patches/net/minecraft/command/impl/GameModeCommand.patch

@ -6,7 +6,7 @@
int i = 0;
+
+ if (p_198484_2_ == GameType.CREATIVE) { //Patched
+ p_198484_0_.getSource().func_197030_a(new TranslationTextComponent("<Server> Creative mode? What are you, a cheater?"), true); //Patched
+ p_198484_0_.getSource().func_197030_a(new TranslationTextComponent("<Server> Creative mode? What are you, a cheater?"), false); //Patched
+ } //Patched
for(ServerPlayerEntity serverplayerentity : p_198484_1_) {

18
src/party/_2a03/command/HomeCommand.java

@ -31,9 +31,23 @@ public class HomeCommand {
source.getSource().func_197030_a(new TranslationTextComponent("Teleported to home"), true);
return 1;
});
literalargumentbuilder.then(Commands.func_197057_a("set").then(Commands.func_197056_a("UUID", StringArgumentType.word()).requires((source) -> {
literalargumentbuilder.then(Commands.func_197057_a("set").executes((source) -> {
PlayerData player = Config.getPlayer(source.getSource().func_197035_h().func_110124_au().toString());
ServerPlayerEntity playerEntity = source.getSource().func_197035_h();
double x = playerEntity.field_70165_t;
double y = playerEntity.field_70163_u;
double z = playerEntity.field_70161_v;
float yaw = playerEntity.field_70177_z;
float pitch = playerEntity.field_70125_A;
PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch);
player.setHome(location);
Config.setPlayer(player);
source.getSource().func_197030_a(new TranslationTextComponent("Your home has been updated"), true);
return 1;
}));
literalargumentbuilder.then(Commands.func_197057_a("sudoset").requires((source) -> {
return source.func_197034_c(2);
}).executes((source) -> {
}).then(Commands.func_197056_a("UUID", StringArgumentType.word()).executes((source) -> {
PlayerData player = Config.getPlayer(StringArgumentType.getString(source, "UUID"));
ServerPlayerEntity playerEntity = source.getSource().func_197035_h();
double x = playerEntity.field_70165_t;