From 7d2c2ab074c54d511abe734f3213d79edb63759b Mon Sep 17 00:00:00 2001 From: BlackHole Date: Mon, 15 Feb 2016 20:12:48 +0100 Subject: [PATCH] Add ComponentBuilder.insertion() --- .../net/md_5/bungee/api/chat/ComponentBuilder.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 09517aa3..9719987b 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 @@ -156,6 +156,18 @@ public class ComponentBuilder return this; } + /** + * Sets the insertion text for the current part. + * + * @param insertion the insertion text + * @return this ComponentBuilder for chaining + */ + public ComponentBuilder insertion(String insertion) + { + current.setInsertion( insertion ); + return this; + } + /** * Sets the click event for the current part. * @@ -210,6 +222,7 @@ public class ComponentBuilder break; case EVENTS: current = new TextComponent( current.getText() ); + current.setInsertion( previous.getInsertion() ); current.setClickEvent( previous.getClickEvent() ); current.setHoverEvent( previous.getHoverEvent() ); break;