Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.FireworkEffect Class Reference
Inheritance diagram for org.bukkit.FireworkEffect:
org.bukkit.configuration.serialization.ConfigurationSerializable

Classes

class  Builder
 
enum  Type
 

Public Member Functions

boolean hasFlicker ()
 
boolean hasTrail ()
 
List< ColorgetColors ()
 
List< ColorgetFadeColors ()
 
Type getType ()
 
Map< String, Object > serialize ()
 
String toString ()
 
int hashCode ()
 
boolean equals (Object obj)
 

Static Public Member Functions

static Builder builder ()
 
static ConfigurationSerializable deserialize (Map< String, Object > map)
 

Detailed Description

Represents a single firework effect.

Definition at line 17 of file FireworkEffect.java.

Member Function Documentation

static Builder org.bukkit.FireworkEffect.builder ( )
static

Construct a firework effect.

Returns
A utility object for building a firework effect

Definition at line 51 of file FireworkEffect.java.

51  {
52  return new Builder();
53  }
static ConfigurationSerializable org.bukkit.FireworkEffect.deserialize ( Map< String, Object >  map)
static
See also
ConfigurationSerializable

Definition at line 355 of file FireworkEffect.java.

355  {
356  Type type = Type.valueOf((String) map.get(TYPE));
357  if (type == null) {
358  throw new IllegalArgumentException(map.get(TYPE) + " is not a valid Type");
359  }
360 
361  return builder()
362  .flicker((Boolean) map.get(FLICKER))
363  .trail((Boolean) map.get(TRAIL))
364  .withColor((Iterable<?>) map.get(COLORS))
365  .withFade((Iterable<?>) map.get(FADE_COLORS))
366  .with(type)
367  .build();
368  }
List<Color> org.bukkit.FireworkEffect.getColors ( )

Get the primary colors of the firework effect.

Returns
An immutable list of the primary colors

Definition at line 330 of file FireworkEffect.java.

330  {
331  return colors;
332  }
List<Color> org.bukkit.FireworkEffect.getFadeColors ( )

Get the fade colors of the firework effect.

Returns
An immutable list of the fade colors

Definition at line 339 of file FireworkEffect.java.

339  {
340  return fadeColors;
341  }
Type org.bukkit.FireworkEffect.getType ( )

Get the type of the firework effect.

Returns
The effect type

Definition at line 348 of file FireworkEffect.java.

348  {
349  return type;
350  }
boolean org.bukkit.FireworkEffect.hasFlicker ( )

Get whether the firework effect flickers.

Returns
true if it flickers, false if not

Definition at line 312 of file FireworkEffect.java.

312  {
313  return flicker;
314  }
int org.bukkit.FireworkEffect.hashCode ( )

TRUE and FALSE as per boolean.hashCode()

Definition at line 390 of file FireworkEffect.java.

390  {
391  /**
392  * TRUE and FALSE as per boolean.hashCode()
393  */
394  final int PRIME = 31, TRUE = 1231, FALSE = 1237;
395  int hash = 1;
396  hash = hash * PRIME + (flicker ? TRUE : FALSE);
397  hash = hash * PRIME + (trail ? TRUE : FALSE);
398  hash = hash * PRIME + type.hashCode();
399  hash = hash * PRIME + colors.hashCode();
400  hash = hash * PRIME + fadeColors.hashCode();
401  return hash;
402  }
boolean org.bukkit.FireworkEffect.hasTrail ( )

Get whether the firework effect has a trail.

Returns
true if it has a trail, false if not

Definition at line 321 of file FireworkEffect.java.

321  {
322  return trail;
323  }
Map<String, Object> org.bukkit.FireworkEffect.serialize ( )

Creates a Map representation of this class.

This class must provide a method to restore this class, as defined in the ConfigurationSerializable interface javadocs.

Returns
Map containing the current state of this class

Implements org.bukkit.configuration.serialization.ConfigurationSerializable.

Definition at line 370 of file FireworkEffect.java.

370  {
371  return ImmutableMap.<String, Object>of(
372  FLICKER, flicker,
373  TRAIL, trail,
374  COLORS, colors,
375  FADE_COLORS, fadeColors,
376  TYPE, type.name()
377  );
378  }

The documentation for this class was generated from the following file: