Add ComponentBuilder.insertion()

This commit is contained in:
BlackHole 2016-02-15 20:12:48 +01:00 committed by md_5
parent 0646a3090a
commit 7d2c2ab074

View File

@ -156,6 +156,18 @@ public class ComponentBuilder
return this; 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. * Sets the click event for the current part.
* *
@ -210,6 +222,7 @@ public class ComponentBuilder
break; break;
case EVENTS: case EVENTS:
current = new TextComponent( current.getText() ); current = new TextComponent( current.getText() );
current.setInsertion( previous.getInsertion() );
current.setClickEvent( previous.getClickEvent() ); current.setClickEvent( previous.getClickEvent() );
current.setHoverEvent( previous.getHoverEvent() ); current.setHoverEvent( previous.getHoverEvent() );
break; break;