Tabnine Logo
Title
Code IndexAdd Tabnine to your IDE (free)

How to use
Title
in
net.md_5.bungee.protocol.packet

Best Java code snippets using net.md_5.bungee.protocol.packet.Title (Showing top 20 results out of 315)

origin: SpigotMC/BungeeCord

private static net.md_5.bungee.protocol.packet.Title createPacket(Action action)
{
  net.md_5.bungee.protocol.packet.Title title = new net.md_5.bungee.protocol.packet.Title();
  title.setAction( action );
  if ( action == Action.TIMES )
  {
    // Set packet to default values first
    title.setFadeIn( 20 );
    title.setStay( 60 );
    title.setFadeOut( 20 );
  }
  return title;
}
origin: SpigotMC/BungeeCord

@Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
  int index = readVarInt( buf );
  // If we're working on 1.10 or lower, increment the value of the index so we pull out the correct value.
  if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_10 && index >= 2 )
  {
    index++;
  }
  action = Action.values()[index];
  switch ( action )
  {
    case TITLE:
    case SUBTITLE:
    case ACTIONBAR:
      text = readString( buf );
      break;
    case TIMES:
      fadeIn = buf.readInt();
      stay = buf.readInt();
      fadeOut = buf.readInt();
      break;
  }
}
origin: SpigotMC/BungeeCord

@Override
public Title subTitle(BaseComponent text)
{
  if ( subtitle == null )
  {
    subtitle = createPacket( Action.SUBTITLE );
  }
  subtitle.setText( ComponentSerializer.toString( text ) );
  return this;
}
origin: SpigotMC/BungeeCord

@Override
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
  int index = action.ordinal();
  // If we're working on 1.10 or lower, increment the value of the index so we pull out the correct value.
  if ( protocolVersion <= ProtocolConstants.MINECRAFT_1_10 && index >= 2 )
  {
    index--;
  }
  writeVarInt( index, buf );
  switch ( action )
  {
    case TITLE:
    case SUBTITLE:
    case ACTIONBAR:
      writeString( text, buf );
      break;
    case TIMES:
      buf.writeInt( fadeIn );
      buf.writeInt( stay );
      buf.writeInt( fadeOut );
      break;
  }
}
origin: SpigotMC/BungeeCord

@Override
public Title fadeOut(int ticks)
{
  if ( times == null )
  {
    times = createPacket( Action.TIMES );
  }
  times.setFadeOut( ticks );
  return this;
}
origin: SpigotMC/BungeeCord

@Override
public Title stay(int ticks)
{
  if ( times == null )
  {
    times = createPacket( Action.TIMES );
  }
  times.setStay( ticks );
  return this;
}
origin: SpigotMC/BungeeCord

@Override
public Title fadeIn(int ticks)
{
  if ( times == null )
  {
    times = createPacket( Action.TIMES );
  }
  times.setFadeIn( ticks );
  return this;
}
origin: WaterfallMC/Waterfall-Old

@Override
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
  writeVarInt( action.ordinal(), buf );
  switch ( action )
  {
    case TITLE:
    case SUBTITLE:
      writeString( text, buf );
      break;
    case TIMES:
      buf.writeInt( fadeIn );
      buf.writeInt( stay );
      buf.writeInt( fadeOut );
      break;
  }
}
origin: WaterfallMC/Waterfall-Old

@Override
public Title fadeOut(int ticks)
{
  if ( times == null )
  {
    times = createPacket( Action.TIMES );
  }
  times.setFadeOut( ticks );
  return this;
}
origin: WaterfallMC/Waterfall-Old

@Override
public Title stay(int ticks)
{
  if ( times == null )
  {
    times = createPacket( Action.TIMES );
  }
  times.setStay( ticks );
  return this;
}
origin: WaterfallMC/Waterfall-Old

@Override
public Title fadeIn(int ticks)
{
  if ( times == null )
  {
    times = createPacket( Action.TIMES );
  }
  times.setFadeIn( ticks );
  return this;
}
origin: WaterfallMC/Waterfall-Old

private static net.md_5.bungee.protocol.packet.Title createPacket(Action action)
{
  net.md_5.bungee.protocol.packet.Title title = new net.md_5.bungee.protocol.packet.Title();
  title.setAction( action );
  if ( action == Action.TIMES )
  {
    // Set packet to default values first
    title.setFadeIn( 20 );
    title.setStay( 60 );
    title.setFadeOut( 20 );
  }
  return title;
}
origin: SpigotMC/BungeeCord

@Override
public Title title(BaseComponent text)
{
  if ( title == null )
  {
    title = createPacket( Action.TITLE );
  }
  title.setText( ComponentSerializer.toString( text ) );
  return this;
}
origin: WaterfallMC/Waterfall-Old

@Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
  action = Action.values()[readVarInt( buf )];
  switch ( action )
  {
    case TITLE:
    case SUBTITLE:
      text = readString( buf );
      break;
    case TIMES:
      fadeIn = buf.readInt();
      stay = buf.readInt();
      fadeOut = buf.readInt();
      break;
  }
}
origin: SpigotMC/BungeeCord

@Override
public Title title(BaseComponent... text)
{
  if ( title == null )
  {
    title = createPacket( Action.TITLE );
  }
  title.setText( ComponentSerializer.toString( text ) );
  return this;
}
origin: SpigotMC/BungeeCord

@Override
public Title subTitle(BaseComponent... text)
{
  if ( subtitle == null )
  {
    subtitle = createPacket( Action.SUBTITLE );
  }
  subtitle.setText( ComponentSerializer.toString( text ) );
  return this;
}
origin: WaterfallMC/Waterfall-Old

@Override
public Title subTitle(BaseComponent... text)
{
  if ( subtitle == null )
  {
    subtitle = createPacket( Action.SUBTITLE );
  }
  subtitle.setText( ComponentSerializer.toString( text ) );
  return this;
}
origin: WaterfallMC/Waterfall-Old

@Override
public Title title(BaseComponent... text)
{
  if ( title == null )
  {
    title = createPacket( Action.TITLE );
  }
  title.setText( ComponentSerializer.toString( text ) );
  return this;
}
origin: WaterfallMC/Waterfall-Old

@Override
public Title subTitle(BaseComponent text)
{
  if ( subtitle == null )
  {
    subtitle = createPacket( Action.SUBTITLE );
  }
  subtitle.setText( ComponentSerializer.toString( text ) );
  return this;
}
origin: WaterfallMC/Waterfall-Old

@Override
public Title title(BaseComponent text)
{
  if ( title == null )
  {
    title = createPacket( Action.TITLE );
  }
  title.setText( ComponentSerializer.toString( text ) );
  return this;
}
net.md_5.bungee.protocol.packetTitle

Most used methods

  • <init>
  • readString
  • readVarInt
  • setAction
  • setFadeIn
  • setFadeOut
  • setStay
  • setText
  • writeString
  • writeVarInt

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • 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