mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-24 17:47:41 +01:00
Add new 1.8 chat features
This commit is contained in:
parent
e556fd7150
commit
fa3678bcdd
@ -48,6 +48,12 @@ public abstract class BaseComponent
|
||||
* obfuscated
|
||||
*/
|
||||
private Boolean obfuscated;
|
||||
/**
|
||||
* The text to insert into the chat when this component (and child
|
||||
* components) are clicked while pressing the shift key
|
||||
*/
|
||||
@Getter
|
||||
private String insertion;
|
||||
|
||||
/**
|
||||
* Appended components that inherit this component's formatting and events
|
||||
@ -76,6 +82,7 @@ public abstract class BaseComponent
|
||||
setUnderlined( old.isUnderlinedRaw() );
|
||||
setStrikethrough( old.isStrikethroughRaw() );
|
||||
setObfuscated( old.isObfuscatedRaw() );
|
||||
setInsertion( old.getInsertion() );
|
||||
setClickEvent( old.getClickEvent() );
|
||||
setHoverEvent( old.getHoverEvent() );
|
||||
if ( old.getExtra() != null )
|
||||
|
@ -45,6 +45,11 @@ public final class ClickEvent
|
||||
* {@link net.md_5.bungee.api.chat.ClickEvent#value} into the players
|
||||
* text box
|
||||
*/
|
||||
SUGGEST_COMMAND
|
||||
SUGGEST_COMMAND,
|
||||
/**
|
||||
* Change to the page number given by
|
||||
* {@link net.md_5.bungee.api.chat.ClickEvent#value} in a book
|
||||
*/
|
||||
CHANGE_PAGE
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ final public class HoverEvent
|
||||
|
||||
SHOW_TEXT,
|
||||
SHOW_ACHIEVEMENT,
|
||||
SHOW_ITEM
|
||||
SHOW_ITEM,
|
||||
SHOW_ENTITY
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,10 @@ public class BaseComponentSerializer
|
||||
{
|
||||
component.setObfuscated( object.get( "obfuscated" ).getAsBoolean() );
|
||||
}
|
||||
if ( object.has( "insertion" ) )
|
||||
{
|
||||
component.setInsertion( object.get( "insertion" ).getAsString() );
|
||||
}
|
||||
if ( object.has( "extra" ) )
|
||||
{
|
||||
component.setExtra( Arrays.<BaseComponent>asList( context.<BaseComponent[]>deserialize( object.get( "extra" ), BaseComponent[].class ) ) );
|
||||
@ -108,6 +112,10 @@ public class BaseComponentSerializer
|
||||
{
|
||||
object.addProperty( "obfuscated", component.isObfuscatedRaw() );
|
||||
}
|
||||
if ( component.getInsertion() != null )
|
||||
{
|
||||
object.addProperty( "insertion", component.getInsertion() );
|
||||
}
|
||||
|
||||
if ( component.getExtra() != null )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user