mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Randomise name if using holograms to have unique scoreboard names
This commit is contained in:
parent
202c2487a6
commit
0a4905c0f3
@ -32,8 +32,11 @@ public class HumanController extends AbstractEntityController {
|
||||
protected Entity createEntity(final Location at, final NPC npc) {
|
||||
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
|
||||
String coloredName = npc.getFullName();
|
||||
|
||||
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = npc.getId() + UUID.randomUUID().toString().replace("-", "");
|
||||
name = name.substring(0, 16);
|
||||
}
|
||||
|
||||
UUID uuid = npc.getUniqueId();
|
||||
if (uuid.version() == 4) { // clear version
|
||||
|
@ -32,8 +32,11 @@ public class HumanController extends AbstractEntityController {
|
||||
protected Entity createEntity(final Location at, final NPC npc) {
|
||||
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
|
||||
String coloredName = npc.getFullName();
|
||||
|
||||
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = npc.getId() + UUID.randomUUID().toString().replace("-", "");
|
||||
name = name.substring(0, 16);
|
||||
}
|
||||
|
||||
UUID uuid = npc.getUniqueId();
|
||||
if (uuid.version() == 4) { // clear version
|
||||
|
@ -32,8 +32,11 @@ public class HumanController extends AbstractEntityController {
|
||||
protected Entity createEntity(final Location at, final NPC npc) {
|
||||
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
|
||||
String coloredName = npc.getFullName();
|
||||
|
||||
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = npc.getId() + UUID.randomUUID().toString().replace("-", "");
|
||||
name = name.substring(0, 16);
|
||||
}
|
||||
|
||||
UUID uuid = npc.getUniqueId();
|
||||
if (uuid.version() == 4) { // clear version
|
||||
|
@ -33,6 +33,10 @@ 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;
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = npc.getId() + UUID.randomUUID().toString().replace("-", "");
|
||||
name = name.substring(0, 16);
|
||||
}
|
||||
|
||||
UUID uuid = npc.getUniqueId();
|
||||
if (uuid.version() == 4) { // clear version
|
||||
|
@ -32,8 +32,11 @@ public class HumanController extends AbstractEntityController {
|
||||
protected Entity createEntity(final Location at, final NPC npc) {
|
||||
final WorldServer nmsWorld = ((CraftWorld) at.getWorld()).getHandle();
|
||||
String coloredName = npc.getFullName();
|
||||
|
||||
String name = coloredName.length() > 16 ? coloredName.substring(0, 16) : coloredName;
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = npc.getId() + UUID.randomUUID().toString().replace("-", "");
|
||||
name = name.substring(0, 16);
|
||||
}
|
||||
|
||||
UUID uuid = npc.getUniqueId();
|
||||
if (uuid.version() == 4) { // clear version
|
||||
|
@ -33,6 +33,10 @@ 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;
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = npc.getId() + UUID.randomUUID().toString().replace("-", "");
|
||||
name = name.substring(0, 16);
|
||||
}
|
||||
|
||||
UUID uuid = npc.getUniqueId();
|
||||
if (uuid.version() == 4) { // clear version
|
||||
|
@ -33,6 +33,10 @@ 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;
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = npc.getId() + UUID.randomUUID().toString().replace("-", "");
|
||||
name = name.substring(0, 16);
|
||||
}
|
||||
|
||||
UUID uuid = npc.getUniqueId();
|
||||
if (uuid.version() == 4) { // clear version
|
||||
|
@ -33,7 +33,11 @@ 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;
|
||||
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = npc.getId() + UUID.randomUUID().toString().replace("-", "");
|
||||
name = name.substring(0, 16);
|
||||
}
|
||||
|
||||
UUID uuid = npc.getUniqueId();
|
||||
if (uuid.version() == 4) { // clear version
|
||||
long msb = uuid.getMostSignificantBits();
|
||||
|
Loading…
Reference in New Issue
Block a user