Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
KingKits v5.3.2
Browse files Browse the repository at this point in the history
KingKits v5.3.2 update.
  • Loading branch information
KingFaris10 committed Mar 1, 2018
1 parent b62b4e6 commit 19ff0e6
Show file tree
Hide file tree
Showing 57 changed files with 943 additions and 998 deletions.
28 changes: 14 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,28 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<linksource>true</linksource>
<reportOutputDirectory>${project.basedir}</reportOutputDirectory>
<destDir>gh-pages</destDir>
<level>private</level>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<linksource>true</linksource>
<reportOutputDirectory>${project.basedir}</reportOutputDirectory>
<destDir>gh-pages</destDir>
<level>private</level>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<version>3.1.0</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<artifactSet>
Expand Down Expand Up @@ -140,13 +140,13 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.11.2-R0.1-SNAPSHOT</version>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.6.2</version>
<version>2.8.2</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -158,7 +158,7 @@
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.5</version>
<version>1.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
26 changes: 8 additions & 18 deletions src/main/java/com/comphenix/attributes/Attributes.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.comphenix.attributes.NbtFactory.NbtList;
import com.faris.kingkits.helper.util.ObjectUtilities;
import com.faris.kingkits.helper.util.Utilities;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterators;
Expand All @@ -31,7 +30,7 @@

import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.*;

public class Attributes {
public enum Operation {
Expand All @@ -40,7 +39,7 @@ public enum Operation {
ADD_PERCENTAGE(2);
private int id;

private Operation(int id) {
Operation(int id) {
this.id = id;
}

Expand Down Expand Up @@ -473,21 +472,12 @@ public List<Attribute> getAll() {

// We can't make Attributes itself iterable without splitting it up into separate classes
public Iterable<Attribute> values() {
return new Iterable<Attribute>() {
@Override
public Iterator<Attribute> iterator() {
// Handle the empty case
if (size() == 0)
return Collections.<Attribute>emptyList().iterator();

return Iterators.transform(attributes.iterator(),
new Function<Object, Attribute>() {
@Override
public Attribute apply(Object element) {
return new Attribute((NbtCompound) element);
}
});
}
return () -> {
// Handle the empty case
if (size() == 0)
return Collections.<Attribute>emptyList().iterator();

return Iterators.transform(attributes.iterator(), element -> new Attribute((NbtCompound) element));
};
}
}
30 changes: 13 additions & 17 deletions src/main/java/com/comphenix/attributes/NbtFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
import com.google.common.collect.HashBiMap;
import com.google.common.collect.Lists;
import com.google.common.collect.MapMaker;
import com.google.common.io.Closeables;
import com.google.common.io.Files;
import com.google.common.io.InputSupplier;
import com.google.common.io.OutputSupplier;
import com.google.common.io.*;
import com.google.common.primitives.Primitives;
import org.bukkit.Bukkit;
import org.bukkit.Material;
Expand All @@ -38,9 +35,8 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.*;
import java.util.concurrent.ConcurrentMap;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import java.util.concurrent.*;
import java.util.zip.*;

public class NbtFactory {
// Convert between NBT id and the equivalent class in java
Expand Down Expand Up @@ -260,13 +256,13 @@ public <T> T getPath(String path) {
/**
* Save the content of a NBT compound to a stream.
* <p>
* Use {@link Files#newOutputStreamSupplier(java.io.File)} to provide a stream supplier to a file.
* Use {@link Files#asByteSink(File, FileWriteMode...)} to provide a stream supplier to a file.
*
* @param stream - the output stream.
* @param option - whether or not to compress the output.
* @throws IOException If anything went wrong.
*/
public void saveTo(OutputSupplier<? extends OutputStream> stream, StreamOptions option) throws IOException {
public void saveTo(ByteSink stream, StreamOptions option) throws IOException {
saveStream(this, stream, option);
}

Expand Down Expand Up @@ -431,7 +427,7 @@ public static NbtList createList(Object... content) {
*
* @return The NBT list.
*/
public static NbtList createList(Iterable<? extends Object> iterable) {
public static NbtList createList(Iterable<?> iterable) {
NbtList list = get().new NbtList(
INSTANCE.createNbtTag(NbtType.TAG_LIST, null)
);
Expand Down Expand Up @@ -466,20 +462,20 @@ public static NbtList fromList(Object nmsList) {
/**
* Load the content of a file from a stream.
* <p>
* Use {@link Files#newInputStreamSupplier(java.io.File)} to provide a stream from a file.
* Use {@link Files#asByteSource(File)} to provide a stream from a file.
*
* @param stream - the stream supplier.
* @param option - whether or not to decompress the input stream.
* @return The decoded NBT compound.
* @throws IOException If anything went wrong.
*/
public static NbtCompound fromStream(InputSupplier<? extends InputStream> stream, StreamOptions option) throws IOException {
public static NbtCompound fromStream(ByteSource stream, StreamOptions option) throws IOException {
InputStream input = null;
DataInputStream data = null;
boolean suppress = true;

try {
input = stream.getInput();
input = stream.openStream();
data = new DataInputStream(new BufferedInputStream(
option == StreamOptions.GZIP_COMPRESSION ? new GZIPInputStream(input) : input
));
Expand All @@ -499,20 +495,20 @@ else if (input != null)
/**
* Save the content of a NBT compound to a stream.
* <p>
* Use {@link Files#newOutputStreamSupplier(java.io.File)} to provide a stream supplier to a file.
* Use {@link Files#asByteSink(File, FileWriteMode...)} to provide a stream supplier to a file.
*
* @param source - the NBT compound to save.
* @param stream - the stream.
* @param option - whether or not to compress the output.
* @throws IOException If anything went wrong.
*/
public static void saveStream(NbtCompound source, OutputSupplier<? extends OutputStream> stream, StreamOptions option) throws IOException {
public static void saveStream(NbtCompound source, ByteSink stream, StreamOptions option) throws IOException {
OutputStream output = null;
DataOutputStream data = null;
boolean suppress = true;

try {
output = stream.getOutput();
output = stream.openStream();
data = new DataOutputStream(
option == StreamOptions.GZIP_COMPRESSION ? new GZIPOutputStream(output) : output
);
Expand Down Expand Up @@ -922,7 +918,7 @@ public boolean hasNext() {
public Entry<String, Object> next() {
Entry<String, Object> entry = proxy.next();

return new SimpleEntry<String, Object>(
return new SimpleEntry<>(
entry.getKey(), wrapOutgoing(entry.getValue())
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/faris/easysql/main/databases/SQLite.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.*;

/**
* Connects to and uses a SQLite database
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/faris/easysql/mysql/MySQLDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import org.bukkit.Bukkit;
import org.bukkit.configuration.serialization.ConfigurationSerializable;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.*;
import java.util.logging.*;

public class MySQLDetails implements ConfigurationSerializable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.*;

public class StatementCreateTable extends StatementBuilder {

Expand Down
Loading

0 comments on commit 19ff0e6

Please sign in to comment.