mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-12-26 10:47:46 +01:00
Raise hologram line character limit
This commit is contained in:
parent
54bc45ebb9
commit
559cba600c
@ -12,6 +12,8 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -34,7 +36,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
if (customName == null) {
|
||||
customName = "";
|
||||
}
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME, Strings.truncate(customName, 300));
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME, Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH));
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME_VISIBILITY, !Strings.isEmpty(customName));
|
||||
return this;
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -33,7 +35,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
if (customName == null) {
|
||||
customName = "";
|
||||
}
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME, Strings.truncate(customName, 300));
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME, Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH));
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME_VISIBILITY, !Strings.isEmpty(customName));
|
||||
return this;
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -33,7 +35,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
if (customName == null) {
|
||||
customName = "";
|
||||
}
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME, Strings.truncate(customName, 300));
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME, Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH));
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME_VISIBILITY, !Strings.isEmpty(customName));
|
||||
return this;
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ import java.util.Optional;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -40,7 +42,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
}
|
||||
|
||||
private Optional<IChatBaseComponent> getCustomNameDataWatcherValue(String customName) {
|
||||
customName = Strings.truncate(customName, 300);
|
||||
customName = Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH);
|
||||
if (!Strings.isEmpty(customName)) {
|
||||
return Optional.of(CraftChatMessage.fromString(customName, false)[0]);
|
||||
} else {
|
||||
|
@ -15,6 +15,8 @@ import java.util.Optional;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -40,7 +42,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
}
|
||||
|
||||
private Optional<IChatBaseComponent> getCustomNameDataWatcherValue(String customName) {
|
||||
customName = Strings.truncate(customName, 300);
|
||||
customName = Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH);
|
||||
if (!Strings.isEmpty(customName)) {
|
||||
return Optional.of(CraftChatMessage.fromString(customName, false)[0]);
|
||||
} else {
|
||||
|
@ -15,6 +15,8 @@ import java.util.Optional;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -40,7 +42,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
}
|
||||
|
||||
private Optional<IChatBaseComponent> getCustomNameDataWatcherValue(String customName) {
|
||||
customName = Strings.truncate(customName, 300);
|
||||
customName = Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH);
|
||||
if (!Strings.isEmpty(customName)) {
|
||||
return Optional.of(CraftChatMessage.fromString(customName, false)[0]);
|
||||
} else {
|
||||
|
@ -15,6 +15,8 @@ import java.util.Optional;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -40,7 +42,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
}
|
||||
|
||||
private Optional<IChatBaseComponent> getCustomNameDataWatcherValue(String customName) {
|
||||
customName = Strings.truncate(customName, 300);
|
||||
customName = Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH);
|
||||
if (!Strings.isEmpty(customName)) {
|
||||
return Optional.of(CraftChatMessage.fromString(customName, false)[0]);
|
||||
} else {
|
||||
|
@ -15,6 +15,8 @@ import java.util.Optional;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -40,7 +42,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
}
|
||||
|
||||
private Optional<IChatBaseComponent> getCustomNameDataWatcherValue(String customName) {
|
||||
customName = Strings.truncate(customName, 300);
|
||||
customName = Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH);
|
||||
if (!Strings.isEmpty(customName)) {
|
||||
return Optional.of(CraftChatMessage.fromString(customName, false)[0]);
|
||||
} else {
|
||||
|
@ -15,6 +15,8 @@ import java.util.Optional;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -40,7 +42,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
}
|
||||
|
||||
private Optional<IChatBaseComponent> getCustomNameDataWatcherValue(String customName) {
|
||||
customName = Strings.truncate(customName, 300);
|
||||
customName = Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH);
|
||||
if (!Strings.isEmpty(customName)) {
|
||||
return Optional.of(CraftChatMessage.fromString(customName, false, true)[0]);
|
||||
} else {
|
||||
|
@ -15,6 +15,8 @@ import java.util.Optional;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -40,7 +42,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
}
|
||||
|
||||
private Optional<IChatBaseComponent> getCustomNameDataWatcherValue(String customName) {
|
||||
customName = Strings.truncate(customName, 300);
|
||||
customName = Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH);
|
||||
if (!Strings.isEmpty(customName)) {
|
||||
return Optional.of(CraftChatMessage.fromString(customName, false, true)[0]);
|
||||
} else {
|
||||
|
@ -15,6 +15,8 @@ import java.util.Optional;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -40,7 +42,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
}
|
||||
|
||||
private Optional<IChatBaseComponent> getCustomNameDataWatcherValue(String customName) {
|
||||
customName = Strings.truncate(customName, 300);
|
||||
customName = Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH);
|
||||
if (!Strings.isEmpty(customName)) {
|
||||
return Optional.of(CraftChatMessage.fromString(customName, false, true)[0]);
|
||||
} else {
|
||||
|
@ -15,6 +15,8 @@ import java.util.Optional;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -40,7 +42,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
}
|
||||
|
||||
private Optional<IChatBaseComponent> getCustomNameDataWatcherValue(String customName) {
|
||||
customName = Strings.truncate(customName, 300);
|
||||
customName = Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH);
|
||||
if (!Strings.isEmpty(customName)) {
|
||||
return Optional.of(CraftChatMessage.fromString(customName, false, true)[0]);
|
||||
} else {
|
||||
|
@ -11,6 +11,8 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -33,7 +35,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
if (customName == null) {
|
||||
customName = "";
|
||||
}
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME, Strings.truncate(customName, 300));
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME, Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH));
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME_VISIBILITY, Strings.isEmpty(customName) ? (byte) 0 : (byte) 1);
|
||||
return this;
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
abstract class DataWatcherPacketBuilder<T> {
|
||||
|
||||
private static final int MAX_CUSTOM_NAME_LENGTH = 5000;
|
||||
|
||||
private final PacketByteBuffer packetByteBuffer;
|
||||
|
||||
DataWatcherPacketBuilder(PacketByteBuffer packetByteBuffer) {
|
||||
@ -34,7 +36,7 @@ abstract class DataWatcherPacketBuilder<T> {
|
||||
if (customName == null) {
|
||||
customName = "";
|
||||
}
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME, Strings.truncate(customName, 300));
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME, Strings.truncate(customName, MAX_CUSTOM_NAME_LENGTH));
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.CUSTOM_NAME_VISIBILITY, !Strings.isEmpty(customName));
|
||||
return this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user