From dda06388692fa199c149a4fdab238fb5d04a7ebf Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 26 Dec 2017 15:30:48 +1100 Subject: [PATCH] Make bungeecord-chat API classes final - the API does not (nor should) support subclassing. --- .../main/java/net/md_5/bungee/api/chat/ComponentBuilder.java | 2 +- chat/src/main/java/net/md_5/bungee/api/chat/HoverEvent.java | 2 +- .../main/java/net/md_5/bungee/api/chat/KeybindComponent.java | 2 +- chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java | 2 +- .../java/net/md_5/bungee/api/chat/TranslatableComponent.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/ComponentBuilder.java b/chat/src/main/java/net/md_5/bungee/api/chat/ComponentBuilder.java index 6277f0c9..2985908b 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/ComponentBuilder.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/ComponentBuilder.java @@ -23,7 +23,7 @@ import java.util.List; * part's formatting *

*/ -public class ComponentBuilder +public final class ComponentBuilder { private BaseComponent current; diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/HoverEvent.java b/chat/src/main/java/net/md_5/bungee/api/chat/HoverEvent.java index 1b76956a..0f6ec77d 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/HoverEvent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/HoverEvent.java @@ -7,7 +7,7 @@ import lombok.ToString; @Getter @ToString @RequiredArgsConstructor -final public class HoverEvent +public final class HoverEvent { private final Action action; diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/KeybindComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/KeybindComponent.java index f5bcb174..5b074c63 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/KeybindComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/KeybindComponent.java @@ -10,7 +10,7 @@ import net.md_5.bungee.api.ChatColor; @Setter @ToString @NoArgsConstructor -public class KeybindComponent extends BaseComponent +public final class KeybindComponent extends BaseComponent { /** diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java index cc7335f3..b4285835 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java @@ -14,7 +14,7 @@ import java.util.regex.Pattern; @Getter @Setter @AllArgsConstructor -public class TextComponent extends BaseComponent +public final class TextComponent extends BaseComponent { private static final Pattern url = Pattern.compile( "^(?:(https?)://)?([-\\w_\\.]{2,}\\.[a-z]{2,4})(/\\S*)?$" ); diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java index 78b24ad6..958ebbdf 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java @@ -16,7 +16,7 @@ import lombok.ToString; @Setter @ToString @NoArgsConstructor -public class TranslatableComponent extends BaseComponent +public final class TranslatableComponent extends BaseComponent { private final ResourceBundle locales = ResourceBundle.getBundle( "mojang-translations/en_US" );