mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-21 11:35:16 +01:00
fixed uuid for console
This commit is contained in:
parent
e3fb5db561
commit
a2c103c6a1
@ -11,6 +11,7 @@ import net.minecraft.server.command.CommandSource;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NMSCommandSender implements ViaCommandSender {
|
||||
@ -49,7 +50,7 @@ public class NMSCommandSender implements ViaCommandSender {
|
||||
&& source instanceof ClientCommandSource) {
|
||||
return MinecraftClient.getInstance().player.getUuid();
|
||||
}
|
||||
return UUID.fromString(getName());
|
||||
return UUID.nameUUIDFromBytes(getName().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,6 +11,7 @@ import net.minecraft.server.command.CommandSource;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NMSCommandSender implements ViaCommandSender {
|
||||
@ -47,7 +48,7 @@ public class NMSCommandSender implements ViaCommandSender {
|
||||
} else if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT && source instanceof ClientCommandSource) {
|
||||
return MinecraftClient.getInstance().player.getUuid();
|
||||
}
|
||||
return UUID.fromString(getName());
|
||||
return UUID.nameUUIDFromBytes(getName().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,6 +8,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NMSCommandSender implements ViaCommandSender {
|
||||
@ -44,7 +45,7 @@ public class NMSCommandSender implements ViaCommandSender {
|
||||
} else if (source instanceof FabricClientCommandSource) {
|
||||
return ((FabricClientCommandSource) source).getPlayer().getUuid();
|
||||
}
|
||||
return UUID.fromString(getName());
|
||||
return UUID.nameUUIDFromBytes(getName().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,6 +9,7 @@ import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import com.viaversion.viaversion.api.command.ViaCommandSender;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NMSCommandSender implements ViaCommandSender {
|
||||
@ -45,7 +46,7 @@ public class NMSCommandSender implements ViaCommandSender {
|
||||
} else if (source instanceof FabricClientCommandSource) {
|
||||
return ((FabricClientCommandSource) source).getPlayer().getUuid();
|
||||
}
|
||||
return UUID.fromString(getName());
|
||||
return UUID.nameUUIDFromBytes(getName().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,6 +8,7 @@ import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
import com.viaversion.viaversion.api.command.ViaCommandSender;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NMSCommandSender implements ViaCommandSender {
|
||||
@ -44,7 +45,7 @@ public class NMSCommandSender implements ViaCommandSender {
|
||||
} else if (source instanceof FabricClientCommandSource) {
|
||||
return ((FabricClientCommandSource) source).getPlayer().getUuid();
|
||||
}
|
||||
return UUID.fromString(getName());
|
||||
return UUID.nameUUIDFromBytes(getName().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,6 +9,7 @@ import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import com.viaversion.viaversion.api.command.ViaCommandSender;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NMSCommandSender implements ViaCommandSender {
|
||||
@ -45,7 +46,7 @@ public class NMSCommandSender implements ViaCommandSender {
|
||||
} else if (source instanceof FabricClientCommandSource) {
|
||||
return ((FabricClientCommandSource) source).getPlayer().getUuid();
|
||||
}
|
||||
return UUID.fromString(getName());
|
||||
return UUID.nameUUIDFromBytes(getName().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,6 +9,7 @@ import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import com.viaversion.viaversion.api.command.ViaCommandSender;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NMSCommandSender implements ViaCommandSender {
|
||||
@ -45,7 +46,7 @@ public class NMSCommandSender implements ViaCommandSender {
|
||||
} else if (source instanceof FabricClientCommandSource) {
|
||||
return ((FabricClientCommandSource) source).getPlayer().getUuid();
|
||||
}
|
||||
return UUID.fromString(getName());
|
||||
return UUID.nameUUIDFromBytes(getName().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,6 +6,7 @@ import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NMSCommandSender implements ViaCommandSender {
|
||||
@ -31,7 +32,7 @@ public class NMSCommandSender implements ViaCommandSender {
|
||||
if (source instanceof Entity) {
|
||||
return ((Entity) source).getUuid();
|
||||
}
|
||||
return UUID.fromString(getName());
|
||||
return UUID.nameUUIDFromBytes(getName().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user