Compile chat API with 1.6

This commit is contained in:
md_5 2014-12-16 14:40:48 +11:00
parent 22084b2c75
commit cd15b82361
7 changed files with 22 additions and 7 deletions

View File

@ -26,4 +26,19 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -112,7 +112,7 @@ public enum ChatColor
/** /**
* Colour instances keyed by their active character. * Colour instances keyed by their active character.
*/ */
private static final Map<Character, ChatColor> BY_CHAR = new HashMap<>(); private static final Map<Character, ChatColor> BY_CHAR = new HashMap<Character, ChatColor>();
/** /**
* The code appended to {@link #COLOR_CHAR} to make usable colour. * The code appended to {@link #COLOR_CHAR} to make usable colour.
*/ */

View File

@ -323,7 +323,7 @@ public abstract class BaseComponent
{ {
if ( extra == null ) if ( extra == null )
{ {
extra = new ArrayList<>(); extra = new ArrayList<BaseComponent>();
} }
component.parent = this; component.parent = this;
extra.add( component ); extra.add( component );

View File

@ -26,7 +26,7 @@ public class ComponentBuilder
{ {
private TextComponent current; private TextComponent current;
private final List<BaseComponent> parts = new ArrayList<>(); private final List<BaseComponent> parts = new ArrayList<BaseComponent>();
/** /**
* Creates a ComponentBuilder from the other given ComponentBuilder to clone * Creates a ComponentBuilder from the other given ComponentBuilder to clone

View File

@ -30,7 +30,7 @@ public class TextComponent extends BaseComponent
*/ */
public static BaseComponent[] fromLegacyText(String message) public static BaseComponent[] fromLegacyText(String message)
{ {
ArrayList<BaseComponent> components = new ArrayList<>(); ArrayList<BaseComponent> components = new ArrayList<BaseComponent>();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
TextComponent component = new TextComponent(); TextComponent component = new TextComponent();
Matcher matcher = url.matcher( message ); Matcher matcher = url.matcher( message );

View File

@ -60,7 +60,7 @@ public class TranslatableComponent extends BaseComponent
public TranslatableComponent(String translate, Object... with) public TranslatableComponent(String translate, Object... with)
{ {
setTranslate( translate ); setTranslate( translate );
List<BaseComponent> temp = new ArrayList<>(); List<BaseComponent> temp = new ArrayList<BaseComponent>();
for ( Object w : with ) for ( Object w : with )
{ {
if ( w instanceof String ) if ( w instanceof String )
@ -121,7 +121,7 @@ public class TranslatableComponent extends BaseComponent
{ {
if ( with == null ) if ( with == null )
{ {
with = new ArrayList<>(); with = new ArrayList<BaseComponent>();
} }
component.parent = this; component.parent = this;
with.add( component ); with.add( component );

View File

@ -23,7 +23,7 @@ public class ComponentSerializer implements JsonDeserializer<BaseComponent>
registerTypeAdapter( TranslatableComponent.class, new TranslatableComponentSerializer() ). registerTypeAdapter( TranslatableComponent.class, new TranslatableComponentSerializer() ).
create(); create();
public final static ThreadLocal<HashSet<BaseComponent>> serializedComponents = new ThreadLocal<>(); public final static ThreadLocal<HashSet<BaseComponent>> serializedComponents = new ThreadLocal<HashSet<BaseComponent>>();
public static BaseComponent[] parse(String json) public static BaseComponent[] parse(String json)
{ {