flewkey
/
mc.2a03.party
Archived
1
0
Fork 0

Let users set their own homes, disabled logging on something

This commit is contained in:
flewkey 2019-05-28 08:30:02 -07:00
parent 31a8027157
commit 43b81556bf
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
2 changed files with 17 additions and 3 deletions

View File

@ -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_) {

View File

@ -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;