Use new method

This commit is contained in:
fullwall 2023-06-18 17:07:08 +08:00
parent da2ab6324a
commit 130dc42e5f
12 changed files with 12 additions and 84 deletions

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final ServerLevel nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final ServerLevel nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final ServerLevel nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final ServerLevel nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;

View File

@ -31,13 +31,7 @@ public class HumanController extends AbstractEntityController {
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
String coloredName = npc.getFullName();
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
UUID uuid = npc.getUniqueId();
if (uuid.version() == 4) { // set version to 2
long msb = uuid.getMostSignificantBits();
msb &= ~0x0000000000004000L;
msb |= 0x0000000000002000L;
uuid = new UUID(msb, uuid.getLeastSignificantBits());
}
UUID uuid = npc.getMinecraftUniqueId();
final String teamName = Util.getTeamName(uuid);
if (npc.requiresNameHologram()) {
name = teamName;