mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Reset UUIDs to version 2 on old minecraft versions
This commit is contained in:
parent
5bb73b3a95
commit
5ef99250e4
@ -32,6 +32,12 @@ public class HumanController extends AbstractEntityController {
|
||||
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());
|
||||
}
|
||||
String teamName = Util.getTeamName(uuid);
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = teamName;
|
||||
|
@ -32,6 +32,12 @@ public class HumanController extends AbstractEntityController {
|
||||
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());
|
||||
}
|
||||
String teamName = Util.getTeamName(uuid);
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = teamName;
|
||||
|
@ -32,6 +32,12 @@ public class HumanController extends AbstractEntityController {
|
||||
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());
|
||||
}
|
||||
String teamName = Util.getTeamName(uuid);
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = teamName;
|
||||
|
@ -32,6 +32,12 @@ public class HumanController extends AbstractEntityController {
|
||||
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());
|
||||
}
|
||||
String teamName = Util.getTeamName(uuid);
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = teamName;
|
||||
|
@ -32,6 +32,12 @@ public class HumanController extends AbstractEntityController {
|
||||
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());
|
||||
}
|
||||
String teamName = Util.getTeamName(uuid);
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = teamName;
|
||||
|
@ -32,6 +32,12 @@ public class HumanController extends AbstractEntityController {
|
||||
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());
|
||||
}
|
||||
String teamName = Util.getTeamName(uuid);
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = teamName;
|
||||
|
@ -360,10 +360,12 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
return;
|
||||
noclip = isSpectator();
|
||||
Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", getBukkitEntity());
|
||||
try {
|
||||
DETECT_EQUIPMENT_UPDATES.invoke(this);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
if (DETECT_EQUIPMENT_UPDATES != null) {
|
||||
try {
|
||||
DETECT_EQUIPMENT_UPDATES.invoke(this);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
boolean navigating = npc.getNavigator().isNavigating();
|
||||
updatePackets(navigating);
|
||||
|
@ -32,6 +32,12 @@ public class HumanController extends AbstractEntityController {
|
||||
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());
|
||||
}
|
||||
String teamName = Util.getTeamName(uuid);
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = teamName;
|
||||
|
@ -32,6 +32,12 @@ public class HumanController extends AbstractEntityController {
|
||||
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());
|
||||
}
|
||||
String teamName = Util.getTeamName(uuid);
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = teamName;
|
||||
|
@ -32,6 +32,12 @@ public class HumanController extends AbstractEntityController {
|
||||
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());
|
||||
}
|
||||
String teamName = Util.getTeamName(uuid);
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = teamName;
|
||||
|
@ -32,6 +32,12 @@ public class HumanController extends AbstractEntityController {
|
||||
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());
|
||||
}
|
||||
final String teamName = Util.getTeamName(uuid);
|
||||
if (npc.requiresNameHologram()) {
|
||||
name = teamName;
|
||||
|
Loading…
Reference in New Issue
Block a user