Skip to content

Commit 10b4809

Browse files
committed
Fix mistake
1 parent 4e459e1 commit 10b4809

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/java/kr/rvs/chplus/CHPlus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
@MSExtension("CHPlus")
1313
public class CHPlus extends AbstractExtension {
14-
public static final Version BUKKIT_VERSION = new SimpleVersion(Bukkit.getVersion());
14+
public static final Version BUKKIT_VERSION = new SimpleVersion(Bukkit.getBukkitVersion());
1515
public static final Version V1_12 = new SimpleVersion(1, 12, 0);
1616
public static final byte CHAT_TYPE_SYSTEM = 2;
1717
public static final byte CHAT_TYPE_GAME_INFO = 2;

src/main/java/kr/rvs/chplus/util/Packets.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static PacketContainer createChatPacket(WrappedChatComponent component, b
3636
StructureModifier components = packet.getSpecificModifier(chatTypeClass);
3737

3838
try {
39-
Method findByByte = chatTypeClass.getMethod("a");
39+
Method findByByte = chatTypeClass.getMethod("a", byte.class);
4040
components.write(0, findByByte.invoke(null, type));
4141
} catch (Exception e) {
4242
// Ignore
@@ -56,7 +56,9 @@ public static PacketContainer createTitlePacket(EnumWrappers.TitleAction action,
5656
.createPacket(PacketType.Play.Server.TITLE);
5757

5858
packet.getTitleActions().write(0, action);
59-
packet.getChatComponents().write(0, WrappedChatComponent.fromText(content));
59+
if (content != null) {
60+
packet.getChatComponents().write(0, WrappedChatComponent.fromText(content));
61+
}
6062

6163
StructureModifier<Integer> modifier = packet.getIntegers();
6264
modifier.write(0, fadeIn);

0 commit comments

Comments
 (0)