Tabnine Logo
TranslatableComponent.setWith
Code IndexAdd Tabnine to your IDE (free)

How to use
setWith
method
in
net.md_5.bungee.api.chat.TranslatableComponent

Best Java code snippets using net.md_5.bungee.api.chat.TranslatableComponent.setWith (Showing top 6 results out of 315)

origin: SpigotMC/BungeeCord

@Override
public TranslatableComponent deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
{
  TranslatableComponent component = new TranslatableComponent();
  JsonObject object = json.getAsJsonObject();
  deserialize( object, component, context );
  component.setTranslate( object.get( "translate" ).getAsString() );
  if ( object.has( "with" ) )
  {
    component.setWith( Arrays.asList( (BaseComponent[]) context.deserialize( object.get( "with" ), BaseComponent[].class ) ) );
  }
  return component;
}
origin: SpigotMC/BungeeCord

/**
 * Creates a translatable component with the passed substitutions
 *
 * @see #translate
 * @see #setWith(java.util.List)
 * @param translate the translation key
 * @param with the {@link java.lang.String}s and
 * {@link net.md_5.bungee.api.chat.BaseComponent}s to use into the
 * translation
 */
public TranslatableComponent(String translate, Object... with)
{
  setTranslate( translate );
  if ( with != null && with.length != 0 )
  {
    List<BaseComponent> temp = new ArrayList<BaseComponent>();
    for ( Object w : with )
    {
      if ( w instanceof BaseComponent )
      {
        temp.add( (BaseComponent) w );
      } else
      {
        temp.add( new TextComponent( String.valueOf( w ) ) );
      }
    }
    setWith( temp );
  }
}
origin: SpigotMC/BungeeCord

/**
 * Creates a translatable component from the original to clone it.
 *
 * @param original the original for the new translatable component.
 */
public TranslatableComponent(TranslatableComponent original)
{
  super( original );
  setTranslate( original.getTranslate() );
  if ( original.getWith() != null )
  {
    List<BaseComponent> temp = new ArrayList<BaseComponent>();
    for ( BaseComponent baseComponent : original.getWith() )
    {
      temp.add( baseComponent.duplicate() );
    }
    setWith( temp );
  }
}
origin: WaterfallMC/Waterfall-Old

@Override
public TranslatableComponent deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
{
  TranslatableComponent component = new TranslatableComponent();
  JsonObject object = json.getAsJsonObject();
  deserialize( object, component, context );
  component.setTranslate( object.get( "translate" ).getAsString() );
  if ( object.has( "with" ) )
  {
    component.setWith( Arrays.asList( (BaseComponent[]) context.deserialize( object.get( "with" ), BaseComponent[].class ) ) );
  }
  return component;
}
origin: WaterfallMC/Waterfall-Old

/**
 * Creates a translatable component with the passed substitutions
 *
 * @see #translate
 * @see #setWith(java.util.List)
 * @param translate the translation key
 * @param with the {@link java.lang.String}s and
 * {@link net.md_5.bungee.api.chat.BaseComponent}s to use into the
 * translation
 */
public TranslatableComponent(String translate, Object... with)
{
  setTranslate( translate );
  List<BaseComponent> temp = new ArrayList<BaseComponent>();
  for ( Object w : with )
  {
    if ( w instanceof String )
    {
      temp.add( new TextComponent( (String) w ) );
    } else
    {
      temp.add( (BaseComponent) w );
    }
  }
  setWith( temp );
}
origin: WaterfallMC/Waterfall-Old

/**
 * Creates a translatable component from the original to clone it.
 *
 * @param original the original for the new translatable component.
 */
public TranslatableComponent(TranslatableComponent original)
{
  super( original );
  setTranslate( original.getTranslate() );
  if ( original.getWith() != null )
  {
    List<BaseComponent> temp = new ArrayList<BaseComponent>();
    for ( BaseComponent baseComponent : original.getWith() )
    {
      temp.add( baseComponent.duplicate() );
    }
    setWith( temp );
  }
}
net.md_5.bungee.api.chatTranslatableComponentsetWith

Javadoc

Sets the translation substitutions to be used in this component. Removes any previously set substitutions

Popular methods of TranslatableComponent

  • <init>
    Creates a translatable component from the original to clone it.
  • getTranslate
  • getWith
  • setTranslate
  • addFormat
  • addWith
    Adds a component substitution to the component. The text will inherit this component's formatting
  • getColor
  • isBold
  • isItalic
  • isObfuscated
  • isStrikethrough
  • isUnderlined
  • isStrikethrough,
  • isUnderlined

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now