From ff2c2a5666eebb95b6ffbab34cb0760a47a0f061 Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 4 May 2017 10:52:38 +0200 Subject: [PATCH 01/23] Added new databasecontroller. --- README.md | 14 +- pom.xml | 23 + .../business/logic/persistence2/Factory.java | 119 ++ .../persistence2/IPetDataController.java | 16 + .../business/logic/persistence2/PetData.java | 45 + .../persistence2/PetDataCommandExecutor.java | 68 ++ .../logic/persistence2/PetRepository.java | 228 ++++ .../logic/persistence2/PlayerData.java | 55 + .../persistence2/PlayerDataRepository.java | 203 ++++ .../lib/util/DataBaseRepository.java | 104 ++ .../lib/util/DbConnectionContext.java | 253 ++++ .../petblocks/lib/util/IController.java | 60 + .../lib/util/IDatabaseController.java | 40 + .../lib/util/ParticleEffectBuilder.java | 1046 +++++++++++++++++ .../petblocks/lib/util/SQLProvider.java | 86 ++ src/main/resources/config.yml | 15 +- src/main/resources/sql/create-mysql.sql | 14 + src/main/resources/sql/create-sqlite.sql | 15 + src/main/resources/sql/petblock/count.sql | 1 + src/main/resources/sql/petblock/delete.sql | 1 + src/main/resources/sql/petblock/insert.sql | 1 + src/main/resources/sql/petblock/selectall.sql | 1 + .../resources/sql/petblock/selectbyid.sql | 1 + src/main/resources/sql/petblock/update.sql | 1 + src/main/resources/sql/player/count.sql | 1 + src/main/resources/sql/player/delete.sql | 1 + src/main/resources/sql/player/insert.sql | 1 + src/main/resources/sql/player/selectall.sql | 1 + src/main/resources/sql/player/selectbyid.sql | 1 + src/main/resources/sql/player/update.sql | 1 + src/main/resources/sql/selectbyplayer.sql | 3 + src/main/resources/sql/selectidbyuuid.sql | 1 + .../persistence2/PetdataDatabaseTest.java | 227 ++++ 33 files changed, 2635 insertions(+), 12 deletions(-) create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetDataCommandExecutor.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerDataRepository.java create mode 100644 src/main/java/com/github/shynixn/petblocks/lib/util/DataBaseRepository.java create mode 100644 src/main/java/com/github/shynixn/petblocks/lib/util/DbConnectionContext.java create mode 100644 src/main/java/com/github/shynixn/petblocks/lib/util/IController.java create mode 100644 src/main/java/com/github/shynixn/petblocks/lib/util/IDatabaseController.java create mode 100644 src/main/java/com/github/shynixn/petblocks/lib/util/ParticleEffectBuilder.java create mode 100644 src/main/java/com/github/shynixn/petblocks/lib/util/SQLProvider.java create mode 100644 src/main/resources/sql/create-mysql.sql create mode 100644 src/main/resources/sql/create-sqlite.sql create mode 100644 src/main/resources/sql/petblock/count.sql create mode 100644 src/main/resources/sql/petblock/delete.sql create mode 100644 src/main/resources/sql/petblock/insert.sql create mode 100644 src/main/resources/sql/petblock/selectall.sql create mode 100644 src/main/resources/sql/petblock/selectbyid.sql create mode 100644 src/main/resources/sql/petblock/update.sql create mode 100644 src/main/resources/sql/player/count.sql create mode 100644 src/main/resources/sql/player/delete.sql create mode 100644 src/main/resources/sql/player/insert.sql create mode 100644 src/main/resources/sql/player/selectall.sql create mode 100644 src/main/resources/sql/player/selectbyid.sql create mode 100644 src/main/resources/sql/player/update.sql create mode 100644 src/main/resources/sql/selectbyplayer.sql create mode 100644 src/main/resources/sql/selectidbyuuid.sql create mode 100644 src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java diff --git a/README.md b/README.md index 4a1ea1958..5933435ab 100644 --- a/README.md +++ b/README.md @@ -44,10 +44,10 @@ Spigot plugin to use blocks as pets in minecraft. ```java Player player = Bukkit.getPlayer("Shynixn"); if(PetBlocksApi.hasPetMeta(player)){ - //Stored data of the entity - PetMeta petMeta = PetBlocksApi.getPetMeta(player); - petMeta.setDisplayName(ChatColor.RED + "That's my new petname"); - PetBlocksApi.persistPetMeta(petMeta); + //Stored data of the entity + PetMeta petMeta = PetBlocksApi.getPetMeta(player); + petMeta.setDisplayName(ChatColor.RED + "That's my new petname"); + PetBlocksApi.persistPetMeta(petMeta); } ``` #### Set Petblock @@ -60,12 +60,12 @@ Spigot plugin to use blocks as pets in minecraft. } ``` -* Check out the [PetBlocks-Spigot-Page](https://www.spigotmc.org/resources/petblocks-mysql-bungeecord-customizeable-gui-1-8-1-9-1-10-1-11.12056/) to get more information. +* Check out the [BlockBall-Spigot-Page](https://www.spigotmc.org/resources/blockball-minigame-bungeecord-soccer-football-1-8-1-9-1-10-1-11.15320/) to get more information. ## Screenshots -![alt tag](http://www.mediafire.com/convkey/9d02/r92bshjdva755d3zg.jpg) -![alt tag](http://www.mediafire.com/convkey/697e/ddk043hgdj57d7jzg.jpg) +![alt tag](http://www.mediafire.com/convkey/0fc6/c5wd0rfxbc01xm7zg.jpg) +![alt tag](http://www.mediafire.com/convkey/a253/ur76bhb6doccomvzg.jpg) ## Licence diff --git a/pom.xml b/pom.xml index 7a5b34d94..7a3bfa2b4 100644 --- a/pom.xml +++ b/pom.xml @@ -190,6 +190,29 @@ RELEASE provided + + com.zaxxer + HikariCP-java7 + 2.4.11 + + + org.mockito + mockito-core + 2.7.22 + test + + + org.xerial + sqlite-jdbc + RELEASE + test + + + ch.vorburger.mariaDB4j + mariaDB4j + 2.2.2 + test + diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java new file mode 100644 index 000000000..9980b2e94 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java @@ -0,0 +1,119 @@ +package com.github.shynixn.petblocks.business.logic.persistence2; + +import com.github.shynixn.petblocks.lib.util.DbConnectionContext; +import com.github.shynixn.petblocks.lib.util.IDatabaseController; +import com.github.shynixn.petblocks.lib.util.SQLProvider; +import org.apache.commons.io.IOUtils; +import org.bukkit.Bukkit; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.plugin.Plugin; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.regex.Pattern; + +/** + * Created by Shynixn + */ +public class Factory { + + private static DbConnectionContext connectionContext; + private static SQLProvider sqlProvider; + + public static IPetDataController createPetDataController() { + if (sqlProvider == null) + throw new IllegalArgumentException("Factory is disabled!"); + if (Bukkit.getServer() != null && Bukkit.getServer().isPrimaryThread()) + throw new IllegalArgumentException("Cannot open controller on main thread."); + return new PetRepository(connectionContext, sqlProvider); + } + + public static IDatabaseController createPlayerDataController() { + if (sqlProvider == null) + throw new IllegalArgumentException("Factory is disabled!"); + if (Bukkit.getServer() != null && Bukkit.getServer().isPrimaryThread()) + throw new IllegalArgumentException("Cannot open controller on main thread."); + return new PlayerDataRepository(connectionContext, sqlProvider); + } + + public static synchronized void enable(final Plugin plugin) { + if (sqlProvider != null) + return; + sqlProvider = new SQLProvider() { + @Override + protected String readStringFromFile(String fileName) throws IOException { + System.out.println("FILE: " + "sql/" + fileName + ".sql"); + try (InputStream stream = plugin.getResource("sql/" + fileName + ".sql")) { + return IOUtils.toString(stream, "UTF-8"); + } + } + }; + if (plugin.getConfig().getBoolean("sql.local")) { + try { + System.out.println("DATAFOLDER: " + plugin.getDataFolder()); + if (!plugin.getDataFolder().exists()) + plugin.getDataFolder().mkdir(); + File file = new File(plugin.getDataFolder(), "PetBlocks.db"); + if (!file.exists()) + file.createNewFile(); + connectionContext = DbConnectionContext.from("org.sqlite.JDBC", "jdbc:sqlite:" + file.getAbsolutePath()); + try(Connection connection = connectionContext.getConnection()) + { + connectionContext.execute("PRAGMA foreign_keys=ON", connection); + } catch (SQLException e) { + e.printStackTrace(); + } + } catch (IOException e) { + e.printStackTrace(); + } + try { + + try (Connection connection = connectionContext.getConnection()) { + for (String data : sqlProvider.getString("create-sqlite").split(Pattern.quote(";"))) { + connectionContext.executeUpdate(data, connection); + } + } catch (Exception e) { + e.printStackTrace(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } else { + + FileConfiguration c = plugin.getConfig(); + try { + connectionContext = DbConnectionContext.from("com.mysql.jdbc.Driver", "jdbc:mysql://" + , c.getString("sql.host") + , c.getInt("sql.port") + , c.getString("sql.database") + , c.getString("sql.username") + , c.getString("sql.password")); + } catch (IOException e) { + e.printStackTrace(); + } + try { + + try (Connection connection = connectionContext.getConnection()) { + connectionContext.executeUpdate(sqlProvider.getString("create-mysql"), connection); + } catch (IOException e) { + e.printStackTrace(); + } + } catch (SQLException e) { + e.printStackTrace(); + } + } + + } + + public static synchronized void disable() { + if (connectionContext != null) + connectionContext.close(); + if (sqlProvider != null) + sqlProvider.clear(); + sqlProvider = null; + connectionContext = null; + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java new file mode 100644 index 000000000..3a331d6d3 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java @@ -0,0 +1,16 @@ +package com.github.shynixn.petblocks.business.logic.persistence2; + +import com.github.shynixn.petblocks.lib.util.IDatabaseController; +import org.bukkit.entity.Player; + +/** + * Created by Shynixn + */ +public interface IPetDataController extends IDatabaseController { + /** + * Returns the petdata from the given player + * @param player player + * @return petData + */ + PetData getByPlayer(Player player); +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java new file mode 100644 index 000000000..e3bea7f84 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java @@ -0,0 +1,45 @@ +package com.github.shynixn.petblocks.business.logic.persistence2; + +import java.sql.ResultSet; +import java.sql.SQLException; + +/** + * Created by Shynixn + */ +public class PetData { + + private long id; + private String name; + private long playerId; + + public long getPlayerId() { + return this.playerId; + } + + public void setPlayerId(long playerId) { + this.playerId = playerId; + } + + public long getId() { + return this.id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public static PetData from(ResultSet resultSet) throws SQLException { + final PetData petData = new PetData(); + petData.setId(resultSet.getLong("id")); + petData.setName(resultSet.getString("name")); + return petData; + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetDataCommandExecutor.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetDataCommandExecutor.java new file mode 100644 index 000000000..f729e8a62 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetDataCommandExecutor.java @@ -0,0 +1,68 @@ +package com.github.shynixn.petblocks.business.logic.persistence2; + +import com.github.shynixn.petblocks.api.PetBlocksApi; +import com.github.shynixn.petblocks.api.entities.PetBlock; +import com.github.shynixn.petblocks.business.Config; +import com.github.shynixn.petblocks.business.Language; +import com.github.shynixn.petblocks.business.Permission; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; +import com.github.shynixn.petblocks.lib.DynamicCommandHelper; +import com.github.shynixn.petblocks.lib.util.IDatabaseController; +import org.bukkit.Bukkit; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; + +/** + * Created by Shynixn + */ +public class PetDataCommandExecutor extends DynamicCommandHelper{ + + private Plugin plugin; + + PetDataCommandExecutor(Plugin plugin) { + super(ConfigCommands.getInstance().getPetblockGuiCommandContainer()); + } + + @Override + public void onCommandSend(CommandSender sender, String[] args) { + if (!(sender instanceof Player)) + return; + final Player player = (Player) sender; + if (!Config.getInstance().allowPetSpawning(player.getLocation())) + return; + else if (args.length == 2 && args[0].equalsIgnoreCase("rename") && player.hasPermission(Permission.RENAMEPET.get())) { + if (args[1].length() > ConfigPet.getInstance().getDesign_maxPetNameLength()) + player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); + else { + Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() { + @Override + public void run() { + try(IDatabaseController controller = Factory.createPetDataController()) + { + + + player.sendMessage(Language.PREFIX + Language.NAME_SUCCES_MESSAGE); + } catch (Exception e) { + player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); + } + } + }); + + + + try { + if (PetBlocksApi.hasPetMeta(player)) + PetBlocksApi.getPetMeta(player).setDisplayName(args[1]); + final PetBlock petBlock; + if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) + petBlock.respawn(); + + } catch (final Exception e) { + + } + } + } + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java new file mode 100644 index 000000000..13e5779ab --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java @@ -0,0 +1,228 @@ +package com.github.shynixn.petblocks.business.logic.persistence2; + +import com.github.shynixn.petblocks.lib.util.DataBaseRepository; +import com.github.shynixn.petblocks.lib.util.DbConnectionContext; +import com.github.shynixn.petblocks.lib.util.SQLProvider; +import org.bukkit.entity.Player; + +import java.io.Closeable; +import java.io.IOException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Shynixn + */ +public class PetRepository extends DataBaseRepository implements IPetDataController { + + private DbConnectionContext dbContext; + private SQLProvider sqlProvider; + + PetRepository(DbConnectionContext dbContext, SQLProvider sqlProvider) { + super(); + this.dbContext = dbContext; + this.sqlProvider = sqlProvider; + } + + + /** + * Returns the petdata from the given player + * + * @param player player + * @return petData + */ + @Override + public PetData getByPlayer(Player player) { + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("petblock/selectbyplayer"), connection, + player.getUniqueId().toString())) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + return PetData.from(resultSet); + } + } + } + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * Returns the item of the given id + * + * @param id id + * @return item + */ + @Override + public PetData getById(long id) { + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("petblock/selectbyid"), connection, + id)) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + return PetData.from(resultSet); + } + } + } + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * Checks if the item has got an valid databaseId + * + * @param item item + * @return hasGivenId + */ + @Override + public boolean hasId(PetData item) { + return item.getId() != 0; + } + + /** + * Selects all items from the database into the list + * + * @return listOfItems + */ + @Override + public List select() { + final List petList = new ArrayList<>(); + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("petblock/selectall"), connection)) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + final PetData petData = PetData.from(resultSet); + petList.add(petData); + } + } + } + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + return petList; + } + + /** + * Updates the item inside of the database + * + * @param item item + */ + @Override + public void update(PetData item) { + try (Connection connection = this.dbContext.getConnection()) { + this.dbContext.executeUpdate(this.sqlProvider.getString("petblock/update"), connection, + item.getName(), + item.getId()); + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + } + + /** + * Deletes the item from the database + * + * @param item item + */ + @Override + public void delete(PetData item) { + try (Connection connection = this.dbContext.getConnection()) { + this.dbContext.executeUpdate(this.sqlProvider.getString("petblock/delete"), connection, + item.getId()); + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + } + + /** + * Inserts the item into the database and sets the id + * + * @param item item + */ + @Override + public void insert(PetData item) { + try (Connection connection = this.dbContext.getConnection()) { + final long id = this.dbContext.executeInsert(this.sqlProvider.getString("petblock/insert"), connection, + item.getName(), item.getPlayerId()); + item.setId(id); + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + } + + /** + * Returns the amount of items in the repository + */ + @Override + public int size() { + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("petblock/count"), connection)) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + return resultSet.getInt(1); + } + } + } + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + return 0; + } + + /** + * Closes this resource, relinquishing any underlying resources. + * This method is invoked automatically on objects managed by the + * {@code try}-with-resources statement. + *

+ *

While this interface method is declared to throw {@code + * Exception}, implementers are strongly encouraged to + * declare concrete implementations of the {@code close} method to + * throw more specific exceptions, or to throw no exception at all + * if the close operation cannot fail. + *

+ *

Cases where the close operation may fail require careful + * attention by implementers. It is strongly advised to relinquish + * the underlying resources and to internally mark the + * resource as closed, prior to throwing the exception. The {@code + * close} method is unlikely to be invoked more than once and so + * this ensures that the resources are released in a timely manner. + * Furthermore it reduces problems that could arise when the resource + * wraps, or is wrapped, by another resource. + *

+ *

Implementers of this interface are also strongly advised + * to not have the {@code close} method throw {@link + * InterruptedException}. + *

+ * This exception interacts with a thread's interrupted status, + * and runtime misbehavior is likely to occur if an {@code + * InterruptedException} is {@linkplain Throwable#addSuppressed + * suppressed}. + *

+ * More generally, if it would cause problems for an + * exception to be suppressed, the {@code AutoCloseable.close} + * method should not throw it. + *

+ *

Note that unlike the {@link Closeable#close close} + * method of {@link Closeable}, this {@code close} method + * is not required to be idempotent. In other words, + * calling this {@code close} method more than once may have some + * visible side effect, unlike {@code Closeable.close} which is + * required to have no effect if called more than once. + *

+ * However, implementers of this interface are strongly encouraged + * to make their {@code close} methods idempotent. + * + * @throws Exception if this resource cannot be closed + */ + @Override + public void close() throws Exception { + this.dbContext = null; + this.sqlProvider = null; + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java new file mode 100644 index 000000000..e48cf0bff --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java @@ -0,0 +1,55 @@ +package com.github.shynixn.petblocks.business.logic.persistence2; + +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.UUID; + +/** + * Created by Shynixn + */ +public class PlayerData { + + private long id; + private String name; + private UUID uuid; + + public long getId() { + return this.id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public UUID getUUID() { + return this.uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public Player getPlayer() + { + return Bukkit.getPlayer(this.uuid); + } + + public static PlayerData from(ResultSet resultSet) throws SQLException { + PlayerData playerStats = new PlayerData(); + playerStats.id = resultSet.getLong("id"); + playerStats.name = resultSet.getString("name"); + playerStats.uuid = UUID.fromString(resultSet.getString("uuid")); + return playerStats; + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerDataRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerDataRepository.java new file mode 100644 index 000000000..66d356704 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerDataRepository.java @@ -0,0 +1,203 @@ +package com.github.shynixn.petblocks.business.logic.persistence2; + +import com.github.shynixn.petblocks.lib.util.DataBaseRepository; +import com.github.shynixn.petblocks.lib.util.DbConnectionContext; +import com.github.shynixn.petblocks.lib.util.SQLProvider; + +import java.io.Closeable; +import java.io.IOException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Shynixn + */ +public class PlayerDataRepository extends DataBaseRepository{ + + private DbConnectionContext dbContext; + private SQLProvider sqlProvider; + + PlayerDataRepository(DbConnectionContext dbContext, SQLProvider sqlProvider) { + super(); + this.dbContext = dbContext; + this.sqlProvider = sqlProvider; + } + + /** + * Returns the item of the given id + * + * @param id id + * @return item + */ + @Override + public PlayerData getById(long id) { + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("selectbyid"), connection, + id)) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + return PlayerData.from(resultSet); + } + } + } + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * Checks if the item has got an valid databaseId + * + * @param item item + * @return hasGivenId + */ + @Override + public boolean hasId(PlayerData item) { + return item.getId() != 0; + } + + /** + * Selects all items from the database into the list + * + * @return listOfItems + */ + @Override + public List select() { + final List playerList = new ArrayList<>(); + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("player/selectall"), connection)) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + playerList.add(PlayerData.from(resultSet)); + } + } + } + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + return playerList; + } + + /** + * Updates the item inside of the database + * + * @param item item + */ + @Override + public void update(PlayerData item) { + try (Connection connection = this.dbContext.getConnection()) { + this.dbContext.executeUpdate(this.sqlProvider.getString("player/update"), connection, + item.getName(), + item.getId()); + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + } + + /** + * Deletes the item from the database + * + * @param item item + */ + @Override + public void delete(PlayerData item) { + try (Connection connection = this.dbContext.getConnection()) { + this.dbContext.executeUpdate(this.sqlProvider.getString("player/delete"), connection, + item.getId()); + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + } + + /** + * Inserts the item into the database and sets the id + * + * @param item item + */ + @Override + public void insert(PlayerData item) { + try (Connection connection = this.dbContext.getConnection()) { + final long id = this.dbContext.executeInsert(this.sqlProvider.getString("player/insert"), connection, + item.getName(), item.getUUID().toString()); + item.setId(id); + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + } + + /** + * Returns the amount of items in the repository + */ + @Override + public int size() { + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("player/count"), connection)) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + return resultSet.getInt(1); + } + } + } + } catch (SQLException | IOException e) { + e.printStackTrace(); + } + return 0; + } + + + /** + * Closes this resource, relinquishing any underlying resources. + * This method is invoked automatically on objects managed by the + * {@code try}-with-resources statement. + *

+ *

While this interface method is declared to throw {@code + * Exception}, implementers are strongly encouraged to + * declare concrete implementations of the {@code close} method to + * throw more specific exceptions, or to throw no exception at all + * if the close operation cannot fail. + *

+ *

Cases where the close operation may fail require careful + * attention by implementers. It is strongly advised to relinquish + * the underlying resources and to internally mark the + * resource as closed, prior to throwing the exception. The {@code + * close} method is unlikely to be invoked more than once and so + * this ensures that the resources are released in a timely manner. + * Furthermore it reduces problems that could arise when the resource + * wraps, or is wrapped, by another resource. + *

+ *

Implementers of this interface are also strongly advised + * to not have the {@code close} method throw {@link + * InterruptedException}. + *

+ * This exception interacts with a thread's interrupted status, + * and runtime misbehavior is likely to occur if an {@code + * InterruptedException} is {@linkplain Throwable#addSuppressed + * suppressed}. + *

+ * More generally, if it would cause problems for an + * exception to be suppressed, the {@code AutoCloseable.close} + * method should not throw it. + *

+ *

Note that unlike the {@link Closeable#close close} + * method of {@link Closeable}, this {@code close} method + * is not required to be idempotent. In other words, + * calling this {@code close} method more than once may have some + * visible side effect, unlike {@code Closeable.close} which is + * required to have no effect if called more than once. + *

+ * However, implementers of this interface are strongly encouraged + * to make their {@code close} methods idempotent. + * + * @throws Exception if this resource cannot be closed + */ + @Override + public void close() throws Exception { + this.dbContext = null; + this.sqlProvider = null; + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/DataBaseRepository.java b/src/main/java/com/github/shynixn/petblocks/lib/util/DataBaseRepository.java new file mode 100644 index 000000000..63112a5d7 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/lib/util/DataBaseRepository.java @@ -0,0 +1,104 @@ +package com.github.shynixn.petblocks.lib.util; + +import java.util.Collections; +import java.util.List; + +/** + * Copyright 2017 Shynixn + *

+ * Do not remove this header! + *

+ * Version 1.0 + *

+ * MIT License + *

+ * Copyright (c) 2017 + *

+ * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + *

+ * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + *

+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +public abstract class DataBaseRepository implements IDatabaseController { + /** + * Stores a new a item in the repository + * + * @param item item + */ + @Override + public void store(T item) { + if (this.hasId(item)) + this.update(item); + else + this.insert(item); + } + + /** + * Removes an item from the repository + * + * @param item item + */ + @Override + public void remove(T item) { + this.delete(item); + } + + /** + * Returns all items from the repository as unmodifiableList + * + * @return items + */ + @Override + public List getAll() { + return Collections.unmodifiableList(this.select()); + } + + /** + * Checks if the item has got an valid databaseId + * + * @param item item + * @return hasGivenId + */ + public abstract boolean hasId(T item); + + /** + * Selects all items from the database into the list + * + * @return listOfItems + */ + public abstract List select(); + + /** + * Updates the item inside of the database + * + * @param item item + */ + public abstract void update(T item); + + /** + * Deletes the item from the database + * + * @param item item + */ + public abstract void delete(T item); + + /** + * Inserts the item into the database and sets the id + * + * @param item item + */ + public abstract void insert(T item); +} \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/DbConnectionContext.java b/src/main/java/com/github/shynixn/petblocks/lib/util/DbConnectionContext.java new file mode 100644 index 000000000..e2aeb5818 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/lib/util/DbConnectionContext.java @@ -0,0 +1,253 @@ +package com.github.shynixn.petblocks.lib.util; + +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; + +import java.io.IOException; +import java.sql.*; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Copyright 2017 Shynixn + *

+ * Do not remove this header! + *

+ * Version 1.0 + *

+ * MIT License + *

+ * Copyright (c) 2017 + *

+ * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + *

+ * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + *

+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +public class DbConnectionContext implements AutoCloseable { + + private HikariDataSource ds; + + /** + * Initializes a new databaseConnectionContext for the given url, userName and password + * + * @param url url + * @param userName userName + * @param password password + */ + private DbConnectionContext(String driver, String url, String userName, String password) { + super(); + System.out.println("URL: " + url); + final HikariConfig config = new HikariConfig(); + config.setDriverClassName(driver); + config.setConnectionTestQuery("SELECT 1"); + config.setJdbcUrl(url); + if(userName != null) + config.setUsername(userName); + if(password != null) + config.setPassword(password); + config.addDataSourceProperty("cachePrepStmts", "true"); + config.addDataSourceProperty("prepStmtCacheSize", "250"); + config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); + config.setMaximumPoolSize(10); + this.ds = new HikariDataSource(config); + } + + /** + * Provides an connection to the database which has to be closed after being used + * + * @return connection + * @throws SQLException exception + */ + public Connection getConnection() throws SQLException { + return this.ds.getConnection(); + } + + /** + * Sets the parameters of the preparedStatement + * + * @param preparedStatement preparedStatement + * @param parameters parameters + * @throws SQLException exception + */ + private void setParameters(PreparedStatement preparedStatement, Object[] parameters) throws SQLException { + for (int i = 0; i < parameters.length; i++) { + preparedStatement.setObject(i + 1, parameters[i]); + } + } + + /** + * Executes a preparedStatement and sets the given parameters to the statement + * + * @param sql sql + * @param connection connection + * @param parameters parameters + * @return success + * @throws SQLException exception + */ + public boolean execute(String sql, Connection connection, Object... parameters) throws SQLException { + if (sql == null) + throw new IllegalArgumentException("Sql cannot be null!"); + if (connection == null) + throw new IllegalArgumentException("Connection cannot be null!"); + if (connection.isClosed()) + throw new IllegalArgumentException("Connection is closed. Cannot create statement!"); + try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) { + this.setParameters(preparedStatement, parameters); + return preparedStatement.execute(); + } + } + + /** + * Executes a preparedStatement and sets the given parameters to the statement + * + * @param sql sql + * @param connection connection + * @param parameters parameters + * @return resultSet + * @throws SQLException exception + */ + public PreparedStatement executeQuery(String sql, Connection connection, Object... parameters) throws SQLException { + if (sql == null) + throw new IllegalArgumentException("Sql cannot be null!"); + if (connection == null) + throw new IllegalArgumentException("Connection cannot be null!"); + if (connection.isClosed()) + throw new IllegalArgumentException("Connection is closed. Cannot create statement!"); + final PreparedStatement preparedStatement = connection.prepareStatement(sql); + this.setParameters(preparedStatement, parameters); + return preparedStatement; + } + + /** + * Executes a preparedStatement and sets the given parameters to the statement + * + * @param sql sql + * @param connection connection + * @param parameters parameters + * @return resultCode + * @throws SQLException exception + */ + public int executeUpdate(String sql, Connection connection, Object... parameters) throws SQLException { + System.out.println("SQL: " + sql); + if (sql == null) + throw new IllegalArgumentException("Sql cannot be null!"); + if (connection == null) + throw new IllegalArgumentException("Connection cannot be null!"); + if (connection.isClosed()) + throw new IllegalArgumentException("Connection is closed. Cannot create statement!"); + try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) { + this.setParameters(preparedStatement, parameters); + return preparedStatement.executeUpdate(); + } + } + + /** + * Executes a preparedStatement and sets the given parameters to the statement + * + * @param sql sql + * @param connection connection + * @param parameters parameters + * @return id + * @throws SQLException exception + */ + public int executeInsert(String sql, Connection connection, Object... parameters) throws SQLException { + if (sql == null) + throw new IllegalArgumentException("Sql cannot be null!"); + if (connection == null) + throw new IllegalArgumentException("Connection cannot be null!"); + if (connection.isClosed()) + throw new IllegalArgumentException("Connection is closed. Cannot create statement!"); + try (PreparedStatement preparedStatement = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS)) { + this.setParameters(preparedStatement, parameters); + preparedStatement.executeUpdate(); + try (ResultSet resultSet = preparedStatement.getGeneratedKeys()) { + resultSet.next(); + return resultSet.getInt(1); + } + } + } + + /** + * Closes the database context + */ + @Override + public void close() { + if (this.ds != null && !this.ds.isClosed()) { + this.ds.close(); + this.ds = null; + } + } + + /** + * Opens a new DatabaseContext for the given url + * @param driver driver + * @param url url + * @return DbConnectionContext + * @throws IOException exception + */ + public static DbConnectionContext from(String driver, String url) throws IOException { + if (driver == null) + throw new IllegalArgumentException("Driver cannot be null!"); + if (url == null) + throw new IllegalArgumentException("Database cannot be null!"); + try { + Class.forName(driver); + return new DbConnectionContext(driver, url, null, null); + } catch (final ClassNotFoundException ex) { + Logger.getLogger(DbConnectionContext.class.getSimpleName()).log(Level.WARNING, "JDBC Driver not found!"); + throw new IOException(ex); + } catch (final Exception ex) { + Logger.getLogger(DbConnectionContext.class.getSimpleName()).log(Level.WARNING, "Cannot connect to database!"); + throw new IOException(ex); + } + } + + /** + * Opens a new DatabaseContext for the given ip, port, database, username and password + * + * @param driver driver + * @param ip ip + * @param port port + * @param database database + * @param userName userName + * @param password password + * @return DbConnectionContext + * @throws IOException exception + */ + public static DbConnectionContext from(String driver, String urlPrefix, String ip, int port, String database, String userName, String password) throws IOException { + if (driver == null) + throw new IllegalArgumentException("Driver cannot be null!"); + if (ip == null) + throw new IllegalArgumentException("Ip cannot be null!"); + if (database == null) + throw new IllegalArgumentException("Database cannot be null!"); + if (userName == null) + throw new IllegalArgumentException("Username cannot be null!"); + if (password == null) + throw new IllegalArgumentException("Password cannot be null!"); + try { + Class.forName(driver); + return new DbConnectionContext(driver, urlPrefix + ip + ':' + port + '/' + database, userName, password); + } catch (final ClassNotFoundException ex) { + Logger.getLogger(DbConnectionContext.class.getSimpleName()).log(Level.WARNING, "JDBC Driver not found!"); + throw new IOException(ex); + } catch (final Exception ex) { + Logger.getLogger(DbConnectionContext.class.getSimpleName()).log(Level.WARNING, "Cannot connect to database!"); + throw new IOException(ex); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/IController.java b/src/main/java/com/github/shynixn/petblocks/lib/util/IController.java new file mode 100644 index 000000000..83e1928a2 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/lib/util/IController.java @@ -0,0 +1,60 @@ +package com.github.shynixn.petblocks.lib.util; + +import java.util.List; + +/** + * Copyright 2017 Shynixn + *

+ * Do not remove this header! + *

+ * Version 1.0 + *

+ * MIT License + *

+ * Copyright (c) 2017 + *

+ * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + *

+ * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + *

+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +public interface IController extends AutoCloseable { + /** + * Stores a new a item in the repository + * + * @param item item + */ + void store(T item); + + /** + * Removes an item from the repository + * + * @param item item + */ + void remove(T item); + + /** + * Returns the amount of items in the repository + */ + int size(); + + /** + * Returns all items from the repository as unmodifiableList + * + * @return items + */ + List getAll(); +} \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/IDatabaseController.java b/src/main/java/com/github/shynixn/petblocks/lib/util/IDatabaseController.java new file mode 100644 index 000000000..69114dd1a --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/lib/util/IDatabaseController.java @@ -0,0 +1,40 @@ +package com.github.shynixn.petblocks.lib.util; + +/** + * Copyright 2017 Shynixn + *

+ * Do not remove this header! + *

+ * Version 1.0 + *

+ * MIT License + *

+ * Copyright (c) 2017 + *

+ * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + *

+ * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + *

+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +public interface IDatabaseController extends IController { + /** + * Returns the item of the given id + * + * @param id id + * @return item + */ + T getById(long id); +} \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/ParticleEffectBuilder.java b/src/main/java/com/github/shynixn/petblocks/lib/util/ParticleEffectBuilder.java new file mode 100644 index 000000000..4bb62a60b --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/lib/util/ParticleEffectBuilder.java @@ -0,0 +1,1046 @@ +package com.github.shynixn.petblocks.lib.util; + +import org.bukkit.*; +import org.bukkit.configuration.serialization.ConfigurationSerializable; +import org.bukkit.entity.Player; + +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * Copyright 2017 Shynixn + *

+ * Do not remove this header! + *

+ * Version 1.0 + *

+ * MIT License + *

+ * Copyright (c) 2016 + *

+ * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + *

+ * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + *

+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +public class ParticleEffectBuilder implements ConfigurationSerializable { + private String effect; + private int amount; + private double speed; + private double x; + private double y; + private double z; + + private Integer material; + private Byte data; + + /** + * Initializes a new ParticleEffectBuilder + */ + public ParticleEffectBuilder() { + super(); + } + + /** + * Initializes a new ParticleEffectBuilder with the given params + * + * @param effectName effect + * @param amount amount + * @param speed speed + * @param x x + * @param y y + * @param z u + */ + public ParticleEffectBuilder(String effectName, int amount, double speed, double x, double y, double z) { + super(); + if (effectName == null) + throw new IllegalArgumentException("Effect cannot be null!"); + if (amount < 0) + throw new IllegalArgumentException("Amount cannot be less than 0"); + if (getParticleEffectFromName(effectName) == null) + throw new IllegalArgumentException("Cannot find particleEffect for name!"); + this.effect = effectName; + this.amount = amount; + this.speed = speed; + this.x = x; + this.y = y; + this.z = z; + } + + /** + * Parses the potioneffect out of the map + * + * @param items items + * @throws Exception mapParseException + */ + public ParticleEffectBuilder(Map items) throws Exception { + super(); + this.effect = (String) items.get("effect"); + this.amount = (int) items.get("amount"); + this.speed = (double) items.get("speed"); + this.x = (double) items.get("size.x"); + this.y = (double) items.get("size.y"); + this.z = (double) items.get("size.z"); + if (items.containsKey("block.material")) + this.material = (Integer) items.get("block.material"); + if (items.containsKey("block.damage")) + this.data = (Byte) items.get("block.damage"); + } + + /** + * Sets the RGB colors of the particleEffect + * + * @param red red + * @param green green + * @param blue blue + * @return builder + */ + public ParticleEffectBuilder setColor(int red, int green, int blue) { + this.setRed(red); + this.setBlue(blue); + this.setGreen(green); + this.setAmount(0); + return this; + } + + /** + * Sets the color of the particleEffect + * + * @param particleColor particleColor + * @return builder + */ + public ParticleEffectBuilder setColor(ParticleColor particleColor) { + if (particleColor == null) + throw new IllegalArgumentException("Color cannot be null!"); + this.setColor(particleColor.getRed(), particleColor.getGreen(), particleColor.getBlue()); + return this; + } + + /** + * Sets the color for note particleEffect + * + * @param color color + * @return builder + */ + public ParticleEffectBuilder setNoteColor(int color) { + if (color > 20 || color < 0) + this.x = 5; + else + this.x = color; + return this; + } + + /** + * Sets the amount of particles of the particleEffect + * + * @param amount amount + * @return builder + */ + public ParticleEffectBuilder setAmount(int amount) { + if (amount < 0) + throw new IllegalArgumentException("Amount cannot be less than 0"); + this.amount = amount; + return this; + } + + /** + * Sets the speed of the particleEffect + * + * @param speed speed + * @return builder + */ + public ParticleEffectBuilder setSpeed(double speed) { + this.speed = speed; + return this; + } + + /** + * Sets the x coordinate of the particleEffect + * + * @param x x + * @return builder + */ + public ParticleEffectBuilder setX(double x) { + this.x = x; + return this; + } + + /** + * Sets the y coordinate of the particleEffect + * + * @param y y + * @return builder + */ + public ParticleEffectBuilder setY(double y) { + this.y = y; + return this; + } + + /** + * Sets the z coordinate of the particleEffect + * + * @param z z + * @return builder + */ + public ParticleEffectBuilder setZ(double z) { + this.z = z; + return this; + } + + /** + * Sets the effectType of the particleEffect + * + * @param name name + * @return builder + */ + public ParticleEffectBuilder setEffectName(String name) { + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + this.effect = name; + return this; + } + + /** + * Sets the effectType of the particlEffect + * + * @param type type + * @return builder + */ + public ParticleEffectBuilder setEffectType(ParticleEffectType type) { + if (type == null) + throw new IllegalArgumentException("Type cannot be null!"); + this.effect = type.getSimpleName(); + return this; + } + + /** + * Sets the blue of the RGB color + * + * @param blue blue + * @return builder + */ + public ParticleEffectBuilder setBlue(int blue) { + this.z = (double) blue / 255.0; + return this; + } + + /** + * Sets the red of the RGB color + * + * @param red red + * @return builder + */ + public ParticleEffectBuilder setRed(int red) { + this.x = (double) red / 255.0; + if (red == 0) + this.x = Float.MIN_NORMAL; + return this; + } + + /** + * Sets the green of the RGB color + * + * @param green green + * @return builder + */ + public ParticleEffectBuilder setGreen(int green) { + this.y = green / 255.0; + return this; + } + + /** + * Sets the material of the particleEffect + * + * @param material material + * @return builder + */ + public ParticleEffectBuilder setMaterial(Material material) { + if (material == null) + throw new IllegalArgumentException("Material cannot be null!"); + this.material = material.getId(); + return this; + } + + /** + * Sets the data of the material of the particleEffect + * + * @param data data + * @return builder + */ + public ParticleEffectBuilder setData(Byte data) { + this.data = data; + return this; + } + + /** + * Returns the effect of the particleEffect + * + * @return effectName + */ + public String getEffectName() { + return this.effect; + } + + /** + * Returns the particleEffectType of the particleEffect + * + * @return effectType + */ + public ParticleEffectType getEffectType() { + return getParticleEffectFromName(this.effect); + } + + /** + * Returns the amount of particles of the particleEffect + * + * @return amount + */ + public int getAmount() { + return this.amount; + } + + /** + * Returns the speed of the particleEffect + * + * @return speed + */ + public double getSpeed() { + return this.speed; + } + + /** + * Returns the x coordinate of the particleEffect + * + * @return x + */ + public double getX() { + return this.x; + } + + /** + * Returns the y coordinate of the particleEffect + * + * @return y + */ + public double getY() { + return this.y; + } + + /** + * Returns the z coordinate of the particleEffect + * + * @return z + */ + public double getZ() { + return this.z; + } + + /** + * Returns the RGB color blue of the particleEffect + * + * @return blue + */ + public int getBlue() { + return (int) this.z * 255; + } + + /** + * Returns the RGB color red of the particleEffect + * + * @return red + */ + public int getRed() { + return (int) this.x * 255; + } + + /** + * Returns the RGB color green of the particleEffect + * + * @return green + */ + public int getGreen() { + return (int) this.y * 255; + } + + /** + * Returns the material of the particleEffect + * + * @return material + */ + public Material getMaterial() { + if (this.material == null || Material.getMaterial(this.material) == null) + return null; + return Material.getMaterial(this.material); + } + + /** + * Returns the data of the particleEffect + * + * @return data + */ + public Byte getData() { + return this.data; + } + + /** + * Copies the current builder + * + * @return copyOfBuilder + */ + public ParticleEffectBuilder copy() { + final ParticleEffectBuilder particle = new ParticleEffectBuilder(); + particle.effect = this.effect; + particle.amount = this.amount; + particle.x = this.x; + particle.y = this.y; + particle.z = this.z; + particle.speed = this.speed; + particle.material = this.material; + particle.data = this.data; + return particle; + } + + /** + * Converts the effect to a bukkitParticle + * + * @param clazz Clazz to be given for compatibility + * @param Particle + * @return bukkitParticle + */ + public > T toParticle(Class clazz) { + if(clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + for (final Object item : clazz.getEnumConstants()) { + final Enum eItem = (Enum) item; + if (eItem.name().equalsIgnoreCase(this.effect)) + return (T) eItem; + } + return null; + } + + /** + * Returns if the particleEffect is a color particleEffect + * + * @return isColor + */ + public boolean isColorParticleEffect() { + return this.effect.equalsIgnoreCase(ParticleEffectType.SPELL_MOB.getSimpleName()) + || this.effect.equalsIgnoreCase(ParticleEffectType.SPELL_MOB_AMBIENT.getSimpleName()) + || this.effect.equalsIgnoreCase(ParticleEffectType.REDSTONE.getSimpleName()) + || this.effect.equalsIgnoreCase(ParticleEffectType.NOTE.getSimpleName()); + } + + /** + * Returns if the particleEffect is a note particleEffect + * + * @return isNote + */ + public boolean isNoteParticleEffect() { + return this.effect.equalsIgnoreCase(ParticleEffectType.NOTE.getSimpleName()); + } + + /** + * Returns if the particleEffect is a materialParticleEffect + * + * @return isMaterial + */ + public boolean isMaterialParticleEffect() { + return this.effect.equalsIgnoreCase(ParticleEffectType.BLOCK_CRACK.getSimpleName()) + || this.effect.equalsIgnoreCase(ParticleEffectType.BLOCK_DUST.getSimpleName()) + || this.effect.equalsIgnoreCase(ParticleEffectType.ITEM_CRACK.getSimpleName()); + } + + /** + * Plays the effect at the given location to the given players. + * + * @param location location + * @param players players + */ + public void apply(Location location, Player... players) { + if(location == null) + throw new IllegalArgumentException("Location cannot be null!"); + if (players.length == 0) + ParticleUtils.sendParticle(this, location); + else + ParticleUtils.sendParticle(this, location, players); + } + + /** + * Checks if 2 builders are equal + * + * @param o secondBuilder + * @return isSame + */ + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + final ParticleEffectBuilder that = (ParticleEffectBuilder) o; + return this.amount == that.amount + && Double.compare(that.speed, this.speed) == 0 + && Double.compare(that.x, this.x) == 0 + && Double.compare(that.y, this.y) == 0 + && Double.compare(that.z, this.z) == 0 + & (this.effect != null ? this.effect.equals(that.effect) : that.effect == null) + && this.material == that.material && (this.data != null ? this.data.equals(that.data) : that.data == null); + } + + /** + * Displays the builder as string + * + * @return string + */ + @Override + public String toString() { + return "effect {" + "name " + this.effect + " amound " + this.amount + " speed " + this.speed + "}"; + } + + /** + * Serializes the particleEffect data to be stored to the filesystem + * + * @return serializedContent + */ + @Override + public Map serialize() { + final Map map = new LinkedHashMap<>(); + map.put("effect", this.effect.toUpperCase()); + map.put("amount", this.amount); + map.put("speed", this.speed); + final Map tmp3 = new LinkedHashMap<>(); + tmp3.put("x", this.x); + tmp3.put("y", this.y); + tmp3.put("z", this.z); + map.put("size", tmp3); + final Map tmp2 = new LinkedHashMap<>(); + if (this.material != null) + tmp2.put("material", this.material); + else + tmp2.put("material", null); + tmp2.put("damage", this.data); + map.put("block", tmp2); + return map; + } + + /** + * Returns a text of all particleEffects to let the user easily view them + * + * @return potionEffects + */ + public static String getParticlesText() { + String s = ""; + for (final ParticleEffectType particleEffect : ParticleEffectType.values()) { + if (s.isEmpty()) + s += particleEffect.getSimpleName(); + else + s += ", " + particleEffect.getSimpleName(); + } + return s; + } + + /** + * Returns the particleEffectType from name + * + * @param name name + * @return particleEffectType + */ + public static ParticleEffectType getParticleEffectFromName(String name) { + for (final ParticleEffectType particleEffect : ParticleEffectType.values()) { + if (name != null && particleEffect.getSimpleName().equalsIgnoreCase(name)) + return particleEffect; + } + return null; + } + + /** + * ParticleColors + */ + public enum ParticleColor { + BLACK(0, 0, 0), + DARK_BLUE(0, 0, 170), + DARK_GREEN(0, 170, 0), + DARK_AQUA(0, 170, 170), + DARK_RED(170, 0, 0), + DARK_PURPLE(170, 0, 170), + GOLD(255, 170, 0), + GRAY(170, 170, 170), + DARK_GRAY(85, 85, 85), + BLUE(85, 85, 255), + GREEN(85, 255, 85), + AQUA(85, 255, 255), + RED(255, 85, 85), + LIGHT_PURPLE(255, 85, 255), + YELLOW(255, 255, 85), + WHITE(255, 255, 255); + + private final int red; + private final int green; + private final int blue; + + /** + * Initializes a new particleColor + * + * @param red red + * @param green green + * @param blue blue + */ + ParticleColor(int red, int green, int blue) { + this.red = red; + this.green = green; + this.blue = blue; + } + + /** + * Returns the RGB value red + * + * @return red + */ + public int getRed() { + return this.red; + } + + /** + * Returns the RGB value green + * + * @return green + */ + public int getGreen() { + return this.green; + } + + /** + * Returns the RGB value blue + * + * @return blue + */ + public int getBlue() { + return this.blue; + } + } + + /** + * ParticleEffectTypes + */ + public enum ParticleEffectType { + EXPLOSION_NORMAL("explode", 0), + EXPLOSION_LARGE("largeexplode", 1), + EXPLOSION_HUGE("hugeexplosion", 2), + FIREWORKS_SPARK("fireworksSpark", 3), + WATER_BUBBLE("bubble", 4), + WATER_SPLASH("splash", 5), + WATER_WAKE("wake", 6), + SUSPENDED("suspended", 7), + SUSPENDED_DEPTH("depthsuspend", 8), + CRIT("crit", 9), + CRIT_MAGIC("magicCrit", 10), + SMOKE_NORMAL("smoke", 11), + SMOKE_LARGE("largesmoke", 12), + SPELL("spell", 13), + SPELL_INSTANT("instantSpell", 14), + SPELL_MOB("mobSpell", 15), + SPELL_MOB_AMBIENT("mobSpellAmbient", 16), + SPELL_WITCH("witchMagic", 17), + DRIP_WATER("dripWater", 18), + DRIP_LAVA("dripLava", 19), + VILLAGER_ANGRY("angryVillager", 20), + VILLAGER_HAPPY("happyVillager", 21), + TOWN_AURA("townaura", 22), + NOTE("note", 23), + PORTAL("portal", 24), + ENCHANTMENT_TABLE("enchantmenttable", 25), + FLAME("flame", 26), + LAVA("lava", 27), + FOOTSTEP("footstep", 28), + CLOUD("cloud", 29), + REDSTONE("reddust", 30), + SNOWBALL("snowballpoof", 31), + SNOW_SHOVEL("snowshovel", 32), + SLIME("slime", 33), + HEART("heart", 34), + BARRIER("barrier", 35), + ITEM_CRACK("iconcrack", 36), + BLOCK_CRACK("blockcrack", 37), + BLOCK_DUST("blockdust", 38), + WATER_DROP("droplet", 39), + ITEM_TAKE("take", 40), + MOB_APPEARANCE("mobappearance", 41), + DRAGON_BREATH("dragonbreath", 42), + END_ROD("endRod", 43), + DAMAGE_INDICATOR("damageIndicator", 44), + SWEEP_ATTACK("sweepAttack", 45), + FALLING_DUST("fallingdust", 46), + TOTEM("totem", 47), + SPIT("spit", 48); + + private final String simpleName; + private final int id; + + /** + * Initializes a new particleEffectType + * + * @param name name + * @param id id + */ + ParticleEffectType(String name, int id) { + this.simpleName = name; + this.id = id; + } + + /** + * Returns the id of the particleEffectType + * + * @return id + */ + public int getId() { + return this.id; + } + + /** + * Returns the name of the particleEffectType + * + * @return name + */ + public String getSimpleName() { + return this.simpleName; + } + } + + /** + * Particle Utils + */ + private static class ParticleUtils { + + /** + * Sends a particleEffect + * + * @param builder builder + * @param location location + * @return hasBeenSend + */ + static boolean sendParticle(ParticleEffectBuilder builder, Location location) { + return sendParticle(builder, location, location.getWorld().getPlayers().toArray(new Player[location.getWorld().getPlayers().size()])); + } + + /** + * Sends a particleEffect + * + * @param builder builder + * @param location location + * @param players players + * @return hasBeenSend + */ + static boolean sendParticle(ParticleEffectBuilder builder, Location location, Player[] players) { + switch (getServerVersion()) { + case "v1_11_R1": + ParticleUtils11R1.sendParticle(builder, location, players); + break; + case "v1_10_R1": + ParticleUtils10R1.sendParticle(builder, location, players); + break; + case "v1_9_R2": + ParticleUtils9R2.sendParticle(builder, location, players); + break; + case "v1_9_R1": + ParticleUtils9R1.sendParticle(builder, location, players); + break; + case "v1_8_R3": + ParticleUtils8R3.sendParticle(builder, location, players); + break; + case "v1_8_R2": + ParticleUtils8R2.sendParticle(builder, location, players); + break; + case "v1_8_R1": + ParticleUtils8R1.sendParticle(builder, location, players); + break; + default: + return false; + } + return true; + } + + /** + * Checks if longDistance attribute is necessary + * + * @param location location + * @param players players + * @return isNecessary + */ + private static boolean isLongDistance(Location location, List players) { + for (final Player player : players) { + if (location.getWorld().getName().equals(player.getLocation().getWorld().getName()) + && player.getLocation().distanceSquared(location) > 65536) { + return true; + } + } + return false; + } + + /** + * Returns the server version. + * + * @return version + */ + private static String getServerVersion() { + return Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3]; + } + + static class ParticleUtils8R1 { + /** + * Sends a particleEffect for v1_8_R1 + * + * @param particleBuilder particleBuilder + * @param location location + * @param players players + */ + static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + final net.minecraft.server.v1_8_R1.EnumParticle particle = net.minecraft.server.v1_8_R1.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); + int[] additionalInfo = null; + if (particleBuilder.getMaterial() != null) { + if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; + else + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; + } + final net.minecraft.server.v1_8_R1.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_8_R1.PacketPlayOutWorldParticles( + particle, + isLongDistance(location, Arrays.asList(players)), + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + (float) particleBuilder.getX(), + (float) particleBuilder.getY(), + (float) particleBuilder.getZ(), + (float) particleBuilder.getSpeed(), + particleBuilder.getAmount(), + additionalInfo); + for (final Player player : players) { + ((org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); + } + } + } + + static class ParticleUtils8R2 { + /** + * Sends a particleEffect for v1_8_R2 + * + * @param particleBuilder particleBuilder + * @param location location + * @param players players + */ + static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + final net.minecraft.server.v1_8_R2.EnumParticle particle = net.minecraft.server.v1_8_R2.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); + int[] additionalInfo = null; + if (particleBuilder.getMaterial() != null) { + if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; + else + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; + } + final net.minecraft.server.v1_8_R2.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_8_R2.PacketPlayOutWorldParticles( + particle, + isLongDistance(location, Arrays.asList(players)), + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + (float) particleBuilder.getX(), + (float) particleBuilder.getY(), + (float) particleBuilder.getZ(), + (float) particleBuilder.getSpeed(), + particleBuilder.getAmount(), + additionalInfo); + for (final Player player : players) { + ((org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); + } + } + } + + static class ParticleUtils8R3 { + /** + * Sends a particleEffect for v1_8_R3 + * + * @param particleBuilder particleBuilder + * @param location location + * @param players players + */ + static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + final net.minecraft.server.v1_8_R3.EnumParticle particle = net.minecraft.server.v1_8_R3.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); + int[] additionalInfo = null; + if (particleBuilder.getMaterial() != null) { + if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; + else + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; + } + final net.minecraft.server.v1_8_R3.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_8_R3.PacketPlayOutWorldParticles( + particle, + isLongDistance(location, Arrays.asList(players)), + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + (float) particleBuilder.getX(), + (float) particleBuilder.getY(), + (float) particleBuilder.getZ(), + (float) particleBuilder.getSpeed(), + particleBuilder.getAmount(), + additionalInfo); + for (final Player player : players) { + ((org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); + } + } + } + + static class ParticleUtils9R1 { + /** + * Sends a particleEffect for v1_9_R1 + * + * @param particleBuilder particleBuilder + * @param location location + * @param players players + */ + static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + final net.minecraft.server.v1_9_R1.EnumParticle particle = net.minecraft.server.v1_9_R1.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); + int[] additionalInfo = null; + if (particleBuilder.getMaterial() != null) { + if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; + else + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; + } + final net.minecraft.server.v1_9_R1.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_9_R1.PacketPlayOutWorldParticles( + particle, + isLongDistance(location, Arrays.asList(players)), + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + (float) particleBuilder.getX(), + (float) particleBuilder.getY(), + (float) particleBuilder.getZ(), + (float) particleBuilder.getSpeed(), + particleBuilder.getAmount(), + additionalInfo); + for (final Player player : players) { + ((org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); + } + } + } + + static class ParticleUtils9R2 { + /** + * Sends a particleEffect for v1_9_R2 + * + * @param particleBuilder particleBuilder + * @param location location + * @param players players + */ + static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + final net.minecraft.server.v1_9_R2.EnumParticle particle = net.minecraft.server.v1_9_R2.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); + int[] additionalInfo = null; + if (particleBuilder.getMaterial() != null) { + if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; + else + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; + } + final net.minecraft.server.v1_9_R2.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_9_R2.PacketPlayOutWorldParticles( + particle, + isLongDistance(location, Arrays.asList(players)), + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + (float) particleBuilder.getX(), + (float) particleBuilder.getY(), + (float) particleBuilder.getZ(), + (float) particleBuilder.getSpeed(), + particleBuilder.getAmount(), + additionalInfo); + for (final Player player : players) { + ((org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); + } + } + } + + static class ParticleUtils10R1 { + /** + * Sends a particleEffect for v1_11_R1 + * + * @param particleBuilder particleBuilder + * @param location location + * @param players players + */ + static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + final net.minecraft.server.v1_10_R1.EnumParticle particle = net.minecraft.server.v1_10_R1.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); + int[] additionalInfo = null; + if (particleBuilder.getMaterial() != null) { + if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; + else + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; + } + final net.minecraft.server.v1_10_R1.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_10_R1.PacketPlayOutWorldParticles( + particle, + isLongDistance(location, Arrays.asList(players)), + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + (float) particleBuilder.getX(), + (float) particleBuilder.getY(), + (float) particleBuilder.getZ(), + (float) particleBuilder.getSpeed(), + particleBuilder.getAmount(), + additionalInfo); + for (final Player player : players) { + ((org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); + } + } + } + + static class ParticleUtils11R1 { + /** + * Sends a particleEffect for v1_11_R1 + * + * @param particleBuilder particleBuilder + * @param location location + * @param players players + */ + static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + final net.minecraft.server.v1_11_R1.EnumParticle particle = net.minecraft.server.v1_11_R1.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); + int[] additionalInfo = null; + if (particleBuilder.getMaterial() != null) { + if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; + else + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; + } + final net.minecraft.server.v1_11_R1.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_11_R1.PacketPlayOutWorldParticles( + particle, + isLongDistance(location, Arrays.asList(players)), + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + (float) particleBuilder.getX(), + (float) particleBuilder.getY(), + (float) particleBuilder.getZ(), + (float) particleBuilder.getSpeed(), + particleBuilder.getAmount(), + additionalInfo); + for (final Player player : players) { + ((org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/SQLProvider.java b/src/main/java/com/github/shynixn/petblocks/lib/util/SQLProvider.java new file mode 100644 index 000000000..27f2830e7 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/lib/util/SQLProvider.java @@ -0,0 +1,86 @@ +package com.github.shynixn.petblocks.lib.util; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; + +/** + * Copyright 2017 Shynixn + *

+ * Do not remove this header! + *

+ * Version 1.0 + *

+ * MIT License + *

+ * Copyright (c) 2017 + *

+ * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + *

+ * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + *

+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +public abstract class SQLProvider { + private final Map cache = new HashMap<>(); + + /** + * Returns a preparedStatement from the given statementName and connection + * @param statementName statementName + * @param connection connection + * @return preparedStatement + * @throws IOException exception + * @throws SQLException exception + */ + public PreparedStatement getStatement(String statementName, Connection connection) throws IOException, SQLException { + if(connection == null) + throw new IllegalArgumentException("Connection cannot be null!"); + if(connection.isClosed()) + throw new IllegalArgumentException("Connection is closed! Cannot create statement!"); + return connection.prepareStatement(this.getString(statementName)); + } + + /** + * Returns a string from the given statementName + * @param statementName statementName + * @return string + */ + public String getString(String statementName) throws IOException { + if(statementName == null) + throw new IllegalArgumentException("Statement cannot be null!"); + if (!this.cache.containsKey(statementName)) { + this.cache.put(statementName, this.readStringFromFile(statementName)); + } + return this.cache.get(statementName); + } + + /** + * Clears the statement cache + */ + public void clear() { + this.cache.clear(); + } + + /** + * Reads a string from the given file + * @param fileName fileName + * @return string + * @throws IOException exception + */ + protected abstract String readStringFromFile(String fileName) throws IOException; +} \ No newline at end of file diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 05b4a8cdf..b998ffffa 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -26,12 +26,17 @@ # admin Access to the /petblocks command petblocks.commands -# MySQL settings -# Where is my database configuration? -# PetBlocks uses the internal database handling from the server. Open the bukkit.yml file and scroll down to database to change it. -# You can find a sample configuration on the plugin page. +# Storage settings +# Database configuration + +sql: + local: true + host: localhost + port: 3306 + database: '' + username: '' + password: '' -sql-enabled: false # Command settings # Choose your wanted command (dynamic command engine). diff --git a/src/main/resources/sql/create-mysql.sql b/src/main/resources/sql/create-mysql.sql new file mode 100644 index 000000000..e61d8a3e8 --- /dev/null +++ b/src/main/resources/sql/create-mysql.sql @@ -0,0 +1,14 @@ +CREATE TABLE IF NOT EXISTS SHY_PLAYER +( + id INTEGER PRIMARY KEY AUTO_INCREMENT, + uuid CHAR(36), + name VARCHAR(16), + CONSTRAINT unique_uuid_cs UNIQUE (uuid) +); + +CREATE TABLE IF NOT EXISTS SHY_PETBLOCK +( + id INTEGER PRIMARY KEY AUTO_INCREMENT, + shy_player_id REFERENCES SHY_PLAYER(id), + name VARCHAR(32) +); \ No newline at end of file diff --git a/src/main/resources/sql/create-sqlite.sql b/src/main/resources/sql/create-sqlite.sql new file mode 100644 index 000000000..e725307ad --- /dev/null +++ b/src/main/resources/sql/create-sqlite.sql @@ -0,0 +1,15 @@ +CREATE TABLE IF NOT EXISTS SHY_PLAYER +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + uuid CHAR(36), + name VARCHAR(16), + CONSTRAINT unique_uuid_cs UNIQUE (uuid) +); + +CREATE TABLE IF NOT EXISTS SHY_PETBLOCK +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + shy_player_id REFERENCES SHY_PLAYER(id), + name VARCHAR(32), + CONSTRAINT foreignkey_player_id_cs FOREIGN KEY (shy_player_id) REFERENCES SHY_PLAYER(id) +); \ No newline at end of file diff --git a/src/main/resources/sql/petblock/count.sql b/src/main/resources/sql/petblock/count.sql new file mode 100644 index 000000000..8ac2fc58d --- /dev/null +++ b/src/main/resources/sql/petblock/count.sql @@ -0,0 +1 @@ +select COUNT(*) from SHY_PETBLOCK \ No newline at end of file diff --git a/src/main/resources/sql/petblock/delete.sql b/src/main/resources/sql/petblock/delete.sql new file mode 100644 index 000000000..9ae2a6370 --- /dev/null +++ b/src/main/resources/sql/petblock/delete.sql @@ -0,0 +1 @@ +DELETE FROM SHY_PETBLOCK WHERE id = ?; \ No newline at end of file diff --git a/src/main/resources/sql/petblock/insert.sql b/src/main/resources/sql/petblock/insert.sql new file mode 100644 index 000000000..b9a69870b --- /dev/null +++ b/src/main/resources/sql/petblock/insert.sql @@ -0,0 +1 @@ +INSERT INTO SHY_PETBLOCK (name, shy_player_id ) VALUES (?,?) \ No newline at end of file diff --git a/src/main/resources/sql/petblock/selectall.sql b/src/main/resources/sql/petblock/selectall.sql new file mode 100644 index 000000000..0ef7c8945 --- /dev/null +++ b/src/main/resources/sql/petblock/selectall.sql @@ -0,0 +1 @@ +SELECT * FROM SHY_PETBLOCK; \ No newline at end of file diff --git a/src/main/resources/sql/petblock/selectbyid.sql b/src/main/resources/sql/petblock/selectbyid.sql new file mode 100644 index 000000000..35b4f5fd3 --- /dev/null +++ b/src/main/resources/sql/petblock/selectbyid.sql @@ -0,0 +1 @@ +SELECT * FROM SHY_PETBLOCK WHERE id = ?; \ No newline at end of file diff --git a/src/main/resources/sql/petblock/update.sql b/src/main/resources/sql/petblock/update.sql new file mode 100644 index 000000000..31243e83f --- /dev/null +++ b/src/main/resources/sql/petblock/update.sql @@ -0,0 +1 @@ +UPDATE SHY_PETBLOCK SET name=? WHERE id=? \ No newline at end of file diff --git a/src/main/resources/sql/player/count.sql b/src/main/resources/sql/player/count.sql new file mode 100644 index 000000000..7dfd500da --- /dev/null +++ b/src/main/resources/sql/player/count.sql @@ -0,0 +1 @@ +select COUNT(*) from SHY_PLAYER \ No newline at end of file diff --git a/src/main/resources/sql/player/delete.sql b/src/main/resources/sql/player/delete.sql new file mode 100644 index 000000000..63e153e24 --- /dev/null +++ b/src/main/resources/sql/player/delete.sql @@ -0,0 +1 @@ +DELETE FROM SHY_PLAYER WHERE id = ?; \ No newline at end of file diff --git a/src/main/resources/sql/player/insert.sql b/src/main/resources/sql/player/insert.sql new file mode 100644 index 000000000..32c19fb94 --- /dev/null +++ b/src/main/resources/sql/player/insert.sql @@ -0,0 +1 @@ +INSERT INTO SHY_PLAYER (name, uuid) VALUES (?,?) \ No newline at end of file diff --git a/src/main/resources/sql/player/selectall.sql b/src/main/resources/sql/player/selectall.sql new file mode 100644 index 000000000..660595dab --- /dev/null +++ b/src/main/resources/sql/player/selectall.sql @@ -0,0 +1 @@ +SELECT * FROM SHY_PLAYER; \ No newline at end of file diff --git a/src/main/resources/sql/player/selectbyid.sql b/src/main/resources/sql/player/selectbyid.sql new file mode 100644 index 000000000..80353bf67 --- /dev/null +++ b/src/main/resources/sql/player/selectbyid.sql @@ -0,0 +1 @@ +SELECT * FROM SHY_PLAYER WHERE id = ?; \ No newline at end of file diff --git a/src/main/resources/sql/player/update.sql b/src/main/resources/sql/player/update.sql new file mode 100644 index 000000000..3189b3680 --- /dev/null +++ b/src/main/resources/sql/player/update.sql @@ -0,0 +1 @@ +UPDATE SHY_PLAYER SET name=? WHERE id=? \ No newline at end of file diff --git a/src/main/resources/sql/selectbyplayer.sql b/src/main/resources/sql/selectbyplayer.sql new file mode 100644 index 000000000..8698e9ac8 --- /dev/null +++ b/src/main/resources/sql/selectbyplayer.sql @@ -0,0 +1,3 @@ +SELECT pet.id, pet.name FROM SHY_PETBLOCK pet, SHY_PLAYER play +WHERE pet.shy_player_id = play.id +AND play.uuid = ?; diff --git a/src/main/resources/sql/selectidbyuuid.sql b/src/main/resources/sql/selectidbyuuid.sql new file mode 100644 index 000000000..1b95a1e25 --- /dev/null +++ b/src/main/resources/sql/selectidbyuuid.sql @@ -0,0 +1 @@ +SELECT id FROM SHY_PLAYER WHERE uuid = ?; \ No newline at end of file diff --git a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java new file mode 100644 index 000000000..07cf8328f --- /dev/null +++ b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java @@ -0,0 +1,227 @@ +package com.github.shynixn.business.logic.persistence2; + +import ch.vorburger.exec.ManagedProcessException; +import ch.vorburger.mariadb4j.DB; +import com.github.shynixn.petblocks.business.logic.persistence2.Factory; +import com.github.shynixn.petblocks.business.logic.persistence2.PetData; +import com.github.shynixn.petblocks.business.logic.persistence2.PlayerData; +import com.github.shynixn.petblocks.lib.util.IController; +import com.github.shynixn.petblocks.lib.util.IDatabaseController; +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.io.File; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.List; +import java.util.UUID; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +/** + * Created by Shynixn + */ +public class PetdataDatabaseTest { + + private static Plugin mockPlugin() { + YamlConfiguration configuration = new YamlConfiguration(); + configuration.set("sql.local", true); + configuration.set("sql.host", "localhost"); + configuration.set("sql.port", 3306); + configuration.set("sql.database", "db"); + configuration.set("sql.username", "root"); + configuration.set("sql.password", ""); + Plugin plugin = mock(Plugin.class); + when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); + when(plugin.getConfig()).thenReturn(configuration); + when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { + String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); + } + }); + return plugin; + } + + @BeforeClass + public static void startMariaDB() { + try { + System.out.println("TRY"); + final DB database = DB.newEmbeddedDB(3306); + database.start(); + try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/?user=root&password=")) { + try (Statement statement = conn.createStatement()) { + statement.executeUpdate("CREATE DATABASE db"); + } + } + System.out.println("STARTED"); + } catch (SQLException | ManagedProcessException e) { + e.printStackTrace(); + } + } + + @Test + public void enableDatabaseSQLiteTest() { + try { + HikariConfig config = new HikariConfig(); + config.setDriverClassName("org.sqlite.JDBC"); + config.setConnectionTestQuery("SELECT 1"); + config.setJdbcUrl("jdbc:sqlite:PetBlocks.db"); + config.setMaxLifetime(60000); + config.setIdleTimeout(45000); + config.setMaximumPoolSize(50); + HikariDataSource ds = new HikariDataSource(config); + ds.close(); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail(); + } + } + + @Test + public void enableDatabaseMySQLTest() { + try { + HikariConfig config = new HikariConfig(); + config.setDriverClassName("com.mysql.jdbc.Driver"); + config.setConnectionTestQuery("SELECT 1"); + config.setJdbcUrl("jdbc:mysql://localhost:3306/db"); + config.setMaxLifetime(60000); + config.setIdleTimeout(45000); + config.setMaximumPoolSize(50); + HikariDataSource ds = new HikariDataSource(config); + ds.close(); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail(); + } + } + + @Test + public void insertAndSelectPetDataSQLiteTest() throws ClassNotFoundException { + Factory.enable(mockPlugin()); + final PetData petData = new PetData(); + petData.setName("Sample"); + try (IController petDataIController = Factory.createPetDataController()) { + for (final PetData pet : petDataIController.getAll()) { + petDataIController.remove(pet); + } + try (IController playerDataIController = Factory.createPlayerDataController()) { + for (PlayerData playerData : playerDataIController.getAll()) { + playerDataIController.remove(playerData); + } + Assert.assertEquals(playerDataIController.size(), 0); + PlayerData playerData = new PlayerData(); + playerData.setName("Christoph"); + playerData.setUuid(UUID.randomUUID()); + playerDataIController.store(playerData); + petData.setPlayerId(playerData.getId()); + Assert.assertEquals(playerDataIController.size(), 1); + } + petDataIController.store(petData); + final List petDataList = petDataIController.getAll(); + Assert.assertEquals(petDataList.size(), 1); + Assert.assertEquals(petDataList.get(0).getName(), petData.getName()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + @Test + public void insertAndSelectPetDataMySQLTest() throws ClassNotFoundException { + Plugin plugin = mockPlugin(); + plugin.getConfig().set("sql.local", false); + Factory.enable(plugin); + final PetData petData = new PetData(); + petData.setName("Sample"); + try (IController petDataIController = Factory.createPetDataController()) { + try (IController playerDataIController = Factory.createPlayerDataController()) { + PlayerData playerData = new PlayerData(); + playerData.setName("Christoph"); + playerData.setUuid(UUID.randomUUID()); + playerDataIController.store(playerData); + petData.setPlayerId(playerData.getId()); + } + for (final PetData pet : petDataIController.getAll()) { + petDataIController.remove(pet); + } + petDataIController.store(petData); + final List petDataList = petDataIController.getAll(); + Assert.assertEquals(petDataList.size(), 1); + Assert.assertEquals(petDataList.get(0).getName(), petData.getName()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + @Test + public void insertAndUpdatePetDataMySQLTest() throws ClassNotFoundException { + Plugin plugin = mockPlugin(); + plugin.getConfig().set("sql.local", false); + Factory.enable(plugin); + final PetData petData = new PetData(); + petData.setName("Eduard"); + try (IDatabaseController petDataIController = Factory.createPetDataController()) { + try (IController playerDataIController = Factory.createPlayerDataController()) { + PlayerData playerData = new PlayerData(); + playerData.setName("Christoph"); + playerData.setUuid(UUID.randomUUID()); + playerDataIController.store(playerData); + petData.setPlayerId(playerData.getId()); + } + for (final PetData pet : petDataIController.getAll()) { + petDataIController.remove(pet); + } + petDataIController.store(petData); + Assert.assertEquals(petDataIController.getById(petData.getId()).getName(), petData.getName()); + petData.setName("Franklin"); + petDataIController.store(petData); + Assert.assertEquals(petDataIController.getById(petData.getId()).getName(), petData.getName()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + @Test + public void insertAndUpdatePetDataSQLiteTest() throws ClassNotFoundException { + Factory.enable(mockPlugin()); + final PetData petData = new PetData(); + petData.setName("Eduard"); + try (IDatabaseController petDataIController = Factory.createPetDataController()) { + try (IController playerDataIController = Factory.createPlayerDataController()) { + PlayerData playerData = new PlayerData(); + playerData.setName("Christoph"); + playerData.setUuid(UUID.randomUUID()); + playerDataIController.store(playerData); + petData.setPlayerId(playerData.getId()); + } + for (final PetData pet : petDataIController.getAll()) { + petDataIController.remove(pet); + } + petDataIController.store(petData); + Assert.assertEquals(petDataIController.getById(petData.getId()).getName(), petData.getName()); + petData.setName("Franklin"); + petDataIController.store(petData); + Assert.assertEquals(petDataIController.getById(petData.getId()).getName(), petData.getName()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } +} From d9ec8a71511ecaef2d41fcfbca1dbcce1af1ee9c Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 4 May 2017 15:04:05 +0200 Subject: [PATCH 02/23] Added new databasecontroller. --- pom.xml | 4 +- .../shynixn/petblocks/business/Config.java | 43 +- .../business/logic/persistence2/Factory.java | 2 +- .../persistence2/IPetDataController.java | 9 +- .../business/logic/persistence2/PetData.java | 10 + .../persistence2/PetDataCommandExecutor.java | 68 ---- .../logic/persistence2/PetRepository.java | 14 +- .../logic/persistence2/PlayerData.java | 10 +- .../PetDataCommandExecutor.java | 70 ++++ .../business/logic/persistence2/ui/GUI.java | 212 ++++++++++ .../persistence2/ui/PetDataListener.java | 374 ++++++++++++++++++ .../petblocks/lib/DynamicCommandHelper.java | 9 +- .../shynixn/petblocks/lib/Interpreter19.java | 2 +- .../petblocks/lib/util/ReflectionUtils.java | 283 +++++++++++++ .../petblocks/lib/util/SimpleListener.java | 76 ++++ .../sql/{ => petblock}/selectbyplayer.sql | 0 .../persistence2/PetCommandExecutorTest.java | 126 ++++++ .../persistence2/PetDataControllerTest.java | 76 ++++ .../persistence2/PetdataDatabaseTest.java | 12 +- 19 files changed, 1296 insertions(+), 104 deletions(-) delete mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetDataCommandExecutor.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/commandexecutor/PetDataCommandExecutor.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/GUI.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/PetDataListener.java create mode 100644 src/main/java/com/github/shynixn/petblocks/lib/util/ReflectionUtils.java create mode 100644 src/main/java/com/github/shynixn/petblocks/lib/util/SimpleListener.java rename src/main/resources/sql/{ => petblock}/selectbyplayer.sql (100%) create mode 100644 src/main/test/java/com/github/shynixn/business/logic/persistence2/PetCommandExecutorTest.java create mode 100644 src/main/test/java/com/github/shynixn/business/logic/persistence2/PetDataControllerTest.java diff --git a/pom.xml b/pom.xml index 7a3bfa2b4..a868c3e56 100644 --- a/pom.xml +++ b/pom.xml @@ -75,8 +75,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.7 - 1.7 + 1.8 + 1.8 2.3.2 diff --git a/src/main/java/com/github/shynixn/petblocks/business/Config.java b/src/main/java/com/github/shynixn/petblocks/business/Config.java index e8b261356..e12406bd3 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/Config.java +++ b/src/main/java/com/github/shynixn/petblocks/business/Config.java @@ -1,6 +1,5 @@ package com.github.shynixn.petblocks.business; - import com.github.shynixn.petblocks.api.entities.*; import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; import com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle; @@ -10,6 +9,7 @@ import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; import com.github.shynixn.petblocks.lib.BukkitUtilities; import com.github.shynixn.petblocks.lib.ParticleBuilder; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; @@ -17,10 +17,13 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; +import java.util.logging.Level; + public final class Config { - private static JavaPlugin plugin; + private static Plugin plugin; private static Config instance; private static FileConfiguration c; @@ -35,12 +38,12 @@ public final class Config { private boolean join_enabled; private boolean join_overwriteExistingPet; - private Config(JavaPlugin plugin) { + private Config(Plugin plugin) { Config.plugin = plugin; this.reload(); } - public static void initiliaze(JavaPlugin plugin) { + public static void initiliaze(Plugin plugin) { instance = new Config(plugin); } @@ -49,25 +52,29 @@ public static Config getInstance() { } public void reload() { - plugin.reloadConfig(); - c = plugin.getConfig(); + try { + plugin.reloadConfig(); + c = plugin.getConfig(); - this.chat_async = c.getBoolean("chat.async"); - this.chat_highestpriority = c.getBoolean("chat.highest-priority"); + this.chat_async = c.getBoolean("chat.async"); + this.chat_highestpriority = c.getBoolean("chat.highest-priority"); - this.world_allowInAllWorlds = plugin.getConfig().getBoolean("world.all"); - this.world_worlds = plugin.getConfig().getStringList("world.worlds").toArray(new String[0]); + this.world_allowInAllWorlds = plugin.getConfig().getBoolean("world.all"); + this.world_worlds = plugin.getConfig().getStringList("world.worlds").toArray(new String[0]); - this.region_allowInAllRegions = plugin.getConfig().getBoolean("region.all"); - this.region_regions = plugin.getConfig().getStringList("region.regions").toArray(new String[0]); + this.region_allowInAllRegions = plugin.getConfig().getBoolean("region.all"); + this.region_regions = plugin.getConfig().getStringList("region.regions").toArray(new String[0]); - this.join_enabled = c.getBoolean("join.enabled"); - this.join_overwriteExistingPet = plugin.getConfig().getBoolean("join.overwrite-previous-pet"); + this.join_enabled = c.getBoolean("join.enabled"); + this.join_overwriteExistingPet = plugin.getConfig().getBoolean("join.overwrite-previous-pet"); - ConfigCommands.getInstance().load(c); - ConfigGUI.getInstance().load(c); - ConfigParticle.getInstance().load(c); - ConfigPet.getInstance().load(c); + ConfigCommands.getInstance().load(c); + ConfigGUI.getInstance().load(c); + ConfigParticle.getInstance().load(c); + ConfigPet.getInstance().load(c); + } catch (Exception ex) { + Bukkit.getLogger().log(Level.WARNING, "Failed to reload config.", ex); + } } public boolean allowPetSpawning(Location location) { diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java index 9980b2e94..ce581ad04 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java @@ -23,7 +23,7 @@ public class Factory { private static DbConnectionContext connectionContext; private static SQLProvider sqlProvider; - public static IPetDataController createPetDataController() { + public static IPetDataController createPetDataController() { if (sqlProvider == null) throw new IllegalArgumentException("Factory is disabled!"); if (Bukkit.getServer() != null && Bukkit.getServer().isPrimaryThread()) diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java index 3a331d6d3..2724cbadc 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java @@ -6,11 +6,18 @@ /** * Created by Shynixn */ -public interface IPetDataController extends IDatabaseController { +public interface IPetDataController extends IDatabaseController { /** * Returns the petdata from the given player * @param player player * @return petData */ PetData getByPlayer(Player player); + + /** + * Creates a petdata from the given player + * @param player player + * @return petdata + */ + PetData create(Player player); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java index e3bea7f84..9f58644c1 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java @@ -1,5 +1,7 @@ package com.github.shynixn.petblocks.business.logic.persistence2; +import org.bukkit.entity.Player; + import java.sql.ResultSet; import java.sql.SQLException; @@ -36,6 +38,14 @@ public void setName(String name) { this.name = name; } + + public static PetData from(PlayerData playerData) + { + final PetData petData = new PetData(); + petData.setPlayerId(playerData.getId()); + return petData; + } + public static PetData from(ResultSet resultSet) throws SQLException { final PetData petData = new PetData(); petData.setId(resultSet.getLong("id")); diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetDataCommandExecutor.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetDataCommandExecutor.java deleted file mode 100644 index f729e8a62..000000000 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetDataCommandExecutor.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.github.shynixn.petblocks.business.logic.persistence2; - -import com.github.shynixn.petblocks.api.PetBlocksApi; -import com.github.shynixn.petblocks.api.entities.PetBlock; -import com.github.shynixn.petblocks.business.Config; -import com.github.shynixn.petblocks.business.Language; -import com.github.shynixn.petblocks.business.Permission; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; -import com.github.shynixn.petblocks.lib.DynamicCommandHelper; -import com.github.shynixn.petblocks.lib.util.IDatabaseController; -import org.bukkit.Bukkit; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; - -/** - * Created by Shynixn - */ -public class PetDataCommandExecutor extends DynamicCommandHelper{ - - private Plugin plugin; - - PetDataCommandExecutor(Plugin plugin) { - super(ConfigCommands.getInstance().getPetblockGuiCommandContainer()); - } - - @Override - public void onCommandSend(CommandSender sender, String[] args) { - if (!(sender instanceof Player)) - return; - final Player player = (Player) sender; - if (!Config.getInstance().allowPetSpawning(player.getLocation())) - return; - else if (args.length == 2 && args[0].equalsIgnoreCase("rename") && player.hasPermission(Permission.RENAMEPET.get())) { - if (args[1].length() > ConfigPet.getInstance().getDesign_maxPetNameLength()) - player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); - else { - Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() { - @Override - public void run() { - try(IDatabaseController controller = Factory.createPetDataController()) - { - - - player.sendMessage(Language.PREFIX + Language.NAME_SUCCES_MESSAGE); - } catch (Exception e) { - player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); - } - } - }); - - - - try { - if (PetBlocksApi.hasPetMeta(player)) - PetBlocksApi.getPetMeta(player).setDisplayName(args[1]); - final PetBlock petBlock; - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) - petBlock.respawn(); - - } catch (final Exception e) { - - } - } - } - } -} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java index 13e5779ab..56e1229e2 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java @@ -17,7 +17,7 @@ /** * Created by Shynixn */ -public class PetRepository extends DataBaseRepository implements IPetDataController { +public class PetRepository extends DataBaseRepository implements IPetDataController { private DbConnectionContext dbContext; private SQLProvider sqlProvider; @@ -28,7 +28,6 @@ public class PetRepository extends DataBaseRepository implements IPetDa this.sqlProvider = sqlProvider; } - /** * Returns the petdata from the given player * @@ -52,6 +51,17 @@ public PetData getByPlayer(Player player) { return null; } + /** + * Creates a petdata from the given player + * + * @param player player + * @return petdata + */ + @Override + public PetData create(Player player) { + return PetData.from(PlayerData.from(player)); + } + /** * Returns the item of the given id * diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java index e48cf0bff..3da00b4ce 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java @@ -40,11 +40,17 @@ public void setUuid(UUID uuid) { this.uuid = uuid; } - public Player getPlayer() - { + public Player getPlayer() { return Bukkit.getPlayer(this.uuid); } + public static PlayerData from(Player player) { + PlayerData playerStats = new PlayerData(); + playerStats.setName(player.getName()); + playerStats.setUuid(player.getUniqueId()); + return playerStats; + } + public static PlayerData from(ResultSet resultSet) throws SQLException { PlayerData playerStats = new PlayerData(); playerStats.id = resultSet.getLong("id"); diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/commandexecutor/PetDataCommandExecutor.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/commandexecutor/PetDataCommandExecutor.java new file mode 100644 index 000000000..045756432 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/commandexecutor/PetDataCommandExecutor.java @@ -0,0 +1,70 @@ +package com.github.shynixn.petblocks.business.logic.persistence2.commandexecutor; + +import com.github.shynixn.petblocks.business.Config; +import com.github.shynixn.petblocks.business.Language; +import com.github.shynixn.petblocks.business.Permission; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; +import com.github.shynixn.petblocks.business.logic.persistence2.Factory; +import com.github.shynixn.petblocks.business.logic.persistence2.IPetDataController; +import com.github.shynixn.petblocks.business.logic.persistence2.PetData; +import com.github.shynixn.petblocks.lib.DynamicCommandHelper; +import org.bukkit.Bukkit; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; + +/** + * Created by Shynixn + */ +public class PetDataCommandExecutor extends DynamicCommandHelper { + + private Plugin plugin; + + public PetDataCommandExecutor(Plugin plugin) { + super(ConfigCommands.getInstance().getPetblockGuiCommandContainer()); + this.plugin = plugin; + } + + private void renamePet(final Player player, String name) { + System.out.println("RUN"); + Bukkit.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + System.out.println("EXECUTING"); + try (IPetDataController controller = Factory.createPetDataController()) { + final PetData petData; + if ((petData = controller.getByPlayer(player)) != null) { + petData.setName(name); + controller.store(petData); + player.sendMessage(Language.PREFIX + Language.NAME_SUCCES_MESSAGE); + } else { + player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); + } + System.out.println("SAVED"); + } catch (Exception e) { + e.printStackTrace(); + } + }); + } + + @Override + public void onCommandSend(CommandSender sender, final String[] args) { + if (!(sender instanceof Player)) + return; + System.out.println("1"); + final Player player = (Player) sender; + if (player.getLocation() != null && !Config.getInstance().allowPetSpawning(player.getLocation())) { + System.out.println("NOPE"); + return; + } + else if (args.length == 2 && args[0] != null && args[0].equalsIgnoreCase("rename") && player.hasPermission(Permission.RENAMEPET.get())) { + System.out.println("2"); + if (args[1] == null || args[1].length() > ConfigPet.getInstance().getDesign_maxPetNameLength()) + player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); + else { + System.out.println("3"); + this.renamePet(player, args[1]); + //Missing RESPAWN + } + } + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/GUI.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/GUI.java new file mode 100644 index 000000000..043a39551 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/GUI.java @@ -0,0 +1,212 @@ +package com.github.shynixn.petblocks.business.logic.persistence2.ui; + +import com.github.shynixn.petblocks.api.PetBlocksApi; +import com.github.shynixn.petblocks.api.entities.PetType; +import com.github.shynixn.petblocks.business.Config; +import com.github.shynixn.petblocks.business.Language; +import com.github.shynixn.petblocks.business.Permission; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle; +import com.github.shynixn.petblocks.business.logic.persistence.PetDataManager; +import com.github.shynixn.petblocks.lib.BukkitUtilities; +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +class GUI { + + public Player player; + private Inventory inventory; + private GuiPage page; + private GuiPageContainer container; + + public GUI(Player player) { + this.player = player; + } + + public void open() { + if (this.player.getOpenInventory() != null) + this.player.closeInventory(); + this.inventory = Bukkit.getServer().createInventory(this.player, 54, Language.GUI_TITLE); + this.player.openInventory(this.inventory); + } + + public boolean isClose() { + return this.inventory == null; + } + + void setMainItems(Player player) { + if (this.isClose()) { + return; + } + this.clearInventory(this.inventory); + for (final PetType petType : PetType.values()) { + final String name = petType.name(); + Config.getInstance().setMyContainer(this.inventory, Language.getDisplayName(name), ConfigGUI.getInstance().getContainer(petType), (Permission.SINGLEPETTYPE.get() + name.toLowerCase()), Permission.ALLPETTYPES.get()); + } + this.page = GuiPage.MAIN; + } + + public void setMainItems(Player player, PetType petType, boolean enabled, boolean refresh) { + if (this.isClose()) { + return; + } + if (this.page != GuiPage.MAIN) + this.setMainItems(player); + if (this.inventory.getItem(ConfigGUI.getInstance().getGeneral_myContainer().getPosition()) == null || refresh || this.inventory.getItem(ConfigGUI.getInstance().getGeneral_myContainer().getPosition()).getType() != Material.SKULL_ITEM) + this.inventory.setItem(ConfigGUI.getInstance().getGeneral_myContainer().getPosition(), BukkitUtilities.nameItem(this.getItemStack(player, petType), Language.MY_PET, null)); + if (!enabled) + Config.getInstance().setMyContainer(this.inventory, Language.ENABLE_PET, ConfigGUI.getInstance().getGeneral_enablePetContainer(), (Permission) null); + else + Config.getInstance().setMyContainer(this.inventory, Language.DISABLE_PET, ConfigGUI.getInstance().getGeneral_disablePetContainer(), (Permission) null); + + Config.getInstance().setMyContainer(this.inventory, Language.CANCEL, ConfigGUI.getInstance().getItems_cancelpetContainer(), (Permission) null); + Config.getInstance().setMyContainer(this.inventory, Language.CANNON, ConfigGUI.getInstance().getItems_cannonpetContainer(), Permission.CANNON); + Config.getInstance().setMyContainer(this.inventory, Language.CALL, ConfigGUI.getInstance().getItems_callpetContainer(), (Permission) null); + + Config.getInstance().setMyContainer(this.inventory, Language.SKULL_NAMING, ConfigGUI.getInstance().getItems_skullNamingContainer(), Permission.RENAMESKULL); + Config.getInstance().setMyContainer(this.inventory, Language.NAMING, ConfigGUI.getInstance().getItems_namingContainer(), Permission.RENAMEPET); + Config.getInstance().setMyContainer(this.inventory, Language.HAT, ConfigGUI.getInstance().getItems_hatpetContainer(), Permission.WEARPET); + Config.getInstance().setMyContainer(this.inventory, Language.RIDING, ConfigGUI.getInstance().getItems_ridingpetContainer(), Permission.RIDEPET); + + Config.getInstance().setMyContainer(this.inventory, Language.COSTUME, ConfigGUI.getInstance().getItems_defaultcostumeContainer(), (Permission) null); + Config.getInstance().setMyContainer(this.inventory, Language.COLOR_COSTUME, ConfigGUI.getInstance().getItems_colorcostumeContainer(), (Permission) null); + Config.getInstance().setMyContainer(this.inventory, Language.CUSTOM_COSTUME, ConfigGUI.getInstance().getItems_customcostumeContainer(), (Permission) null); + + if (PetBlocksApi.getPetMeta(player).isSoundsEnabled()) + Config.getInstance().setMyContainer(this.inventory, Language.MUTE, ConfigGUI.getInstance().getItems_soundEnabledContainer(), (Permission) null); + else + Config.getInstance().setMyContainer(this.inventory, Language.UNMUTE, ConfigGUI.getInstance().getItems_soundDisabledContainer(), (Permission) null); + + Config.getInstance().setMyContainer(this.inventory, Language.PARTICLE, ConfigGUI.getInstance().getItems_particlepetContainer(), (Permission) null); + this.fillEmptySlots(this.inventory); + } + + public void setDefaultCostumeItems(Player player) { + this.setCostumes(player, ConfigGUI.getInstance().getDefaultItemStacks(), GuiPage.DEFAULTCOSTUMES, 0); + } + + public void setColorCostumeItems(Player player) { + this.setCostumes(player, ConfigGUI.getInstance().getColoredItemStacks(), GuiPage.COLORCOSTUMES, 0); + } + + public void setCustomCostumeItems(Player player) { + this.setCostumes(player, ConfigGUI.getInstance().getCustomItemStacks(), GuiPage.CUSTOMCOSTUMES, 0); + } + + public void setParticleCostumeItems(Player player) { + if (this.isClose()) { + return; + } + this.clearInventory(this.inventory); + for (int i = 0; i < 54 && i < ConfigParticle.getInstance().getParticleItemStacks().length; i++) { + this.inventory.setItem(i, ConfigParticle.getInstance().getParticleItemStacks()[i]); + } + this.fillEmptySlots(this.inventory); + this.page = GuiPage.PARTICLES; + } + + public PetType getPetType(ItemStack itemStack) { + for (final String name : PetType.getNames()) { + if (BukkitUtilities.compareItemName(itemStack, Language.getDisplayName(name))) { + return PetType.getPetTypeFromName(name); + } + } + return null; + } + + void setCostumes(Player player, ItemStack[] itemStacks, GuiPage page, int type) { + if (this.isClose()) { + return; + } + int count; + GuiPageContainer current; + if (this.container != null && type == 1) { + current = this.container; + while (current.next != null) { + current = current.next; + } + } else if (this.container != null && type == 2) { + current = this.container; + if (current.next == null) + return; + if (current.next.next == null) + return; + while (current.next.next.next != null) { + current = current.next; + } + current.next = null; + } else { + this.container = new GuiPageContainer(page); + current = this.container; + } + + count = current.startCount; + this.clearInventory(this.inventory); + inventory.setItem(ConfigGUI.getInstance().getGeneral_previouspageContainer().getPosition(), BukkitUtilities.nameItemDisplay(ConfigGUI.getInstance().getGeneral_previouspageContainer().generate(), Language.PREVIOUS)); + inventory.setItem(ConfigGUI.getInstance().getGeneral_nextpageContainer().getPosition(), BukkitUtilities.nameItemDisplay(ConfigGUI.getInstance().getGeneral_nextpageContainer().generate(), Language.NEXT)); + for (int i = 0; i < 45 && (i + current.startCount) < itemStacks.length; i++) { + if (inventory.getItem(i) == null || inventory.getItem(i).getType() == Material.AIR) { + inventory.setItem(i, itemStacks[(i + current.startCount)]); + count++; + } + } + this.fillEmptySlots(inventory); + + GuiPageContainer runRef = this.container; + while (runRef.next != null) + runRef = runRef.next; + runRef.next = new GuiPageContainer(page); + runRef.next.startCount = count; + } + + ItemStack[] getItemstackFromPage(GuiPage page) { + if (page == GuiPage.COLORCOSTUMES) + return ConfigGUI.getInstance().getColoredItemStacks(); + else if (page == GuiPage.DEFAULTCOSTUMES) + return ConfigGUI.getInstance().getDefaultItemStacks(); + else if (page == GuiPage.CUSTOMCOSTUMES) + return ConfigGUI.getInstance().getCustomItemStacks(); + return new ItemStack[0]; + } + + public Inventory getInventory() { + return inventory; + } + + static class GuiPageContainer { + GuiPage page; + int startCount; + GuiPageContainer next; + + GuiPageContainer(GuiPage page) { + super(); + this.page = page; + } + } + + enum GuiPage { + MAIN, DEFAULTCOSTUMES, COLORCOSTUMES, CUSTOMCOSTUMES, PARTICLES + } + + + private void fillEmptySlots(Inventory inventory) { + for (int i = 0; i < inventory.getContents().length; i++) { + if (inventory.getItem(i) == null || inventory.getItem(i).getType() == Material.AIR) { + inventory.setItem(i, BukkitUtilities.nameItemDisplay(ConfigGUI.getInstance().getGeneral_emptyslotContainer().generate(), Language.EMPTY)); + } + } + } + + private void clearInventory(Inventory inventory) { + for (int i = 0; i < inventory.getContents().length; i++) { + inventory.setItem(i, null); + } + } + + private ItemStack getItemStack(Player player, PetType petType) { + return Config.getInstance().getMyItemStack(player, Language.getDisplayName(petType.name()), ConfigGUI.getInstance().getContainer(petType), (Permission.SINGLEPETTYPE.get() + petType.name().toLowerCase()), Permission.ALLPETTYPES.get()); + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/PetDataListener.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/PetDataListener.java new file mode 100644 index 000000000..f44fb5eb5 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/PetDataListener.java @@ -0,0 +1,374 @@ +package com.github.shynixn.petblocks.business.logic.persistence2.ui; + +import com.github.shynixn.petblocks.api.PetBlocksApi; +import com.github.shynixn.petblocks.api.entities.PetBlock; +import com.github.shynixn.petblocks.api.entities.PetMeta; +import com.github.shynixn.petblocks.api.entities.PetType; +import com.github.shynixn.petblocks.api.events.PetMetaEvent; +import com.github.shynixn.petblocks.business.Config; +import com.github.shynixn.petblocks.business.Language; +import com.github.shynixn.petblocks.business.Permission; +import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; +import com.github.shynixn.petblocks.business.logic.persistence.PetData; +import com.github.shynixn.petblocks.business.logic.persistence.PetDataManager; +import com.github.shynixn.petblocks.business.logic.persistence2.Factory; +import com.github.shynixn.petblocks.business.logic.persistence2.IPetDataController; +import com.github.shynixn.petblocks.lib.BukkitEvents; +import com.github.shynixn.petblocks.lib.BukkitUtilities; +import com.github.shynixn.petblocks.lib.util.SimpleListener; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.player.AsyncPlayerChatEvent; +import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.inventory.meta.SkullMeta; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.util.Vector; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@SuppressWarnings("deprecation") +class PetDataListener extends SimpleListener { + private final Map openGuis = new HashMap<>(); + private final List namingPlayers = new ArrayList<>(); + private final List namingSkull = new ArrayList<>(); + + PetDataListener(Plugin plugin) { + super(plugin); + } + + /* private void selectPet(Player player, PetType petType) + { + if (player.hasPermission(Permission.ALLPETTYPES.get()) || player.hasPermission(Permission.SINGLEPETTYPE.get() + type.name().toLowerCase())) { + if (PetBlocksApi.hasPetBlock(player)) + PetBlocksApi.removePetBlock(player); + + try(IPetDataController petDataController = Factory.createPetDataController()) + { + + } catch (Exception e) { + e.printStackTrace(); + } + + /* petMeta = this.manager.createPetMeta(player, type); + this.manager.addPetMeta(petMeta); + if (ConfigGUI.getInstance().isSettings_copyskin()) { + petMeta.setSkin(Material.SKULL_ITEM, (short) 3, ConfigGUI.getInstance().getContainer(petMeta.getType()).getSkullName()); + } + this.manager.persist(petMeta); + this.manager.gui.setMainItems(player, petMeta.getType(), false, true); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } + + @EventHandler + public void playerClickEvent(final InventoryClickEvent event) { + PetMeta petMeta; + PetBlock petBlock; + final Player player = (Player) event.getWhoClicked(); + if(!this.openGuis.containsKey(player)) + return; + + GUI gui = this.openGuis.get(player); + + + if (event.getView().getTopInventory().getTitle().equals(Language.GUI_TITLE) && gui.getInventory().equals(event.getInventory())) { + if (gui.getPetType(event.getCurrentItem()) != null) { + final PetType type = gui.getPetType(event.getCurrentItem()); + this.selectPet(player, type); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.MY_PET) && ((petMeta = this.manager.getPetMeta(player)) != null)) { + if (ConfigGUI.getInstance().isSettings_copyskin()) { + petMeta.setSkin(Material.SKULL_ITEM, (short) 3, ConfigGUI.getInstance().getContainer(petMeta.getType()).getSkullName()); + } else { + petMeta.setSkin(Material.getMaterial(ConfigGUI.getInstance().getItems_defaultcostumeContainer().getId()), (short) ConfigGUI.getInstance().getItems_defaultcostumeContainer().getDamage(), ConfigGUI.getInstance().getItems_defaultcostumeContainer().getSkullName()); + } + petMeta.setParticleEffect(null); + if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) + petBlock.respawn(); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.ENABLE_PET) && ((petMeta = this.manager.getPetMeta(player)) != null)) { + PetBlocksApi.setPetBlock(player, petMeta); + this.manager.gui.setMainItems(player, petMeta.getType(), true, false); + petMeta.setEnabled(true); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.DISABLE_PET) && ((petMeta = this.manager.getPetMeta(player)) != null) && PetBlocksApi.hasPetBlock(player)) { + PetBlocksApi.removePetBlock(player); + this.manager.gui.setMainItems(player, petMeta.getType(), false, false); + petMeta.setEnabled(false); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.MUTE) && ((petMeta = this.manager.getPetMeta(player)) != null)) { + PetBlocksApi.getPetMeta(player).setSoundsEnabled(false); + this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.UNMUTE) && ((petMeta = this.manager.getPetMeta(player)) != null)) { + PetBlocksApi.getPetMeta(player).setSoundsEnabled(true); + this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.PREVIOUS)) { + this.manager.gui.setCostumes(player, this.manager.gui.getItemstackFromPage(this.manager.pages.get(player).page), this.manager.pages.get(player).page, 2); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.NEXT)) { + this.manager.gui.setCostumes(player, this.manager.gui.getItemstackFromPage(this.manager.pages.get(player).page), this.manager.pages.get(player).page, 1); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.COSTUME)) { + this.manager.gui.setDefaultCostumeItems(player); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.COLOR_COSTUME)) { + this.manager.gui.setColorCostumeItems(player); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CUSTOM_COSTUME)) { + this.manager.gui.setCustomCostumeItems(player); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.PARTICLE)) { + this.manager.gui.setParticleCostumeItems(player); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CALL) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { + petBlock.teleport(player); + player.closeInventory(); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.HAT) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { + if (player.hasPermission(Permission.WEARPET.get())) { + petBlock.wear(player); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.RIDING) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { + if (player.hasPermission(Permission.RIDEPET.get())) { + petBlock.ride(player); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.NAMING)) { + if (player.hasPermission(Permission.RENAMEPET.get())) { + this.namingPlayers.add(player); + player.closeInventory(); + player.sendMessage(Language.PREFIX + Language.NAME_MESSAGE); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.SKULL_NAMING)) { + if (player.hasPermission(Permission.RENAMESKULL.get())) { + this.namingSkull.add(player); + player.closeInventory(); + player.sendMessage(Language.PREFIX + Language.SNAME_MESSAGE); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CANNON) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { + if (player.hasPermission(Permission.CANNON.get())) { + player.closeInventory(); + petBlock.launch(this.getDirection(player)); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CANCEL)) { + player.closeInventory(); + } else if (this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.PARTICLES && ((petMeta = this.manager.getPetMeta(player)) != null)) { + if (!player.hasPermission(Permission.ALLPARTICLES.get()) && !player.hasPermission(Permission.SINGLEPARTICLE.get() + "" + event.getSlot())) { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } else { + petMeta.setParticleEffect(ConfigParticle.getInstance().getParticle(event.getSlot())); + } + player.closeInventory(); + this.manager.gui.open(player); + this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); + if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) + petBlock.respawn(); + } else if (!BukkitUtilities.compareItemName(event.getCurrentItem(), Language.EMPTY) && (this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.DEFAULTCOSTUMES || this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.CUSTOMCOSTUMES || this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.COLORCOSTUMES) && event.getCurrentItem() != null) { + final int number; + try { + String s = event.getCurrentItem().getItemMeta().getDisplayName(); + s = ChatColor.stripColor(s); + number = Integer.parseInt(s); + } catch (final Exception ex) { + BukkitUtilities.sendColorMessage("Number prefix (lang.yml) only allows color codes!", ChatColor.RED, "[PetBlocks]"); + player.sendMessage(ChatColor.RED + "Number-prefix (lang.yml) only allows color codes! Contact an admin in order to resolve this issue."); + player.closeInventory(); + return; + } + if (this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.DEFAULTCOSTUMES && (!player.hasPermission(Permission.ALLDEFAULTCOSTUMES.get()) && !player.hasPermission(Permission.SINGLEDEFAULTCOSTUME.get() + "" + number))) { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } else if (this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.COLORCOSTUMES && (!player.hasPermission(Permission.ALLCOLORCOSTUMES.get()) && !player.hasPermission(Permission.SINGLECOLORCOSTUME.get() + "" + number))) { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } else if (this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.CUSTOMCOSTUMES && (!player.hasPermission(Permission.ALLCUSTOMCOSTUMES.get()) && !player.hasPermission(Permission.SINGLECUSTOMCOSTUME.get() + "" + number))) { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } else if (event.getClickedInventory().equals(event.getView().getTopInventory()) || player.hasPermission(Permission.OWNINGAMECOSTUMES.get())) { + petMeta = this.manager.getPetMeta(player); + if (petMeta == null) + return; + if (event.getCurrentItem().getType() != Material.SKULL_ITEM) + petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), null); + else { + final SkullMeta meta = (SkullMeta) event.getCurrentItem().getItemMeta(); + if (meta.getOwner() == null) { + petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), NMSRegistry.getSkinUrl(event.getCurrentItem())); + } else { + petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), ((SkullMeta) event.getCurrentItem().getItemMeta()).getOwner()); + } + } + petMeta.setUnbreakable(NMSRegistry.isUnbreakable(event.getCurrentItem())); + player.closeInventory(); + this.manager.gui.open(player); + this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); + if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) + petBlock.respawn(); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (ConfigGUI.getInstance().isSettings_clickemptyback() && BukkitUtilities.compareItemName(event.getCurrentItem(), Language.EMPTY)) { + petMeta = PetBlocksApi.getPetMeta(player); + if (this.manager.pages.containsKey(player) && this.manager.pages.get(player).page != com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.MAIN) { + this.manager.gui.setMainItems(player); + if (petMeta != null) + this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), true); + } + } + event.setCancelled(true); + ((Player) event.getWhoClicked()).updateInventory(); + } + } + + @EventHandler + public void petDataChangeEvent(PetMetaEvent event) { + if (this.getPlugin().getConfig().getBoolean("sql.enabled")) + this.manager.persist(event.getPetMeta()); + } + + @EventHandler + public void playerJoinEvent(final PlayerJoinEvent event) { + final PetMeta petMeta; + if (Config.getInstance().isJoin_enabled()) { + if (!this.manager.hasPetMeta(event.getPlayer()) || Config.getInstance().isJoin_overwriteExistingPet()) { + final PetMeta meta = this.manager.createPetMeta(event.getPlayer(), PetType.CAT); + Config.getInstance().fixJoinDefaultPet(meta); + this.manager.addPetMeta(meta); + this.manager.saveUnsecured(event.getPlayer(), meta); + } + } else { + this.manager.hasPetMeta(event.getPlayer()); + } + if ((petMeta = PetBlocksApi.getPetMeta(event.getPlayer())) != null && petMeta.isEnabled()) { + this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { + @Override + public void run() { + PetBlocksApi.removePetBlock(event.getPlayer()); + PetBlocksApi.setPetBlock(event.getPlayer(), PetDataListener.this.manager.getPetMeta(event.getPlayer())); + } + }, 2L); + } + } + + @EventHandler + public void playerQuitEvent(PlayerQuitEvent event) { + if (this.manager.hasPetMeta(event.getPlayer())) { + this.manager.persist(this.manager.getPetMeta(event.getPlayer())); + PetBlocksApi.removePetBlock(event.getPlayer()); + } + } + + @EventHandler + public void inventoryCloseEvent(InventoryCloseEvent event) { + final Player player = (Player) event.getPlayer(); + if (this.manager.inventories.containsKey(player)) { + this.manager.inventories.remove(player); + } + } + + @EventHandler(priority = EventPriority.HIGHEST) + public void playerChatEvent(PlayerChatEvent event) { + if (!Config.getInstance().isChat_async() && Config.getInstance().isChat_highestpriority()) { + this.handleChatMessage(event); + } + } + + @EventHandler(priority = EventPriority.LOWEST) + public void playerChatEvent2(PlayerChatEvent event) { + if (!Config.getInstance().isChat_async() && !Config.getInstance().isChat_highestpriority()) { + this.handleChatMessage(event); + } + } + + @EventHandler(priority = EventPriority.HIGHEST) + public void playerChatEvent3(final AsyncPlayerChatEvent event) { + if (Config.getInstance().isChat_async() && Config.getInstance().isChat_highestpriority()) { + if (this.namingPlayers.contains(event.getPlayer()) || this.namingSkull.contains(event.getPlayer())) + event.setCancelled(true); + this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { + @Override + public void run() { + PetDataListener.this.handleChatMessage(new PlayerChatEvent(event.getPlayer(), event.getMessage())); + } + }, 1L); + } + } + + @EventHandler(priority = EventPriority.LOW) + public void playerChatEvent4(final AsyncPlayerChatEvent event) { + if (Config.getInstance().isChat_async() && !Config.getInstance().isChat_highestpriority()) { + if (this.namingPlayers.contains(event.getPlayer()) || this.namingSkull.contains(event.getPlayer())) + event.setCancelled(true); + this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { + @Override + public void run() { + PetDataListener.this.handleChatMessage(new PlayerChatEvent(event.getPlayer(), event.getMessage())); + } + }, 1L); + } + } + + private void handleChatMessage(PlayerChatEvent event) { + if (this.namingPlayers.contains(event.getPlayer())) { + event.setCancelled(true); + if (event.getMessage().length() > ConfigPet.getInstance().getDesign_maxPetNameLength()) + event.getPlayer().sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); + else { + try { + this.namingPlayers.remove(event.getPlayer()); + final PetMeta petMeta; + final PetBlock petBlock; + if ((petMeta = this.manager.getPetMeta(event.getPlayer())) != null) { + petMeta.setDisplayName(event.getMessage()); + } + if ((petBlock = PetBlocksApi.getPetBlock(event.getPlayer())) != null) + petBlock.respawn(); + event.getPlayer().sendMessage(Language.PREFIX + Language.NAME_SUCCES_MESSAGE); + } catch (final Exception e) { + event.getPlayer().sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); + } + } + } else if (this.namingSkull.contains(event.getPlayer())) { + event.setCancelled(true); + if (event.getMessage().length() > 20) + event.getPlayer().sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); + else { + try { + this.namingSkull.remove(event.getPlayer()); + final PetMeta petMeta; + final PetBlock petBlock; + if ((petMeta = this.manager.getPetMeta(event.getPlayer())) != null) { + petMeta.setSkin(Material.SKULL_ITEM, (short) 3, event.getMessage()); + } + if ((petBlock = PetBlocksApi.getPetBlock(event.getPlayer())) != null) + petBlock.respawn(); + event.getPlayer().sendMessage(Language.PREFIX + Language.SNAME_SUCCES_MESSAGE); + } catch (final Exception e) { + event.getPlayer().sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); + } + } + } + } + + private Vector getDirection(Player player) { + final Vector vector = new Vector(); + final double rotX = player.getLocation().getYaw(); + final double rotY = player.getLocation().getPitch(); + vector.setY(-Math.sin(Math.toRadians(rotY))); + final double h = Math.cos(Math.toRadians(rotY)); + vector.setX(-h * Math.sin(Math.toRadians(rotX))); + vector.setZ(h * Math.cos(Math.toRadians(rotX))); + vector.setY(0.5); + return vector.multiply(3); + }*/ +} diff --git a/src/main/java/com/github/shynixn/petblocks/lib/DynamicCommandHelper.java b/src/main/java/com/github/shynixn/petblocks/lib/DynamicCommandHelper.java index e5d85d85f..f6609426f 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/DynamicCommandHelper.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/DynamicCommandHelper.java @@ -1,12 +1,14 @@ package com.github.shynixn.petblocks.lib; import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; +import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.command.defaults.BukkitCommand; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import java.util.ArrayList; +import java.util.logging.Level; /** * Created by Shynixn @@ -21,7 +23,11 @@ public DynamicCommandHelper(CommandContainer c) { this.usageMessage = c.getUseage(); this.setPermission(c.getPermission()); this.setAliases(new ArrayList()); - NMSRegistry.registerDynamicCommand(c.getCommand(), this); + try { + NMSRegistry.registerDynamicCommand(c.getCommand(), this); + } catch (Exception ex) { + Bukkit.getLogger().log(Level.WARNING,"Cannot register command.", ex); + } } @Override @@ -36,7 +42,6 @@ public boolean execute(CommandSender sender, String alias, String[] args) { public abstract void onCommandSend(CommandSender sender, String[] args); - public String getText(String[] args) { String s = ""; for (String k : args) { diff --git a/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java b/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java index 73f33edfd..da0a37112 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java @@ -46,7 +46,7 @@ public static Sound interPretSounds19(String sound) { } catch (Exception e) { e.printStackTrace(); } - throw new RuntimeException("Sounds Interpreter19 has got problems!"); + return null; } public static ItemStack getItemInHand19(Player player, boolean offHand) { diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/ReflectionUtils.java b/src/main/java/com/github/shynixn/petblocks/lib/util/ReflectionUtils.java new file mode 100644 index 000000000..57e067cd3 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/lib/util/ReflectionUtils.java @@ -0,0 +1,283 @@ +package com.github.shynixn.petblocks.lib.util; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +/** + * Copyright 2017 Shynixn + *

+ * Do not remove this header! + *

+ * Version 1.0 + *

+ * MIT License + *

+ * Copyright (c) 2016 + *

+ * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + *

+ * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + *

+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +public final class ReflectionUtils { + /** + * Initializes a new instance of reflectionUtils + */ + private ReflectionUtils() { + super(); + } + + /** + * Returns the class from the name and converts VERSION to the current server version. + * + * @param name name + * @return clazz + * @throws ClassNotFoundException exception + */ + public static Class invokeClass(String name) throws ClassNotFoundException { + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + return Class.forName(name); + } + + /** + * Creates a new instance of the given clazz with the default constructor + * + * @param clazz clazz + * @param returnType + * @return instance + */ + public static T invokeDefaultConstructor(Class clazz) throws IllegalAccessException, InstantiationException { + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + return clazz.newInstance(); + } + + /** + * Creates a new instance of the given clazz, paramTypes, params + * + * @param clazz clazz + * @param paramTypes paramTypes + * @param params params + * @param classType + * @return instance + * @throws IllegalAccessException exception + * @throws InvocationTargetException exception + * @throws InstantiationException exception + * @throws NoSuchMethodException exception + */ + public static T invokeConstructor(Class clazz, Class[] paramTypes, Object[] params) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException { + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + if (paramTypes == null) + throw new IllegalArgumentException("ParamTypes cannot be null"); + if (params == null) + throw new IllegalArgumentException("Params cannot be null!"); + final Constructor constructor = clazz.getDeclaredConstructor(paramTypes); + constructor.setAccessible(true); + return constructor.newInstance(params); + } + + /** + * Invokes the static method of the given clazz, name, paramTypes, params + * + * @param clazz clazz + * @param name name + * @param paramTypes paramTypes + * @param params params + * @param returnType + * @return returnValue + * @throws NoSuchMethodException exception + * @throws InvocationTargetException exception + * @throws IllegalAccessException exception + */ + public static T invokeMethodByClass(Class clazz, String name, Class[] paramTypes, Object[] params) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + if (paramTypes == null) + throw new IllegalArgumentException("ParamTypes cannot be null"); + if (params == null) + throw new IllegalArgumentException("Params cannot be null!"); + final Method method = clazz.getDeclaredMethod(name, paramTypes); + method.setAccessible(true); + return (T) method.invoke(null, params); + } + + /** + * Invokes the method of the given instance, name, paramTypes, params + * + * @param instance instance + * @param name name + * @param paramTypes paramTypes + * @param params params + * @param returnType + * @return returnValue + * @throws NoSuchMethodException exception + * @throws InvocationTargetException exception + * @throws IllegalAccessException exception + */ + public static T invokeMethodByObject(Object instance, String name, Class[] paramTypes, Object[] params) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + return invokeMethodByObject(instance, name, paramTypes, params, instance.getClass()); + } + + /** + * Invokes the method of the given instance, name, paramTypes, params + * + * @param instance instance + * @param name name + * @param paramTypes paramTypes + * @param params params + * @param clazz clazz + * @param returnType + * @return returnValue + * @throws NoSuchMethodException exception + * @throws InvocationTargetException exception + * @throws IllegalAccessException exception + */ + public static T invokeMethodByObject(Object instance, String name, Class[] paramTypes, Object[] params, Class clazz) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + if (instance == null) + throw new IllegalArgumentException("Instance cannot be null!"); + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + if (paramTypes == null) + throw new IllegalArgumentException("ParamTypes cannot be null"); + if (params == null) + throw new IllegalArgumentException("Params cannot be null!"); + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + final Method method = clazz.getDeclaredMethod(name, paramTypes); + method.setAccessible(true); + return (T) method.invoke(instance, params); + } + + /** + * Invokes the field of the given class and name + * + * @param clazz clazz + * @param name name + * @param returnType + * @return returnValue + * @throws NoSuchFieldException exception + * @throws IllegalAccessException exception + */ + public static T invokeFieldByClass(Class clazz, String name) throws NoSuchFieldException, IllegalAccessException { + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + final Field field = clazz.getDeclaredField(name); + field.setAccessible(true); + return (T) field.get(null); + } + + /** + * Invokes the field of the given instance and name + * + * @param instance instance + * @param name name + * @param returnType + * @return returnValue + */ + public static T invokeFieldByObject(Object instance, String name) throws NoSuchFieldException, IllegalAccessException { + return invokeFieldByObject(instance, name, instance.getClass()); + } + + /** + * Invokes the field of the given instance and name + * + * @param instance instance + * @param name name + * @param clazz clazz + * @param returnType + * @return returnValue + */ + public static T invokeFieldByObject(Object instance, String name, Class clazz) throws NoSuchFieldException, IllegalAccessException { + if (instance == null) + throw new IllegalArgumentException("Object cannot be null!"); + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + final Field field = clazz.getDeclaredField(name); + field.setAccessible(true); + return (T) field.get(instance); + } + + /** + * Invokes the annotation of the given clazz + * + * @param clazz clazz + * @param annotationClazz annotation + * @param returnType + * @return returnValue + */ + public static T invokeAnnotationByClass(Class clazz, Class annotationClazz) { + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + if (annotationClazz == null) + throw new IllegalArgumentException("AnnotationClass cannot be null!"); + for (final Annotation annotation : clazz.getDeclaredAnnotations()) { + if (annotation.annotationType() == annotationClazz) + return (T) annotation; + } + return null; + } + + /** + * Invokes the annotation of the given field + * + * @param field field + * @param annotationClazz annotation + * @param returnType + * @return returnValue + */ + public static T invokeAnnotationByField(Field field, Class annotationClazz) { + if (field == null) + throw new IllegalArgumentException("Field cannot be null!"); + if (annotationClazz == null) + throw new IllegalArgumentException("AnnotationClass cannot be null!"); + for (final Annotation annotation : field.getDeclaredAnnotations()) { + if (annotation.annotationType() == annotationClazz) + return (T) annotation; + } + return null; + } + + /** + * Invokes the annotation of the given method + * + * @param method method + * @param annotationClazz annotation + * @param returnType + * @return returnValue + */ + public static T invokeAnnotationByMethod(Method method, Class annotationClazz) { + if (method == null) + throw new IllegalArgumentException("Method cannot be null!"); + if (annotationClazz == null) + throw new IllegalArgumentException("AnnotationClass cannot be null!"); + for (final Annotation annotation : method.getDeclaredAnnotations()) { + if (annotation.annotationType() == annotationClazz) + return (T) annotation; + } + return null; + } +} \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/SimpleListener.java b/src/main/java/com/github/shynixn/petblocks/lib/util/SimpleListener.java new file mode 100644 index 000000000..1912f1a11 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/lib/util/SimpleListener.java @@ -0,0 +1,76 @@ +package com.github.shynixn.petblocks.lib.util; + +import org.bukkit.Bukkit; +import org.bukkit.event.HandlerList; +import org.bukkit.event.Listener; +import org.bukkit.plugin.Plugin; + +/** + * Copyright 2017 Shynixn + *

+ * Do not remove this header! + *

+ * Version 1.0 + *

+ * MIT License + *

+ * Copyright (c) 2016 + *

+ * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + *

+ * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + *

+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +public class SimpleListener implements Listener { + + final protected Plugin plugin; + + /** + * Initializes a new listener by plugin + * + * @param plugin plugin + */ + public SimpleListener(Plugin plugin) { + super(); + if (plugin == null) + throw new IllegalArgumentException("Plugin cannot be null!"); + this.plugin = plugin; + this.register(); + } + + /** + * Initializes a new listener by pluginname + * + * @param plugin plugin + */ + public SimpleListener(String plugin) { + this(Bukkit.getPluginManager().getPlugin(plugin)); + } + + /** + * Registers the listener to spigot + */ + final void register() { + Bukkit.getPluginManager().registerEvents(this, this.plugin); + } + + /** + * Unregisters the lister from spigot + */ + final void unregister() { + HandlerList.unregisterAll(this); + } +} \ No newline at end of file diff --git a/src/main/resources/sql/selectbyplayer.sql b/src/main/resources/sql/petblock/selectbyplayer.sql similarity index 100% rename from src/main/resources/sql/selectbyplayer.sql rename to src/main/resources/sql/petblock/selectbyplayer.sql diff --git a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetCommandExecutorTest.java b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetCommandExecutorTest.java new file mode 100644 index 000000000..1c9ff17d7 --- /dev/null +++ b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetCommandExecutorTest.java @@ -0,0 +1,126 @@ +package com.github.shynixn.business.logic.persistence2; + +import com.github.shynixn.petblocks.business.Config; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; +import com.github.shynixn.petblocks.business.logic.persistence2.Factory; +import com.github.shynixn.petblocks.business.logic.persistence2.IPetDataController; +import com.github.shynixn.petblocks.business.logic.persistence2.PetData; +import com.github.shynixn.petblocks.business.logic.persistence2.PlayerData; +import com.github.shynixn.petblocks.business.logic.persistence2.commandexecutor.PetDataCommandExecutor; +import com.github.shynixn.petblocks.lib.util.IDatabaseController; +import org.bukkit.Bukkit; +import org.bukkit.Server; +import org.bukkit.configuration.InvalidConfigurationException; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitScheduler; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.io.*; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.UUID; +import java.util.logging.Logger; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +/** + * Created by Shynixn + */ +public class PetCommandExecutorTest { + + @Before + public void prepareServer() { + BukkitScheduler scheduler = mock(BukkitScheduler.class); + when(scheduler.runTaskAsynchronously(any(Plugin.class), any(Runnable.class))).thenAnswer(new Answer() { + @Override + public Void answer(InvocationOnMock invocationOnMock) throws Throwable { + System.out.println("GOT YOU"); + Runnable runnable = invocationOnMock.getArgument(1); + runnable.run(); + return null; + } + }); + Server server = mock(Server.class); + Logger logger = Logger.getLogger("TestLogger"); + when(server.getLogger()).thenReturn(logger); + when(server.getScheduler()).thenReturn(scheduler); + try { + Bukkit.setServer(server); + } catch (Exception ex) { + + } + } + + @Test + public void renamePetTest() { + Plugin plugin = mockPlugin(); + Factory.enable(plugin); + Player player = mockPlayer(); + try (IPetDataController controller = Factory.createPetDataController(); + IDatabaseController playerController = Factory.createPlayerDataController()) { + for (PetData petData : controller.getAll()) { + controller.remove(petData); + } + for (PlayerData playerData : playerController.getAll()) { + playerController.remove(playerData); + } + + PlayerData playerData = PlayerData.from(player); + playerController.store(playerData); + PetData petData = PetData.from(playerData); + petData.setName("Maier"); + controller.store(petData); + + PetDataCommandExecutor petDataCommandExecutor = new PetDataCommandExecutor(plugin); + petDataCommandExecutor.onCommandSend(player, new String[]{"rename", "Gerhard"}); + petDataCommandExecutor.onCommandSend(player, new String[]{"rename", "22222222222222222222222222222222222222222"}); + petDataCommandExecutor.onCommandSend(player, new String[]{null,null}); + petDataCommandExecutor.onCommandSend(player, new String[]{"rename",null}); + + Assert.assertNotNull(controller.getByPlayer(player)); + Assert.assertEquals(controller.getByPlayer(player).getName(), "Gerhard"); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + private static Player mockPlayer() { + UUID uuid = UUID.randomUUID(); + Player player = mock(Player.class); + when(player.getName()).thenReturn("Shynixn"); + when(player.getUniqueId()).thenReturn(uuid); + when(player.hasPermission(any(String.class))).thenReturn(true); + return player; + } + + private static Plugin mockPlugin() { + YamlConfiguration configuration = new YamlConfiguration(); + try { + configuration.load(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.yml"))); + } catch (IOException | InvalidConfigurationException e) { + e.printStackTrace(); + } + Plugin plugin = mock(Plugin.class); + when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); + when(plugin.getConfig()).thenReturn(configuration); + when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { + String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); + } + }); + Config.initiliaze(plugin); + ConfigCommands.getInstance().load(plugin.getConfig()); + return plugin; + } +} diff --git a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetDataControllerTest.java b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetDataControllerTest.java new file mode 100644 index 000000000..66d1bb736 --- /dev/null +++ b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetDataControllerTest.java @@ -0,0 +1,76 @@ +package com.github.shynixn.business.logic.persistence2; + +import com.github.shynixn.petblocks.business.logic.persistence2.Factory; +import com.github.shynixn.petblocks.business.logic.persistence2.IPetDataController; +import com.github.shynixn.petblocks.business.logic.persistence2.PetData; +import com.github.shynixn.petblocks.business.logic.persistence2.PlayerData; +import com.github.shynixn.petblocks.lib.util.IController; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.junit.Assert; +import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.io.File; +import java.io.InputStream; +import java.util.UUID; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +/** + * Created by Shynixn + */ +public class PetDataControllerTest { + + private static Plugin mockPlugin() { + YamlConfiguration configuration = new YamlConfiguration(); + configuration.set("sql.local", true); + configuration.set("sql.host", "localhost"); + configuration.set("sql.port", 3306); + configuration.set("sql.database", "db"); + configuration.set("sql.username", "root"); + configuration.set("sql.password", ""); + Plugin plugin = mock(Plugin.class); + when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); + when(plugin.getConfig()).thenReturn(configuration); + when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { + String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); + } + }); + return plugin; + } + + @Test + public void getPetDataByPlayerTest() throws ClassNotFoundException { + Factory.enable(mockPlugin()); + final PetData petData = new PetData(); + petData.setName("Maier"); + try (IPetDataController petDataIController = Factory.createPetDataController()) { + PlayerData playerData = new PlayerData(); + try (IController playerDataIController = Factory.createPlayerDataController()) { + playerData.setName("Christoph"); + playerData.setUuid(UUID.randomUUID()); + playerDataIController.store(playerData); + petData.setPlayerId(playerData.getId()); + } + for (final PetData pet : petDataIController.getAll()) { + petDataIController.remove(pet); + } + petDataIController.store(petData); + Player player = mock(Player.class); + when(player.getUniqueId()).thenReturn(playerData.getUUID()); + PetData petData1 = petDataIController.getByPlayer(player); + Assert.assertEquals(petData1.getName(), petData.getName()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } +} diff --git a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java index 07cf8328f..d0aa43ec8 100644 --- a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java +++ b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java @@ -3,6 +3,7 @@ import ch.vorburger.exec.ManagedProcessException; import ch.vorburger.mariadb4j.DB; import com.github.shynixn.petblocks.business.logic.persistence2.Factory; +import com.github.shynixn.petblocks.business.logic.persistence2.IPetDataController; import com.github.shynixn.petblocks.business.logic.persistence2.PetData; import com.github.shynixn.petblocks.business.logic.persistence2.PlayerData; import com.github.shynixn.petblocks.lib.util.IController; @@ -10,9 +11,9 @@ import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.junit.Assert; -import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.mockito.invocation.InvocationOnMock; @@ -47,12 +48,9 @@ private static Plugin mockPlugin() { Plugin plugin = mock(Plugin.class); when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); when(plugin.getConfig()).thenReturn(configuration); - when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { - @Override - public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { - String file = invocationOnMock.getArgument(0); - return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); - } + when(plugin.getResource(any(String.class))).thenAnswer(invocationOnMock -> { + String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); }); return plugin; } From ae44ac3542182f0919787eae0df3a42329bce1b1 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 29 May 2017 10:38:49 +0200 Subject: [PATCH 03/23] Added database management. --- pom.xml | 17 +- sqlite-jdbc-3.16.1.jar | 0 .../shynixn/petblocks/api/PetBlocksApi.java | 13 +- .../petblocks/api/entities/PetMeta.java | 16 +- .../petblocks/api/entities/PetType.java | 5 +- .../petblocks/api/events/PetMetaEvent.java | 23 - .../persistence/controller}/IController.java | 2 +- .../controller}/IDatabaseController.java | 2 +- .../ParticleEffectMetaController.java | 11 + .../controller/PetMetaController.java | 23 + .../controller/PlayerMetaController.java | 17 + .../entity/ParticleEffectMeta.java | 398 +++++++++++++ .../persistence/entity/Persistenceable.java | 10 + .../api/persistence/entity/PetMeta.java | 51 ++ .../api/persistence/entity/PlayerMeta.java | 38 ++ .../petblocks/business/Permission.java | 3 + .../business/bukkit/PetBlocksPlugin.java | 2 +- .../nms/v1_12_R1/CustomGroundArmorstand.java | 403 +++++++++++++ .../bukkit/nms/v1_12_R1/CustomRabbit.java | 87 +++ .../bukkit/nms/v1_12_R1/CustomZombie.java | 90 +++ .../bukkit/nms/v1_12_R1/OwnerPathfinder.java | 101 ++++ .../logic/{persistence => business}/GUI.java | 2 +- .../business/PetBlockCommandExecutor.java | 2 +- .../logic/business/PetBlockManager.java | 1 - .../PetDataCommandExecutor.java | 2 +- .../PetDataListener.java | 38 +- .../logic/business/PetDataManager.java | 76 +++ .../business/logic/persistence/Factory.java | 106 ++++ .../logic/persistence/PetDataFileManager.java | 215 ------- .../logic/persistence/PetDataManager.java | 100 ---- .../ParticleEffectDataRepository.java} | 157 ++--- .../controller/PetDataRepository.java | 315 +++++++++++ .../controller}/PlayerDataRepository.java | 104 ++-- .../entity/ParticleEffectData.java} | 322 ++++------- .../persistence/entity/PersistenceObject.java | 24 + .../persistence/{ => entity}/PetData.java | 436 +++++++------- .../logic/persistence/entity/PlayerData.java | 69 +++ .../business/logic/persistence2/Factory.java | 119 ---- .../persistence2/IPetDataController.java | 23 - .../business/logic/persistence2/PetData.java | 55 -- .../logic/persistence2/PlayerData.java | 61 -- .../PetDataCommandExecutor.java | 70 --- .../business/logic/persistence2/ui/GUI.java | 212 ------- .../persistence2/ui/PetDataListener.java | 374 ------------ .../lib/{util => }/DataBaseRepository.java | 13 +- ... => ExtensionHikariConnectionContext.java} | 137 ++++- .../shynixn/petblocks/lib/Interpreter19.java | 9 +- .../shynixn/petblocks/lib/ParticleEffect.java | 38 +- .../lib/ParticleReflectionUtils.java | 279 +++++++++ .../petblocks/lib/ReflectionUtils.java | 534 +++++++++--------- .../lib/{util => }/SimpleListener.java | 2 +- .../petblocks/lib/util/ReflectionUtils.java | 283 ---------- .../petblocks/lib/util/SQLProvider.java | 86 --- src/main/resources/sql/create-mysql.sql | 34 +- src/main/resources/sql/create-sqlite.sql | 33 +- src/main/resources/sql/particle/count.sql | 1 + src/main/resources/sql/particle/delete.sql | 1 + src/main/resources/sql/particle/insert.sql | 2 + src/main/resources/sql/particle/selectall.sql | 1 + .../resources/sql/particle/selectbyid.sql | 1 + src/main/resources/sql/particle/update.sql | 1 + src/main/resources/sql/petblock/insert.sql | 2 +- .../resources/sql/petblock/selectbyplayer.sql | 2 +- .../sql/petblock/selectentrybyplayer.sql | 3 + src/main/resources/sql/petblock/update.sql | 2 +- src/main/resources/sql/player/update.sql | 2 +- .../persistence2/PetCommandExecutorTest.java | 126 ----- .../persistence2/PetDataControllerTest.java | 76 --- .../persistence2/PetdataDatabaseTest.java | 225 -------- .../persistence/controller/DatabaseTest.java | 62 ++ ...ParticleEffectMetaMySQLControllerTest.java | 156 +++++ ...articleEffectMetaSQLiteControllerTest.java | 137 +++++ .../PetMetaMySQLControllerTest.java | 226 ++++++++ .../PetMetaSQLiteControllerTest.java | 190 +++++++ .../PlayerMetaMySQLControllerTest.java | 149 +++++ .../PlayerMetaSQLiteControllerTest.java | 124 ++++ 76 files changed, 4184 insertions(+), 2948 deletions(-) create mode 100644 sqlite-jdbc-3.16.1.jar delete mode 100644 src/main/java/com/github/shynixn/petblocks/api/events/PetMetaEvent.java rename src/main/java/com/github/shynixn/petblocks/{lib/util => api/persistence/controller}/IController.java (96%) rename src/main/java/com/github/shynixn/petblocks/{lib/util => api/persistence/controller}/IDatabaseController.java (95%) create mode 100644 src/main/java/com/github/shynixn/petblocks/api/persistence/controller/ParticleEffectMetaController.java create mode 100644 src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.java create mode 100644 src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java create mode 100644 src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java create mode 100644 src/main/java/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.java create mode 100644 src/main/java/com/github/shynixn/petblocks/api/persistence/entity/PetMeta.java create mode 100644 src/main/java/com/github/shynixn/petblocks/api/persistence/entity/PlayerMeta.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.java rename src/main/java/com/github/shynixn/petblocks/business/logic/{persistence => business}/GUI.java (99%) rename src/main/java/com/github/shynixn/petblocks/business/logic/{persistence => business}/PetDataCommandExecutor.java (98%) rename src/main/java/com/github/shynixn/petblocks/business/logic/{persistence => business}/PetDataListener.java (93%) create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java delete mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataFileManager.java delete mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataManager.java rename src/main/java/com/github/shynixn/petblocks/business/logic/{persistence2/PetRepository.java => persistence/controller/ParticleEffectDataRepository.java} (55%) create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java rename src/main/java/com/github/shynixn/petblocks/business/logic/{persistence2 => persistence/controller}/PlayerDataRepository.java (63%) rename src/main/java/com/github/shynixn/petblocks/{lib/util/ParticleEffectBuilder.java => business/logic/persistence/entity/ParticleEffectData.java} (80%) create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PersistenceObject.java rename src/main/java/com/github/shynixn/petblocks/business/logic/persistence/{ => entity}/PetData.java (61%) create mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PlayerData.java delete mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java delete mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java delete mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java delete mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java delete mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/commandexecutor/PetDataCommandExecutor.java delete mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/GUI.java delete mode 100644 src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/PetDataListener.java rename src/main/java/com/github/shynixn/petblocks/lib/{util => }/DataBaseRepository.java (87%) rename src/main/java/com/github/shynixn/petblocks/lib/{util/DbConnectionContext.java => ExtensionHikariConnectionContext.java} (61%) create mode 100644 src/main/java/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.java rename src/main/java/com/github/shynixn/petblocks/lib/{util => }/SimpleListener.java (97%) delete mode 100644 src/main/java/com/github/shynixn/petblocks/lib/util/ReflectionUtils.java delete mode 100644 src/main/java/com/github/shynixn/petblocks/lib/util/SQLProvider.java create mode 100644 src/main/resources/sql/particle/count.sql create mode 100644 src/main/resources/sql/particle/delete.sql create mode 100644 src/main/resources/sql/particle/insert.sql create mode 100644 src/main/resources/sql/particle/selectall.sql create mode 100644 src/main/resources/sql/particle/selectbyid.sql create mode 100644 src/main/resources/sql/particle/update.sql create mode 100644 src/main/resources/sql/petblock/selectentrybyplayer.sql delete mode 100644 src/main/test/java/com/github/shynixn/business/logic/persistence2/PetCommandExecutorTest.java delete mode 100644 src/main/test/java/com/github/shynixn/business/logic/persistence2/PetDataControllerTest.java delete mode 100644 src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java create mode 100644 src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/DatabaseTest.java create mode 100644 src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java create mode 100644 src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java create mode 100644 src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java create mode 100644 src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java create mode 100644 src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java create mode 100644 src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java diff --git a/pom.xml b/pom.xml index a868c3e56..54b48b2a2 100644 --- a/pom.xml +++ b/pom.xml @@ -165,6 +165,13 @@ 1.0 ${basedir}/lib/spigot-1.11.2.jar + + net + minecraft112-PRE-R1 + system + 1.0 + ${basedir}/lib/spigot-1.12-pre5.jar + de.myzelyam supervanish @@ -213,9 +220,15 @@ 2.2.2 test + + org.junit.jupiter + junit-jupiter-api + RELEASE + test + - + \ No newline at end of file diff --git a/sqlite-jdbc-3.16.1.jar b/sqlite-jdbc-3.16.1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/src/main/java/com/github/shynixn/petblocks/api/PetBlocksApi.java b/src/main/java/com/github/shynixn/petblocks/api/PetBlocksApi.java index 11c276203..e7e74a606 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/PetBlocksApi.java +++ b/src/main/java/com/github/shynixn/petblocks/api/PetBlocksApi.java @@ -3,7 +3,7 @@ import com.github.shynixn.petblocks.api.entities.PetBlock; import com.github.shynixn.petblocks.api.entities.PetMeta; import com.github.shynixn.petblocks.business.logic.business.PetBlockManager; -import com.github.shynixn.petblocks.business.logic.persistence.PetDataManager; +import com.github.shynixn.petblocks.business.logic.business.PetDataManager; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; @@ -21,7 +21,6 @@ private static void init(JavaPlugin plugin) { private static void dispose(JavaPlugin plugin) { if (petBlockManager != null) { petBlockManager.killAll(); - dataManager.dispose(); } } @@ -61,10 +60,9 @@ public static PetBlock getPetBlock(Player player) { return null; } - public static PetMeta getPetMeta(Player player) { + public static com.github.shynixn.petblocks.api.persistence.entity.PetMeta getPetMeta(Player player) { if (player == null) throw new IllegalArgumentException("Player cannot be null!"); - dataManager.hasPetMeta(player); return dataManager.getPetMeta(player); } @@ -72,7 +70,7 @@ public static void removePetMeta(Player player) { if (player == null) throw new IllegalArgumentException("Player cannot be null!"); if (dataManager.hasPetMeta(player)) - dataManager.remove(getPetMeta(player)); + dataManager.remove((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)getPetMeta(player)); } public static void setPetMeta(Player player, PetType petType) { @@ -81,14 +79,13 @@ public static void setPetMeta(Player player, PetType petType) { if (petType == null) throw new IllegalArgumentException("Type cannot be null!"); final PetMeta meta = dataManager.createPetMeta(player, petType); - dataManager.addPetMeta(meta); - dataManager.persist(meta); + dataManager.persist((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)meta); } public static void persistPetMeta(PetMeta petMeta) { if (petMeta == null) throw new IllegalArgumentException("Meta cannot be null!"); - dataManager.persist(petMeta); + dataManager.persist((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)petMeta); } public static boolean hasPetMeta(Player player) { diff --git a/src/main/java/com/github/shynixn/petblocks/api/entities/PetMeta.java b/src/main/java/com/github/shynixn/petblocks/api/entities/PetMeta.java index 88e586172..0aa13fe99 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/entities/PetMeta.java +++ b/src/main/java/com/github/shynixn/petblocks/api/entities/PetMeta.java @@ -5,6 +5,7 @@ import java.io.Serializable; +@Deprecated public interface PetMeta extends Serializable { Movement getMovementType(); @@ -12,20 +13,14 @@ public interface PetMeta extends Serializable { PetType getType(); - Player getOwner(); - boolean isUnbreakable(); void setUnbreakable(boolean unbreakable); - Particle getParticleEffect(); - void setSoundsEnabled(boolean enabled); boolean isSoundsEnabled(); - void setParticleEffect(Particle particle); - void setHidden(boolean enabled); boolean isHidden(); @@ -67,4 +62,13 @@ public interface PetMeta extends Serializable { int getAgeInTicks(); Age getAge(); + + @Deprecated + Player getOwner(); + + @Deprecated + void setParticleEffect(Particle particle); + + @Deprecated + Particle getParticleEffect(); } diff --git a/src/main/java/com/github/shynixn/petblocks/api/entities/PetType.java b/src/main/java/com/github/shynixn/petblocks/api/entities/PetType.java index 56059b021..7ce8165a0 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/entities/PetType.java +++ b/src/main/java/com/github/shynixn/petblocks/api/entities/PetType.java @@ -95,10 +95,13 @@ public static String[] getNames() { } public static PetType getPetTypeFromName(String name) { - for (final PetType pet : PetType.values()) { + for (final PetType pet : PetType.values()) + { + System.out.println("IS " + pet.name() + " VS " + name); if (pet.name().equalsIgnoreCase(name)) return pet; } + System.out.println("NO QUERY"); return null; } } diff --git a/src/main/java/com/github/shynixn/petblocks/api/events/PetMetaEvent.java b/src/main/java/com/github/shynixn/petblocks/api/events/PetMetaEvent.java deleted file mode 100644 index 8645c509e..000000000 --- a/src/main/java/com/github/shynixn/petblocks/api/events/PetMetaEvent.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.github.shynixn.petblocks.api.events; - -import com.github.shynixn.petblocks.api.entities.PetMeta; -import com.github.shynixn.petblocks.lib.SpigotEvent; -import org.bukkit.entity.Player; - -public class PetMetaEvent extends SpigotEvent { - private final PetMeta meta; - - public PetMetaEvent(PetMeta meta) { - if (meta == null) - throw new IllegalArgumentException("PetMeta cannot be null!"); - this.meta = meta; - } - - public PetMeta getPetMeta() { - return this.meta; - } - - public Player getPlayer() { - return this.meta.getOwner(); - } -} diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/IController.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IController.java similarity index 96% rename from src/main/java/com/github/shynixn/petblocks/lib/util/IController.java rename to src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IController.java index 83e1928a2..a37ac8b91 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/util/IController.java +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IController.java @@ -1,4 +1,4 @@ -package com.github.shynixn.petblocks.lib.util; +package com.github.shynixn.petblocks.api.persistence.controller; import java.util.List; diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/IDatabaseController.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.java similarity index 95% rename from src/main/java/com/github/shynixn/petblocks/lib/util/IDatabaseController.java rename to src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.java index 69114dd1a..de12980c6 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/util/IDatabaseController.java +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.java @@ -1,4 +1,4 @@ -package com.github.shynixn.petblocks.lib.util; +package com.github.shynixn.petblocks.api.persistence.controller; /** * Copyright 2017 Shynixn diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/ParticleEffectMetaController.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/ParticleEffectMetaController.java new file mode 100644 index 000000000..89858f36a --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/ParticleEffectMetaController.java @@ -0,0 +1,11 @@ +package com.github.shynixn.petblocks.api.persistence.controller; + +import com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta; + +public interface ParticleEffectMetaController extends IDatabaseController { + /** + * Creates a new particleEffectMeta + * @return meta + */ + ParticleEffectMeta create(); +} diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.java new file mode 100644 index 000000000..db72b3b8e --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.java @@ -0,0 +1,23 @@ +package com.github.shynixn.petblocks.api.persistence.controller; + +import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; +import org.bukkit.entity.Player; + +/** + * Created by Shynixn + */ +public interface PetMetaController extends IDatabaseController { + /** + * Returns the petdata from the given player + * @param player player + * @return petData + */ + PetMeta getByPlayer(Player player); + + /** + * Checks if the player has got an entry in the database + * @param player player + * @return hasEntry + */ + boolean hasEntry(Player player); +} diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java new file mode 100644 index 000000000..dec44ce35 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java @@ -0,0 +1,17 @@ +package com.github.shynixn.petblocks.api.persistence.controller; + +import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; +import org.bukkit.entity.Player; + +/** + * Created by Shynixn + */ +public interface PlayerMetaController extends IDatabaseController { + + /** + * Creates a new playerData from the given player + * @param player player + * @return playerData + */ + PlayerMeta create(Player player); +} diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java new file mode 100644 index 000000000..50f43fe4c --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java @@ -0,0 +1,398 @@ +package com.github.shynixn.petblocks.api.persistence.entity; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Player; + +/** + * Created by Shynixn + */ +public interface ParticleEffectMeta extends Persistenceable{ + /** + * Sets the RGB colors of the particleEffect + * + * @param red red + * @param green green + * @param blue blue + * @return builder + */ + ParticleEffectMeta setColor(int red, int green, int blue); + + /** + * Sets the color of the particleEffect + * + * @param particleColor particleColor + * @return builder + */ + ParticleEffectMeta setColor(ParticleEffectMeta.ParticleColor particleColor); + + /** + * Sets the color for note particleEffect + * + * @param color color + * @return builder + */ + ParticleEffectMeta setNoteColor(int color); + + /** + * Sets the amount of particles of the particleEffect + * + * @param amount amount + * @return builder + */ + ParticleEffectMeta setAmount(int amount); + + /** + * Sets the speed of the particleEffect + * + * @param speed speed + * @return builder + */ + ParticleEffectMeta setSpeed(double speed); + + /** + * Sets the x coordinate of the particleEffect + * + * @param x x + * @return builder + */ + ParticleEffectMeta setX(double x); + + /** + * Sets the y coordinate of the particleEffect + * + * @param y y + * @return builder + */ + ParticleEffectMeta setY(double y); + + /** + * Sets the z coordinate of the particleEffect + * + * @param z z + * @return builder + */ + ParticleEffectMeta setZ(double z); + + /** + * Sets the effectType of the particleEffect + * + * @param name name + * @return builder + */ + ParticleEffectMeta setEffectName(String name); + + /** + * Sets the effectType of the particlEffect + * + * @param type type + * @return builder + */ + ParticleEffectMeta setEffectType(ParticleEffectMeta.ParticleEffectType type); + + /** + * Sets the blue of the RGB color + * + * @param blue blue + * @return builder + */ + ParticleEffectMeta setBlue(int blue); + + /** + * Sets the red of the RGB color + * + * @param red red + * @return builder + */ + ParticleEffectMeta setRed(int red); + + /** + * Sets the green of the RGB color + * + * @param green green + * @return builder + */ + ParticleEffectMeta setGreen(int green); + + /** + * Sets the material of the particleEffect + * + * @param material material + * @return builder + */ + ParticleEffectMeta setMaterial(Material material); + + /** + * Sets the data of the material of the particleEffect + * + * @param data data + * @return builder + */ + ParticleEffectMeta setData(Byte data); + + /** + * Returns the effect of the particleEffect + * + * @return effectName + */ + String getEffectName(); + + /** + * Returns the particleEffectType of the particleEffect + * + * @return effectType + */ + ParticleEffectMeta.ParticleEffectType getEffectType(); + + /** + * Returns the amount of particles of the particleEffect + * + * @return amount + */ + int getAmount(); + + /** + * Returns the speed of the particleEffect + * + * @return speed + */ + double getSpeed(); + + /** + * Returns the x coordinate of the particleEffect + * + * @return x + */ + double getX(); + + /** + * Returns the y coordinate of the particleEffect + * + * @return y + */ + double getY(); + + /** + * Returns the z coordinate of the particleEffect + * + * @return z + */ + double getZ(); + + /** + * Returns the RGB color blue of the particleEffect + * + * @return blue + */ + int getBlue(); + + /** + * Returns the RGB color red of the particleEffect + * + * @return red + */ + int getRed(); + + /** + * Returns the RGB color green of the particleEffect + * + * @return green + */ + int getGreen(); + + /** + * Returns the material of the particleEffect + * + * @return material + */ + Material getMaterial(); + + /** + * Returns the data of the particleEffect + * + * @return data + */ + Byte getData(); + + /** + * Returns if the particleEffect is a color particleEffect + * + * @return isColor + */ + boolean isColorParticleEffect(); + + /** + * Returns if the particleEffect is a note particleEffect + * + * @return isNote + */ + boolean isNoteParticleEffect(); + + /** + * Returns if the particleEffect is a materialParticleEffect + * + * @return isMaterial + */ + boolean isMaterialParticleEffect(); + + /** + * Plays the effect at the given location to the given players. + * + * @param location location + * @param players players + */ + void apply(Location location, Player... players); + + /** + * ParticleColors + */ + enum ParticleColor { + BLACK(0, 0, 0), + DARK_BLUE(0, 0, 170), + DARK_GREEN(0, 170, 0), + DARK_AQUA(0, 170, 170), + DARK_RED(170, 0, 0), + DARK_PURPLE(170, 0, 170), + GOLD(255, 170, 0), + GRAY(170, 170, 170), + DARK_GRAY(85, 85, 85), + BLUE(85, 85, 255), + GREEN(85, 255, 85), + AQUA(85, 255, 255), + RED(255, 85, 85), + LIGHT_PURPLE(255, 85, 255), + YELLOW(255, 255, 85), + WHITE(255, 255, 255); + + private final int red; + private final int green; + private final int blue; + + /** + * Initializes a new particleColor + * + * @param red red + * @param green green + * @param blue blue + */ + ParticleColor(int red, int green, int blue) { + this.red = red; + this.green = green; + this.blue = blue; + } + + /** + * Returns the RGB value red + * + * @return red + */ + public int getRed() { + return this.red; + } + + /** + * Returns the RGB value green + * + * @return green + */ + public int getGreen() { + return this.green; + } + + /** + * Returns the RGB value blue + * + * @return blue + */ + public int getBlue() { + return this.blue; + } + } + + /** + * ParticleEffectTypes + */ + enum ParticleEffectType { + EXPLOSION_NORMAL("explode", 0), + EXPLOSION_LARGE("largeexplode", 1), + EXPLOSION_HUGE("hugeexplosion", 2), + FIREWORKS_SPARK("fireworksSpark", 3), + WATER_BUBBLE("bubble", 4), + WATER_SPLASH("splash", 5), + WATER_WAKE("wake", 6), + SUSPENDED("suspended", 7), + SUSPENDED_DEPTH("depthsuspend", 8), + CRIT("crit", 9), + CRIT_MAGIC("magicCrit", 10), + SMOKE_NORMAL("smoke", 11), + SMOKE_LARGE("largesmoke", 12), + SPELL("spell", 13), + SPELL_INSTANT("instantSpell", 14), + SPELL_MOB("mobSpell", 15), + SPELL_MOB_AMBIENT("mobSpellAmbient", 16), + SPELL_WITCH("witchMagic", 17), + DRIP_WATER("dripWater", 18), + DRIP_LAVA("dripLava", 19), + VILLAGER_ANGRY("angryVillager", 20), + VILLAGER_HAPPY("happyVillager", 21), + TOWN_AURA("townaura", 22), + NOTE("note", 23), + PORTAL("portal", 24), + ENCHANTMENT_TABLE("enchantmenttable", 25), + FLAME("flame", 26), + LAVA("lava", 27), + FOOTSTEP("footstep", 28), + CLOUD("cloud", 29), + REDSTONE("reddust", 30), + SNOWBALL("snowballpoof", 31), + SNOW_SHOVEL("snowshovel", 32), + SLIME("slime", 33), + HEART("heart", 34), + BARRIER("barrier", 35), + ITEM_CRACK("iconcrack", 36), + BLOCK_CRACK("blockcrack", 37), + BLOCK_DUST("blockdust", 38), + WATER_DROP("droplet", 39), + ITEM_TAKE("take", 40), + MOB_APPEARANCE("mobappearance", 41), + DRAGON_BREATH("dragonbreath", 42), + END_ROD("endRod", 43), + DAMAGE_INDICATOR("damageIndicator", 44), + SWEEP_ATTACK("sweepAttack", 45), + FALLING_DUST("fallingdust", 46), + TOTEM("totem", 47), + SPIT("spit", 48); + + private final String simpleName; + private final int id; + + /** + * Initializes a new particleEffectType + * + * @param name name + * @param id id + */ + ParticleEffectType(String name, int id) { + this.simpleName = name; + this.id = id; + } + + /** + * Returns the id of the particleEffectType + * + * @return id + */ + public int getId() { + return this.id; + } + + /** + * Returns the name of the particleEffectType + * + * @return name + */ + public String getSimpleName() { + return this.simpleName; + } + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.java new file mode 100644 index 000000000..9e9de0117 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.java @@ -0,0 +1,10 @@ +package com.github.shynixn.petblocks.api.persistence.entity; + +public interface Persistenceable { + + /** + * Returns the id of the object + * @return id + */ + long getId(); +} diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/PetMeta.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/PetMeta.java new file mode 100644 index 000000000..91f8bedfe --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/PetMeta.java @@ -0,0 +1,51 @@ +package com.github.shynixn.petblocks.api.persistence.entity; + +public interface PetMeta extends com.github.shynixn.petblocks.api.entities.PetMeta, Persistenceable{ + /** + * Returns the id of the player + * @return playerId + */ + long getPlayerId(); + + /** + * Sets the id of the player + * @param id id + */ + void setPlayerId(long id); + + /** + * Returns the id of the particle + * @return particleId + */ + long getParticleId(); + + /** + * Sets the id of the particle + * @param id id + */ + void setParticleId(long id); + + /** + * Sets the particleEffect meta + * @param meta meta + */ + void setParticleEffectMeta(ParticleEffectMeta meta); + + /** + * Returns the particleEffect meta + * @return meta + */ + ParticleEffectMeta getParticleEffectMeta(); + + /** + * Sets the own meta + * @param meta meta + */ + void setPlayerMeta(PlayerMeta meta); + + /** + * Returns the meta of the owner + * @return player + */ + PlayerMeta getPlayerMeta(); +} diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/PlayerMeta.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/PlayerMeta.java new file mode 100644 index 000000000..e7d82fe65 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/PlayerMeta.java @@ -0,0 +1,38 @@ +package com.github.shynixn.petblocks.api.persistence.entity; + +import org.bukkit.entity.Player; + +import java.util.UUID; + +public interface PlayerMeta extends Persistenceable{ + + /** + * Returns the name of the playerData + * @return playerData + */ + String getName(); + + /** + * Sets the name of the playerData + * @param name name + */ + void setName(String name); + + /** + * Returns the uuid of the playerData + * @return uuid + */ + UUID getUUID(); + + /** + * Sets the uuid of the playerData + * @param uuid uuid + */ + void setUuid(UUID uuid); + + /** + * Returns the player of the playerData + * @return player + */ + Player getPlayer(); +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/Permission.java b/src/main/java/com/github/shynixn/petblocks/business/Permission.java index 9dacbfbc6..2eb07b522 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/Permission.java +++ b/src/main/java/com/github/shynixn/petblocks/business/Permission.java @@ -1,5 +1,7 @@ package com.github.shynixn.petblocks.business; +import java.util.*; + public enum Permission { ALLPETTYPES("petblocks.pet.type.all"), SINGLEPETTYPE("petblocks.pet.type."), @@ -27,4 +29,5 @@ public enum Permission { public String get() { return perm; } + } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java index 6278e5870..e120680d2 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java @@ -62,7 +62,7 @@ public List> getDatabaseClasses() { this.saveDefaultConfig(); if(this.getConfig().getBoolean("sql-enabled")) { if(BukkitUtilities.isVersionSupported()) { - list.add(ReflectionLib.getClassFromName("com.github.shynixn.petblocks.business.logic.persistence.PetData")); + list.add(ReflectionLib.getClassFromName("com.github.shynixn.petblocks.business.logic.persistence.entity.PetData")); } } return list; diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java new file mode 100644 index 000000000..8f1608109 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java @@ -0,0 +1,403 @@ +package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1; + +import com.github.shynixn.petblocks.api.entities.*; +import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; +import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; +import com.github.shynixn.petblocks.api.events.PetBlockSpawnEvent; +import net.minecraft.server.v1_12_R1.Entity; +import net.minecraft.server.v1_12_R1.EntityArmorStand; +import net.minecraft.server.v1_12_R1.EntityHuman; +import net.minecraft.server.v1_12_R1.EntityLiving; +import net.minecraft.server.v1_12_R1.EntityPlayer; +import net.minecraft.server.v1_12_R1.MathHelper; +import net.minecraft.server.v1_12_R1.MovingObjectPosition; +import net.minecraft.server.v1_12_R1.NBTTagCompound; +import net.minecraft.server.v1_12_R1.PacketPlayOutAnimation; +import net.minecraft.server.v1_12_R1.PacketPlayOutEntityTeleport; +import net.minecraft.server.v1_12_R1.PacketPlayOutMount; +import net.minecraft.server.v1_12_R1.Vec3D; +import net.minecraft.server.v1_12_R1.World; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.craftbukkit.v1_12_R1.CraftWorld; +import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import org.bukkit.metadata.FixedMetadataValue; +import org.bukkit.util.EulerAngle; +import org.bukkit.util.Vector; + +import java.lang.reflect.Field; +import java.util.logging.Level; +import java.util.logging.Logger; + +final class CustomGroundArmorstand extends EntityArmorStand implements PetBlock { + private PetMeta petMeta; + private Player owner; + + private boolean isSpecial; + private boolean isGround; + private boolean firstRide = true; + private CustomEntity rabbit; + private int counter; + + private boolean isDieing; + private double health = 20.0; + + private boolean hitflor; + + public CustomGroundArmorstand(World world) { + super(world); + } + + public CustomGroundArmorstand(Location location, PetMeta meta) { + super(((CraftWorld) location.getWorld()).getHandle()); + this.isSpecial = true; + this.petMeta = meta; + this.owner = meta.getOwner(); + if (meta.getMovementType() == Movement.HOPPING) + this.rabbit = new CustomRabbit(this.owner, meta); + else if (meta.getMovementType() == Movement.CRAWLING) + this.rabbit = new CustomZombie(this.owner, meta); + this.spawn(location); + } + + public CustomGroundArmorstand(World world, double d0, double d1, double d2) { + super(world, d0, d1, d2); + } + + private boolean isJumping() { + final Field jump; + try { + jump = EntityLiving.class.getDeclaredField("bd"); + jump.setAccessible(true); + for (final Entity entity : this.passengers) { + return jump.getBoolean(entity); + } + return false; + } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e1) { + Bukkit.getLogger().log(Level.WARNING, "Failed to inject jumping.", e1); + } + return false; + } + + private EntityHuman hasHumanPassenger() { + if (this.passengers != null) { + for (Entity entity : this.passengers) { + if (entity instanceof EntityHuman) + return (EntityHuman) entity; + } + } + return null; + } + + @Override + protected void doTick() { + if (this.isSpecial) { + this.counter = PetBlockHelper.doTick(this.counter, this, location -> { + CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + final PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); + } + }); + } + super.doTick(); + } + + @Override + public void a(float sideMot, float forMot, float unknown) { + if (this.isSpecial) { + if (this.hasHumanPassenger() != null) { + if (this.petMeta.getMoveType() == MoveType.WALKING) { + this.lastYaw = (this.yaw = this.hasHumanPassenger().yaw); + this.pitch = (this.hasHumanPassenger().pitch * 0.5F); + this.setYawPitch(this.yaw, this.pitch); + this.aP = (this.aN = this.yaw); + sideMot = this.hasHumanPassenger().be * 0.5F; + forMot = this.hasHumanPassenger().bf; + if (forMot <= 0.0F) { + forMot *= 0.25F; + } + if (this.onGround && this.isJumping()) { + double jumpHeight = 0.5D; + this.motY = jumpHeight; + } + this.P = (float) ConfigPet.getInstance().getModifier_petclimbing(); + // this.aR = (this.cq() * 0.1F); + if (!this.world.isClientSide) { + // this.l(0.35F); + super.g(sideMot * (float) ConfigPet.getInstance().getModifier_petriding(), forMot * (float) ConfigPet.getInstance().getModifier_petriding()); + } + this.aF = this.aG; + double d0 = this.locX - this.lastX; + double d1 = this.locZ - this.lastZ; + float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; + + if (f4 > 1.0F) { + f4 = 1.0F; + } + + this.aG += (f4 - this.aG) * 0.4F; + this.aH += this.aG; + } else { + float side = this.hasHumanPassenger().be * 0.5F; + float forw = this.hasHumanPassenger().bf; + Vector v = new Vector(); + Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); + if (side < 0.0F) { + l.setYaw(this.hasHumanPassenger().yaw - 90); + v.add(l.getDirection().normalize().multiply(-0.5)); + } else if (side > 0.0F) { + l.setYaw(this.hasHumanPassenger().yaw + 90); + v.add(l.getDirection().normalize().multiply(-0.5)); + } + + if (forw < 0.0F) { + l.setYaw(this.hasHumanPassenger().yaw); + v.add(l.getDirection().normalize().multiply(0.5)); + } else if (forw > 0.0F) { + l.setYaw(this.hasHumanPassenger().yaw); + v.add(l.getDirection().normalize().multiply(0.5)); + } + + this.lastYaw = this.yaw = this.hasHumanPassenger().yaw - 180; + this.pitch = this.hasHumanPassenger().pitch * 0.5F; + this.lastYaw = (this.yaw = this.hasHumanPassenger().yaw); + this.setYawPitch(this.yaw, this.pitch); + if (this.firstRide) { + this.firstRide = false; + v.setY(1F); + } + if (this.isJumping()) { + v.setY(0.5F); + this.isGround = true; + this.hitflor = false; + } else if (this.isGround) { + v.setY(-0.2F); + } + if (this.hitflor) { + v.setY(0); + l.add(v.multiply(2.25).multiply(ConfigPet.getInstance().getModifier_petriding())); + this.setPosition(l.getX(), l.getY(), l.getZ()); + } else { + l.add(v.multiply(2.25).multiply(ConfigPet.getInstance().getModifier_petriding())); + this.setPosition(l.getX(), l.getY(), l.getZ()); + } + Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); + Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); + if (movingobjectposition == null) { + this.bumper = l.toVector(); + } else { + if (this.bumper != null && ConfigPet.getInstance().isFollow_wallcolliding()) + this.setPosition(this.bumper.getX(), this.bumper.getY(), this.bumper.getZ()); + } + } + } else + this.firstRide = true; + } else { + super.g(sideMot, forMot); + } + } + + private Vector bumper; + + public void spawn(Location location) { + PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); + Bukkit.getPluginManager().callEvent(event); + if (!event.isCanceled()) { + NMSRegistry.accessWorldGuardSpawn(location); + this.rabbit.spawn(location); + World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + this.setPosition(location.getX(), location.getY(), location.getZ()); + mcWorld.addEntity(this, SpawnReason.CUSTOM); + NBTTagCompound compound = new NBTTagCompound(); + compound.setBoolean("invulnerable", true); + compound.setBoolean("Invisible", true); + compound.setBoolean("PersistenceRequired", true); + compound.setBoolean("ShowArms", true); + compound.setBoolean("NoBasePlate", true); + this.a(compound); + this.getArmorStand().setBodyPose(new EulerAngle(0, 0, 2878)); + this.getArmorStand().setLeftArmPose(new EulerAngle(2878, 0, 0)); + this.getArmorStand().setMetadata("keep", this.getKeepField()); + NMSRegistry.rollbackWorldGuardSpawn(location); + this.getArmorStand().setCustomNameVisible(true); + this.getArmorStand().setCustomName(this.petMeta.getDisplayName()); + this.getArmorStand().setRemoveWhenFarAway(false); + this.rabbit.getSpigotEntity().setRemoveWhenFarAway(false); + this.health = ConfigPet.getInstance().getCombat_health(); + if (this.petMeta == null) + return; + PetBlockHelper.setItemConsideringAge(this); + } + } + + @Override + public void teleportWithOwner(Location location) { + EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); + player.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); + for (Player player1 : this.owner.getWorld().getPlayers()) { + ((CraftPlayer) player1).getHandle().playerConnection.sendPacket(teleport); + } + } + + @Override + public void damage(double amount) { + if (amount < -1.0) { + this.hitflor = true; + } else { + this.health = PetBlockHelper.setDamage(this, this.health, amount, new PetBlockHelper.TickCallBack() { + @Override + public void run(Location location) { + PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); + for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); + } + } + }); + } + } + + @Override + public void respawn() { + PetBlockHelper.respawn(this, new PetBlockHelper.TickCallBack() { + @Override + public void run(Location location) { + CustomGroundArmorstand.this.spawn(location); + } + }); + } + + @Override + public LivingEntity getMovementEntity() { + if (this.rabbit == null) + return null; + return this.rabbit.getSpigotEntity(); + } + + @Override + public void setDieing() { + this.isDieing = PetBlockHelper.setDieing(this); + } + + @Override + public void refreshHeadMeta() { + PetBlockHelper.refreshHeadItemMeta(this, this.getArmorStand().getHelmet()); + } + + @Override + public boolean isDieing() { + return this.isDieing; + } + + @Override + public void setSkin(String skin) { + PetBlockHelper.setSkin(this, skin); + } + + @Override + public void setSkin(org.bukkit.Material material, byte data) { + PetBlockHelper.setSkin(this, material, data); + } + + @Override + public void remove() { + PetBlockHelper.remove(this); + } + + @Override + public void ride(Player player) { + PetBlockHelper.setRiding(this, player); + } + + @Override + public boolean isDead() { + return PetBlockHelper.isDead(this); + } + + @Override + public void teleport(Location location) { + PetBlockHelper.teleport(this, location); + } + + @Override + public void teleport(org.bukkit.entity.Entity entity) { + this.teleport(entity.getLocation()); + } + + @Override + public void jump() { + PetBlockHelper.jump(this); + } + + @Override + public void launch(Vector vector) { + PetBlockHelper.launch(this, vector); + } + + @Override + public void wear(final Player player) { + PetBlockHelper.wear(this, player, new PetBlockHelper.TickCallBack() { + @Override + public void run(Location location) { + PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); + } + } + }); + } + + @Override + public void setDisplayName(String name) { + PetBlockHelper.setDisplayName(this, name); + } + + @Override + public ArmorStand getArmorStand() { + return (ArmorStand) this.getBukkitEntity(); + } + + @Override + public void eject(final Player player) { + PetBlockHelper.eject(this, player, new PetBlockHelper.TickCallBack() { + @Override + public void run(Location location) { + PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); + } + } + }); + } + + @Override + public Player getOwner() { + return this.owner; + } + + @Override + public String getDisplayName() { + return this.getArmorStand().getCustomName(); + } + + @Override + public Location getLocation() { + return this.getArmorStand().getLocation(); + } + + @Override + public PetMeta getPetMeta() { + return this.petMeta; + } + + private FixedMetadataValue getKeepField() { + return new FixedMetadataValue(Bukkit.getPluginManager().getPlugin("PetBlocks"), true); + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java new file mode 100644 index 000000000..8459d2902 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java @@ -0,0 +1,87 @@ +package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1; + +import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; +import com.google.common.collect.Sets; +import com.github.shynixn.petblocks.api.entities.CustomEntity; +import com.github.shynixn.petblocks.api.entities.PetMeta; +import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; +import net.minecraft.server.v1_11_R1.*; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.craftbukkit.v1_11_R1.CraftWorld; +import org.bukkit.entity.Player; +import org.bukkit.entity.Rabbit; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import org.bukkit.metadata.FixedMetadataValue; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +public final class CustomRabbit extends EntityRabbit implements CustomEntity { + private Player player; + private PetMeta petData; + private long playedMovingSound = 100000; + + public CustomRabbit(World world) { + super(world); + } + + public CustomRabbit(Player player, PetMeta meta) { + super(((CraftWorld) player.getWorld()).getHandle()); + this.setSilent(true); + try { + Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + this.ignoreFinalField(bField); + this.ignoreFinalField(cField); + cField.setAccessible(true); + bField.set(this.goalSelector, Sets.newLinkedHashSet()); + bField.set(this.targetSelector, Sets.newLinkedHashSet()); + cField.set(this.goalSelector, Sets.newLinkedHashSet()); + cField.set(this.targetSelector, Sets.newLinkedHashSet()); + this.goalSelector.a(0, new PathfinderGoalFloat(this)); + this.goalSelector.a(1, new OwnerPathfinder(this, player)); + this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); + } catch (Exception exc) { + exc.printStackTrace(); + } + this.player = player; + this.petData = meta; + this.P = (float) ConfigPet.getInstance().getModifier_petclimbing(); + } + + private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { + field.setAccessible(true); + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + } + + @Override + protected SoundEffect di() { + this.playedMovingSound = PetBlockHelper.executeMovingSound(this.getBukkitEntity(), this.player, this.petData, this.playedMovingSound); + return super.di(); + } + + @Override + public void spawn(Location location) { + World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + this.setPosition(location.getX(), location.getY(), location.getZ()); + mcWorld.addEntity(this, SpawnReason.CUSTOM); + this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); + this.getSpigotEntity().setMetadata("keep", this.getKeepField()); + this.getSpigotEntity().setCustomNameVisible(false); + this.getSpigotEntity().setCustomName("PetBlockIdentifier"); + } + + @Override + public Rabbit getSpigotEntity() { + return (Rabbit) this.getBukkitEntity(); + } + + private FixedMetadataValue getKeepField() { + return new FixedMetadataValue(Bukkit.getPluginManager().getPlugin("PetBlocks"), true); + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.java new file mode 100644 index 000000000..065a94009 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.java @@ -0,0 +1,90 @@ +package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1; + +import com.github.shynixn.petblocks.api.entities.PetMeta; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; +import com.google.common.collect.Sets; +import com.github.shynixn.petblocks.api.entities.CustomEntity; +import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; +import net.minecraft.server.v1_11_R1.*; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.craftbukkit.v1_11_R1.CraftWorld; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.metadata.FixedMetadataValue; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +/** + * Created by Shynixn + */ +public final class CustomZombie extends EntityZombie implements CustomEntity { + private long playedMovingSound = 100000; + private PetMeta petMeta; + private Player player; + + public CustomZombie(World world) { + super(world); + } + + public CustomZombie(Player player, PetMeta meta) { + super(((CraftWorld) player.getWorld()).getHandle()); + this.setSilent(true); + try { + Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + this.ignoreFinalField(bField); + this.ignoreFinalField(cField); + cField.setAccessible(true); + bField.set(this.goalSelector, Sets.newLinkedHashSet()); + bField.set(this.targetSelector, Sets.newLinkedHashSet()); + cField.set(this.goalSelector, Sets.newLinkedHashSet()); + cField.set(this.targetSelector, Sets.newLinkedHashSet()); + this.goalSelector.a(0, new PathfinderGoalFloat(this)); + this.goalSelector.a(1, new OwnerPathfinder(this, player)); + this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); + } catch (Exception exc) { + exc.printStackTrace(); + } + this.player = player; + this.petMeta = meta; + this.P = (float) ConfigPet.getInstance().getModifier_petclimbing(); + } + + @Override + public void spawn(Location location) { + World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + this.setPosition(location.getX(), location.getY(), location.getZ()); + mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); + this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); + this.getSpigotEntity().setMetadata("keep", this.getKeepField()); + this.getSpigotEntity().setCustomNameVisible(false); + this.getSpigotEntity().setCustomName("PetBlockIdentifier"); + } + + @Override + protected void a(BlockPosition blockposition, Block block) { + this.playedMovingSound = PetBlockHelper.executeMovingSound(this.getBukkitEntity(), this.player, this.petMeta, this.playedMovingSound); + super.a(blockposition, block); + } + + @Override + public LivingEntity getSpigotEntity() { + return (LivingEntity) this.getBukkitEntity(); + } + + private FixedMetadataValue getKeepField() { + return new FixedMetadataValue(Bukkit.getPluginManager().getPlugin("PetBlocks"), true); + } + + private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { + field.setAccessible(true); + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.java new file mode 100644 index 000000000..d23620b49 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.java @@ -0,0 +1,101 @@ +package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1; + +import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; +import net.minecraft.server.v1_11_R1.EntityInsentient; +import net.minecraft.server.v1_11_R1.NBTTagCompound; +import net.minecraft.server.v1_11_R1.PathEntity; +import net.minecraft.server.v1_11_R1.PathfinderGoal; +import org.bukkit.Location; +import org.bukkit.craftbukkit.v1_11_R1.inventory.CraftItemStack; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.util.Vector; + +import java.util.Map; + +public final class OwnerPathfinder extends PathfinderGoal { + private final EntityInsentient entity; + private PathEntity path; + private final Player player; + + private int counter2; + private int counter; + + public OwnerPathfinder(EntityInsentient entitycreature, Player player) { + this.entity = entitycreature; + this.player = player; + } + + @Override + public boolean a() { + if (this.player == null) { + return this.path != null; + } + if (!this.entity.getWorld().getWorldData().getName().equals(this.player.getWorld().getName())) { + this.entity.getBukkitEntity().teleport(this.player.getLocation()); + } else if (this.entity.getBukkitEntity().getLocation().distance(this.player.getLocation()) > 2) { + this.counter2 = PetBlockHelper.afraidWaterEffect(this.entity.getBukkitEntity(), this.counter2); + Location targetLocation = this.player.getLocation(); + this.entity.getNavigation().n(); + this.entity.getNavigation(); + this.path = this.entity.getNavigation().a(targetLocation.getX() + 1, targetLocation.getY(), targetLocation.getZ() + 1); + this.entity.getNavigation(); + if (this.entity.getBukkitEntity().getLocation().distance(this.player.getLocation()) > ConfigPet.getInstance().getFollow_maxRangeTeleport()) + this.entity.getBukkitEntity().teleport(this.player.getLocation()); + if (Math.abs(this.entity.getBukkitEntity().getLocation().getY() - targetLocation.getY()) >= 2) { + this.counter++; + } else { + this.counter = 0; + } + if (this.counter > 5) { + this.entity.getBukkitEntity().setVelocity(new Vector(0.1, ConfigPet.getInstance().getModifier_petclimbing() * 0.1, 0.1)); + this.counter = 0; + } + if (this.path != null) { + this.c(); + } + } + return this.path != null; + } + + @Override + public void c() { + if (this.entity instanceof CustomRabbit) + this.entity.getNavigation().a(this.path, 2.5D); + else + this.entity.getNavigation().a(this.path, 1D); + } + + public static boolean isUnbreakable(ItemStack itemStack) { + net.minecraft.server.v1_11_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + return stack.getTag() != null && stack.getTag().hasKey("Unbreakable") && stack.getTag().getBoolean("Unbreakable"); + } + + public static ItemStack setItemstackTag(ItemStack itemStack, Map tags) { + net.minecraft.server.v1_11_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + for (String tag : tags.keySet()) { + NBTTagCompound nbtTagCompound; + if (stack.getTag() == null) + nbtTagCompound = new NBTTagCompound(); + else + nbtTagCompound = stack.getTag(); + if (tags.get(tag) instanceof String) + nbtTagCompound.setString(tag, (String) tags.get(tag)); + else if (tags.get(tag) instanceof Boolean) + nbtTagCompound.setBoolean(tag, (Boolean) tags.get(tag)); + else if (tags.get(tag) instanceof Integer) + nbtTagCompound.setInt(tag, (Integer) tags.get(tag)); + else if (tags.get(tag) instanceof Float) + nbtTagCompound.setFloat(tag, (Float) tags.get(tag)); + else if (tags.get(tag) instanceof Double) + nbtTagCompound.setDouble(tag, (Double) tags.get(tag)); + else if (tags.get(tag) instanceof Long) + nbtTagCompound.setLong(tag, (Long) tags.get(tag)); + else if (tags.get(tag) instanceof Byte) + nbtTagCompound.setByte(tag, (Byte) tags.get(tag)); + stack.setTag(nbtTagCompound); + } + return CraftItemStack.asCraftMirror(stack); + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/GUI.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/GUI.java similarity index 99% rename from src/main/java/com/github/shynixn/petblocks/business/logic/persistence/GUI.java rename to src/main/java/com/github/shynixn/petblocks/business/logic/business/GUI.java index a4758d3d3..b6e3f93d8 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/GUI.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/GUI.java @@ -1,4 +1,4 @@ -package com.github.shynixn.petblocks.business.logic.persistence; +package com.github.shynixn.petblocks.business.logic.business; import com.github.shynixn.petblocks.api.PetBlocksApi; import com.github.shynixn.petblocks.business.Config; diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java index 93d83866b..f643d9682 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java @@ -251,7 +251,7 @@ private void setPetPlayerCommand(Player player, String soul, String costume, int private void setPet(Player player, PetType petType, ItemStack itemStack) { final PetMeta meta = this.manager.dataManager.createPetMeta(player, petType); - this.manager.dataManager.addPetMeta(meta); + this.manager.dataManager.persist((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)meta); if (itemStack.getType() == Material.SKULL_ITEM) { final SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta(); if (skullMeta.getOwner() == null) { diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java index bbe03a756..3980ee7c5 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java @@ -5,7 +5,6 @@ import java.util.List; import java.util.Map; -import com.github.shynixn.petblocks.business.logic.persistence.PetDataManager; import com.github.shynixn.petblocks.api.events.PetBlockDeathEvent; import org.bukkit.Bukkit; import org.bukkit.entity.Player; diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataCommandExecutor.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataCommandExecutor.java similarity index 98% rename from src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataCommandExecutor.java rename to src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataCommandExecutor.java index bb45a9f67..37d366307 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataCommandExecutor.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataCommandExecutor.java @@ -1,4 +1,4 @@ -package com.github.shynixn.petblocks.business.logic.persistence; +package com.github.shynixn.petblocks.business.logic.business; import com.github.shynixn.petblocks.api.PetBlocksApi; import com.github.shynixn.petblocks.api.entities.PetBlock; diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataListener.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java similarity index 93% rename from src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataListener.java rename to src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java index fa65b3ee6..6189d5728 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataListener.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java @@ -1,4 +1,4 @@ -package com.github.shynixn.petblocks.business.logic.persistence; +package com.github.shynixn.petblocks.business.logic.business; import java.util.ArrayList; import java.util.List; @@ -30,7 +30,6 @@ import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; -import com.github.shynixn.petblocks.api.events.PetMetaEvent; import com.github.shynixn.petblocks.lib.BukkitUtilities; @SuppressWarnings("deprecation") @@ -56,11 +55,10 @@ public void playerClickEvent(final InventoryClickEvent event) { if (PetBlocksApi.hasPetBlock(player)) PetBlocksApi.removePetBlock(player); petMeta = this.manager.createPetMeta(player, type); - this.manager.addPetMeta(petMeta); if (ConfigGUI.getInstance().isSettings_copyskin()) { petMeta.setSkin(Material.SKULL_ITEM, (short) 3, ConfigGUI.getInstance().getContainer(petMeta.getType()).getSkullName()); } - this.manager.persist(petMeta); + this.manager.persist((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)petMeta); this.manager.gui.setMainItems(player, petMeta.getType(), false, true); } else { player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); @@ -205,12 +203,6 @@ public void playerClickEvent(final InventoryClickEvent event) { } } - @EventHandler - public void petDataChangeEvent(PetMetaEvent event) { - if (this.getPlugin().getConfig().getBoolean("sql.enabled")) - this.manager.persist(event.getPetMeta()); - } - @EventHandler public void playerJoinEvent(final PlayerJoinEvent event) { final PetMeta petMeta; @@ -218,19 +210,15 @@ public void playerJoinEvent(final PlayerJoinEvent event) { if (!this.manager.hasPetMeta(event.getPlayer()) || Config.getInstance().isJoin_overwriteExistingPet()) { final PetMeta meta = this.manager.createPetMeta(event.getPlayer(), PetType.CAT); Config.getInstance().fixJoinDefaultPet(meta); - this.manager.addPetMeta(meta); - this.manager.saveUnsecured(event.getPlayer(), meta); + this.manager.persist((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)meta); } } else { this.manager.hasPetMeta(event.getPlayer()); } if ((petMeta = PetBlocksApi.getPetMeta(event.getPlayer())) != null && petMeta.isEnabled()) { - this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { - @Override - public void run() { - PetBlocksApi.removePetBlock(event.getPlayer()); - PetBlocksApi.setPetBlock(event.getPlayer(), PetDataListener.this.manager.getPetMeta(event.getPlayer())); - } + this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), () -> { + PetBlocksApi.removePetBlock(event.getPlayer()); + PetBlocksApi.setPetBlock(event.getPlayer(), PetDataListener.this.manager.getPetMeta(event.getPlayer())); }, 2L); } } @@ -270,12 +258,7 @@ public void playerChatEvent3(final AsyncPlayerChatEvent event) { if (Config.getInstance().isChat_async() && Config.getInstance().isChat_highestpriority()) { if (this.namingPlayers.contains(event.getPlayer()) || this.namingSkull.contains(event.getPlayer())) event.setCancelled(true); - this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { - @Override - public void run() { - PetDataListener.this.handleChatMessage(new PlayerChatEvent(event.getPlayer(), event.getMessage())); - } - }, 1L); + this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), () -> PetDataListener.this.handleChatMessage(new PlayerChatEvent(event.getPlayer(), event.getMessage())), 1L); } } @@ -284,12 +267,7 @@ public void playerChatEvent4(final AsyncPlayerChatEvent event) { if (Config.getInstance().isChat_async() && !Config.getInstance().isChat_highestpriority()) { if (this.namingPlayers.contains(event.getPlayer()) || this.namingSkull.contains(event.getPlayer())) event.setCancelled(true); - this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { - @Override - public void run() { - PetDataListener.this.handleChatMessage(new PlayerChatEvent(event.getPlayer(), event.getMessage())); - } - }, 1L); + this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), () -> PetDataListener.this.handleChatMessage(new PlayerChatEvent(event.getPlayer(), event.getMessage())), 1L); } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java new file mode 100644 index 000000000..ddab47aed --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java @@ -0,0 +1,76 @@ +package com.github.shynixn.petblocks.business.logic.business; + +import java.util.HashMap; +import java.util.Map; + +import com.github.shynixn.petblocks.api.entities.PetType; +import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; +import com.github.shynixn.petblocks.business.Config; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; +import com.github.shynixn.petblocks.api.persistence.controller.PetMetaController; +import com.github.shynixn.petblocks.business.logic.persistence.Factory; +import com.github.shynixn.petblocks.business.logic.persistence.entity.PetData; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; + +import com.github.shynixn.petblocks.api.PetBlocksApi; + +import com.github.shynixn.petblocks.business.Language; + +public final class PetDataManager { + private final PetMetaController petDataController; + Map inventories = new HashMap<>(); + Map pages = new HashMap<>(); + GUI gui; + + public PetDataManager(JavaPlugin plugin) { + super(); + this.gui = new GUI(this); + new PetDataCommandExecutor(this); + new PetDataListener(this, plugin); + this.petDataController = Factory.createPetDataController(); + } + + public PetMeta createPetMeta(Player player, PetType petType) { + final ItemStack itemStack = ConfigGUI.getInstance().getGeneral_defaultAppearanceContainer().generate(); + final PetData petData = new PetData(player, petType, Language.getDefaultPetName(player), itemStack, ConfigGUI.getInstance().getGeneral_defaultAppearanceContainer().getSkullName()); + petData.setMoveType(Config.getInstance().getMovingType(petType)); + petData.setMovementType(ConfigGUI.getInstance().getContainer(petType).getMovement()); + petData.setIsBuild(true); + return petData; + } + + public void persist(PetMeta petMeta) { + if (petMeta == null) + throw new IllegalArgumentException("PetMeta cannot be null!"); + if (PetBlocksApi.hasPetBlock(petMeta.getOwner())) + petMeta.setEnabled(true); + + + + + + this.petDataController.store(petMeta); + } + + + public void remove(PetMeta petMeta) { + if (petMeta == null) + throw new IllegalArgumentException("PetMeta cannot be null!"); + this.petDataController.remove(petMeta); + } + + public PetMeta getPetMeta(Player player) { + if (player == null) + throw new IllegalArgumentException("Player cannot be null!"); + return this.petDataController.getByPlayer(player); + } + + public boolean hasPetMeta(Player player) { + if (player == null) + throw new IllegalArgumentException("Player cannot be null!"); + return this.petDataController.hasEntry(player); + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java new file mode 100644 index 000000000..34fbb5bc3 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java @@ -0,0 +1,106 @@ +package com.github.shynixn.petblocks.business.logic.persistence; + +import com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController; +import com.github.shynixn.petblocks.api.persistence.controller.PetMetaController; +import com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController; +import com.github.shynixn.petblocks.business.logic.persistence.controller.*; +import com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext; +import org.apache.commons.io.IOUtils; +import org.bukkit.Bukkit; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.plugin.Plugin; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.regex.Pattern; + +public class Factory { + + private static ExtensionHikariConnectionContext connectionContext; + + public static PlayerMetaController createPlayerDataController() { + return new PlayerDataRepository(connectionContext); + } + + public static ParticleEffectMetaController createParticleEffectController() { + return new ParticleEffectDataRepository(connectionContext); + } + + public static PetMetaController createPetDataController() { + return new PetDataRepository(connectionContext); + } + + public static void disable() { + if (connectionContext == null) + return; + connectionContext.close(); + connectionContext = null; + } + + public synchronized static void initialize(Plugin plugin) { + if (connectionContext != null) + return; + if (plugin == null) + throw new IllegalArgumentException("Plugin cannot be null!"); + ExtensionHikariConnectionContext.SQlRetriever retriever = (ExtensionHikariConnectionContext.SQlRetriever) fileName -> { + try (InputStream stream = plugin.getResource("sql/" + fileName + ".sql")) { + return IOUtils.toString(stream, "UTF-8"); + } catch (final IOException e) { + Bukkit.getLogger().log(Level.WARNING, "Cannot read file.", fileName); + throw new RuntimeException(); + } + }; + if (plugin.getConfig().getBoolean("sql.local")) { + try { + if (!plugin.getDataFolder().exists()) + plugin.getDataFolder().mkdir(); + File file = new File(plugin.getDataFolder(), "PetBlocks.db"); + if (!file.exists()) + file.createNewFile(); + connectionContext = ExtensionHikariConnectionContext.from(ExtensionHikariConnectionContext.SQLITE_DRIVER, "jdbc:sqlite:" + file.getAbsolutePath(), retriever); + try (Connection connection = connectionContext.getConnection()) { + connectionContext.execute("PRAGMA foreign_keys=ON", connection); + } + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Cannot execute statement.", e); + } catch (final IOException e) { + Bukkit.getLogger().log(Level.WARNING, "Cannot read file.", e); + } + try (Connection connection = connectionContext.getConnection()) { + for (String data : connectionContext.getStringFromFile("create-sqlite").split(Pattern.quote(";"))) { + System.out.println("EXECUTE " + data); + connectionContext.executeUpdate(data, connection); + } + } catch (Exception e) { + Bukkit.getLogger().log(Level.WARNING, "Cannot execute exception.", e); + } + } else { + FileConfiguration c = plugin.getConfig(); + try { + connectionContext = ExtensionHikariConnectionContext.from(ExtensionHikariConnectionContext.MYSQL_DRIVER, "jdbc:mysql://" + , c.getString("sql.host") + , c.getInt("sql.port") + , c.getString("sql.database") + , c.getString("sql.username") + , c.getString("sql.password") + , retriever); + } catch (IOException e) { + e.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "Cannot read file.", e); + } + try (Connection connection = connectionContext.getConnection()) { + for (String data : connectionContext.getStringFromFile("create-mysql").split(Pattern.quote(";"))) { + System.out.println("EXECUTE " + data); + connectionContext.executeUpdate(data, connection); + } + } catch (Exception e) { + e.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "Cannot execute exception.", e); + } + } + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataFileManager.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataFileManager.java deleted file mode 100644 index e88bddc39..000000000 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataFileManager.java +++ /dev/null @@ -1,215 +0,0 @@ -package com.github.shynixn.petblocks.business.logic.persistence; - -import com.avaje.ebean.SqlQuery; -import com.avaje.ebean.SqlRow; -import com.github.shynixn.petblocks.api.entities.MoveType; -import com.github.shynixn.petblocks.api.entities.Movement; -import com.github.shynixn.petblocks.api.entities.Particle; -import com.github.shynixn.petblocks.api.entities.PetType; -import com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin; -import com.github.shynixn.petblocks.lib.AsyncRunnable; -import com.github.shynixn.petblocks.lib.BukkitUtilities; -import com.github.shynixn.petblocks.lib.ParticleBuilder; -import com.github.shynixn.petblocks.lib.ParticleEffect; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import javax.persistence.PersistenceException; -import java.io.File; -import java.util.logging.Level; - -class PetDataFileManager { - private final JavaPlugin plugin; - - PetDataFileManager(JavaPlugin plugin) { - super(); - this.plugin = plugin; - } - - private File getFolder() { - final File file = new File(this.plugin.getDataFolder(), "Pets"); - if (!file.exists() && !file.mkdir()) - Bukkit.getLogger().log(Level.WARNING, "Cannot create resource folder."); - return file; - } - - private boolean isSqlEnabled() { - return this.plugin.getConfig().getBoolean("sql-enabled"); - } - - void connectToDataBase() { - AsyncRunnable.toAsynchroneThread(new AsyncRunnable() { - @Override - public void run() { - if (PetDataFileManager.this.isSqlEnabled()) { - BukkitUtilities.sendColorMessage("Connecting to database...'", ChatColor.GREEN, PetBlocksPlugin.PREFIX_CONSOLE); - try { - PetDataFileManager.this.plugin.getDatabase().find(PetData.class).findRowCount(); - final SqlQuery query = PetDataFileManager.this.plugin.getDatabase().createSqlQuery("DESCRIBE `petblock`"); - boolean found = false; - boolean foundbreak = false; - boolean foundSound = false; - for (SqlRow row : query.findList()) { - if (row.getString("field").equals("movement")) { - found = true; - } - if (row.getString("field").equals("sounds")) { - foundSound = true; - } - if (row.getString("field").equals("unbreakable")) { - foundbreak = true; - } - } - query.cancel(); - if (!found || !foundSound || !foundbreak) { - BukkitUtilities.sendColorMessage("Outdated petblock database! Removing database...'", ChatColor.YELLOW, PetBlocksPlugin.PREFIX_CONSOLE); - PetDataFileManager.this.plugin.getDatabase().createSqlUpdate("drop table petblock").execute(); - BukkitUtilities.sendColorMessage("Finished removing database!", ChatColor.YELLOW, PetBlocksPlugin.PREFIX_CONSOLE); - throw new PersistenceException("Install"); - } - BukkitUtilities.sendColorMessage("Successfully connected to your database!", ChatColor.GREEN, PetBlocksPlugin.PREFIX_CONSOLE); - } catch (final PersistenceException ex) { - BukkitUtilities.sendColorMessage("Cannot find petblocks resources! Installing database...'", ChatColor.GREEN, PetBlocksPlugin.PREFIX_CONSOLE); - final PetBlocksPlugin plugin2 = (PetBlocksPlugin) PetDataFileManager.this.plugin; - plugin2.setupDatabase(); - BukkitUtilities.sendColorMessage("Successfully connected to your database!", ChatColor.GREEN, PetBlocksPlugin.PREFIX_CONSOLE); - } catch (final Exception ex) { - Bukkit.getLogger().log(Level.WARNING,"Cannot connect to your database!" , ex); - } - } - } - }); - } - - private synchronized void saveDataBase(Player player, PetData petData) { - try { - if (this.plugin.getDatabase().find(PetData.class).where().ieq("uuid", player.getUniqueId().toString()).findUnique() == null) { - this.plugin.getDatabase().save(petData); - } else { - this.plugin.getDatabase().update(petData); - } - } catch (final Exception e) { - Bukkit.getLogger().log(Level.WARNING, "Cannot save petData from player.", e); - } - } - - private PetData loadDataBase(Player player) { - try { - PetData data = this.plugin.getDatabase().find(PetData.class).where().ieq("uuid", player.getUniqueId().toString()).findUnique(); - if (data != null) { - data = data.copy(); - data.setOwner(player); - data.setIsBuild(true); - } - return data; - } catch (final Exception e) { - Bukkit.getLogger().log(Level.WARNING, "Cannot load petData from player.", e); - } - return null; - } - - void save(final Player player, final PetData petData, boolean instant) { - if (!instant) { - this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, new Runnable() { - - @Override - public void run() { - try { - if (PetDataFileManager.this.isSqlEnabled()) - PetDataFileManager.this.saveDataBase(player, petData); - else - PetDataFileManager.this.saveDefault(player, petData); - } catch (final Exception ex) { - Bukkit.getLogger().log(Level.WARNING, "Cannot save petData from player.", ex); - } - } - }); - } else { - if (this.isSqlEnabled()) - this.saveDataBase(player, petData); - else - this.saveDefault(player, petData); - } - } - - private void saveDefault(Player player, PetData petData) { - try { - final FileConfiguration dataConfig = new YamlConfiguration(); - final File file = BukkitUtilities.createFile(new File(this.getFolder(), player.getUniqueId().toString() + ".yml")); - dataConfig.load(file); - dataConfig.set("pet.petname", petData.getDisplayName()); - dataConfig.set("pet.type", petData.getPetType().name().toUpperCase()); - dataConfig.set("pet.id", petData.getSkinMaterial().getId()); - dataConfig.set("pet.durability", petData.getSkinDurability()); - dataConfig.set("pet.skullname", petData.getSkin()); - dataConfig.set("pet.enabled", petData.isEnabled()); - dataConfig.set("pet.age", petData.getAgeInTicks()); - dataConfig.set("pet.unbreakable", petData.isUnbreakable()); - dataConfig.set("pet.sounds", petData.isSoundsEnabled()); - dataConfig.set("pet.moving", petData.getMoveType().name().toUpperCase()); - dataConfig.set("pet.movement", petData.getMovementType().name().toUpperCase()); - if (petData.getParticleEffect() != null) { - dataConfig.set("pet.particle.name", petData.getParticleEffect().getEffect().getName()); - dataConfig.set("pet.particle.x", petData.getParticleEffect().getX()); - dataConfig.set("pet.particle.y", petData.getParticleEffect().getY()); - dataConfig.set("pet.particle.z", petData.getParticleEffect().getZ()); - dataConfig.set("pet.particle.speed", petData.getParticleEffect().getSpeed()); - dataConfig.set("pet.particle.amount", petData.getParticleEffect().getAmount()); - dataConfig.set("pet.particle.block.id", petData.getParticleEffect().getMaterialId()); - dataConfig.set("pet.particle.block.damage", petData.getParticleEffect().getData()); - } - dataConfig.save(file); - } catch (final Exception e) { - Bukkit.getLogger().log(Level.WARNING, "Cannot save petData from player.", e); - } - } - - private PetData loadDefault(Player player) { - try { - final FileConfiguration dataConfig = new YamlConfiguration(); - final File file = new File(this.getFolder(), player.getUniqueId().toString() + ".yml"); - if (file.exists()) { - dataConfig.load(file); - final PetData petData = new PetData(player, PetType.getPetTypeFromName(dataConfig.getString("pet.type"))); - petData.setSkin(Material.getMaterial(dataConfig.getInt("pet.id")), (short) dataConfig.getInt("pet.durability"), dataConfig.getString("pet.skullname")); - petData.setDisplayName(dataConfig.getString("pet.petname")); - petData.setEnabled(dataConfig.getBoolean("pet.enabled")); - petData.setAgeInTicks(dataConfig.getInt("pet.age")); - if (dataConfig.contains("pet.unbreakable")) - petData.setUnbreakable(dataConfig.getBoolean("pet.unbreakable")); - petData.setSoundsEnabled(dataConfig.getBoolean("pet.sounds")); - petData.setMovementType(Movement.getMovementFromName(dataConfig.getString("pet.movement"))); - if (MoveType.getMoveTypeFromName(dataConfig.getString("pet.moving")) == null) - petData.setMoveType(MoveType.WALKING); - else - petData.setMoveType(MoveType.getMoveTypeFromName(dataConfig.getString("pet.moving"))); - if (ParticleEffect.getParticleEffectFromName(dataConfig.getString("pet.particle.name")) != null) { - final Particle particle = new ParticleBuilder() - .setEffect(ParticleEffect.getParticleEffectFromName(dataConfig.getString("pet.particle.name"))) - .setOffset(dataConfig.getDouble("pet.particle.x"), dataConfig.getDouble("pet.particle.y"), dataConfig.getDouble("pet.particle.z")) - .setSpeed(dataConfig.getDouble("pet.particle.speed")) - .setAmount(dataConfig.getInt("pet.particle.amount")) - .setMaterialId(dataConfig.getInt("pet.particle.block.id")) - .setData((byte) dataConfig.getInt("pet.particle.block.damage")).build(); - petData.setParticleEffect(particle); - } - return petData; - } - } catch (final Exception e) { - Bukkit.getLogger().log(Level.WARNING, "Cannot load petData from player.", e); - } - return null; - } - - public PetData load(Player player) { - if (this.isSqlEnabled()) - return this.loadDataBase(player); - else - return this.loadDefault(player); - } -} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataManager.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataManager.java deleted file mode 100644 index 4a46f3bcd..000000000 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetDataManager.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.github.shynixn.petblocks.business.logic.persistence; - -import java.util.HashMap; -import java.util.Map; - -import com.github.shynixn.petblocks.business.Config; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.java.JavaPlugin; - -import com.github.shynixn.petblocks.api.PetBlocksApi; -import com.github.shynixn.petblocks.api.entities.PetMeta; -import com.github.shynixn.petblocks.api.entities.PetType; -import com.github.shynixn.petblocks.api.events.PetMetaEvent; -import com.github.shynixn.petblocks.business.Language; - -public final class PetDataManager { - private final PetDataFileManager fileManager; - private final Map petContainer = new HashMap<>(); - - Map inventories = new HashMap<>(); - Map pages = new HashMap<>(); - GUI gui; - - public PetDataManager(JavaPlugin plugin) { - super(); - this.gui = new GUI(this); - new PetDataCommandExecutor(this); - new PetDataListener(this, plugin); - this.fileManager = new PetDataFileManager(plugin); - this.fileManager.connectToDataBase(); - } - - public PetMeta createPetMeta(Player player, PetType petType) { - final ItemStack itemStack = ConfigGUI.getInstance().getGeneral_defaultAppearanceContainer().generate(); - final PetData petData = new PetData(player, petType, Language.getDefaultPetName(player), itemStack, ConfigGUI.getInstance().getGeneral_defaultAppearanceContainer().getSkullName()); - petData.setMoveType(Config.getInstance().getMovingType(petType)); - petData.setMovementType(ConfigGUI.getInstance().getContainer(petType).getMovement()); - petData.setIsBuild(true); - return petData; - } - - public void addPetMeta(PetMeta meta) { - if (meta.getOwner() != null && meta instanceof PetData) { - if (this.petContainer.containsKey(meta.getOwner())) { - Long id = this.petContainer.get(meta.getOwner()).getId(); - ((PetData) meta).setId(id); - } - this.petContainer.put(meta.getOwner(), (PetData) meta); - Bukkit.getServer().getPluginManager().callEvent(new PetMetaEvent(this.petContainer.get(meta.getOwner()))); - } - } - - public PetMeta getPetMeta(Player player) { - if (this.petContainer.containsKey(player)) - return this.petContainer.get(player); - return null; - } - - public void persist(PetMeta petMeta) { - if (petMeta == null) - return; - if (PetBlocksApi.hasPetBlock(petMeta.getOwner())) - ((PetData) petMeta).enabled = true; - this.fileManager.save(petMeta.getOwner(), this.petContainer.get(petMeta.getOwner()), false); - } - - void saveUnsecured(Player player, PetMeta meta) { - this.fileManager.save(player, (PetData) meta, false); - } - - public void dispose() { - for (final Player player : this.petContainer.keySet()) { - this.fileManager.save(player, this.petContainer.get(player), true); - } - this.petContainer.clear(); - } - - public void remove(PetMeta petMeta) { - this.petContainer.remove(petMeta.getOwner()); - } - - public boolean hasPetMeta(Player player) { - if (!this.petContainer.containsKey(player)) { - final PetData petData; - if ((petData = this.fileManager.load(player)) != null) { - if (petData.isEnabled()) { - PetBlocksApi.setPetBlock(player, petData); - } - this.petContainer.put(player, petData); - return true; - } - return false; - } - return true; - } -} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java similarity index 55% rename from src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java rename to src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java index 56e1229e2..e34baaf49 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetRepository.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java @@ -1,12 +1,13 @@ -package com.github.shynixn.petblocks.business.logic.persistence2; +package com.github.shynixn.petblocks.business.logic.persistence.controller; -import com.github.shynixn.petblocks.lib.util.DataBaseRepository; -import com.github.shynixn.petblocks.lib.util.DbConnectionContext; -import com.github.shynixn.petblocks.lib.util.SQLProvider; -import org.bukkit.entity.Player; +import com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController; +import com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta; +import com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData; +import com.github.shynixn.petblocks.lib.DataBaseRepository; +import com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext; +import org.bukkit.Material; import java.io.Closeable; -import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -14,52 +15,22 @@ import java.util.ArrayList; import java.util.List; -/** - * Created by Shynixn - */ -public class PetRepository extends DataBaseRepository implements IPetDataController { +public class ParticleEffectDataRepository extends DataBaseRepository implements ParticleEffectMetaController { - private DbConnectionContext dbContext; - private SQLProvider sqlProvider; + private ExtensionHikariConnectionContext dbContext; - PetRepository(DbConnectionContext dbContext, SQLProvider sqlProvider) { + public ParticleEffectDataRepository(ExtensionHikariConnectionContext connectionContext) { super(); - this.dbContext = dbContext; - this.sqlProvider = sqlProvider; + this.dbContext = connectionContext; } /** - * Returns the petdata from the given player - * - * @param player player - * @return petData + * Creates a new particleEffectMeta + * @return meta */ @Override - public PetData getByPlayer(Player player) { - try (Connection connection = this.dbContext.getConnection()) { - try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("petblock/selectbyplayer"), connection, - player.getUniqueId().toString())) { - try (ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - return PetData.from(resultSet); - } - } - } - } catch (SQLException | IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * Creates a petdata from the given player - * - * @param player player - * @return petdata - */ - @Override - public PetData create(Player player) { - return PetData.from(PlayerData.from(player)); + public ParticleEffectMeta create() { + return new ParticleEffectData(); } /** @@ -69,17 +40,17 @@ public PetData create(Player player) { * @return item */ @Override - public PetData getById(long id) { + public ParticleEffectMeta getById(long id) { try (Connection connection = this.dbContext.getConnection()) { - try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("petblock/selectbyid"), connection, + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("particle/selectbyid", connection, id)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - return PetData.from(resultSet); + return this.from(resultSet); } } } - } catch (SQLException | IOException e) { + } catch (SQLException e) { e.printStackTrace(); } return null; @@ -92,7 +63,7 @@ public PetData getById(long id) { * @return hasGivenId */ @Override - public boolean hasId(PetData item) { + public boolean hasId(ParticleEffectMeta item) { return item.getId() != 0; } @@ -102,21 +73,21 @@ public boolean hasId(PetData item) { * @return listOfItems */ @Override - public List select() { - final List petList = new ArrayList<>(); + public List select() { + final List items = new ArrayList<>(); try (Connection connection = this.dbContext.getConnection()) { - try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("petblock/selectall"), connection)) { + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("particle/selectall", connection)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - final PetData petData = PetData.from(resultSet); - petList.add(petData); + final ParticleEffectMeta data = from(resultSet); + items.add(data); } } } - } catch (SQLException | IOException e) { + } catch (SQLException e) { e.printStackTrace(); } - return petList; + return items; } /** @@ -125,12 +96,22 @@ public List select() { * @param item item */ @Override - public void update(PetData item) { + public void update(ParticleEffectMeta item) { try (Connection connection = this.dbContext.getConnection()) { - this.dbContext.executeUpdate(this.sqlProvider.getString("petblock/update"), connection, - item.getName(), - item.getId()); - } catch (SQLException | IOException e) { + String materialName = null; + if(item.getMaterial() != null) + materialName = item.getMaterial().name(); + this.dbContext.executeStoredUpdate("particle/update", connection, + item.getEffectName(), + item.getAmount(), + item.getSpeed(), + item.getX(), + item.getY(), + item.getZ(), + materialName, + (int)item.getData(), + item.getId()); + } catch (SQLException e) { e.printStackTrace(); } } @@ -141,11 +122,13 @@ public void update(PetData item) { * @param item item */ @Override - public void delete(PetData item) { + public void delete(ParticleEffectMeta item) { + System.out.println("EXEUCTED DELETE OF " + item.getId()); try (Connection connection = this.dbContext.getConnection()) { - this.dbContext.executeUpdate(this.sqlProvider.getString("petblock/delete"), connection, + this.dbContext.executeStoredUpdate("particle/delete", connection, item.getId()); - } catch (SQLException | IOException e) { + System.out.println("EXEUCTED DELETE OF " + item.getId()); + } catch (SQLException e) { e.printStackTrace(); } } @@ -156,12 +139,22 @@ public void delete(PetData item) { * @param item item */ @Override - public void insert(PetData item) { + public void insert(ParticleEffectMeta item) { try (Connection connection = this.dbContext.getConnection()) { - final long id = this.dbContext.executeInsert(this.sqlProvider.getString("petblock/insert"), connection, - item.getName(), item.getPlayerId()); - item.setId(id); - } catch (SQLException | IOException e) { + String materialName = null; + if(item.getMaterial() != null) + materialName = item.getMaterial().name(); + final long id = this.dbContext.executeStoredInsert("particle/insert", connection, + item.getEffectName(), + item.getAmount(), + item.getSpeed(), + item.getX(), + item.getY(), + item.getZ(), + materialName, + item.getData()); + ((ParticleEffectData)item).setId(id); + } catch (SQLException e) { e.printStackTrace(); } } @@ -172,19 +165,40 @@ public void insert(PetData item) { @Override public int size() { try (Connection connection = this.dbContext.getConnection()) { - try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("petblock/count"), connection)) { + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("particle/count", connection)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { return resultSet.getInt(1); } } } - } catch (SQLException | IOException e) { + } catch (SQLException e) { e.printStackTrace(); } return 0; } + /** + * Generates the entity from the given resultSet + * + * @param resultSet resultSet + * @return entity + */ + @Override + public ParticleEffectMeta from(ResultSet resultSet) throws SQLException{ + final ParticleEffectData particleEffectData = new ParticleEffectData(); + particleEffectData.setId(resultSet.getLong("id")); + particleEffectData.setEffectName(resultSet.getString("name")); + particleEffectData.setAmount(resultSet.getInt("amount")); + particleEffectData.setSpeed(resultSet.getDouble("speed")); + particleEffectData.setX(resultSet.getDouble("x")); + particleEffectData.setY(resultSet.getDouble("y")); + particleEffectData.setZ(resultSet.getDouble("z")); + particleEffectData.setMaterial(Material.getMaterial(resultSet.getString("material"))); + particleEffectData.setData((byte) resultSet.getInt("data")); + return particleEffectData; + } + /** * Closes this resource, relinquishing any underlying resources. * This method is invoked automatically on objects managed by the @@ -233,6 +247,5 @@ public int size() { @Override public void close() throws Exception { this.dbContext = null; - this.sqlProvider = null; } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java new file mode 100644 index 000000000..1358b0eaa --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java @@ -0,0 +1,315 @@ +package com.github.shynixn.petblocks.business.logic.persistence.controller; + +import com.github.shynixn.petblocks.api.entities.MoveType; +import com.github.shynixn.petblocks.api.entities.Movement; +import com.github.shynixn.petblocks.api.entities.PetType; +import com.github.shynixn.petblocks.api.persistence.controller.PetMetaController; +import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; +import com.github.shynixn.petblocks.business.logic.persistence.entity.PetData; +import com.github.shynixn.petblocks.lib.DataBaseRepository; +import com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext; +import org.bukkit.Material; +import org.bukkit.entity.Player; + +import java.io.Closeable; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Shynixn + */ +public class PetDataRepository extends DataBaseRepository implements PetMetaController { + + private ExtensionHikariConnectionContext dbContext; + + public PetDataRepository(ExtensionHikariConnectionContext connectionContext) { + super(); + this.dbContext = connectionContext; + } + + /** + * Returns the petdata from the given player + * + * @param player player + * @return petData + */ + @Override + public PetMeta getByPlayer(Player player) { + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/selectbyplayer", connection, + player.getUniqueId().toString())) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + return from(resultSet); + } + } + } + } catch (SQLException e) { + e.printStackTrace(); + } + return null; + } + + /** + * Checks if the player has got an entry in the database + * + * @param player player + * @return hasEntry + */ + @Override + public boolean hasEntry(Player player) { + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/selectentrybyplayer", connection, + player.getUniqueId().toString())) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + return true; + } + } + } + } catch (SQLException e) { + e.printStackTrace(); + } + return false; + } + + /** + * Returns the item of the given id + * + * @param id id + * @return item + */ + @Override + public PetMeta getById(long id) { + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/selectbyid", connection, + id)) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + return from(resultSet); + } + } + } + } catch (SQLException e) { + e.printStackTrace(); + } + return null; + } + + /** + * Checks if the item has got an valid databaseId + * + * @param item item + * @return hasGivenId + */ + @Override + public boolean hasId(PetMeta item) { + return item.getId() != 0; + } + + /** + * Selects all items from the database into the list + * + * @return listOfItems + */ + @Override + public List select() { + final List petList = new ArrayList<>(); + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/selectall", connection)) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + final PetMeta petData = from(resultSet); + petList.add(petData); + } + } + } + } catch (SQLException e) { + e.printStackTrace(); + } + return petList; + } + + /** + * Updates the item inside of the database + * + * @param item item + */ + @Override + public void update(PetMeta item) { + if(item == null) + throw new IllegalArgumentException("Meta has to be an instance of PetData"); + if(item.getType() == null) + throw new IllegalArgumentException("PetType cannot be null!"); + if(item.getSkinMaterial() == null) + throw new IllegalArgumentException("SkinMaterial cannot be null!"); + try (Connection connection = this.dbContext.getConnection()) { + System.out.println("UPDATE TYPE: " + item.getType().name()); + this.dbContext.executeStoredUpdate("petblock/update", connection, + item.getDisplayName(), + item.getType().name(), + item.getSkinMaterial().name(), + item.getSkinDurability(), + item.getSkin(), + item.isEnabled(), + item.getAgeInTicks(), + item.isUnbreakable(), + item.isSoundsEnabled(), + item.getMoveType().name(), + item.getMovementType().name(), + item.getId() + ); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + /** + * Deletes the item from the database + * + * @param item item + */ + @Override + public void delete(PetMeta item) { + try (Connection connection = this.dbContext.getConnection()) { + this.dbContext.executeStoredUpdate("petblock/delete", connection, + item.getId()); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + /** + * Inserts the item into the database and sets the id + * + * @param item item + */ + @Override + public void insert(PetMeta item) { + if(item == null) + throw new IllegalArgumentException("Meta has to be an instance of PetData"); + if(item.getType() == null) + throw new IllegalArgumentException("PetType cannot be null!"); + if(item.getSkinMaterial() == null) + throw new IllegalArgumentException("SkinMaterial cannot be null!"); + try (Connection connection = this.dbContext.getConnection()) { + final long id = this.dbContext.executeStoredInsert("petblock/insert", connection, + item.getPlayerId(), + item.getParticleId(), + item.getDisplayName(), + item.getType().name(), + item.getSkinMaterial().name(), + item.getSkinDurability(), + item.getSkin(), + item.isEnabled(), + item.getAgeInTicks(), + item.isUnbreakable(), + item.isSoundsEnabled(), + item.getMoveType().name(), + item.getMovementType().name() + ); + ((PetData)item).setId(id); + System.out.println("SUCCESS"); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + /** + * Generates the entity from the given resultSet + * + * @param resultSet resultSet + * @return entity + */ + @Override + public PetMeta from(ResultSet resultSet) throws SQLException { + PetData petMeta = new PetData(); + petMeta.setId(resultSet.getLong("id")); + petMeta.setPlayerId(resultSet.getLong("shy_player_id")); + petMeta.setParticleId(resultSet.getLong("shy_particle_effect_id")); + petMeta.setDisplayName(resultSet.getString("name")); + petMeta.setPetType(PetType.getPetTypeFromName(resultSet.getString("type"))); + System.out.println("TYPE: " + petMeta.getType()); + petMeta.setSkin(Material.getMaterial(resultSet.getString("material")), (byte) resultSet.getInt("data"), resultSet.getString("skull")); + petMeta.setEnabled(resultSet.getBoolean("enabled")); + petMeta.setAgeInTicks(resultSet.getInt("age")); + petMeta.setUnbreakable(resultSet.getBoolean("unbreakable")); + petMeta.setSoundsEnabled(resultSet.getBoolean("play_sounds")); + petMeta.setMoveType(MoveType.getMoveTypeFromName(resultSet.getString("moving_type"))); + petMeta.setMovementType(Movement.getMovementFromName(resultSet.getString("movement_type"))); + return petMeta; + } + + /** + * Returns the amount of items in the repository + */ + @Override + public int size() { + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/count", connection)) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + while (resultSet.next()) { + return resultSet.getInt(1); + } + } + } + } catch (SQLException e) { + e.printStackTrace(); + } + return 0; + } + + /** + * Closes this resource, relinquishing any underlying resources. + * This method is invoked automatically on objects managed by the + * {@code try}-with-resources statement. + *

+ *

While this interface method is declared to throw {@code + * Exception}, implementers are strongly encouraged to + * declare concrete implementations of the {@code close} method to + * throw more specific exceptions, or to throw no exception at all + * if the close operation cannot fail. + *

+ *

Cases where the close operation may fail require careful + * attention by implementers. It is strongly advised to relinquish + * the underlying resources and to internally mark the + * resource as closed, prior to throwing the exception. The {@code + * close} method is unlikely to be invoked more than once and so + * this ensures that the resources are released in a timely manner. + * Furthermore it reduces problems that could arise when the resource + * wraps, or is wrapped, by another resource. + *

+ *

Implementers of this interface are also strongly advised + * to not have the {@code close} method throw {@link + * InterruptedException}. + *

+ * This exception interacts with a thread's interrupted status, + * and runtime misbehavior is likely to occur if an {@code + * InterruptedException} is {@linkplain Throwable#addSuppressed + * suppressed}. + *

+ * More generally, if it would cause problems for an + * exception to be suppressed, the {@code AutoCloseable.close} + * method should not throw it. + *

+ *

Note that unlike the {@link Closeable#close close} + * method of {@link Closeable}, this {@code close} method + * is not required to be idempotent. In other words, + * calling this {@code close} method more than once may have some + * visible side effect, unlike {@code Closeable.close} which is + * required to have no effect if called more than once. + *

+ * However, implementers of this interface are strongly encouraged + * to make their {@code close} methods idempotent. + * + * @throws Exception if this resource cannot be closed + */ + @Override + public void close() throws Exception { + this.dbContext = null; + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerDataRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java similarity index 63% rename from src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerDataRepository.java rename to src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java index 66d356704..05a2f066b 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerDataRepository.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java @@ -1,30 +1,43 @@ -package com.github.shynixn.petblocks.business.logic.persistence2; +package com.github.shynixn.petblocks.business.logic.persistence.controller; -import com.github.shynixn.petblocks.lib.util.DataBaseRepository; -import com.github.shynixn.petblocks.lib.util.DbConnectionContext; -import com.github.shynixn.petblocks.lib.util.SQLProvider; +import com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController; +import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; +import com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData; +import com.github.shynixn.petblocks.lib.DataBaseRepository; +import com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext; +import org.bukkit.entity.Player; import java.io.Closeable; -import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +import java.util.UUID; /** * Created by Shynixn */ -public class PlayerDataRepository extends DataBaseRepository{ +public class PlayerDataRepository extends DataBaseRepository implements PlayerMetaController { - private DbConnectionContext dbContext; - private SQLProvider sqlProvider; + private ExtensionHikariConnectionContext dbContext; - PlayerDataRepository(DbConnectionContext dbContext, SQLProvider sqlProvider) { + public PlayerDataRepository(ExtensionHikariConnectionContext connectionContext) { super(); - this.dbContext = dbContext; - this.sqlProvider = sqlProvider; + this.dbContext = connectionContext; + } + + + /** + * Creates a new playerData from the given player + * + * @param player player + * @return playerData + */ + @Override + public PlayerMeta create(Player player) { + return PlayerData.from(player); } /** @@ -34,17 +47,17 @@ public class PlayerDataRepository extends DataBaseRepository{ * @return item */ @Override - public PlayerData getById(long id) { + public PlayerMeta getById(long id) { try (Connection connection = this.dbContext.getConnection()) { - try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("selectbyid"), connection, + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("player/selectbyid", connection, id)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - return PlayerData.from(resultSet); + return from(resultSet); } } } - } catch (SQLException | IOException e) { + } catch (SQLException e) { e.printStackTrace(); } return null; @@ -57,7 +70,7 @@ public PlayerData getById(long id) { * @return hasGivenId */ @Override - public boolean hasId(PlayerData item) { + public boolean hasId(PlayerMeta item) { return item.getId() != 0; } @@ -67,19 +80,22 @@ public boolean hasId(PlayerData item) { * @return listOfItems */ @Override - public List select() { - final List playerList = new ArrayList<>(); + public List select() { + final List playerList = new ArrayList<>(); try (Connection connection = this.dbContext.getConnection()) { - try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("player/selectall"), connection)) { + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("player/selectall", connection)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - playerList.add(PlayerData.from(resultSet)); + final PlayerData playerData = from(resultSet); + System.out.println("PLAYERDATA: " + playerData.getId()); + playerList.add(playerData); } } } - } catch (SQLException | IOException e) { + } catch (SQLException e) { e.printStackTrace(); } + System.out.println("RETURN"); return playerList; } @@ -89,12 +105,13 @@ public List select() { * @param item item */ @Override - public void update(PlayerData item) { + public void update(PlayerMeta item) { try (Connection connection = this.dbContext.getConnection()) { - this.dbContext.executeUpdate(this.sqlProvider.getString("player/update"), connection, + this.dbContext.executeStoredUpdate("player/update", connection, + item.getUUID().toString(), item.getName(), item.getId()); - } catch (SQLException | IOException e) { + } catch (SQLException e) { e.printStackTrace(); } } @@ -105,11 +122,13 @@ public void update(PlayerData item) { * @param item item */ @Override - public void delete(PlayerData item) { + public void delete(PlayerMeta item) { + System.out.println("EXEUCTED DELETE OF " + item.getId()); try (Connection connection = this.dbContext.getConnection()) { - this.dbContext.executeUpdate(this.sqlProvider.getString("player/delete"), connection, + this.dbContext.executeStoredUpdate("player/delete", connection, item.getId()); - } catch (SQLException | IOException e) { + System.out.println("EXEUCTED DELETE OF " + item.getId()); + } catch (SQLException e) { e.printStackTrace(); } } @@ -120,36 +139,52 @@ public void delete(PlayerData item) { * @param item item */ @Override - public void insert(PlayerData item) { + public void insert(PlayerMeta item) { try (Connection connection = this.dbContext.getConnection()) { - final long id = this.dbContext.executeInsert(this.sqlProvider.getString("player/insert"), connection, + if(item.getUUID() == null) + throw new IllegalArgumentException("UUId cannot be null!"); + final long id = this.dbContext.executeStoredInsert("player/insert", connection, item.getName(), item.getUUID().toString()); - item.setId(id); - } catch (SQLException | IOException e) { + ((PlayerData)item).setId(id); + } catch (SQLException e) { e.printStackTrace(); } } + /** + * Generates the entity from the given resultSet + * + * @param resultSet resultSet + * @return entity + */ + @Override + public PlayerData from(ResultSet resultSet) throws SQLException { + final PlayerData playerStats = new PlayerData(); + playerStats.setId(resultSet.getLong("id")); + playerStats.setName(resultSet.getString("name")); + playerStats.setUuid(UUID.fromString(resultSet.getString("uuid"))); + return playerStats; + } + /** * Returns the amount of items in the repository */ @Override public int size() { try (Connection connection = this.dbContext.getConnection()) { - try (PreparedStatement preparedStatement = this.dbContext.executeQuery(this.sqlProvider.getString("player/count"), connection)) { + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("player/count", connection)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { return resultSet.getInt(1); } } } - } catch (SQLException | IOException e) { + } catch (SQLException e) { e.printStackTrace(); } return 0; } - /** * Closes this resource, relinquishing any underlying resources. * This method is invoked automatically on objects managed by the @@ -198,6 +233,5 @@ public int size() { @Override public void close() throws Exception { this.dbContext = null; - this.sqlProvider = null; } } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/ParticleEffectBuilder.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.java similarity index 80% rename from src/main/java/com/github/shynixn/petblocks/lib/util/ParticleEffectBuilder.java rename to src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.java index 4bb62a60b..9fdd538f9 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/util/ParticleEffectBuilder.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.java @@ -1,13 +1,11 @@ -package com.github.shynixn.petblocks.lib.util; +package com.github.shynixn.petblocks.business.logic.persistence.entity; +import com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta; import org.bukkit.*; import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.entity.Player; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * Copyright 2017 Shynixn @@ -38,7 +36,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -public class ParticleEffectBuilder implements ConfigurationSerializable { +public class ParticleEffectData extends PersistenceObject implements ConfigurationSerializable, ParticleEffectMeta { private String effect; private int amount; private double speed; @@ -50,14 +48,14 @@ public class ParticleEffectBuilder implements ConfigurationSerializable { private Byte data; /** - * Initializes a new ParticleEffectBuilder + * Initializes a new ParticleEffectData */ - public ParticleEffectBuilder() { + public ParticleEffectData() { super(); } /** - * Initializes a new ParticleEffectBuilder with the given params + * Initializes a new ParticleEffectData with the given params * * @param effectName effect * @param amount amount @@ -66,7 +64,7 @@ public ParticleEffectBuilder() { * @param y y * @param z u */ - public ParticleEffectBuilder(String effectName, int amount, double speed, double x, double y, double z) { + public ParticleEffectData(String effectName, int amount, double speed, double x, double y, double z) { super(); if (effectName == null) throw new IllegalArgumentException("Effect cannot be null!"); @@ -88,7 +86,7 @@ public ParticleEffectBuilder(String effectName, int amount, double speed, double * @param items items * @throws Exception mapParseException */ - public ParticleEffectBuilder(Map items) throws Exception { + public ParticleEffectData(Map items) throws Exception { super(); this.effect = (String) items.get("effect"); this.amount = (int) items.get("amount"); @@ -110,7 +108,8 @@ public ParticleEffectBuilder(Map items) throws Exception { * @param blue blue * @return builder */ - public ParticleEffectBuilder setColor(int red, int green, int blue) { + @Override + public ParticleEffectData setColor(int red, int green, int blue) { this.setRed(red); this.setBlue(blue); this.setGreen(green); @@ -124,7 +123,8 @@ public ParticleEffectBuilder setColor(int red, int green, int blue) { * @param particleColor particleColor * @return builder */ - public ParticleEffectBuilder setColor(ParticleColor particleColor) { + @Override + public ParticleEffectData setColor(ParticleColor particleColor) { if (particleColor == null) throw new IllegalArgumentException("Color cannot be null!"); this.setColor(particleColor.getRed(), particleColor.getGreen(), particleColor.getBlue()); @@ -137,7 +137,8 @@ public ParticleEffectBuilder setColor(ParticleColor particleColor) { * @param color color * @return builder */ - public ParticleEffectBuilder setNoteColor(int color) { + @Override + public ParticleEffectData setNoteColor(int color) { if (color > 20 || color < 0) this.x = 5; else @@ -151,7 +152,8 @@ public ParticleEffectBuilder setNoteColor(int color) { * @param amount amount * @return builder */ - public ParticleEffectBuilder setAmount(int amount) { + @Override + public ParticleEffectData setAmount(int amount) { if (amount < 0) throw new IllegalArgumentException("Amount cannot be less than 0"); this.amount = amount; @@ -164,7 +166,8 @@ public ParticleEffectBuilder setAmount(int amount) { * @param speed speed * @return builder */ - public ParticleEffectBuilder setSpeed(double speed) { + @Override + public ParticleEffectData setSpeed(double speed) { this.speed = speed; return this; } @@ -175,7 +178,8 @@ public ParticleEffectBuilder setSpeed(double speed) { * @param x x * @return builder */ - public ParticleEffectBuilder setX(double x) { + @Override + public ParticleEffectData setX(double x) { this.x = x; return this; } @@ -186,7 +190,8 @@ public ParticleEffectBuilder setX(double x) { * @param y y * @return builder */ - public ParticleEffectBuilder setY(double y) { + @Override + public ParticleEffectData setY(double y) { this.y = y; return this; } @@ -197,7 +202,8 @@ public ParticleEffectBuilder setY(double y) { * @param z z * @return builder */ - public ParticleEffectBuilder setZ(double z) { + @Override + public ParticleEffectData setZ(double z) { this.z = z; return this; } @@ -208,7 +214,8 @@ public ParticleEffectBuilder setZ(double z) { * @param name name * @return builder */ - public ParticleEffectBuilder setEffectName(String name) { + @Override + public ParticleEffectData setEffectName(String name) { if (name == null) throw new IllegalArgumentException("Name cannot be null!"); this.effect = name; @@ -221,7 +228,8 @@ public ParticleEffectBuilder setEffectName(String name) { * @param type type * @return builder */ - public ParticleEffectBuilder setEffectType(ParticleEffectType type) { + @Override + public ParticleEffectData setEffectType(ParticleEffectType type) { if (type == null) throw new IllegalArgumentException("Type cannot be null!"); this.effect = type.getSimpleName(); @@ -234,7 +242,8 @@ public ParticleEffectBuilder setEffectType(ParticleEffectType type) { * @param blue blue * @return builder */ - public ParticleEffectBuilder setBlue(int blue) { + @Override + public ParticleEffectData setBlue(int blue) { this.z = (double) blue / 255.0; return this; } @@ -245,7 +254,8 @@ public ParticleEffectBuilder setBlue(int blue) { * @param red red * @return builder */ - public ParticleEffectBuilder setRed(int red) { + @Override + public ParticleEffectData setRed(int red) { this.x = (double) red / 255.0; if (red == 0) this.x = Float.MIN_NORMAL; @@ -258,7 +268,8 @@ public ParticleEffectBuilder setRed(int red) { * @param green green * @return builder */ - public ParticleEffectBuilder setGreen(int green) { + @Override + public ParticleEffectData setGreen(int green) { this.y = green / 255.0; return this; } @@ -269,10 +280,13 @@ public ParticleEffectBuilder setGreen(int green) { * @param material material * @return builder */ - public ParticleEffectBuilder setMaterial(Material material) { - if (material == null) - throw new IllegalArgumentException("Material cannot be null!"); - this.material = material.getId(); + @Override + public ParticleEffectData setMaterial(Material material) { + if (material != null) { + this.material = material.getId(); + } else { + this.material = null; + } return this; } @@ -282,7 +296,8 @@ public ParticleEffectBuilder setMaterial(Material material) { * @param data data * @return builder */ - public ParticleEffectBuilder setData(Byte data) { + @Override + public ParticleEffectData setData(Byte data) { this.data = data; return this; } @@ -292,6 +307,7 @@ public ParticleEffectBuilder setData(Byte data) { * * @return effectName */ + @Override public String getEffectName() { return this.effect; } @@ -301,6 +317,7 @@ public String getEffectName() { * * @return effectType */ + @Override public ParticleEffectType getEffectType() { return getParticleEffectFromName(this.effect); } @@ -310,6 +327,7 @@ public ParticleEffectType getEffectType() { * * @return amount */ + @Override public int getAmount() { return this.amount; } @@ -319,6 +337,7 @@ public int getAmount() { * * @return speed */ + @Override public double getSpeed() { return this.speed; } @@ -328,6 +347,7 @@ public double getSpeed() { * * @return x */ + @Override public double getX() { return this.x; } @@ -337,6 +357,7 @@ public double getX() { * * @return y */ + @Override public double getY() { return this.y; } @@ -346,6 +367,7 @@ public double getY() { * * @return z */ + @Override public double getZ() { return this.z; } @@ -355,6 +377,7 @@ public double getZ() { * * @return blue */ + @Override public int getBlue() { return (int) this.z * 255; } @@ -364,6 +387,7 @@ public int getBlue() { * * @return red */ + @Override public int getRed() { return (int) this.x * 255; } @@ -373,6 +397,7 @@ public int getRed() { * * @return green */ + @Override public int getGreen() { return (int) this.y * 255; } @@ -382,6 +407,7 @@ public int getGreen() { * * @return material */ + @Override public Material getMaterial() { if (this.material == null || Material.getMaterial(this.material) == null) return null; @@ -393,6 +419,7 @@ public Material getMaterial() { * * @return data */ + @Override public Byte getData() { return this.data; } @@ -402,8 +429,8 @@ public Byte getData() { * * @return copyOfBuilder */ - public ParticleEffectBuilder copy() { - final ParticleEffectBuilder particle = new ParticleEffectBuilder(); + public ParticleEffectData copy() { + final ParticleEffectData particle = new ParticleEffectData(); particle.effect = this.effect; particle.amount = this.amount; particle.x = this.x; @@ -423,7 +450,7 @@ public ParticleEffectBuilder copy() { * @return bukkitParticle */ public > T toParticle(Class clazz) { - if(clazz == null) + if (clazz == null) throw new IllegalArgumentException("Class cannot be null!"); for (final Object item : clazz.getEnumConstants()) { final Enum eItem = (Enum) item; @@ -438,6 +465,7 @@ public > T toParticle(Class clazz) { * * @return isColor */ + @Override public boolean isColorParticleEffect() { return this.effect.equalsIgnoreCase(ParticleEffectType.SPELL_MOB.getSimpleName()) || this.effect.equalsIgnoreCase(ParticleEffectType.SPELL_MOB_AMBIENT.getSimpleName()) @@ -450,6 +478,7 @@ public boolean isColorParticleEffect() { * * @return isNote */ + @Override public boolean isNoteParticleEffect() { return this.effect.equalsIgnoreCase(ParticleEffectType.NOTE.getSimpleName()); } @@ -459,6 +488,7 @@ public boolean isNoteParticleEffect() { * * @return isMaterial */ + @Override public boolean isMaterialParticleEffect() { return this.effect.equalsIgnoreCase(ParticleEffectType.BLOCK_CRACK.getSimpleName()) || this.effect.equalsIgnoreCase(ParticleEffectType.BLOCK_DUST.getSimpleName()) @@ -471,8 +501,9 @@ public boolean isMaterialParticleEffect() { * @param location location * @param players players */ + @Override public void apply(Location location, Player... players) { - if(location == null) + if (location == null) throw new IllegalArgumentException("Location cannot be null!"); if (players.length == 0) ParticleUtils.sendParticle(this, location); @@ -490,7 +521,7 @@ public void apply(Location location, Player... players) { public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - final ParticleEffectBuilder that = (ParticleEffectBuilder) o; + final ParticleEffectData that = (ParticleEffectData) o; return this.amount == that.amount && Double.compare(that.speed, this.speed) == 0 && Double.compare(that.x, this.x) == 0 @@ -566,159 +597,6 @@ public static ParticleEffectType getParticleEffectFromName(String name) { return null; } - /** - * ParticleColors - */ - public enum ParticleColor { - BLACK(0, 0, 0), - DARK_BLUE(0, 0, 170), - DARK_GREEN(0, 170, 0), - DARK_AQUA(0, 170, 170), - DARK_RED(170, 0, 0), - DARK_PURPLE(170, 0, 170), - GOLD(255, 170, 0), - GRAY(170, 170, 170), - DARK_GRAY(85, 85, 85), - BLUE(85, 85, 255), - GREEN(85, 255, 85), - AQUA(85, 255, 255), - RED(255, 85, 85), - LIGHT_PURPLE(255, 85, 255), - YELLOW(255, 255, 85), - WHITE(255, 255, 255); - - private final int red; - private final int green; - private final int blue; - - /** - * Initializes a new particleColor - * - * @param red red - * @param green green - * @param blue blue - */ - ParticleColor(int red, int green, int blue) { - this.red = red; - this.green = green; - this.blue = blue; - } - - /** - * Returns the RGB value red - * - * @return red - */ - public int getRed() { - return this.red; - } - - /** - * Returns the RGB value green - * - * @return green - */ - public int getGreen() { - return this.green; - } - - /** - * Returns the RGB value blue - * - * @return blue - */ - public int getBlue() { - return this.blue; - } - } - - /** - * ParticleEffectTypes - */ - public enum ParticleEffectType { - EXPLOSION_NORMAL("explode", 0), - EXPLOSION_LARGE("largeexplode", 1), - EXPLOSION_HUGE("hugeexplosion", 2), - FIREWORKS_SPARK("fireworksSpark", 3), - WATER_BUBBLE("bubble", 4), - WATER_SPLASH("splash", 5), - WATER_WAKE("wake", 6), - SUSPENDED("suspended", 7), - SUSPENDED_DEPTH("depthsuspend", 8), - CRIT("crit", 9), - CRIT_MAGIC("magicCrit", 10), - SMOKE_NORMAL("smoke", 11), - SMOKE_LARGE("largesmoke", 12), - SPELL("spell", 13), - SPELL_INSTANT("instantSpell", 14), - SPELL_MOB("mobSpell", 15), - SPELL_MOB_AMBIENT("mobSpellAmbient", 16), - SPELL_WITCH("witchMagic", 17), - DRIP_WATER("dripWater", 18), - DRIP_LAVA("dripLava", 19), - VILLAGER_ANGRY("angryVillager", 20), - VILLAGER_HAPPY("happyVillager", 21), - TOWN_AURA("townaura", 22), - NOTE("note", 23), - PORTAL("portal", 24), - ENCHANTMENT_TABLE("enchantmenttable", 25), - FLAME("flame", 26), - LAVA("lava", 27), - FOOTSTEP("footstep", 28), - CLOUD("cloud", 29), - REDSTONE("reddust", 30), - SNOWBALL("snowballpoof", 31), - SNOW_SHOVEL("snowshovel", 32), - SLIME("slime", 33), - HEART("heart", 34), - BARRIER("barrier", 35), - ITEM_CRACK("iconcrack", 36), - BLOCK_CRACK("blockcrack", 37), - BLOCK_DUST("blockdust", 38), - WATER_DROP("droplet", 39), - ITEM_TAKE("take", 40), - MOB_APPEARANCE("mobappearance", 41), - DRAGON_BREATH("dragonbreath", 42), - END_ROD("endRod", 43), - DAMAGE_INDICATOR("damageIndicator", 44), - SWEEP_ATTACK("sweepAttack", 45), - FALLING_DUST("fallingdust", 46), - TOTEM("totem", 47), - SPIT("spit", 48); - - private final String simpleName; - private final int id; - - /** - * Initializes a new particleEffectType - * - * @param name name - * @param id id - */ - ParticleEffectType(String name, int id) { - this.simpleName = name; - this.id = id; - } - - /** - * Returns the id of the particleEffectType - * - * @return id - */ - public int getId() { - return this.id; - } - - /** - * Returns the name of the particleEffectType - * - * @return name - */ - public String getSimpleName() { - return this.simpleName; - } - } - /** * Particle Utils */ @@ -731,7 +609,7 @@ private static class ParticleUtils { * @param location location * @return hasBeenSend */ - static boolean sendParticle(ParticleEffectBuilder builder, Location location) { + static boolean sendParticle(ParticleEffectData builder, Location location) { return sendParticle(builder, location, location.getWorld().getPlayers().toArray(new Player[location.getWorld().getPlayers().size()])); } @@ -743,8 +621,11 @@ static boolean sendParticle(ParticleEffectBuilder builder, Location location) { * @param players players * @return hasBeenSend */ - static boolean sendParticle(ParticleEffectBuilder builder, Location location, Player[] players) { + static boolean sendParticle(ParticleEffectData builder, Location location, Player[] players) { switch (getServerVersion()) { + case "v1_12_R1": + ParticleUtils12R1.sendParticle(builder, location, players); + break; case "v1_11_R1": ParticleUtils11R1.sendParticle(builder, location, players); break; @@ -806,11 +687,11 @@ static class ParticleUtils8R1 { * @param location location * @param players players */ - static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + static void sendParticle(ParticleEffectData particleBuilder, Location location, Player[] players) { final net.minecraft.server.v1_8_R1.EnumParticle particle = net.minecraft.server.v1_8_R1.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); int[] additionalInfo = null; if (particleBuilder.getMaterial() != null) { - if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + if (particleBuilder.getEffectType() == ParticleEffectData.ParticleEffectType.ITEM_CRACK) additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; else additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; @@ -841,11 +722,11 @@ static class ParticleUtils8R2 { * @param location location * @param players players */ - static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + static void sendParticle(ParticleEffectData particleBuilder, Location location, Player[] players) { final net.minecraft.server.v1_8_R2.EnumParticle particle = net.minecraft.server.v1_8_R2.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); int[] additionalInfo = null; if (particleBuilder.getMaterial() != null) { - if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + if (particleBuilder.getEffectType() == ParticleEffectData.ParticleEffectType.ITEM_CRACK) additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; else additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; @@ -876,11 +757,11 @@ static class ParticleUtils8R3 { * @param location location * @param players players */ - static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + static void sendParticle(ParticleEffectData particleBuilder, Location location, Player[] players) { final net.minecraft.server.v1_8_R3.EnumParticle particle = net.minecraft.server.v1_8_R3.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); int[] additionalInfo = null; if (particleBuilder.getMaterial() != null) { - if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + if (particleBuilder.getEffectType() == ParticleEffectData.ParticleEffectType.ITEM_CRACK) additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; else additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; @@ -911,11 +792,11 @@ static class ParticleUtils9R1 { * @param location location * @param players players */ - static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + static void sendParticle(ParticleEffectData particleBuilder, Location location, Player[] players) { final net.minecraft.server.v1_9_R1.EnumParticle particle = net.minecraft.server.v1_9_R1.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); int[] additionalInfo = null; if (particleBuilder.getMaterial() != null) { - if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + if (particleBuilder.getEffectType() == ParticleEffectData.ParticleEffectType.ITEM_CRACK) additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; else additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; @@ -946,11 +827,11 @@ static class ParticleUtils9R2 { * @param location location * @param players players */ - static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + static void sendParticle(ParticleEffectData particleBuilder, Location location, Player[] players) { final net.minecraft.server.v1_9_R2.EnumParticle particle = net.minecraft.server.v1_9_R2.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); int[] additionalInfo = null; if (particleBuilder.getMaterial() != null) { - if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + if (particleBuilder.getEffectType() == ParticleEffectData.ParticleEffectType.ITEM_CRACK) additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; else additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; @@ -981,11 +862,11 @@ static class ParticleUtils10R1 { * @param location location * @param players players */ - static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + static void sendParticle(ParticleEffectData particleBuilder, Location location, Player[] players) { final net.minecraft.server.v1_10_R1.EnumParticle particle = net.minecraft.server.v1_10_R1.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); int[] additionalInfo = null; if (particleBuilder.getMaterial() != null) { - if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + if (particleBuilder.getEffectType() == ParticleEffectData.ParticleEffectType.ITEM_CRACK) additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; else additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; @@ -1016,11 +897,11 @@ static class ParticleUtils11R1 { * @param location location * @param players players */ - static void sendParticle(ParticleEffectBuilder particleBuilder, Location location, Player[] players) { + static void sendParticle(ParticleEffectData particleBuilder, Location location, Player[] players) { final net.minecraft.server.v1_11_R1.EnumParticle particle = net.minecraft.server.v1_11_R1.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); int[] additionalInfo = null; if (particleBuilder.getMaterial() != null) { - if (particleBuilder.getEffectType() == ParticleEffectBuilder.ParticleEffectType.ITEM_CRACK) + if (particleBuilder.getEffectType() == ParticleEffectData.ParticleEffectType.ITEM_CRACK) additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; else additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; @@ -1042,5 +923,40 @@ static void sendParticle(ParticleEffectBuilder particleBuilder, Location locatio } } } + + static class ParticleUtils12R1 { + /** + * Sends a particleEffect for v1_12_R1 + * + * @param particleBuilder particleBuilder + * @param location location + * @param players players + */ + static void sendParticle(ParticleEffectData particleBuilder, Location location, Player[] players) { + final net.minecraft.server.v1_12_R1.EnumParticle particle = net.minecraft.server.v1_12_R1.EnumParticle.valueOf(particleBuilder.getEffectType().name().toUpperCase()); + int[] additionalInfo = null; + if (particleBuilder.getMaterial() != null) { + if (particleBuilder.getEffectType() == ParticleEffectData.ParticleEffectType.ITEM_CRACK) + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData()}; + else + additionalInfo = new int[]{particleBuilder.getMaterial().getId(), particleBuilder.getData() << 12}; + } + final net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles( + particle, + isLongDistance(location, Arrays.asList(players)), + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + (float) particleBuilder.getX(), + (float) particleBuilder.getY(), + (float) particleBuilder.getZ(), + (float) particleBuilder.getSpeed(), + particleBuilder.getAmount(), + additionalInfo); + for (final Player player : players) { + ((org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); + } + } + } } } \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PersistenceObject.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PersistenceObject.java new file mode 100644 index 000000000..b3ae23bb5 --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PersistenceObject.java @@ -0,0 +1,24 @@ +package com.github.shynixn.petblocks.business.logic.persistence.entity; + +import com.github.shynixn.petblocks.api.persistence.entity.Persistenceable; + +public class PersistenceObject implements Persistenceable { + long id; + /** + * Returns the id of the object + * + * @return id + */ + @Override + public long getId() { + return this.id; + } + + /** + * Sets the id of the object + * @param id id + */ + public void setId(long id) { + this.id = id; + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java similarity index 61% rename from src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetData.java rename to src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java index 4f7357e3a..2aaf2fc12 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/PetData.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java @@ -1,117 +1,51 @@ -package com.github.shynixn.petblocks.business.logic.persistence; +package com.github.shynixn.petblocks.business.logic.persistence.entity; import com.github.shynixn.petblocks.api.entities.*; +import com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta; +import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; +import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; import com.github.shynixn.petblocks.lib.ParticleBuilder; import com.github.shynixn.petblocks.lib.ParticleEffect; -import com.github.shynixn.petblocks.api.events.PetMetaEvent; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import java.util.UUID; -import javax.persistence.*; - -@Entity -@Table(name = "petblock") -public class PetData implements PetMeta { +public class PetData extends PersistenceObject implements PetMeta { private static final Long serialVersionUID = 1L; - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id") - private Long id; - - @Column(name = "uuid") - private String uuid; - - @Column(name = "name") private String displayName; - - @Column(name = "type") private PetType petType; - - @Column(name = "material") private Material costume; - - @Column(name = "metavalue") private short durability; - - @Column(name = "skin") private String skullName; - - @Column(name = "enabled") - protected boolean enabled; - - @Column(name = "hidden") private boolean hidden; - - @Column(name = "moving") private MoveType moveType = MoveType.WALKING; - - @Column(name = "age") private int ageTicks; - - @Column(name = "movement") private String movement; - - @Column(name = "unbreakable") private boolean unbreakable; - - // - - @Column(name = "effect_name") - @Enumerated(EnumType.ORDINAL) - private ParticleEffect effect; - - @Column(name = "effect_x") - private double x; - - @Column(name = "effect_y") - private double y; - - @Column(name = "effect_z") - private double z; - - @Column(name = "effect_speed") - private double speed; - - @Column(name = "effect_amount") - private int amount; - - @Column(name = "effect_material") - private Material material; - - @Column(name = "effect_metavalue") - private byte data; - - @Column(name = "sounds") + private boolean enabled; private boolean sounds; - // - - @Transient - private Player player; - - @Transient private transient String headDisplayName; - - @Transient private transient String[] headLore; - - @Transient private boolean build; + private PlayerMeta playerInfo; + private long playerId; + + private ParticleEffectMeta particleEffectBuilder; + private long particleId; public PetData(Player player, PetType petType, String name, ItemStack itemStack, String owner) { this.petType = petType; this.displayName = name; - this.player = player; - this.uuid = player.getUniqueId().toString(); + this.playerInfo = PlayerData.from(player); this.costume = itemStack.getType(); this.durability = itemStack.getDurability(); if (owner != null && owner.contains("textures.minecraft")) { - if (owner.contains("http://") == false) + if (!owner.contains("http://")) owner = "http://" + owner; } if (owner != null && !owner.equals("")) @@ -120,22 +54,89 @@ public PetData(Player player, PetType petType, String name, ItemStack itemStack, this.sounds = true; } - public PetData(Player player, PetType petType) { - this.player = player; - this.petType = petType; - this.displayName = "My Pet"; - this.costume = Material.GRASS; - this.uuid = player.getUniqueId().toString(); - this.ageTicks = Age.SMALL.getTicks(); - this.sounds = true; + public PetData() { } - protected PetData(PetType petType) { - this.petType = petType; - this.displayName = "My Pet"; - this.costume = Material.GRASS; - this.ageTicks = Age.SMALL.getTicks(); - this.sounds = true; + /** + * Returns the id of the player + * + * @return playerId + */ + @Override + public long getPlayerId() { + return this.playerId; + } + + /** + * Sets the id of the player + * + * @param id id + */ + @Override + public void setPlayerId(long id) { + this.playerId = id; + } + + /** + * Returns the id of the particle + * + * @return particleId + */ + @Override + public long getParticleId() { + return this.particleId; + } + + /** + * Sets the id of the particle + * + * @param id id + */ + @Override + public void setParticleId(long id) { + this.particleId = id; + } + + /** + * Sets the particleEffect meta + * + * @param meta meta + */ + @Override + public void setParticleEffectMeta(ParticleEffectMeta meta) { + this.particleId = meta.getId(); + this.particleEffectBuilder = meta; + } + + /** + * Returns the particleEffect meta + * + * @return meta + */ + @Override + public ParticleEffectMeta getParticleEffectMeta() { + return this.particleEffectBuilder; + } + + /** + * Sets the own meta + * + * @param meta meta + */ + @Override + public void setPlayerMeta(PlayerMeta meta) { + this.playerId = meta.getId(); + this.playerInfo = meta; + } + + /** + * Returns the meta of the owner + * + * @return player + */ + @Override + public PlayerMeta getPlayerMeta() { + return this.playerInfo; } public boolean isBuild() { @@ -146,9 +147,6 @@ public void setIsBuild(boolean isBuild) { this.build = isBuild; } - public PetData() { - } - public boolean isSounds() { return this.sounds; } @@ -166,8 +164,6 @@ public void setSkin(Material material, short durability, String skin) { this.costume = material; this.durability = durability; this.skullName = skin; - if (this.build) - Bukkit.getServer().getPluginManager().callEvent(new PetMetaEvent(this)); } @Override @@ -239,22 +235,9 @@ public void setHidden(boolean isHidden) { this.hidden = isHidden; } - @Override - public Particle getParticleEffect() { - try { - if (this.effect == null) - return null; - return new ParticleBuilder().setEffect(this.effect).setOffset(this.x, this.y, this.z).setSpeed(this.speed).setAmount(this.amount).setMaterial(this.material).setData(this.data).build(); - } catch (Exception ex) { - return null; - } - } - @Override public void setSoundsEnabled(boolean enabled) { this.sounds = enabled; - if (this.build) - Bukkit.getServer().getPluginManager().callEvent(new PetMetaEvent(this)); } @Override @@ -262,11 +245,6 @@ public boolean isSoundsEnabled() { return this.sounds; } - @Override - public Player getOwner() { - return this.player; - } - @Override public boolean isUnbreakable() { return this.unbreakable; @@ -277,31 +255,6 @@ public void setUnbreakable(boolean unbreakable) { this.unbreakable = unbreakable; } - @Override - public void setParticleEffect(Particle particle) { - try { - this.effect = particle.getEffect(); - this.x = particle.getX(); - this.y = particle.getY(); - this.z = particle.getZ(); - this.speed = particle.getSpeed(); - this.amount = particle.getAmount(); - this.material = particle.getMaterial(); - this.data = particle.getData(); - } catch (Exception ex) { - this.effect = null; - this.x = 0; - this.y = 0; - this.z = 0; - this.speed = 0; - this.amount = 0; - this.material = null; - this.data = 0; - } - if (this.build) - Bukkit.getServer().getPluginManager().callEvent(new PetMetaEvent(this)); - } - @Override public String getHeadDisplayName() { return this.headDisplayName; @@ -342,8 +295,6 @@ public void setDisplayName(String name) { if (name == null) return; this.displayName = ChatColor.translateAlternateColorCodes('&', name); - if (this.build) - Bukkit.getServer().getPluginManager().callEvent(new PetMetaEvent(this)); } @Override @@ -372,8 +323,6 @@ public short getSkinDurability() { @Override public void setEnabled(boolean enabled) { this.enabled = enabled; - if (this.build) - Bukkit.getServer().getPluginManager().callEvent(new PetMetaEvent(this)); } @Override @@ -381,26 +330,6 @@ public boolean isEnabled() { return this.enabled; } - public String getUuid() { - return this.uuid; - } - - public void setOwner(Player player) { - this.player = player; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - public Material getCostume() { return this.costume; } @@ -425,98 +354,167 @@ public void setSkullName(String skullName) { this.skullName = skullName; } + //region Deprecated + + @Deprecated + public Player getOwner() { + return this.playerInfo.getPlayer(); + } + + @Deprecated + public void setOwner(Player player) { + this.playerInfo.setUuid(player.getUniqueId()); + } + + @Deprecated + public String getUuid() { + return this.playerInfo.getUUID().toString(); + } + + @Deprecated + public void setUuid(String uuid) { + this.playerInfo.setUuid(UUID.fromString(uuid)); + } + + @Deprecated + public PetData copy() { + PetData petData = new PetData(); + petData.displayName = this.displayName; + petData.petType = this.petType; + petData.costume = this.costume; + petData.durability = this.durability; + petData.skullName = this.skullName; + petData.enabled = this.enabled; + petData.hidden = this.hidden; + petData.sounds = this.sounds; + petData.moveType = this.moveType; + petData.ageTicks = this.ageTicks; + + petData.setEffect(this.getEffect()); + petData.setX(this.getX()); + petData.setY(this.getY()); + petData.setZ(this.getZ()); + + petData.setSpeed(this.getSpeed()); + petData.setAmount(this.getAmount()); + petData.setMaterial(this.getMaterial()); + petData.setData(this.getData()); + petData.build = this.build; + return petData; + } + + @Deprecated + public void setParticleEffect(Particle particle) { + try { + this.setEffect(particle.getEffect()); + this.setX(particle.getX()); + this.setY(particle.getY()); + this.setZ(particle.getZ()); + this.setSpeed(particle.getSpeed()); + this.setAmount(particle.getAmount()); + this.setMaterial(particle.getMaterial()); + this.setData(particle.getData()); + } catch (Exception ex) { + this.setEffect(null); + this.setX(0); + this.setY(0); + this.setZ(0); + this.setSpeed(0); + this.setAmount(0); + this.setMaterial(null); + this.setData((byte) 0); + } + } + + @Deprecated + public Particle getParticleEffect() { + try { + if (this.particleEffectBuilder == null) + return null; + return new ParticleBuilder().setEffect(this.getEffect()) + .setOffset(this.getX(), this.getY(), this.getZ()).setSpeed(this.getSpeed()).setAmount(this.getAmount()).setMaterial(this.getMaterial()).setData(this.getData()).build(); + } catch (Exception ex) { + return null; + } + } + + @Deprecated + public byte getData() { + return this.particleEffectBuilder.getData(); + } + + @Deprecated + public void setData(byte data) { + this.particleEffectBuilder.setData(data); + } + + @Deprecated public ParticleEffect getEffect() { - return this.effect; + return ParticleEffect.getParticleEffectFromName(this.particleEffectBuilder.getEffectName()); } + @Deprecated public void setEffect(ParticleEffect effect) { - this.effect = effect; + this.particleEffectBuilder.setEffectName(effect.getName()); } + @Deprecated public double getX() { - return this.x; + return this.particleEffectBuilder.getX(); } + @Deprecated public void setX(double x) { - this.x = x; + this.particleEffectBuilder.setX(x); } + @Deprecated public double getY() { - return this.y; + return this.particleEffectBuilder.getY(); } + @Deprecated public void setY(double y) { - this.y = y; + this.particleEffectBuilder.setY(y); } + @Deprecated public double getZ() { - return this.z; + return this.particleEffectBuilder.getZ(); } + @Deprecated public void setZ(double z) { - this.z = z; + this.particleEffectBuilder.setZ(z); } + @Deprecated public double getSpeed() { - return this.speed; + return this.particleEffectBuilder.getSpeed(); } + @Deprecated public void setSpeed(double speed) { - this.speed = speed; + this.particleEffectBuilder.setSpeed(speed); } + @Deprecated public int getAmount() { - return this.amount; + return this.particleEffectBuilder.getAmount(); } + @Deprecated public void setAmount(int amount) { - this.amount = amount; + this.particleEffectBuilder.setAmount(amount); } + @Deprecated public Material getMaterial() { - return this.material; + return this.particleEffectBuilder.getMaterial(); } + @Deprecated public void setMaterial(Material material) { - this.material = material; - } - - public byte getData() { - return this.data; - } - - public void setData(byte data) { - this.data = data; - } - - public PetData copy() { - PetData petData = new PetData(); - petData.id = this.id; - petData.uuid = this.uuid; - petData.displayName = this.displayName; - petData.petType = this.petType; - petData.costume = this.costume; - petData.durability = this.durability; - petData.skullName = this.skullName; - petData.enabled = this.enabled; - petData.hidden = this.hidden; - petData.sounds = this.sounds; - petData.moveType = this.moveType; - petData.ageTicks = this.ageTicks; - - petData.effect = this.effect; - petData.x = this.x; - petData.y = this.y; - petData.z = this.z; - - petData.speed = this.speed; - petData.amount = this.amount; - petData.material = this.material; - petData.data = this.data; - - petData.player = this.player; - petData.build = this.build; - - return petData; + this.particleEffectBuilder.setMaterial(material); } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PlayerData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PlayerData.java new file mode 100644 index 000000000..ca775fb3f --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PlayerData.java @@ -0,0 +1,69 @@ +package com.github.shynixn.petblocks.business.logic.persistence.entity; + +import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; + +import java.util.UUID; + +public class PlayerData extends PersistenceObject implements PlayerMeta { + private String name; + private UUID uuid; + + /** + * Returns the name of the playerData + * @return playerData + */ + @Override + public String getName() { + return this.name; + } + + /** + * Sets the name of the playerData + * @param name name + */ + @Override + public void setName(String name) { + this.name = name; + } + + /** + * Returns the uuid of the playerData + * @return uuid + */ + @Override + public UUID getUUID() { + return this.uuid; + } + + /** + * Sets the uuid of the playerData + * @param uuid uuid + */ + @Override + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + * Returns the player of the playerData + * @return player + */ + @Override + public Player getPlayer() { + return Bukkit.getPlayer(this.uuid); + } + + /** + * Generates the playerData from a player + * @param player player + * @return playerData + */ + public static PlayerData from(Player player) { + final PlayerData playerStats = new PlayerData(); + playerStats.setName(player.getName()); + playerStats.setUuid(player.getUniqueId()); + return playerStats; + } +} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java deleted file mode 100644 index ce581ad04..000000000 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/Factory.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.github.shynixn.petblocks.business.logic.persistence2; - -import com.github.shynixn.petblocks.lib.util.DbConnectionContext; -import com.github.shynixn.petblocks.lib.util.IDatabaseController; -import com.github.shynixn.petblocks.lib.util.SQLProvider; -import org.apache.commons.io.IOUtils; -import org.bukkit.Bukkit; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.plugin.Plugin; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.SQLException; -import java.util.regex.Pattern; - -/** - * Created by Shynixn - */ -public class Factory { - - private static DbConnectionContext connectionContext; - private static SQLProvider sqlProvider; - - public static IPetDataController createPetDataController() { - if (sqlProvider == null) - throw new IllegalArgumentException("Factory is disabled!"); - if (Bukkit.getServer() != null && Bukkit.getServer().isPrimaryThread()) - throw new IllegalArgumentException("Cannot open controller on main thread."); - return new PetRepository(connectionContext, sqlProvider); - } - - public static IDatabaseController createPlayerDataController() { - if (sqlProvider == null) - throw new IllegalArgumentException("Factory is disabled!"); - if (Bukkit.getServer() != null && Bukkit.getServer().isPrimaryThread()) - throw new IllegalArgumentException("Cannot open controller on main thread."); - return new PlayerDataRepository(connectionContext, sqlProvider); - } - - public static synchronized void enable(final Plugin plugin) { - if (sqlProvider != null) - return; - sqlProvider = new SQLProvider() { - @Override - protected String readStringFromFile(String fileName) throws IOException { - System.out.println("FILE: " + "sql/" + fileName + ".sql"); - try (InputStream stream = plugin.getResource("sql/" + fileName + ".sql")) { - return IOUtils.toString(stream, "UTF-8"); - } - } - }; - if (plugin.getConfig().getBoolean("sql.local")) { - try { - System.out.println("DATAFOLDER: " + plugin.getDataFolder()); - if (!plugin.getDataFolder().exists()) - plugin.getDataFolder().mkdir(); - File file = new File(plugin.getDataFolder(), "PetBlocks.db"); - if (!file.exists()) - file.createNewFile(); - connectionContext = DbConnectionContext.from("org.sqlite.JDBC", "jdbc:sqlite:" + file.getAbsolutePath()); - try(Connection connection = connectionContext.getConnection()) - { - connectionContext.execute("PRAGMA foreign_keys=ON", connection); - } catch (SQLException e) { - e.printStackTrace(); - } - } catch (IOException e) { - e.printStackTrace(); - } - try { - - try (Connection connection = connectionContext.getConnection()) { - for (String data : sqlProvider.getString("create-sqlite").split(Pattern.quote(";"))) { - connectionContext.executeUpdate(data, connection); - } - } catch (Exception e) { - e.printStackTrace(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } else { - - FileConfiguration c = plugin.getConfig(); - try { - connectionContext = DbConnectionContext.from("com.mysql.jdbc.Driver", "jdbc:mysql://" - , c.getString("sql.host") - , c.getInt("sql.port") - , c.getString("sql.database") - , c.getString("sql.username") - , c.getString("sql.password")); - } catch (IOException e) { - e.printStackTrace(); - } - try { - - try (Connection connection = connectionContext.getConnection()) { - connectionContext.executeUpdate(sqlProvider.getString("create-mysql"), connection); - } catch (IOException e) { - e.printStackTrace(); - } - } catch (SQLException e) { - e.printStackTrace(); - } - } - - } - - public static synchronized void disable() { - if (connectionContext != null) - connectionContext.close(); - if (sqlProvider != null) - sqlProvider.clear(); - sqlProvider = null; - connectionContext = null; - } -} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java deleted file mode 100644 index 2724cbadc..000000000 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/IPetDataController.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.github.shynixn.petblocks.business.logic.persistence2; - -import com.github.shynixn.petblocks.lib.util.IDatabaseController; -import org.bukkit.entity.Player; - -/** - * Created by Shynixn - */ -public interface IPetDataController extends IDatabaseController { - /** - * Returns the petdata from the given player - * @param player player - * @return petData - */ - PetData getByPlayer(Player player); - - /** - * Creates a petdata from the given player - * @param player player - * @return petdata - */ - PetData create(Player player); -} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java deleted file mode 100644 index 9f58644c1..000000000 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PetData.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.github.shynixn.petblocks.business.logic.persistence2; - -import org.bukkit.entity.Player; - -import java.sql.ResultSet; -import java.sql.SQLException; - -/** - * Created by Shynixn - */ -public class PetData { - - private long id; - private String name; - private long playerId; - - public long getPlayerId() { - return this.playerId; - } - - public void setPlayerId(long playerId) { - this.playerId = playerId; - } - - public long getId() { - return this.id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - - public static PetData from(PlayerData playerData) - { - final PetData petData = new PetData(); - petData.setPlayerId(playerData.getId()); - return petData; - } - - public static PetData from(ResultSet resultSet) throws SQLException { - final PetData petData = new PetData(); - petData.setId(resultSet.getLong("id")); - petData.setName(resultSet.getString("name")); - return petData; - } -} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java deleted file mode 100644 index 3da00b4ce..000000000 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/PlayerData.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.github.shynixn.petblocks.business.logic.persistence2; - -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.UUID; - -/** - * Created by Shynixn - */ -public class PlayerData { - - private long id; - private String name; - private UUID uuid; - - public long getId() { - return this.id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public UUID getUUID() { - return this.uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public Player getPlayer() { - return Bukkit.getPlayer(this.uuid); - } - - public static PlayerData from(Player player) { - PlayerData playerStats = new PlayerData(); - playerStats.setName(player.getName()); - playerStats.setUuid(player.getUniqueId()); - return playerStats; - } - - public static PlayerData from(ResultSet resultSet) throws SQLException { - PlayerData playerStats = new PlayerData(); - playerStats.id = resultSet.getLong("id"); - playerStats.name = resultSet.getString("name"); - playerStats.uuid = UUID.fromString(resultSet.getString("uuid")); - return playerStats; - } -} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/commandexecutor/PetDataCommandExecutor.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/commandexecutor/PetDataCommandExecutor.java deleted file mode 100644 index 045756432..000000000 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/commandexecutor/PetDataCommandExecutor.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.github.shynixn.petblocks.business.logic.persistence2.commandexecutor; - -import com.github.shynixn.petblocks.business.Config; -import com.github.shynixn.petblocks.business.Language; -import com.github.shynixn.petblocks.business.Permission; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; -import com.github.shynixn.petblocks.business.logic.persistence2.Factory; -import com.github.shynixn.petblocks.business.logic.persistence2.IPetDataController; -import com.github.shynixn.petblocks.business.logic.persistence2.PetData; -import com.github.shynixn.petblocks.lib.DynamicCommandHelper; -import org.bukkit.Bukkit; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; - -/** - * Created by Shynixn - */ -public class PetDataCommandExecutor extends DynamicCommandHelper { - - private Plugin plugin; - - public PetDataCommandExecutor(Plugin plugin) { - super(ConfigCommands.getInstance().getPetblockGuiCommandContainer()); - this.plugin = plugin; - } - - private void renamePet(final Player player, String name) { - System.out.println("RUN"); - Bukkit.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { - System.out.println("EXECUTING"); - try (IPetDataController controller = Factory.createPetDataController()) { - final PetData petData; - if ((petData = controller.getByPlayer(player)) != null) { - petData.setName(name); - controller.store(petData); - player.sendMessage(Language.PREFIX + Language.NAME_SUCCES_MESSAGE); - } else { - player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); - } - System.out.println("SAVED"); - } catch (Exception e) { - e.printStackTrace(); - } - }); - } - - @Override - public void onCommandSend(CommandSender sender, final String[] args) { - if (!(sender instanceof Player)) - return; - System.out.println("1"); - final Player player = (Player) sender; - if (player.getLocation() != null && !Config.getInstance().allowPetSpawning(player.getLocation())) { - System.out.println("NOPE"); - return; - } - else if (args.length == 2 && args[0] != null && args[0].equalsIgnoreCase("rename") && player.hasPermission(Permission.RENAMEPET.get())) { - System.out.println("2"); - if (args[1] == null || args[1].length() > ConfigPet.getInstance().getDesign_maxPetNameLength()) - player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); - else { - System.out.println("3"); - this.renamePet(player, args[1]); - //Missing RESPAWN - } - } - } -} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/GUI.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/GUI.java deleted file mode 100644 index 043a39551..000000000 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/GUI.java +++ /dev/null @@ -1,212 +0,0 @@ -package com.github.shynixn.petblocks.business.logic.persistence2.ui; - -import com.github.shynixn.petblocks.api.PetBlocksApi; -import com.github.shynixn.petblocks.api.entities.PetType; -import com.github.shynixn.petblocks.business.Config; -import com.github.shynixn.petblocks.business.Language; -import com.github.shynixn.petblocks.business.Permission; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle; -import com.github.shynixn.petblocks.business.logic.persistence.PetDataManager; -import com.github.shynixn.petblocks.lib.BukkitUtilities; -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; - -class GUI { - - public Player player; - private Inventory inventory; - private GuiPage page; - private GuiPageContainer container; - - public GUI(Player player) { - this.player = player; - } - - public void open() { - if (this.player.getOpenInventory() != null) - this.player.closeInventory(); - this.inventory = Bukkit.getServer().createInventory(this.player, 54, Language.GUI_TITLE); - this.player.openInventory(this.inventory); - } - - public boolean isClose() { - return this.inventory == null; - } - - void setMainItems(Player player) { - if (this.isClose()) { - return; - } - this.clearInventory(this.inventory); - for (final PetType petType : PetType.values()) { - final String name = petType.name(); - Config.getInstance().setMyContainer(this.inventory, Language.getDisplayName(name), ConfigGUI.getInstance().getContainer(petType), (Permission.SINGLEPETTYPE.get() + name.toLowerCase()), Permission.ALLPETTYPES.get()); - } - this.page = GuiPage.MAIN; - } - - public void setMainItems(Player player, PetType petType, boolean enabled, boolean refresh) { - if (this.isClose()) { - return; - } - if (this.page != GuiPage.MAIN) - this.setMainItems(player); - if (this.inventory.getItem(ConfigGUI.getInstance().getGeneral_myContainer().getPosition()) == null || refresh || this.inventory.getItem(ConfigGUI.getInstance().getGeneral_myContainer().getPosition()).getType() != Material.SKULL_ITEM) - this.inventory.setItem(ConfigGUI.getInstance().getGeneral_myContainer().getPosition(), BukkitUtilities.nameItem(this.getItemStack(player, petType), Language.MY_PET, null)); - if (!enabled) - Config.getInstance().setMyContainer(this.inventory, Language.ENABLE_PET, ConfigGUI.getInstance().getGeneral_enablePetContainer(), (Permission) null); - else - Config.getInstance().setMyContainer(this.inventory, Language.DISABLE_PET, ConfigGUI.getInstance().getGeneral_disablePetContainer(), (Permission) null); - - Config.getInstance().setMyContainer(this.inventory, Language.CANCEL, ConfigGUI.getInstance().getItems_cancelpetContainer(), (Permission) null); - Config.getInstance().setMyContainer(this.inventory, Language.CANNON, ConfigGUI.getInstance().getItems_cannonpetContainer(), Permission.CANNON); - Config.getInstance().setMyContainer(this.inventory, Language.CALL, ConfigGUI.getInstance().getItems_callpetContainer(), (Permission) null); - - Config.getInstance().setMyContainer(this.inventory, Language.SKULL_NAMING, ConfigGUI.getInstance().getItems_skullNamingContainer(), Permission.RENAMESKULL); - Config.getInstance().setMyContainer(this.inventory, Language.NAMING, ConfigGUI.getInstance().getItems_namingContainer(), Permission.RENAMEPET); - Config.getInstance().setMyContainer(this.inventory, Language.HAT, ConfigGUI.getInstance().getItems_hatpetContainer(), Permission.WEARPET); - Config.getInstance().setMyContainer(this.inventory, Language.RIDING, ConfigGUI.getInstance().getItems_ridingpetContainer(), Permission.RIDEPET); - - Config.getInstance().setMyContainer(this.inventory, Language.COSTUME, ConfigGUI.getInstance().getItems_defaultcostumeContainer(), (Permission) null); - Config.getInstance().setMyContainer(this.inventory, Language.COLOR_COSTUME, ConfigGUI.getInstance().getItems_colorcostumeContainer(), (Permission) null); - Config.getInstance().setMyContainer(this.inventory, Language.CUSTOM_COSTUME, ConfigGUI.getInstance().getItems_customcostumeContainer(), (Permission) null); - - if (PetBlocksApi.getPetMeta(player).isSoundsEnabled()) - Config.getInstance().setMyContainer(this.inventory, Language.MUTE, ConfigGUI.getInstance().getItems_soundEnabledContainer(), (Permission) null); - else - Config.getInstance().setMyContainer(this.inventory, Language.UNMUTE, ConfigGUI.getInstance().getItems_soundDisabledContainer(), (Permission) null); - - Config.getInstance().setMyContainer(this.inventory, Language.PARTICLE, ConfigGUI.getInstance().getItems_particlepetContainer(), (Permission) null); - this.fillEmptySlots(this.inventory); - } - - public void setDefaultCostumeItems(Player player) { - this.setCostumes(player, ConfigGUI.getInstance().getDefaultItemStacks(), GuiPage.DEFAULTCOSTUMES, 0); - } - - public void setColorCostumeItems(Player player) { - this.setCostumes(player, ConfigGUI.getInstance().getColoredItemStacks(), GuiPage.COLORCOSTUMES, 0); - } - - public void setCustomCostumeItems(Player player) { - this.setCostumes(player, ConfigGUI.getInstance().getCustomItemStacks(), GuiPage.CUSTOMCOSTUMES, 0); - } - - public void setParticleCostumeItems(Player player) { - if (this.isClose()) { - return; - } - this.clearInventory(this.inventory); - for (int i = 0; i < 54 && i < ConfigParticle.getInstance().getParticleItemStacks().length; i++) { - this.inventory.setItem(i, ConfigParticle.getInstance().getParticleItemStacks()[i]); - } - this.fillEmptySlots(this.inventory); - this.page = GuiPage.PARTICLES; - } - - public PetType getPetType(ItemStack itemStack) { - for (final String name : PetType.getNames()) { - if (BukkitUtilities.compareItemName(itemStack, Language.getDisplayName(name))) { - return PetType.getPetTypeFromName(name); - } - } - return null; - } - - void setCostumes(Player player, ItemStack[] itemStacks, GuiPage page, int type) { - if (this.isClose()) { - return; - } - int count; - GuiPageContainer current; - if (this.container != null && type == 1) { - current = this.container; - while (current.next != null) { - current = current.next; - } - } else if (this.container != null && type == 2) { - current = this.container; - if (current.next == null) - return; - if (current.next.next == null) - return; - while (current.next.next.next != null) { - current = current.next; - } - current.next = null; - } else { - this.container = new GuiPageContainer(page); - current = this.container; - } - - count = current.startCount; - this.clearInventory(this.inventory); - inventory.setItem(ConfigGUI.getInstance().getGeneral_previouspageContainer().getPosition(), BukkitUtilities.nameItemDisplay(ConfigGUI.getInstance().getGeneral_previouspageContainer().generate(), Language.PREVIOUS)); - inventory.setItem(ConfigGUI.getInstance().getGeneral_nextpageContainer().getPosition(), BukkitUtilities.nameItemDisplay(ConfigGUI.getInstance().getGeneral_nextpageContainer().generate(), Language.NEXT)); - for (int i = 0; i < 45 && (i + current.startCount) < itemStacks.length; i++) { - if (inventory.getItem(i) == null || inventory.getItem(i).getType() == Material.AIR) { - inventory.setItem(i, itemStacks[(i + current.startCount)]); - count++; - } - } - this.fillEmptySlots(inventory); - - GuiPageContainer runRef = this.container; - while (runRef.next != null) - runRef = runRef.next; - runRef.next = new GuiPageContainer(page); - runRef.next.startCount = count; - } - - ItemStack[] getItemstackFromPage(GuiPage page) { - if (page == GuiPage.COLORCOSTUMES) - return ConfigGUI.getInstance().getColoredItemStacks(); - else if (page == GuiPage.DEFAULTCOSTUMES) - return ConfigGUI.getInstance().getDefaultItemStacks(); - else if (page == GuiPage.CUSTOMCOSTUMES) - return ConfigGUI.getInstance().getCustomItemStacks(); - return new ItemStack[0]; - } - - public Inventory getInventory() { - return inventory; - } - - static class GuiPageContainer { - GuiPage page; - int startCount; - GuiPageContainer next; - - GuiPageContainer(GuiPage page) { - super(); - this.page = page; - } - } - - enum GuiPage { - MAIN, DEFAULTCOSTUMES, COLORCOSTUMES, CUSTOMCOSTUMES, PARTICLES - } - - - private void fillEmptySlots(Inventory inventory) { - for (int i = 0; i < inventory.getContents().length; i++) { - if (inventory.getItem(i) == null || inventory.getItem(i).getType() == Material.AIR) { - inventory.setItem(i, BukkitUtilities.nameItemDisplay(ConfigGUI.getInstance().getGeneral_emptyslotContainer().generate(), Language.EMPTY)); - } - } - } - - private void clearInventory(Inventory inventory) { - for (int i = 0; i < inventory.getContents().length; i++) { - inventory.setItem(i, null); - } - } - - private ItemStack getItemStack(Player player, PetType petType) { - return Config.getInstance().getMyItemStack(player, Language.getDisplayName(petType.name()), ConfigGUI.getInstance().getContainer(petType), (Permission.SINGLEPETTYPE.get() + petType.name().toLowerCase()), Permission.ALLPETTYPES.get()); - } -} diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/PetDataListener.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/PetDataListener.java deleted file mode 100644 index f44fb5eb5..000000000 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence2/ui/PetDataListener.java +++ /dev/null @@ -1,374 +0,0 @@ -package com.github.shynixn.petblocks.business.logic.persistence2.ui; - -import com.github.shynixn.petblocks.api.PetBlocksApi; -import com.github.shynixn.petblocks.api.entities.PetBlock; -import com.github.shynixn.petblocks.api.entities.PetMeta; -import com.github.shynixn.petblocks.api.entities.PetType; -import com.github.shynixn.petblocks.api.events.PetMetaEvent; -import com.github.shynixn.petblocks.business.Config; -import com.github.shynixn.petblocks.business.Language; -import com.github.shynixn.petblocks.business.Permission; -import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; -import com.github.shynixn.petblocks.business.logic.persistence.PetData; -import com.github.shynixn.petblocks.business.logic.persistence.PetDataManager; -import com.github.shynixn.petblocks.business.logic.persistence2.Factory; -import com.github.shynixn.petblocks.business.logic.persistence2.IPetDataController; -import com.github.shynixn.petblocks.lib.BukkitEvents; -import com.github.shynixn.petblocks.lib.BukkitUtilities; -import com.github.shynixn.petblocks.lib.util.SimpleListener; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryCloseEvent; -import org.bukkit.event.player.AsyncPlayerChatEvent; -import org.bukkit.event.player.PlayerChatEvent; -import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerQuitEvent; -import org.bukkit.inventory.meta.SkullMeta; -import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.util.Vector; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@SuppressWarnings("deprecation") -class PetDataListener extends SimpleListener { - private final Map openGuis = new HashMap<>(); - private final List namingPlayers = new ArrayList<>(); - private final List namingSkull = new ArrayList<>(); - - PetDataListener(Plugin plugin) { - super(plugin); - } - - /* private void selectPet(Player player, PetType petType) - { - if (player.hasPermission(Permission.ALLPETTYPES.get()) || player.hasPermission(Permission.SINGLEPETTYPE.get() + type.name().toLowerCase())) { - if (PetBlocksApi.hasPetBlock(player)) - PetBlocksApi.removePetBlock(player); - - try(IPetDataController petDataController = Factory.createPetDataController()) - { - - } catch (Exception e) { - e.printStackTrace(); - } - - /* petMeta = this.manager.createPetMeta(player, type); - this.manager.addPetMeta(petMeta); - if (ConfigGUI.getInstance().isSettings_copyskin()) { - petMeta.setSkin(Material.SKULL_ITEM, (short) 3, ConfigGUI.getInstance().getContainer(petMeta.getType()).getSkullName()); - } - this.manager.persist(petMeta); - this.manager.gui.setMainItems(player, petMeta.getType(), false, true); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } - - @EventHandler - public void playerClickEvent(final InventoryClickEvent event) { - PetMeta petMeta; - PetBlock petBlock; - final Player player = (Player) event.getWhoClicked(); - if(!this.openGuis.containsKey(player)) - return; - - GUI gui = this.openGuis.get(player); - - - if (event.getView().getTopInventory().getTitle().equals(Language.GUI_TITLE) && gui.getInventory().equals(event.getInventory())) { - if (gui.getPetType(event.getCurrentItem()) != null) { - final PetType type = gui.getPetType(event.getCurrentItem()); - this.selectPet(player, type); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.MY_PET) && ((petMeta = this.manager.getPetMeta(player)) != null)) { - if (ConfigGUI.getInstance().isSettings_copyskin()) { - petMeta.setSkin(Material.SKULL_ITEM, (short) 3, ConfigGUI.getInstance().getContainer(petMeta.getType()).getSkullName()); - } else { - petMeta.setSkin(Material.getMaterial(ConfigGUI.getInstance().getItems_defaultcostumeContainer().getId()), (short) ConfigGUI.getInstance().getItems_defaultcostumeContainer().getDamage(), ConfigGUI.getInstance().getItems_defaultcostumeContainer().getSkullName()); - } - petMeta.setParticleEffect(null); - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) - petBlock.respawn(); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.ENABLE_PET) && ((petMeta = this.manager.getPetMeta(player)) != null)) { - PetBlocksApi.setPetBlock(player, petMeta); - this.manager.gui.setMainItems(player, petMeta.getType(), true, false); - petMeta.setEnabled(true); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.DISABLE_PET) && ((petMeta = this.manager.getPetMeta(player)) != null) && PetBlocksApi.hasPetBlock(player)) { - PetBlocksApi.removePetBlock(player); - this.manager.gui.setMainItems(player, petMeta.getType(), false, false); - petMeta.setEnabled(false); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.MUTE) && ((petMeta = this.manager.getPetMeta(player)) != null)) { - PetBlocksApi.getPetMeta(player).setSoundsEnabled(false); - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.UNMUTE) && ((petMeta = this.manager.getPetMeta(player)) != null)) { - PetBlocksApi.getPetMeta(player).setSoundsEnabled(true); - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.PREVIOUS)) { - this.manager.gui.setCostumes(player, this.manager.gui.getItemstackFromPage(this.manager.pages.get(player).page), this.manager.pages.get(player).page, 2); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.NEXT)) { - this.manager.gui.setCostumes(player, this.manager.gui.getItemstackFromPage(this.manager.pages.get(player).page), this.manager.pages.get(player).page, 1); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.COSTUME)) { - this.manager.gui.setDefaultCostumeItems(player); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.COLOR_COSTUME)) { - this.manager.gui.setColorCostumeItems(player); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CUSTOM_COSTUME)) { - this.manager.gui.setCustomCostumeItems(player); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.PARTICLE)) { - this.manager.gui.setParticleCostumeItems(player); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CALL) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { - petBlock.teleport(player); - player.closeInventory(); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.HAT) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { - if (player.hasPermission(Permission.WEARPET.get())) { - petBlock.wear(player); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.RIDING) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { - if (player.hasPermission(Permission.RIDEPET.get())) { - petBlock.ride(player); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.NAMING)) { - if (player.hasPermission(Permission.RENAMEPET.get())) { - this.namingPlayers.add(player); - player.closeInventory(); - player.sendMessage(Language.PREFIX + Language.NAME_MESSAGE); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.SKULL_NAMING)) { - if (player.hasPermission(Permission.RENAMESKULL.get())) { - this.namingSkull.add(player); - player.closeInventory(); - player.sendMessage(Language.PREFIX + Language.SNAME_MESSAGE); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CANNON) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { - if (player.hasPermission(Permission.CANNON.get())) { - player.closeInventory(); - petBlock.launch(this.getDirection(player)); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CANCEL)) { - player.closeInventory(); - } else if (this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.PARTICLES && ((petMeta = this.manager.getPetMeta(player)) != null)) { - if (!player.hasPermission(Permission.ALLPARTICLES.get()) && !player.hasPermission(Permission.SINGLEPARTICLE.get() + "" + event.getSlot())) { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } else { - petMeta.setParticleEffect(ConfigParticle.getInstance().getParticle(event.getSlot())); - } - player.closeInventory(); - this.manager.gui.open(player); - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) - petBlock.respawn(); - } else if (!BukkitUtilities.compareItemName(event.getCurrentItem(), Language.EMPTY) && (this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.DEFAULTCOSTUMES || this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.CUSTOMCOSTUMES || this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.COLORCOSTUMES) && event.getCurrentItem() != null) { - final int number; - try { - String s = event.getCurrentItem().getItemMeta().getDisplayName(); - s = ChatColor.stripColor(s); - number = Integer.parseInt(s); - } catch (final Exception ex) { - BukkitUtilities.sendColorMessage("Number prefix (lang.yml) only allows color codes!", ChatColor.RED, "[PetBlocks]"); - player.sendMessage(ChatColor.RED + "Number-prefix (lang.yml) only allows color codes! Contact an admin in order to resolve this issue."); - player.closeInventory(); - return; - } - if (this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.DEFAULTCOSTUMES && (!player.hasPermission(Permission.ALLDEFAULTCOSTUMES.get()) && !player.hasPermission(Permission.SINGLEDEFAULTCOSTUME.get() + "" + number))) { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } else if (this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.COLORCOSTUMES && (!player.hasPermission(Permission.ALLCOLORCOSTUMES.get()) && !player.hasPermission(Permission.SINGLECOLORCOSTUME.get() + "" + number))) { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } else if (this.manager.pages.get(player).page == com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.CUSTOMCOSTUMES && (!player.hasPermission(Permission.ALLCUSTOMCOSTUMES.get()) && !player.hasPermission(Permission.SINGLECUSTOMCOSTUME.get() + "" + number))) { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } else if (event.getClickedInventory().equals(event.getView().getTopInventory()) || player.hasPermission(Permission.OWNINGAMECOSTUMES.get())) { - petMeta = this.manager.getPetMeta(player); - if (petMeta == null) - return; - if (event.getCurrentItem().getType() != Material.SKULL_ITEM) - petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), null); - else { - final SkullMeta meta = (SkullMeta) event.getCurrentItem().getItemMeta(); - if (meta.getOwner() == null) { - petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), NMSRegistry.getSkinUrl(event.getCurrentItem())); - } else { - petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), ((SkullMeta) event.getCurrentItem().getItemMeta()).getOwner()); - } - } - petMeta.setUnbreakable(NMSRegistry.isUnbreakable(event.getCurrentItem())); - player.closeInventory(); - this.manager.gui.open(player); - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) - petBlock.respawn(); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (ConfigGUI.getInstance().isSettings_clickemptyback() && BukkitUtilities.compareItemName(event.getCurrentItem(), Language.EMPTY)) { - petMeta = PetBlocksApi.getPetMeta(player); - if (this.manager.pages.containsKey(player) && this.manager.pages.get(player).page != com.github.shynixn.petblocks.business.logic.persistence.GUI.GuiPage.MAIN) { - this.manager.gui.setMainItems(player); - if (petMeta != null) - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), true); - } - } - event.setCancelled(true); - ((Player) event.getWhoClicked()).updateInventory(); - } - } - - @EventHandler - public void petDataChangeEvent(PetMetaEvent event) { - if (this.getPlugin().getConfig().getBoolean("sql.enabled")) - this.manager.persist(event.getPetMeta()); - } - - @EventHandler - public void playerJoinEvent(final PlayerJoinEvent event) { - final PetMeta petMeta; - if (Config.getInstance().isJoin_enabled()) { - if (!this.manager.hasPetMeta(event.getPlayer()) || Config.getInstance().isJoin_overwriteExistingPet()) { - final PetMeta meta = this.manager.createPetMeta(event.getPlayer(), PetType.CAT); - Config.getInstance().fixJoinDefaultPet(meta); - this.manager.addPetMeta(meta); - this.manager.saveUnsecured(event.getPlayer(), meta); - } - } else { - this.manager.hasPetMeta(event.getPlayer()); - } - if ((petMeta = PetBlocksApi.getPetMeta(event.getPlayer())) != null && petMeta.isEnabled()) { - this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { - @Override - public void run() { - PetBlocksApi.removePetBlock(event.getPlayer()); - PetBlocksApi.setPetBlock(event.getPlayer(), PetDataListener.this.manager.getPetMeta(event.getPlayer())); - } - }, 2L); - } - } - - @EventHandler - public void playerQuitEvent(PlayerQuitEvent event) { - if (this.manager.hasPetMeta(event.getPlayer())) { - this.manager.persist(this.manager.getPetMeta(event.getPlayer())); - PetBlocksApi.removePetBlock(event.getPlayer()); - } - } - - @EventHandler - public void inventoryCloseEvent(InventoryCloseEvent event) { - final Player player = (Player) event.getPlayer(); - if (this.manager.inventories.containsKey(player)) { - this.manager.inventories.remove(player); - } - } - - @EventHandler(priority = EventPriority.HIGHEST) - public void playerChatEvent(PlayerChatEvent event) { - if (!Config.getInstance().isChat_async() && Config.getInstance().isChat_highestpriority()) { - this.handleChatMessage(event); - } - } - - @EventHandler(priority = EventPriority.LOWEST) - public void playerChatEvent2(PlayerChatEvent event) { - if (!Config.getInstance().isChat_async() && !Config.getInstance().isChat_highestpriority()) { - this.handleChatMessage(event); - } - } - - @EventHandler(priority = EventPriority.HIGHEST) - public void playerChatEvent3(final AsyncPlayerChatEvent event) { - if (Config.getInstance().isChat_async() && Config.getInstance().isChat_highestpriority()) { - if (this.namingPlayers.contains(event.getPlayer()) || this.namingSkull.contains(event.getPlayer())) - event.setCancelled(true); - this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { - @Override - public void run() { - PetDataListener.this.handleChatMessage(new PlayerChatEvent(event.getPlayer(), event.getMessage())); - } - }, 1L); - } - } - - @EventHandler(priority = EventPriority.LOW) - public void playerChatEvent4(final AsyncPlayerChatEvent event) { - if (Config.getInstance().isChat_async() && !Config.getInstance().isChat_highestpriority()) { - if (this.namingPlayers.contains(event.getPlayer()) || this.namingSkull.contains(event.getPlayer())) - event.setCancelled(true); - this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { - @Override - public void run() { - PetDataListener.this.handleChatMessage(new PlayerChatEvent(event.getPlayer(), event.getMessage())); - } - }, 1L); - } - } - - private void handleChatMessage(PlayerChatEvent event) { - if (this.namingPlayers.contains(event.getPlayer())) { - event.setCancelled(true); - if (event.getMessage().length() > ConfigPet.getInstance().getDesign_maxPetNameLength()) - event.getPlayer().sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); - else { - try { - this.namingPlayers.remove(event.getPlayer()); - final PetMeta petMeta; - final PetBlock petBlock; - if ((petMeta = this.manager.getPetMeta(event.getPlayer())) != null) { - petMeta.setDisplayName(event.getMessage()); - } - if ((petBlock = PetBlocksApi.getPetBlock(event.getPlayer())) != null) - petBlock.respawn(); - event.getPlayer().sendMessage(Language.PREFIX + Language.NAME_SUCCES_MESSAGE); - } catch (final Exception e) { - event.getPlayer().sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); - } - } - } else if (this.namingSkull.contains(event.getPlayer())) { - event.setCancelled(true); - if (event.getMessage().length() > 20) - event.getPlayer().sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); - else { - try { - this.namingSkull.remove(event.getPlayer()); - final PetMeta petMeta; - final PetBlock petBlock; - if ((petMeta = this.manager.getPetMeta(event.getPlayer())) != null) { - petMeta.setSkin(Material.SKULL_ITEM, (short) 3, event.getMessage()); - } - if ((petBlock = PetBlocksApi.getPetBlock(event.getPlayer())) != null) - petBlock.respawn(); - event.getPlayer().sendMessage(Language.PREFIX + Language.SNAME_SUCCES_MESSAGE); - } catch (final Exception e) { - event.getPlayer().sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); - } - } - } - } - - private Vector getDirection(Player player) { - final Vector vector = new Vector(); - final double rotX = player.getLocation().getYaw(); - final double rotY = player.getLocation().getPitch(); - vector.setY(-Math.sin(Math.toRadians(rotY))); - final double h = Math.cos(Math.toRadians(rotY)); - vector.setX(-h * Math.sin(Math.toRadians(rotX))); - vector.setZ(h * Math.cos(Math.toRadians(rotX))); - vector.setY(0.5); - return vector.multiply(3); - }*/ -} diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/DataBaseRepository.java b/src/main/java/com/github/shynixn/petblocks/lib/DataBaseRepository.java similarity index 87% rename from src/main/java/com/github/shynixn/petblocks/lib/util/DataBaseRepository.java rename to src/main/java/com/github/shynixn/petblocks/lib/DataBaseRepository.java index 63112a5d7..5ab3d1ad9 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/util/DataBaseRepository.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/DataBaseRepository.java @@ -1,5 +1,9 @@ -package com.github.shynixn.petblocks.lib.util; +package com.github.shynixn.petblocks.lib; +import com.github.shynixn.petblocks.api.persistence.controller.IDatabaseController; + +import java.sql.ResultSet; +import java.sql.SQLException; import java.util.Collections; import java.util.List; @@ -101,4 +105,11 @@ public List getAll() { * @param item item */ public abstract void insert(T item); + + /** + * Generates the entity from the given resultSet + * @param resultSet resultSet + * @return entity + */ + public abstract T from(ResultSet resultSet) throws SQLException; } \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/DbConnectionContext.java b/src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java similarity index 61% rename from src/main/java/com/github/shynixn/petblocks/lib/util/DbConnectionContext.java rename to src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java index e2aeb5818..12be9041d 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/util/DbConnectionContext.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java @@ -1,10 +1,12 @@ -package com.github.shynixn.petblocks.lib.util; +package com.github.shynixn.petblocks.lib; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import java.io.IOException; import java.sql.*; +import java.util.HashMap; +import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -37,9 +39,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -public class DbConnectionContext implements AutoCloseable { - +public class ExtensionHikariConnectionContext implements AutoCloseable { + public static final String SQLITE_DRIVER = "org.sqlite.JDBC"; + public static final String MYSQL_DRIVER = "com.mysql.jdbc.Driver"; private HikariDataSource ds; + private SQlRetriever retriever; + private Map cache = new HashMap<>(); /** * Initializes a new databaseConnectionContext for the given url, userName and password @@ -48,22 +53,23 @@ public class DbConnectionContext implements AutoCloseable { * @param userName userName * @param password password */ - private DbConnectionContext(String driver, String url, String userName, String password) { + private ExtensionHikariConnectionContext(String driver, String url, String userName, String password, SQlRetriever retriever) { super(); - System.out.println("URL: " + url); + this.retriever = retriever; final HikariConfig config = new HikariConfig(); config.setDriverClassName(driver); config.setConnectionTestQuery("SELECT 1"); config.setJdbcUrl(url); - if(userName != null) + if (userName != null) config.setUsername(userName); - if(password != null) + if (password != null) config.setPassword(password); config.addDataSourceProperty("cachePrepStmts", "true"); config.addDataSourceProperty("prepStmtCacheSize", "250"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); config.setMaximumPoolSize(10); this.ds = new HikariDataSource(config); + Logger.getLogger(this.getClass().getSimpleName()).log(Level.INFO, "Connected to " + url); } /** @@ -89,6 +95,21 @@ private void setParameters(PreparedStatement preparedStatement, Object[] paramet } } + /** + * Reads a sqlStatement from the given fileName, executes it and sets the given parameter + * + * @param fileName fileName + * @param connection connection + * @param parameters parameters + * @return success + * @throws SQLException exception + */ + public boolean executeStored(String fileName, Connection connection, Object... parameters) throws SQLException { + if (fileName == null) + throw new IllegalArgumentException("FileName cannot be null!"); + return this.execute(this.getStringFromFile(fileName), connection, parameters); + } + /** * Executes a preparedStatement and sets the given parameters to the statement * @@ -111,6 +132,21 @@ public boolean execute(String sql, Connection connection, Object... parameters) } } + /** + * Reads a sqlStatement from the given fileName, executes it and sets the given parameter + * + * @param fileName fileName + * @param connection connection + * @param parameters parameters + * @return resultSet + * @throws SQLException exception + */ + public PreparedStatement executeStoredQuery(String fileName, Connection connection, Object... parameters) throws SQLException { + if (fileName == null) + throw new IllegalArgumentException("FileName cannot be null!"); + return this.executeQuery(this.getStringFromFile(fileName), connection, parameters); + } + /** * Executes a preparedStatement and sets the given parameters to the statement * @@ -132,6 +168,21 @@ public PreparedStatement executeQuery(String sql, Connection connection, Object. return preparedStatement; } + /** + * Reads a sqlStatement from the given fileName, executes it and sets the given parameter + * + * @param fileName fileName + * @param connection connection + * @param parameters parameters + * @return resultCode + * @throws SQLException exception + */ + public int executeStoredUpdate(String fileName, Connection connection, Object... parameters) throws SQLException { + if (fileName == null) + throw new IllegalArgumentException("FileName cannot be null!"); + return this.executeUpdate(this.getStringFromFile(fileName), connection, parameters); + } + /** * Executes a preparedStatement and sets the given parameters to the statement * @@ -142,19 +193,34 @@ public PreparedStatement executeQuery(String sql, Connection connection, Object. * @throws SQLException exception */ public int executeUpdate(String sql, Connection connection, Object... parameters) throws SQLException { - System.out.println("SQL: " + sql); if (sql == null) throw new IllegalArgumentException("Sql cannot be null!"); if (connection == null) throw new IllegalArgumentException("Connection cannot be null!"); if (connection.isClosed()) throw new IllegalArgumentException("Connection is closed. Cannot create statement!"); + System.out.println("UPDATE: " + sql); try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) { this.setParameters(preparedStatement, parameters); return preparedStatement.executeUpdate(); } } + /** + * Reads a sqlStatement from the given fileName, executes it and sets the given parameter + * + * @param fileName fileName + * @param connection connection + * @param parameters parameters + * @return id + * @throws SQLException exception + */ + public int executeStoredInsert(String fileName, Connection connection, Object... parameters) throws SQLException { + if (fileName == null) + throw new IllegalArgumentException("FileName cannot be null!"); + return this.executeInsert(this.getStringFromFile(fileName), connection, parameters); + } + /** * Executes a preparedStatement and sets the given parameters to the statement * @@ -190,28 +256,51 @@ public void close() { this.ds.close(); this.ds = null; } + if (this.cache != null) { + this.cache.clear(); + this.cache = null; + } + } + + /** + * Manages caching of statements + * + * @param statementName statementName + * @return sqlStatement + * @throws IOException exception + */ + public String getStringFromFile(String statementName) { + if (statementName == null) + throw new IllegalArgumentException("Statement cannot be null!"); + if (!this.cache.containsKey(statementName)) { + this.cache.put(statementName, this.retriever.loadSqlStatement(statementName)); + } + return this.cache.get(statementName); } /** * Opens a new DatabaseContext for the given url + * * @param driver driver - * @param url url + * @param url url * @return DbConnectionContext * @throws IOException exception */ - public static DbConnectionContext from(String driver, String url) throws IOException { + public static ExtensionHikariConnectionContext from(String driver, String url, SQlRetriever retriever) throws IOException { if (driver == null) throw new IllegalArgumentException("Driver cannot be null!"); if (url == null) throw new IllegalArgumentException("Database cannot be null!"); + if(retriever == null) + throw new IllegalArgumentException("Retriever cannot be null!"); try { Class.forName(driver); - return new DbConnectionContext(driver, url, null, null); + return new ExtensionHikariConnectionContext(driver, url, null, null, retriever); } catch (final ClassNotFoundException ex) { - Logger.getLogger(DbConnectionContext.class.getSimpleName()).log(Level.WARNING, "JDBC Driver not found!"); + Logger.getLogger(ExtensionHikariConnectionContext.class.getSimpleName()).log(Level.WARNING, "JDBC Driver not found!"); throw new IOException(ex); } catch (final Exception ex) { - Logger.getLogger(DbConnectionContext.class.getSimpleName()).log(Level.WARNING, "Cannot connect to database!"); + Logger.getLogger(ExtensionHikariConnectionContext.class.getSimpleName()).log(Level.WARNING, "Cannot connect to database!"); throw new IOException(ex); } } @@ -219,7 +308,7 @@ public static DbConnectionContext from(String driver, String url) throws IOExcep /** * Opens a new DatabaseContext for the given ip, port, database, username and password * - * @param driver driver + * @param driver driver * @param ip ip * @param port port * @param database database @@ -228,7 +317,7 @@ public static DbConnectionContext from(String driver, String url) throws IOExcep * @return DbConnectionContext * @throws IOException exception */ - public static DbConnectionContext from(String driver, String urlPrefix, String ip, int port, String database, String userName, String password) throws IOException { + public static ExtensionHikariConnectionContext from(String driver, String urlPrefix, String ip, int port, String database, String userName, String password, SQlRetriever retriever) throws IOException { if (driver == null) throw new IllegalArgumentException("Driver cannot be null!"); if (ip == null) @@ -239,15 +328,27 @@ public static DbConnectionContext from(String driver, String urlPrefix, String i throw new IllegalArgumentException("Username cannot be null!"); if (password == null) throw new IllegalArgumentException("Password cannot be null!"); + if(retriever == null) + throw new IllegalArgumentException("Retriever cannot be null!"); try { Class.forName(driver); - return new DbConnectionContext(driver, urlPrefix + ip + ':' + port + '/' + database, userName, password); + return new ExtensionHikariConnectionContext(driver, urlPrefix + ip + ':' + port + '/' + database, userName, password, retriever); } catch (final ClassNotFoundException ex) { - Logger.getLogger(DbConnectionContext.class.getSimpleName()).log(Level.WARNING, "JDBC Driver not found!"); + Logger.getLogger(ExtensionHikariConnectionContext.class.getSimpleName()).log(Level.WARNING, "JDBC Driver not found!"); throw new IOException(ex); } catch (final Exception ex) { - Logger.getLogger(DbConnectionContext.class.getSimpleName()).log(Level.WARNING, "Cannot connect to database!"); + Logger.getLogger(ExtensionHikariConnectionContext.class.getSimpleName()).log(Level.WARNING, "Cannot connect to database!"); throw new IOException(ex); } } + + public interface SQlRetriever { + /** + * Loads a sqlStatement from the givenFile + * + * @param fileName fileName + * @return sqlStatement + */ + String loadSqlStatement(String fileName); + } } \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java b/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java index da0a37112..5916dbdee 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java @@ -70,7 +70,14 @@ public static void setItemInHand19(Player player, ItemStack itemStack, boolean o } private static boolean isAbove18() { - return BukkitUtilities.getServerVersion().equals("v1_9_R1") + try + { + BukkitUtilities.getServerVersion(); + }catch (RuntimeException ex) + { + return false; + } + return BukkitUtilities.getServerVersion().equals("v1_9_R1") || BukkitUtilities.getServerVersion().equals("v1_9_R2") || BukkitUtilities.getServerVersion().equals("v1_10_R1") || BukkitUtilities.getServerVersion().equals("v1_11_R1"); diff --git a/src/main/java/com/github/shynixn/petblocks/lib/ParticleEffect.java b/src/main/java/com/github/shynixn/petblocks/lib/ParticleEffect.java index 993601065..da1d23c3e 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/ParticleEffect.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/ParticleEffect.java @@ -644,15 +644,15 @@ public static void initialize() throws VersionIncompatibleException { return; } try { - version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split(Pattern.quote("_"))[1]); + version = Integer.parseInt(ParticleReflectionUtils.PackageType.getServerVersion().split(Pattern.quote("_"))[1]); if (version > 7) { - enumParticle = ReflectionUtils.PackageType.MINECRAFT_SERVER.getClass("EnumParticle"); + enumParticle = ParticleReflectionUtils.PackageType.MINECRAFT_SERVER.getClass("EnumParticle"); } - Class packetClass = ReflectionUtils.PackageType.MINECRAFT_SERVER.getClass(version < 7 ? "Packet63WorldParticles" : "PacketPlayOutWorldParticles"); - packetConstructor = ReflectionUtils.getConstructor(packetClass); - getHandle = ReflectionUtils.getMethod("CraftPlayer", ReflectionUtils.PackageType.CRAFTBUKKIT_ENTITY, "getHandle"); - playerConnection = ReflectionUtils.getField("EntityPlayer", ReflectionUtils.PackageType.MINECRAFT_SERVER, false, "playerConnection"); - sendPacket = ReflectionUtils.getMethod(playerConnection.getType(), "sendPacket", ReflectionUtils.PackageType.MINECRAFT_SERVER.getClass("Packet")); + Class packetClass = ParticleReflectionUtils.PackageType.MINECRAFT_SERVER.getClass(version < 7 ? "Packet63WorldParticles" : "PacketPlayOutWorldParticles"); + packetConstructor = ParticleReflectionUtils.getConstructor(packetClass); + getHandle = ParticleReflectionUtils.getMethod("CraftPlayer", ParticleReflectionUtils.PackageType.CRAFTBUKKIT_ENTITY, "getHandle"); + playerConnection = ParticleReflectionUtils.getField("EntityPlayer", ParticleReflectionUtils.PackageType.MINECRAFT_SERVER, false, "playerConnection"); + sendPacket = ParticleReflectionUtils.getMethod(playerConnection.getType(), "sendPacket", ParticleReflectionUtils.PackageType.MINECRAFT_SERVER.getClass("Packet")); } catch (Exception exception) { throw new VersionIncompatibleException("Your current bukkit version seems to be incompatible with this library", exception); } @@ -684,23 +684,23 @@ private void initializePacket(Location center) throws PacketInstantiationExcepti if (data != null) { name += data.getPacketDataString(); } - ReflectionUtils.setValue(packet, true, "a", name); + ParticleReflectionUtils.setValue(packet, true, "a", name); } else { - ReflectionUtils.setValue(packet, true, "a", enumParticle.getEnumConstants()[effect.getId()]); - ReflectionUtils.setValue(packet, true, "j", longDistance); + ParticleReflectionUtils.setValue(packet, true, "a", enumParticle.getEnumConstants()[effect.getId()]); + ParticleReflectionUtils.setValue(packet, true, "j", longDistance); if (data != null) { int[] packetData = data.getPacketData(); - ReflectionUtils.setValue(packet, true, "k", effect == ParticleEffect.ITEM_CRACK ? packetData : new int[]{packetData[0] | (packetData[1] << 12)}); + ParticleReflectionUtils.setValue(packet, true, "k", effect == ParticleEffect.ITEM_CRACK ? packetData : new int[]{packetData[0] | (packetData[1] << 12)}); } } - ReflectionUtils.setValue(packet, true, "b", (float) center.getX()); - ReflectionUtils.setValue(packet, true, "c", (float) center.getY()); - ReflectionUtils.setValue(packet, true, "d", (float) center.getZ()); - ReflectionUtils.setValue(packet, true, "e", offsetX); - ReflectionUtils.setValue(packet, true, "f", offsetY); - ReflectionUtils.setValue(packet, true, "g", offsetZ); - ReflectionUtils.setValue(packet, true, "h", speed); - ReflectionUtils.setValue(packet, true, "i", amount); + ParticleReflectionUtils.setValue(packet, true, "b", (float) center.getX()); + ParticleReflectionUtils.setValue(packet, true, "c", (float) center.getY()); + ParticleReflectionUtils.setValue(packet, true, "d", (float) center.getZ()); + ParticleReflectionUtils.setValue(packet, true, "e", offsetX); + ParticleReflectionUtils.setValue(packet, true, "f", offsetY); + ParticleReflectionUtils.setValue(packet, true, "g", offsetZ); + ParticleReflectionUtils.setValue(packet, true, "h", speed); + ParticleReflectionUtils.setValue(packet, true, "i", amount); } catch (Exception exception) { throw new PacketInstantiationException("Packet instantiation failed", exception); } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.java b/src/main/java/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.java new file mode 100644 index 000000000..21e81ec4d --- /dev/null +++ b/src/main/java/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.java @@ -0,0 +1,279 @@ +package com.github.shynixn.petblocks.lib; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; + +import org.bukkit.Bukkit; + +/** + * ReflectionUtils + *

+ * This class provides useful methods which makes dealing with reflection much easier, especially when working with Bukkit + *

+ * You are welcome to use it, modify it and redistribute it under the following conditions: + *

    + *
  • Don't claim this class as your own + *
  • Don't remove this disclaimer + *
+ *

+ * It would be nice if you provide credit to me if you use this class in a published project + * + * @author DarkBlade12 + * @version 1.1 + */ +public final class ParticleReflectionUtils { + // Prevent accidental construction + private ParticleReflectionUtils() {} + + public static Constructor getConstructor(Class clazz, Class... parameterTypes) throws NoSuchMethodException { + Class[] primitiveTypes = DataType.getPrimitive(parameterTypes); + for (Constructor constructor : clazz.getConstructors()) { + if (!DataType.compare(DataType.getPrimitive(constructor.getParameterTypes()), primitiveTypes)) { + continue; + } + return constructor; + } + throw new NoSuchMethodException("There is no such constructor in this class with the specified parameter types"); + } + + public static Constructor getConstructor(String className, PackageType packageType, Class... parameterTypes) throws NoSuchMethodException, ClassNotFoundException { + return getConstructor(packageType.getClass(className), parameterTypes); + } + + public static Object instantiateObject(Class clazz, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + return getConstructor(clazz, DataType.getPrimitive(arguments)).newInstance(arguments); + } + + public static Object instantiateObject(String className, PackageType packageType, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException { + return instantiateObject(packageType.getClass(className), arguments); + } + + public static Method getMethod(Class clazz, String methodName, Class... parameterTypes) throws NoSuchMethodException { + Class[] primitiveTypes = DataType.getPrimitive(parameterTypes); + for (Method method : clazz.getMethods()) { + if (!method.getName().equals(methodName) || !DataType.compare(DataType.getPrimitive(method.getParameterTypes()), primitiveTypes)) { + continue; + } + return method; + } + throw new NoSuchMethodException("There is no such method in this class with the specified name and parameter types"); + } + + public static Method getMethod(String className, PackageType packageType, String methodName, Class... parameterTypes) throws NoSuchMethodException, ClassNotFoundException { + return getMethod(packageType.getClass(className), methodName, parameterTypes); + } + + public static Object invokeMethod(Object instance, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + return getMethod(instance.getClass(), methodName, DataType.getPrimitive(arguments)).invoke(instance, arguments); + } + + public static Object invokeMethod(Object instance, Class clazz, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + return getMethod(clazz, methodName, DataType.getPrimitive(arguments)).invoke(instance, arguments); + } + + public static Object invokeMethod(Object instance, String className, PackageType packageType, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException { + return invokeMethod(instance, packageType.getClass(className), methodName, arguments); + } + + public static Field getField(Class clazz, boolean declared, String fieldName) throws NoSuchFieldException, SecurityException { + Field field = declared ? clazz.getDeclaredField(fieldName) : clazz.getField(fieldName); + field.setAccessible(true); + return field; + } + + public static Field getField(String className, PackageType packageType, boolean declared, String fieldName) throws NoSuchFieldException, SecurityException, ClassNotFoundException { + return getField(packageType.getClass(className), declared, fieldName); + } + + public static Object getValue(Object instance, Class clazz, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { + return getField(clazz, declared, fieldName).get(instance); + } + + public static Object getValue(Object instance, String className, PackageType packageType, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, ClassNotFoundException { + return getValue(instance, packageType.getClass(className), declared, fieldName); + } + + public static Object getValue(Object instance, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { + return getValue(instance, instance.getClass(), declared, fieldName); + } + + public static void setValue(Object instance, Class clazz, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { + getField(clazz, declared, fieldName).set(instance, value); + } + + public static void setValue(Object instance, String className, PackageType packageType, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, ClassNotFoundException { + setValue(instance, packageType.getClass(className), declared, fieldName, value); + } + + public static void setValue(Object instance, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { + setValue(instance, instance.getClass(), declared, fieldName, value); + } + /** + * Represents an enumeration of dynamic packages of NMS and CraftBukkit + *

+ * This class is part of the ReflectionUtils and follows the same usage conditions + * + * @author DarkBlade12 + * @since 1.0 + */ + public enum PackageType { + MINECRAFT_SERVER("net.minecraft.server." + getServerVersion()), + CRAFTBUKKIT("org.bukkit.craftbukkit." + getServerVersion()), + CRAFTBUKKIT_BLOCK(CRAFTBUKKIT, "block"), + CRAFTBUKKIT_CHUNKIO(CRAFTBUKKIT, "chunkio"), + CRAFTBUKKIT_COMMAND(CRAFTBUKKIT, "command"), + CRAFTBUKKIT_CONVERSATIONS(CRAFTBUKKIT, "conversations"), + CRAFTBUKKIT_ENCHANTMENS(CRAFTBUKKIT, "enchantments"), + CRAFTBUKKIT_ENTITY(CRAFTBUKKIT, "entity"), + CRAFTBUKKIT_EVENT(CRAFTBUKKIT, "event"), + CRAFTBUKKIT_GENERATOR(CRAFTBUKKIT, "generator"), + CRAFTBUKKIT_HELP(CRAFTBUKKIT, "help"), + CRAFTBUKKIT_INVENTORY(CRAFTBUKKIT, "inventory"), + CRAFTBUKKIT_MAP(CRAFTBUKKIT, "map"), + CRAFTBUKKIT_METADATA(CRAFTBUKKIT, "metadata"), + CRAFTBUKKIT_POTION(CRAFTBUKKIT, "potion"), + CRAFTBUKKIT_PROJECTILES(CRAFTBUKKIT, "projectiles"), + CRAFTBUKKIT_SCHEDULER(CRAFTBUKKIT, "scheduler"), + CRAFTBUKKIT_SCOREBOARD(CRAFTBUKKIT, "scoreboard"), + CRAFTBUKKIT_UPDATER(CRAFTBUKKIT, "updater"), + CRAFTBUKKIT_UTIL(CRAFTBUKKIT, "util"); + + private final String path; + + PackageType(String path) { + this.path = path; + } + + PackageType(PackageType parent, String path) { + this(parent + "." + path); + } + + public String getPath() { + return path; + } + + public Class getClass(String className) throws ClassNotFoundException { + return Class.forName(this + "." + className); + } + @Override + public String toString() { + return path; + } + + public static String getServerVersion() { + return Bukkit.getServer().getClass().getPackage().getName().substring(23); + } + } + + /** + * Represents an enumeration of Java persistence types with corresponding classes + *

+ * This class is part of the ReflectionUtils and follows the same usage conditions + * + * @author DarkBlade12 + * @since 1.0 + */ + public enum DataType { + BYTE(byte.class, Byte.class), + SHORT(short.class, Short.class), + INTEGER(int.class, Integer.class), + LONG(long.class, Long.class), + CHARACTER(char.class, Character.class), + FLOAT(float.class, Float.class), + DOUBLE(double.class, Double.class), + BOOLEAN(boolean.class, Boolean.class); + + private static final Map, DataType> CLASS_MAP = new HashMap, DataType>(); + private final Class primitive; + private final Class reference; + + static { + for (DataType type : values()) { + CLASS_MAP.put(type.primitive, type); + CLASS_MAP.put(type.reference, type); + } + } + + DataType(Class primitive, Class reference) { + this.primitive = primitive; + this.reference = reference; + } + + public Class getPrimitive() { + return primitive; + } + + public Class getReference() { + return reference; + } + + public static DataType fromClass(Class clazz) { + return CLASS_MAP.get(clazz); + } + + public static Class getPrimitive(Class clazz) { + DataType type = fromClass(clazz); + return type == null ? clazz : type.getPrimitive(); + } + + public static Class getReference(Class clazz) { + DataType type = fromClass(clazz); + return type == null ? clazz : type.getReference(); + } + + public static Class[] getPrimitive(Class[] classes) { + int length = classes == null ? 0 : classes.length; + Class[] types = new Class[length]; + for (int index = 0; index < length; index++) { + types[index] = getPrimitive(classes[index]); + } + return types; + } + + public static Class[] getReference(Class[] classes) { + int length = classes == null ? 0 : classes.length; + Class[] types = new Class[length]; + for (int index = 0; index < length; index++) { + types[index] = getReference(classes[index]); + } + return types; + } + + public static Class[] getPrimitive(Object[] objects) { + int length = objects == null ? 0 : objects.length; + Class[] types = new Class[length]; + for (int index = 0; index < length; index++) { + types[index] = getPrimitive(objects[index].getClass()); + } + return types; + } + + public static Class[] getReference(Object[] objects) { + int length = objects == null ? 0 : objects.length; + Class[] types = new Class[length]; + for (int index = 0; index < length; index++) { + types[index] = getReference(objects[index].getClass()); + } + return types; + } + + public static boolean compare(Class[] primary, Class[] secondary) { + if (primary == null || secondary == null || primary.length != secondary.length) { + return false; + } + for (int index = 0; index < primary.length; index++) { + Class primaryClass = primary[index]; + Class secondaryClass = secondary[index]; + if (primaryClass.equals(secondaryClass) || primaryClass.isAssignableFrom(secondaryClass)) { + continue; + } + return false; + } + return true; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/ReflectionUtils.java b/src/main/java/com/github/shynixn/petblocks/lib/ReflectionUtils.java index e62512f62..bb9a00088 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/ReflectionUtils.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/ReflectionUtils.java @@ -1,279 +1,283 @@ package com.github.shynixn.petblocks.lib; +import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -import org.bukkit.Bukkit; /** - * ReflectionUtils + * Copyright 2017 Shynixn + *

+ * Do not remove this header! + *

+ * Version 1.0 *

- * This class provides useful methods which makes dealing with reflection much easier, especially when working with Bukkit + * MIT License *

- * You are welcome to use it, modify it and redistribute it under the following conditions: - *

    - *
  • Don't claim this class as your own - *
  • Don't remove this disclaimer - *
+ * Copyright (c) 2016 *

- * It would be nice if you provide credit to me if you use this class in a published project - * - * @author DarkBlade12 - * @version 1.1 + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + *

+ * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + *

+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ public final class ReflectionUtils { - // Prevent accidental construction - private ReflectionUtils() {} - - public static Constructor getConstructor(Class clazz, Class... parameterTypes) throws NoSuchMethodException { - Class[] primitiveTypes = DataType.getPrimitive(parameterTypes); - for (Constructor constructor : clazz.getConstructors()) { - if (!DataType.compare(DataType.getPrimitive(constructor.getParameterTypes()), primitiveTypes)) { - continue; - } - return constructor; - } - throw new NoSuchMethodException("There is no such constructor in this class with the specified parameter types"); - } - - public static Constructor getConstructor(String className, PackageType packageType, Class... parameterTypes) throws NoSuchMethodException, ClassNotFoundException { - return getConstructor(packageType.getClass(className), parameterTypes); - } - - public static Object instantiateObject(Class clazz, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException { - return getConstructor(clazz, DataType.getPrimitive(arguments)).newInstance(arguments); - } - - public static Object instantiateObject(String className, PackageType packageType, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException { - return instantiateObject(packageType.getClass(className), arguments); - } - - public static Method getMethod(Class clazz, String methodName, Class... parameterTypes) throws NoSuchMethodException { - Class[] primitiveTypes = DataType.getPrimitive(parameterTypes); - for (Method method : clazz.getMethods()) { - if (!method.getName().equals(methodName) || !DataType.compare(DataType.getPrimitive(method.getParameterTypes()), primitiveTypes)) { - continue; - } - return method; - } - throw new NoSuchMethodException("There is no such method in this class with the specified name and parameter types"); - } - - public static Method getMethod(String className, PackageType packageType, String methodName, Class... parameterTypes) throws NoSuchMethodException, ClassNotFoundException { - return getMethod(packageType.getClass(className), methodName, parameterTypes); - } - - public static Object invokeMethod(Object instance, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException { - return getMethod(instance.getClass(), methodName, DataType.getPrimitive(arguments)).invoke(instance, arguments); - } - - public static Object invokeMethod(Object instance, Class clazz, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException { - return getMethod(clazz, methodName, DataType.getPrimitive(arguments)).invoke(instance, arguments); - } - - public static Object invokeMethod(Object instance, String className, PackageType packageType, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException { - return invokeMethod(instance, packageType.getClass(className), methodName, arguments); - } - - public static Field getField(Class clazz, boolean declared, String fieldName) throws NoSuchFieldException, SecurityException { - Field field = declared ? clazz.getDeclaredField(fieldName) : clazz.getField(fieldName); - field.setAccessible(true); - return field; - } - - public static Field getField(String className, PackageType packageType, boolean declared, String fieldName) throws NoSuchFieldException, SecurityException, ClassNotFoundException { - return getField(packageType.getClass(className), declared, fieldName); - } - - public static Object getValue(Object instance, Class clazz, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { - return getField(clazz, declared, fieldName).get(instance); - } - - public static Object getValue(Object instance, String className, PackageType packageType, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, ClassNotFoundException { - return getValue(instance, packageType.getClass(className), declared, fieldName); - } - - public static Object getValue(Object instance, boolean declared, String fieldName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { - return getValue(instance, instance.getClass(), declared, fieldName); - } - - public static void setValue(Object instance, Class clazz, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { - getField(clazz, declared, fieldName).set(instance, value); - } - - public static void setValue(Object instance, String className, PackageType packageType, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException, ClassNotFoundException { - setValue(instance, packageType.getClass(className), declared, fieldName, value); - } - - public static void setValue(Object instance, boolean declared, String fieldName, Object value) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { - setValue(instance, instance.getClass(), declared, fieldName, value); - } - /** - * Represents an enumeration of dynamic packages of NMS and CraftBukkit - *

- * This class is part of the ReflectionUtils and follows the same usage conditions - * - * @author DarkBlade12 - * @since 1.0 - */ - public enum PackageType { - MINECRAFT_SERVER("net.minecraft.server." + getServerVersion()), - CRAFTBUKKIT("org.bukkit.craftbukkit." + getServerVersion()), - CRAFTBUKKIT_BLOCK(CRAFTBUKKIT, "block"), - CRAFTBUKKIT_CHUNKIO(CRAFTBUKKIT, "chunkio"), - CRAFTBUKKIT_COMMAND(CRAFTBUKKIT, "command"), - CRAFTBUKKIT_CONVERSATIONS(CRAFTBUKKIT, "conversations"), - CRAFTBUKKIT_ENCHANTMENS(CRAFTBUKKIT, "enchantments"), - CRAFTBUKKIT_ENTITY(CRAFTBUKKIT, "entity"), - CRAFTBUKKIT_EVENT(CRAFTBUKKIT, "event"), - CRAFTBUKKIT_GENERATOR(CRAFTBUKKIT, "generator"), - CRAFTBUKKIT_HELP(CRAFTBUKKIT, "help"), - CRAFTBUKKIT_INVENTORY(CRAFTBUKKIT, "inventory"), - CRAFTBUKKIT_MAP(CRAFTBUKKIT, "map"), - CRAFTBUKKIT_METADATA(CRAFTBUKKIT, "metadata"), - CRAFTBUKKIT_POTION(CRAFTBUKKIT, "potion"), - CRAFTBUKKIT_PROJECTILES(CRAFTBUKKIT, "projectiles"), - CRAFTBUKKIT_SCHEDULER(CRAFTBUKKIT, "scheduler"), - CRAFTBUKKIT_SCOREBOARD(CRAFTBUKKIT, "scoreboard"), - CRAFTBUKKIT_UPDATER(CRAFTBUKKIT, "updater"), - CRAFTBUKKIT_UTIL(CRAFTBUKKIT, "util"); - - private final String path; - - PackageType(String path) { - this.path = path; - } - - PackageType(PackageType parent, String path) { - this(parent + "." + path); - } - - public String getPath() { - return path; - } - - public Class getClass(String className) throws ClassNotFoundException { - return Class.forName(this + "." + className); - } - @Override - public String toString() { - return path; - } - - public static String getServerVersion() { - return Bukkit.getServer().getClass().getPackage().getName().substring(23); - } - } - - /** - * Represents an enumeration of Java persistence types with corresponding classes - *

- * This class is part of the ReflectionUtils and follows the same usage conditions - * - * @author DarkBlade12 - * @since 1.0 - */ - public enum DataType { - BYTE(byte.class, Byte.class), - SHORT(short.class, Short.class), - INTEGER(int.class, Integer.class), - LONG(long.class, Long.class), - CHARACTER(char.class, Character.class), - FLOAT(float.class, Float.class), - DOUBLE(double.class, Double.class), - BOOLEAN(boolean.class, Boolean.class); - - private static final Map, DataType> CLASS_MAP = new HashMap, DataType>(); - private final Class primitive; - private final Class reference; - - static { - for (DataType type : values()) { - CLASS_MAP.put(type.primitive, type); - CLASS_MAP.put(type.reference, type); - } - } - - DataType(Class primitive, Class reference) { - this.primitive = primitive; - this.reference = reference; - } - - public Class getPrimitive() { - return primitive; - } - - public Class getReference() { - return reference; - } - - public static DataType fromClass(Class clazz) { - return CLASS_MAP.get(clazz); - } - - public static Class getPrimitive(Class clazz) { - DataType type = fromClass(clazz); - return type == null ? clazz : type.getPrimitive(); - } - - public static Class getReference(Class clazz) { - DataType type = fromClass(clazz); - return type == null ? clazz : type.getReference(); - } - - public static Class[] getPrimitive(Class[] classes) { - int length = classes == null ? 0 : classes.length; - Class[] types = new Class[length]; - for (int index = 0; index < length; index++) { - types[index] = getPrimitive(classes[index]); - } - return types; - } - - public static Class[] getReference(Class[] classes) { - int length = classes == null ? 0 : classes.length; - Class[] types = new Class[length]; - for (int index = 0; index < length; index++) { - types[index] = getReference(classes[index]); - } - return types; - } - - public static Class[] getPrimitive(Object[] objects) { - int length = objects == null ? 0 : objects.length; - Class[] types = new Class[length]; - for (int index = 0; index < length; index++) { - types[index] = getPrimitive(objects[index].getClass()); - } - return types; - } - - public static Class[] getReference(Object[] objects) { - int length = objects == null ? 0 : objects.length; - Class[] types = new Class[length]; - for (int index = 0; index < length; index++) { - types[index] = getReference(objects[index].getClass()); - } - return types; - } - - public static boolean compare(Class[] primary, Class[] secondary) { - if (primary == null || secondary == null || primary.length != secondary.length) { - return false; - } - for (int index = 0; index < primary.length; index++) { - Class primaryClass = primary[index]; - Class secondaryClass = secondary[index]; - if (primaryClass.equals(secondaryClass) || primaryClass.isAssignableFrom(secondaryClass)) { - continue; - } - return false; - } - return true; - } - } + /** + * Initializes a new instance of reflectionUtils + */ + private ReflectionUtils() { + super(); + } + + /** + * Returns the class from the name and converts VERSION to the current server version. + * + * @param name name + * @return clazz + * @throws ClassNotFoundException exception + */ + public static Class invokeClass(String name) throws ClassNotFoundException { + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + return Class.forName(name); + } + + /** + * Creates a new instance of the given clazz with the default constructor + * + * @param clazz clazz + * @param returnType + * @return instance + */ + public static T invokeDefaultConstructor(Class clazz) throws IllegalAccessException, InstantiationException { + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + return clazz.newInstance(); + } + + /** + * Creates a new instance of the given clazz, paramTypes, params + * + * @param clazz clazz + * @param paramTypes paramTypes + * @param params params + * @param classType + * @return instance + * @throws IllegalAccessException exception + * @throws InvocationTargetException exception + * @throws InstantiationException exception + * @throws NoSuchMethodException exception + */ + public static T invokeConstructor(Class clazz, Class[] paramTypes, Object[] params) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException { + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + if (paramTypes == null) + throw new IllegalArgumentException("ParamTypes cannot be null"); + if (params == null) + throw new IllegalArgumentException("Params cannot be null!"); + final Constructor constructor = clazz.getDeclaredConstructor(paramTypes); + constructor.setAccessible(true); + return constructor.newInstance(params); + } + + /** + * Invokes the static method of the given clazz, name, paramTypes, params + * + * @param clazz clazz + * @param name name + * @param paramTypes paramTypes + * @param params params + * @param returnType + * @return returnValue + * @throws NoSuchMethodException exception + * @throws InvocationTargetException exception + * @throws IllegalAccessException exception + */ + public static T invokeMethodByClass(Class clazz, String name, Class[] paramTypes, Object[] params) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + if (paramTypes == null) + throw new IllegalArgumentException("ParamTypes cannot be null"); + if (params == null) + throw new IllegalArgumentException("Params cannot be null!"); + final Method method = clazz.getDeclaredMethod(name, paramTypes); + method.setAccessible(true); + return (T) method.invoke(null, params); + } + + /** + * Invokes the method of the given instance, name, paramTypes, params + * + * @param instance instance + * @param name name + * @param paramTypes paramTypes + * @param params params + * @param returnType + * @return returnValue + * @throws NoSuchMethodException exception + * @throws InvocationTargetException exception + * @throws IllegalAccessException exception + */ + public static T invokeMethodByObject(Object instance, String name, Class[] paramTypes, Object[] params) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + return invokeMethodByObject(instance, name, paramTypes, params, instance.getClass()); + } + + /** + * Invokes the method of the given instance, name, paramTypes, params + * + * @param instance instance + * @param name name + * @param paramTypes paramTypes + * @param params params + * @param clazz clazz + * @param returnType + * @return returnValue + * @throws NoSuchMethodException exception + * @throws InvocationTargetException exception + * @throws IllegalAccessException exception + */ + public static T invokeMethodByObject(Object instance, String name, Class[] paramTypes, Object[] params, Class clazz) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + if (instance == null) + throw new IllegalArgumentException("Instance cannot be null!"); + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + if (paramTypes == null) + throw new IllegalArgumentException("ParamTypes cannot be null"); + if (params == null) + throw new IllegalArgumentException("Params cannot be null!"); + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + final Method method = clazz.getDeclaredMethod(name, paramTypes); + method.setAccessible(true); + return (T) method.invoke(instance, params); + } + + /** + * Invokes the field of the given class and name + * + * @param clazz clazz + * @param name name + * @param returnType + * @return returnValue + * @throws NoSuchFieldException exception + * @throws IllegalAccessException exception + */ + public static T invokeFieldByClass(Class clazz, String name) throws NoSuchFieldException, IllegalAccessException { + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + final Field field = clazz.getDeclaredField(name); + field.setAccessible(true); + return (T) field.get(null); + } + + /** + * Invokes the field of the given instance and name + * + * @param instance instance + * @param name name + * @param returnType + * @return returnValue + */ + public static T invokeFieldByObject(Object instance, String name) throws NoSuchFieldException, IllegalAccessException { + return invokeFieldByObject(instance, name, instance.getClass()); + } + + /** + * Invokes the field of the given instance and name + * + * @param instance instance + * @param name name + * @param clazz clazz + * @param returnType + * @return returnValue + */ + public static T invokeFieldByObject(Object instance, String name, Class clazz) throws NoSuchFieldException, IllegalAccessException { + if (instance == null) + throw new IllegalArgumentException("Object cannot be null!"); + if (name == null) + throw new IllegalArgumentException("Name cannot be null!"); + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + final Field field = clazz.getDeclaredField(name); + field.setAccessible(true); + return (T) field.get(instance); + } + + /** + * Invokes the annotation of the given clazz + * + * @param clazz clazz + * @param annotationClazz annotation + * @param returnType + * @return returnValue + */ + public static T invokeAnnotationByClass(Class clazz, Class annotationClazz) { + if (clazz == null) + throw new IllegalArgumentException("Class cannot be null!"); + if (annotationClazz == null) + throw new IllegalArgumentException("AnnotationClass cannot be null!"); + for (final Annotation annotation : clazz.getDeclaredAnnotations()) { + if (annotation.annotationType() == annotationClazz) + return (T) annotation; + } + return null; + } + + /** + * Invokes the annotation of the given field + * + * @param field field + * @param annotationClazz annotation + * @param returnType + * @return returnValue + */ + public static T invokeAnnotationByField(Field field, Class annotationClazz) { + if (field == null) + throw new IllegalArgumentException("Field cannot be null!"); + if (annotationClazz == null) + throw new IllegalArgumentException("AnnotationClass cannot be null!"); + for (final Annotation annotation : field.getDeclaredAnnotations()) { + if (annotation.annotationType() == annotationClazz) + return (T) annotation; + } + return null; + } + + /** + * Invokes the annotation of the given method + * + * @param method method + * @param annotationClazz annotation + * @param returnType + * @return returnValue + */ + public static T invokeAnnotationByMethod(Method method, Class annotationClazz) { + if (method == null) + throw new IllegalArgumentException("Method cannot be null!"); + if (annotationClazz == null) + throw new IllegalArgumentException("AnnotationClass cannot be null!"); + for (final Annotation annotation : method.getDeclaredAnnotations()) { + if (annotation.annotationType() == annotationClazz) + return (T) annotation; + } + return null; + } } \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/SimpleListener.java b/src/main/java/com/github/shynixn/petblocks/lib/SimpleListener.java similarity index 97% rename from src/main/java/com/github/shynixn/petblocks/lib/util/SimpleListener.java rename to src/main/java/com/github/shynixn/petblocks/lib/SimpleListener.java index 1912f1a11..58af5917f 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/util/SimpleListener.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/SimpleListener.java @@ -1,4 +1,4 @@ -package com.github.shynixn.petblocks.lib.util; +package com.github.shynixn.petblocks.lib; import org.bukkit.Bukkit; import org.bukkit.event.HandlerList; diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/ReflectionUtils.java b/src/main/java/com/github/shynixn/petblocks/lib/util/ReflectionUtils.java deleted file mode 100644 index 57e067cd3..000000000 --- a/src/main/java/com/github/shynixn/petblocks/lib/util/ReflectionUtils.java +++ /dev/null @@ -1,283 +0,0 @@ -package com.github.shynixn.petblocks.lib.util; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -/** - * Copyright 2017 Shynixn - *

- * Do not remove this header! - *

- * Version 1.0 - *

- * MIT License - *

- * Copyright (c) 2016 - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -public final class ReflectionUtils { - /** - * Initializes a new instance of reflectionUtils - */ - private ReflectionUtils() { - super(); - } - - /** - * Returns the class from the name and converts VERSION to the current server version. - * - * @param name name - * @return clazz - * @throws ClassNotFoundException exception - */ - public static Class invokeClass(String name) throws ClassNotFoundException { - if (name == null) - throw new IllegalArgumentException("Name cannot be null!"); - return Class.forName(name); - } - - /** - * Creates a new instance of the given clazz with the default constructor - * - * @param clazz clazz - * @param returnType - * @return instance - */ - public static T invokeDefaultConstructor(Class clazz) throws IllegalAccessException, InstantiationException { - if (clazz == null) - throw new IllegalArgumentException("Class cannot be null!"); - return clazz.newInstance(); - } - - /** - * Creates a new instance of the given clazz, paramTypes, params - * - * @param clazz clazz - * @param paramTypes paramTypes - * @param params params - * @param classType - * @return instance - * @throws IllegalAccessException exception - * @throws InvocationTargetException exception - * @throws InstantiationException exception - * @throws NoSuchMethodException exception - */ - public static T invokeConstructor(Class clazz, Class[] paramTypes, Object[] params) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException { - if (clazz == null) - throw new IllegalArgumentException("Class cannot be null!"); - if (paramTypes == null) - throw new IllegalArgumentException("ParamTypes cannot be null"); - if (params == null) - throw new IllegalArgumentException("Params cannot be null!"); - final Constructor constructor = clazz.getDeclaredConstructor(paramTypes); - constructor.setAccessible(true); - return constructor.newInstance(params); - } - - /** - * Invokes the static method of the given clazz, name, paramTypes, params - * - * @param clazz clazz - * @param name name - * @param paramTypes paramTypes - * @param params params - * @param returnType - * @return returnValue - * @throws NoSuchMethodException exception - * @throws InvocationTargetException exception - * @throws IllegalAccessException exception - */ - public static T invokeMethodByClass(Class clazz, String name, Class[] paramTypes, Object[] params) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { - if (clazz == null) - throw new IllegalArgumentException("Class cannot be null!"); - if (name == null) - throw new IllegalArgumentException("Name cannot be null!"); - if (paramTypes == null) - throw new IllegalArgumentException("ParamTypes cannot be null"); - if (params == null) - throw new IllegalArgumentException("Params cannot be null!"); - final Method method = clazz.getDeclaredMethod(name, paramTypes); - method.setAccessible(true); - return (T) method.invoke(null, params); - } - - /** - * Invokes the method of the given instance, name, paramTypes, params - * - * @param instance instance - * @param name name - * @param paramTypes paramTypes - * @param params params - * @param returnType - * @return returnValue - * @throws NoSuchMethodException exception - * @throws InvocationTargetException exception - * @throws IllegalAccessException exception - */ - public static T invokeMethodByObject(Object instance, String name, Class[] paramTypes, Object[] params) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { - return invokeMethodByObject(instance, name, paramTypes, params, instance.getClass()); - } - - /** - * Invokes the method of the given instance, name, paramTypes, params - * - * @param instance instance - * @param name name - * @param paramTypes paramTypes - * @param params params - * @param clazz clazz - * @param returnType - * @return returnValue - * @throws NoSuchMethodException exception - * @throws InvocationTargetException exception - * @throws IllegalAccessException exception - */ - public static T invokeMethodByObject(Object instance, String name, Class[] paramTypes, Object[] params, Class clazz) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { - if (instance == null) - throw new IllegalArgumentException("Instance cannot be null!"); - if (name == null) - throw new IllegalArgumentException("Name cannot be null!"); - if (paramTypes == null) - throw new IllegalArgumentException("ParamTypes cannot be null"); - if (params == null) - throw new IllegalArgumentException("Params cannot be null!"); - if (clazz == null) - throw new IllegalArgumentException("Class cannot be null!"); - final Method method = clazz.getDeclaredMethod(name, paramTypes); - method.setAccessible(true); - return (T) method.invoke(instance, params); - } - - /** - * Invokes the field of the given class and name - * - * @param clazz clazz - * @param name name - * @param returnType - * @return returnValue - * @throws NoSuchFieldException exception - * @throws IllegalAccessException exception - */ - public static T invokeFieldByClass(Class clazz, String name) throws NoSuchFieldException, IllegalAccessException { - if (clazz == null) - throw new IllegalArgumentException("Class cannot be null!"); - if (name == null) - throw new IllegalArgumentException("Name cannot be null!"); - final Field field = clazz.getDeclaredField(name); - field.setAccessible(true); - return (T) field.get(null); - } - - /** - * Invokes the field of the given instance and name - * - * @param instance instance - * @param name name - * @param returnType - * @return returnValue - */ - public static T invokeFieldByObject(Object instance, String name) throws NoSuchFieldException, IllegalAccessException { - return invokeFieldByObject(instance, name, instance.getClass()); - } - - /** - * Invokes the field of the given instance and name - * - * @param instance instance - * @param name name - * @param clazz clazz - * @param returnType - * @return returnValue - */ - public static T invokeFieldByObject(Object instance, String name, Class clazz) throws NoSuchFieldException, IllegalAccessException { - if (instance == null) - throw new IllegalArgumentException("Object cannot be null!"); - if (name == null) - throw new IllegalArgumentException("Name cannot be null!"); - if (clazz == null) - throw new IllegalArgumentException("Class cannot be null!"); - final Field field = clazz.getDeclaredField(name); - field.setAccessible(true); - return (T) field.get(instance); - } - - /** - * Invokes the annotation of the given clazz - * - * @param clazz clazz - * @param annotationClazz annotation - * @param returnType - * @return returnValue - */ - public static T invokeAnnotationByClass(Class clazz, Class annotationClazz) { - if (clazz == null) - throw new IllegalArgumentException("Class cannot be null!"); - if (annotationClazz == null) - throw new IllegalArgumentException("AnnotationClass cannot be null!"); - for (final Annotation annotation : clazz.getDeclaredAnnotations()) { - if (annotation.annotationType() == annotationClazz) - return (T) annotation; - } - return null; - } - - /** - * Invokes the annotation of the given field - * - * @param field field - * @param annotationClazz annotation - * @param returnType - * @return returnValue - */ - public static T invokeAnnotationByField(Field field, Class annotationClazz) { - if (field == null) - throw new IllegalArgumentException("Field cannot be null!"); - if (annotationClazz == null) - throw new IllegalArgumentException("AnnotationClass cannot be null!"); - for (final Annotation annotation : field.getDeclaredAnnotations()) { - if (annotation.annotationType() == annotationClazz) - return (T) annotation; - } - return null; - } - - /** - * Invokes the annotation of the given method - * - * @param method method - * @param annotationClazz annotation - * @param returnType - * @return returnValue - */ - public static T invokeAnnotationByMethod(Method method, Class annotationClazz) { - if (method == null) - throw new IllegalArgumentException("Method cannot be null!"); - if (annotationClazz == null) - throw new IllegalArgumentException("AnnotationClass cannot be null!"); - for (final Annotation annotation : method.getDeclaredAnnotations()) { - if (annotation.annotationType() == annotationClazz) - return (T) annotation; - } - return null; - } -} \ No newline at end of file diff --git a/src/main/java/com/github/shynixn/petblocks/lib/util/SQLProvider.java b/src/main/java/com/github/shynixn/petblocks/lib/util/SQLProvider.java deleted file mode 100644 index 27f2830e7..000000000 --- a/src/main/java/com/github/shynixn/petblocks/lib/util/SQLProvider.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.github.shynixn.petblocks.lib.util; - -import java.io.IOException; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -/** - * Copyright 2017 Shynixn - *

- * Do not remove this header! - *

- * Version 1.0 - *

- * MIT License - *

- * Copyright (c) 2017 - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -public abstract class SQLProvider { - private final Map cache = new HashMap<>(); - - /** - * Returns a preparedStatement from the given statementName and connection - * @param statementName statementName - * @param connection connection - * @return preparedStatement - * @throws IOException exception - * @throws SQLException exception - */ - public PreparedStatement getStatement(String statementName, Connection connection) throws IOException, SQLException { - if(connection == null) - throw new IllegalArgumentException("Connection cannot be null!"); - if(connection.isClosed()) - throw new IllegalArgumentException("Connection is closed! Cannot create statement!"); - return connection.prepareStatement(this.getString(statementName)); - } - - /** - * Returns a string from the given statementName - * @param statementName statementName - * @return string - */ - public String getString(String statementName) throws IOException { - if(statementName == null) - throw new IllegalArgumentException("Statement cannot be null!"); - if (!this.cache.containsKey(statementName)) { - this.cache.put(statementName, this.readStringFromFile(statementName)); - } - return this.cache.get(statementName); - } - - /** - * Clears the statement cache - */ - public void clear() { - this.cache.clear(); - } - - /** - * Reads a string from the given file - * @param fileName fileName - * @return string - * @throws IOException exception - */ - protected abstract String readStringFromFile(String fileName) throws IOException; -} \ No newline at end of file diff --git a/src/main/resources/sql/create-mysql.sql b/src/main/resources/sql/create-mysql.sql index e61d8a3e8..cc767ac8b 100644 --- a/src/main/resources/sql/create-mysql.sql +++ b/src/main/resources/sql/create-mysql.sql @@ -1,14 +1,40 @@ CREATE TABLE IF NOT EXISTS SHY_PLAYER ( id INTEGER PRIMARY KEY AUTO_INCREMENT, - uuid CHAR(36), - name VARCHAR(16), + uuid CHAR(36) UNIQUE NOT NULL, + name VARCHAR(16) NOT NULL, CONSTRAINT unique_uuid_cs UNIQUE (uuid) ); +CREATE TABLE IF NOT EXISTS SHY_PARTICLE_EFFECT +( + id INTEGER PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(32) NOT NULL, + amount INTEGER, + speed DOUBLE, + x DOUBLE, + y DOUBLE, + z DOUBLE, + material VARCHAR(32), + data CHAR(4) +); + CREATE TABLE IF NOT EXISTS SHY_PETBLOCK ( id INTEGER PRIMARY KEY AUTO_INCREMENT, - shy_player_id REFERENCES SHY_PLAYER(id), - name VARCHAR(32) + shy_player_id INTEGER, + shy_particle_effect_id INTEGER, + name VARCHAR(32) NOT NULL, + type VARCHAR (32) NOT NULL, + material VARCHAR(32), + data CHAR(4), + skull TEXT, + enabled INTEGER, + age INTEGER, + unbreakable INTEGER, + play_sounds INTEGER, + moving_type VARCHAR(32) NOT NULL, + movement_type VARCHAR(32) NOT NULL, + FOREIGN KEY (shy_player_id) REFERENCES SHY_PLAYER(id), + FOREIGN KEY (shy_particle_effect_id) REFERENCES SHY_PARTICLE_EFFECT(id) ); \ No newline at end of file diff --git a/src/main/resources/sql/create-sqlite.sql b/src/main/resources/sql/create-sqlite.sql index e725307ad..ec0a32514 100644 --- a/src/main/resources/sql/create-sqlite.sql +++ b/src/main/resources/sql/create-sqlite.sql @@ -1,15 +1,40 @@ CREATE TABLE IF NOT EXISTS SHY_PLAYER ( id INTEGER PRIMARY KEY AUTOINCREMENT, - uuid CHAR(36), - name VARCHAR(16), + uuid CHAR(36) UNIQUE NOT NULL, + name VARCHAR(16) NOT NULL, CONSTRAINT unique_uuid_cs UNIQUE (uuid) ); +CREATE TABLE IF NOT EXISTS SHY_PARTICLE_EFFECT +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name VARCHAR(32) NOT NULL, + amount INTEGER, + speed REAL, + x REAL, + y REAL, + z REAL, + material VARCHAR(32), + data CHAR(4) +); + CREATE TABLE IF NOT EXISTS SHY_PETBLOCK ( id INTEGER PRIMARY KEY AUTOINCREMENT, shy_player_id REFERENCES SHY_PLAYER(id), - name VARCHAR(32), - CONSTRAINT foreignkey_player_id_cs FOREIGN KEY (shy_player_id) REFERENCES SHY_PLAYER(id) + shy_particle_effect_id REFERENCES SHY_PARTICLE_EFFECT(id), + name VARCHAR(32) NOT NULL, + type VARCHAR (32) NOT NULL, + material VARCHAR(32), + data CHAR(4), + skull TEXT, + enabled INTEGER, + age INTEGER, + unbreakable INTEGER, + play_sounds INTEGER, + moving_type VARCHAR(32) NOT NULL, + movement_type VARCHAR(32) NOT NULL, + CONSTRAINT foreignkey_player_id_cs FOREIGN KEY (shy_player_id) REFERENCES SHY_PLAYER(id), + CONSTRAINT foreignkey_particle_id_cs FOREIGN KEY (shy_particle_effect_id) REFERENCES SHY_PARTICLE_EFFECT(id) ); \ No newline at end of file diff --git a/src/main/resources/sql/particle/count.sql b/src/main/resources/sql/particle/count.sql new file mode 100644 index 000000000..1265aecaf --- /dev/null +++ b/src/main/resources/sql/particle/count.sql @@ -0,0 +1 @@ +select COUNT(*) from SHY_PARTICLE_EFFECT \ No newline at end of file diff --git a/src/main/resources/sql/particle/delete.sql b/src/main/resources/sql/particle/delete.sql new file mode 100644 index 000000000..3bea624dc --- /dev/null +++ b/src/main/resources/sql/particle/delete.sql @@ -0,0 +1 @@ +DELETE FROM SHY_PARTICLE_EFFECT WHERE id = ?; \ No newline at end of file diff --git a/src/main/resources/sql/particle/insert.sql b/src/main/resources/sql/particle/insert.sql new file mode 100644 index 000000000..c42b060a2 --- /dev/null +++ b/src/main/resources/sql/particle/insert.sql @@ -0,0 +1,2 @@ +INSERT INTO SHY_PARTICLE_EFFECT (name, amount, speed, x, y, z, material, data) VALUES (?,?,?,?,?,?,?,?) + diff --git a/src/main/resources/sql/particle/selectall.sql b/src/main/resources/sql/particle/selectall.sql new file mode 100644 index 000000000..e89e37f84 --- /dev/null +++ b/src/main/resources/sql/particle/selectall.sql @@ -0,0 +1 @@ +SELECT * FROM SHY_PARTICLE_EFFECT; \ No newline at end of file diff --git a/src/main/resources/sql/particle/selectbyid.sql b/src/main/resources/sql/particle/selectbyid.sql new file mode 100644 index 000000000..477ab87ed --- /dev/null +++ b/src/main/resources/sql/particle/selectbyid.sql @@ -0,0 +1 @@ +SELECT * FROM SHY_PARTICLE_EFFECT WHERE id = ?; \ No newline at end of file diff --git a/src/main/resources/sql/particle/update.sql b/src/main/resources/sql/particle/update.sql new file mode 100644 index 000000000..a57864a5d --- /dev/null +++ b/src/main/resources/sql/particle/update.sql @@ -0,0 +1 @@ +UPDATE SHY_PARTICLE_EFFECT SET name=?, amount=?, speed=?, x=?, y=?, z=?, material=?, data=? WHERE id=? \ No newline at end of file diff --git a/src/main/resources/sql/petblock/insert.sql b/src/main/resources/sql/petblock/insert.sql index b9a69870b..eb6180d05 100644 --- a/src/main/resources/sql/petblock/insert.sql +++ b/src/main/resources/sql/petblock/insert.sql @@ -1 +1 @@ -INSERT INTO SHY_PETBLOCK (name, shy_player_id ) VALUES (?,?) \ No newline at end of file +INSERT INTO SHY_PETBLOCK (shy_player_id, shy_particle_effect_id, name, type, material, data, skull, enabled, age, unbreakable, play_sounds, moving_type, movement_type) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?) \ No newline at end of file diff --git a/src/main/resources/sql/petblock/selectbyplayer.sql b/src/main/resources/sql/petblock/selectbyplayer.sql index 8698e9ac8..11adc44e4 100644 --- a/src/main/resources/sql/petblock/selectbyplayer.sql +++ b/src/main/resources/sql/petblock/selectbyplayer.sql @@ -1,3 +1,3 @@ -SELECT pet.id, pet.name FROM SHY_PETBLOCK pet, SHY_PLAYER play +SELECT pet.id, pet.shy_player_id, pet.shy_particle_effect_id, pet.name, pet.type, pet.material, pet.data, pet.skull, pet.enabled, pet.age, pet.unbreakable, pet.play_sounds, pet.moving_type, pet.movement_type FROM SHY_PETBLOCK pet, SHY_PLAYER play WHERE pet.shy_player_id = play.id AND play.uuid = ?; diff --git a/src/main/resources/sql/petblock/selectentrybyplayer.sql b/src/main/resources/sql/petblock/selectentrybyplayer.sql new file mode 100644 index 000000000..f395aa10b --- /dev/null +++ b/src/main/resources/sql/petblock/selectentrybyplayer.sql @@ -0,0 +1,3 @@ +SELECT 1 FROM SHY_PETBLOCK pet, SHY_PLAYER play +WHERE pet.shy_player_id = play.id +AND play.uuid = ?; \ No newline at end of file diff --git a/src/main/resources/sql/petblock/update.sql b/src/main/resources/sql/petblock/update.sql index 31243e83f..cc11d8e98 100644 --- a/src/main/resources/sql/petblock/update.sql +++ b/src/main/resources/sql/petblock/update.sql @@ -1 +1 @@ -UPDATE SHY_PETBLOCK SET name=? WHERE id=? \ No newline at end of file +UPDATE SHY_PETBLOCK SET name=?, type=?, material=?, data=?, skull=?, enabled=?, age=?, unbreakable=?, play_sounds=?, moving_type=?, movement_type=? WHERE id=?; \ No newline at end of file diff --git a/src/main/resources/sql/player/update.sql b/src/main/resources/sql/player/update.sql index 3189b3680..2a6821046 100644 --- a/src/main/resources/sql/player/update.sql +++ b/src/main/resources/sql/player/update.sql @@ -1 +1 @@ -UPDATE SHY_PLAYER SET name=? WHERE id=? \ No newline at end of file +UPDATE SHY_PLAYER SET uuid=?, name=? WHERE id=? \ No newline at end of file diff --git a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetCommandExecutorTest.java b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetCommandExecutorTest.java deleted file mode 100644 index 1c9ff17d7..000000000 --- a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetCommandExecutorTest.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.github.shynixn.business.logic.persistence2; - -import com.github.shynixn.petblocks.business.Config; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; -import com.github.shynixn.petblocks.business.logic.persistence2.Factory; -import com.github.shynixn.petblocks.business.logic.persistence2.IPetDataController; -import com.github.shynixn.petblocks.business.logic.persistence2.PetData; -import com.github.shynixn.petblocks.business.logic.persistence2.PlayerData; -import com.github.shynixn.petblocks.business.logic.persistence2.commandexecutor.PetDataCommandExecutor; -import com.github.shynixn.petblocks.lib.util.IDatabaseController; -import org.bukkit.Bukkit; -import org.bukkit.Server; -import org.bukkit.configuration.InvalidConfigurationException; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitScheduler; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -import java.io.*; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.UUID; -import java.util.logging.Logger; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -/** - * Created by Shynixn - */ -public class PetCommandExecutorTest { - - @Before - public void prepareServer() { - BukkitScheduler scheduler = mock(BukkitScheduler.class); - when(scheduler.runTaskAsynchronously(any(Plugin.class), any(Runnable.class))).thenAnswer(new Answer() { - @Override - public Void answer(InvocationOnMock invocationOnMock) throws Throwable { - System.out.println("GOT YOU"); - Runnable runnable = invocationOnMock.getArgument(1); - runnable.run(); - return null; - } - }); - Server server = mock(Server.class); - Logger logger = Logger.getLogger("TestLogger"); - when(server.getLogger()).thenReturn(logger); - when(server.getScheduler()).thenReturn(scheduler); - try { - Bukkit.setServer(server); - } catch (Exception ex) { - - } - } - - @Test - public void renamePetTest() { - Plugin plugin = mockPlugin(); - Factory.enable(plugin); - Player player = mockPlayer(); - try (IPetDataController controller = Factory.createPetDataController(); - IDatabaseController playerController = Factory.createPlayerDataController()) { - for (PetData petData : controller.getAll()) { - controller.remove(petData); - } - for (PlayerData playerData : playerController.getAll()) { - playerController.remove(playerData); - } - - PlayerData playerData = PlayerData.from(player); - playerController.store(playerData); - PetData petData = PetData.from(playerData); - petData.setName("Maier"); - controller.store(petData); - - PetDataCommandExecutor petDataCommandExecutor = new PetDataCommandExecutor(plugin); - petDataCommandExecutor.onCommandSend(player, new String[]{"rename", "Gerhard"}); - petDataCommandExecutor.onCommandSend(player, new String[]{"rename", "22222222222222222222222222222222222222222"}); - petDataCommandExecutor.onCommandSend(player, new String[]{null,null}); - petDataCommandExecutor.onCommandSend(player, new String[]{"rename",null}); - - Assert.assertNotNull(controller.getByPlayer(player)); - Assert.assertEquals(controller.getByPlayer(player).getName(), "Gerhard"); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail(); - } - } - - private static Player mockPlayer() { - UUID uuid = UUID.randomUUID(); - Player player = mock(Player.class); - when(player.getName()).thenReturn("Shynixn"); - when(player.getUniqueId()).thenReturn(uuid); - when(player.hasPermission(any(String.class))).thenReturn(true); - return player; - } - - private static Plugin mockPlugin() { - YamlConfiguration configuration = new YamlConfiguration(); - try { - configuration.load(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.yml"))); - } catch (IOException | InvalidConfigurationException e) { - e.printStackTrace(); - } - Plugin plugin = mock(Plugin.class); - when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); - when(plugin.getConfig()).thenReturn(configuration); - when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { - @Override - public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { - String file = invocationOnMock.getArgument(0); - return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); - } - }); - Config.initiliaze(plugin); - ConfigCommands.getInstance().load(plugin.getConfig()); - return plugin; - } -} diff --git a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetDataControllerTest.java b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetDataControllerTest.java deleted file mode 100644 index 66d1bb736..000000000 --- a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetDataControllerTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.github.shynixn.business.logic.persistence2; - -import com.github.shynixn.petblocks.business.logic.persistence2.Factory; -import com.github.shynixn.petblocks.business.logic.persistence2.IPetDataController; -import com.github.shynixn.petblocks.business.logic.persistence2.PetData; -import com.github.shynixn.petblocks.business.logic.persistence2.PlayerData; -import com.github.shynixn.petblocks.lib.util.IController; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.junit.Assert; -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -import java.io.File; -import java.io.InputStream; -import java.util.UUID; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -/** - * Created by Shynixn - */ -public class PetDataControllerTest { - - private static Plugin mockPlugin() { - YamlConfiguration configuration = new YamlConfiguration(); - configuration.set("sql.local", true); - configuration.set("sql.host", "localhost"); - configuration.set("sql.port", 3306); - configuration.set("sql.database", "db"); - configuration.set("sql.username", "root"); - configuration.set("sql.password", ""); - Plugin plugin = mock(Plugin.class); - when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); - when(plugin.getConfig()).thenReturn(configuration); - when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { - @Override - public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { - String file = invocationOnMock.getArgument(0); - return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); - } - }); - return plugin; - } - - @Test - public void getPetDataByPlayerTest() throws ClassNotFoundException { - Factory.enable(mockPlugin()); - final PetData petData = new PetData(); - petData.setName("Maier"); - try (IPetDataController petDataIController = Factory.createPetDataController()) { - PlayerData playerData = new PlayerData(); - try (IController playerDataIController = Factory.createPlayerDataController()) { - playerData.setName("Christoph"); - playerData.setUuid(UUID.randomUUID()); - playerDataIController.store(playerData); - petData.setPlayerId(playerData.getId()); - } - for (final PetData pet : petDataIController.getAll()) { - petDataIController.remove(pet); - } - petDataIController.store(petData); - Player player = mock(Player.class); - when(player.getUniqueId()).thenReturn(playerData.getUUID()); - PetData petData1 = petDataIController.getByPlayer(player); - Assert.assertEquals(petData1.getName(), petData.getName()); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail(); - } - } -} diff --git a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java b/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java deleted file mode 100644 index d0aa43ec8..000000000 --- a/src/main/test/java/com/github/shynixn/business/logic/persistence2/PetdataDatabaseTest.java +++ /dev/null @@ -1,225 +0,0 @@ -package com.github.shynixn.business.logic.persistence2; - -import ch.vorburger.exec.ManagedProcessException; -import ch.vorburger.mariadb4j.DB; -import com.github.shynixn.petblocks.business.logic.persistence2.Factory; -import com.github.shynixn.petblocks.business.logic.persistence2.IPetDataController; -import com.github.shynixn.petblocks.business.logic.persistence2.PetData; -import com.github.shynixn.petblocks.business.logic.persistence2.PlayerData; -import com.github.shynixn.petblocks.lib.util.IController; -import com.github.shynixn.petblocks.lib.util.IDatabaseController; -import com.zaxxer.hikari.HikariConfig; -import com.zaxxer.hikari.HikariDataSource; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -import java.io.File; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.List; -import java.util.UUID; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -/** - * Created by Shynixn - */ -public class PetdataDatabaseTest { - - private static Plugin mockPlugin() { - YamlConfiguration configuration = new YamlConfiguration(); - configuration.set("sql.local", true); - configuration.set("sql.host", "localhost"); - configuration.set("sql.port", 3306); - configuration.set("sql.database", "db"); - configuration.set("sql.username", "root"); - configuration.set("sql.password", ""); - Plugin plugin = mock(Plugin.class); - when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); - when(plugin.getConfig()).thenReturn(configuration); - when(plugin.getResource(any(String.class))).thenAnswer(invocationOnMock -> { - String file = invocationOnMock.getArgument(0); - return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); - }); - return plugin; - } - - @BeforeClass - public static void startMariaDB() { - try { - System.out.println("TRY"); - final DB database = DB.newEmbeddedDB(3306); - database.start(); - try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/?user=root&password=")) { - try (Statement statement = conn.createStatement()) { - statement.executeUpdate("CREATE DATABASE db"); - } - } - System.out.println("STARTED"); - } catch (SQLException | ManagedProcessException e) { - e.printStackTrace(); - } - } - - @Test - public void enableDatabaseSQLiteTest() { - try { - HikariConfig config = new HikariConfig(); - config.setDriverClassName("org.sqlite.JDBC"); - config.setConnectionTestQuery("SELECT 1"); - config.setJdbcUrl("jdbc:sqlite:PetBlocks.db"); - config.setMaxLifetime(60000); - config.setIdleTimeout(45000); - config.setMaximumPoolSize(50); - HikariDataSource ds = new HikariDataSource(config); - ds.close(); - } catch (Exception ex) { - ex.printStackTrace(); - Assert.fail(); - } - } - - @Test - public void enableDatabaseMySQLTest() { - try { - HikariConfig config = new HikariConfig(); - config.setDriverClassName("com.mysql.jdbc.Driver"); - config.setConnectionTestQuery("SELECT 1"); - config.setJdbcUrl("jdbc:mysql://localhost:3306/db"); - config.setMaxLifetime(60000); - config.setIdleTimeout(45000); - config.setMaximumPoolSize(50); - HikariDataSource ds = new HikariDataSource(config); - ds.close(); - } catch (Exception ex) { - ex.printStackTrace(); - Assert.fail(); - } - } - - @Test - public void insertAndSelectPetDataSQLiteTest() throws ClassNotFoundException { - Factory.enable(mockPlugin()); - final PetData petData = new PetData(); - petData.setName("Sample"); - try (IController petDataIController = Factory.createPetDataController()) { - for (final PetData pet : petDataIController.getAll()) { - petDataIController.remove(pet); - } - try (IController playerDataIController = Factory.createPlayerDataController()) { - for (PlayerData playerData : playerDataIController.getAll()) { - playerDataIController.remove(playerData); - } - Assert.assertEquals(playerDataIController.size(), 0); - PlayerData playerData = new PlayerData(); - playerData.setName("Christoph"); - playerData.setUuid(UUID.randomUUID()); - playerDataIController.store(playerData); - petData.setPlayerId(playerData.getId()); - Assert.assertEquals(playerDataIController.size(), 1); - } - petDataIController.store(petData); - final List petDataList = petDataIController.getAll(); - Assert.assertEquals(petDataList.size(), 1); - Assert.assertEquals(petDataList.get(0).getName(), petData.getName()); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail(); - } - } - - @Test - public void insertAndSelectPetDataMySQLTest() throws ClassNotFoundException { - Plugin plugin = mockPlugin(); - plugin.getConfig().set("sql.local", false); - Factory.enable(plugin); - final PetData petData = new PetData(); - petData.setName("Sample"); - try (IController petDataIController = Factory.createPetDataController()) { - try (IController playerDataIController = Factory.createPlayerDataController()) { - PlayerData playerData = new PlayerData(); - playerData.setName("Christoph"); - playerData.setUuid(UUID.randomUUID()); - playerDataIController.store(playerData); - petData.setPlayerId(playerData.getId()); - } - for (final PetData pet : petDataIController.getAll()) { - petDataIController.remove(pet); - } - petDataIController.store(petData); - final List petDataList = petDataIController.getAll(); - Assert.assertEquals(petDataList.size(), 1); - Assert.assertEquals(petDataList.get(0).getName(), petData.getName()); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail(); - } - } - - @Test - public void insertAndUpdatePetDataMySQLTest() throws ClassNotFoundException { - Plugin plugin = mockPlugin(); - plugin.getConfig().set("sql.local", false); - Factory.enable(plugin); - final PetData petData = new PetData(); - petData.setName("Eduard"); - try (IDatabaseController petDataIController = Factory.createPetDataController()) { - try (IController playerDataIController = Factory.createPlayerDataController()) { - PlayerData playerData = new PlayerData(); - playerData.setName("Christoph"); - playerData.setUuid(UUID.randomUUID()); - playerDataIController.store(playerData); - petData.setPlayerId(playerData.getId()); - } - for (final PetData pet : petDataIController.getAll()) { - petDataIController.remove(pet); - } - petDataIController.store(petData); - Assert.assertEquals(petDataIController.getById(petData.getId()).getName(), petData.getName()); - petData.setName("Franklin"); - petDataIController.store(petData); - Assert.assertEquals(petDataIController.getById(petData.getId()).getName(), petData.getName()); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail(); - } - } - - @Test - public void insertAndUpdatePetDataSQLiteTest() throws ClassNotFoundException { - Factory.enable(mockPlugin()); - final PetData petData = new PetData(); - petData.setName("Eduard"); - try (IDatabaseController petDataIController = Factory.createPetDataController()) { - try (IController playerDataIController = Factory.createPlayerDataController()) { - PlayerData playerData = new PlayerData(); - playerData.setName("Christoph"); - playerData.setUuid(UUID.randomUUID()); - playerDataIController.store(playerData); - petData.setPlayerId(playerData.getId()); - } - for (final PetData pet : petDataIController.getAll()) { - petDataIController.remove(pet); - } - petDataIController.store(petData); - Assert.assertEquals(petDataIController.getById(petData.getId()).getName(), petData.getName()); - petData.setName("Franklin"); - petDataIController.store(petData); - Assert.assertEquals(petDataIController.getById(petData.getId()).getName(), petData.getName()); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail(); - } - } -} diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/DatabaseTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/DatabaseTest.java new file mode 100644 index 000000000..64b738d2a --- /dev/null +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/DatabaseTest.java @@ -0,0 +1,62 @@ +package com.github.shynixn.petblocks.business.logic.persistence.controller; + +import ch.vorburger.mariadb4j.DB; +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; +import org.junit.Assert; +import org.junit.Test; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.Statement; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; + +public class DatabaseTest { + + @Test + public void enableDatabaseSQLiteTest() { + try { + HikariConfig config = new HikariConfig(); + config.setDriverClassName("org.sqlite.JDBC"); + config.setConnectionTestQuery("SELECT 1"); + config.setJdbcUrl("jdbc:sqlite:PetBlocks.db"); + config.setMaxLifetime(60000); + config.setIdleTimeout(45000); + config.setMaximumPoolSize(50); + HikariDataSource ds = new HikariDataSource(config); + ds.close(); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail(); + } + } + + @Test + public void enableDatabaseMySQLTest() { + try { + final DB database = DB.newEmbeddedDB(3306); + database.start(); + try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/?user=root&password=")) { + try (Statement statement = conn.createStatement()) { + statement.executeUpdate("CREATE DATABASE db"); + } + } + + HikariConfig config = new HikariConfig(); + config.setDriverClassName("com.mysql.jdbc.Driver"); + config.setConnectionTestQuery("SELECT 1"); + config.setJdbcUrl("jdbc:mysql://localhost:3306/db"); + config.setMaxLifetime(60000); + config.setIdleTimeout(45000); + config.setMaximumPoolSize(50); + HikariDataSource ds = new HikariDataSource(config); + ds.close(); + database.stop(); + } catch (Exception ex) { + ex.printStackTrace(); + Assert.fail(); + } + } +} diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java new file mode 100644 index 000000000..892ba2f46 --- /dev/null +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java @@ -0,0 +1,156 @@ +package com.github.shynixn.petblocks.business.logic.persistence.controller; + +import ch.vorburger.exec.ManagedProcessException; +import ch.vorburger.mariadb4j.DB; +import com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController; +import com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta; +import com.github.shynixn.petblocks.business.logic.persistence.Factory; +import org.bukkit.Material; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.io.File; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class ParticleEffectMetaMySQLControllerTest { + + private static Plugin mockPlugin() { + final YamlConfiguration configuration = new YamlConfiguration(); + configuration.set("sql.local", true); + configuration.set("sql.host", "localhost"); + configuration.set("sql.port", 3306); + configuration.set("sql.database", "db"); + configuration.set("sql.username", "root"); + configuration.set("sql.password", ""); + Plugin plugin = mock(Plugin.class); + new File("PetBlocks.db").delete(); + when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); + when(plugin.getConfig()).thenReturn(configuration); + when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); + } + }); + return plugin; + } + + private static DB database; + + @AfterClass + public static void stopMariaDB() + { + try { + database.stop(); + } catch (ManagedProcessException e) { + e.printStackTrace(); + } + } + + @BeforeClass + public static void startMariaDB() { + try { + Factory.disable(); + database = DB.newEmbeddedDB(3306); + database.start(); + try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/?user=root&password=")) { + try (Statement statement = conn.createStatement()) { + statement.executeUpdate("CREATE DATABASE db"); + } + } + } catch (SQLException | ManagedProcessException e) { + e.printStackTrace(); + } + } + + @Test + public void insertSelectParticleEffectMetaTest() throws ClassNotFoundException { + Plugin plugin = mockPlugin(); + plugin.getConfig().set("sql.local", false); + Factory.initialize(plugin); + try (ParticleEffectMetaController controller = Factory.createParticleEffectController()) { + for (final ParticleEffectMeta item : controller.getAll()) { + controller.remove(item); + } + ParticleEffectMeta meta = controller.create(); + meta.setEffectType(ParticleEffectMeta.ParticleEffectType.CLOUD); + controller.store(meta); + assertEquals(1, controller.size()); + assertEquals(ParticleEffectMeta.ParticleEffectType.CLOUD, controller.getById(meta.getId()).getEffectType()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + + @Test + public void storeLoadParticleEffectMetaTest() throws ClassNotFoundException { + Plugin plugin = mockPlugin(); + plugin.getConfig().set("sql.local", false); + Factory.initialize(plugin); + try (ParticleEffectMetaController controller = Factory.createParticleEffectController()) { + for (final ParticleEffectMeta item : controller.getAll()) { + controller.remove(item); + } + ParticleEffectMeta meta = controller.create(); + meta.setEffectType(ParticleEffectMeta.ParticleEffectType.DAMAGE_INDICATOR); + meta.setAmount(5) + .setX(2.25) + .setY(3.75) + .setZ(11.24) + .setSpeed(0.0001) + .setMaterial(Material.BONE) + .setData((byte)5); + controller.store(meta); + assertEquals(1, controller.size()); + + meta = controller.getById(meta.getId()); + assertEquals(ParticleEffectMeta.ParticleEffectType.DAMAGE_INDICATOR, meta.getEffectType()); + assertEquals(5, meta.getAmount()); + assertEquals(2.25, meta.getX()); + assertEquals(3.75, meta.getY()); + assertEquals(11.24, meta.getZ()); + assertEquals(Material.BONE, meta.getMaterial()); + assertEquals((byte)5, (byte)meta.getData()); + + meta.setAmount(7) + .setEffectType(ParticleEffectMeta.ParticleEffectType.BARRIER) + .setX(4.25) + .setY(7.75) + .setZ(5.24) + .setSpeed(0.002) + .setMaterial(Material.BARRIER) + .setData((byte)7); + controller.store(meta); + + meta = controller.getById(meta.getId()); + assertEquals(ParticleEffectMeta.ParticleEffectType.BARRIER, meta.getEffectType()); + assertEquals(7, meta.getAmount()); + assertEquals(4.25, meta.getX()); + assertEquals(7.75, meta.getY()); + assertEquals(5.24, meta.getZ()); + assertEquals(Material.BARRIER, meta.getMaterial()); + assertEquals((byte)7, (byte)meta.getData()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } +} diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java new file mode 100644 index 000000000..d14d25797 --- /dev/null +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java @@ -0,0 +1,137 @@ +package com.github.shynixn.petblocks.business.logic.persistence.controller; + +import com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController; +import com.github.shynixn.petblocks.api.persistence.controller.PetMetaController; +import com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController; +import com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta; +import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; +import com.github.shynixn.petblocks.business.logic.persistence.Factory; +import org.bukkit.Material; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.io.File; +import java.io.InputStream; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class ParticleEffectMetaSQLiteControllerTest { + + private static Plugin mockPlugin() { + final YamlConfiguration configuration = new YamlConfiguration(); + configuration.set("sql.local", true); + configuration.set("sql.host", "localhost"); + configuration.set("sql.port", 3306); + configuration.set("sql.database", "db"); + configuration.set("sql.username", "root"); + configuration.set("sql.password", ""); + Plugin plugin = mock(Plugin.class); + new File("PetBlocks.db").delete(); + when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); + when(plugin.getConfig()).thenReturn(configuration); + when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); + } + }); + return plugin; + } + + @BeforeClass + public static void disableFactory() { + Factory.disable(); + } + + @Test + public void insertSelectParticleEffectMetaTest() throws ClassNotFoundException { + Factory.initialize(mockPlugin()); + try (ParticleEffectMetaController controller = Factory.createParticleEffectController()) { + try (PetMetaController petController = Factory.createPetDataController()) { + for (final PetMeta item : petController.getAll()) { + petController.remove(item); + } + } + for (final ParticleEffectMeta item : controller.getAll()) { + controller.remove(item); + } + ParticleEffectMeta meta = controller.create(); + controller.store(meta); + assertEquals(0, controller.size()); + meta.setEffectType(ParticleEffectMeta.ParticleEffectType.CLOUD); + controller.store(meta); + assertEquals(1, controller.size()); + assertEquals(ParticleEffectMeta.ParticleEffectType.CLOUD, controller.getById(meta.getId()).getEffectType()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + + @Test + public void storeLoadParticleEffectMetaTest() throws ClassNotFoundException { + Factory.initialize(mockPlugin()); + try (ParticleEffectMetaController controller = Factory.createParticleEffectController()) { + try (PetMetaController petController = Factory.createPetDataController()) { + for (final PetMeta item : petController.getAll()) { + petController.remove(item); + } + } + for (final ParticleEffectMeta item : controller.getAll()) { + controller.remove(item); + } + ParticleEffectMeta meta = controller.create(); + meta.setEffectType(ParticleEffectMeta.ParticleEffectType.DAMAGE_INDICATOR); + meta.setAmount(5) + .setX(2.25) + .setY(3.75) + .setZ(11.24) + .setSpeed(0.0001) + .setMaterial(Material.BONE) + .setData((byte)5); + controller.store(meta); + assertEquals(1, controller.size()); + + meta = controller.getById(meta.getId()); + assertEquals(ParticleEffectMeta.ParticleEffectType.DAMAGE_INDICATOR, meta.getEffectType()); + assertEquals(5, meta.getAmount()); + assertEquals(2.25, meta.getX()); + assertEquals(3.75, meta.getY()); + assertEquals(11.24, meta.getZ()); + assertEquals(Material.BONE, meta.getMaterial()); + assertEquals((byte)5, (byte)meta.getData()); + + meta.setAmount(7) + .setEffectType(ParticleEffectMeta.ParticleEffectType.BARRIER) + .setX(4.25) + .setY(7.75) + .setZ(5.24) + .setSpeed(0.002) + .setMaterial(Material.BARRIER) + .setData((byte)7); + controller.store(meta); + + meta = controller.getById(meta.getId()); + assertEquals(ParticleEffectMeta.ParticleEffectType.BARRIER, meta.getEffectType()); + assertEquals(7, meta.getAmount()); + assertEquals(4.25, meta.getX()); + assertEquals(7.75, meta.getY()); + assertEquals(5.24, meta.getZ()); + assertEquals(Material.BARRIER, meta.getMaterial()); + assertEquals((byte)7, (byte)meta.getData()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } +} diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java new file mode 100644 index 000000000..403281fe6 --- /dev/null +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java @@ -0,0 +1,226 @@ +package com.github.shynixn.petblocks.business.logic.persistence.controller; + +import ch.vorburger.exec.ManagedProcessException; +import ch.vorburger.mariadb4j.DB; +import com.github.shynixn.petblocks.api.entities.MoveType; +import com.github.shynixn.petblocks.api.entities.Movement; +import com.github.shynixn.petblocks.api.entities.PetType; +import com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController; +import com.github.shynixn.petblocks.api.persistence.controller.PetMetaController; +import com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController; +import com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta; +import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; +import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; +import com.github.shynixn.petblocks.business.logic.persistence.Factory; +import com.github.shynixn.petblocks.business.logic.persistence.entity.PetData; +import com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData; +import org.bukkit.Material; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.io.File; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class PetMetaMySQLControllerTest { + + private static Plugin mockPlugin() { + final YamlConfiguration configuration = new YamlConfiguration(); + configuration.set("sql.local", true); + configuration.set("sql.host", "localhost"); + configuration.set("sql.port", 3306); + configuration.set("sql.database", "db"); + configuration.set("sql.username", "root"); + configuration.set("sql.password", ""); + Plugin plugin = mock(Plugin.class); + new File("PetBlocks.db").delete(); + when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); + when(plugin.getConfig()).thenReturn(configuration); + when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); + } + }); + return plugin; + } + + + private static DB database; + + @AfterClass + public static void stopMariaDB() + { + try { + database.stop(); + } catch (ManagedProcessException e) { + e.printStackTrace(); + } + } + + @BeforeClass + public static void startMariaDB() { + try { + Factory.disable(); + database = DB.newEmbeddedDB(3306); + database.start(); + try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/?user=root&password=")) { + try (Statement statement = conn.createStatement()) { + statement.executeUpdate("CREATE DATABASE db"); + } + } + } catch (SQLException | ManagedProcessException e) { + e.printStackTrace(); + } + } + + @Test + public void insertSelectPlayerMetaTest() throws ClassNotFoundException { + Plugin plugin = mockPlugin(); + plugin.getConfig().set("sql.local", false); + Factory.initialize(mockPlugin()); + final UUID uuid = UUID.randomUUID(); + final Player player = mock(Player.class); + when(player.getName()).thenReturn("Shynixn"); + when(player.getUniqueId()).thenReturn(uuid); + try (PetMetaController controller = Factory.createPetDataController()) { + try (ParticleEffectMetaController particleController = Factory.createParticleEffectController()) { + try (PlayerMetaController playerController = Factory.createPlayerDataController()) { + for (final PetMeta item : controller.getAll()) { + controller.remove(item); + } + PetMeta meta = new PetData(); + meta.setDisplayName("Notch"); + assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); + assertEquals(0, controller.size()); + + ParticleEffectMeta particleEffectMeta = particleController.create(); + particleEffectMeta.setEffectType(ParticleEffectMeta.ParticleEffectType.END_ROD); + particleController.store(particleEffectMeta); + meta.setParticleEffectMeta(particleEffectMeta); + + assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); + assertEquals(0, controller.size()); + + PlayerMeta playerMeta = playerController.create(player); + playerController.store(playerMeta); + meta.setPlayerMeta(playerMeta); + assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); + + meta.setPetType(PetType.BAT); + assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); + + meta.setSkin(Material.STONE, (short) 5, null); + controller.store(meta); + + assertEquals(1, controller.size()); + assertEquals("Notch", controller.getByPlayer(player).getDisplayName()); + } + } + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + + @Test + public void storeLoadPlayerMetaTest() throws ClassNotFoundException { + Plugin plugin = mockPlugin(); + plugin.getConfig().set("sql.local", false); + Factory.initialize(mockPlugin()); + final UUID uuid = UUID.randomUUID(); + final Player player = mock(Player.class); + when(player.getName()).thenReturn("Shynixn"); + when(player.getUniqueId()).thenReturn(uuid); + try (PetMetaController controller = Factory.createPetDataController()) { + try (ParticleEffectMetaController particleController = Factory.createParticleEffectController()) { + try (PlayerMetaController playerController = Factory.createPlayerDataController()) { + for (final PetMeta item : controller.getAll()) { + controller.remove(item); + } + PetMeta meta = new PetData(); + meta.setDisplayName("Me"); + meta.setSkin(Material.BIRCH_DOOR_ITEM,(short)5 , "This is my long skin."); + meta.setPetType(PetType.SHEEP); + meta.setEnabled(true); + meta.setAgeInTicks(500); + meta.setUnbreakable(true); + meta.setSoundsEnabled(true); + meta.setMoveType(MoveType.FLYING); + meta.setMovementType(Movement.CRAWLING); + + ParticleEffectMeta particleEffectMeta = particleController.create(); + particleEffectMeta.setEffectType(ParticleEffectMeta.ParticleEffectType.END_ROD); + particleController.store(particleEffectMeta); + meta.setParticleEffectMeta(particleEffectMeta); + + PlayerMeta playerMeta = playerController.create(player); + playerController.store(playerMeta); + meta.setPlayerMeta(playerMeta); + controller.store(meta); + + assertEquals(1, controller.size()); + meta = controller.getById(meta.getId()); + assertEquals("Me", meta.getDisplayName()); + assertEquals(Material.BIRCH_DOOR_ITEM, meta.getSkinMaterial()); + assertEquals((short)5, meta.getSkinDurability()); + assertEquals("This is my long skin.", meta.getSkin()); + assertEquals(PetType.SHEEP, meta.getType()); + assertEquals(true, meta.isEnabled()); + assertEquals(500, meta.getAgeInTicks()); + assertEquals(true, meta.isUnbreakable()); + assertEquals(true, meta.isSoundsEnabled()); + assertEquals(MoveType.FLYING, meta.getMoveType()); + assertEquals(Movement.CRAWLING, meta.getMovementType()); + + meta.setDisplayName("PikaPet"); + meta.setSkin(Material.ARROW,(short)7 , "http://Skin.com"); + meta.setPetType(PetType.DRAGON); + meta.setEnabled(false); + meta.setAgeInTicks(250); + meta.setUnbreakable(false); + meta.setSoundsEnabled(false); + meta.setMoveType(MoveType.WALKING); + meta.setMovementType(Movement.HOPPING); + controller.store(meta); + + assertEquals(1, controller.size()); + meta = controller.getById(meta.getId()); + assertEquals("PikaPet", meta.getDisplayName()); + assertEquals(Material.ARROW, meta.getSkinMaterial()); + assertEquals((short)7, meta.getSkinDurability()); + assertEquals("http://Skin.com", meta.getSkin()); + assertEquals(PetType.DRAGON, meta.getType()); + assertEquals(false, meta.isEnabled()); + assertEquals(250, meta.getAgeInTicks()); + assertEquals(false, meta.isUnbreakable()); + assertEquals(false, meta.isSoundsEnabled()); + assertEquals(MoveType.WALKING, meta.getMoveType()); + assertEquals(Movement.HOPPING, meta.getMovementType()); + } + } + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } +} diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java new file mode 100644 index 000000000..a37ddf6c1 --- /dev/null +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java @@ -0,0 +1,190 @@ +package com.github.shynixn.petblocks.business.logic.persistence.controller; + +import com.github.shynixn.petblocks.api.entities.MoveType; +import com.github.shynixn.petblocks.api.entities.Movement; +import com.github.shynixn.petblocks.api.entities.PetType; +import com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController; +import com.github.shynixn.petblocks.api.persistence.controller.PetMetaController; +import com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController; +import com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta; +import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; +import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; +import com.github.shynixn.petblocks.business.logic.persistence.Factory; +import com.github.shynixn.petblocks.business.logic.persistence.entity.PetData; +import org.bukkit.Material; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.jupiter.api.function.Executable; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.io.File; +import java.io.InputStream; +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class PetMetaSQLiteControllerTest { + + private static Plugin mockPlugin() { + final YamlConfiguration configuration = new YamlConfiguration(); + configuration.set("sql.local", true); + configuration.set("sql.host", "localhost"); + configuration.set("sql.port", 3306); + configuration.set("sql.database", "db"); + configuration.set("sql.username", "root"); + configuration.set("sql.password", ""); + Plugin plugin = mock(Plugin.class); + new File("PetBlocks.db").delete(); + when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); + when(plugin.getConfig()).thenReturn(configuration); + when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); + } + }); + return plugin; + } + + @BeforeClass + public static void disableFactory() { + Factory.disable(); + } + + @Test + public void insertSelectPetMetaTest() throws ClassNotFoundException { + Factory.initialize(mockPlugin()); + final UUID uuid = UUID.randomUUID(); + final Player player = mock(Player.class); + when(player.getName()).thenReturn("Shynixn"); + when(player.getUniqueId()).thenReturn(uuid); + try (PetMetaController controller = Factory.createPetDataController()) { + try (ParticleEffectMetaController particleController = Factory.createParticleEffectController()) { + try (PlayerMetaController playerController = Factory.createPlayerDataController()) { + for (final PetMeta item : controller.getAll()) { + controller.remove(item); + } + PetMeta meta = new PetData(); + meta.setDisplayName("Notch"); + assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); + assertEquals(0, controller.size()); + + ParticleEffectMeta particleEffectMeta = particleController.create(); + particleEffectMeta.setEffectType(ParticleEffectMeta.ParticleEffectType.END_ROD); + particleController.store(particleEffectMeta); + meta.setParticleEffectMeta(particleEffectMeta); + + assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); + assertEquals(0, controller.size()); + + PlayerMeta playerMeta = playerController.create(player); + playerController.store(playerMeta); + meta.setPlayerMeta(playerMeta); + assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); + + meta.setPetType(PetType.BAT); + assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); + + meta.setSkin(Material.STONE, (short)5, null); + controller.store(meta); + + assertEquals(1, controller.size()); + assertEquals("Notch", controller.getByPlayer(player).getDisplayName()); + } + } + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + @Test + public void storeLoadPetMetaTest() throws ClassNotFoundException { + Factory.initialize(mockPlugin()); + final UUID uuid = UUID.randomUUID(); + final Player player = mock(Player.class); + when(player.getName()).thenReturn("Shynixn"); + when(player.getUniqueId()).thenReturn(uuid); + try (PetMetaController controller = Factory.createPetDataController()) { + try (ParticleEffectMetaController particleController = Factory.createParticleEffectController()) { + try (PlayerMetaController playerController = Factory.createPlayerDataController()) { + for (final PetMeta item : controller.getAll()) { + controller.remove(item); + } + PetMeta meta = new PetData(); + meta.setDisplayName("Me"); + meta.setSkin(Material.BIRCH_DOOR_ITEM,(short)5 , "This is my long skin."); + meta.setPetType(PetType.SHEEP); + meta.setEnabled(true); + meta.setAgeInTicks(500); + meta.setUnbreakable(true); + meta.setSoundsEnabled(true); + meta.setMoveType(MoveType.FLYING); + meta.setMovementType(Movement.CRAWLING); + + ParticleEffectMeta particleEffectMeta = particleController.create(); + particleEffectMeta.setEffectType(ParticleEffectMeta.ParticleEffectType.END_ROD); + particleController.store(particleEffectMeta); + meta.setParticleEffectMeta(particleEffectMeta); + + PlayerMeta playerMeta = playerController.create(player); + playerController.store(playerMeta); + meta.setPlayerMeta(playerMeta); + controller.store(meta); + + assertEquals(1, controller.size()); + meta = controller.getById(meta.getId()); + assertEquals("Me", meta.getDisplayName()); + assertEquals(Material.BIRCH_DOOR_ITEM, meta.getSkinMaterial()); + assertEquals((short)5, meta.getSkinDurability()); + assertEquals("This is my long skin.", meta.getSkin()); + assertEquals(PetType.SHEEP, meta.getType()); + assertEquals(true, meta.isEnabled()); + assertEquals(500, meta.getAgeInTicks()); + assertEquals(true, meta.isUnbreakable()); + assertEquals(true, meta.isSoundsEnabled()); + assertEquals(MoveType.FLYING, meta.getMoveType()); + assertEquals(Movement.CRAWLING, meta.getMovementType()); + + meta.setDisplayName("PikaPet"); + meta.setSkin(Material.ARROW,(short)7 , "http://Skin.com"); + meta.setPetType(PetType.DRAGON); + meta.setEnabled(false); + meta.setAgeInTicks(250); + meta.setUnbreakable(false); + meta.setSoundsEnabled(false); + meta.setMoveType(MoveType.WALKING); + meta.setMovementType(Movement.HOPPING); + controller.store(meta); + + assertEquals(1, controller.size()); + meta = controller.getById(meta.getId()); + assertEquals("PikaPet", meta.getDisplayName()); + assertEquals(Material.ARROW, meta.getSkinMaterial()); + assertEquals((short)7, meta.getSkinDurability()); + assertEquals("http://Skin.com", meta.getSkin()); + assertEquals(PetType.DRAGON, meta.getType()); + assertEquals(false, meta.isEnabled()); + assertEquals(250, meta.getAgeInTicks()); + assertEquals(false, meta.isUnbreakable()); + assertEquals(false, meta.isSoundsEnabled()); + assertEquals(MoveType.WALKING, meta.getMoveType()); + assertEquals(Movement.HOPPING, meta.getMovementType()); + } + } + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } +} diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java new file mode 100644 index 000000000..6a87e2826 --- /dev/null +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java @@ -0,0 +1,149 @@ +package com.github.shynixn.petblocks.business.logic.persistence.controller; + +import ch.vorburger.exec.ManagedProcessException; +import ch.vorburger.mariadb4j.DB; +import com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController; +import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; +import com.github.shynixn.petblocks.business.logic.persistence.Factory; +import com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.jupiter.api.function.Executable; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.io.File; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class PlayerMetaMySQLControllerTest { + + private static Plugin mockPlugin() { + final YamlConfiguration configuration = new YamlConfiguration(); + configuration.set("sql.local", true); + configuration.set("sql.host", "localhost"); + configuration.set("sql.port", 3306); + configuration.set("sql.database", "db"); + configuration.set("sql.username", "root"); + configuration.set("sql.password", ""); + Plugin plugin = mock(Plugin.class); + new File("PetBlocks.db").delete(); + when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); + when(plugin.getConfig()).thenReturn(configuration); + when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); + } + }); + return plugin; + } + + + private static DB database; + + @AfterClass + public static void stopMariaDB() + { + try { + database.stop(); + } catch (ManagedProcessException e) { + e.printStackTrace(); + } + } + + @BeforeClass + public static void startMariaDB() { + try { + Factory.disable(); + database = DB.newEmbeddedDB(3306); + database.start(); + try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/?user=root&password=")) { + try (Statement statement = conn.createStatement()) { + statement.executeUpdate("CREATE DATABASE db"); + } + } + } catch (SQLException | ManagedProcessException e) { + e.printStackTrace(); + } + } + + @Test + public void insertSelectPlayerMetaTest() throws ClassNotFoundException { + Plugin plugin = mockPlugin(); + plugin.getConfig().set("sql.local", false); + Factory.initialize(plugin); + try (PlayerMetaController controller = Factory.createPlayerDataController()) { + for (final PlayerMeta item : controller.getAll()) { + controller.remove(item); + } + UUID uuid = UUID.randomUUID(); + PlayerMeta playerMeta = new PlayerData(); + + assertThrows(IllegalArgumentException.class, () -> controller.store(playerMeta)); + assertEquals(0, controller.size()); + + playerMeta.setUuid(uuid); + controller.store(playerMeta); + assertEquals(0, controller.size()); + + playerMeta.setName("Sample"); + controller.store(playerMeta); + assertEquals(1, controller.size()); + assertEquals(uuid, controller.getById(playerMeta.getId()).getUUID()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + + @Test + public void storeLoadPlayerMetaTest() throws ClassNotFoundException { + Plugin plugin = mockPlugin(); + plugin.getConfig().set("sql.local", false); + Factory.initialize(plugin); + try (PlayerMetaController controller = Factory.createPlayerDataController()) { + for (final PlayerMeta item : controller.getAll()) { + controller.remove(item); + } + UUID uuid = UUID.randomUUID(); + PlayerMeta playerMeta = new PlayerData(); + playerMeta.setName("Second"); + playerMeta.setUuid(uuid); + controller.store(playerMeta); + + assertEquals(1, controller.size()); + playerMeta = controller.getAll().get(0); + assertEquals(uuid, playerMeta.getUUID()); + assertEquals("Second", playerMeta.getName()); + + uuid = UUID.randomUUID(); + playerMeta.setName("Shynixn"); + playerMeta.setUuid(uuid); + controller.store(playerMeta); + + playerMeta = controller.getAll().get(0); + assertEquals(uuid, playerMeta.getUUID()); + assertEquals("Shynixn", playerMeta.getName()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } +} diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java new file mode 100644 index 000000000..6145b81c2 --- /dev/null +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java @@ -0,0 +1,124 @@ +package com.github.shynixn.petblocks.business.logic.persistence.controller; + +import com.github.shynixn.petblocks.api.persistence.controller.PetMetaController; +import com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController; +import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; +import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; +import com.github.shynixn.petblocks.business.logic.persistence.Factory; +import com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.io.File; +import java.io.InputStream; +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class PlayerMetaSQLiteControllerTest { + + private static Plugin mockPlugin() { + final YamlConfiguration configuration = new YamlConfiguration(); + configuration.set("sql.local", true); + configuration.set("sql.host", "localhost"); + configuration.set("sql.port", 3306); + configuration.set("sql.database", "db"); + configuration.set("sql.username", "root"); + configuration.set("sql.password", ""); + Plugin plugin = mock(Plugin.class); + new File("PetBlocks.db").delete(); + when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); + when(plugin.getConfig()).thenReturn(configuration); + when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); + } + }); + return plugin; + } + + @BeforeClass + public static void disableFactory() { + Factory.disable(); + } + + @Test + public void insertSelectPlayerMetaTest() throws ClassNotFoundException { + Factory.initialize(mockPlugin()); + try (PlayerMetaController controller = Factory.createPlayerDataController()) { + try (PetMetaController petController = Factory.createPetDataController()) { + for (final PetMeta item : petController.getAll()) { + petController.remove(item); + } + } + for (final PlayerMeta item : controller.getAll()) { + controller.remove(item); + } + UUID uuid = UUID.randomUUID(); + PlayerMeta playerMeta = new PlayerData(); + assertThrows(IllegalArgumentException.class, () -> controller.store(playerMeta)); + assertEquals(0, controller.size()); + + playerMeta.setUuid(uuid); + controller.store(playerMeta); + assertEquals(0, controller.size()); + + playerMeta.setName("Sample"); + controller.store(playerMeta); + assertEquals(1, controller.size()); + assertEquals(uuid, controller.getById(playerMeta.getId()).getUUID()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + + @Test + public void storeLoadPlayerMetaTest() throws ClassNotFoundException { + Factory.initialize(mockPlugin()); + try (PlayerMetaController controller = Factory.createPlayerDataController()) { + try (PetMetaController petController = Factory.createPetDataController()) { + for (final PetMeta item : petController.getAll()) { + petController.remove(item); + } + } + for (final PlayerMeta item : controller.getAll()) { + controller.remove(item); + } + UUID uuid = UUID.randomUUID(); + PlayerMeta playerMeta = new PlayerData(); + playerMeta.setName("Second"); + playerMeta.setUuid(uuid); + controller.store(playerMeta); + + assertEquals(1, controller.size()); + playerMeta = controller.getAll().get(0); + assertEquals(uuid, playerMeta.getUUID()); + assertEquals("Second", playerMeta.getName()); + + uuid = UUID.randomUUID(); + playerMeta.setName("Shynixn"); + playerMeta.setUuid(uuid); + controller.store(playerMeta); + + playerMeta = controller.getAll().get(0); + assertEquals(uuid, playerMeta.getUUID()); + assertEquals("Shynixn", playerMeta.getName()); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } +} From 0083cc9e2a9ba7e1ca45ddff56980b8f8e0ede0c Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 31 May 2017 11:50:50 +0200 Subject: [PATCH 04/23] Added nms for 1.12 and fixed code style --- pom.xml | 22 ++ .../shynixn/petblocks/api/PetBlocksApi.java | 2 +- .../petblocks/api/entities/PetType.java | 4 +- .../petblocks/api/events/PetBlockEvent.java | 1 + .../api/events/PetBlockRideEvent.java | 2 +- .../persistence/entity/Persistenceable.java | 1 + .../shynixn/petblocks/business/Config.java | 17 +- .../shynixn/petblocks/business/Language.java | 10 +- .../petblocks/business/Permission.java | 7 +- .../supervanish/VisibilityManager.java | 4 +- .../business/bukkit/nms/NMSRegistry.java | 12 +- .../bukkit/nms/helper/PetBlockHelper.java | 16 +- .../nms/v1_10_R1/CustomGroundArmorstand.java | 99 ++++----- .../bukkit/nms/v1_10_R1/CustomRabbit.java | 13 +- .../bukkit/nms/v1_10_R1/CustomZombie.java | 13 +- .../bukkit/nms/v1_10_R1/OwnerPathfinder.java | 11 +- .../nms/v1_11_R1/CustomGroundArmorstand.java | 95 ++++----- .../bukkit/nms/v1_11_R1/CustomRabbit.java | 13 +- .../bukkit/nms/v1_11_R1/CustomZombie.java | 13 +- .../bukkit/nms/v1_11_R1/OwnerPathfinder.java | 11 +- .../nms/v1_12_R1/CustomGroundArmorstand.java | 102 ++++----- .../bukkit/nms/v1_12_R1/CustomRabbit.java | 25 +-- .../bukkit/nms/v1_12_R1/CustomZombie.java | 21 +- .../bukkit/nms/v1_12_R1/OwnerPathfinder.java | 23 ++- .../nms/v1_8_R1/CustomGroundArmorstand.java | 66 +++--- .../bukkit/nms/v1_8_R1/CustomRabbit.java | 11 +- .../bukkit/nms/v1_8_R1/CustomZombie.java | 11 +- .../bukkit/nms/v1_8_R1/OwnerPathfinder.java | 11 +- .../nms/v1_8_R2/CustomGroundArmorstand.java | 66 +++--- .../bukkit/nms/v1_8_R2/CustomRabbit.java | 11 +- .../bukkit/nms/v1_8_R2/CustomZombie.java | 11 +- .../bukkit/nms/v1_8_R2/OwnerPathfinder.java | 11 +- .../nms/v1_8_R3/CustomGroundArmorstand.java | 69 +++---- .../bukkit/nms/v1_8_R3/CustomRabbit.java | 11 +- .../bukkit/nms/v1_8_R3/CustomZombie.java | 11 +- .../bukkit/nms/v1_8_R3/OwnerPathfinder.java | 11 +- .../nms/v1_9_R1/CustomGroundArmorstand.java | 95 ++++----- .../bukkit/nms/v1_9_R1/CustomRabbit.java | 13 +- .../bukkit/nms/v1_9_R1/CustomZombie.java | 13 +- .../bukkit/nms/v1_9_R1/OwnerPathfinder.java | 11 +- .../nms/v1_9_R2/CustomGroundArmorstand.java | 92 ++++----- .../bukkit/nms/v1_9_R2/CustomRabbit.java | 13 +- .../bukkit/nms/v1_9_R2/CustomZombie.java | 13 +- .../bukkit/nms/v1_9_R2/OwnerPathfinder.java | 11 +- .../business/PetBlockCommandExecutor.java | 2 +- .../logic/business/PetBlockListener.java | 19 +- .../logic/business/PetBlockManager.java | 7 +- .../logic/business/PetDataListener.java | 2 +- .../logic/configuration/ConfigGUI.java | 20 +- .../logic/configuration/ConfigParticle.java | 4 +- .../configuration/CustomItemContainer.java | 10 +- .../business/logic/persistence/Factory.java | 22 +- .../ParticleEffectDataRepository.java | 40 ++-- .../controller/PetDataRepository.java | 60 +++--- .../controller/PlayerDataRepository.java | 42 ++-- .../entity/ParticleEffectData.java | 2 +- .../logic/persistence/entity/PetData.java | 13 +- .../shynixn/petblocks/lib/AsyncRunnable.java | 22 +- .../shynixn/petblocks/lib/BukkitCommands.java | 1 + .../shynixn/petblocks/lib/BukkitEvents.java | 1 + .../petblocks/lib/BukkitUtilities.java | 24 +-- .../petblocks/lib/DynamicCommandHelper.java | 6 +- .../lib/ExtensionHikariConnectionContext.java | 4 +- .../shynixn/petblocks/lib/Interpreter19.java | 14 +- .../shynixn/petblocks/lib/LightRegistry.java | 17 +- .../shynixn/petblocks/lib/Particle.java | 11 +- .../petblocks/lib/ParticleBuilder.java | 68 +++--- .../shynixn/petblocks/lib/ParticleEffect.java | 194 +++++++++--------- .../lib/ParticleReflectionUtils.java | 50 ++--- .../shynixn/petblocks/lib/PluginLoader.java | 8 +- .../shynixn/petblocks/lib/ReflectionLib.java | 14 +- .../shynixn/petblocks/lib/RegisterHelper.java | 25 +-- .../petblocks/lib/SkullMetaRegistry.java | 6 +- .../shynixn/petblocks/lib/SoundData.java | 7 +- .../persistence/controller/DatabaseTest.java | 21 +- ...ParticleEffectMetaMySQLControllerTest.java | 36 ++-- ...articleEffectMetaSQLiteControllerTest.java | 27 +-- .../PetMetaMySQLControllerTest.java | 45 ++-- .../PetMetaSQLiteControllerTest.java | 35 ++-- .../PlayerMetaMySQLControllerTest.java | 39 ++-- .../PlayerMetaSQLiteControllerTest.java | 28 ++- 81 files changed, 951 insertions(+), 1093 deletions(-) diff --git a/pom.xml b/pom.xml index 54b48b2a2..c0b8c51b7 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,27 @@ + + maven-surefire-plugin + 2.19.1 + + + org.junit.platform + junit-platform-surefire-provider + 1.0.0-M4 + + + org.junit.jupiter + junit-jupiter-engine + 5.0.0-M4 + + + + + **/*Test.java + + + org.apache.maven.plugins maven-javadoc-plugin @@ -201,6 +222,7 @@ com.zaxxer HikariCP-java7 2.4.11 + compile org.mockito diff --git a/src/main/java/com/github/shynixn/petblocks/api/PetBlocksApi.java b/src/main/java/com/github/shynixn/petblocks/api/PetBlocksApi.java index e7e74a606..781f2e284 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/PetBlocksApi.java +++ b/src/main/java/com/github/shynixn/petblocks/api/PetBlocksApi.java @@ -70,7 +70,7 @@ public static void removePetMeta(Player player) { if (player == null) throw new IllegalArgumentException("Player cannot be null!"); if (dataManager.hasPetMeta(player)) - dataManager.remove((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)getPetMeta(player)); + dataManager.remove(getPetMeta(player)); } public static void setPetMeta(Player player, PetType petType) { diff --git a/src/main/java/com/github/shynixn/petblocks/api/entities/PetType.java b/src/main/java/com/github/shynixn/petblocks/api/entities/PetType.java index 7ce8165a0..9d9cd36bf 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/entities/PetType.java +++ b/src/main/java/com/github/shynixn/petblocks/api/entities/PetType.java @@ -87,7 +87,7 @@ public void playRandomSound(Location location) { } public static String[] getNames() { - String[] names = new String[PetType.values().length]; + final String[] names = new String[PetType.values().length]; for (int i = 0; i < names.length; i++) { names[i] = PetType.values()[i].name(); } @@ -97,11 +97,9 @@ public static String[] getNames() { public static PetType getPetTypeFromName(String name) { for (final PetType pet : PetType.values()) { - System.out.println("IS " + pet.name() + " VS " + name); if (pet.name().equalsIgnoreCase(name)) return pet; } - System.out.println("NO QUERY"); return null; } } diff --git a/src/main/java/com/github/shynixn/petblocks/api/events/PetBlockEvent.java b/src/main/java/com/github/shynixn/petblocks/api/events/PetBlockEvent.java index 78534636b..15dae02cd 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/events/PetBlockEvent.java +++ b/src/main/java/com/github/shynixn/petblocks/api/events/PetBlockEvent.java @@ -11,6 +11,7 @@ public class PetBlockEvent extends SpigotEvent { private final PetBlock petBlock; public PetBlockEvent(PetBlock petBlock) { + super(); if (petBlock == null) throw new IllegalArgumentException("PetBlock cannot be null!"); this.petBlock = petBlock; diff --git a/src/main/java/com/github/shynixn/petblocks/api/events/PetBlockRideEvent.java b/src/main/java/com/github/shynixn/petblocks/api/events/PetBlockRideEvent.java index 3e469d039..e887d90cb 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/events/PetBlockRideEvent.java +++ b/src/main/java/com/github/shynixn/petblocks/api/events/PetBlockRideEvent.java @@ -6,7 +6,7 @@ * Created by Shynixn */ public class PetBlockRideEvent extends PetBlockCancelAbleEvent { - private boolean isRiding; + private final boolean isRiding; public PetBlockRideEvent(PetBlock petBlock, boolean isRiding) { super(petBlock); diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.java index 9e9de0117..1aec04e12 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.java +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.java @@ -1,5 +1,6 @@ package com.github.shynixn.petblocks.api.persistence.entity; +@FunctionalInterface public interface Persistenceable { /** diff --git a/src/main/java/com/github/shynixn/petblocks/business/Config.java b/src/main/java/com/github/shynixn/petblocks/business/Config.java index e12406bd3..04dfd52e5 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/Config.java +++ b/src/main/java/com/github/shynixn/petblocks/business/Config.java @@ -1,14 +1,15 @@ package com.github.shynixn.petblocks.business; import com.github.shynixn.petblocks.api.entities.*; +import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; +import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; import com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle; import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; -import com.github.shynixn.petblocks.lib.ParticleEffect; -import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; import com.github.shynixn.petblocks.lib.BukkitUtilities; import com.github.shynixn.petblocks.lib.ParticleBuilder; +import com.github.shynixn.petblocks.lib.ParticleEffect; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -18,7 +19,6 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.java.JavaPlugin; import java.util.logging.Level; @@ -39,6 +39,7 @@ public final class Config { private boolean join_overwriteExistingPet; private Config(Plugin plugin) { + super(); Config.plugin = plugin; this.reload(); } @@ -60,10 +61,10 @@ public void reload() { this.chat_highestpriority = c.getBoolean("chat.highest-priority"); this.world_allowInAllWorlds = plugin.getConfig().getBoolean("world.all"); - this.world_worlds = plugin.getConfig().getStringList("world.worlds").toArray(new String[0]); + this.world_worlds = plugin.getConfig().getStringList("world.worlds").toArray(new String[plugin.getConfig().getStringList("world.worlds").size()]); this.region_allowInAllRegions = plugin.getConfig().getBoolean("region.all"); - this.region_regions = plugin.getConfig().getStringList("region.regions").toArray(new String[0]); + this.region_regions = plugin.getConfig().getStringList("region.regions").toArray(new String[plugin.getConfig().getStringList("region.regions").size()]); this.join_enabled = c.getBoolean("join.enabled"); this.join_overwriteExistingPet = plugin.getConfig().getBoolean("join.overwrite-previous-pet"); @@ -72,7 +73,7 @@ public void reload() { ConfigGUI.getInstance().load(c); ConfigParticle.getInstance().load(c); ConfigPet.getInstance().load(c); - } catch (Exception ex) { + } catch (final Exception ex) { Bukkit.getLogger().log(Level.WARNING, "Failed to reload config.", ex); } } @@ -100,7 +101,7 @@ public void fixJoinDefaultPet(PetMeta petMeta) { else petMeta.setMoveType(MoveType.getMoveTypeFromName(c.getString("join.settings.moving"))); if (!c.getString("join.settings.particle.name").equalsIgnoreCase("none") && ParticleEffect.getParticleEffectFromName(c.getString("join.settings.particle.name")) != null) { - Particle particle = new ParticleBuilder() + final Particle particle = new ParticleBuilder() .setEffect(ParticleEffect.getParticleEffectFromName(c.getString("join.settings.particle.name"))) .setOffset(c.getDouble("join.settings.particle.x"), c.getDouble("join.settings.particle.y"), c.getDouble("join.settings.particle.z")) .setSpeed(c.getDouble("join.settings.particle.speed")) diff --git a/src/main/java/com/github/shynixn/petblocks/business/Language.java b/src/main/java/com/github/shynixn/petblocks/business/Language.java index d8a47db83..1927e8551 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/Language.java +++ b/src/main/java/com/github/shynixn/petblocks/business/Language.java @@ -2,7 +2,9 @@ import java.io.File; import java.lang.reflect.Field; +import java.util.logging.Level; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; @@ -92,19 +94,19 @@ public static void reload(JavaPlugin plugin) { PREFIX = ChatColor.translateAlternateColorCodes('&', config.getString("prefix")); NUMBER_PREFIX = ChatColor.translateAlternateColorCodes('&', config.getString("number-prefix")); } - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Bukkit.getLogger().log(Level.WARNING, "Failed to read lang.yml! Recreate it!", e); BukkitUtilities.sendColorMessage("Recreate your lang.yml!", ChatColor.RED, PetBlocksPlugin.PREFIX_CONSOLE); } } public static String getDisplayName(String petName) { - for (Field field : Language.class.getDeclaredFields()) { + for (final Field field : Language.class.getDeclaredFields()) { if (field.getName().contains("DISPLAYNAME") && field.getName().toUpperCase().contains(petName.toUpperCase())) try { return (String) field.get(null); } catch (IllegalArgumentException | IllegalAccessException e) { - e.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "Failed to obtain value of field.", e); } } throw new RuntimeException("Cannot find displaName"); diff --git a/src/main/java/com/github/shynixn/petblocks/business/Permission.java b/src/main/java/com/github/shynixn/petblocks/business/Permission.java index 2eb07b522..56a5e54f4 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/Permission.java +++ b/src/main/java/com/github/shynixn/petblocks/business/Permission.java @@ -1,7 +1,5 @@ package com.github.shynixn.petblocks.business; -import java.util.*; - public enum Permission { ALLPETTYPES("petblocks.pet.type.all"), SINGLEPETTYPE("petblocks.pet.type."), @@ -20,14 +18,13 @@ public enum Permission { SINGLEPARTICLE("petblocks.pet.particles."), OWNINGAMECOSTUMES("petblocks.inventory.costume"); - private String perm; + private final String perm; Permission(String perm) { this.perm = perm; } public String get() { - return perm; + return this.perm; } - } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/VisibilityManager.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/VisibilityManager.java index 9dde2a5fb..b89113b10 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/VisibilityManager.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/VisibilityManager.java @@ -24,7 +24,7 @@ void hidePetBlock(final PetBlock petBlock, final Player... players) { @Override public void run() { if (!VisibilityManager.this.hiddenValues.containsKey(petBlock)) - VisibilityManager.this.hiddenValues.put(petBlock, new ArrayList()); + VisibilityManager.this.hiddenValues.put(petBlock, new ArrayList<>()); for (final Player player : players) { VisibilityManager.this.sendDestroyPacket(player, petBlock.getArmorStand()); VisibilityManager.this.sendDestroyPacket(player, petBlock.getMovementEntity()); @@ -87,7 +87,7 @@ private void sendPacket(Player player, Entity entity, Object packet) { final Object playerConnection = entityPlayer.getClass().getField("playerConnection").get(entityPlayer); ReflectionLib.invokeMethodByObject(playerConnection, "sendPacket", packet); } catch (final Exception e) { - Bukkit.getLogger().log(Level.WARNING, "Cannot send packet " + packet.getClass().getSimpleName() + ".", e); + Bukkit.getLogger().log(Level.WARNING, "Cannot send packet " + packet.getClass().getSimpleName() + '.', e); } } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/NMSRegistry.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/NMSRegistry.java index 892355828..f101a34c6 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/NMSRegistry.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/NMSRegistry.java @@ -2,13 +2,13 @@ import com.github.shynixn.petblocks.api.entities.PetBlock; import com.github.shynixn.petblocks.api.entities.PetMeta; -import com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag.ClearLagListener; -import com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection5; -import com.github.shynixn.petblocks.lib.*; import com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin; +import com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag.ClearLagListener; import com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish.SuperVanishConnection; +import com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection5; import com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection6; import com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.Listener19; +import com.github.shynixn.petblocks.lib.*; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; @@ -18,7 +18,6 @@ import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; -import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -46,7 +45,8 @@ public static void registerListener19(List players, JavaPlugin plugin) { if (BukkitUtilities.getServerVersion().equalsIgnoreCase("v1_9_R1") || BukkitUtilities.getServerVersion().equalsIgnoreCase("v1_9_R2") || BukkitUtilities.getServerVersion().equalsIgnoreCase("v1_10_R1") - || BukkitUtilities.getServerVersion().equalsIgnoreCase("v1_11_R1")) { + || BukkitUtilities.getServerVersion().equalsIgnoreCase("v1_11_R1") + || BukkitUtilities.getServerVersion().equalsIgnoreCase("v1_12_R1")) { try { Class.forName("org.bukkit.event.player.PlayerSwapHandItemsEvent"); } catch (final ClassNotFoundException e) { @@ -130,7 +130,7 @@ public static void rollbackWorldGuardSpawn(Location location) { WorldGuardConnection6.rollBack(); else if (RegisterHelper.isRegistered("WorldGuard", '5')) WorldGuardConnection5.rollBack(); - } catch (Exception ex) { + } catch (final Exception ex) { Bukkit.getServer().getConsoleSender().sendMessage(PetBlocksPlugin.PREFIX_CONSOLE + ChatColor.DARK_RED + "Crashed while connecting to worldguard." + ex.getMessage()); } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.java index 985802d6c..0382976e2 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.java @@ -173,7 +173,7 @@ public static void refreshHeadItemMeta(PetBlock petBlock, ItemStack itemStack) { public static void setItemConsideringAge(PetBlock petBlock) { final Age age = petBlock.getPetMeta().getAge(); - ItemStack itemStack; + final ItemStack itemStack; if(petBlock.getPetMeta().getSkin() != null) { if(petBlock.getPetMeta().getSkin().contains("http")) { itemStack = NMSRegistry.changeSkullSkin(new ItemStack(petBlock.getPetMeta().getSkinMaterial(), 1, petBlock.getPetMeta().getSkinDurability()),petBlock.getPetMeta().getSkin()); @@ -212,15 +212,10 @@ public static boolean setDieing(final PetBlock petBlock) { petBlock.jump(); if(petBlock.getArmorStand() != null && !petBlock.getArmorStand().isDead()) petBlock.getArmorStand().setHeadPose(new EulerAngle(0,1,0)); - Bukkit.getPluginManager().getPlugin("PetBlocks").getServer().getScheduler().runTaskLater(Bukkit.getPluginManager().getPlugin("PetBlocks"), new Runnable() - { - @Override - public void run() - { - final Particle particle = new ParticleBuilder(ParticleEffect.CLOUD,1,1,1,0.1,100).build(); - particle.play(petBlock.getLocation()); - petBlock.remove(); - } + Bukkit.getPluginManager().getPlugin("PetBlocks").getServer().getScheduler().runTaskLater(Bukkit.getPluginManager().getPlugin("PetBlocks"), () -> { + final Particle particle = new ParticleBuilder(ParticleEffect.CLOUD,1,1,1,0.1,100).build(); + particle.play(petBlock.getLocation()); + petBlock.remove(); },20*2); return true; } @@ -304,6 +299,7 @@ public static void remove(PetBlock petBlock) { petBlock.getArmorStand().remove(); } + @FunctionalInterface public interface TickCallBack { void run(Location location); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomGroundArmorstand.java index 0c43e00a6..9dd823d2c 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomGroundArmorstand.java @@ -1,10 +1,10 @@ package com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1; import com.github.shynixn.petblocks.api.entities.*; -import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; import com.github.shynixn.petblocks.api.events.PetBlockSpawnEvent; +import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; import net.minecraft.server.v1_10_R1.*; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -19,6 +19,7 @@ import org.bukkit.util.Vector; import java.lang.reflect.Field; +import java.util.logging.Level; final class CustomGroundArmorstand extends EntityArmorStand implements PetBlock { private PetMeta petMeta; @@ -56,23 +57,23 @@ public CustomGroundArmorstand(World world, double d0, double d1, double d2) { } private boolean isJumping() { - Field jump = null; + final Field jump; try { jump = EntityLiving.class.getDeclaredField("be"); jump.setAccessible(true); - for (Entity entity : this.passengers) { + for (final Entity entity : this.passengers) { return jump.getBoolean(entity); } return false; } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e1) { - e1.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", e1); } return false; } private EntityHuman hasHumanPassenger() { if (this.passengers != null) { - for (Entity entity : this.passengers) { + for (final Entity entity : this.passengers) { if (entity instanceof EntityHuman) return (EntityHuman) entity; } @@ -83,14 +84,11 @@ private EntityHuman hasHumanPassenger() { @Override protected void doTick() { if (this.isSpecial) { - this.counter = PetBlockHelper.doTick(this.counter, this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.counter = PetBlockHelper.doTick(this.counter, this, location -> { + CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + final PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -112,8 +110,7 @@ public void g(float sideMot, float forMot) { forMot *= 0.25F; } if (this.onGround && this.isJumping()) { - double jumpHeight = 0.5D; - this.motY = jumpHeight; + this.motY = 0.5D; } this.P = (float) ConfigPet.getInstance().getModifier_petclimbing(); this.aS = (this.cp() * 0.1F); @@ -122,8 +119,8 @@ public void g(float sideMot, float forMot) { super.g(sideMot * (float) ConfigPet.getInstance().getModifier_petriding(), forMot * (float) ConfigPet.getInstance().getModifier_petriding()); } this.aG = this.aH; - double d0 = this.locX - this.lastX; - double d1 = this.locZ - this.lastZ; + final double d0 = this.locX - this.lastX; + final double d1 = this.locZ - this.lastZ; float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) { @@ -133,10 +130,10 @@ public void g(float sideMot, float forMot) { this.aH += (f4 - this.aH) * 0.4F; this.aI += this.aH; } else { - float side = this.hasHumanPassenger().bf * 0.5F; - float forw = this.hasHumanPassenger().bg; - Vector v = new Vector(); - Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); + final float side = this.hasHumanPassenger().bf * 0.5F; + final float forw = this.hasHumanPassenger().bg; + final Vector v = new Vector(); + final Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); if (side < 0.0F) { l.setYaw(this.hasHumanPassenger().yaw - 90); v.add(l.getDirection().normalize().multiply(-0.5)); @@ -176,9 +173,9 @@ public void g(float sideMot, float forMot) { l.add(v.multiply(2.25).multiply(ConfigPet.getInstance().getModifier_petriding())); this.setPosition(l.getX(), l.getY(), l.getZ()); } - Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); - MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); + final Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); + final Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + final MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); if (movingobjectposition == null) { this.bumper = l.toVector(); } else { @@ -196,15 +193,15 @@ public void g(float sideMot, float forMot) { private Vector bumper; public void spawn(Location location) { - PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); + final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); Bukkit.getPluginManager().callEvent(event); if (!event.isCanceled()) { NMSRegistry.accessWorldGuardSpawn(location); this.rabbit.spawn(location); - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); - NBTTagCompound compound = new NBTTagCompound(); + final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); @@ -228,10 +225,10 @@ public void spawn(Location location) { @Override public void teleportWithOwner(Location location) { - EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); + final EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); player.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); - for (Player player1 : this.owner.getWorld().getPlayers()) { + final PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); + for (final Player player1 : this.owner.getWorld().getPlayers()) { ((CraftPlayer) player1).getHandle().playerConnection.sendPacket(teleport); } } @@ -241,13 +238,10 @@ public void damage(double amount) { if (amount < -1.0) { this.hitflor = true; } else { - this.health = PetBlockHelper.setDamage(this, this.health, amount, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.health = PetBlockHelper.setDamage(this, this.health, amount, location -> { + final PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -255,12 +249,7 @@ public void run(Location location) { @Override public void respawn() { - PetBlockHelper.respawn(this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.spawn(location); - } - }); + PetBlockHelper.respawn(this, CustomGroundArmorstand.this::spawn); } @Override @@ -332,13 +321,10 @@ public void launch(Vector vector) { @Override public void wear(final Player player) { - PetBlockHelper.wear(this, player, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); - for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); - } + PetBlockHelper.wear(this, player, location -> { + final PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (final Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); } }); } @@ -355,13 +341,10 @@ public ArmorStand getArmorStand() { @Override public void eject(final Player player) { - PetBlockHelper.eject(this, player, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); - for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); - } + PetBlockHelper.eject(this, player, location -> { + final PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (final Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); } }); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomRabbit.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomRabbit.java index 8815197aa..624a507bf 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomRabbit.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomRabbit.java @@ -18,6 +18,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.logging.Level; public final class CustomRabbit extends EntityRabbit implements CustomEntity { private Player player; @@ -32,8 +33,8 @@ public CustomRabbit(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.setSilent(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); this.ignoreFinalField(bField); this.ignoreFinalField(cField); cField.setAccessible(true); @@ -44,8 +45,8 @@ public CustomRabbit(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petData = meta; @@ -54,7 +55,7 @@ public CustomRabbit(Player player, PetMeta meta) { private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); + final Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } @@ -67,7 +68,7 @@ protected SoundEffect df() { @Override public void spawn(Location location) { - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomZombie.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomZombie.java index f5da60eff..5cffd63d6 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomZombie.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomZombie.java @@ -18,6 +18,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.logging.Level; /** * Created by Shynixn @@ -35,8 +36,8 @@ public CustomZombie(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.setSilent(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); this.ignoreFinalField(bField); this.ignoreFinalField(cField); cField.setAccessible(true); @@ -47,8 +48,8 @@ public CustomZombie(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petMeta = meta; @@ -57,7 +58,7 @@ public CustomZombie(Player player, PetMeta meta) { @Override public void spawn(Location location) { - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); @@ -83,7 +84,7 @@ private FixedMetadataValue getKeepField() { private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); + final Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/OwnerPathfinder.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/OwnerPathfinder.java index c59fbafc2..270ee20cd 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/OwnerPathfinder.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/OwnerPathfinder.java @@ -20,6 +20,7 @@ public final class OwnerPathfinder extends PathfinderGoal { private int counter; public OwnerPathfinder(EntityInsentient entitycreature, Player player) { + super(); this.entity = entitycreature; this.player = player; } @@ -33,7 +34,7 @@ public boolean a() { this.entity.getBukkitEntity().teleport(this.player.getLocation()); } else if (this.entity.getBukkitEntity().getLocation().distance(this.player.getLocation()) > 2) { this.counter2 = PetBlockHelper.afraidWaterEffect(this.entity.getBukkitEntity(), this.counter2); - Location targetLocation = this.player.getLocation(); + final Location targetLocation = this.player.getLocation(); this.entity.getNavigation().n(); this.entity.getNavigation(); this.path = this.entity.getNavigation().a(targetLocation.getX() + 1, targetLocation.getY(), targetLocation.getZ() + 1); @@ -65,14 +66,14 @@ public void c() { } public static boolean isUnbreakable(ItemStack itemStack) { - net.minecraft.server.v1_10_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + final net.minecraft.server.v1_10_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); return stack.getTag() != null && stack.getTag().hasKey("Unbreakable") && stack.getTag().getBoolean("Unbreakable"); } public static ItemStack setItemstackTag(ItemStack itemStack, Map tags) { - net.minecraft.server.v1_10_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); - for (String tag : tags.keySet()) { - NBTTagCompound nbtTagCompound; + final net.minecraft.server.v1_10_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + for (final String tag : tags.keySet()) { + final NBTTagCompound nbtTagCompound; if (stack.getTag() == null) nbtTagCompound = new NBTTagCompound(); else diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomGroundArmorstand.java index 1d83bffd0..fe7304225 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomGroundArmorstand.java @@ -31,6 +31,7 @@ import org.bukkit.util.Vector; import java.lang.reflect.Field; +import java.util.logging.Level; final class CustomGroundArmorstand extends EntityArmorStand implements PetBlock { private PetMeta petMeta; @@ -68,23 +69,23 @@ public CustomGroundArmorstand(World world, double d0, double d1, double d2) { } private boolean isJumping() { - Field jump = null; + final Field jump; try { jump = EntityLiving.class.getDeclaredField("bd"); jump.setAccessible(true); - for (Entity entity : this.passengers) { + for (final Entity entity : this.passengers) { return jump.getBoolean(entity); } return false; } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e1) { - e1.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", e1); } return false; } private EntityHuman hasHumanPassenger() { if (this.passengers != null) { - for (Entity entity : this.passengers) { + for (final Entity entity : this.passengers) { if (entity instanceof EntityHuman) return (EntityHuman) entity; } @@ -95,14 +96,11 @@ private EntityHuman hasHumanPassenger() { @Override protected void doTick() { if (this.isSpecial) { - this.counter = PetBlockHelper.doTick(this.counter, this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.counter = PetBlockHelper.doTick(this.counter, this, location -> { + CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + final PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -124,8 +122,7 @@ public void g(float sideMot, float forMot) { forMot *= 0.25F; } if (this.onGround && this.isJumping()) { - double jumpHeight = 0.5D; - this.motY = jumpHeight; + this.motY = 0.5D; } this.P = (float) ConfigPet.getInstance().getModifier_petclimbing(); this.aR = (this.cq() * 0.1F); @@ -134,8 +131,8 @@ public void g(float sideMot, float forMot) { super.g(sideMot * (float) ConfigPet.getInstance().getModifier_petriding(), forMot * (float) ConfigPet.getInstance().getModifier_petriding()); } this.aF = this.aG; - double d0 = this.locX - this.lastX; - double d1 = this.locZ - this.lastZ; + final double d0 = this.locX - this.lastX; + final double d1 = this.locZ - this.lastZ; float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) { @@ -145,10 +142,10 @@ public void g(float sideMot, float forMot) { this.aG += (f4 - this.aG) * 0.4F; this.aH += this.aG; } else { - float side = this.hasHumanPassenger().be * 0.5F; - float forw = this.hasHumanPassenger().bf; - Vector v = new Vector(); - Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); + final float side = this.hasHumanPassenger().be * 0.5F; + final float forw = this.hasHumanPassenger().bf; + final Vector v = new Vector(); + final Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); if (side < 0.0F) { l.setYaw(this.hasHumanPassenger().yaw - 90); v.add(l.getDirection().normalize().multiply(-0.5)); @@ -188,9 +185,9 @@ public void g(float sideMot, float forMot) { l.add(v.multiply(2.25).multiply(ConfigPet.getInstance().getModifier_petriding())); this.setPosition(l.getX(), l.getY(), l.getZ()); } - Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); - MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); + final Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); + final Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + final MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); if (movingobjectposition == null) { this.bumper = l.toVector(); } else { @@ -208,15 +205,15 @@ public void g(float sideMot, float forMot) { private Vector bumper; public void spawn(Location location) { - PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); + final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); Bukkit.getPluginManager().callEvent(event); if (!event.isCanceled()) { NMSRegistry.accessWorldGuardSpawn(location); this.rabbit.spawn(location); - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); - NBTTagCompound compound = new NBTTagCompound(); + final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); @@ -240,10 +237,10 @@ public void spawn(Location location) { @Override public void teleportWithOwner(Location location) { - EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); + final EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); player.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); - for (Player player1 : this.owner.getWorld().getPlayers()) { + final PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); + for (final Player player1 : this.owner.getWorld().getPlayers()) { ((CraftPlayer) player1).getHandle().playerConnection.sendPacket(teleport); } } @@ -253,13 +250,10 @@ public void damage(double amount) { if (amount < -1.0) { this.hitflor = true; } else { - this.health = PetBlockHelper.setDamage(this, this.health, amount, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.health = PetBlockHelper.setDamage(this, this.health, amount, location -> { + final PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -267,12 +261,7 @@ public void run(Location location) { @Override public void respawn() { - PetBlockHelper.respawn(this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.spawn(location); - } - }); + PetBlockHelper.respawn(this, CustomGroundArmorstand.this::spawn); } @Override @@ -344,13 +333,10 @@ public void launch(Vector vector) { @Override public void wear(final Player player) { - PetBlockHelper.wear(this, player, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); - for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); - } + PetBlockHelper.wear(this, player, location -> { + final PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (final Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); } }); } @@ -367,13 +353,10 @@ public ArmorStand getArmorStand() { @Override public void eject(final Player player) { - PetBlockHelper.eject(this, player, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); - for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); - } + PetBlockHelper.eject(this, player, location -> { + final PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (final Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); } }); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomRabbit.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomRabbit.java index bd02f5484..570c06685 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomRabbit.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomRabbit.java @@ -18,6 +18,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.logging.Level; public final class CustomRabbit extends EntityRabbit implements CustomEntity { private Player player; @@ -32,8 +33,8 @@ public CustomRabbit(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.setSilent(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); this.ignoreFinalField(bField); this.ignoreFinalField(cField); cField.setAccessible(true); @@ -44,8 +45,8 @@ public CustomRabbit(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petData = meta; @@ -54,7 +55,7 @@ public CustomRabbit(Player player, PetMeta meta) { private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); + final Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } @@ -67,7 +68,7 @@ protected SoundEffect di() { @Override public void spawn(Location location) { - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomZombie.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomZombie.java index f2a678947..75f364841 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomZombie.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomZombie.java @@ -18,6 +18,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.logging.Level; /** * Created by Shynixn @@ -35,8 +36,8 @@ public CustomZombie(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.setSilent(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); this.ignoreFinalField(bField); this.ignoreFinalField(cField); cField.setAccessible(true); @@ -47,8 +48,8 @@ public CustomZombie(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petMeta = meta; @@ -57,7 +58,7 @@ public CustomZombie(Player player, PetMeta meta) { @Override public void spawn(Location location) { - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); @@ -83,7 +84,7 @@ private FixedMetadataValue getKeepField() { private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); + final Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/OwnerPathfinder.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/OwnerPathfinder.java index b916d4754..20ad34b01 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/OwnerPathfinder.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/OwnerPathfinder.java @@ -23,6 +23,7 @@ public final class OwnerPathfinder extends PathfinderGoal { private int counter; public OwnerPathfinder(EntityInsentient entitycreature, Player player) { + super(); this.entity = entitycreature; this.player = player; } @@ -36,7 +37,7 @@ public boolean a() { this.entity.getBukkitEntity().teleport(this.player.getLocation()); } else if (this.entity.getBukkitEntity().getLocation().distance(this.player.getLocation()) > 2) { this.counter2 = PetBlockHelper.afraidWaterEffect(this.entity.getBukkitEntity(), this.counter2); - Location targetLocation = this.player.getLocation(); + final Location targetLocation = this.player.getLocation(); this.entity.getNavigation().n(); this.entity.getNavigation(); this.path = this.entity.getNavigation().a(targetLocation.getX() + 1, targetLocation.getY(), targetLocation.getZ() + 1); @@ -68,14 +69,14 @@ public void c() { } public static boolean isUnbreakable(ItemStack itemStack) { - net.minecraft.server.v1_11_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + final net.minecraft.server.v1_11_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); return stack.getTag() != null && stack.getTag().hasKey("Unbreakable") && stack.getTag().getBoolean("Unbreakable"); } public static ItemStack setItemstackTag(ItemStack itemStack, Map tags) { - net.minecraft.server.v1_11_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); - for (String tag : tags.keySet()) { - NBTTagCompound nbtTagCompound; + final net.minecraft.server.v1_11_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + for (final String tag : tags.keySet()) { + final NBTTagCompound nbtTagCompound; if (stack.getTag() == null) nbtTagCompound = new NBTTagCompound(); else diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java index 8f1608109..0db77aec0 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java @@ -1,23 +1,11 @@ package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1; import com.github.shynixn.petblocks.api.entities.*; +import com.github.shynixn.petblocks.api.events.PetBlockSpawnEvent; import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; -import com.github.shynixn.petblocks.api.events.PetBlockSpawnEvent; -import net.minecraft.server.v1_12_R1.Entity; -import net.minecraft.server.v1_12_R1.EntityArmorStand; -import net.minecraft.server.v1_12_R1.EntityHuman; -import net.minecraft.server.v1_12_R1.EntityLiving; -import net.minecraft.server.v1_12_R1.EntityPlayer; -import net.minecraft.server.v1_12_R1.MathHelper; -import net.minecraft.server.v1_12_R1.MovingObjectPosition; -import net.minecraft.server.v1_12_R1.NBTTagCompound; -import net.minecraft.server.v1_12_R1.PacketPlayOutAnimation; -import net.minecraft.server.v1_12_R1.PacketPlayOutEntityTeleport; -import net.minecraft.server.v1_12_R1.PacketPlayOutMount; -import net.minecraft.server.v1_12_R1.Vec3D; -import net.minecraft.server.v1_12_R1.World; +import net.minecraft.server.v1_12_R1.*; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_12_R1.CraftWorld; @@ -32,7 +20,6 @@ import java.lang.reflect.Field; import java.util.logging.Level; -import java.util.logging.Logger; final class CustomGroundArmorstand extends EntityArmorStand implements PetBlock { private PetMeta petMeta; @@ -79,14 +66,14 @@ private boolean isJumping() { } return false; } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e1) { - Bukkit.getLogger().log(Level.WARNING, "Failed to inject jumping.", e1); + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", e1); } return false; } private EntityHuman hasHumanPassenger() { if (this.passengers != null) { - for (Entity entity : this.passengers) { + for (final Entity entity : this.passengers) { if (entity instanceof EntityHuman) return (EntityHuman) entity; } @@ -109,7 +96,7 @@ protected void doTick() { } @Override - public void a(float sideMot, float forMot, float unknown) { + public void a(float sideMot, float forMot, float f2) { if (this.isSpecial) { if (this.hasHumanPassenger() != null) { if (this.petMeta.getMoveType() == MoveType.WALKING) { @@ -118,23 +105,22 @@ public void a(float sideMot, float forMot, float unknown) { this.setYawPitch(this.yaw, this.pitch); this.aP = (this.aN = this.yaw); sideMot = this.hasHumanPassenger().be * 0.5F; - forMot = this.hasHumanPassenger().bf; + forMot = this.hasHumanPassenger().bg; if (forMot <= 0.0F) { forMot *= 0.25F; } if (this.onGround && this.isJumping()) { - double jumpHeight = 0.5D; - this.motY = jumpHeight; + this.motY = 0.5D; } this.P = (float) ConfigPet.getInstance().getModifier_petclimbing(); - // this.aR = (this.cq() * 0.1F); + this.aR = (this.cw() * 0.1F); if (!this.world.isClientSide) { - // this.l(0.35F); + this.m(0.35F); super.g(sideMot * (float) ConfigPet.getInstance().getModifier_petriding(), forMot * (float) ConfigPet.getInstance().getModifier_petriding()); } this.aF = this.aG; - double d0 = this.locX - this.lastX; - double d1 = this.locZ - this.lastZ; + final double d0 = this.locX - this.lastX; + final double d1 = this.locZ - this.lastZ; float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) { @@ -144,10 +130,10 @@ public void a(float sideMot, float forMot, float unknown) { this.aG += (f4 - this.aG) * 0.4F; this.aH += this.aG; } else { - float side = this.hasHumanPassenger().be * 0.5F; - float forw = this.hasHumanPassenger().bf; - Vector v = new Vector(); - Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); + final float side = this.hasHumanPassenger().be * 0.5F; + final float forw = this.hasHumanPassenger().bf; + final Vector v = new Vector(); + final Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); if (side < 0.0F) { l.setYaw(this.hasHumanPassenger().yaw - 90); v.add(l.getDirection().normalize().multiply(-0.5)); @@ -187,9 +173,9 @@ public void a(float sideMot, float forMot, float unknown) { l.add(v.multiply(2.25).multiply(ConfigPet.getInstance().getModifier_petriding())); this.setPosition(l.getX(), l.getY(), l.getZ()); } - Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); - MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); + final Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); + final Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + final MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); if (movingobjectposition == null) { this.bumper = l.toVector(); } else { @@ -207,15 +193,15 @@ public void a(float sideMot, float forMot, float unknown) { private Vector bumper; public void spawn(Location location) { - PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); + final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); Bukkit.getPluginManager().callEvent(event); if (!event.isCanceled()) { NMSRegistry.accessWorldGuardSpawn(location); this.rabbit.spawn(location); - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); - NBTTagCompound compound = new NBTTagCompound(); + final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); @@ -239,10 +225,10 @@ public void spawn(Location location) { @Override public void teleportWithOwner(Location location) { - EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); + final EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); player.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); - for (Player player1 : this.owner.getWorld().getPlayers()) { + final PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); + for (final Player player1 : this.owner.getWorld().getPlayers()) { ((CraftPlayer) player1).getHandle().playerConnection.sendPacket(teleport); } } @@ -252,13 +238,10 @@ public void damage(double amount) { if (amount < -1.0) { this.hitflor = true; } else { - this.health = PetBlockHelper.setDamage(this, this.health, amount, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.health = PetBlockHelper.setDamage(this, this.health, amount, location -> { + final PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -266,12 +249,7 @@ public void run(Location location) { @Override public void respawn() { - PetBlockHelper.respawn(this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.spawn(location); - } - }); + PetBlockHelper.respawn(this, CustomGroundArmorstand.this::spawn); } @Override @@ -343,13 +321,10 @@ public void launch(Vector vector) { @Override public void wear(final Player player) { - PetBlockHelper.wear(this, player, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); - for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); - } + PetBlockHelper.wear(this, player, location -> { + final PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (final Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); } }); } @@ -366,13 +341,10 @@ public ArmorStand getArmorStand() { @Override public void eject(final Player player) { - PetBlockHelper.eject(this, player, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); - for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); - } + PetBlockHelper.eject(this, player, location -> { + final PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (final Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); } }); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java index 8459d2902..54de28209 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java @@ -1,14 +1,14 @@ package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1; -import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; -import com.google.common.collect.Sets; import com.github.shynixn.petblocks.api.entities.CustomEntity; import com.github.shynixn.petblocks.api.entities.PetMeta; import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; -import net.minecraft.server.v1_11_R1.*; +import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; +import com.google.common.collect.Sets; +import net.minecraft.server.v1_12_R1.*; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_11_R1.CraftWorld; +import org.bukkit.craftbukkit.v1_12_R1.CraftWorld; import org.bukkit.entity.Player; import org.bukkit.entity.Rabbit; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; @@ -18,6 +18,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.logging.Level; public final class CustomRabbit extends EntityRabbit implements CustomEntity { private Player player; @@ -32,8 +33,8 @@ public CustomRabbit(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.setSilent(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); this.ignoreFinalField(bField); this.ignoreFinalField(cField); cField.setAccessible(true); @@ -44,8 +45,8 @@ public CustomRabbit(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petData = meta; @@ -54,20 +55,20 @@ public CustomRabbit(Player player, PetMeta meta) { private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); + final Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } @Override - protected SoundEffect di() { + protected SoundEffect dk() { this.playedMovingSound = PetBlockHelper.executeMovingSound(this.getBukkitEntity(), this.player, this.petData, this.playedMovingSound); - return super.di(); + return super.dk(); } @Override public void spawn(Location location) { - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.java index 065a94009..65abd0336 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.java @@ -1,14 +1,14 @@ package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1; +import com.github.shynixn.petblocks.api.entities.CustomEntity; import com.github.shynixn.petblocks.api.entities.PetMeta; +import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; import com.google.common.collect.Sets; -import com.github.shynixn.petblocks.api.entities.CustomEntity; -import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; -import net.minecraft.server.v1_11_R1.*; +import net.minecraft.server.v1_12_R1.*; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_11_R1.CraftWorld; +import org.bukkit.craftbukkit.v1_12_R1.CraftWorld; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.CreatureSpawnEvent; @@ -18,6 +18,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.logging.Level; /** * Created by Shynixn @@ -35,8 +36,8 @@ public CustomZombie(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.setSilent(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); this.ignoreFinalField(bField); this.ignoreFinalField(cField); cField.setAccessible(true); @@ -47,8 +48,8 @@ public CustomZombie(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petMeta = meta; @@ -57,7 +58,7 @@ public CustomZombie(Player player, PetMeta meta) { @Override public void spawn(Location location) { - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); @@ -83,7 +84,7 @@ private FixedMetadataValue getKeepField() { private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); + final Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.java index d23620b49..3040e5c48 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.java @@ -2,12 +2,12 @@ import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; -import net.minecraft.server.v1_11_R1.EntityInsentient; -import net.minecraft.server.v1_11_R1.NBTTagCompound; -import net.minecraft.server.v1_11_R1.PathEntity; -import net.minecraft.server.v1_11_R1.PathfinderGoal; +import net.minecraft.server.v1_12_R1.EntityInsentient; +import net.minecraft.server.v1_12_R1.NBTTagCompound; +import net.minecraft.server.v1_12_R1.PathEntity; +import net.minecraft.server.v1_12_R1.PathfinderGoal; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_11_R1.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; @@ -23,6 +23,7 @@ public final class OwnerPathfinder extends PathfinderGoal { private int counter; public OwnerPathfinder(EntityInsentient entitycreature, Player player) { + super(); this.entity = entitycreature; this.player = player; } @@ -36,8 +37,8 @@ public boolean a() { this.entity.getBukkitEntity().teleport(this.player.getLocation()); } else if (this.entity.getBukkitEntity().getLocation().distance(this.player.getLocation()) > 2) { this.counter2 = PetBlockHelper.afraidWaterEffect(this.entity.getBukkitEntity(), this.counter2); - Location targetLocation = this.player.getLocation(); - this.entity.getNavigation().n(); + final Location targetLocation = this.player.getLocation(); + this.entity.getNavigation().o(); this.entity.getNavigation(); this.path = this.entity.getNavigation().a(targetLocation.getX() + 1, targetLocation.getY(), targetLocation.getZ() + 1); this.entity.getNavigation(); @@ -68,14 +69,14 @@ public void c() { } public static boolean isUnbreakable(ItemStack itemStack) { - net.minecraft.server.v1_11_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + final net.minecraft.server.v1_12_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); return stack.getTag() != null && stack.getTag().hasKey("Unbreakable") && stack.getTag().getBoolean("Unbreakable"); } public static ItemStack setItemstackTag(ItemStack itemStack, Map tags) { - net.minecraft.server.v1_11_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); - for (String tag : tags.keySet()) { - NBTTagCompound nbtTagCompound; + final net.minecraft.server.v1_12_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + for (final String tag : tags.keySet()) { + final NBTTagCompound nbtTagCompound; if (stack.getTag() == null) nbtTagCompound = new NBTTagCompound(); else diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomGroundArmorstand.java index 911081693..54f70bd85 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomGroundArmorstand.java @@ -18,6 +18,7 @@ import org.bukkit.util.Vector; import java.lang.reflect.Field; +import java.util.logging.Level; final class CustomGroundArmorstand extends EntityArmorStand implements PetBlock { private PetMeta petMeta; @@ -55,13 +56,13 @@ public CustomGroundArmorstand(World world) { } private boolean isJumping() { - Field jump; + final Field jump; try { jump = EntityLiving.class.getDeclaredField("aW"); jump.setAccessible(true); return jump.getBoolean(this.passenger); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e1) { - e1.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", e1); } return false; } @@ -69,14 +70,11 @@ private boolean isJumping() { @Override protected void doTick() { if (this.isSpecial) { - this.counter = PetBlockHelper.doTick(this.counter, this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.counter = PetBlockHelper.doTick(this.counter, this, location -> { + CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + final PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -108,8 +106,8 @@ public void g(float sideMot, float forMot) { } this.ay = this.az; - double d0 = this.locX - this.lastX; - double d1 = this.locZ - this.lastZ; + final double d0 = this.locX - this.lastX; + final double d1 = this.locZ - this.lastZ; float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) { @@ -119,10 +117,10 @@ public void g(float sideMot, float forMot) { this.az += (f4 - this.az) * 0.4F; this.aA += this.az; } else { - float side = ((EntityLiving) this.passenger).aX * 0.5F; - float forw = ((EntityLiving) this.passenger).aY; - Vector v = new Vector(); - Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); + final float side = ((EntityLiving) this.passenger).aX * 0.5F; + final float forw = ((EntityLiving) this.passenger).aY; + final Vector v = new Vector(); + final Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); if (side < 0.0F) { l.setYaw(this.passenger.yaw - 90); v.add(l.getDirection().normalize().multiply(-0.5)); @@ -162,9 +160,9 @@ public void g(float sideMot, float forMot) { l.add(v.multiply(2.25).multiply(ConfigPet.getInstance().getModifier_petriding())); this.setPosition(l.getX(), l.getY(), l.getZ()); } - Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); - MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); + final Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); + final Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + final MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); if (movingobjectposition == null) { this.bumper = l.toVector(); } else { @@ -182,15 +180,15 @@ public void g(float sideMot, float forMot) { private Vector bumper; public void spawn(Location location) { - PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); + final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); Bukkit.getPluginManager().callEvent(event); if (!event.isCanceled()) { NMSRegistry.accessWorldGuardSpawn(location); this.rabbit.spawn(location); - net.minecraft.server.v1_8_R1.World mcWorld = ((org.bukkit.craftbukkit.v1_8_R1.CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_8_R1.World mcWorld = ((org.bukkit.craftbukkit.v1_8_R1.CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); - net.minecraft.server.v1_8_R1.NBTTagCompound compound = new net.minecraft.server.v1_8_R1.NBTTagCompound(); + final net.minecraft.server.v1_8_R1.NBTTagCompound compound = new net.minecraft.server.v1_8_R1.NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); @@ -214,10 +212,10 @@ public void spawn(Location location) { @Override public void teleportWithOwner(Location location) { - EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); + final EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); player.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); - for (Player player1 : this.owner.getWorld().getPlayers()) { + final PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); + for (final Player player1 : this.owner.getWorld().getPlayers()) { ((CraftPlayer) player1).getHandle().playerConnection.sendPacket(teleport); } } @@ -227,13 +225,10 @@ public void damage(double amount) { if (amount < -1.0) { this.hitflor = true; } else { - this.health = PetBlockHelper.setDamage(this, this.health, amount, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.health = PetBlockHelper.setDamage(this, this.health, amount, location -> { + final PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -241,12 +236,7 @@ public void run(Location location) { @Override public void respawn() { - PetBlockHelper.respawn(this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.spawn(location); - } - }); + PetBlockHelper.respawn(this, CustomGroundArmorstand.this::spawn); } @Override diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomRabbit.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomRabbit.java index 0283da771..24e44fd70 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomRabbit.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomRabbit.java @@ -17,6 +17,7 @@ import org.bukkit.potion.PotionEffectType; import java.lang.reflect.Field; +import java.util.logging.Level; public final class CustomRabbit extends EntityRabbit implements CustomEntity { private long playedMovingSound = 100000; @@ -36,9 +37,9 @@ public CustomRabbit(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.b(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); bField.setAccessible(true); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); cField.setAccessible(true); bField.set(this.goalSelector, new UnsafeList()); bField.set(this.targetSelector, new UnsafeList()); @@ -47,8 +48,8 @@ public CustomRabbit(Player player, PetMeta meta) { this.getAttributeInstance(GenericAttributes.d).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petMeta = meta; @@ -63,7 +64,7 @@ protected String ck() { @Override public void spawn(Location location) { - net.minecraft.server.v1_8_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_8_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomZombie.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomZombie.java index f3128fa19..63f12dc6e 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomZombie.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomZombie.java @@ -17,6 +17,7 @@ import org.bukkit.potion.PotionEffectType; import java.lang.reflect.Field; +import java.util.logging.Level; /** * Created by Shynixn @@ -34,9 +35,9 @@ public CustomZombie(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.b(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); bField.setAccessible(true); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); cField.setAccessible(true); bField.set(this.goalSelector, new UnsafeList()); bField.set(this.targetSelector, new UnsafeList()); @@ -45,8 +46,8 @@ public CustomZombie(Player player, PetMeta meta) { this.getAttributeInstance(GenericAttributes.d).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petMeta = meta; @@ -55,7 +56,7 @@ public CustomZombie(Player player, PetMeta meta) { @Override public void spawn(Location location) { - net.minecraft.server.v1_8_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_8_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/OwnerPathfinder.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/OwnerPathfinder.java index 180ccc155..31dc807f6 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/OwnerPathfinder.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/OwnerPathfinder.java @@ -22,6 +22,7 @@ public final class OwnerPathfinder extends PathfinderGoal { private int counter2; public OwnerPathfinder(EntityInsentient entitycreature, Player player) { + super(); this.entity = entitycreature; this.player = player; } @@ -35,7 +36,7 @@ public boolean a() { this.entity.getBukkitEntity().teleport(this.player.getLocation()); } else if (this.entity.getBukkitEntity().getLocation().distance(this.player.getLocation()) > 2) { this.counter2 = PetBlockHelper.afraidWaterEffect(this.entity.getBukkitEntity(), this.counter2); - Location targetLocation = this.player.getLocation(); + final Location targetLocation = this.player.getLocation(); this.entity.getNavigation().m(); this.entity.getNavigation(); this.path = this.entity.getNavigation().a(targetLocation.getX() + 1, targetLocation.getY(), targetLocation.getZ() + 1); @@ -59,7 +60,7 @@ public boolean a() { } public static boolean isUnbreakable(ItemStack itemStack) { - net.minecraft.server.v1_8_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + final net.minecraft.server.v1_8_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); return stack.getTag() != null && stack.getTag().hasKey("Unbreakable") && stack.getTag().getBoolean("Unbreakable"); } @@ -69,9 +70,9 @@ public void c() { } public static ItemStack setItemstackTag(ItemStack itemStack, Map tags) { - net.minecraft.server.v1_8_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); - for (String tag : tags.keySet()) { - NBTTagCompound nbtTagCompound; + final net.minecraft.server.v1_8_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + for (final String tag : tags.keySet()) { + final NBTTagCompound nbtTagCompound; if (stack.getTag() == null) nbtTagCompound = new NBTTagCompound(); else diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomGroundArmorstand.java index c67f7ca81..3fa3b6676 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomGroundArmorstand.java @@ -18,6 +18,7 @@ import org.bukkit.util.Vector; import java.lang.reflect.Field; +import java.util.logging.Level; final class CustomGroundArmorstand extends EntityArmorStand implements PetBlock { private PetMeta petMeta; @@ -55,13 +56,13 @@ public CustomGroundArmorstand(World world, double d0, double d1, double d2) { } private boolean isJumping() { - Field jump = null; + final Field jump; try { jump = EntityLiving.class.getDeclaredField("aY"); jump.setAccessible(true); return jump.getBoolean(this.passenger); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e1) { - e1.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", e1); } return false; } @@ -69,14 +70,11 @@ private boolean isJumping() { @Override protected void doTick() { if (this.isSpecial) { - this.counter = PetBlockHelper.doTick(this.counter, this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.counter = PetBlockHelper.doTick(this.counter, this, location -> { + CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + final PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -108,8 +106,8 @@ public void g(float sideMot, float forMot) { } this.aA = this.aB; - double d0 = this.locX - this.lastX; - double d1 = this.locZ - this.lastZ; + final double d0 = this.locX - this.lastX; + final double d1 = this.locZ - this.lastZ; float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) { @@ -119,10 +117,10 @@ public void g(float sideMot, float forMot) { this.aB += (f4 - this.aB) * 0.4F; this.aC += this.aB; } else { - float side = ((EntityLiving) this.passenger).aZ * 0.5F; - float forw = ((EntityLiving) this.passenger).ba; - Vector v = new Vector(); - Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); + final float side = ((EntityLiving) this.passenger).aZ * 0.5F; + final float forw = ((EntityLiving) this.passenger).ba; + final Vector v = new Vector(); + final Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); if (side < 0.0F) { l.setYaw(this.passenger.yaw - 90); v.add(l.getDirection().normalize().multiply(-0.5)); @@ -162,9 +160,9 @@ public void g(float sideMot, float forMot) { l.add(v.multiply(2.25).multiply(ConfigPet.getInstance().getModifier_petriding())); this.setPosition(l.getX(), l.getY(), l.getZ()); } - Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); - MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); + final Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); + final Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + final MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); if (movingobjectposition == null) { this.bumper = l.toVector(); } else { @@ -182,15 +180,15 @@ public void g(float sideMot, float forMot) { private Vector bumper; public void spawn(Location location) { - PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); + final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); Bukkit.getPluginManager().callEvent(event); if (!event.isCanceled()) { NMSRegistry.accessWorldGuardSpawn(location); this.rabbit.spawn(location); - net.minecraft.server.v1_8_R2.World mcWorld = ((org.bukkit.craftbukkit.v1_8_R2.CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_8_R2.World mcWorld = ((org.bukkit.craftbukkit.v1_8_R2.CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); - net.minecraft.server.v1_8_R2.NBTTagCompound compound = new net.minecraft.server.v1_8_R2.NBTTagCompound(); + final net.minecraft.server.v1_8_R2.NBTTagCompound compound = new net.minecraft.server.v1_8_R2.NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); @@ -214,10 +212,10 @@ public void spawn(Location location) { @Override public void teleportWithOwner(Location location) { - EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); + final EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); player.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); - for (Player player1 : this.owner.getWorld().getPlayers()) { + final PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); + for (final Player player1 : this.owner.getWorld().getPlayers()) { ((CraftPlayer) player1).getHandle().playerConnection.sendPacket(teleport); } } @@ -227,13 +225,10 @@ public void damage(double amount) { if (amount < -1.0) { this.hitflor = true; } else { - this.health = PetBlockHelper.setDamage(this, this.health, amount, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.health = PetBlockHelper.setDamage(this, this.health, amount, location -> { + final PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -241,12 +236,7 @@ public void run(Location location) { @Override public void respawn() { - PetBlockHelper.respawn(this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.spawn(location); - } - }); + PetBlockHelper.respawn(this, CustomGroundArmorstand.this::spawn); } @Override diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomRabbit.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomRabbit.java index a8f019533..ad10c1c18 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomRabbit.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomRabbit.java @@ -1,6 +1,7 @@ package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2; import java.lang.reflect.Field; +import java.util.logging.Level; import com.github.shynixn.petblocks.api.entities.PetMeta; import com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper; @@ -37,9 +38,9 @@ public CustomRabbit(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.b(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); bField.setAccessible(true); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); cField.setAccessible(true); bField.set(this.goalSelector, new UnsafeList()); bField.set(this.targetSelector, new UnsafeList()); @@ -49,8 +50,8 @@ public CustomRabbit(Player player, PetMeta meta) { this.getAttributeInstance(GenericAttributes.d).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petMeta = meta; @@ -65,7 +66,7 @@ protected String cm() { @Override public void spawn(Location location) { - net.minecraft.server.v1_8_R2.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_8_R2.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomZombie.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomZombie.java index 1bf82fc50..e9648ae2f 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomZombie.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomZombie.java @@ -17,6 +17,7 @@ import org.bukkit.potion.PotionEffectType; import java.lang.reflect.Field; +import java.util.logging.Level; /** * Created by Shynixn @@ -34,9 +35,9 @@ public CustomZombie(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.b(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); bField.setAccessible(true); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); cField.setAccessible(true); bField.set(this.goalSelector, new UnsafeList()); bField.set(this.targetSelector, new UnsafeList()); @@ -46,8 +47,8 @@ public CustomZombie(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petMeta = meta; @@ -56,7 +57,7 @@ public CustomZombie(Player player, PetMeta meta) { @Override public void spawn(Location location) { - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/OwnerPathfinder.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/OwnerPathfinder.java index d56fa5486..f56428ed9 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/OwnerPathfinder.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/OwnerPathfinder.java @@ -22,6 +22,7 @@ public final class OwnerPathfinder extends PathfinderGoal { private int counter2; public OwnerPathfinder(EntityInsentient entitycreature, Player player) { + super(); this.entity = entitycreature; this.player = player; } @@ -35,7 +36,7 @@ public boolean a() { this.entity.getBukkitEntity().teleport(this.player.getLocation()); } else if (this.entity.getBukkitEntity().getLocation().distance(this.player.getLocation()) > 2) { this.counter2 = PetBlockHelper.afraidWaterEffect(this.entity.getBukkitEntity(), this.counter2); - Location targetLocation = this.player.getLocation(); + final Location targetLocation = this.player.getLocation(); this.entity.getNavigation().m(); this.entity.getNavigation(); this.path = this.entity.getNavigation().a(targetLocation.getX() + 1, targetLocation.getY(), targetLocation.getZ() + 1); @@ -64,14 +65,14 @@ public void c() { } public static boolean isUnbreakable(ItemStack itemStack) { - net.minecraft.server.v1_8_R2.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + final net.minecraft.server.v1_8_R2.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); return stack.getTag() != null && stack.getTag().hasKey("Unbreakable") && stack.getTag().getBoolean("Unbreakable"); } public static ItemStack setItemstackTag(ItemStack itemStack, Map tags) { - net.minecraft.server.v1_8_R2.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); - for (String tag : tags.keySet()) { - NBTTagCompound nbtTagCompound; + final net.minecraft.server.v1_8_R2.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + for (final String tag : tags.keySet()) { + final NBTTagCompound nbtTagCompound; if (stack.getTag() == null) nbtTagCompound = new NBTTagCompound(); else diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomGroundArmorstand.java index d28a8972b..590308259 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomGroundArmorstand.java @@ -18,6 +18,7 @@ import org.bukkit.util.Vector; import java.lang.reflect.Field; +import java.util.logging.Level; final class CustomGroundArmorstand extends EntityArmorStand implements PetBlock { private PetMeta petMeta; @@ -55,13 +56,13 @@ else if (meta.getMovementType() == Movement.CRAWLING) } private boolean isJumping() { - Field jump = null; + final Field jump; try { jump = EntityLiving.class.getDeclaredField("aY"); jump.setAccessible(true); return jump.getBoolean(this.passenger); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e1) { - e1.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", e1); } return false; } @@ -69,14 +70,11 @@ private boolean isJumping() { @Override protected void doTick() { if (this.isSpecial) { - this.counter = PetBlockHelper.doTick(this.counter, this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.counter = PetBlockHelper.doTick(this.counter, this, location -> { + CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + final PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -98,8 +96,7 @@ public void g(float sideMot, float forMot) { forMot *= 0.25F; } if (this.onGround && this.isJumping()) { - double jumpHeight = 0.5D; - this.motY = jumpHeight; + this.motY = 0.5D; } this.S = (float) ConfigPet.getInstance().getModifier_petclimbing(); this.aM = (this.bI() * 0.1F); @@ -109,8 +106,8 @@ public void g(float sideMot, float forMot) { } this.aA = this.aB; - double d0 = this.locX - this.lastX; - double d1 = this.locZ - this.lastZ; + final double d0 = this.locX - this.lastX; + final double d1 = this.locZ - this.lastZ; float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) { @@ -120,10 +117,10 @@ public void g(float sideMot, float forMot) { this.aB += (f4 - this.aB) * 0.4F; this.aC += this.aB; } else { - float side = ((EntityLiving) this.passenger).aZ * 0.5F; - float forw = ((EntityLiving) this.passenger).ba; - Vector v = new Vector(); - Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); + final float side = ((EntityLiving) this.passenger).aZ * 0.5F; + final float forw = ((EntityLiving) this.passenger).ba; + final Vector v = new Vector(); + final Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); if (side < 0.0F) { l.setYaw(this.passenger.yaw - 90); v.add(l.getDirection().normalize().multiply(-0.5)); @@ -163,9 +160,9 @@ public void g(float sideMot, float forMot) { l.add(v.multiply(2.25).multiply(ConfigPet.getInstance().getModifier_petriding())); this.setPosition(l.getX(), l.getY(), l.getZ()); } - Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); - MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); + final Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); + final Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + final MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); if (movingobjectposition == null) { this.bumper = l.toVector(); } else { @@ -183,15 +180,15 @@ public void g(float sideMot, float forMot) { private Vector bumper; public void spawn(Location location) { - PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); + final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); Bukkit.getPluginManager().callEvent(event); if (!event.isCanceled()) { NMSRegistry.accessWorldGuardSpawn(location); this.rabbit.spawn(location); - net.minecraft.server.v1_8_R3.World mcWorld = ((org.bukkit.craftbukkit.v1_8_R3.CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_8_R3.World mcWorld = ((org.bukkit.craftbukkit.v1_8_R3.CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); - net.minecraft.server.v1_8_R3.NBTTagCompound compound = new net.minecraft.server.v1_8_R3.NBTTagCompound(); + final net.minecraft.server.v1_8_R3.NBTTagCompound compound = new net.minecraft.server.v1_8_R3.NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); @@ -215,10 +212,10 @@ public void spawn(Location location) { @Override public void teleportWithOwner(Location location) { - EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); + final EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); player.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); - for (Player player1 : this.owner.getWorld().getPlayers()) { + final PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); + for (final Player player1 : this.owner.getWorld().getPlayers()) { ((CraftPlayer) player1).getHandle().playerConnection.sendPacket(teleport); } } @@ -228,13 +225,10 @@ public void damage(double amount) { if (amount < -1.0) { this.hitflor = true; } else { - this.health = PetBlockHelper.setDamage(this, this.health, amount, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.health = PetBlockHelper.setDamage(this, this.health, amount, location -> { + final PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -242,12 +236,7 @@ public void run(Location location) { @Override public void respawn() { - PetBlockHelper.respawn(this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.spawn(location); - } - }); + PetBlockHelper.respawn(this, CustomGroundArmorstand.this::spawn); } @Override diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomRabbit.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomRabbit.java index 28b7bc197..3240e42f1 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomRabbit.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomRabbit.java @@ -1,6 +1,7 @@ package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3; import java.lang.reflect.Field; +import java.util.logging.Level; import com.github.shynixn.petblocks.api.entities.CustomEntity; import com.github.shynixn.petblocks.api.entities.PetMeta; @@ -33,9 +34,9 @@ public CustomRabbit(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.b(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); bField.setAccessible(true); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); cField.setAccessible(true); bField.set(this.goalSelector, new UnsafeList()); bField.set(this.targetSelector, new UnsafeList()); @@ -45,8 +46,8 @@ public CustomRabbit(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petData = meta; @@ -61,7 +62,7 @@ protected String cm() { @Override public void spawn(Location location) { - net.minecraft.server.v1_8_R3.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_8_R3.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomZombie.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomZombie.java index 08af5ce3f..2904a061c 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomZombie.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomZombie.java @@ -17,6 +17,7 @@ import org.bukkit.potion.PotionEffectType; import java.lang.reflect.Field; +import java.util.logging.Level; /** * Created by Shynixn @@ -34,9 +35,9 @@ public CustomZombie(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.b(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); bField.setAccessible(true); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); cField.setAccessible(true); bField.set(this.goalSelector, new UnsafeList()); bField.set(this.targetSelector, new UnsafeList()); @@ -46,8 +47,8 @@ public CustomZombie(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petMeta = meta; @@ -56,7 +57,7 @@ public CustomZombie(Player player, PetMeta meta) { @Override public void spawn(Location location) { - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/OwnerPathfinder.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/OwnerPathfinder.java index e575bca5e..a39fab1fd 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/OwnerPathfinder.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/OwnerPathfinder.java @@ -22,6 +22,7 @@ public final class OwnerPathfinder extends PathfinderGoal { private int counter2; public OwnerPathfinder(EntityInsentient entitycreature, Player player) { + super(); this.entity = entitycreature; this.player = player; } @@ -35,7 +36,7 @@ public boolean a() { this.entity.getBukkitEntity().teleport(this.player.getLocation()); } else if (this.entity.getBukkitEntity().getLocation().distance(this.player.getLocation()) > 2) { this.counter2 = PetBlockHelper.afraidWaterEffect(this.entity.getBukkitEntity(), this.counter2); - Location targetLocation = this.player.getLocation(); + final Location targetLocation = this.player.getLocation(); this.entity.getNavigation().m(); this.entity.getNavigation(); this.path = this.entity.getNavigation().a(targetLocation.getX() + 1, targetLocation.getY(), targetLocation.getZ() + 1); @@ -64,14 +65,14 @@ public void c() { } public static boolean isUnbreakable(ItemStack itemStack) { - net.minecraft.server.v1_8_R3.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + final net.minecraft.server.v1_8_R3.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); return stack.getTag() != null && stack.getTag().hasKey("Unbreakable") && stack.getTag().getBoolean("Unbreakable"); } public static ItemStack setItemstackTag(ItemStack itemStack, Map tags) { - net.minecraft.server.v1_8_R3.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); - for (String tag : tags.keySet()) { - NBTTagCompound nbtTagCompound; + final net.minecraft.server.v1_8_R3.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + for (final String tag : tags.keySet()) { + final NBTTagCompound nbtTagCompound; if (stack.getTag() == null) nbtTagCompound = new NBTTagCompound(); else diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomGroundArmorstand.java index cd4acb6f8..cff899531 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomGroundArmorstand.java @@ -19,6 +19,7 @@ import org.bukkit.util.Vector; import java.lang.reflect.Field; +import java.util.logging.Level; final class CustomGroundArmorstand extends EntityArmorStand implements PetBlock { private PetMeta petMeta; @@ -56,23 +57,23 @@ public CustomGroundArmorstand(World world, double d0, double d1, double d2) { } private boolean isJumping() { - Field jump; + final Field jump; try { jump = EntityLiving.class.getDeclaredField("bc"); jump.setAccessible(true); - for (net.minecraft.server.v1_9_R1.Entity entity : this.passengers) { + for (final net.minecraft.server.v1_9_R1.Entity entity : this.passengers) { return jump.getBoolean(entity); } return false; } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e1) { - e1.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", e1); } return false; } private EntityHuman hasHumanPassenger() { if (this.passengers != null) { - for (net.minecraft.server.v1_9_R1.Entity entity : this.passengers) { + for (final net.minecraft.server.v1_9_R1.Entity entity : this.passengers) { if (entity instanceof EntityHuman) return (EntityHuman) entity; } @@ -83,14 +84,11 @@ private EntityHuman hasHumanPassenger() { @Override protected void doTick() { if (this.isSpecial) { - this.counter = PetBlockHelper.doTick(this.counter, this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.counter = PetBlockHelper.doTick(this.counter, this, location -> { + CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + final PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -112,8 +110,7 @@ public void g(float sideMot, float forMot) { forMot *= 0.25F; } if (this.onGround && this.isJumping()) { - double jumpHeight = 0.5D; - this.motY = jumpHeight; + this.motY = 0.5D; } this.P = (float) ConfigPet.getInstance().getModifier_petclimbing(); this.aQ = (this.ck() * 0.1F); @@ -122,8 +119,8 @@ public void g(float sideMot, float forMot) { super.g(sideMot * (float) ConfigPet.getInstance().getModifier_petriding(), forMot * (float) ConfigPet.getInstance().getModifier_petriding()); } this.aE = this.aF; - double d0 = this.locX - this.lastX; - double d1 = this.locZ - this.lastZ; + final double d0 = this.locX - this.lastX; + final double d1 = this.locZ - this.lastZ; float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) { @@ -133,10 +130,10 @@ public void g(float sideMot, float forMot) { this.aF += (f4 - this.aF) * 0.4F; this.aG += this.aF; } else { - float side = this.hasHumanPassenger().bd * 0.5F; - float forw = this.hasHumanPassenger().be; - Vector v = new Vector(); - Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); + final float side = this.hasHumanPassenger().bd * 0.5F; + final float forw = this.hasHumanPassenger().be; + final Vector v = new Vector(); + final Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); if (side < 0.0F) { l.setYaw(this.hasHumanPassenger().yaw - 90); v.add(l.getDirection().normalize().multiply(-0.5)); @@ -176,9 +173,9 @@ public void g(float sideMot, float forMot) { l.add(v.multiply(2.25).multiply(ConfigPet.getInstance().getModifier_petriding())); this.setPosition(l.getX(), l.getY(), l.getZ()); } - Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); - MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); + final Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); + final Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + final MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); if (movingobjectposition == null) { this.bumper = l.toVector(); } else { @@ -196,15 +193,15 @@ public void g(float sideMot, float forMot) { private Vector bumper; public void spawn(Location location) { - PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); + final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); Bukkit.getPluginManager().callEvent(event); if (!event.isCanceled()) { NMSRegistry.accessWorldGuardSpawn(location); this.rabbit.spawn(location); - net.minecraft.server.v1_9_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_9_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); - NBTTagCompound compound = new NBTTagCompound(); + final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); @@ -228,10 +225,10 @@ public void spawn(Location location) { @Override public void teleportWithOwner(Location location) { - EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); + final EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); player.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); - for (Player player1 : this.owner.getWorld().getPlayers()) { + final PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); + for (final Player player1 : this.owner.getWorld().getPlayers()) { ((CraftPlayer) player1).getHandle().playerConnection.sendPacket(teleport); } } @@ -241,13 +238,10 @@ public void damage(double amount) { if (amount < -1.0) { this.hitflor = true; } else { - this.health = PetBlockHelper.setDamage(this, this.health, amount, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.health = PetBlockHelper.setDamage(this, this.health, amount, location -> { + final PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -255,12 +249,7 @@ public void run(Location location) { @Override public void respawn() { - PetBlockHelper.respawn(this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.spawn(location); - } - }); + PetBlockHelper.respawn(this, CustomGroundArmorstand.this::spawn); } @Override @@ -332,13 +321,10 @@ public void launch(Vector vector) { @Override public void wear(final Player player) { - PetBlockHelper.wear(this, player, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); - for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); - } + PetBlockHelper.wear(this, player, location -> { + final PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (final Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); } }); } @@ -355,13 +341,10 @@ public ArmorStand getArmorStand() { @Override public void eject(final Player player) { - PetBlockHelper.eject(this, player, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); - for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); - } + PetBlockHelper.eject(this, player, location -> { + final PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (final Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); } }); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomRabbit.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomRabbit.java index 8f7c2000b..4abed68f1 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomRabbit.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomRabbit.java @@ -18,6 +18,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.logging.Level; public final class CustomRabbit extends EntityRabbit implements CustomEntity { private Player player; @@ -33,8 +34,8 @@ public CustomRabbit(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.c(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); this.ignoreFinalField(bField); this.ignoreFinalField(cField); cField.setAccessible(true); @@ -45,8 +46,8 @@ public CustomRabbit(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petData = meta; @@ -55,7 +56,7 @@ public CustomRabbit(Player player, PetMeta meta) { private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); + final Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } @@ -68,7 +69,7 @@ protected SoundEffect da() { @Override public void spawn(Location location) { - net.minecraft.server.v1_9_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_9_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomZombie.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomZombie.java index 56c362e65..0c7b675fd 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomZombie.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomZombie.java @@ -18,6 +18,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.logging.Level; /** * Created by Shynixn @@ -35,8 +36,8 @@ public CustomZombie(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.c(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); this.ignoreFinalField(bField); this.ignoreFinalField(cField); cField.setAccessible(true); @@ -47,8 +48,8 @@ public CustomZombie(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petMeta = meta; @@ -57,7 +58,7 @@ public CustomZombie(Player player, PetMeta meta) { @Override public void spawn(Location location) { - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); @@ -83,7 +84,7 @@ private FixedMetadataValue getKeepField() { private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); + final Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/OwnerPathfinder.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/OwnerPathfinder.java index d8f034d2c..f1ef8a85b 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/OwnerPathfinder.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/OwnerPathfinder.java @@ -22,6 +22,7 @@ public final class OwnerPathfinder extends PathfinderGoal { private int counter2; public OwnerPathfinder(EntityInsentient entitycreature, Player player) { + super(); this.entity = entitycreature; this.player = player; } @@ -35,7 +36,7 @@ public boolean a() { this.entity.getBukkitEntity().teleport(this.player.getLocation()); } else if (this.entity.getBukkitEntity().getLocation().distance(this.player.getLocation()) > 2) { this.counter2 = PetBlockHelper.afraidWaterEffect(this.entity.getBukkitEntity(), this.counter2); - Location targetLocation = this.player.getLocation(); + final Location targetLocation = this.player.getLocation(); this.entity.getNavigation().n(); this.entity.getNavigation(); this.path = this.entity.getNavigation().a(targetLocation.getX() + 1, targetLocation.getY(), targetLocation.getZ() + 1); @@ -67,14 +68,14 @@ public void c() { } public static boolean isUnbreakable(ItemStack itemStack) { - net.minecraft.server.v1_9_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + final net.minecraft.server.v1_9_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); return stack.getTag() != null && stack.getTag().hasKey("Unbreakable") && stack.getTag().getBoolean("Unbreakable"); } public static ItemStack setItemstackTag(ItemStack itemStack, Map tags) { - net.minecraft.server.v1_9_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); - for (String tag : tags.keySet()) { - NBTTagCompound nbtTagCompound; + final net.minecraft.server.v1_9_R1.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + for (final String tag : tags.keySet()) { + final NBTTagCompound nbtTagCompound; if (stack.getTag() == null) nbtTagCompound = new NBTTagCompound(); else diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomGroundArmorstand.java index 914425ce9..ac4385272 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomGroundArmorstand.java @@ -19,6 +19,7 @@ import org.bukkit.util.Vector; import java.lang.reflect.Field; +import java.util.logging.Level; final class CustomGroundArmorstand extends EntityArmorStand implements PetBlock { private PetMeta petMeta; @@ -56,23 +57,23 @@ public CustomGroundArmorstand(World world, double d0, double d1, double d2) { } private boolean isJumping() { - Field jump = null; + final Field jump; try { jump = EntityLiving.class.getDeclaredField("bd"); jump.setAccessible(true); - for (net.minecraft.server.v1_9_R2.Entity entity : this.passengers) { + for (final net.minecraft.server.v1_9_R2.Entity entity : this.passengers) { return jump.getBoolean(entity); } return false; } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e1) { - e1.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", e1); } return false; } private EntityHuman hasHumanPassenger() { if (this.passengers != null) { - for (net.minecraft.server.v1_9_R2.Entity entity : this.passengers) { + for (final net.minecraft.server.v1_9_R2.Entity entity : this.passengers) { if (entity instanceof EntityHuman) return (EntityHuman) entity; } @@ -83,14 +84,11 @@ private EntityHuman hasHumanPassenger() { @Override protected void doTick() { if (this.isSpecial) { - this.counter = PetBlockHelper.doTick(this.counter, this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.counter = PetBlockHelper.doTick(this.counter, this, location -> { + CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + final PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -121,8 +119,8 @@ public void g(float sideMot, float forMot) { super.g(sideMot * (float) ConfigPet.getInstance().getModifier_petriding(), forMot * (float) ConfigPet.getInstance().getModifier_petriding()); } this.aF = this.aG; - double d0 = this.locX - this.lastX; - double d1 = this.locZ - this.lastZ; + final double d0 = this.locX - this.lastX; + final double d1 = this.locZ - this.lastZ; float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) { @@ -132,10 +130,10 @@ public void g(float sideMot, float forMot) { this.aG += (f4 - this.aG) * 0.4F; this.aH += this.aG; } else { - float side = this.hasHumanPassenger().be * 0.5F; - float forw = this.hasHumanPassenger().bf; - Vector v = new Vector(); - Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); + final float side = this.hasHumanPassenger().be * 0.5F; + final float forw = this.hasHumanPassenger().bf; + final Vector v = new Vector(); + final Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); if (side < 0.0F) { l.setYaw(this.hasHumanPassenger().yaw - 90); v.add(l.getDirection().normalize().multiply(-0.5)); @@ -175,9 +173,9 @@ public void g(float sideMot, float forMot) { l.add(v.multiply(2.25).multiply(ConfigPet.getInstance().getModifier_petriding())); this.setPosition(l.getX(), l.getY(), l.getZ()); } - Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); - Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); - MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); + final Vec3D vec3d = new Vec3D(this.locX, this.locY, this.locZ); + final Vec3D vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); + final MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1); if (movingobjectposition == null) { this.bumper = l.toVector(); } else { @@ -195,15 +193,15 @@ public void g(float sideMot, float forMot) { private Vector bumper; public void spawn(Location location) { - PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); + final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this); Bukkit.getPluginManager().callEvent(event); if (!event.isCanceled()) { NMSRegistry.accessWorldGuardSpawn(location); this.rabbit.spawn(location); - net.minecraft.server.v1_9_R2.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_9_R2.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); - NBTTagCompound compound = new NBTTagCompound(); + final NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean("invulnerable", true); compound.setBoolean("Invisible", true); compound.setBoolean("PersistenceRequired", true); @@ -227,10 +225,10 @@ public void spawn(Location location) { @Override public void teleportWithOwner(Location location) { - EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); + final EntityPlayer player = ((CraftPlayer) this.owner).getHandle(); player.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); - for (Player player1 : this.owner.getWorld().getPlayers()) { + final PacketPlayOutEntityTeleport teleport = new PacketPlayOutEntityTeleport(player); + for (final Player player1 : this.owner.getWorld().getPlayers()) { ((CraftPlayer) player1).getHandle().playerConnection.sendPacket(teleport); } } @@ -245,13 +243,10 @@ public void damage(double amount) { if (amount < -1.0) { this.hitflor = true; } else { - this.health = PetBlockHelper.setDamage(this, this.health, amount, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); - for (Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); - } + this.health = PetBlockHelper.setDamage(this, this.health, amount, location -> { + final PacketPlayOutAnimation animation = new PacketPlayOutAnimation(CustomGroundArmorstand.this, 1); + for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } }); } @@ -259,12 +254,7 @@ public void run(Location location) { @Override public void respawn() { - PetBlockHelper.respawn(this, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - CustomGroundArmorstand.this.spawn(location); - } - }); + PetBlockHelper.respawn(this, CustomGroundArmorstand.this::spawn); } @Override @@ -331,13 +321,10 @@ public void launch(Vector vector) { @Override public void wear(final Player player) { - PetBlockHelper.wear(this, player, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); - for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); - } + PetBlockHelper.wear(this, player, location -> { + final PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (final Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); } }); } @@ -354,13 +341,10 @@ public ArmorStand getArmorStand() { @Override public void eject(final Player player) { - PetBlockHelper.eject(this, player, new PetBlockHelper.TickCallBack() { - @Override - public void run(Location location) { - PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); - for (Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { - ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); - } + PetBlockHelper.eject(this, player, location -> { + final PacketPlayOutMount animation = new PacketPlayOutMount(((CraftPlayer) player).getHandle()); + for (final Player player2 : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { + ((CraftPlayer) player2).getHandle().playerConnection.sendPacket(animation); } }); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomRabbit.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomRabbit.java index 51f583d1f..9f2474f94 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomRabbit.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomRabbit.java @@ -18,6 +18,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.logging.Level; public final class CustomRabbit extends EntityRabbit implements CustomEntity { private Player player; @@ -33,8 +34,8 @@ public CustomRabbit(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.c(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); this.ignoreFinalField(bField); this.ignoreFinalField(cField); cField.setAccessible(true); @@ -45,8 +46,8 @@ public CustomRabbit(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petData = meta; @@ -55,7 +56,7 @@ public CustomRabbit(Player player, PetMeta meta) { private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); + final Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } @@ -68,7 +69,7 @@ protected SoundEffect db() { @Override public void spawn(Location location) { - net.minecraft.server.v1_9_R2.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final net.minecraft.server.v1_9_R2.World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomZombie.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomZombie.java index 4d86dcafe..08cd9f36a 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomZombie.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomZombie.java @@ -18,6 +18,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.logging.Level; /** * Created by Shynixn @@ -35,8 +36,8 @@ public CustomZombie(Player player, PetMeta meta) { super(((CraftWorld) player.getWorld()).getHandle()); this.c(true); try { - Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); - Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); + final Field bField = PathfinderGoalSelector.class.getDeclaredField("b"); + final Field cField = PathfinderGoalSelector.class.getDeclaredField("c"); this.ignoreFinalField(bField); this.ignoreFinalField(cField); cField.setAccessible(true); @@ -47,8 +48,8 @@ public CustomZombie(Player player, PetMeta meta) { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new OwnerPathfinder(this, player)); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D * ConfigPet.getInstance().getModifier_petwalking()); - } catch (Exception exc) { - exc.printStackTrace(); + } catch (final Exception exc) { + Bukkit.getLogger().log(Level.WARNING, "EntityNMS exception.", exc); } this.player = player; this.petMeta = meta; @@ -57,7 +58,7 @@ public CustomZombie(Player player, PetMeta meta) { @Override public void spawn(Location location) { - World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); + final World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); this.setPosition(location.getX(), location.getY(), location.getZ()); mcWorld.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM); this.getSpigotEntity().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9999999, 1)); @@ -83,7 +84,7 @@ private FixedMetadataValue getKeepField() { private void ignoreFinalField(Field field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { field.setAccessible(true); - Field modifiersField = Field.class.getDeclaredField("modifiers"); + final Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/OwnerPathfinder.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/OwnerPathfinder.java index 5f41d46a4..ed34d8baa 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/OwnerPathfinder.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/OwnerPathfinder.java @@ -22,6 +22,7 @@ public final class OwnerPathfinder extends PathfinderGoal { private int counter2; public OwnerPathfinder(EntityInsentient entitycreature, Player player) { + super(); this.entity = entitycreature; this.player = player; } @@ -35,7 +36,7 @@ public boolean a() { this.entity.getBukkitEntity().teleport(this.player.getLocation()); } else if (this.entity.getBukkitEntity().getLocation().distance(this.player.getLocation()) > 2) { this.counter2 = PetBlockHelper.afraidWaterEffect(this.entity.getBukkitEntity(), this.counter2); - Location targetLocation = this.player.getLocation(); + final Location targetLocation = this.player.getLocation(); this.entity.getNavigation().n(); this.entity.getNavigation(); this.path = this.entity.getNavigation().a(targetLocation.getX() + 1, targetLocation.getY(), targetLocation.getZ() + 1); @@ -67,14 +68,14 @@ public void c() { } public static boolean isUnbreakable(ItemStack itemStack) { - net.minecraft.server.v1_9_R2.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + final net.minecraft.server.v1_9_R2.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); return stack.getTag() != null && stack.getTag().hasKey("Unbreakable") && stack.getTag().getBoolean("Unbreakable"); } public static ItemStack setItemstackTag(ItemStack itemStack, Map tags) { - net.minecraft.server.v1_9_R2.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); - for (String tag : tags.keySet()) { - NBTTagCompound nbtTagCompound; + final net.minecraft.server.v1_9_R2.ItemStack stack = CraftItemStack.asNMSCopy(itemStack); + for (final String tag : tags.keySet()) { + final NBTTagCompound nbtTagCompound; if (stack.getTag() == null) nbtTagCompound = new NBTTagCompound(); else diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java index f643d9682..b4b5e7f98 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java @@ -158,7 +158,7 @@ private void killNextCommand(Player sender) { } if (nearest != null) { nearest.remove(); - sender.sendMessage(Language.PREFIX + "" + ChatColor.GREEN + "You removed entity " + nearest.getType() + "."); + sender.sendMessage(Language.PREFIX + "" + ChatColor.GREEN + "You removed entity " + nearest.getType() + '.'); } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java index a7125ed2a..78c912487 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java @@ -115,13 +115,7 @@ public void onPlayerTeleportEvent(final PlayerTeleportEvent event) { public void onPlayerRespawnEvent(final PlayerRespawnEvent event) { if (this.manager.hasPetBlock(event.getPlayer())) { this.manager.removePetBlock(event.getPlayer()); - this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { - - @Override - public void run() { - PetBlockListener.this.manager.setPetBlock(event.getPlayer(), PetBlockListener.this.manager.dataManager.getPetMeta(event.getPlayer()), ConfigPet.getInstance().getWarpDelay()); - } - }, 60L); + this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), () -> PetBlockListener.this.manager.setPetBlock(event.getPlayer(), PetBlockListener.this.manager.dataManager.getPetMeta(event.getPlayer()), ConfigPet.getInstance().getWarpDelay()), 60L); } } @@ -164,12 +158,7 @@ public void entityRightClickEvent(final PlayerInteractAtEntityEvent event) { else Interpreter19.getItemInHand19(event.getPlayer(), false).setAmount(Interpreter19.getItemInHand19(event.getPlayer(), false).getAmount() - 1); if (!this.jumped.contains(petBlock)) { - this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), new Runnable() { - @Override - public void run() { - PetBlockListener.this.jumped.remove(PetBlockListener.this.getPet(event.getRightClicked())); - } - }, 20L); + this.getPlugin().getServer().getScheduler().runTaskLater(this.getPlugin(), () -> PetBlockListener.this.jumped.remove(PetBlockListener.this.getPet(event.getRightClicked())), 20L); this.jumped.add(this.getPet(event.getRightClicked())); petBlock.jump(); } @@ -342,9 +331,9 @@ public void run() { } } if (counter == 1) - BukkitUtilities.sendColorMessage("PetHunter " + ChatColor.GREEN + ">" + ChatColor.YELLOW + " Removed " + counter + " pet.", ChatColor.YELLOW, PetBlocksPlugin.PREFIX_CONSOLE); + BukkitUtilities.sendColorMessage("PetHunter " + ChatColor.GREEN + '>' + ChatColor.YELLOW + " Removed " + counter + " pet.", ChatColor.YELLOW, PetBlocksPlugin.PREFIX_CONSOLE); else if (counter > 0) - BukkitUtilities.sendColorMessage("PetHunter " + ChatColor.GREEN + ">" + ChatColor.YELLOW + " Removed " + counter + " pet.", ChatColor.YELLOW, PetBlocksPlugin.PREFIX_CONSOLE); + BukkitUtilities.sendColorMessage("PetHunter " + ChatColor.GREEN + '>' + ChatColor.YELLOW + " Removed " + counter + " pet.", ChatColor.YELLOW, PetBlocksPlugin.PREFIX_CONSOLE); } } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java index 3980ee7c5..0fbec1713 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java @@ -50,12 +50,7 @@ public void setPetBlock(final Player player, final PetMeta petMeta, int delay) { if (delay == 0) { this.petblocks.put(player, NMSRegistry.createPetBlock(player.getLocation(), petMeta)); } else { - this.plugin.getServer().getScheduler().runTaskLater(this.plugin, new Runnable() { - @Override - public void run() { - PetBlockManager.this.petblocks.put(player, NMSRegistry.createPetBlock(player.getLocation(), petMeta)); - } - }, 20 * delay); + this.plugin.getServer().getScheduler().runTaskLater(this.plugin, () -> PetBlockManager.this.petblocks.put(player, NMSRegistry.createPetBlock(player.getLocation(), petMeta)), 20 * delay); } } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java index 6189d5728..863c0ca10 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java @@ -209,7 +209,7 @@ public void playerJoinEvent(final PlayerJoinEvent event) { if (Config.getInstance().isJoin_enabled()) { if (!this.manager.hasPetMeta(event.getPlayer()) || Config.getInstance().isJoin_overwriteExistingPet()) { final PetMeta meta = this.manager.createPetMeta(event.getPlayer(), PetType.CAT); - Config.getInstance().fixJoinDefaultPet(meta); + Config.getInstance().fixJoinDefaultPet((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)meta); this.manager.persist((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)meta); } } else { diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.java b/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.java index 5808ffde2..bf84613d4 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.java @@ -5,6 +5,7 @@ import com.github.shynixn.petblocks.business.Language; import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; import com.github.shynixn.petblocks.lib.BukkitUtilities; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.configuration.file.FileConfiguration; @@ -15,6 +16,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.logging.Level; /** * Created by Shynixn @@ -236,15 +238,15 @@ public ItemContainer getItems_ridingpetContainer() { } private ItemStack[] resolveItems(List texts) { - ArrayList itemStacks = new ArrayList<>(); - for (String s : texts) { + final ArrayList itemStacks = new ArrayList<>(); + for (final String s : texts) { try { int i = 0; ItemStack itemStack = null; if (BukkitUtilities.tryParseInt(s)) { itemStack = new ItemStack(Material.getMaterial(Integer.parseInt(s))); } else if (s.contains(":")) { - String[] parts = s.split(":"); + final String[] parts = s.split(":"); boolean skull = false; if (parts[0].equalsIgnoreCase("skull")) { skull = true; @@ -259,13 +261,13 @@ private ItemStack[] resolveItems(List texts) { } for (; i < parts.length; i++) { if (parts[i].equalsIgnoreCase("unbreakable")) { - Map data = new HashMap<>(); + final Map data = new HashMap<>(); data.put("Unbreakable", true); itemStack = NMSRegistry.setItemStackTag(itemStack, data); } if (parts[i].equalsIgnoreCase("lore")) { i++; - List lore = new ArrayList<>(); + final List lore = new ArrayList<>(); for (; i < parts.length; i++) { if (parts[i].equalsIgnoreCase("unbreakable")) { i--; @@ -275,7 +277,7 @@ private ItemStack[] resolveItems(List texts) { } } if (itemStack != null) { - ItemMeta meta = itemStack.getItemMeta(); + final ItemMeta meta = itemStack.getItemMeta(); meta.setLore(lore); itemStack.setItemMeta(meta); } @@ -292,13 +294,13 @@ private ItemStack[] resolveItems(List texts) { } } itemStacks.add(itemStack); - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Bukkit.getLogger().log(Level.WARNING, "Failed to enable registry.", e); } } for (int i = 0; i < itemStacks.size(); i++) { BukkitUtilities.nameItemDisplay(itemStacks.get(i), Language.NUMBER_PREFIX + "" + i + ""); } - return itemStacks.toArray(new ItemStack[0]); + return itemStacks.toArray(new ItemStack[itemStacks.size()]); } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.java b/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.java index 8a3b5c841..61f2b4b3a 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.java @@ -46,7 +46,7 @@ public void load(FileConfiguration c) { } final ItemStack[] itemStacks = new ItemStack[54]; for (int i = 0; i < itemStacks.length; i++) { - for (CustomItemContainer.ParticleItemContainer container : containers) { + for (final CustomItemContainer.ParticleItemContainer container : containers) { if (container.getPosition() == i) { itemStacks[i] = container.generate(); BukkitUtilities.nameItemDisplay(itemStacks[i], Language.NUMBER_PREFIX + "" + i + ""); @@ -67,7 +67,7 @@ public Particle getParticle(int slot) { private CustomItemContainer.ParticleItemContainer getParticleItemContainer(int number, FileConfiguration c) { try { - final String s = "particles." + number + "."; + final String s = "particles." + number + '.'; final String a = s + "effect."; return new CustomItemContainer.ParticleItemContainer(c.getInt(s + "id"), c.getInt(s + "damage"), c.getString(s + "owner"), number, c.getString(s + "lore"), true, "", this.getParticleForContainer(a, c)); } catch (final Exception e) { diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/CustomItemContainer.java b/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/CustomItemContainer.java index 769922c3c..8698c8b58 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/CustomItemContainer.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/CustomItemContainer.java @@ -105,9 +105,9 @@ public String[] getLore(Player player, Permission... permission) { return null; if (this.loreName != null && this.loreName.contains("")) { if (this.hasPermission(player, permission)) - return this.toLines(this.loreName.toString().replace("", Language.ICO_PERMS_YES)); + return this.toLines(this.loreName.replace("", Language.ICO_PERMS_YES)); else - return this.toLines(this.loreName.toString().replace("", Language.ICO_PERMS_NO)); + return this.toLines(this.loreName.replace("", Language.ICO_PERMS_NO)); } return this.toLines(this.loreName); } @@ -118,9 +118,9 @@ public String[] getLore(Player player, String... permission) { return null; if (this.loreName != null && this.loreName.contains("")) { if (this.hasPermission(player, permission)) - return this.toLines(this.loreName.toString().replace("", Language.ICO_PERMS_YES)); + return this.toLines(this.loreName.replace("", Language.ICO_PERMS_YES)); else - return this.toLines(this.loreName.toString().replace("", Language.ICO_PERMS_NO)); + return this.toLines(this.loreName.replace("", Language.ICO_PERMS_NO)); } return this.toLines(this.loreName); } @@ -153,7 +153,7 @@ public ItemStack generate() { if (this.skullName.contains("textures.minecraft.net")) { itemStack = NMSRegistry.changeSkullSkin(itemStack, "http://" + this.skullName); } else { - SkullMeta meta = (SkullMeta) itemStack.getItemMeta(); + final SkullMeta meta = (SkullMeta) itemStack.getItemMeta(); meta.setOwner(this.skullName); itemStack.setItemMeta(meta); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java index 34fbb5bc3..75efdeb8f 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java @@ -46,19 +46,19 @@ public synchronized static void initialize(Plugin plugin) { return; if (plugin == null) throw new IllegalArgumentException("Plugin cannot be null!"); - ExtensionHikariConnectionContext.SQlRetriever retriever = (ExtensionHikariConnectionContext.SQlRetriever) fileName -> { + final ExtensionHikariConnectionContext.SQlRetriever retriever = fileName -> { try (InputStream stream = plugin.getResource("sql/" + fileName + ".sql")) { return IOUtils.toString(stream, "UTF-8"); } catch (final IOException e) { Bukkit.getLogger().log(Level.WARNING, "Cannot read file.", fileName); - throw new RuntimeException(); + throw new RuntimeException(e); } }; if (plugin.getConfig().getBoolean("sql.local")) { try { if (!plugin.getDataFolder().exists()) plugin.getDataFolder().mkdir(); - File file = new File(plugin.getDataFolder(), "PetBlocks.db"); + final File file = new File(plugin.getDataFolder(), "PetBlocks.db"); if (!file.exists()) file.createNewFile(); connectionContext = ExtensionHikariConnectionContext.from(ExtensionHikariConnectionContext.SQLITE_DRIVER, "jdbc:sqlite:" + file.getAbsolutePath(), retriever); @@ -71,15 +71,14 @@ public synchronized static void initialize(Plugin plugin) { Bukkit.getLogger().log(Level.WARNING, "Cannot read file.", e); } try (Connection connection = connectionContext.getConnection()) { - for (String data : connectionContext.getStringFromFile("create-sqlite").split(Pattern.quote(";"))) { - System.out.println("EXECUTE " + data); + for (final String data : connectionContext.getStringFromFile("create-sqlite").split(Pattern.quote(";"))) { connectionContext.executeUpdate(data, connection); } - } catch (Exception e) { + } catch (final Exception e) { Bukkit.getLogger().log(Level.WARNING, "Cannot execute exception.", e); } } else { - FileConfiguration c = plugin.getConfig(); + final FileConfiguration c = plugin.getConfig(); try { connectionContext = ExtensionHikariConnectionContext.from(ExtensionHikariConnectionContext.MYSQL_DRIVER, "jdbc:mysql://" , c.getString("sql.host") @@ -88,17 +87,14 @@ public synchronized static void initialize(Plugin plugin) { , c.getString("sql.username") , c.getString("sql.password") , retriever); - } catch (IOException e) { - e.printStackTrace(); + } catch (final IOException e) { Bukkit.getLogger().log(Level.WARNING, "Cannot read file.", e); } try (Connection connection = connectionContext.getConnection()) { - for (String data : connectionContext.getStringFromFile("create-mysql").split(Pattern.quote(";"))) { - System.out.println("EXECUTE " + data); + for (final String data : connectionContext.getStringFromFile("create-mysql").split(Pattern.quote(";"))) { connectionContext.executeUpdate(data, connection); } - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { Bukkit.getLogger().log(Level.WARNING, "Cannot execute exception.", e); } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java index e34baaf49..7320a1acf 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java @@ -5,6 +5,7 @@ import com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData; import com.github.shynixn.petblocks.lib.DataBaseRepository; import com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext; +import org.bukkit.Bukkit; import org.bukkit.Material; import java.io.Closeable; @@ -14,6 +15,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; public class ParticleEffectDataRepository extends DataBaseRepository implements ParticleEffectMetaController { @@ -45,13 +47,12 @@ public ParticleEffectMeta getById(long id) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("particle/selectbyid", connection, id)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - return this.from(resultSet); - } + resultSet.next(); + return this.from(resultSet); } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } return null; } @@ -79,13 +80,13 @@ public List select() { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("particle/selectall", connection)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - final ParticleEffectMeta data = from(resultSet); + final ParticleEffectMeta data = this.from(resultSet); items.add(data); } } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } return items; } @@ -111,8 +112,8 @@ public void update(ParticleEffectMeta item) { materialName, (int)item.getData(), item.getId()); - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } } @@ -123,13 +124,11 @@ public void update(ParticleEffectMeta item) { */ @Override public void delete(ParticleEffectMeta item) { - System.out.println("EXEUCTED DELETE OF " + item.getId()); try (Connection connection = this.dbContext.getConnection()) { this.dbContext.executeStoredUpdate("particle/delete", connection, item.getId()); - System.out.println("EXEUCTED DELETE OF " + item.getId()); - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } } @@ -154,8 +153,8 @@ public void insert(ParticleEffectMeta item) { materialName, item.getData()); ((ParticleEffectData)item).setId(id); - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } } @@ -167,13 +166,12 @@ public int size() { try (Connection connection = this.dbContext.getConnection()) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("particle/count", connection)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - return resultSet.getInt(1); - } + resultSet.next(); + return resultSet.getInt(1); } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } return 0; } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java index 1358b0eaa..3fd36ab42 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java @@ -8,6 +8,7 @@ import com.github.shynixn.petblocks.business.logic.persistence.entity.PetData; import com.github.shynixn.petblocks.lib.DataBaseRepository; import com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -18,6 +19,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; /** * Created by Shynixn @@ -43,13 +45,12 @@ public PetMeta getByPlayer(Player player) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/selectbyplayer", connection, player.getUniqueId().toString())) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - return from(resultSet); - } + resultSet.next(); + return this.from(resultSet); } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } return null; } @@ -66,13 +67,11 @@ public boolean hasEntry(Player player) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/selectentrybyplayer", connection, player.getUniqueId().toString())) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - return true; - } + return resultSet.next(); } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } return false; } @@ -89,13 +88,12 @@ public PetMeta getById(long id) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/selectbyid", connection, id)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - return from(resultSet); - } + resultSet.next(); + return this.from(resultSet); } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } return null; } @@ -123,13 +121,13 @@ public List select() { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/selectall", connection)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - final PetMeta petData = from(resultSet); + final PetMeta petData = this.from(resultSet); petList.add(petData); } } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } return petList; } @@ -148,7 +146,6 @@ public void update(PetMeta item) { if(item.getSkinMaterial() == null) throw new IllegalArgumentException("SkinMaterial cannot be null!"); try (Connection connection = this.dbContext.getConnection()) { - System.out.println("UPDATE TYPE: " + item.getType().name()); this.dbContext.executeStoredUpdate("petblock/update", connection, item.getDisplayName(), item.getType().name(), @@ -163,8 +160,8 @@ public void update(PetMeta item) { item.getMovementType().name(), item.getId() ); - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } } @@ -178,8 +175,8 @@ public void delete(PetMeta item) { try (Connection connection = this.dbContext.getConnection()) { this.dbContext.executeStoredUpdate("petblock/delete", connection, item.getId()); - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } } @@ -213,9 +210,8 @@ public void insert(PetMeta item) { item.getMovementType().name() ); ((PetData)item).setId(id); - System.out.println("SUCCESS"); - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } } @@ -227,13 +223,12 @@ public void insert(PetMeta item) { */ @Override public PetMeta from(ResultSet resultSet) throws SQLException { - PetData petMeta = new PetData(); + final PetData petMeta = new PetData(); petMeta.setId(resultSet.getLong("id")); petMeta.setPlayerId(resultSet.getLong("shy_player_id")); petMeta.setParticleId(resultSet.getLong("shy_particle_effect_id")); petMeta.setDisplayName(resultSet.getString("name")); petMeta.setPetType(PetType.getPetTypeFromName(resultSet.getString("type"))); - System.out.println("TYPE: " + petMeta.getType()); petMeta.setSkin(Material.getMaterial(resultSet.getString("material")), (byte) resultSet.getInt("data"), resultSet.getString("skull")); petMeta.setEnabled(resultSet.getBoolean("enabled")); petMeta.setAgeInTicks(resultSet.getInt("age")); @@ -252,13 +247,12 @@ public int size() { try (Connection connection = this.dbContext.getConnection()) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/count", connection)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - return resultSet.getInt(1); - } + resultSet.next(); + return resultSet.getInt(1); } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } return 0; } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java index 05a2f066b..9e8398c85 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java @@ -5,6 +5,7 @@ import com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData; import com.github.shynixn.petblocks.lib.DataBaseRepository; import com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import java.io.Closeable; @@ -15,6 +16,7 @@ import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.util.logging.Level; /** * Created by Shynixn @@ -52,13 +54,12 @@ public PlayerMeta getById(long id) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("player/selectbyid", connection, id)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - return from(resultSet); - } + resultSet.next(); + return this.from(resultSet); } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } return null; } @@ -86,16 +87,14 @@ public List select() { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("player/selectall", connection)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - final PlayerData playerData = from(resultSet); - System.out.println("PLAYERDATA: " + playerData.getId()); + final PlayerData playerData = this.from(resultSet); playerList.add(playerData); } } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } - System.out.println("RETURN"); return playerList; } @@ -111,8 +110,8 @@ public void update(PlayerMeta item) { item.getUUID().toString(), item.getName(), item.getId()); - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } } @@ -123,13 +122,11 @@ public void update(PlayerMeta item) { */ @Override public void delete(PlayerMeta item) { - System.out.println("EXEUCTED DELETE OF " + item.getId()); try (Connection connection = this.dbContext.getConnection()) { this.dbContext.executeStoredUpdate("player/delete", connection, item.getId()); - System.out.println("EXEUCTED DELETE OF " + item.getId()); - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } } @@ -146,8 +143,8 @@ public void insert(PlayerMeta item) { final long id = this.dbContext.executeStoredInsert("player/insert", connection, item.getName(), item.getUUID().toString()); ((PlayerData)item).setId(id); - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } } @@ -174,13 +171,12 @@ public int size() { try (Connection connection = this.dbContext.getConnection()) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("player/count", connection)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - return resultSet.getInt(1); - } + resultSet.next(); + return resultSet.getInt(1); } } - } catch (SQLException e) { - e.printStackTrace(); + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } return 0; } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.java index 9fdd538f9..a314125cb 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.java @@ -538,7 +538,7 @@ public boolean equals(Object o) { */ @Override public String toString() { - return "effect {" + "name " + this.effect + " amound " + this.amount + " speed " + this.speed + "}"; + return "effect {" + "name " + this.effect + " amound " + this.amount + " speed " + this.speed + '}'; } /** diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java index 2aaf2fc12..da9517390 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java @@ -39,6 +39,7 @@ public class PetData extends PersistenceObject implements PetMeta { private long particleId; public PetData(Player player, PetType petType, String name, ItemStack itemStack, String owner) { + super(); this.petType = petType; this.displayName = name; this.playerInfo = PlayerData.from(player); @@ -48,13 +49,14 @@ public PetData(Player player, PetType petType, String name, ItemStack itemStack, if (!owner.contains("http://")) owner = "http://" + owner; } - if (owner != null && !owner.equals("")) + if (owner != null && !owner.isEmpty()) this.skullName = owner; this.ageTicks = Age.SMALL.getTicks(); this.sounds = true; } public PetData() { + super(); } /** @@ -356,6 +358,7 @@ public void setSkullName(String skullName) { //region Deprecated + @Override @Deprecated public Player getOwner() { return this.playerInfo.getPlayer(); @@ -378,7 +381,7 @@ public void setUuid(String uuid) { @Deprecated public PetData copy() { - PetData petData = new PetData(); + final PetData petData = new PetData(); petData.displayName = this.displayName; petData.petType = this.petType; petData.costume = this.costume; @@ -403,6 +406,7 @@ public PetData copy() { return petData; } + @Override @Deprecated public void setParticleEffect(Particle particle) { try { @@ -414,7 +418,7 @@ public void setParticleEffect(Particle particle) { this.setAmount(particle.getAmount()); this.setMaterial(particle.getMaterial()); this.setData(particle.getData()); - } catch (Exception ex) { + } catch (final Exception ex) { this.setEffect(null); this.setX(0); this.setY(0); @@ -426,6 +430,7 @@ public void setParticleEffect(Particle particle) { } } + @Override @Deprecated public Particle getParticleEffect() { try { @@ -433,7 +438,7 @@ public Particle getParticleEffect() { return null; return new ParticleBuilder().setEffect(this.getEffect()) .setOffset(this.getX(), this.getY(), this.getZ()).setSpeed(this.getSpeed()).setAmount(this.getAmount()).setMaterial(this.getMaterial()).setData(this.getData()).build(); - } catch (Exception ex) { + } catch (final Exception ex) { return null; } } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/AsyncRunnable.java b/src/main/java/com/github/shynixn/petblocks/lib/AsyncRunnable.java index ceecc3409..a44330acd 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/AsyncRunnable.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/AsyncRunnable.java @@ -37,24 +37,18 @@ public boolean isSynchrone() { } public static void toAsynchroneThread(final AsyncRunnable runnable, final Object... params) { - plugin.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() { - @Override - public void run() { - runnable.paramcache = params; - runnable.isSynchrone = false; - runnable.run(); - } + plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> { + runnable.paramcache = params; + runnable.isSynchrone = false; + runnable.run(); }); } public static void toSynchroneThread(final AsyncRunnable runnable, final Object... params) { - plugin.getServer().getScheduler().runTask(plugin, new Runnable() { - @Override - public void run() { - runnable.paramcache = params; - runnable.isSynchrone = true; - runnable.run(); - } + plugin.getServer().getScheduler().runTask(plugin, () -> { + runnable.paramcache = params; + runnable.isSynchrone = true; + runnable.run(); }); } } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/BukkitCommands.java b/src/main/java/com/github/shynixn/petblocks/lib/BukkitCommands.java index 3bcb52c0b..f4c85bb35 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/BukkitCommands.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/BukkitCommands.java @@ -16,6 +16,7 @@ public void consoleSendCommandEvent(CommandSender sender, String[] args) { } public BukkitCommands(String command, JavaPlugin plugin) { + super(); plugin.getCommand(command).setExecutor(this); this.plugin = plugin; } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/BukkitEvents.java b/src/main/java/com/github/shynixn/petblocks/lib/BukkitEvents.java index 14ac6743b..12504c7e9 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/BukkitEvents.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/BukkitEvents.java @@ -16,6 +16,7 @@ protected JavaPlugin getPlugin() { } public BukkitEvents(JavaPlugin plugin) { + super(); Bukkit.getPluginManager().registerEvents(this, plugin); this.plugin = plugin; } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/BukkitUtilities.java b/src/main/java/com/github/shynixn/petblocks/lib/BukkitUtilities.java index d95097896..06d42dada 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/BukkitUtilities.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/BukkitUtilities.java @@ -18,7 +18,6 @@ import java.util.List; import java.util.Random; import java.util.logging.Level; -import java.util.logging.Logger; @SuppressWarnings({"ResultOfMethodCallIgnored", "SameParameterValue"}) public final class BukkitUtilities { @@ -29,9 +28,7 @@ private BukkitUtilities() { public static List getOnlinePlayers() { final List players = new ArrayList<>(); for (final World world : Bukkit.getWorlds()) { - for (final Player player : world.getPlayers()) { - players.add(player); - } + players.addAll(world.getPlayers()); } return players; } @@ -58,7 +55,7 @@ public static ItemStack nameItem(ItemStack item, String name, String[] lore) { if (lore != null) { im.setLore(Arrays.asList(lore)); } else { - im.setLore(new ArrayList()); + im.setLore(new ArrayList<>()); } item.setItemMeta(im); return item; @@ -79,13 +76,14 @@ public static ItemStack nameItemDisplay(ItemStack item, String name) { public static boolean copyFile(InputStream in, File file) { try { - final OutputStream out = new FileOutputStream(file); - final byte[] buf = new byte[1024]; - int len; - while ((len = in.read(buf)) > 0) { - out.write(buf, 0, len); + try(final OutputStream out = new FileOutputStream(file)) + { + final byte[] buf = new byte[1024]; + int len; + while ((len = in.read(buf)) > 0) { + out.write(buf, 0, len); + } } - out.close(); in.close(); } catch (final Exception e) { Bukkit.getLogger().log(Level.WARNING, e.getMessage()); @@ -138,7 +136,8 @@ public static boolean isVersionSupported() { || getServerVersion().equals("v1_9_R1") || getServerVersion().equals("v1_9_R2") || getServerVersion().equals("v1_10_R1") - || getServerVersion().equals("v1_11_R1"); + || getServerVersion().equals("v1_11_R1") + || getServerVersion().equals("v1_12_R1"); } public static String replaceServerVersion(String text) { @@ -162,7 +161,6 @@ public static ItemStack activateHead(String name, ItemStack itemStack) { } } catch (final Exception e) { Bukkit.getLogger().log(Level.WARNING, e.getMessage()); - ; } return itemStack; } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/DynamicCommandHelper.java b/src/main/java/com/github/shynixn/petblocks/lib/DynamicCommandHelper.java index f6609426f..56b0fb842 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/DynamicCommandHelper.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/DynamicCommandHelper.java @@ -22,10 +22,10 @@ public DynamicCommandHelper(CommandContainer c) { this.description = c.getDescription(); this.usageMessage = c.getUseage(); this.setPermission(c.getPermission()); - this.setAliases(new ArrayList()); + this.setAliases(new ArrayList<>()); try { NMSRegistry.registerDynamicCommand(c.getCommand(), this); - } catch (Exception ex) { + } catch (final Exception ex) { Bukkit.getLogger().log(Level.WARNING,"Cannot register command.", ex); } } @@ -44,7 +44,7 @@ public boolean execute(CommandSender sender, String alias, String[] args) { public String getText(String[] args) { String s = ""; - for (String k : args) { + for (final String k : args) { if (!s.equalsIgnoreCase("")) s += " "; s += k; diff --git a/src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java b/src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java index 12be9041d..4ae5fc18b 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java @@ -43,7 +43,7 @@ public class ExtensionHikariConnectionContext implements AutoCloseable { public static final String SQLITE_DRIVER = "org.sqlite.JDBC"; public static final String MYSQL_DRIVER = "com.mysql.jdbc.Driver"; private HikariDataSource ds; - private SQlRetriever retriever; + private final SQlRetriever retriever; private Map cache = new HashMap<>(); /** @@ -199,7 +199,6 @@ public int executeUpdate(String sql, Connection connection, Object... parameters throw new IllegalArgumentException("Connection cannot be null!"); if (connection.isClosed()) throw new IllegalArgumentException("Connection is closed. Cannot create statement!"); - System.out.println("UPDATE: " + sql); try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) { this.setParameters(preparedStatement, parameters); return preparedStatement.executeUpdate(); @@ -342,6 +341,7 @@ public static ExtensionHikariConnectionContext from(String driver, String urlPre } } + @FunctionalInterface public interface SQlRetriever { /** * Loads a sqlStatement from the givenFile diff --git a/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java b/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java index 5916dbdee..3a26da351 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/Interpreter19.java @@ -1,9 +1,12 @@ package com.github.shynixn.petblocks.lib; +import org.bukkit.Bukkit; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import java.util.logging.Level; + /** * Created by Shynixn */ @@ -42,9 +45,9 @@ public static Sound interPretSounds19(String sound) { return Sound.valueOf("ENTITY_ENDERDRAGON_FLAP"); if (sound.toUpperCase().equals("ENDERDRAGON_GROWL")) return Sound.valueOf("ENTITY_ENDERDRAGON_GROWL"); - throw new RuntimeException("Sounds Betainterpreter19 cannot translate the sounds. " + sound + "."); - } catch (Exception e) { - e.printStackTrace(); + throw new RuntimeException("Sounds Betainterpreter19 cannot translate the sounds. " + sound + '.'); + } catch (final Exception e) { + Bukkit.getLogger().log(Level.WARNING, "Failed to interpret sounds above 1_9.", e); } return null; } @@ -73,13 +76,14 @@ private static boolean isAbove18() { try { BukkitUtilities.getServerVersion(); - }catch (RuntimeException ex) + }catch (final RuntimeException ex) { return false; } return BukkitUtilities.getServerVersion().equals("v1_9_R1") || BukkitUtilities.getServerVersion().equals("v1_9_R2") || BukkitUtilities.getServerVersion().equals("v1_10_R1") - || BukkitUtilities.getServerVersion().equals("v1_11_R1"); + || BukkitUtilities.getServerVersion().equals("v1_11_R1") + || BukkitUtilities.getServerVersion().equals("v1_12_R1"); } } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java b/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java index 4e898a2b6..7b450586c 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java @@ -15,11 +15,11 @@ public enum LightRegistry { RABBIT(101, "RABBIT", "Rabbit", "rabbit", "EntityRabbit"), ZOMBIE(54, "ZOMBIE", "Zombie", "zombie", "EntityZombie"); - int entityId; - String name; - String saveGame_18_19_10; - String saveGame_11; - Class nmsClass; + final int entityId; + final String name; + final String saveGame_18_19_10; + final String saveGame_11; + final Class nmsClass; static EntityRegistry entityRegistry; @@ -29,9 +29,10 @@ public enum LightRegistry { this.name = name; this.saveGame_18_19_10 = saveGame_18_19_10; this.saveGame_11 = saveGame_11; - this.nmsClass = Class.forName("net.minecraft.server." + getServerVersion() + "." + nmsClassName); + this.nmsClass = Class.forName("net.minecraft.server." + getServerVersion() + '.' + nmsClassName); } catch (final Exception ex) { Bukkit.getLogger().log(Level.WARNING, "Wrong PowerRegistryType configuration. ", ex); + throw new RuntimeException(ex); } } @@ -89,7 +90,7 @@ public void registerCustomEntity(Class customEntityClazz, LightRegistry power @Override public void unregister() throws Exception { final Class entityTypeClazz = Class.forName("net.minecraft.server.VERSION.EntityTypes".replace("VERSION", getServerVersion())); - if (!getServerVersion().equals("v1_11_R1")) { + if (!getServerVersion().equals("v1_11_R1") && !getServerVersion().equals("v1_12_R1")) { for (final Class customEntityClazz : types.keySet()) { final LightRegistry powerRegistry = types.get(customEntityClazz); this., String>getMap(entityTypeClazz, "d").remove(customEntityClazz); @@ -112,7 +113,7 @@ public void unregister() throws Exception { private void modify(Class clazz, String saveGameId, int entityId) throws Exception { final Class entityTypeClazz = Class.forName("net.minecraft.server.VERSION.EntityTypes".replace("VERSION", getServerVersion())); - if (!getServerVersion().equals("v1_11_R1")) { + if (!getServerVersion().equals("v1_11_R1") && !getServerVersion().equals("v1_12_R1")) { this.>getMap(entityTypeClazz, "c").put(saveGameId, clazz); this., String>getMap(entityTypeClazz, "d").put(clazz, saveGameId); this.>getMap(entityTypeClazz, "e").put(entityId, clazz); diff --git a/src/main/java/com/github/shynixn/petblocks/lib/Particle.java b/src/main/java/com/github/shynixn/petblocks/lib/Particle.java index 3f3987535..9858d17a9 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/Particle.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/Particle.java @@ -138,6 +138,7 @@ private class SendParticleRunnable extends AsyncRunnable { private final Player[] players; SendParticleRunnable(Location location, Player... players) { + super(); this.location = location; this.players = players; } @@ -145,15 +146,15 @@ private class SendParticleRunnable extends AsyncRunnable { @Override public void run() { if (Particle.this.effect == ParticleEffect.SPELL_MOB || Particle.this.effect == ParticleEffect.SPELL_MOB_AMBIENT || Particle.this.effect == ParticleEffect.REDSTONE) - Particle.this.effect.display(new ParticleEffect.OrdinaryColor((int) Particle.this.x, (int) Particle.this.z, (int) Particle.this.y), location, Arrays.asList(players)); + Particle.this.effect.display(new ParticleEffect.OrdinaryColor((int) Particle.this.x, (int) Particle.this.z, (int) Particle.this.y), this.location, Arrays.asList(this.players)); else if (Particle.this.effect == ParticleEffect.NOTE) - Particle.this.effect.display(new ParticleEffect.NoteColor((int) Particle.this.x), location, Arrays.asList(players)); + Particle.this.effect.display(new ParticleEffect.NoteColor((int) Particle.this.x), this.location, Arrays.asList(this.players)); else if (Particle.this.effect == ParticleEffect.BLOCK_CRACK || Particle.this.effect == ParticleEffect.BLOCK_DUST) - Particle.this.effect.display(new ParticleEffect.BlockData(Particle.this.material, Particle.this.data), (float) Particle.this.x, (float) Particle.this.y, (float) Particle.this.z, (float) Particle.this.speed, Particle.this.amount, location, Arrays.asList(players)); + Particle.this.effect.display(new ParticleEffect.BlockData(Particle.this.material, Particle.this.data), (float) Particle.this.x, (float) Particle.this.y, (float) Particle.this.z, (float) Particle.this.speed, Particle.this.amount, this.location, Arrays.asList(this.players)); else if (Particle.this.effect == ParticleEffect.ITEM_CRACK) - Particle.this.effect.display(new ParticleEffect.ItemData(Particle.this.material, Particle.this.data), (float) Particle.this.x, (float) Particle.this.y, (float) Particle.this.z, (float) Particle.this.speed, Particle.this.amount, location, Arrays.asList(players)); + Particle.this.effect.display(new ParticleEffect.ItemData(Particle.this.material, Particle.this.data), (float) Particle.this.x, (float) Particle.this.y, (float) Particle.this.z, (float) Particle.this.speed, Particle.this.amount, this.location, Arrays.asList(this.players)); else - Particle.this.effect.display((float) Particle.this.x, (float) Particle.this.y, (float) Particle.this.z, (float) Particle.this.speed, Particle.this.amount, location, Arrays.asList(players)); + Particle.this.effect.display((float) Particle.this.x, (float) Particle.this.y, (float) Particle.this.z, (float) Particle.this.speed, Particle.this.amount, this.location, Arrays.asList(this.players)); } } } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/ParticleBuilder.java b/src/main/java/com/github/shynixn/petblocks/lib/ParticleBuilder.java index 6268a40e3..1912faeda 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/ParticleBuilder.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/ParticleBuilder.java @@ -14,9 +14,11 @@ public final class ParticleBuilder { private byte data; public ParticleBuilder() { + super(); } public ParticleBuilder(ParticleEffect effect, double x, double y, double z, double speed, int amount) { + super(); this.effect = effect; this.x = x; this.y = y; @@ -43,33 +45,33 @@ public ParticleBuilder setGreen(int green) { } public ParticleBuilder setColor(int red, int green, int blue) { - setGreen(green); - setBlue(blue); - setRed(red); + this.setGreen(green); + this.setBlue(blue); + this.setRed(red); return this; } public int getRed() { - return (int) x; + return (int) this.x; } public int getBlue() { - return (int) y; + return (int) this.y; } public int getGreen() { - return (int) z; + return (int) this.z; } public ParticleBuilder setNoteColor(int color) { if (color > 20 || color < 0) color = 5; - setRed(color); + this.setRed(color); return this; } public ParticleEffect getEffect() { - return effect; + return this.effect; } public ParticleBuilder setEffect(ParticleEffect effect) { @@ -78,7 +80,7 @@ public ParticleBuilder setEffect(ParticleEffect effect) { } public int getAmount() { - return amount; + return this.amount; } public ParticleBuilder setAmount(int amount) { @@ -87,7 +89,7 @@ public ParticleBuilder setAmount(int amount) { } public double getX() { - return x; + return this.x; } public ParticleBuilder setX(double x) { @@ -96,7 +98,7 @@ public ParticleBuilder setX(double x) { } public double getY() { - return y; + return this.y; } public ParticleBuilder setY(double y) { @@ -105,7 +107,7 @@ public ParticleBuilder setY(double y) { } public double getZ() { - return z; + return this.z; } public ParticleBuilder setZ(double z) { @@ -114,14 +116,14 @@ public ParticleBuilder setZ(double z) { } public ParticleBuilder setOffset(double x, double y, double z) { - setX(x); - setY(y); - setZ(z); + this.setX(x); + this.setY(y); + this.setZ(z); return this; } public double getSpeed() { - return speed; + return this.speed; } public ParticleBuilder setSpeed(double speed) { @@ -130,7 +132,7 @@ public ParticleBuilder setSpeed(double speed) { } public Material getMaterial() { - return material; + return this.material; } public ParticleBuilder setMaterial(Material material) { @@ -139,8 +141,8 @@ public ParticleBuilder setMaterial(Material material) { } public int getMaterialId() { - if (material != null) - return material.getId(); + if (this.material != null) + return this.material.getId(); return -1; } @@ -157,7 +159,7 @@ public Particle build() { } public byte getData() { - return data; + return this.data; } public ParticleBuilder setData(byte data) { @@ -166,33 +168,27 @@ public ParticleBuilder setData(byte data) { } public boolean isColorParticleEffect() { - if (effect == ParticleEffect.SPELL_MOB || effect == ParticleEffect.SPELL_MOB_AMBIENT || effect == ParticleEffect.REDSTONE || effect == ParticleEffect.NOTE) - return true; - return false; + return this.effect == ParticleEffect.SPELL_MOB || this.effect == ParticleEffect.SPELL_MOB_AMBIENT || this.effect == ParticleEffect.REDSTONE || this.effect == ParticleEffect.NOTE; } public boolean isNoteParticleEffect() { - if (effect == ParticleEffect.NOTE) - return true; - return false; + return this.effect == ParticleEffect.NOTE; } public boolean isMaterialParticleEffect() { - if (effect == ParticleEffect.BLOCK_CRACK || effect == ParticleEffect.BLOCK_DUST || effect == ParticleEffect.ITEM_CRACK) - return true; - return false; + return this.effect == ParticleEffect.BLOCK_CRACK || this.effect == ParticleEffect.BLOCK_DUST || this.effect == ParticleEffect.ITEM_CRACK; } @SuppressWarnings("deprecation") @Override public String toString() { - String sdefault = "Name:" + effect.getName() + " Amount:" + amount + " Speed:" + speed + " OffsetX: " + x + " OffsetY: " + y + " OffsetZ" + z; - if (isColorParticleEffect()) - sdefault = "Name:" + effect.getName() + " Amount:" + amount + " Speed:" + speed + " Red:" + getRed() + " Green:" + getGreen() + " Blue:" + getBlue(); - else if (isNoteParticleEffect()) - sdefault = "Name:" + effect.getName() + " Amount:" + amount + " Speed:" + speed + " Color:" + getRed(); - else if (isMaterialParticleEffect() && material != null) - sdefault += " Id:" + material.getId() + " Data:" + data; + String sdefault = "Name:" + this.effect.getName() + " Amount:" + this.amount + " Speed:" + this.speed + " OffsetX: " + this.x + " OffsetY: " + this.y + " OffsetZ" + this.z; + if (this.isColorParticleEffect()) + sdefault = "Name:" + this.effect.getName() + " Amount:" + this.amount + " Speed:" + this.speed + " Red:" + this.getRed() + " Green:" + this.getGreen() + " Blue:" + this.getBlue(); + else if (this.isNoteParticleEffect()) + sdefault = "Name:" + this.effect.getName() + " Amount:" + this.amount + " Speed:" + this.speed + " Color:" + this.getRed(); + else if (this.isMaterialParticleEffect() && this.material != null) + sdefault += " Id:" + this.material.getId() + " Data:" + this.data; return sdefault; } } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/ParticleEffect.java b/src/main/java/com/github/shynixn/petblocks/lib/ParticleEffect.java index da1d23c3e..573b26637 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/ParticleEffect.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/ParticleEffect.java @@ -102,8 +102,8 @@ public enum ParticleEffect { MOB_APPEARANCE("mobappearance", 41, 8); - private static final Map NAME_MAP = new HashMap(); - private static final Map ID_MAP = new HashMap(); + private static final Map NAME_MAP = new HashMap<>(); + private static final Map ID_MAP = new HashMap<>(); private final String name; private final int id; private final int requiredVersion; @@ -111,14 +111,14 @@ public enum ParticleEffect { // Initialize map for quick name and id lookup static { - for (ParticleEffect effect : values()) { + for (final ParticleEffect effect : values()) { NAME_MAP.put(effect.name, effect); ID_MAP.put(effect.id, effect); } } - private ParticleEffect(String name, int id, int requiredVersion, ParticleProperty... properties) { + ParticleEffect(String name, int id, int requiredVersion, ParticleProperty... properties) { this.name = name; this.id = id; this.requiredVersion = requiredVersion; @@ -127,35 +127,31 @@ private ParticleEffect(String name, int id, int requiredVersion, ParticlePropert public String getName() { - return name; + return this.name; } public int getId() { - return id; + return this.id; } public int getRequiredVersion() { - return requiredVersion; + return this.requiredVersion; } public boolean hasProperty(ParticleProperty property) { - return properties.contains(property); + return this.properties.contains(property); } public boolean isSupported() { - if (requiredVersion == -1) { - return true; - } - return ParticlePacket.getVersion() >= requiredVersion; + return this.requiredVersion == -1 || ParticlePacket.getVersion() >= this.requiredVersion; } - public static ParticleEffect fromName(String name) { - for (Entry entry : NAME_MAP.entrySet()) { + for (final Entry entry : NAME_MAP.entrySet()) { if (!entry.getKey().equalsIgnoreCase(name)) { continue; } @@ -166,7 +162,7 @@ public static ParticleEffect fromName(String name) { public static ParticleEffect fromId(int id) { - for (Entry entry : ID_MAP.entrySet()) { + for (final Entry entry : ID_MAP.entrySet()) { if (entry.getKey() != id) { continue; } @@ -177,15 +173,15 @@ public static ParticleEffect fromId(int id) { private static boolean isWater(Location location) { - Material material = location.getBlock().getType(); + final Material material = location.getBlock().getType(); return material == Material.WATER || material == Material.STATIONARY_WATER; } private static boolean isLongDistance(Location location, List players) { - String world = location.getWorld().getName(); - for (Player player : players) { - Location playerLocation = player.getLocation(); + final String world = location.getWorld().getName(); + for (final Player player : players) { + final Location playerLocation = player.getLocation(); if (!world.equals(playerLocation.getWorld().getName()) || playerLocation.distanceSquared(location) < 65536) { continue; } @@ -206,13 +202,13 @@ private static boolean isColorCorrect(ParticleEffect effect, ParticleColor color public void display(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, double range) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { - if (!isSupported()) { + if (!this.isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (this.hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect requires additional data"); } - if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { + if (this.hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException("There is no water at the center location"); } new ParticlePacket(this, offsetX, offsetY, offsetZ, speed, amount, range > 256, null).sendTo(center, range); @@ -220,13 +216,13 @@ public void display(float offsetX, float offsetY, float offsetZ, float speed, in public void display(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, List players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { - if (!isSupported()) { + if (!this.isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (this.hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect requires additional data"); } - if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { + if (this.hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException("There is no water at the center location"); } new ParticlePacket(this, offsetX, offsetY, offsetZ, speed, amount, isLongDistance(center, players), null).sendTo(center, players); @@ -234,21 +230,21 @@ public void display(float offsetX, float offsetY, float offsetZ, float speed, in public void display(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, Player... players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { - display(offsetX, offsetY, offsetZ, speed, amount, center, Arrays.asList(players)); + this.display(offsetX, offsetY, offsetZ, speed, amount, center, Arrays.asList(players)); } public void display(Vector direction, float speed, Location center, double range) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { - if (!isSupported()) { + if (!this.isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (this.hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect requires additional data"); } - if (!hasProperty(ParticleProperty.DIRECTIONAL)) { + if (!this.hasProperty(ParticleProperty.DIRECTIONAL)) { throw new IllegalArgumentException("This particle effect is not directional"); } - if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { + if (this.hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException("There is no water at the center location"); } new ParticlePacket(this, direction, speed, range > 256, null).sendTo(center, range); @@ -256,16 +252,16 @@ public void display(Vector direction, float speed, Location center, double range public void display(Vector direction, float speed, Location center, List players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { - if (!isSupported()) { + if (!this.isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (this.hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect requires additional data"); } - if (!hasProperty(ParticleProperty.DIRECTIONAL)) { + if (!this.hasProperty(ParticleProperty.DIRECTIONAL)) { throw new IllegalArgumentException("This particle effect is not directional"); } - if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { + if (this.hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException("There is no water at the center location"); } new ParticlePacket(this, direction, speed, isLongDistance(center, players), null).sendTo(center, players); @@ -273,15 +269,15 @@ public void display(Vector direction, float speed, Location center, List public void display(Vector direction, float speed, Location center, Player... players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { - display(direction, speed, center, Arrays.asList(players)); + this.display(direction, speed, center, Arrays.asList(players)); } public void display(ParticleColor color, Location center, double range) throws ParticleVersionException, ParticleColorException { - if (!isSupported()) { + if (!this.isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (!hasProperty(ParticleProperty.COLORABLE)) { + if (!this.hasProperty(ParticleProperty.COLORABLE)) { throw new ParticleColorException("This particle effect is not colorable"); } if (!isColorCorrect(this, color)) { @@ -292,10 +288,10 @@ public void display(ParticleColor color, Location center, double range) throws P public void display(ParticleColor color, Location center, List players) throws ParticleVersionException, ParticleColorException { - if (!isSupported()) { + if (!this.isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (!hasProperty(ParticleProperty.COLORABLE)) { + if (!this.hasProperty(ParticleProperty.COLORABLE)) { throw new ParticleColorException("This particle effect is not colorable"); } if (!isColorCorrect(this, color)) { @@ -306,15 +302,15 @@ public void display(ParticleColor color, Location center, List players) public void display(ParticleColor color, Location center, Player... players) throws ParticleVersionException, ParticleColorException { - display(color, center, Arrays.asList(players)); + this.display(color, center, Arrays.asList(players)); } public void display(ParticleData data, float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, double range) throws ParticleVersionException, ParticleDataException { - if (!isSupported()) { + if (!this.isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (!hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (!this.hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect does not require additional data"); } if (!isDataCorrect(this, data)) { @@ -325,10 +321,10 @@ public void display(ParticleData data, float offsetX, float offsetY, float offse public void display(ParticleData data, float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, List players) throws ParticleVersionException, ParticleDataException { - if (!isSupported()) { + if (!this.isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (!hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (!this.hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect does not require additional data"); } if (!isDataCorrect(this, data)) { @@ -339,15 +335,15 @@ public void display(ParticleData data, float offsetX, float offsetY, float offse public void display(ParticleData data, float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, Player... players) throws ParticleVersionException, ParticleDataException { - display(data, offsetX, offsetY, offsetZ, speed, amount, center, Arrays.asList(players)); + this.display(data, offsetX, offsetY, offsetZ, speed, amount, center, Arrays.asList(players)); } public void display(ParticleData data, Vector direction, float speed, Location center, double range) throws ParticleVersionException, ParticleDataException { - if (!isSupported()) { + if (!this.isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (!hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (!this.hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect does not require additional data"); } if (!isDataCorrect(this, data)) { @@ -358,10 +354,10 @@ public void display(ParticleData data, Vector direction, float speed, Location c public void display(ParticleData data, Vector direction, float speed, Location center, List players) throws ParticleVersionException, ParticleDataException { - if (!isSupported()) { + if (!this.isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (!hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (!this.hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect does not require additional data"); } if (!isDataCorrect(this, data)) { @@ -372,11 +368,11 @@ public void display(ParticleData data, Vector direction, float speed, Location c public void display(ParticleData data, Vector direction, float speed, Location center, Player... players) throws ParticleVersionException, ParticleDataException { - display(data, direction, speed, center, Arrays.asList(players)); + this.display(data, direction, speed, center, Arrays.asList(players)); } - public static enum ParticleProperty { + public enum ParticleProperty { REQUIRES_WATER, @@ -384,7 +380,7 @@ public static enum ParticleProperty { DIRECTIONAL, - COLORABLE; + COLORABLE } @@ -396,6 +392,7 @@ public static abstract class ParticleData { @SuppressWarnings("deprecation") public ParticleData(Material material, byte data) { + super(); this.material = material; this.data = data; this.packetData = new int[]{material.getId(), data}; @@ -403,22 +400,22 @@ public ParticleData(Material material, byte data) { public Material getMaterial() { - return material; + return this.material; } public byte getData() { - return data; + return this.data; } public int[] getPacketData() { - return packetData; + return this.packetData; } public String getPacketDataString() { - return "_" + packetData[0] + "_" + packetData[1]; + return "_" + this.packetData[0] + '_' + this.packetData[1]; } } @@ -461,6 +458,7 @@ public static final class OrdinaryColor extends ParticleColor { public OrdinaryColor(int red, int green, int blue) throws IllegalArgumentException { + super(); if (red < 0) { throw new IllegalArgumentException("The red value is lower than 0"); } @@ -491,35 +489,35 @@ public OrdinaryColor(Color color) { public int getRed() { - return red; + return this.red; } public int getGreen() { - return green; + return this.green; } public int getBlue() { - return blue; + return this.blue; } @Override public float getValueX() { - return (float) red / 255F; + return (float) this.red / 255F; } @Override public float getValueY() { - return (float) green / 255F; + return (float) this.green / 255F; } @Override public float getValueZ() { - return (float) blue / 255F; + return (float) this.blue / 255F; } } @@ -529,6 +527,7 @@ public static final class NoteColor extends ParticleColor { public NoteColor(int note) throws IllegalArgumentException { + super(); if (note < 0) { throw new IllegalArgumentException("The note value is lower than 0"); } @@ -541,7 +540,7 @@ public NoteColor(int note) throws IllegalArgumentException { @Override public float getValueX() { - return (float) note / 24F; + return (float) this.note / 24F; } @@ -609,6 +608,7 @@ public static final class ParticlePacket { public ParticlePacket(ParticleEffect effect, float offsetX, float offsetY, float offsetZ, float speed, int amount, boolean longDistance, ParticleData data) throws IllegalArgumentException { + super(); initialize(); if (speed < 0) { throw new IllegalArgumentException("The speed is lower than 0"); @@ -635,7 +635,7 @@ public ParticlePacket(ParticleEffect effect, Vector direction, float speed, bool public ParticlePacket(ParticleEffect effect, ParticleColor color, boolean longDistance) { this(effect, color.getValueX(), color.getValueY(), color.getValueZ(), 1, 0, longDistance, null); if (effect == ParticleEffect.REDSTONE && color instanceof OrdinaryColor && ((OrdinaryColor) color).getRed() == 0) { - offsetX = Float.MIN_NORMAL; + this.offsetX = Float.MIN_NORMAL; } } @@ -648,12 +648,12 @@ public static void initialize() throws VersionIncompatibleException { if (version > 7) { enumParticle = ParticleReflectionUtils.PackageType.MINECRAFT_SERVER.getClass("EnumParticle"); } - Class packetClass = ParticleReflectionUtils.PackageType.MINECRAFT_SERVER.getClass(version < 7 ? "Packet63WorldParticles" : "PacketPlayOutWorldParticles"); + final Class packetClass = ParticleReflectionUtils.PackageType.MINECRAFT_SERVER.getClass(version < 7 ? "Packet63WorldParticles" : "PacketPlayOutWorldParticles"); packetConstructor = ParticleReflectionUtils.getConstructor(packetClass); getHandle = ParticleReflectionUtils.getMethod("CraftPlayer", ParticleReflectionUtils.PackageType.CRAFTBUKKIT_ENTITY, "getHandle"); playerConnection = ParticleReflectionUtils.getField("EntityPlayer", ParticleReflectionUtils.PackageType.MINECRAFT_SERVER, false, "playerConnection"); sendPacket = ParticleReflectionUtils.getMethod(playerConnection.getType(), "sendPacket", ParticleReflectionUtils.PackageType.MINECRAFT_SERVER.getClass("Packet")); - } catch (Exception exception) { + } catch (final Exception exception) { throw new VersionIncompatibleException("Your current bukkit version seems to be incompatible with this library", exception); } initialized = true; @@ -674,45 +674,45 @@ public static boolean isInitialized() { private void initializePacket(Location center) throws PacketInstantiationException { - if (packet != null) { + if (this.packet != null) { return; } try { - packet = packetConstructor.newInstance(); + this.packet = packetConstructor.newInstance(); if (version < 8) { - String name = effect.getName(); - if (data != null) { - name += data.getPacketDataString(); + String name = this.effect.getName(); + if (this.data != null) { + name += this.data.getPacketDataString(); } - ParticleReflectionUtils.setValue(packet, true, "a", name); + ParticleReflectionUtils.setValue(this.packet, true, "a", name); } else { - ParticleReflectionUtils.setValue(packet, true, "a", enumParticle.getEnumConstants()[effect.getId()]); - ParticleReflectionUtils.setValue(packet, true, "j", longDistance); - if (data != null) { - int[] packetData = data.getPacketData(); - ParticleReflectionUtils.setValue(packet, true, "k", effect == ParticleEffect.ITEM_CRACK ? packetData : new int[]{packetData[0] | (packetData[1] << 12)}); + ParticleReflectionUtils.setValue(this.packet, true, "a", enumParticle.getEnumConstants()[this.effect.getId()]); + ParticleReflectionUtils.setValue(this.packet, true, "j", this.longDistance); + if (this.data != null) { + final int[] packetData = this.data.getPacketData(); + ParticleReflectionUtils.setValue(this.packet, true, "k", this.effect == ParticleEffect.ITEM_CRACK ? packetData : new int[]{packetData[0] | (packetData[1] << 12)}); } } - ParticleReflectionUtils.setValue(packet, true, "b", (float) center.getX()); - ParticleReflectionUtils.setValue(packet, true, "c", (float) center.getY()); - ParticleReflectionUtils.setValue(packet, true, "d", (float) center.getZ()); - ParticleReflectionUtils.setValue(packet, true, "e", offsetX); - ParticleReflectionUtils.setValue(packet, true, "f", offsetY); - ParticleReflectionUtils.setValue(packet, true, "g", offsetZ); - ParticleReflectionUtils.setValue(packet, true, "h", speed); - ParticleReflectionUtils.setValue(packet, true, "i", amount); - } catch (Exception exception) { + ParticleReflectionUtils.setValue(this.packet, true, "b", (float) center.getX()); + ParticleReflectionUtils.setValue(this.packet, true, "c", (float) center.getY()); + ParticleReflectionUtils.setValue(this.packet, true, "d", (float) center.getZ()); + ParticleReflectionUtils.setValue(this.packet, true, "e", this.offsetX); + ParticleReflectionUtils.setValue(this.packet, true, "f", this.offsetY); + ParticleReflectionUtils.setValue(this.packet, true, "g", this.offsetZ); + ParticleReflectionUtils.setValue(this.packet, true, "h", this.speed); + ParticleReflectionUtils.setValue(this.packet, true, "i", this.amount); + } catch (final Exception exception) { throw new PacketInstantiationException("Packet instantiation failed", exception); } } public void sendTo(Location center, Player player) throws PacketInstantiationException, PacketSendingException { - initializePacket(center); + this.initializePacket(center); try { - sendPacket.invoke(playerConnection.get(getHandle.invoke(player)), packet); - } catch (Exception exception) { - throw new PacketSendingException("Failed to send the packet to player '" + player.getName() + "'", exception); + sendPacket.invoke(playerConnection.get(getHandle.invoke(player)), this.packet); + } catch (final Exception exception) { + throw new PacketSendingException("Failed to send the packet to player '" + player.getName() + '\'', exception); } } @@ -721,8 +721,8 @@ public void sendTo(Location center, List players) throws IllegalArgument if (players.isEmpty()) { return; } - for (Player player : players) { - sendTo(center, player); + for (final Player player : players) { + this.sendTo(center, player); } } @@ -731,13 +731,13 @@ public void sendTo(Location center, double range) throws IllegalArgumentExceptio if (range < 1) { throw new IllegalArgumentException("The range is lower than 1"); } - String worldName = center.getWorld().getName(); - double squared = range * range; - for (Player player : BukkitUtilities.getOnlinePlayers()) { + final String worldName = center.getWorld().getName(); + final double squared = range * range; + for (final Player player : BukkitUtilities.getOnlinePlayers()) { if (!player.getWorld().getName().equals(worldName) || player.getLocation().distanceSquared(center) > squared) { continue; } - sendTo(center, player); + this.sendTo(center, player); } } @@ -773,7 +773,7 @@ public PacketSendingException(String message, Throwable cause) { } public static ParticleEffect getParticleEffectFromName(String name) { - for (ParticleEffect particleEffect : ParticleEffect.values()) { + for (final ParticleEffect particleEffect : ParticleEffect.values()) { if (particleEffect.getName().equalsIgnoreCase(name)) return particleEffect; } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.java b/src/main/java/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.java index 21e81ec4d..c1974650e 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.java @@ -27,11 +27,13 @@ */ public final class ParticleReflectionUtils { // Prevent accidental construction - private ParticleReflectionUtils() {} + private ParticleReflectionUtils() { + super(); + } public static Constructor getConstructor(Class clazz, Class... parameterTypes) throws NoSuchMethodException { - Class[] primitiveTypes = DataType.getPrimitive(parameterTypes); - for (Constructor constructor : clazz.getConstructors()) { + final Class[] primitiveTypes = DataType.getPrimitive(parameterTypes); + for (final Constructor constructor : clazz.getConstructors()) { if (!DataType.compare(DataType.getPrimitive(constructor.getParameterTypes()), primitiveTypes)) { continue; } @@ -53,8 +55,8 @@ public static Object instantiateObject(String className, PackageType packageType } public static Method getMethod(Class clazz, String methodName, Class... parameterTypes) throws NoSuchMethodException { - Class[] primitiveTypes = DataType.getPrimitive(parameterTypes); - for (Method method : clazz.getMethods()) { + final Class[] primitiveTypes = DataType.getPrimitive(parameterTypes); + for (final Method method : clazz.getMethods()) { if (!method.getName().equals(methodName) || !DataType.compare(DataType.getPrimitive(method.getParameterTypes()), primitiveTypes)) { continue; } @@ -80,7 +82,7 @@ public static Object invokeMethod(Object instance, String className, PackageType } public static Field getField(Class clazz, boolean declared, String fieldName) throws NoSuchFieldException, SecurityException { - Field field = declared ? clazz.getDeclaredField(fieldName) : clazz.getField(fieldName); + final Field field = declared ? clazz.getDeclaredField(fieldName) : clazz.getField(fieldName); field.setAccessible(true); return field; } @@ -153,7 +155,7 @@ public enum PackageType { } public String getPath() { - return path; + return this.path; } public Class getClass(String className) throws ClassNotFoundException { @@ -161,7 +163,7 @@ public Class getClass(String className) throws ClassNotFoundException { } @Override public String toString() { - return path; + return this.path; } public static String getServerVersion() { @@ -187,12 +189,12 @@ public enum DataType { DOUBLE(double.class, Double.class), BOOLEAN(boolean.class, Boolean.class); - private static final Map, DataType> CLASS_MAP = new HashMap, DataType>(); + private static final Map, DataType> CLASS_MAP = new HashMap<>(); private final Class primitive; private final Class reference; static { - for (DataType type : values()) { + for (final DataType type : values()) { CLASS_MAP.put(type.primitive, type); CLASS_MAP.put(type.reference, type); } @@ -204,11 +206,11 @@ public enum DataType { } public Class getPrimitive() { - return primitive; + return this.primitive; } public Class getReference() { - return reference; + return this.reference; } public static DataType fromClass(Class clazz) { @@ -216,18 +218,18 @@ public static DataType fromClass(Class clazz) { } public static Class getPrimitive(Class clazz) { - DataType type = fromClass(clazz); + final DataType type = fromClass(clazz); return type == null ? clazz : type.getPrimitive(); } public static Class getReference(Class clazz) { - DataType type = fromClass(clazz); + final DataType type = fromClass(clazz); return type == null ? clazz : type.getReference(); } public static Class[] getPrimitive(Class[] classes) { - int length = classes == null ? 0 : classes.length; - Class[] types = new Class[length]; + final int length = classes == null ? 0 : classes.length; + final Class[] types = new Class[length]; for (int index = 0; index < length; index++) { types[index] = getPrimitive(classes[index]); } @@ -235,8 +237,8 @@ public static Class[] getPrimitive(Class[] classes) { } public static Class[] getReference(Class[] classes) { - int length = classes == null ? 0 : classes.length; - Class[] types = new Class[length]; + final int length = classes == null ? 0 : classes.length; + final Class[] types = new Class[length]; for (int index = 0; index < length; index++) { types[index] = getReference(classes[index]); } @@ -244,8 +246,8 @@ public static Class[] getReference(Class[] classes) { } public static Class[] getPrimitive(Object[] objects) { - int length = objects == null ? 0 : objects.length; - Class[] types = new Class[length]; + final int length = objects == null ? 0 : objects.length; + final Class[] types = new Class[length]; for (int index = 0; index < length; index++) { types[index] = getPrimitive(objects[index].getClass()); } @@ -253,8 +255,8 @@ public static Class[] getPrimitive(Object[] objects) { } public static Class[] getReference(Object[] objects) { - int length = objects == null ? 0 : objects.length; - Class[] types = new Class[length]; + final int length = objects == null ? 0 : objects.length; + final Class[] types = new Class[length]; for (int index = 0; index < length; index++) { types[index] = getReference(objects[index].getClass()); } @@ -266,8 +268,8 @@ public static boolean compare(Class[] primary, Class[] secondary) { return false; } for (int index = 0; index < primary.length; index++) { - Class primaryClass = primary[index]; - Class secondaryClass = secondary[index]; + final Class primaryClass = primary[index]; + final Class secondaryClass = secondary[index]; if (primaryClass.equals(secondaryClass) || primaryClass.isAssignableFrom(secondaryClass)) { continue; } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/PluginLoader.java b/src/main/java/com/github/shynixn/petblocks/lib/PluginLoader.java index 048c5e6c1..6d438a33b 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/PluginLoader.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/PluginLoader.java @@ -1,5 +1,6 @@ package com.github.shynixn.petblocks.lib; +import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; import java.lang.annotation.Retention; @@ -8,6 +9,7 @@ import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.logging.Level; import static java.lang.annotation.ElementType.CONSTRUCTOR; import static java.lang.annotation.ElementType.FIELD; @@ -35,7 +37,7 @@ public static void load(JavaPlugin plugin, Class... classes) { } } } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "Failed to load plugin loader.", e); } tClass = tClass.getSuperclass(); } while (tClass != null); @@ -53,7 +55,7 @@ public static void unload(JavaPlugin plugin, Class... classes) { } } } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "Failed to disable pluginloader.", e); } tClass = tClass.getSuperclass(); } while (tClass != null); @@ -66,7 +68,7 @@ public static void unload(JavaPlugin plugin, Class... classes) { } @Retention(RetentionPolicy.RUNTIME) - @Target(value = {METHOD}) + @Target(METHOD) public @interface PluginUnload { } } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/ReflectionLib.java b/src/main/java/com/github/shynixn/petblocks/lib/ReflectionLib.java index c919f7f9d..dd41a40f5 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/ReflectionLib.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/ReflectionLib.java @@ -18,7 +18,7 @@ public static Object invokeConstructor(Class clazz, Object... params) { try { constructor.setAccessible(true); return constructor.newInstance(params); - } catch (Exception ignored) { + } catch (final Exception ignored) { } } @@ -36,7 +36,7 @@ public static Object invokeMethodByObject(Object object, String name, Object... method.setAccessible(true); return method.invoke(object, params); } - } catch (Exception ignored) { + } catch (final Exception ignored) { } } @@ -48,11 +48,11 @@ public static Object invokeMethodByObject(Object object, String name, Object... if (method.getName().equalsIgnoreCase(name)) { Bukkit.getLogger().log(Level.WARNING, "Unknown: [" + method.getName() + "] " + method.getParameterTypes().length); Bukkit.getLogger().log(Level.WARNING, "Calling params: "); - for (Object param : params) { + for (final Object param : params) { Bukkit.getLogger().log(Level.WARNING, param.getClass().getName()); } Bukkit.getLogger().log(Level.WARNING, "Method params: "); - for (Class cl : method.getParameterTypes()) { + for (final Class cl : method.getParameterTypes()) { Bukkit.getLogger().log(Level.WARNING, cl.getName()); } } @@ -71,7 +71,7 @@ public static Object getValueFromField(String fieldName, Object object) { try { return field.get(object); } catch (final IllegalAccessException e) { - e.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "Access violation.", e); } } } @@ -88,7 +88,7 @@ public static Object invokeMethodByClazz(Class clazz, String name, Object... method.setAccessible(true); return method.invoke(null, params); } - } catch (Exception ignored) { + } catch (final Exception ignored) { } } @@ -100,7 +100,7 @@ public static Object invokeMethodByClazz(Class clazz, String name, Object... public static Class getClassFromName(String name) { try { return Class.forName(name.replace("VERSION", BukkitUtilities.getServerVersion())); - } catch (Exception e) { + } catch (final Exception e) { throw new RuntimeException("Cannot find correct class [" + name + "] " + e.getMessage()); } } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/RegisterHelper.java b/src/main/java/com/github/shynixn/petblocks/lib/RegisterHelper.java index df1f07024..52b301dba 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/RegisterHelper.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/RegisterHelper.java @@ -4,14 +4,13 @@ import org.bukkit.ChatColor; import java.util.HashMap; -import java.util.logging.Level; /** * Created by Shynixn */ public final class RegisterHelper { public static String PREFIX; - private static HashMap registered = new HashMap<>(); + private static final HashMap registered = new HashMap<>(); public static boolean register(String pluginName) { return register(pluginName, null, null); @@ -26,31 +25,25 @@ public static boolean isRegistered(String pluginName) { } public static boolean isRegistered(String pluginName, char version) { - if (registered.containsKey(pluginName) == false) - return false; - if (registered.get(pluginName).charAt(0) != version) { + if (!registered.containsKey(pluginName)) return false; - } - return true; + return registered.get(pluginName).charAt(0) == version; } public static boolean isRegistered(String pluginName, String version) { if (!registered.containsKey(pluginName)) return false; - if (version != null && !registered.get(pluginName).equals(version)) { - return false; - } - return true; + return !(version != null && !registered.get(pluginName).equals(version)); } public static boolean register(String pluginName, String path, char version) { boolean canregister = true; if (pluginName != null && Bukkit.getPluginManager().getPlugin(pluginName) != null) { - Bukkit.getServer().getConsoleSender().sendMessage(PREFIX + ChatColor.GRAY + "found dependency [" + pluginName + "] " + version + "."); + Bukkit.getServer().getConsoleSender().sendMessage(PREFIX + ChatColor.GRAY + "found dependency [" + pluginName + "] " + version + '.'); if (path != null) { try { Class.forName(path); - } catch (ClassNotFoundException e) { + } catch (final ClassNotFoundException e) { canregister = false; } } @@ -59,10 +52,10 @@ public static boolean register(String pluginName, String path, char version) { } if (canregister) { registered.put(pluginName, Bukkit.getPluginManager().getPlugin(pluginName).getDescription().getVersion()); - Bukkit.getServer().getConsoleSender().sendMessage(PREFIX + ChatColor.DARK_GREEN + "hooked successfully into [" + pluginName + "] " + version + "."); + Bukkit.getServer().getConsoleSender().sendMessage(PREFIX + ChatColor.DARK_GREEN + "hooked successfully into [" + pluginName + "] " + version + '.'); return true; } else { - Bukkit.getServer().getConsoleSender().sendMessage(PREFIX + ChatColor.DARK_RED + "failed to hook into [" + pluginName + "] " + version + "."); + Bukkit.getServer().getConsoleSender().sendMessage(PREFIX + ChatColor.DARK_RED + "failed to hook into [" + pluginName + "] " + version + '.'); } } return false; @@ -75,7 +68,7 @@ public static boolean register(String pluginName, String path, String version) { if (path != null) { try { Class.forName(path); - } catch (ClassNotFoundException e) { + } catch (final ClassNotFoundException e) { canregister = false; } } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/SkullMetaRegistry.java b/src/main/java/com/github/shynixn/petblocks/lib/SkullMetaRegistry.java index be5efd3c6..0b8248c36 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/SkullMetaRegistry.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/SkullMetaRegistry.java @@ -3,7 +3,9 @@ import java.lang.reflect.Field; import java.util.Collection; import java.util.UUID; +import java.util.logging.Level; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -31,7 +33,7 @@ public static ItemStack convertToSkinSkull(ItemStack itemStack, String skinUrl, itemStack.setItemMeta(meta); itemStack = setDisplayName(itemStack, "TMP"); } catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) { - e.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "Failed to convert skin to skull.", e); } } return itemStack; @@ -69,7 +71,7 @@ public static String getLink(ItemStack itemStack, String v) { } } } catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) { - e.printStackTrace(); + Bukkit.getLogger().log(Level.WARNING, "Failed to obtain link from skull.", e); } return null; } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/SoundData.java b/src/main/java/com/github/shynixn/petblocks/lib/SoundData.java index 99c0bd815..d9352cb52 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/SoundData.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/SoundData.java @@ -7,7 +7,7 @@ public class SoundData { private double pitch; private double volume; - private Sound sound; + private final Sound sound; public SoundData(Sound sound, double pitch, double volume) { super(); @@ -31,18 +31,19 @@ public SoundData(String name, double pitch, double volume) { } public SoundData(String name) { + super(); this.pitch = 1.0; this.volume = 1.0; this.sound = Interpreter19.interPretSounds19(name); } public void playTo(Player player) { - player.playSound(player.getLocation(), sound, (float) pitch, (float) volume); + player.playSound(player.getLocation(), this.sound, (float) this.pitch, (float) this.volume); } public void play(Location location) { for (final Player player : location.getWorld().getPlayers()) { - player.playSound(location, sound, (float) pitch, (float) volume); + player.playSound(location, this.sound, (float) this.pitch, (float) this.volume); } } } \ No newline at end of file diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/DatabaseTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/DatabaseTest.java index 64b738d2a..fe4297585 100644 --- a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/DatabaseTest.java +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/DatabaseTest.java @@ -9,26 +9,25 @@ import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; +import java.util.logging.Level; +import java.util.logging.Logger; public class DatabaseTest { @Test public void enableDatabaseSQLiteTest() { try { - HikariConfig config = new HikariConfig(); + final HikariConfig config = new HikariConfig(); config.setDriverClassName("org.sqlite.JDBC"); config.setConnectionTestQuery("SELECT 1"); config.setJdbcUrl("jdbc:sqlite:PetBlocks.db"); config.setMaxLifetime(60000); config.setIdleTimeout(45000); config.setMaximumPoolSize(50); - HikariDataSource ds = new HikariDataSource(config); + final HikariDataSource ds = new HikariDataSource(config); ds.close(); - } catch (Exception ex) { - ex.printStackTrace(); + } catch (final Exception ex) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to enable database.", ex); Assert.fail(); } } @@ -44,18 +43,18 @@ public void enableDatabaseMySQLTest() { } } - HikariConfig config = new HikariConfig(); + final HikariConfig config = new HikariConfig(); config.setDriverClassName("com.mysql.jdbc.Driver"); config.setConnectionTestQuery("SELECT 1"); config.setJdbcUrl("jdbc:mysql://localhost:3306/db"); config.setMaxLifetime(60000); config.setIdleTimeout(45000); config.setMaximumPoolSize(50); - HikariDataSource ds = new HikariDataSource(config); + final HikariDataSource ds = new HikariDataSource(config); ds.close(); database.stop(); - } catch (Exception ex) { - ex.printStackTrace(); + } catch (final Exception ex) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to enable database.", ex); Assert.fail(); } } diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java index 892ba2f46..5b1fe1fde 100644 --- a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java @@ -12,15 +12,14 @@ import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import java.io.File; -import java.io.InputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; @@ -37,16 +36,13 @@ private static Plugin mockPlugin() { configuration.set("sql.database", "db"); configuration.set("sql.username", "root"); configuration.set("sql.password", ""); - Plugin plugin = mock(Plugin.class); + final Plugin plugin = mock(Plugin.class); new File("PetBlocks.db").delete(); when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); when(plugin.getConfig()).thenReturn(configuration); - when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { - @Override - public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { - final String file = invocationOnMock.getArgument(0); - return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); - } + when(plugin.getResource(any(String.class))).thenAnswer(invocationOnMock -> { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); }); return plugin; } @@ -58,8 +54,8 @@ public static void stopMariaDB() { try { database.stop(); - } catch (ManagedProcessException e) { - e.printStackTrace(); + } catch (final ManagedProcessException e) { + Logger.getLogger(ParticleEffectMetaMySQLControllerTest.class.getSimpleName()).log(Level.WARNING, "Failed to stop maria db.", e); } } @@ -75,26 +71,26 @@ public static void startMariaDB() { } } } catch (SQLException | ManagedProcessException e) { - e.printStackTrace(); + Logger.getLogger(ParticleEffectMetaMySQLControllerTest.class.getSimpleName()).log(Level.WARNING, "Failed to start maria db.", e); } } @Test public void insertSelectParticleEffectMetaTest() throws ClassNotFoundException { - Plugin plugin = mockPlugin(); + final Plugin plugin = mockPlugin(); plugin.getConfig().set("sql.local", false); Factory.initialize(plugin); try (ParticleEffectMetaController controller = Factory.createParticleEffectController()) { for (final ParticleEffectMeta item : controller.getAll()) { controller.remove(item); } - ParticleEffectMeta meta = controller.create(); + final ParticleEffectMeta meta = controller.create(); meta.setEffectType(ParticleEffectMeta.ParticleEffectType.CLOUD); controller.store(meta); assertEquals(1, controller.size()); assertEquals(ParticleEffectMeta.ParticleEffectType.CLOUD, controller.getById(meta.getId()).getEffectType()); - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(ParticleEffectMetaMySQLControllerTest.class.getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } @@ -102,7 +98,7 @@ public void insertSelectParticleEffectMetaTest() throws ClassNotFoundException { @Test public void storeLoadParticleEffectMetaTest() throws ClassNotFoundException { - Plugin plugin = mockPlugin(); + final Plugin plugin = mockPlugin(); plugin.getConfig().set("sql.local", false); Factory.initialize(plugin); try (ParticleEffectMetaController controller = Factory.createParticleEffectController()) { @@ -148,8 +144,8 @@ public void storeLoadParticleEffectMetaTest() throws ClassNotFoundException { assertEquals(5.24, meta.getZ()); assertEquals(Material.BARRIER, meta.getMaterial()); assertEquals((byte)7, (byte)meta.getData()); - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(ParticleEffectMetaMySQLControllerTest.class.getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java index d14d25797..262d4353f 100644 --- a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java @@ -2,7 +2,6 @@ import com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController; import com.github.shynixn.petblocks.api.persistence.controller.PetMetaController; -import com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController; import com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta; import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; import com.github.shynixn.petblocks.business.logic.persistence.Factory; @@ -12,11 +11,10 @@ import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import java.io.File; -import java.io.InputStream; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; @@ -33,16 +31,13 @@ private static Plugin mockPlugin() { configuration.set("sql.database", "db"); configuration.set("sql.username", "root"); configuration.set("sql.password", ""); - Plugin plugin = mock(Plugin.class); + final Plugin plugin = mock(Plugin.class); new File("PetBlocks.db").delete(); when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); when(plugin.getConfig()).thenReturn(configuration); - when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { - @Override - public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { - final String file = invocationOnMock.getArgument(0); - return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); - } + when(plugin.getResource(any(String.class))).thenAnswer(invocationOnMock -> { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); }); return plugin; } @@ -64,15 +59,15 @@ public void insertSelectParticleEffectMetaTest() throws ClassNotFoundException { for (final ParticleEffectMeta item : controller.getAll()) { controller.remove(item); } - ParticleEffectMeta meta = controller.create(); + final ParticleEffectMeta meta = controller.create(); controller.store(meta); assertEquals(0, controller.size()); meta.setEffectType(ParticleEffectMeta.ParticleEffectType.CLOUD); controller.store(meta); assertEquals(1, controller.size()); assertEquals(ParticleEffectMeta.ParticleEffectType.CLOUD, controller.getById(meta.getId()).getEffectType()); - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } @@ -129,8 +124,8 @@ public void storeLoadParticleEffectMetaTest() throws ClassNotFoundException { assertEquals(5.24, meta.getZ()); assertEquals(Material.BARRIER, meta.getMaterial()); assertEquals((byte)7, (byte)meta.getData()); - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java index 403281fe6..98abb5a87 100644 --- a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java @@ -13,7 +13,6 @@ import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; import com.github.shynixn.petblocks.business.logic.persistence.Factory; import com.github.shynixn.petblocks.business.logic.persistence.entity.PetData; -import com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData; import org.bukkit.Material; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; @@ -22,16 +21,15 @@ import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import java.io.File; -import java.io.InputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -49,16 +47,13 @@ private static Plugin mockPlugin() { configuration.set("sql.database", "db"); configuration.set("sql.username", "root"); configuration.set("sql.password", ""); - Plugin plugin = mock(Plugin.class); + final Plugin plugin = mock(Plugin.class); new File("PetBlocks.db").delete(); when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); when(plugin.getConfig()).thenReturn(configuration); - when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { - @Override - public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { - final String file = invocationOnMock.getArgument(0); - return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); - } + when(plugin.getResource(any(String.class))).thenAnswer(invocationOnMock -> { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); }); return plugin; } @@ -71,8 +66,8 @@ public static void stopMariaDB() { try { database.stop(); - } catch (ManagedProcessException e) { - e.printStackTrace(); + } catch (final ManagedProcessException e) { + Logger.getLogger(PetMetaMySQLControllerTest.class.getSimpleName()).log(Level.WARNING, "Failed stop maria db.", e); } } @@ -88,13 +83,13 @@ public static void startMariaDB() { } } } catch (SQLException | ManagedProcessException e) { - e.printStackTrace(); + Logger.getLogger(PetMetaMySQLControllerTest.class.getSimpleName()).log(Level.WARNING, "Failed start maria db.", e); } } @Test public void insertSelectPlayerMetaTest() throws ClassNotFoundException { - Plugin plugin = mockPlugin(); + final Plugin plugin = mockPlugin(); plugin.getConfig().set("sql.local", false); Factory.initialize(mockPlugin()); final UUID uuid = UUID.randomUUID(); @@ -107,12 +102,12 @@ public void insertSelectPlayerMetaTest() throws ClassNotFoundException { for (final PetMeta item : controller.getAll()) { controller.remove(item); } - PetMeta meta = new PetData(); + final PetMeta meta = new PetData(); meta.setDisplayName("Notch"); assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); assertEquals(0, controller.size()); - ParticleEffectMeta particleEffectMeta = particleController.create(); + final ParticleEffectMeta particleEffectMeta = particleController.create(); particleEffectMeta.setEffectType(ParticleEffectMeta.ParticleEffectType.END_ROD); particleController.store(particleEffectMeta); meta.setParticleEffectMeta(particleEffectMeta); @@ -120,7 +115,7 @@ public void insertSelectPlayerMetaTest() throws ClassNotFoundException { assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); assertEquals(0, controller.size()); - PlayerMeta playerMeta = playerController.create(player); + final PlayerMeta playerMeta = playerController.create(player); playerController.store(playerMeta); meta.setPlayerMeta(playerMeta); assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); @@ -135,8 +130,8 @@ public void insertSelectPlayerMetaTest() throws ClassNotFoundException { assertEquals("Notch", controller.getByPlayer(player).getDisplayName()); } } - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } @@ -144,7 +139,7 @@ public void insertSelectPlayerMetaTest() throws ClassNotFoundException { @Test public void storeLoadPlayerMetaTest() throws ClassNotFoundException { - Plugin plugin = mockPlugin(); + final Plugin plugin = mockPlugin(); plugin.getConfig().set("sql.local", false); Factory.initialize(mockPlugin()); final UUID uuid = UUID.randomUUID(); @@ -168,12 +163,12 @@ public void storeLoadPlayerMetaTest() throws ClassNotFoundException { meta.setMoveType(MoveType.FLYING); meta.setMovementType(Movement.CRAWLING); - ParticleEffectMeta particleEffectMeta = particleController.create(); + final ParticleEffectMeta particleEffectMeta = particleController.create(); particleEffectMeta.setEffectType(ParticleEffectMeta.ParticleEffectType.END_ROD); particleController.store(particleEffectMeta); meta.setParticleEffectMeta(particleEffectMeta); - PlayerMeta playerMeta = playerController.create(player); + final PlayerMeta playerMeta = playerController.create(player); playerController.store(playerMeta); meta.setPlayerMeta(playerMeta); controller.store(meta); @@ -218,8 +213,8 @@ public void storeLoadPlayerMetaTest() throws ClassNotFoundException { assertEquals(Movement.HOPPING, meta.getMovementType()); } } - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java index a37ddf6c1..e5d1d0d3f 100644 --- a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java @@ -18,13 +18,11 @@ import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import org.junit.jupiter.api.function.Executable; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import java.io.File; -import java.io.InputStream; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -42,16 +40,13 @@ private static Plugin mockPlugin() { configuration.set("sql.database", "db"); configuration.set("sql.username", "root"); configuration.set("sql.password", ""); - Plugin plugin = mock(Plugin.class); + final Plugin plugin = mock(Plugin.class); new File("PetBlocks.db").delete(); when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); when(plugin.getConfig()).thenReturn(configuration); - when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { - @Override - public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { - final String file = invocationOnMock.getArgument(0); - return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); - } + when(plugin.getResource(any(String.class))).thenAnswer(invocationOnMock -> { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); }); return plugin; } @@ -74,12 +69,12 @@ public void insertSelectPetMetaTest() throws ClassNotFoundException { for (final PetMeta item : controller.getAll()) { controller.remove(item); } - PetMeta meta = new PetData(); + final PetMeta meta = new PetData(); meta.setDisplayName("Notch"); assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); assertEquals(0, controller.size()); - ParticleEffectMeta particleEffectMeta = particleController.create(); + final ParticleEffectMeta particleEffectMeta = particleController.create(); particleEffectMeta.setEffectType(ParticleEffectMeta.ParticleEffectType.END_ROD); particleController.store(particleEffectMeta); meta.setParticleEffectMeta(particleEffectMeta); @@ -87,7 +82,7 @@ public void insertSelectPetMetaTest() throws ClassNotFoundException { assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); assertEquals(0, controller.size()); - PlayerMeta playerMeta = playerController.create(player); + final PlayerMeta playerMeta = playerController.create(player); playerController.store(playerMeta); meta.setPlayerMeta(playerMeta); assertThrows(IllegalArgumentException.class, () -> controller.store(meta)); @@ -102,8 +97,8 @@ public void insertSelectPetMetaTest() throws ClassNotFoundException { assertEquals("Notch", controller.getByPlayer(player).getDisplayName()); } } - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } @@ -132,12 +127,12 @@ public void storeLoadPetMetaTest() throws ClassNotFoundException { meta.setMoveType(MoveType.FLYING); meta.setMovementType(Movement.CRAWLING); - ParticleEffectMeta particleEffectMeta = particleController.create(); + final ParticleEffectMeta particleEffectMeta = particleController.create(); particleEffectMeta.setEffectType(ParticleEffectMeta.ParticleEffectType.END_ROD); particleController.store(particleEffectMeta); meta.setParticleEffectMeta(particleEffectMeta); - PlayerMeta playerMeta = playerController.create(player); + final PlayerMeta playerMeta = playerController.create(player); playerController.store(playerMeta); meta.setPlayerMeta(playerMeta); controller.store(meta); @@ -182,8 +177,8 @@ public void storeLoadPetMetaTest() throws ClassNotFoundException { assertEquals(Movement.HOPPING, meta.getMovementType()); } } - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java index 6a87e2826..f8dc56121 100644 --- a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java @@ -12,17 +12,15 @@ import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import org.junit.jupiter.api.function.Executable; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import java.io.File; -import java.io.InputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -40,16 +38,13 @@ private static Plugin mockPlugin() { configuration.set("sql.database", "db"); configuration.set("sql.username", "root"); configuration.set("sql.password", ""); - Plugin plugin = mock(Plugin.class); + final Plugin plugin = mock(Plugin.class); new File("PetBlocks.db").delete(); when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); when(plugin.getConfig()).thenReturn(configuration); - when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { - @Override - public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { - final String file = invocationOnMock.getArgument(0); - return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); - } + when(plugin.getResource(any(String.class))).thenAnswer(invocationOnMock -> { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); }); return plugin; } @@ -62,8 +57,8 @@ public static void stopMariaDB() { try { database.stop(); - } catch (ManagedProcessException e) { - e.printStackTrace(); + } catch (final ManagedProcessException e) { + Logger.getLogger(PlayerMetaMySQLControllerTest.class.getSimpleName()).log(Level.WARNING, "Failed to stop mariadb.", e); } } @@ -79,21 +74,21 @@ public static void startMariaDB() { } } } catch (SQLException | ManagedProcessException e) { - e.printStackTrace(); + Logger.getLogger(PlayerMetaMySQLControllerTest.class.getSimpleName()).log(Level.WARNING, "Failed to start mariadb.", e); } } @Test public void insertSelectPlayerMetaTest() throws ClassNotFoundException { - Plugin plugin = mockPlugin(); + final Plugin plugin = mockPlugin(); plugin.getConfig().set("sql.local", false); Factory.initialize(plugin); try (PlayerMetaController controller = Factory.createPlayerDataController()) { for (final PlayerMeta item : controller.getAll()) { controller.remove(item); } - UUID uuid = UUID.randomUUID(); - PlayerMeta playerMeta = new PlayerData(); + final UUID uuid = UUID.randomUUID(); + final PlayerMeta playerMeta = new PlayerData(); assertThrows(IllegalArgumentException.class, () -> controller.store(playerMeta)); assertEquals(0, controller.size()); @@ -106,8 +101,8 @@ public void insertSelectPlayerMetaTest() throws ClassNotFoundException { controller.store(playerMeta); assertEquals(1, controller.size()); assertEquals(uuid, controller.getById(playerMeta.getId()).getUUID()); - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } @@ -115,7 +110,7 @@ public void insertSelectPlayerMetaTest() throws ClassNotFoundException { @Test public void storeLoadPlayerMetaTest() throws ClassNotFoundException { - Plugin plugin = mockPlugin(); + final Plugin plugin = mockPlugin(); plugin.getConfig().set("sql.local", false); Factory.initialize(plugin); try (PlayerMetaController controller = Factory.createPlayerDataController()) { @@ -141,8 +136,8 @@ public void storeLoadPlayerMetaTest() throws ClassNotFoundException { playerMeta = controller.getAll().get(0); assertEquals(uuid, playerMeta.getUUID()); assertEquals("Shynixn", playerMeta.getName()); - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } diff --git a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java index 6145b81c2..92e990a75 100644 --- a/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java +++ b/src/main/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java @@ -11,12 +11,11 @@ import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import java.io.File; -import java.io.InputStream; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -34,16 +33,13 @@ private static Plugin mockPlugin() { configuration.set("sql.database", "db"); configuration.set("sql.username", "root"); configuration.set("sql.password", ""); - Plugin plugin = mock(Plugin.class); + final Plugin plugin = mock(Plugin.class); new File("PetBlocks.db").delete(); when(plugin.getDataFolder()).thenReturn(new File("PetBlocks")); when(plugin.getConfig()).thenReturn(configuration); - when(plugin.getResource(any(String.class))).thenAnswer(new Answer() { - @Override - public InputStream answer(InvocationOnMock invocationOnMock) throws Throwable { - final String file = invocationOnMock.getArgument(0); - return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); - } + when(plugin.getResource(any(String.class))).thenAnswer(invocationOnMock -> { + final String file = invocationOnMock.getArgument(0); + return Thread.currentThread().getContextClassLoader().getResourceAsStream(file); }); return plugin; } @@ -65,8 +61,8 @@ public void insertSelectPlayerMetaTest() throws ClassNotFoundException { for (final PlayerMeta item : controller.getAll()) { controller.remove(item); } - UUID uuid = UUID.randomUUID(); - PlayerMeta playerMeta = new PlayerData(); + final UUID uuid = UUID.randomUUID(); + final PlayerMeta playerMeta = new PlayerData(); assertThrows(IllegalArgumentException.class, () -> controller.store(playerMeta)); assertEquals(0, controller.size()); @@ -78,8 +74,8 @@ public void insertSelectPlayerMetaTest() throws ClassNotFoundException { controller.store(playerMeta); assertEquals(1, controller.size()); assertEquals(uuid, controller.getById(playerMeta.getId()).getUUID()); - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } @@ -116,8 +112,8 @@ public void storeLoadPlayerMetaTest() throws ClassNotFoundException { playerMeta = controller.getAll().get(0); assertEquals(uuid, playerMeta.getUUID()); assertEquals("Shynixn", playerMeta.getName()); - } catch (Exception e) { - e.printStackTrace(); + } catch (final Exception e) { + Logger.getLogger(this.getClass().getSimpleName()).log(Level.WARNING, "Failed to run test.", e); Assert.fail(); } } From 7081febc6397634fece7639529e9d0e8c7de9656 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 2 Jun 2017 12:08:59 +0200 Subject: [PATCH 05/23] Fixed test structure --- pom.xml | 21 ++++------ sqlite-jdbc-3.16.1.jar | 0 .../persistence/controller/IController.java | 3 +- .../ParticleEffectDataRepository.java | 40 ------------------- .../controller/PetDataRepository.java | 39 ------------------ .../controller/PlayerDataRepository.java | 39 ------------------ .../petblocks/lib/DataBaseRepository.java | 1 + .../lib/ExtensionHikariConnectionContext.java | 3 +- .../petblocks/lib/ReflectionUtils.java | 6 +++ .../persistence/controller/DatabaseTest.java | 2 +- ...ParticleEffectMetaMySQLControllerTest.java | 14 +++---- ...articleEffectMetaSQLiteControllerTest.java | 12 +++++- .../PetMetaMySQLControllerTest.java | 10 ++--- .../PetMetaSQLiteControllerTest.java | 5 ++- .../PlayerMetaMySQLControllerTest.java | 10 ++--- .../PlayerMetaSQLiteControllerTest.java | 5 ++- 16 files changed, 52 insertions(+), 158 deletions(-) delete mode 100644 sqlite-jdbc-3.16.1.jar rename src/{main => }/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/DatabaseTest.java (98%) rename src/{main => }/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java (97%) rename src/{main => }/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java (94%) rename src/{main => }/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java (98%) rename src/{main => }/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java (99%) rename src/{main => }/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java (97%) rename src/{main => }/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java (98%) diff --git a/pom.xml b/pom.xml index c0b8c51b7..72e1603d9 100644 --- a/pom.xml +++ b/pom.xml @@ -51,19 +51,14 @@ org.junit.platform junit-platform-surefire-provider - 1.0.0-M4 + RELEASE org.junit.jupiter junit-jupiter-engine - 5.0.0-M4 + RELEASE - - - **/*Test.java - - org.apache.maven.plugins @@ -224,12 +219,6 @@ 2.4.11 compile - - org.mockito - mockito-core - 2.7.22 - test - org.xerial sqlite-jdbc @@ -248,6 +237,12 @@ RELEASE test + + org.mockito + mockito-core + RELEASE + test + org.apache.maven.plugins maven-compiler-plugin diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java index dec44ce35..c19247b69 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java @@ -3,6 +3,8 @@ import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; import org.bukkit.entity.Player; +import java.util.UUID; + /** * Created by Shynixn */ @@ -14,4 +16,11 @@ public interface PlayerMetaController extends IDatabaseController { * @return playerData */ PlayerMeta create(Player player); + + /** + * Returns the playerMeta of the given uuid + * @param uuid uuid + * @return playerMeta + */ + PlayerMeta getByUUID(UUID uuid); } diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java index 50f43fe4c..1210d121c 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java @@ -313,6 +313,7 @@ public int getBlue() { * ParticleEffectTypes */ enum ParticleEffectType { + NONE("none", -1), EXPLOSION_NORMAL("explode", 0), EXPLOSION_LARGE("largeexplode", 1), EXPLOSION_HUGE("hugeexplosion", 2), diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java index e120680d2..3f5e3003b 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java @@ -4,7 +4,6 @@ import com.github.shynixn.petblocks.business.Config; import com.github.shynixn.petblocks.business.Language; import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; -import com.github.shynixn.petblocks.lib.AsyncRunnable; import com.github.shynixn.petblocks.lib.BukkitUtilities; import com.github.shynixn.petblocks.lib.PluginLoader; import com.github.shynixn.petblocks.lib.ReflectionLib; @@ -38,7 +37,6 @@ public void onEnable() { } else { BukkitUtilities.sendColorMessage("Loading PetBlocks ...", ChatColor.GREEN, PREFIX_CONSOLE); - PluginLoader.load(this, AsyncRunnable.class); Language.reload(this); Config.initiliaze(this); NMSRegistry.registerAll(); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/VisibilityManager.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/VisibilityManager.java index b89113b10..d27ac3e8f 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/VisibilityManager.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/VisibilityManager.java @@ -1,11 +1,12 @@ package com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish; -import com.github.shynixn.petblocks.lib.AsyncRunnable; +import com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin; import com.github.shynixn.petblocks.api.entities.PetBlock; import com.github.shynixn.petblocks.lib.ReflectionLib; import org.bukkit.Bukkit; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; import java.util.ArrayList; import java.util.HashMap; @@ -20,30 +21,24 @@ class VisibilityManager { private final Map> hiddenValues = new HashMap<>(); void hidePetBlock(final PetBlock petBlock, final Player... players) { - AsyncRunnable.toAsynchroneThread(new AsyncRunnable() { - @Override - public void run() { - if (!VisibilityManager.this.hiddenValues.containsKey(petBlock)) - VisibilityManager.this.hiddenValues.put(petBlock, new ArrayList<>()); - for (final Player player : players) { - VisibilityManager.this.sendDestroyPacket(player, petBlock.getArmorStand()); - VisibilityManager.this.sendDestroyPacket(player, petBlock.getMovementEntity()); - VisibilityManager.this.hiddenValues.get(petBlock).add(player); - } + Bukkit.getServer().getScheduler().runTaskAsynchronously(JavaPlugin.getPlugin(PetBlocksPlugin.class), () -> { + if (!VisibilityManager.this.hiddenValues.containsKey(petBlock)) + VisibilityManager.this.hiddenValues.put(petBlock, new ArrayList<>()); + for (final Player player : players) { + VisibilityManager.this.sendDestroyPacket(player, petBlock.getArmorStand()); + VisibilityManager.this.sendDestroyPacket(player, petBlock.getMovementEntity()); + VisibilityManager.this.hiddenValues.get(petBlock).add(player); } }); } void showPetBlock(final PetBlock petBlock, final Player... players) { - AsyncRunnable.toAsynchroneThread(new AsyncRunnable() { - @Override - public void run() { - if (VisibilityManager.this.hiddenValues.containsKey(petBlock)) { - for (final Player player : players) { - VisibilityManager.this.sendSpawnPacket(player, petBlock.getArmorStand()); - VisibilityManager.this.sendSpawnPacket(player, petBlock.getMovementEntity()); - VisibilityManager.this.hiddenValues.get(petBlock).add(player); - } + Bukkit.getServer().getScheduler().runTaskAsynchronously(JavaPlugin.getPlugin(PetBlocksPlugin.class), () -> { + if (VisibilityManager.this.hiddenValues.containsKey(petBlock)) { + for (final Player player : players) { + VisibilityManager.this.sendSpawnPacket(player, petBlock.getArmorStand()); + VisibilityManager.this.sendSpawnPacket(player, petBlock.getMovementEntity()); + VisibilityManager.this.hiddenValues.get(petBlock).add(player); } } }); diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java index 0db77aec0..c72ca800e 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java @@ -85,11 +85,14 @@ private EntityHuman hasHumanPassenger() { protected void doTick() { if (this.isSpecial) { this.counter = PetBlockHelper.doTick(this.counter, this, location -> { + + System.out.println("TELTEPORT TO RABBIT"); CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); final PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { ((CraftPlayer) player).getHandle().playerConnection.sendPacket(animation); } + }); } super.doTick(); @@ -97,9 +100,16 @@ protected void doTick() { @Override public void a(float sideMot, float forMot, float f2) { + + + + System.out.println("MOVE 1" + sideMot +"." + forMot + "." + f2); if (this.isSpecial) { + System.out.println("MOVE 2"); if (this.hasHumanPassenger() != null) { + System.out.println("MOVE 3"); if (this.petMeta.getMoveType() == MoveType.WALKING) { + System.out.println("1"); this.lastYaw = (this.yaw = this.hasHumanPassenger().yaw); this.pitch = (this.hasHumanPassenger().pitch * 0.5F); this.setYawPitch(this.yaw, this.pitch); @@ -286,6 +296,18 @@ public void setSkin(org.bukkit.Material material, byte data) { @Override public void remove() { + + + try + { + throw new Exception("I ORDED THE REMOVE OF THIS PETBLOCK"); + } + catch (Exception ex) + { + ex.printStackTrace(); + } + + PetBlockHelper.remove(this); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/GUI.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/GUI.java index b6e3f93d8..a004e82e8 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/GUI.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/GUI.java @@ -1,6 +1,6 @@ package com.github.shynixn.petblocks.business.logic.business; -import com.github.shynixn.petblocks.api.PetBlocksApi; +import com.github.shynixn.petblocks.api.entities.PetMeta; import com.github.shynixn.petblocks.business.Config; import com.github.shynixn.petblocks.business.Permission; import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; @@ -33,7 +33,8 @@ void open(Player player) { } } - void setMainItems(Player player, PetType petType, boolean enabled, boolean refresh) { + void setMainItems(Player player, PetType petType, boolean enabled, boolean refresh, PetMeta petMeta) { + //Thread safe if (this.manager.inventories.containsKey(player)) { if (this.manager.pages.get(player).page != GuiPage.MAIN) this.setMainItems(player); @@ -58,7 +59,7 @@ void setMainItems(Player player, PetType petType, boolean enabled, boolean refre Config.getInstance().setMyContainer(inventory, Language.COLOR_COSTUME, ConfigGUI.getInstance().getItems_colorcostumeContainer(), (Permission) null); Config.getInstance().setMyContainer(inventory, Language.CUSTOM_COSTUME, ConfigGUI.getInstance().getItems_customcostumeContainer(), (Permission) null); - if (PetBlocksApi.getPetMeta(player).isSoundsEnabled()) + if (petMeta.isSoundsEnabled()) Config.getInstance().setMyContainer(inventory, Language.MUTE, ConfigGUI.getInstance().getItems_soundEnabledContainer(), (Permission) null); else Config.getInstance().setMyContainer(inventory, Language.UNMUTE, ConfigGUI.getInstance().getItems_soundDisabledContainer(), (Permission) null); diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java index b4b5e7f98..bc3de5c7b 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java @@ -5,6 +5,7 @@ import com.github.shynixn.petblocks.api.entities.PetMeta; import com.github.shynixn.petblocks.api.entities.PetType; import com.github.shynixn.petblocks.business.Language; +import com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin; import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; @@ -19,13 +20,17 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.SkullMeta; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.java.JavaPlugin; class PetBlockCommandExecutor extends DynamicCommandHelper { private final PetBlockManager manager; + private final Plugin plugin; PetBlockCommandExecutor(PetBlockManager manager) { super(ConfigCommands.getInstance().getPetblocksConfigurationCommandContainer()); this.manager = manager; + this.plugin = JavaPlugin.getPlugin(PetBlocksPlugin.class); } @Override @@ -103,16 +108,15 @@ else if (args.length == 1 && args[0].equalsIgnoreCase("killnext") && sender inst } private void toggleSounds(Player player) { - if (PetBlocksApi.hasPetMeta(player)) { - final PetMeta petMeta = PetBlocksApi.getPetMeta(player); + this.providePet(player, (petMeta, petBlock) -> { petMeta.setSoundsEnabled(!petMeta.isSoundsEnabled()); - } + this.persistAsynchronously(petMeta); + }); } - private void setLore(Player player, String name, int line) { - if (PetBlocksApi.hasPetMeta(player)) { - final PetMeta meta = PetBlocksApi.getPetMeta(player); - name = name.replace('_', ' '); + private void setLore(Player player, String nameBump, int line) { + this.providePet(player, (meta, petBlock) -> { + String name = nameBump.replace('_', ' '); try { if (meta.getHeadLore() == null) { meta.setHeadLore(new String[line + 1]); @@ -130,21 +134,20 @@ private void setLore(Player player, String name, int line) { } catch (final Exception ex) { meta.setHeadLore(null); } - final PetBlock petBlock; - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) + this.persistAsynchronously(meta); + if (petBlock != null) petBlock.refreshHeadMeta(); - } + }); } private void setSkullName(Player player, String name) { - if (PetBlocksApi.hasPetMeta(player)) { - name = name.replace('_', ' '); - final PetMeta meta = PetBlocksApi.getPetMeta(player); - meta.setHeadDisplayName(ChatColor.translateAlternateColorCodes('&', name)); - final PetBlock petBlock; - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) + String bname = name.replace('_', ' '); + this.providePet(player, (meta, petBlock) -> { + meta.setHeadDisplayName(ChatColor.translateAlternateColorCodes('&', bname)); + this.persistAsynchronously(meta); + if (petBlock != null) petBlock.refreshHeadMeta(); - } + }); } private void killNextCommand(Player sender) { @@ -176,29 +179,28 @@ private void hatPetCommand(Player player) { private void setParticleCommand(Player player, int number) { if (ConfigParticle.getInstance().getParticleItemStacks().length > number && number >= 0 && ConfigParticle.getInstance().getParticle(number) != null) { - if (PetBlocksApi.hasPetMeta(player)) { - final PetMeta petMeta = PetBlocksApi.getPetMeta(player); - petMeta.setParticleEffect(ConfigParticle.getInstance().getParticle(number)); - final PetBlock petBlock; - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) + this.providePet(player, (meta, petBlock) -> { + meta.setParticleEffect(ConfigParticle.getInstance().getParticle(number)); + this.persistAsynchronously(meta); + if (petBlock != null) petBlock.respawn(); - } + }); } } - private void changePetSkinCommand(Player player, String skin) { + private void changePetSkinCommand(Player player, String skinBump) { try { - if (PetBlocksApi.hasPetMeta(player)) { - final PetMeta petMeta = PetBlocksApi.getPetMeta(player); + this.providePet(player, (meta, petBlock) -> { + String skin = skinBump; if (skin.contains("textures.minecraft")) { if (!skin.contains("http://")) skin = "http://" + skin; } - petMeta.setSkin(Material.SKULL_ITEM, (short) 3, skin); - final PetBlock petBlock; - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) + meta.setSkin(Material.SKULL_ITEM, (short) 3, skin); + this.persistAsynchronously(meta); + if (petBlock != null) petBlock.respawn(); - } + }); } catch (final Exception e) { player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); } @@ -206,14 +208,14 @@ private void changePetSkinCommand(Player player, String skin) { private void namePetCommand(Player player, String name) { try { - if (PetBlocksApi.hasPetMeta(player)) { - final PetMeta petMeta = PetBlocksApi.getPetMeta(player); - petMeta.setDisplayName(name); - final PetBlock petBlock; - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) + this.providePet(player, (meta, petBlock) -> { + meta.setDisplayName(name); + this.persistAsynchronously(meta); + if (petBlock != null) petBlock.respawn(); - } + }); } catch (final Exception e) { + e.printStackTrace(); player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); } } @@ -221,8 +223,9 @@ private void namePetCommand(Player player, String name) { private void togglePetCommand(Player player) { if (this.manager.hasPetBlock(player)) this.manager.removePetBlock(player); - else if (this.manager.dataManager.hasPetMeta(player)) - PetBlocksApi.setPetBlock(player, this.manager.dataManager.getPetMeta(player)); + this.providePet(player, (meta, petBlock) -> { + PetBlocksApi.setPetBlock(player, meta); + }); } private void removePetCommand(Player player) { @@ -250,18 +253,27 @@ private void setPetPlayerCommand(Player player, String soul, String costume, int } private void setPet(Player player, PetType petType, ItemStack itemStack) { - final PetMeta meta = this.manager.dataManager.createPetMeta(player, petType); - this.manager.dataManager.persist((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)meta); - if (itemStack.getType() == Material.SKULL_ITEM) { - final SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta(); - if (skullMeta.getOwner() == null) { - meta.setSkin(itemStack.getType(), itemStack.getDurability(), NMSRegistry.getSkinUrl(itemStack)); - } else { - meta.setSkin(itemStack.getType(), itemStack.getDurability(), ((SkullMeta) itemStack.getItemMeta()).getOwner()); + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + if (PetBlocksApi.hasPetMeta(player)) { + PetBlocksApi.removePetMeta(player); } - } else { - meta.setSkin(itemStack.getType(), itemStack.getDurability(), null); - } + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> { + final PetMeta meta = this.manager.dataManager.createPetMeta(player, petType); + if (itemStack.getType() == Material.SKULL_ITEM) { + final SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta(); + if (skullMeta.getOwner() == null) { + meta.setSkin(itemStack.getType(), itemStack.getDurability(), NMSRegistry.getSkinUrl(itemStack)); + } else { + meta.setSkin(itemStack.getType(), itemStack.getDurability(), ((SkullMeta) itemStack.getItemMeta()).getOwner()); + } + } else { + meta.setSkin(itemStack.getType(), itemStack.getDurability(), null); + } + this.persistAsynchronously((com.github.shynixn.petblocks.api.persistence.entity.PetMeta) meta); + if(PetBlocksApi.getPetBlock(player) != null) + PetBlocksApi.getPetBlock(player).respawn(); + }); + }); } private Player getOnlinePlayer(String name) { @@ -271,4 +283,22 @@ private Player getOnlinePlayer(String name) { } return null; } + + private void persistAsynchronously(com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta) { + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> this.manager.dataManager.persist(petMeta)); + } + + private void providePet(Player player, PetBlockListener.PetRunnable runnable) { + if (PetBlocksApi.hasPetBlock(player)) { + final PetBlock petBlock = PetBlocksApi.getPetBlock(player); + runnable.run((com.github.shynixn.petblocks.api.persistence.entity.PetMeta) petBlock.getPetMeta(), petBlock); + } else { + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + if (!PetBlocksApi.hasPetMeta(player)) + return; + final com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta = PetBlocksApi.getPetMeta(player); + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> runnable.run(petMeta, null)); + }); + } + } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java index 1a94ef768..1bcc0fe5a 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java @@ -1,5 +1,7 @@ package com.github.shynixn.petblocks.business.logic.business; +import com.github.shynixn.petblocks.api.PetBlocksApi; +import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; import com.github.shynixn.petblocks.business.Config; import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; import com.github.shynixn.petblocks.lib.*; @@ -50,6 +52,7 @@ private void run() { @EventHandler public void onEntityToggleSneakEvent(final PlayerToggleSneakEvent event) { + //Thread Safe final PetBlock petBlock; if (event.getPlayer().getPassenger() != null && this.isPet(event.getPlayer().getPassenger()) && (petBlock = this.manager.getPetBlock(event.getPlayer())) != null) { petBlock.eject(event.getPlayer()); @@ -95,7 +98,7 @@ public void onPlayerTeleportEvent(final PlayerTeleportEvent event) { if (!event.getTo().getWorld().getName().equals(event.getFrom().getWorld().getName())) { this.manager.removePetBlock(event.getPlayer()); if (Config.getInstance().allowPetSpawning(event.getTo())) { - PetBlockListener.this.manager.setPetBlock(event.getPlayer(), PetBlockListener.this.manager.dataManager.getPetMeta(event.getPlayer()), ConfigPet.getInstance().getWarpDelay()); + this.providePet(event.getPlayer(), (petMeta, petBlock) -> PetBlockListener.this.manager.setPetBlock(event.getPlayer(), petMeta, ConfigPet.getInstance().getWarpDelay())); } } else if (event.getPlayer().getPassenger() != null && this.isPet(event.getPlayer().getPassenger())) { if (!ConfigPet.getInstance().isFollow_fallOffHead()) { @@ -116,7 +119,7 @@ public void onPlayerTeleportEvent(final PlayerTeleportEvent event) { public void onPlayerRespawnEvent(final PlayerRespawnEvent event) { if (this.manager.hasPetBlock(event.getPlayer())) { this.manager.removePetBlock(event.getPlayer()); - this.plugin.getServer().getScheduler().runTaskLater(this.plugin, () -> PetBlockListener.this.manager.setPetBlock(event.getPlayer(), PetBlockListener.this.manager.dataManager.getPetMeta(event.getPlayer()), ConfigPet.getInstance().getWarpDelay()), 60L); + this.plugin.getServer().getScheduler().runTaskLater(this.plugin, () -> this.providePet(event.getPlayer(), (petMeta, petBlock) -> PetBlockListener.this.manager.setPetBlock(event.getPlayer(), petMeta, ConfigPet.getInstance().getWarpDelay())), 60L); } } @@ -143,10 +146,9 @@ private boolean isDeadPet(Entity entity) { @EventHandler(priority = EventPriority.HIGHEST) public void entityRightClickEvent(final PlayerInteractAtEntityEvent event) { if (this.manager.carryingPet.contains(event.getPlayer())) { - if (!this.manager.hasPetBlock(event.getPlayer())) - this.manager.setPetBlock(event.getPlayer(), this.manager.dataManager.getPetMeta(event.getPlayer())); Interpreter19.setItemInHand19(event.getPlayer(), null, true); - this.manager.petblocks.remove(event.getPlayer()); + if (this.manager.hasPetBlock(event.getPlayer())) + this.manager.petblocks.remove(event.getPlayer()); event.setCancelled(true); } else if (this.isPet(event.getRightClicked())) { final PetBlock petBlock = this.getPet(event.getRightClicked()); @@ -177,7 +179,7 @@ public void entityRightClickEvent(final PlayerInteractAtEntityEvent event) { @EventHandler public void onPlayerInteractEvent(PlayerInteractEvent event) { if (this.manager.carryingPet.contains(event.getPlayer())) { - this.handleClickOnEntity(event); + this.removePetFromArm(event.getPlayer()); event.setCancelled(true); } } @@ -201,7 +203,7 @@ public void onInventoryOpenEvent(InventoryOpenEvent event) { @EventHandler public void onPlayerEntityEvent(PlayerInteractEntityEvent event) { if (this.manager.carryingPet.contains(event.getPlayer())) { - this.handleClickOnEntity(event); + this.removePetFromArm(event.getPlayer()); event.setCancelled(true); } } @@ -209,10 +211,7 @@ public void onPlayerEntityEvent(PlayerInteractEntityEvent event) { @EventHandler public void onPlayerDeathEvent(PlayerDeathEvent event) { if (this.manager.carryingPet.contains(event.getEntity())) { - if (!this.manager.hasPetBlock(event.getEntity())) - this.manager.setPetBlock(event.getEntity(), this.manager.dataManager.getPetMeta(event.getEntity())); - Interpreter19.setItemInHand19(event.getEntity(), null, true); - this.manager.carryingPet.remove(event.getEntity()); + this.removePetFromArm(event.getEntity()); } } @@ -228,10 +227,7 @@ public void onPlayerQuitEvent(PlayerQuitEvent event) { public void onInventoryOpen(InventoryClickEvent event) { final Player player = (Player) event.getWhoClicked(); if (this.manager.carryingPet.contains(player)) { - if (!this.manager.hasPetBlock((Player) event.getWhoClicked())) - this.manager.setPetBlock((Player) event.getWhoClicked(), this.manager.dataManager.getPetMeta((Player) event.getWhoClicked())); - Interpreter19.setItemInHand19((Player) event.getWhoClicked(), null, true); - this.manager.carryingPet.remove(player); + this.removePetFromArm((Player) event.getWhoClicked()); event.setCancelled(true); } } @@ -239,21 +235,16 @@ public void onInventoryOpen(InventoryClickEvent event) { @EventHandler public void onPlayerDropItem(PlayerDropItemEvent event) { if (this.manager.carryingPet.contains(event.getPlayer())) { - if (!this.manager.hasPetBlock(event.getPlayer())) - this.manager.setPetBlock(event.getPlayer(), this.manager.dataManager.getPetMeta(event.getPlayer())); - this.manager.carryingPet.remove(event.getPlayer()); + this.removePetFromArm(event.getPlayer()); event.getItemDrop().remove(); - Interpreter19.setItemInHand19(event.getPlayer(), null, true); } } @EventHandler public void onSlotChange(PlayerItemHeldEvent event) { if (this.manager.carryingPet.contains(event.getPlayer())) { - if (!this.manager.hasPetBlock(event.getPlayer())) - this.manager.setPetBlock(event.getPlayer(), this.manager.dataManager.getPetMeta(event.getPlayer())); + this.removePetFromArm(event.getPlayer()); event.getPlayer().getInventory().setItem(event.getPreviousSlot(), null); - this.manager.carryingPet.remove(event.getPlayer()); } } @@ -271,13 +262,6 @@ else if (event.getCause() == DamageCause.FALL) } } - private void handleClickOnEntity(PlayerEvent event) { - if (!this.manager.hasPetBlock(event.getPlayer())) - this.manager.setPetBlock(event.getPlayer(), this.manager.dataManager.getPetMeta(event.getPlayer())); - Interpreter19.setItemInHand19(event.getPlayer(), null, true); - this.manager.carryingPet.remove(event.getPlayer()); - } - private PetBlock getPet(Entity entity) { try { for (final PetBlock block : this.manager.petblocks.values()) { @@ -296,14 +280,20 @@ private boolean isPet(Entity entity) { private class ParticleRunnable implements Runnable { @Override public void run() { + //ThreadSafe for (final Player player : PetBlockListener.this.manager.carryingPet.toArray(new Player[PetBlockListener.this.manager.carryingPet.size()])) { ParticleEffect.HEART.display(0.5F, 0.5F, 0.5F, 0.1F, 1, player.getLocation().add(0, 1, 0), player.getWorld().getPlayers()); } for (final Player player : PetBlockListener.this.manager.petblocks.keySet().toArray(new Player[PetBlockListener.this.manager.petblocks.size()])) { if (PetBlockListener.this.manager.petblocks.get(player).isDead() || !Config.getInstance().allowPetSpawning(player.getLocation())) { PetBlockListener.this.manager.removePetBlock(player); - if (player.isOnline() && Config.getInstance().allowPetSpawning(player.getLocation())) - PetBlockListener.this.manager.setPetBlock(player, PetBlockListener.this.manager.dataManager.getPetMeta(player)); + if (player.isOnline() && Config.getInstance().allowPetSpawning(player.getLocation())) { + PetBlockListener.this.plugin.getServer().getScheduler().runTaskAsynchronously(PetBlockListener.this.plugin, () -> { + final PetMeta petMeta = PetBlockListener.this.manager.dataManager.getPetMeta(player); + PetBlockListener.this.plugin.getServer().getScheduler().runTask(PetBlockListener.this.plugin, () -> PetBlockListener.this.manager.setPetBlock(player, petMeta)); + }); + } + } } } @@ -316,7 +306,8 @@ public void run() { PetBlockListener.this.manager.timeBlocked.put(player, PetBlockListener.this.manager.timeBlocked.get(player) - 1); if (PetBlockListener.this.manager.timeBlocked.get(player) <= 0) { PetBlockListener.this.manager.timeBlocked.remove(player); - PetBlockListener.this.manager.setPetBlock(player, PetBlockListener.this.manager.dataManager.getPetMeta(player)); + providePet(player, (petMeta, petBlock) -> PetBlockListener.this.manager.setPetBlock(player, petMeta)); + } } int counter = 0; @@ -337,4 +328,29 @@ else if (counter > 0) BukkitUtilities.sendColorMessage("PetHunter " + ChatColor.GREEN + '>' + ChatColor.YELLOW + " Removed " + counter + " pet.", ChatColor.YELLOW, PetBlocksPlugin.PREFIX_CONSOLE); } } + + private void removePetFromArm(Player player) { + this.providePet(player, (petMeta, petBlock) -> { + if (petBlock == null) + this.manager.setPetBlock(player, petMeta); + Interpreter19.setItemInHand19(player, null, true); + this.manager.carryingPet.remove(player); + }); + } + + private void providePet(Player player, PetRunnable runnable) { + if (PetBlocksApi.hasPetBlock(player)) { + final PetBlock petBlock = PetBlocksApi.getPetBlock(player); + runnable.run((PetMeta) petBlock.getPetMeta(), petBlock); + } else { + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + final PetMeta petMeta = PetBlocksApi.getPetMeta(player); + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> runnable.run(petMeta, null)); + }); + } + } + + interface PetRunnable { + void run(PetMeta petMeta, PetBlock petBlock); + } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java index cfb4c5864..5eab646a1 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.java @@ -62,6 +62,8 @@ public void removePetBlock(Player player) { if (this.hasPetBlock(player)) { final PetBlockDeathEvent event = new PetBlockDeathEvent(this.petblocks.get(player)); Bukkit.getPluginManager().callEvent(event); + final com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta = (com.github.shynixn.petblocks.api.persistence.entity.PetMeta) this.petblocks.get(player).getPetMeta(); + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> this.dataManager.persist(petMeta)); if (!event.isCanceled()) { this.petblocks.get(player).remove(); this.petblocks.remove(player); diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataCommandExecutor.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataCommandExecutor.java index 37d366307..ad066848c 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataCommandExecutor.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataCommandExecutor.java @@ -6,19 +6,27 @@ import com.github.shynixn.petblocks.business.Config; import com.github.shynixn.petblocks.business.Language; import com.github.shynixn.petblocks.business.Permission; +import com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin; import com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands; import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; import com.github.shynixn.petblocks.lib.DynamicCommandHelper; import org.bukkit.Material; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.java.JavaPlugin; + +import java.util.concurrent.RunnableFuture; class PetDataCommandExecutor extends DynamicCommandHelper { private final PetDataManager manager; + private final Plugin plugin; PetDataCommandExecutor(PetDataManager petDataManager) { super(ConfigCommands.getInstance().getPetblockGuiCommandContainer()); this.manager = petDataManager; + this.plugin = JavaPlugin.getPlugin(PetBlocksPlugin.class); } @Override @@ -35,44 +43,84 @@ public void onCommandSend(CommandSender sender, String[] args) { } else if (args.length == 1 && args[0].equalsIgnoreCase("toggle")) { if (PetBlocksApi.hasPetBlock(player)) PetBlocksApi.removePetBlock(player); - else if (PetBlocksApi.hasPetMeta(player)) - PetBlocksApi.setPetBlock(player, PetBlocksApi.getPetMeta(player)); - } else if (args.length == 2 && args[0].equalsIgnoreCase("rename") && player.hasPermission(Permission.RENAMEPET.get())) { - if (args[1].length() > ConfigPet.getInstance().getDesign_maxPetNameLength()) - player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); else { - try { - if (PetBlocksApi.hasPetMeta(player)) - PetBlocksApi.getPetMeta(player).setDisplayName(args[1]); - final PetBlock petBlock; - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) - petBlock.respawn(); - player.sendMessage(Language.PREFIX + Language.NAME_SUCCES_MESSAGE); - } catch (final Exception e) { - player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); - } + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + final com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta = PetDataCommandExecutor.this.manager.getPetMeta(player); + if (petMeta != null) { + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> PetBlocksApi.setPetBlock(player, petMeta)); + } + }); } + } else if (args.length == 2 && args[0].equalsIgnoreCase("rename") && player.hasPermission(Permission.RENAMEPET.get())) { + this.handleNaming(player, args[1], false); } else if (args.length == 2 && args[0].equalsIgnoreCase("skin") && player.hasPermission(Permission.RENAMESKULL.get())) { - if (args[1].length() > 20) - player.sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); - else { - try { - if (PetBlocksApi.hasPetMeta(player)) - PetBlocksApi.getPetMeta(player).setSkin(Material.SKULL_ITEM, (short) 3, args[1]); - final PetBlock petBlock; - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) - petBlock.respawn(); - player.sendMessage(Language.PREFIX + Language.SNAME_SUCCES_MESSAGE); - } catch (final Exception e) { - player.sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); - } - } + this.handleNaming(player, args[1], true); } else { this.manager.gui.open(player); this.manager.gui.setMainItems(player); - final PetMeta petMeta; - if ((petMeta = this.manager.getPetMeta(player)) != null) - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), true); + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + final PetMeta petMeta; + if ((petMeta = this.manager.getPetMeta(player)) != null) { + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), true, petMeta)); + } + }); } } + + private void handleNaming(Player player, String message, boolean skullNaming) { + if (PetBlocksApi.hasPetBlock(player)) { + final PetBlock petBlock = PetBlocksApi.getPetBlock(player); + if (skullNaming) { + this.renameSkull(player, message, (com.github.shynixn.petblocks.api.persistence.entity.PetMeta) petBlock.getPetMeta(), petBlock); + } else { + this.renameName(player, message, (com.github.shynixn.petblocks.api.persistence.entity.PetMeta) petBlock.getPetMeta(), petBlock); + + } + } else { + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + final com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta = this.manager.getPetMeta(player); + if (skullNaming) { + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> this.renameSkull(player, message, petMeta, null)); + } else { + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> this.renameName(player, message, petMeta, null)); + } + }); + } + } + + private void renameName(Player player, String message, com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta, PetBlock petBlock) { + if (message.length() > ConfigPet.getInstance().getDesign_maxPetNameLength()) { + player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); + } else { + try { + petMeta.setDisplayName(message); + this.persistAsynchronously(petMeta); + if (petBlock != null) + petBlock.respawn(); + player.sendMessage(Language.PREFIX + Language.NAME_SUCCES_MESSAGE); + } catch (final Exception e) { + player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); + } + } + } + + private void renameSkull(Player player, String message, com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta, PetBlock petBlock) { + if (message.length() > 20) { + player.sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); + } else { + try { + petMeta.setSkin(Material.SKULL_ITEM, (short) 3, message); + this.persistAsynchronously(petMeta); + if (petBlock != null) + petBlock.respawn(); + player.sendMessage(Language.PREFIX + Language.SNAME_SUCCES_MESSAGE); + } catch (final Exception e) { + player.sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); + } + } + } + + private void persistAsynchronously(com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta) { + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> this.manager.persist(petMeta)); + } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java index 6b247663e..9f9a79f83 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java @@ -1,8 +1,5 @@ package com.github.shynixn.petblocks.business.logic.business; -import java.util.ArrayList; -import java.util.List; - import com.github.shynixn.petblocks.api.PetBlocksApi; import com.github.shynixn.petblocks.api.entities.PetBlock; import com.github.shynixn.petblocks.api.entities.PetMeta; @@ -14,6 +11,7 @@ import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; import com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle; import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; +import com.github.shynixn.petblocks.lib.BukkitUtilities; import com.github.shynixn.petblocks.lib.SimpleListener; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -28,16 +26,19 @@ import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; -import com.github.shynixn.petblocks.lib.BukkitUtilities; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; @SuppressWarnings("deprecation") class PetDataListener extends SimpleListener { private final PetDataManager manager; private final List namingPlayers = new ArrayList<>(); private final List namingSkull = new ArrayList<>(); + private final Set changingPlayers = new HashSet<>(); PetDataListener(PetDataManager manager, Plugin plugin) { super(plugin); @@ -46,182 +47,42 @@ class PetDataListener extends SimpleListener { @EventHandler public void playerClickEvent(final InventoryClickEvent event) { - PetMeta petMeta; - PetBlock petBlock; final Player player = (Player) event.getWhoClicked(); if (event.getView().getTopInventory().getTitle().equals(Language.GUI_TITLE) && this.manager.inventories.containsKey(player) && this.manager.inventories.get(player).equals(event.getInventory())) { - if (this.manager.gui.getPetType(event.getCurrentItem()) != null) { - final PetType type = this.manager.gui.getPetType(event.getCurrentItem()); - if (player.hasPermission(Permission.ALLPETTYPES.get()) || player.hasPermission(Permission.SINGLEPETTYPE.get() + type.name().toLowerCase())) { - if (PetBlocksApi.hasPetBlock(player)) - PetBlocksApi.removePetBlock(player); - petMeta = this.manager.createPetMeta(player, type); - if (ConfigGUI.getInstance().isSettings_copyskin()) { - petMeta.setSkin(Material.SKULL_ITEM, (short) 3, ConfigGUI.getInstance().getContainer(petMeta.getType()).getSkullName()); - } - this.manager.persist((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)petMeta); - this.manager.gui.setMainItems(player, petMeta.getType(), false, true); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.MY_PET) && ((petMeta = this.manager.getPetMeta(player)) != null)) { - if (ConfigGUI.getInstance().isSettings_copyskin()) { - petMeta.setSkin(Material.SKULL_ITEM, (short) 3, ConfigGUI.getInstance().getContainer(petMeta.getType()).getSkullName()); - } else { - petMeta.setSkin(Material.getMaterial(ConfigGUI.getInstance().getItems_defaultcostumeContainer().getId()), (short) ConfigGUI.getInstance().getItems_defaultcostumeContainer().getDamage(), ConfigGUI.getInstance().getItems_defaultcostumeContainer().getSkullName()); - } - petMeta.setParticleEffect(null); - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) - petBlock.respawn(); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.ENABLE_PET) && ((petMeta = this.manager.getPetMeta(player)) != null)) { - PetBlocksApi.setPetBlock(player, petMeta); - this.manager.gui.setMainItems(player, petMeta.getType(), true, false); - petMeta.setEnabled(true); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.DISABLE_PET) && ((petMeta = this.manager.getPetMeta(player)) != null) && PetBlocksApi.hasPetBlock(player)) { - PetBlocksApi.removePetBlock(player); - this.manager.gui.setMainItems(player, petMeta.getType(), false, false); - petMeta.setEnabled(false); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.MUTE) && ((petMeta = this.manager.getPetMeta(player)) != null)) { - PetBlocksApi.getPetMeta(player).setSoundsEnabled(false); - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.UNMUTE) && ((petMeta = this.manager.getPetMeta(player)) != null)) { - PetBlocksApi.getPetMeta(player).setSoundsEnabled(true); - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.PREVIOUS)) { - this.manager.gui.setCostumes(player, this.manager.gui.getItemstackFromPage(this.manager.pages.get(player).page), this.manager.pages.get(player).page, 2); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.NEXT)) { - this.manager.gui.setCostumes(player, this.manager.gui.getItemstackFromPage(this.manager.pages.get(player).page), this.manager.pages.get(player).page, 1); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.COSTUME)) { - this.manager.gui.setDefaultCostumeItems(player); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.COLOR_COSTUME)) { - this.manager.gui.setColorCostumeItems(player); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CUSTOM_COSTUME)) { - this.manager.gui.setCustomCostumeItems(player); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.PARTICLE)) { - this.manager.gui.setParticleCostumeItems(player); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CALL) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { - petBlock.teleport(player); - player.closeInventory(); - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.HAT) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { - if (player.hasPermission(Permission.WEARPET.get())) { - petBlock.wear(player); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.RIDING) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { - if (player.hasPermission(Permission.RIDEPET.get())) { - petBlock.ride(player); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.NAMING)) { - if (player.hasPermission(Permission.RENAMEPET.get())) { - this.namingPlayers.add(player); - player.closeInventory(); - player.sendMessage(Language.PREFIX + Language.NAME_MESSAGE); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.SKULL_NAMING)) { - if (player.hasPermission(Permission.RENAMESKULL.get())) { - this.namingSkull.add(player); - player.closeInventory(); - player.sendMessage(Language.PREFIX + Language.SNAME_MESSAGE); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CANNON) && ((petBlock = PetBlocksApi.getPetBlock(player)) != null)) { - if (player.hasPermission(Permission.CANNON.get())) { - player.closeInventory(); - petBlock.launch(this.getDirection(player)); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CANCEL)) { - player.closeInventory(); - } else if (this.manager.pages.get(player).page == GUI.GuiPage.PARTICLES && ((petMeta = this.manager.getPetMeta(player)) != null)) { - if (!player.hasPermission(Permission.ALLPARTICLES.get()) && !player.hasPermission(Permission.SINGLEPARTICLE.get() + "" + event.getSlot())) { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } else { - petMeta.setParticleEffect(ConfigParticle.getInstance().getParticle(event.getSlot())); - } - player.closeInventory(); - this.manager.gui.open(player); - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) - petBlock.respawn(); - } else if (!BukkitUtilities.compareItemName(event.getCurrentItem(), Language.EMPTY) && (this.manager.pages.get(player).page == GUI.GuiPage.DEFAULTCOSTUMES || this.manager.pages.get(player).page == GUI.GuiPage.CUSTOMCOSTUMES || this.manager.pages.get(player).page == GUI.GuiPage.COLORCOSTUMES) && event.getCurrentItem() != null) { - final int number; - try { - String s = event.getCurrentItem().getItemMeta().getDisplayName(); - s = ChatColor.stripColor(s); - number = Integer.parseInt(s); - } catch (final Exception ex) { - BukkitUtilities.sendColorMessage("Number prefix (lang.yml) only allows color codes!", ChatColor.RED, "[PetBlocks]"); - player.sendMessage(ChatColor.RED + "Number-prefix (lang.yml) only allows color codes! Contact an admin in order to resolve this issue."); - player.closeInventory(); - return; - } - if (this.manager.pages.get(player).page == GUI.GuiPage.DEFAULTCOSTUMES && (!player.hasPermission(Permission.ALLDEFAULTCOSTUMES.get()) && !player.hasPermission(Permission.SINGLEDEFAULTCOSTUME.get() + "" + number))) { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } else if (this.manager.pages.get(player).page == GUI.GuiPage.COLORCOSTUMES && (!player.hasPermission(Permission.ALLCOLORCOSTUMES.get()) && !player.hasPermission(Permission.SINGLECOLORCOSTUME.get() + "" + number))) { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } else if (this.manager.pages.get(player).page == GUI.GuiPage.CUSTOMCOSTUMES && (!player.hasPermission(Permission.ALLCUSTOMCOSTUMES.get()) && !player.hasPermission(Permission.SINGLECUSTOMCOSTUME.get() + "" + number))) { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } else if (event.getClickedInventory().equals(event.getView().getTopInventory()) || player.hasPermission(Permission.OWNINGAMECOSTUMES.get())) { - petMeta = this.manager.getPetMeta(player); - if (petMeta == null) - return; - if (event.getCurrentItem().getType() != Material.SKULL_ITEM) - petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), null); - else { - final SkullMeta meta = (SkullMeta) event.getCurrentItem().getItemMeta(); - if (meta.getOwner() == null) { - petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), NMSRegistry.getSkinUrl(event.getCurrentItem())); - } else { - petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), ((SkullMeta) event.getCurrentItem().getItemMeta()).getOwner()); - } - } - petMeta.setUnbreakable(NMSRegistry.isUnbreakable(event.getCurrentItem())); - player.closeInventory(); - this.manager.gui.open(player); - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false); - if ((petBlock = PetBlocksApi.getPetBlock(player)) != null) - petBlock.respawn(); - } else { - player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); - } - } else if (ConfigGUI.getInstance().isSettings_clickemptyback() && BukkitUtilities.compareItemName(event.getCurrentItem(), Language.EMPTY)) { - petMeta = PetBlocksApi.getPetMeta(player); - if (this.manager.pages.containsKey(player) && this.manager.pages.get(player).page != GUI.GuiPage.MAIN) { - this.manager.gui.setMainItems(player); - if (petMeta != null) - this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), true); - } - } event.setCancelled(true); ((Player) event.getWhoClicked()).updateInventory(); + if (PetBlocksApi.hasPetBlock(player)) { + final PetBlock petBlock = PetBlocksApi.getPetBlock(player); + this.handleClick(event, player, (com.github.shynixn.petblocks.api.persistence.entity.PetMeta) petBlock.getPetMeta(), petBlock); + } else { + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + final com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta = this.manager.getPetMeta(player); + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> this.handleClick(event, player, petMeta, null)); + }); + } } } @EventHandler public void playerJoinEvent(final PlayerJoinEvent event) { - final PetMeta petMeta; - if (Config.getInstance().isJoin_enabled()) { - if (!this.manager.hasPetMeta(event.getPlayer()) || Config.getInstance().isJoin_overwriteExistingPet()) { - final PetMeta meta = this.manager.createPetMeta(event.getPlayer(), PetType.CAT); - Config.getInstance().fixJoinDefaultPet((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)meta); - this.manager.persist((com.github.shynixn.petblocks.api.persistence.entity.PetMeta)meta); + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + final PetMeta petMeta; + if (Config.getInstance().isJoin_enabled()) { + if (!this.manager.hasPetMeta(event.getPlayer()) || Config.getInstance().isJoin_overwriteExistingPet()) { + final PetMeta meta = this.manager.createPetMeta(event.getPlayer(), PetType.CAT); + Config.getInstance().fixJoinDefaultPet((com.github.shynixn.petblocks.api.persistence.entity.PetMeta) meta); + this.manager.persist((com.github.shynixn.petblocks.api.persistence.entity.PetMeta) meta); + } + } else { + this.manager.hasPetMeta(event.getPlayer()); } - } else { - this.manager.hasPetMeta(event.getPlayer()); - } - if ((petMeta = PetBlocksApi.getPetMeta(event.getPlayer())) != null && petMeta.isEnabled()) { - this.plugin.getServer().getScheduler().runTaskLater(this.plugin, () -> { - PetBlocksApi.removePetBlock(event.getPlayer()); - PetBlocksApi.setPetBlock(event.getPlayer(), PetDataListener.this.manager.getPetMeta(event.getPlayer())); - }, 2L); - } + if ((petMeta = PetBlocksApi.getPetMeta(event.getPlayer())) != null && petMeta.isEnabled()) { + this.plugin.getServer().getScheduler().runTaskLater(this.plugin, () -> { + PetBlocksApi.removePetBlock(event.getPlayer()); + PetBlocksApi.setPetBlock(event.getPlayer(), petMeta); + }, 2L); + } + }); } @EventHandler @@ -272,45 +133,237 @@ public void playerChatEvent4(final AsyncPlayerChatEvent event) { } } - private void handleChatMessage(PlayerChatEvent event) { - if (this.namingPlayers.contains(event.getPlayer())) { - event.setCancelled(true); - if (event.getMessage().length() > ConfigPet.getInstance().getDesign_maxPetNameLength()) - event.getPlayer().sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); - else { - try { - this.namingPlayers.remove(event.getPlayer()); - final PetMeta petMeta; - final PetBlock petBlock; - if ((petMeta = this.manager.getPetMeta(event.getPlayer())) != null) { - petMeta.setDisplayName(event.getMessage()); + private void handleClick(InventoryClickEvent event, Player player, com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta, PetBlock petBlock) { + if(this.changingPlayers.contains(player)) + return; + if (this.manager.gui.getPetType(event.getCurrentItem()) != null) { + final PetType type = this.manager.gui.getPetType(event.getCurrentItem()); + if (player.hasPermission(Permission.ALLPETTYPES.get()) || player.hasPermission(Permission.SINGLEPETTYPE.get() + type.name().toLowerCase())) { + if (PetBlocksApi.hasPetBlock(player)) + PetBlocksApi.removePetBlock(player); + this.changingPlayers.add(player); + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + final com.github.shynixn.petblocks.api.persistence.entity.PetMeta meta = this.manager.getPetMeta(player); + if (meta != null) { + this.manager.remove(meta); } - if ((petBlock = PetBlocksApi.getPetBlock(event.getPlayer())) != null) - petBlock.respawn(); - event.getPlayer().sendMessage(Language.PREFIX + Language.NAME_SUCCES_MESSAGE); - } catch (final Exception e) { - event.getPlayer().sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); - } + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> { + final com.github.shynixn.petblocks.api.persistence.entity.PetMeta currentPetMeta = PetDataListener.this.manager.createPetMeta(player, type); + if (ConfigGUI.getInstance().isSettings_copyskin()) { + currentPetMeta.setSkin(Material.SKULL_ITEM, (short) 3, ConfigGUI.getInstance().getContainer(currentPetMeta.getType()).getSkullName()); + } + System.out.println("REFRESH TO NOT ENABLED"); + PetDataListener.this.manager.gui.setMainItems(player, currentPetMeta.getType(), false, true, currentPetMeta); + + PetDataListener.this.plugin.getServer().getScheduler().runTaskAsynchronously(PetDataListener.this.plugin, () -> { + PetDataListener.this.manager.persist(currentPetMeta); + PetDataListener.this.plugin.getServer().getScheduler().runTask(PetDataListener.this.plugin, () -> PetDataListener.this.changingPlayers.remove(player)); + }); + }); + }); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); } - } else if (this.namingSkull.contains(event.getPlayer())) { - event.setCancelled(true); - if (event.getMessage().length() > 20) - event.getPlayer().sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); - else { - try { - this.namingSkull.remove(event.getPlayer()); - final PetMeta petMeta; - final PetBlock petBlock; - if ((petMeta = this.manager.getPetMeta(event.getPlayer())) != null) { - petMeta.setSkin(Material.SKULL_ITEM, (short) 3, event.getMessage()); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.MY_PET)) { + if (ConfigGUI.getInstance().isSettings_copyskin()) { + petMeta.setSkin(Material.SKULL_ITEM, (short) 3, ConfigGUI.getInstance().getContainer(petMeta.getType()).getSkullName()); + } else { + petMeta.setSkin(Material.getMaterial(ConfigGUI.getInstance().getItems_defaultcostumeContainer().getId()), (short) ConfigGUI.getInstance().getItems_defaultcostumeContainer().getDamage(), ConfigGUI.getInstance().getItems_defaultcostumeContainer().getSkullName()); + } + petMeta.setParticleEffect(null); + if (petBlock != null) { + petBlock.respawn(); + } + this.persistAsynchronously(petMeta); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.ENABLE_PET) && petMeta != null) { + petMeta.setEnabled(true); + PetBlocksApi.setPetBlock(player, petMeta); + PetDataListener.this.manager.gui.setMainItems(player, petMeta.getType(), true, false, petMeta); + this.persistAsynchronously(petMeta); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.DISABLE_PET)&& petMeta != null) { + petMeta.setEnabled(false); + PetBlocksApi.removePetBlock(player); + this.manager.gui.setMainItems(player, petMeta.getType(), false, false, petMeta); + this.persistAsynchronously(petMeta); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.MUTE)&& petMeta != null) { + petMeta.setSoundsEnabled(false); + this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false, petMeta); + this.persistAsynchronously(petMeta); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.UNMUTE)) { + petMeta.setSoundsEnabled(true); + this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false, petMeta); + this.persistAsynchronously(petMeta); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.PREVIOUS)) { + this.manager.gui.setCostumes(player, this.manager.gui.getItemstackFromPage(this.manager.pages.get(player).page), this.manager.pages.get(player).page, 2); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.NEXT)) { + this.manager.gui.setCostumes(player, this.manager.gui.getItemstackFromPage(this.manager.pages.get(player).page), this.manager.pages.get(player).page, 1); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.COSTUME)) { + this.manager.gui.setDefaultCostumeItems(player); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.COLOR_COSTUME)) { + this.manager.gui.setColorCostumeItems(player); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CUSTOM_COSTUME)) { + this.manager.gui.setCustomCostumeItems(player); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.PARTICLE)) { + this.manager.gui.setParticleCostumeItems(player); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CALL) && petBlock != null) { + petBlock.teleport(player); + player.closeInventory(); + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.HAT) && petBlock != null) { + if (player.hasPermission(Permission.WEARPET.get())) { + petBlock.wear(player); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.RIDING) && petBlock != null) { + if (player.hasPermission(Permission.RIDEPET.get())) { + petBlock.ride(player); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.NAMING)) { + if (player.hasPermission(Permission.RENAMEPET.get())) { + this.namingPlayers.add(player); + player.closeInventory(); + player.sendMessage(Language.PREFIX + Language.NAME_MESSAGE); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.SKULL_NAMING)) { + if (player.hasPermission(Permission.RENAMESKULL.get())) { + this.namingSkull.add(player); + player.closeInventory(); + player.sendMessage(Language.PREFIX + Language.SNAME_MESSAGE); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CANNON) && petBlock != null) { + if (player.hasPermission(Permission.CANNON.get())) { + player.closeInventory(); + petBlock.launch(this.getDirection(player)); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (BukkitUtilities.compareItemName(event.getCurrentItem(), Language.CANCEL)) { + player.closeInventory(); + } else if (this.manager.pages.get(player).page == GUI.GuiPage.PARTICLES) { + if (!player.hasPermission(Permission.ALLPARTICLES.get()) && !player.hasPermission(Permission.SINGLEPARTICLE.get() + "" + event.getSlot())) { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } else { + petMeta.setParticleEffect(ConfigParticle.getInstance().getParticle(event.getSlot())); + } + player.closeInventory(); + this.manager.gui.open(player); + this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false, petMeta); + this.persistAsynchronously(petMeta); + if (petBlock != null) + petBlock.respawn(); + } else if (!BukkitUtilities.compareItemName(event.getCurrentItem(), Language.EMPTY) && (this.manager.pages.get(player).page == GUI.GuiPage.DEFAULTCOSTUMES || this.manager.pages.get(player).page == GUI.GuiPage.CUSTOMCOSTUMES || this.manager.pages.get(player).page == GUI.GuiPage.COLORCOSTUMES) && event.getCurrentItem() != null) { + final int number; + try { + String s = event.getCurrentItem().getItemMeta().getDisplayName(); + s = ChatColor.stripColor(s); + number = Integer.parseInt(s); + } catch (final Exception ex) { + BukkitUtilities.sendColorMessage("Number prefix (lang.yml) only allows color codes!", ChatColor.RED, "[PetBlocks]"); + player.sendMessage(ChatColor.RED + "Number-prefix (lang.yml) only allows color codes! Contact an admin in order to resolve this issue."); + player.closeInventory(); + return; + } + if (this.manager.pages.get(player).page == GUI.GuiPage.DEFAULTCOSTUMES && (!player.hasPermission(Permission.ALLDEFAULTCOSTUMES.get()) && !player.hasPermission(Permission.SINGLEDEFAULTCOSTUME.get() + "" + number))) { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } else if (this.manager.pages.get(player).page == GUI.GuiPage.COLORCOSTUMES && (!player.hasPermission(Permission.ALLCOLORCOSTUMES.get()) && !player.hasPermission(Permission.SINGLECOLORCOSTUME.get() + "" + number))) { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } else if (this.manager.pages.get(player).page == GUI.GuiPage.CUSTOMCOSTUMES && (!player.hasPermission(Permission.ALLCUSTOMCOSTUMES.get()) && !player.hasPermission(Permission.SINGLECUSTOMCOSTUME.get() + "" + number))) { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } else if (event.getClickedInventory().equals(event.getView().getTopInventory()) || player.hasPermission(Permission.OWNINGAMECOSTUMES.get())) { + if (petMeta == null) + return; + if (event.getCurrentItem().getType() != Material.SKULL_ITEM) + petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), null); + else { + final SkullMeta meta = (SkullMeta) event.getCurrentItem().getItemMeta(); + if (meta.getOwner() == null) { + petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), NMSRegistry.getSkinUrl(event.getCurrentItem())); + } else { + petMeta.setSkin(event.getCurrentItem().getType(), event.getCurrentItem().getDurability(), ((SkullMeta) event.getCurrentItem().getItemMeta()).getOwner()); } - if ((petBlock = PetBlocksApi.getPetBlock(event.getPlayer())) != null) - petBlock.respawn(); - event.getPlayer().sendMessage(Language.PREFIX + Language.SNAME_SUCCES_MESSAGE); - } catch (final Exception e) { - event.getPlayer().sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); } + petMeta.setUnbreakable(NMSRegistry.isUnbreakable(event.getCurrentItem())); + player.closeInventory(); + this.manager.gui.open(player); + this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), false, petMeta); + this.persistAsynchronously(petMeta); + if (petBlock != null) + petBlock.respawn(); + } else { + player.sendMessage(Language.PREFIX + Language.NO_PERMISSION); + } + } else if (ConfigGUI.getInstance().isSettings_clickemptyback() && BukkitUtilities.compareItemName(event.getCurrentItem(), Language.EMPTY)) { + if (this.manager.pages.containsKey(player) && this.manager.pages.get(player).page != GUI.GuiPage.MAIN) { + this.manager.gui.setMainItems(player); + if (petMeta != null) + this.manager.gui.setMainItems(player, petMeta.getType(), PetBlocksApi.hasPetBlock(player), true, petMeta); + } + } + } + + private void persistAsynchronously(com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta) { + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> this.manager.persist(petMeta)); + } + + private void renameName(Player player, String message, com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta, PetBlock petBlock) { + if (message.length() > ConfigPet.getInstance().getDesign_maxPetNameLength()) { + player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); + } else { + try { + this.namingPlayers.remove(player); + petMeta.setDisplayName(message); + this.persistAsynchronously(petMeta); + if (petBlock != null) + petBlock.respawn(); + player.sendMessage(Language.PREFIX + Language.NAME_SUCCES_MESSAGE); + } catch (final Exception e) { + player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); + } + } + } + + private void renameSkull(Player player, String message, com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta, PetBlock petBlock) { + if (message.length() > 20) { + player.sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); + } else { + try { + this.namingSkull.remove(player); + petMeta.setSkin(Material.SKULL_ITEM, (short) 3, message); + this.persistAsynchronously(petMeta); + if (petBlock != null) + petBlock.respawn(); + player.sendMessage(Language.PREFIX + Language.SNAME_SUCCES_MESSAGE); + } catch (final Exception e) { + player.sendMessage(Language.PREFIX + Language.SNAME_ERROR_MESSAGE); + } + } + } + + private void handleChatMessage(PlayerChatEvent event) { + if (this.namingPlayers.contains(event.getPlayer()) || this.namingSkull.contains(event.getPlayer())) + event.setCancelled(true); + if (PetBlocksApi.hasPetBlock(event.getPlayer())) { + final PetBlock petBlock = PetBlocksApi.getPetBlock(event.getPlayer()); + if (this.namingSkull.contains(event.getPlayer())) { + this.renameSkull(event.getPlayer(), event.getMessage(), (com.github.shynixn.petblocks.api.persistence.entity.PetMeta) petBlock.getPetMeta(), petBlock); + } else if (this.namingPlayers.contains(event.getPlayer())) { + this.renameName(event.getPlayer(), event.getMessage(), (com.github.shynixn.petblocks.api.persistence.entity.PetMeta) petBlock.getPetMeta(), petBlock); } + } else { + this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { + final com.github.shynixn.petblocks.api.persistence.entity.PetMeta petMeta = this.manager.getPetMeta(event.getPlayer()); + if (this.namingSkull.contains(event.getPlayer())) { + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> this.renameSkull(event.getPlayer(), event.getMessage(), petMeta, null)); + } else if (this.namingPlayers.contains(event.getPlayer())) { + this.plugin.getServer().getScheduler().runTask(this.plugin, () -> this.renameName(event.getPlayer(), event.getMessage(), petMeta, null)); + } + }); } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java index cdda2825f..1e6ad407c 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java @@ -2,14 +2,21 @@ import java.util.HashMap; import java.util.Map; +import java.util.concurrent.Future; +import java.util.concurrent.RunnableFuture; import com.github.shynixn.petblocks.api.entities.PetType; +import com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController; +import com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController; import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; +import com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta; import com.github.shynixn.petblocks.business.Config; import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; import com.github.shynixn.petblocks.api.persistence.controller.PetMetaController; import com.github.shynixn.petblocks.business.logic.persistence.Factory; +import com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository; import com.github.shynixn.petblocks.business.logic.persistence.entity.PetData; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -22,12 +29,18 @@ public final class PetDataManager { private final PetMetaController petDataController; + private final PlayerMetaController playerMetaController; + private final ParticleEffectMetaController particleEffectMetaController; + + private final long mainThreadId; + Map inventories = new HashMap<>(); Map pages = new HashMap<>(); GUI gui; public PetDataManager(Plugin plugin) { super(); + this.mainThreadId = Thread.currentThread().getId(); this.gui = new GUI(this); if (plugin.getPluginLoader() != null) { new PetDataCommandExecutor(this); @@ -35,6 +48,8 @@ public PetDataManager(Plugin plugin) { } Factory.initialize(plugin); this.petDataController = Factory.createPetDataController(); + this.playerMetaController = Factory.createPlayerDataController(); + this.particleEffectMetaController = Factory.createParticleEffectController(); } public PetMeta createPetMeta(Player player, PetType petType) { @@ -51,24 +66,53 @@ public void persist(PetMeta petMeta) { throw new IllegalArgumentException("PetMeta cannot be null!"); if (PetBlocksApi.hasPetBlock(petMeta.getOwner())) petMeta.setEnabled(true); - this.petDataController.store(petMeta); + if (Thread.currentThread().getId() == this.mainThreadId) + throw new RuntimeException("This method has to be accessed asynchronously."); + petMeta.getPlayerMeta().setName(petMeta.getPlayerMeta().getPlayer().getName()); + if (petMeta.getPlayerMeta().getId() == 0) { + System.out.println("FIRST TIME BUT FOUND PLAYER META"); + final PlayerMeta playerMeta; + if ((playerMeta = this.playerMetaController.getByUUID(petMeta.getPlayerMeta().getPlayer().getUniqueId())) != null) { + petMeta.setPlayerMeta(playerMeta); + } + } + PetDataManager.this.playerMetaController.store(petMeta.getPlayerMeta()); + PetDataManager.this.particleEffectMetaController.store(petMeta.getParticleEffectMeta()); + petMeta.setParticleId(petMeta.getParticleEffectMeta().getId()); + petMeta.setPlayerId(petMeta.getPlayerMeta().getId()); + PetDataManager.this.petDataController.store(petMeta); } public void remove(PetMeta petMeta) { if (petMeta == null) throw new IllegalArgumentException("PetMeta cannot be null!"); + if (Thread.currentThread().getId() == this.mainThreadId) + throw new RuntimeException("This method has to be accessed asynchronously."); + System.out.println("REMOVING DATA"); this.petDataController.remove(petMeta); + this.particleEffectMetaController.remove(petMeta.getParticleEffectMeta()); } public PetMeta getPetMeta(Player player) { if (player == null) throw new IllegalArgumentException("Player cannot be null!"); - return this.petDataController.getByPlayer(player); + if (Thread.currentThread().getId() == this.mainThreadId) + throw new RuntimeException("This method has to be accessed asynchronously."); + if (PetBlocksApi.getPetBlock(player) != null) + return (PetMeta) PetBlocksApi.getPetBlock(player).getPetMeta(); + final PetMeta petMeta = this.petDataController.getByPlayer(player); + if (petMeta == null) + return null; + petMeta.setParticleEffectMeta(this.particleEffectMetaController.getById(petMeta.getParticleId())); + petMeta.setPlayerMeta(this.playerMetaController.getById(petMeta.getPlayerId())); + return petMeta; } public boolean hasPetMeta(Player player) { if (player == null) throw new IllegalArgumentException("Player cannot be null!"); + if (Thread.currentThread().getId() == this.mainThreadId) + throw new RuntimeException("This method has to be accessed asynchronly."); return this.petDataController.hasEntry(player); } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.java b/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.java index 2ef991e4d..bf84613d4 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.java @@ -182,7 +182,6 @@ public boolean isSettings_clickemptyback() { } public ItemContainer getGeneral_defaultAppearanceContainer() { - System.out.println("EXIST: " + this.general_defaultAppearanceContainer); return this.general_defaultAppearanceContainer; } @@ -240,9 +239,7 @@ public ItemContainer getItems_ridingpetContainer() { private ItemStack[] resolveItems(List texts) { final ArrayList itemStacks = new ArrayList<>(); - System.out.println("TESTS: " + texts.size()); for (final String s : texts) { - System.out.println("TEST: " + s); try { int i = 0; ItemStack itemStack = null; @@ -302,7 +299,6 @@ private ItemStack[] resolveItems(List texts) { } } for (int i = 0; i < itemStacks.size(); i++) { - System.out.println("HEK"); BukkitUtilities.nameItemDisplay(itemStacks.get(i), Language.NUMBER_PREFIX + "" + i + ""); } return itemStacks.toArray(new ItemStack[itemStacks.size()]); diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.java b/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.java index 61f2b4b3a..186e62c3a 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.java @@ -62,7 +62,7 @@ public Particle getParticle(int slot) { if (container.getPosition() == slot) return container.getParticle().build(); } - return null; + return new ParticleBuilder().setEffect(null).build(); } private CustomItemContainer.ParticleItemContainer getParticleItemContainer(int number, FileConfiguration c) { diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java index 2700c7969..5502c8b7f 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.java @@ -47,8 +47,9 @@ public ParticleEffectMeta getById(long id) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("particle/selectbyid", connection, id)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - resultSet.next(); - return this.from(resultSet); + if (resultSet.next()) { + return this.from(resultSet); + } } } } catch (final SQLException e) { diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java index 483995388..c37d87322 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.java @@ -45,8 +45,9 @@ public PetMeta getByPlayer(Player player) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/selectbyplayer", connection, player.getUniqueId().toString())) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - resultSet.next(); - return this.from(resultSet); + if (resultSet.next()) { + return this.from(resultSet); + } } } } catch (final SQLException e) { @@ -88,8 +89,9 @@ public PetMeta getById(long id) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("petblock/selectbyid", connection, id)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - resultSet.next(); - return this.from(resultSet); + if (resultSet.next()) { + return this.from(resultSet); + } } } } catch (final SQLException e) { @@ -139,11 +141,11 @@ public List select() { */ @Override public void update(PetMeta item) { - if(item == null) + if (item == null) throw new IllegalArgumentException("Meta has to be an instance of PetData"); - if(item.getType() == null) + if (item.getType() == null) throw new IllegalArgumentException("PetType cannot be null!"); - if(item.getSkinMaterial() == null) + if (item.getSkinMaterial() == null) throw new IllegalArgumentException("SkinMaterial cannot be null!"); try (Connection connection = this.dbContext.getConnection()) { this.dbContext.executeStoredUpdate("petblock/update", connection, @@ -159,7 +161,7 @@ public void update(PetMeta item) { item.getMoveType().name(), item.getMovementType().name(), item.getId() - ); + ); } catch (final SQLException e) { Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } @@ -187,15 +189,15 @@ public void delete(PetMeta item) { */ @Override public void insert(PetMeta item) { - if(item == null) + if (item == null) throw new IllegalArgumentException("Meta has to be an instance of PetData"); - if(item.getType() == null) + if (item.getType() == null) throw new IllegalArgumentException("PetType cannot be null!"); - if(item.getSkinMaterial() == null) + if (item.getSkinMaterial() == null) throw new IllegalArgumentException("SkinMaterial cannot be null!"); try (Connection connection = this.dbContext.getConnection()) { final long id = this.dbContext.executeStoredInsert("petblock/insert", connection, - item.getPlayerId(), + item.getPlayerId(), item.getParticleId(), item.getDisplayName(), item.getType().name(), @@ -208,8 +210,8 @@ public void insert(PetMeta item) { item.isSoundsEnabled(), item.getMoveType().name(), item.getMovementType().name() - ); - ((PetData)item).setId(id); + ); + ((PetData) item).setId(id); } catch (final SQLException e) { Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); } @@ -261,6 +263,7 @@ public int size() { * Closes this resource, relinquishing any underlying resources. * This method is invoked automatically on objects managed by the * {@code try}-with-resources statement. + * * @throws Exception if this resource cannot be closed */ @Override diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java index ff54325c7..b386c02ea 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.java @@ -42,6 +42,29 @@ public PlayerMeta create(Player player) { return PlayerData.from(player); } + /** + * Returns the playerMeta of the given uuid + * + * @param uuid uuid + * @return playerMeta + */ + @Override + public PlayerMeta getByUUID(UUID uuid) { + try (Connection connection = this.dbContext.getConnection()) { + try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("player/selectbyuuid", connection, + uuid.toString())) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + if (resultSet.next()) { + return this.from(resultSet); + } + } + } + } catch (final SQLException e) { + Bukkit.getLogger().log(Level.WARNING, "Database error occurred.", e); + } + return null; + } + /** * Returns the item of the given id * @@ -54,8 +77,9 @@ public PlayerMeta getById(long id) { try (PreparedStatement preparedStatement = this.dbContext.executeStoredQuery("player/selectbyid", connection, id)) { try (ResultSet resultSet = preparedStatement.executeQuery()) { - resultSet.next(); - return this.from(resultSet); + if (resultSet.next()) { + return this.from(resultSet); + } } } } catch (final SQLException e) { diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java index da9517390..e7ddbbc1c 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.java @@ -10,6 +10,7 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; + import java.util.UUID; public class PetData extends PersistenceObject implements PetMeta { @@ -53,6 +54,8 @@ public PetData(Player player, PetType petType, String name, ItemStack itemStack, this.skullName = owner; this.ageTicks = Age.SMALL.getTicks(); this.sounds = true; + this.particleEffectBuilder = new ParticleEffectData(); + this.particleEffectBuilder.setEffectType(ParticleEffectMeta.ParticleEffectType.NONE); } public PetData() { @@ -106,6 +109,8 @@ public void setParticleId(long id) { */ @Override public void setParticleEffectMeta(ParticleEffectMeta meta) { + if(meta == null) + throw new IllegalArgumentException("Meta cannot be null!"); this.particleId = meta.getId(); this.particleEffectBuilder = meta; } @@ -183,14 +188,6 @@ public int getAgeInTicks() { return this.ageTicks; } - public void setAgeTicks(int ticks) { - this.ageTicks = ticks; - } - - public int getAgeTicks() { - return this.ageTicks; - } - @Override public Age getAge() { return Age.getAgeFromTicks(this.ageTicks); @@ -460,7 +457,11 @@ public ParticleEffect getEffect() { @Deprecated public void setEffect(ParticleEffect effect) { - this.particleEffectBuilder.setEffectName(effect.getName()); + if (effect == null) { + this.particleEffectBuilder.setEffectType(ParticleEffectMeta.ParticleEffectType.NONE); + } else { + this.particleEffectBuilder.setEffectName(effect.getName()); + } } @Deprecated diff --git a/src/main/java/com/github/shynixn/petblocks/lib/AsyncRunnable.java b/src/main/java/com/github/shynixn/petblocks/lib/AsyncRunnable.java deleted file mode 100644 index 59785f611..000000000 --- a/src/main/java/com/github/shynixn/petblocks/lib/AsyncRunnable.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.github.shynixn.petblocks.lib; - -import org.bukkit.plugin.java.JavaPlugin; - -@Deprecated -public abstract class AsyncRunnable implements Runnable { - @PluginLoader.PluginLoad - private static JavaPlugin plugin; - private boolean isSynchrone; - private Object[] paramcache; - - private static boolean isPrimaryThread() { - final Thread mainThread = (Thread) ReflectionLib.getValueFromField("primaryThread", ReflectionLib.invokeMethodByClazz(ReflectionLib.getClassFromName("net.minecraft.server.VERSION.MinecraftServer"), "getServer")); - return Thread.currentThread() != mainThread; - } - - public static void throwExceptionIfSynchroneThread() { - if (isPrimaryThread()) - throw new RuntimeException("Cannot access data from primary thread!"); - } - - public static void throwExceptionIfAsnychroneThread() { - if (!isPrimaryThread()) - throw new RuntimeException("Cannot access data from secondary thread!"); - } - - public T getParam(int number) { - if (this.paramcache.length > number && number >= 0) - return (T) this.paramcache[number]; - return null; - } - - public boolean isSynchrone() { - return this.isSynchrone; - } - - public static void toAsynchroneThread(final AsyncRunnable runnable, final Object... params) { - plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> { - runnable.paramcache = params; - runnable.isSynchrone = false; - runnable.run(); - }); - } - - public static void toSynchroneThread(final AsyncRunnable runnable, final Object... params) { - plugin.getServer().getScheduler().runTask(plugin, () -> { - runnable.paramcache = params; - runnable.isSynchrone = true; - runnable.run(); - }); - } -} diff --git a/src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java b/src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java index d98b76e56..bebe7ea59 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.java @@ -67,7 +67,10 @@ private ExtensionHikariConnectionContext(String driver, String url, String userN config.addDataSourceProperty("cachePrepStmts", "true"); config.addDataSourceProperty("prepStmtCacheSize", "250"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); - config.setMaximumPoolSize(10); + if(driver.equals(SQLITE_DRIVER)) + config.setMaximumPoolSize(1); + else + config.setMaximumPoolSize(10); this.ds = new HikariDataSource(config); Logger.getLogger(this.getClass().getSimpleName()).log(Level.INFO, "Connected to " + url); } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java b/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java index 7b450586c..b2fd5c38d 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java @@ -91,6 +91,7 @@ public void registerCustomEntity(Class customEntityClazz, LightRegistry power public void unregister() throws Exception { final Class entityTypeClazz = Class.forName("net.minecraft.server.VERSION.EntityTypes".replace("VERSION", getServerVersion())); if (!getServerVersion().equals("v1_11_R1") && !getServerVersion().equals("v1_12_R1")) { + System.out.println("USE OLD REGISTERING"); for (final Class customEntityClazz : types.keySet()) { final LightRegistry powerRegistry = types.get(customEntityClazz); this., String>getMap(entityTypeClazz, "d").remove(customEntityClazz); @@ -98,6 +99,7 @@ public void unregister() throws Exception { this.modify(powerRegistry.nmsClass, powerRegistry.saveGame_18_19_10, powerRegistry.entityId); } } else { + System.out.println("USE NEW REGISTRERING"); final Field fieldRegistry = entityTypeClazz.getField("b"); fieldRegistry.setAccessible(true); final Object registry = fieldRegistry.get(null); @@ -114,12 +116,14 @@ public void unregister() throws Exception { private void modify(Class clazz, String saveGameId, int entityId) throws Exception { final Class entityTypeClazz = Class.forName("net.minecraft.server.VERSION.EntityTypes".replace("VERSION", getServerVersion())); if (!getServerVersion().equals("v1_11_R1") && !getServerVersion().equals("v1_12_R1")) { + System.out.println("USE OLD REGISTERING"); this.>getMap(entityTypeClazz, "c").put(saveGameId, clazz); this., String>getMap(entityTypeClazz, "d").put(clazz, saveGameId); this.>getMap(entityTypeClazz, "e").put(entityId, clazz); this., Integer>getMap(entityTypeClazz, "f").put(clazz, entityId); this.getMap(entityTypeClazz, "f").put(saveGameId, entityId); } else { + System.out.println("USE NEW REGISTRERING"); final Field field = entityTypeClazz.getField("b"); field.setAccessible(true); final Object registry = field.get(null); diff --git a/src/main/java/com/github/shynixn/petblocks/lib/Particle.java b/src/main/java/com/github/shynixn/petblocks/lib/Particle.java index 934da1cc0..f7546c0db 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/Particle.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/Particle.java @@ -1,8 +1,10 @@ package com.github.shynixn.petblocks.lib; +import com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; import java.util.Arrays; @@ -81,7 +83,7 @@ public void play(Location location) { @Override public void play(final Location location, final Player... players) { try { - AsyncRunnable.toAsynchroneThread(new SendParticleRunnable(location, players)); + JavaPlugin.getPlugin(PetBlocksPlugin.class).getServer().getScheduler().runTaskAsynchronously(JavaPlugin.getPlugin(PetBlocksPlugin.class), new SendParticleRunnable(location, players)); } catch (final Exception ignored) { } @@ -134,7 +136,7 @@ public byte getData() { return this.data; } - private class SendParticleRunnable extends AsyncRunnable { + private class SendParticleRunnable implements Runnable { private final Location location; private final Player[] players; @@ -146,6 +148,8 @@ private class SendParticleRunnable extends AsyncRunnable { @Override public void run() { + if(Particle.this.effect == null) + return; if (Particle.this.effect == ParticleEffect.SPELL_MOB || Particle.this.effect == ParticleEffect.SPELL_MOB_AMBIENT || Particle.this.effect == ParticleEffect.REDSTONE) Particle.this.effect.display(new ParticleEffect.OrdinaryColor((int) Particle.this.x, (int) Particle.this.z, (int) Particle.this.y), this.location, Arrays.asList(this.players)); else if (Particle.this.effect == ParticleEffect.NOTE) diff --git a/src/main/resources/sql/player/selectbyuuid.sql b/src/main/resources/sql/player/selectbyuuid.sql new file mode 100644 index 000000000..df2f98054 --- /dev/null +++ b/src/main/resources/sql/player/selectbyuuid.sql @@ -0,0 +1 @@ +SELECT * FROM SHY_PLAYER WHERE uuid = ?; \ No newline at end of file From 7aa556aa8cd5673d44f3d5b794a8265f19e4355a Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 7 Jun 2017 10:16:27 +0200 Subject: [PATCH 09/23] Fixed entity riding in 1.12 --- .../shynixn/petblocks/business/Config.java | 1 - .../business/bukkit/PetBlocksPlugin.java | 5 ---- .../nms/v1_12_R1/CustomGroundArmorstand.java | 30 +++++-------------- .../business/PetBlockCommandExecutor.java | 5 ++-- .../logic/business/PetBlockListener.java | 4 +-- .../logic/business/PetDataListener.java | 14 +++++---- .../logic/business/PetDataManager.java | 2 -- .../business/logic/persistence/Factory.java | 18 ++++++++--- .../shynixn/petblocks/lib/LightRegistry.java | 7 ++--- .../shynixn/petblocks/lib/ReflectionLib.java | 1 - src/main/resources/config.yml | 2 +- ...ParticleEffectMetaMySQLControllerTest.java | 6 ++-- ...articleEffectMetaSQLiteControllerTest.java | 2 +- .../PetMetaMySQLControllerTest.java | 6 ++-- .../PetMetaSQLiteControllerTest.java | 2 +- .../PlayerMetaMySQLControllerTest.java | 6 ++-- .../PlayerMetaSQLiteControllerTest.java | 2 +- 17 files changed, 49 insertions(+), 64 deletions(-) diff --git a/src/main/java/com/github/shynixn/petblocks/business/Config.java b/src/main/java/com/github/shynixn/petblocks/business/Config.java index 675155037..04dfd52e5 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/Config.java +++ b/src/main/java/com/github/shynixn/petblocks/business/Config.java @@ -74,7 +74,6 @@ public void reload() { ConfigParticle.getInstance().load(c); ConfigPet.getInstance().load(c); } catch (final Exception ex) { - ex.printStackTrace(); Bukkit.getLogger().log(Level.WARNING, "Failed to reload config.", ex); } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java index 3f5e3003b..fa67042a7 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java @@ -5,7 +5,6 @@ import com.github.shynixn.petblocks.business.Language; import com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry; import com.github.shynixn.petblocks.lib.BukkitUtilities; -import com.github.shynixn.petblocks.lib.PluginLoader; import com.github.shynixn.petblocks.lib.ReflectionLib; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -65,8 +64,4 @@ public List> getDatabaseClasses() { } return list; } - - public void setupDatabase() { - this.installDDL(); - } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java index c72ca800e..9a878f34e 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java @@ -85,8 +85,6 @@ private EntityHuman hasHumanPassenger() { protected void doTick() { if (this.isSpecial) { this.counter = PetBlockHelper.doTick(this.counter, this, location -> { - - System.out.println("TELTEPORT TO RABBIT"); CustomGroundArmorstand.this.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); final PacketPlayOutEntityTeleport animation = new PacketPlayOutEntityTeleport(CustomGroundArmorstand.this); for (final Player player : CustomGroundArmorstand.this.getArmorStand().getWorld().getPlayers()) { @@ -98,18 +96,14 @@ protected void doTick() { super.doTick(); } - @Override - public void a(float sideMot, float forMot, float f2) { - System.out.println("MOVE 1" + sideMot +"." + forMot + "." + f2); + @Override + public void a(float sideMot,float f2, float forMot) { if (this.isSpecial) { - System.out.println("MOVE 2"); if (this.hasHumanPassenger() != null) { - System.out.println("MOVE 3"); if (this.petMeta.getMoveType() == MoveType.WALKING) { - System.out.println("1"); this.lastYaw = (this.yaw = this.hasHumanPassenger().yaw); this.pitch = (this.hasHumanPassenger().pitch * 0.5F); this.setYawPitch(this.yaw, this.pitch); @@ -124,10 +118,12 @@ public void a(float sideMot, float forMot, float f2) { } this.P = (float) ConfigPet.getInstance().getModifier_petclimbing(); this.aR = (this.cw() * 0.1F); + if (!this.world.isClientSide) { this.m(0.35F); - super.g(sideMot * (float) ConfigPet.getInstance().getModifier_petriding(), forMot * (float) ConfigPet.getInstance().getModifier_petriding()); + super.a(sideMot * (float) ConfigPet.getInstance().getModifier_petriding(), f2, forMot * (float) ConfigPet.getInstance().getModifier_petriding()); } + this.aF = this.aG; final double d0 = this.locX - this.lastX; final double d1 = this.locZ - this.lastZ; @@ -141,7 +137,7 @@ public void a(float sideMot, float forMot, float f2) { this.aH += this.aG; } else { final float side = this.hasHumanPassenger().be * 0.5F; - final float forw = this.hasHumanPassenger().bf; + final float forw = this.hasHumanPassenger().bg; final Vector v = new Vector(); final Location l = new Location(this.world.getWorld(), this.locX, this.locY, this.locZ); if (side < 0.0F) { @@ -196,7 +192,7 @@ public void a(float sideMot, float forMot, float f2) { } else this.firstRide = true; } else { - super.g(sideMot, forMot); + super.a(sideMot, f2, forMot); } } @@ -296,18 +292,6 @@ public void setSkin(org.bukkit.Material material, byte data) { @Override public void remove() { - - - try - { - throw new Exception("I ORDED THE REMOVE OF THIS PETBLOCK"); - } - catch (Exception ex) - { - ex.printStackTrace(); - } - - PetBlockHelper.remove(this); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java index bc3de5c7b..30c0ea045 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockCommandExecutor.java @@ -116,7 +116,7 @@ private void toggleSounds(Player player) { private void setLore(Player player, String nameBump, int line) { this.providePet(player, (meta, petBlock) -> { - String name = nameBump.replace('_', ' '); + final String name = nameBump.replace('_', ' '); try { if (meta.getHeadLore() == null) { meta.setHeadLore(new String[line + 1]); @@ -141,7 +141,7 @@ private void setLore(Player player, String nameBump, int line) { } private void setSkullName(Player player, String name) { - String bname = name.replace('_', ' '); + final String bname = name.replace('_', ' '); this.providePet(player, (meta, petBlock) -> { meta.setHeadDisplayName(ChatColor.translateAlternateColorCodes('&', bname)); this.persistAsynchronously(meta); @@ -215,7 +215,6 @@ private void namePetCommand(Player player, String name) { petBlock.respawn(); }); } catch (final Exception e) { - e.printStackTrace(); player.sendMessage(Language.PREFIX + Language.NAME_ERROR_MESSAGE); } } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java index 1bcc0fe5a..0c54f36f4 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetBlockListener.java @@ -52,7 +52,6 @@ private void run() { @EventHandler public void onEntityToggleSneakEvent(final PlayerToggleSneakEvent event) { - //Thread Safe final PetBlock petBlock; if (event.getPlayer().getPassenger() != null && this.isPet(event.getPlayer().getPassenger()) && (petBlock = this.manager.getPetBlock(event.getPlayer())) != null) { petBlock.eject(event.getPlayer()); @@ -306,7 +305,7 @@ public void run() { PetBlockListener.this.manager.timeBlocked.put(player, PetBlockListener.this.manager.timeBlocked.get(player) - 1); if (PetBlockListener.this.manager.timeBlocked.get(player) <= 0) { PetBlockListener.this.manager.timeBlocked.remove(player); - providePet(player, (petMeta, petBlock) -> PetBlockListener.this.manager.setPetBlock(player, petMeta)); + PetBlockListener.this.providePet(player, (petMeta, petBlock) -> PetBlockListener.this.manager.setPetBlock(player, petMeta)); } } @@ -350,6 +349,7 @@ private void providePet(Player player, PetRunnable runnable) { } } + @FunctionalInterface interface PetRunnable { void run(PetMeta petMeta, PetBlock petBlock); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java index 9f9a79f83..a2dd21a9c 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java @@ -11,6 +11,8 @@ import com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI; import com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle; import com.github.shynixn.petblocks.business.logic.configuration.ConfigPet; +import com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData; +import com.github.shynixn.petblocks.business.logic.persistence.entity.PetData; import com.github.shynixn.petblocks.lib.BukkitUtilities; import com.github.shynixn.petblocks.lib.SimpleListener; import org.bukkit.ChatColor; @@ -144,17 +146,19 @@ private void handleClick(InventoryClickEvent event, Player player, com.github.sh this.changingPlayers.add(player); this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { final com.github.shynixn.petblocks.api.persistence.entity.PetMeta meta = this.manager.getPetMeta(player); - if (meta != null) { - this.manager.remove(meta); - } this.plugin.getServer().getScheduler().runTask(this.plugin, () -> { final com.github.shynixn.petblocks.api.persistence.entity.PetMeta currentPetMeta = PetDataListener.this.manager.createPetMeta(player, type); + if (meta != null) { + currentPetMeta.setParticleId(meta.getParticleId()); + currentPetMeta.setPlayerId(meta.getPlayerId()); + currentPetMeta.setPlayerMeta(meta.getPlayerMeta()); + currentPetMeta.setParticleEffectMeta(meta.getParticleEffectMeta()); + ((PetData)currentPetMeta).setId(meta.getId()); + } if (ConfigGUI.getInstance().isSettings_copyskin()) { currentPetMeta.setSkin(Material.SKULL_ITEM, (short) 3, ConfigGUI.getInstance().getContainer(currentPetMeta.getType()).getSkullName()); } - System.out.println("REFRESH TO NOT ENABLED"); PetDataListener.this.manager.gui.setMainItems(player, currentPetMeta.getType(), false, true, currentPetMeta); - PetDataListener.this.plugin.getServer().getScheduler().runTaskAsynchronously(PetDataListener.this.plugin, () -> { PetDataListener.this.manager.persist(currentPetMeta); PetDataListener.this.plugin.getServer().getScheduler().runTask(PetDataListener.this.plugin, () -> PetDataListener.this.changingPlayers.remove(player)); diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java index 1e6ad407c..a59931c09 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java @@ -70,7 +70,6 @@ public void persist(PetMeta petMeta) { throw new RuntimeException("This method has to be accessed asynchronously."); petMeta.getPlayerMeta().setName(petMeta.getPlayerMeta().getPlayer().getName()); if (petMeta.getPlayerMeta().getId() == 0) { - System.out.println("FIRST TIME BUT FOUND PLAYER META"); final PlayerMeta playerMeta; if ((playerMeta = this.playerMetaController.getByUUID(petMeta.getPlayerMeta().getPlayer().getUniqueId())) != null) { petMeta.setPlayerMeta(playerMeta); @@ -88,7 +87,6 @@ public void remove(PetMeta petMeta) { throw new IllegalArgumentException("PetMeta cannot be null!"); if (Thread.currentThread().getId() == this.mainThreadId) throw new RuntimeException("This method has to be accessed asynchronously."); - System.out.println("REMOVING DATA"); this.petDataController.remove(petMeta); this.particleEffectMetaController.remove(petMeta.getParticleEffectMeta()); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java index 75efdeb8f..b48f2cdc8 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/persistence/Factory.java @@ -54,7 +54,7 @@ public synchronized static void initialize(Plugin plugin) { throw new RuntimeException(e); } }; - if (plugin.getConfig().getBoolean("sql.local")) { + if (!plugin.getConfig().getBoolean("sql.enabled")) { try { if (!plugin.getDataFolder().exists()) plugin.getDataFolder().mkdir(); @@ -75,7 +75,7 @@ public synchronized static void initialize(Plugin plugin) { connectionContext.executeUpdate(data, connection); } } catch (final Exception e) { - Bukkit.getLogger().log(Level.WARNING, "Cannot execute exception.", e); + Bukkit.getLogger().log(Level.WARNING, "Cannot execute creation.", e); } } else { final FileConfiguration c = plugin.getConfig(); @@ -88,14 +88,24 @@ public synchronized static void initialize(Plugin plugin) { , c.getString("sql.password") , retriever); } catch (final IOException e) { - Bukkit.getLogger().log(Level.WARNING, "Cannot read file.", e); + Bukkit.getLogger().log(Level.WARNING, "Cannot connect to MySQL database!", e); + Bukkit.getLogger().log(Level.WARNING, "Trying to connect to SQLite database....", e); + connectionContext = null; + plugin.getConfig().set("sql.enabled", false); + Factory.initialize(plugin); + return; } try (Connection connection = connectionContext.getConnection()) { for (final String data : connectionContext.getStringFromFile("create-mysql").split(Pattern.quote(";"))) { connectionContext.executeUpdate(data, connection); } } catch (final Exception e) { - Bukkit.getLogger().log(Level.WARNING, "Cannot execute exception.", e); + Bukkit.getLogger().log(Level.WARNING, "Cannot execute creation.", e); + Bukkit.getLogger().log(Level.WARNING, "Trying to connect to SQLite database....", e); + connectionContext = null; + plugin.getConfig().set("sql.enabled", false); + Factory.initialize(plugin); + return; } } } diff --git a/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java b/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java index b2fd5c38d..710ec7a73 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/LightRegistry.java @@ -1,5 +1,6 @@ package com.github.shynixn.petblocks.lib; +import net.minecraft.server.v1_12_R1.EntityTypes; import org.bukkit.Bukkit; import java.lang.reflect.Field; @@ -13,8 +14,8 @@ @SuppressWarnings("unused") public enum LightRegistry { RABBIT(101, "RABBIT", "Rabbit", "rabbit", "EntityRabbit"), + HORSE(100, "HORSE", "Horse", "Horse", "EntityHorse"), ZOMBIE(54, "ZOMBIE", "Zombie", "zombie", "EntityZombie"); - final int entityId; final String name; final String saveGame_18_19_10; @@ -91,7 +92,6 @@ public void registerCustomEntity(Class customEntityClazz, LightRegistry power public void unregister() throws Exception { final Class entityTypeClazz = Class.forName("net.minecraft.server.VERSION.EntityTypes".replace("VERSION", getServerVersion())); if (!getServerVersion().equals("v1_11_R1") && !getServerVersion().equals("v1_12_R1")) { - System.out.println("USE OLD REGISTERING"); for (final Class customEntityClazz : types.keySet()) { final LightRegistry powerRegistry = types.get(customEntityClazz); this., String>getMap(entityTypeClazz, "d").remove(customEntityClazz); @@ -99,7 +99,6 @@ public void unregister() throws Exception { this.modify(powerRegistry.nmsClass, powerRegistry.saveGame_18_19_10, powerRegistry.entityId); } } else { - System.out.println("USE NEW REGISTRERING"); final Field fieldRegistry = entityTypeClazz.getField("b"); fieldRegistry.setAccessible(true); final Object registry = fieldRegistry.get(null); @@ -116,14 +115,12 @@ public void unregister() throws Exception { private void modify(Class clazz, String saveGameId, int entityId) throws Exception { final Class entityTypeClazz = Class.forName("net.minecraft.server.VERSION.EntityTypes".replace("VERSION", getServerVersion())); if (!getServerVersion().equals("v1_11_R1") && !getServerVersion().equals("v1_12_R1")) { - System.out.println("USE OLD REGISTERING"); this.>getMap(entityTypeClazz, "c").put(saveGameId, clazz); this., String>getMap(entityTypeClazz, "d").put(clazz, saveGameId); this.>getMap(entityTypeClazz, "e").put(entityId, clazz); this., Integer>getMap(entityTypeClazz, "f").put(clazz, entityId); this.getMap(entityTypeClazz, "f").put(saveGameId, entityId); } else { - System.out.println("USE NEW REGISTRERING"); final Field field = entityTypeClazz.getField("b"); field.setAccessible(true); final Object registry = field.get(null); diff --git a/src/main/java/com/github/shynixn/petblocks/lib/ReflectionLib.java b/src/main/java/com/github/shynixn/petblocks/lib/ReflectionLib.java index 2bad546d8..344dd4638 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/ReflectionLib.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/ReflectionLib.java @@ -91,7 +91,6 @@ public static Object invokeMethodByClazz(Class clazz, String name, Object... return method.invoke(null, params); } } catch (final Exception ignored) { - ignored.printStackTrace(); } } clazz = clazz.getSuperclass(); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index b998ffffa..49548bb20 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -30,7 +30,7 @@ # Database configuration sql: - local: true + enabled: false host: localhost port: 3306 database: '' diff --git a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java index 2e5fba712..75527fad2 100644 --- a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java +++ b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaMySQLControllerTest.java @@ -30,7 +30,7 @@ public class ParticleEffectMetaMySQLControllerTest { private static Plugin mockPlugin() { final YamlConfiguration configuration = new YamlConfiguration(); - configuration.set("sql.local", true); + configuration.set("sql.enabled", false); configuration.set("sql.host", "localhost"); configuration.set("sql.port", 3306); configuration.set("sql.database", "db"); @@ -76,7 +76,7 @@ public static void startMariaDB() { @Test public void insertSelectParticleEffectMetaTest() throws ClassNotFoundException { final Plugin plugin = mockPlugin(); - plugin.getConfig().set("sql.local", false); + plugin.getConfig().set("sql.enabled", true); Factory.initialize(plugin); try (ParticleEffectMetaController controller = Factory.createParticleEffectController()) { for (final ParticleEffectMeta item : controller.getAll()) { @@ -97,7 +97,7 @@ public void insertSelectParticleEffectMetaTest() throws ClassNotFoundException { @Test public void storeLoadParticleEffectMetaTest() throws ClassNotFoundException { final Plugin plugin = mockPlugin(); - plugin.getConfig().set("sql.local", false); + plugin.getConfig().set("sql.enabled",true); Factory.initialize(plugin); try (ParticleEffectMetaController controller = Factory.createParticleEffectController()) { for (final ParticleEffectMeta item : controller.getAll()) { diff --git a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java index 46072a7da..71747d2c3 100644 --- a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java +++ b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectMetaSQLiteControllerTest.java @@ -33,7 +33,7 @@ private static Plugin mockPlugin() { if(Bukkit.getServer() == null) Bukkit.setServer(server); final YamlConfiguration configuration = new YamlConfiguration(); - configuration.set("sql.local", true); + configuration.set("sql.enabled",false); configuration.set("sql.host", "localhost"); configuration.set("sql.port", 3306); configuration.set("sql.database", "db"); diff --git a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java index f53df8819..6811da21d 100644 --- a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java +++ b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaMySQLControllerTest.java @@ -41,7 +41,7 @@ public class PetMetaMySQLControllerTest { private static Plugin mockPlugin() { final YamlConfiguration configuration = new YamlConfiguration(); - configuration.set("sql.local", true); + configuration.set("sql.enabled", false); configuration.set("sql.host", "localhost"); configuration.set("sql.port", 3306); configuration.set("sql.database", "db"); @@ -90,7 +90,7 @@ public static void startMariaDB() { @Test public void insertSelectPlayerMetaTest() throws ClassNotFoundException { final Plugin plugin = mockPlugin(); - plugin.getConfig().set("sql.local", false); + plugin.getConfig().set("sql.enabled", true); Factory.initialize(mockPlugin()); final UUID uuid = UUID.randomUUID(); final Player player = mock(Player.class); @@ -140,7 +140,7 @@ public void insertSelectPlayerMetaTest() throws ClassNotFoundException { @Test public void storeLoadPlayerMetaTest() throws ClassNotFoundException { final Plugin plugin = mockPlugin(); - plugin.getConfig().set("sql.local", false); + plugin.getConfig().set("sql.enabled", true); Factory.initialize(mockPlugin()); final UUID uuid = UUID.randomUUID(); final Player player = mock(Player.class); diff --git a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java index 3412412e7..a14bb0574 100644 --- a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java +++ b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PetMetaSQLiteControllerTest.java @@ -35,7 +35,7 @@ public class PetMetaSQLiteControllerTest { private static Plugin mockPlugin() { final YamlConfiguration configuration = new YamlConfiguration(); - configuration.set("sql.local", true); + configuration.set("sql.enabled", false); configuration.set("sql.host", "localhost"); configuration.set("sql.port", 3306); configuration.set("sql.database", "db"); diff --git a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java index 1174381c4..96d1e1f62 100644 --- a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java +++ b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaMySQLControllerTest.java @@ -32,7 +32,7 @@ public class PlayerMetaMySQLControllerTest { private static Plugin mockPlugin() { final YamlConfiguration configuration = new YamlConfiguration(); - configuration.set("sql.local", true); + configuration.set("sql.enabled", false); configuration.set("sql.host", "localhost"); configuration.set("sql.port", 3306); configuration.set("sql.database", "db"); @@ -81,7 +81,7 @@ public static void startMariaDB() { @Test public void insertSelectPlayerMetaTest() throws ClassNotFoundException { final Plugin plugin = mockPlugin(); - plugin.getConfig().set("sql.local", false); + plugin.getConfig().set("sql.enabled", true); Factory.initialize(plugin); try (PlayerMetaController controller = Factory.createPlayerDataController()) { for (final PlayerMeta item : controller.getAll()) { @@ -111,7 +111,7 @@ public void insertSelectPlayerMetaTest() throws ClassNotFoundException { @Test public void storeLoadPlayerMetaTest() throws ClassNotFoundException { final Plugin plugin = mockPlugin(); - plugin.getConfig().set("sql.local", false); + plugin.getConfig().set("sql.enabled", true); Factory.initialize(plugin); try (PlayerMetaController controller = Factory.createPlayerDataController()) { for (final PlayerMeta item : controller.getAll()) { diff --git a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java index cafb03db8..916012eeb 100644 --- a/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java +++ b/src/test/java/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerMetaSQLiteControllerTest.java @@ -28,7 +28,7 @@ public class PlayerMetaSQLiteControllerTest { private static Plugin mockPlugin() { final YamlConfiguration configuration = new YamlConfiguration(); - configuration.set("sql.local", true); + configuration.set("sql.enabled", false); configuration.set("sql.host", "localhost"); configuration.set("sql.port", 3306); configuration.set("sql.database", "db"); From 98c3e084606c3ca71c453e0f589fde7bd994c00a Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 7 Jun 2017 10:19:56 +0200 Subject: [PATCH 10/23] Removed temporary file --- src/main/resources/sql/selectidbyuuid.sql | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/main/resources/sql/selectidbyuuid.sql diff --git a/src/main/resources/sql/selectidbyuuid.sql b/src/main/resources/sql/selectidbyuuid.sql deleted file mode 100644 index 1b95a1e25..000000000 --- a/src/main/resources/sql/selectidbyuuid.sql +++ /dev/null @@ -1 +0,0 @@ -SELECT id FROM SHY_PLAYER WHERE uuid = ?; \ No newline at end of file From 53094d7a07987bc008334545d875f54fbf65814a Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 7 Jun 2017 10:21:03 +0200 Subject: [PATCH 11/23] Fixed documentation --- .../persistence/controller/IController.java | 29 ------------------- .../controller/IDatabaseController.java | 29 ------------------- .../controller/PetMetaController.java | 3 -- .../controller/PlayerMetaController.java | 3 -- .../entity/ParticleEffectMeta.java | 3 -- 5 files changed, 67 deletions(-) diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IController.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IController.java index 69db02117..fa09a1238 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IController.java +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IController.java @@ -2,35 +2,6 @@ import java.util.List; -/** - * Copyright 2017 Shynixn - *

- * Do not remove this header! - *

- * Version 1.0 - *

- * MIT License - *

- * Copyright (c) 2017 - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ public interface IController extends AutoCloseable { /** * Stores a new a item in the repository diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.java index de12980c6..8771f5fbc 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.java +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.java @@ -1,34 +1,5 @@ package com.github.shynixn.petblocks.api.persistence.controller; -/** - * Copyright 2017 Shynixn - *

- * Do not remove this header! - *

- * Version 1.0 - *

- * MIT License - *

- * Copyright (c) 2017 - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ public interface IDatabaseController extends IController { /** * Returns the item of the given id diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.java index db72b3b8e..7c097647e 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.java +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.java @@ -3,9 +3,6 @@ import com.github.shynixn.petblocks.api.persistence.entity.PetMeta; import org.bukkit.entity.Player; -/** - * Created by Shynixn - */ public interface PetMetaController extends IDatabaseController { /** * Returns the petdata from the given player diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java index c19247b69..35e50dc37 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.java @@ -5,9 +5,6 @@ import java.util.UUID; -/** - * Created by Shynixn - */ public interface PlayerMetaController extends IDatabaseController { /** diff --git a/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java index 1210d121c..317305be0 100644 --- a/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java +++ b/src/main/java/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.java @@ -4,9 +4,6 @@ import org.bukkit.Material; import org.bukkit.entity.Player; -/** - * Created by Shynixn - */ public interface ParticleEffectMeta extends Persistenceable{ /** * Sets the RGB colors of the particleEffect From b327b6ccb2725278afdaace1891f37d833884175 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 7 Jun 2017 10:42:39 +0200 Subject: [PATCH 12/23] Fixed logout problem --- pom.xml | 6 +++--- .../business/logic/business/PetDataListener.java | 5 +---- .../business/logic/business/PetDataManager.java | 14 +++++++------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index f706c8c13..31e7f8dfd 100644 --- a/pom.xml +++ b/pom.xml @@ -215,8 +215,8 @@ com.zaxxer - HikariCP-java7 - 2.4.11 + HikariCP + RELEASE compile @@ -228,7 +228,7 @@ ch.vorburger.mariaDB4j mariaDB4j - 2.2.2 + RELEASE test diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java index a2dd21a9c..88203836c 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataListener.java @@ -89,10 +89,7 @@ public void playerJoinEvent(final PlayerJoinEvent event) { @EventHandler public void playerQuitEvent(PlayerQuitEvent event) { - if (this.manager.hasPetMeta(event.getPlayer())) { - this.manager.persist(this.manager.getPetMeta(event.getPlayer())); - PetBlocksApi.removePetBlock(event.getPlayer()); - } + PetBlocksApi.removePetBlock(event.getPlayer()); } @EventHandler diff --git a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java index a59931c09..b4167bdcb 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java +++ b/src/main/java/com/github/shynixn/petblocks/business/logic/business/PetDataManager.java @@ -64,15 +64,15 @@ public PetMeta createPetMeta(Player player, PetType petType) { public void persist(PetMeta petMeta) { if (petMeta == null) throw new IllegalArgumentException("PetMeta cannot be null!"); - if (PetBlocksApi.hasPetBlock(petMeta.getOwner())) - petMeta.setEnabled(true); if (Thread.currentThread().getId() == this.mainThreadId) throw new RuntimeException("This method has to be accessed asynchronously."); - petMeta.getPlayerMeta().setName(petMeta.getPlayerMeta().getPlayer().getName()); - if (petMeta.getPlayerMeta().getId() == 0) { - final PlayerMeta playerMeta; - if ((playerMeta = this.playerMetaController.getByUUID(petMeta.getPlayerMeta().getPlayer().getUniqueId())) != null) { - petMeta.setPlayerMeta(playerMeta); + if (petMeta.getOwner() != null) { + petMeta.getPlayerMeta().setName(petMeta.getPlayerMeta().getPlayer().getName()); + if (petMeta.getPlayerMeta().getId() == 0) { + final PlayerMeta playerMeta; + if ((playerMeta = this.playerMetaController.getByUUID(petMeta.getPlayerMeta().getPlayer().getUniqueId())) != null) { + petMeta.setPlayerMeta(playerMeta); + } } } PetDataManager.this.playerMetaController.store(petMeta.getPlayerMeta()); From 96ec2ee5f2b726fa842f38f36029f1fe0d92be97 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 7 Jun 2017 10:43:20 +0200 Subject: [PATCH 13/23] Reset maven pom --- pom.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 31e7f8dfd..576a7193e 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ - + org.apache.maven.plugins maven-compiler-plugin @@ -245,7 +245,7 @@ - + + \ No newline at end of file From 72dad2a23d5832ba6aef850319716c478676a046 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 7 Jun 2017 10:47:03 +0200 Subject: [PATCH 14/23] Comment --- .../java/com/github/shynixn/petblocks/lib/BukkitCommands.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/github/shynixn/petblocks/lib/BukkitCommands.java b/src/main/java/com/github/shynixn/petblocks/lib/BukkitCommands.java index 3ec792e5f..b650fba23 100644 --- a/src/main/java/com/github/shynixn/petblocks/lib/BukkitCommands.java +++ b/src/main/java/com/github/shynixn/petblocks/lib/BukkitCommands.java @@ -34,5 +34,6 @@ public final boolean onCommand(CommandSender arg0, Command arg1, String arg2, St } public void playerSendCommandEvent(Player player, String[] args) { + // } } From 32c86f1615cd41b94115671241c43cfb65a4c74f Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 7 Jun 2017 10:50:03 +0200 Subject: [PATCH 15/23] Updated README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5933435ab..1c9f4ce22 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ Spigot plugin to use blocks as pets in minecraft. * Use blocks as pets in minecraft. * Customizable UI. -* Version support 1.8.R1 - 1.11.R1 +* Version support 1.8.R1 - 1.12.R1 * Check out the [PetBlocks-Spigot-Page](https://www.spigotmc.org/resources/petblocks-mysql-bungeecord-customizeable-gui-1-8-1-9-1-10-1-11.12056/) to get more information. ## Installation * [Download the plugin PetBlocks](https://github.com/Shynixn/PetBlocks/releases) * Put the plugin into your plugin folder -* Start the server (1.8.0 - 1.11.2, Java 7/Java 8) +* Start the server (1.8.0 - 1.12.0, Java 8) * Join and play :) ## API From 26b5a5dbcfc9c0f7719947679fe38291df9558ad Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 7 Jun 2017 10:51:47 +0200 Subject: [PATCH 16/23] Updated README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1c9f4ce22..4c22cee04 100644 --- a/README.md +++ b/README.md @@ -60,12 +60,12 @@ Spigot plugin to use blocks as pets in minecraft. } ``` -* Check out the [BlockBall-Spigot-Page](https://www.spigotmc.org/resources/blockball-minigame-bungeecord-soccer-football-1-8-1-9-1-10-1-11.15320/) to get more information. +* Check out the [PetBlocks-Spigot-Page](https://www.spigotmc.org/resources/petblocks-mysql-bungeecord-customizeable-gui-1-8-1-9-1-10-1-11.12056/) to get more information. ## Screenshots -![alt tag](http://www.mediafire.com/convkey/0fc6/c5wd0rfxbc01xm7zg.jpg) -![alt tag](http://www.mediafire.com/convkey/a253/ur76bhb6doccomvzg.jpg) +![alt tag](http://www.mediafire.com/convkey/9d02/r92bshjdva755d3zg.jpg) +![alt tag](http://www.mediafire.com/convkey/697e/ddk043hgdj57d7jzg.jpg) ## Licence @@ -81,4 +81,4 @@ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and -limitations under the License. +limitations under the License. \ No newline at end of file From 1eefc1b1e269c4fff3d91005905bfd07f171ae4d Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 7 Jun 2017 11:03:12 +0200 Subject: [PATCH 17/23] Fixed version checker --- .../shynixn/petblocks/business/bukkit/PetBlocksPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java index fa67042a7..18b8e4dae 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.java @@ -28,7 +28,7 @@ public void onEnable() { if(!BukkitUtilities.isVersionSupported()) { BukkitUtilities.sendColorMessage("================================================", ChatColor.RED, PREFIX_CONSOLE); BukkitUtilities.sendColorMessage("Petblocks does not support your server version", ChatColor.RED, PREFIX_CONSOLE); - BukkitUtilities.sendColorMessage("Install v1.8.0 - v1.11.0", ChatColor.RED, PREFIX_CONSOLE); + BukkitUtilities.sendColorMessage("Install v1.8.0 - v1.12.0", ChatColor.RED, PREFIX_CONSOLE); BukkitUtilities.sendColorMessage("Plugin gets now disabled!", ChatColor.RED, PREFIX_CONSOLE); BukkitUtilities.sendColorMessage("================================================", ChatColor.RED, PREFIX_CONSOLE); this.disabled = true; From f4f13c5de5b272ad1a66cf2ea2f7d5a1afb488d7 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 9 Jun 2017 09:35:55 +0200 Subject: [PATCH 18/23] Fixed release version changes, added javadocs --- .travis.yml | 4 +- README.md | 4 +- docs/apidocs/META-INF/MANIFEST.MF | 6 + docs/apidocs/allclasses-frame.html | 133 + docs/apidocs/allclasses-noframe.html | 133 + .../shynixn/petblocks/api/PetBlocksApi.html | 398 ++ .../petblocks/api/class-use/PetBlocksApi.html | 126 + .../shynixn/petblocks/api/entities/Age.html | 370 ++ .../petblocks/api/entities/CustomEntity.html | 241 ++ .../petblocks/api/entities/ItemContainer.html | 358 ++ .../petblocks/api/entities/MoveType.html | 356 ++ .../petblocks/api/entities/Movement.html | 357 ++ .../petblocks/api/entities/Particle.html | 364 ++ .../petblocks/api/entities/PetBlock.html | 524 +++ .../petblocks/api/entities/PetMeta.html | 728 ++++ .../petblocks/api/entities/PetType.html | 714 ++++ .../petblocks/api/entities/class-use/Age.html | 257 ++ .../api/entities/class-use/CustomEntity.html | 172 + .../api/entities/class-use/ItemContainer.html | 285 ++ .../api/entities/class-use/MoveType.html | 267 ++ .../api/entities/class-use/Movement.html | 239 ++ .../api/entities/class-use/Particle.html | 268 ++ .../api/entities/class-use/PetBlock.html | 371 ++ .../api/entities/class-use/PetMeta.html | 515 +++ .../api/entities/class-use/PetType.html | 346 ++ .../petblocks/api/entities/package-frame.html | 32 + .../api/entities/package-summary.html | 195 + .../petblocks/api/entities/package-tree.html | 158 + .../petblocks/api/entities/package-use.html | 466 +++ .../api/events/PetBlockCancelAbleEvent.html | 342 ++ .../api/events/PetBlockCannonEvent.html | 303 ++ .../api/events/PetBlockDeathEvent.html | 303 ++ .../petblocks/api/events/PetBlockEvent.html | 330 ++ .../api/events/PetBlockMoveEvent.html | 291 ++ .../api/events/PetBlockRideEvent.html | 339 ++ .../api/events/PetBlockSpawnEvent.html | 303 ++ .../api/events/PetBlockWearEvent.html | 339 ++ .../class-use/PetBlockCancelAbleEvent.html | 192 + .../events/class-use/PetBlockCannonEvent.html | 126 + .../events/class-use/PetBlockDeathEvent.html | 126 + .../api/events/class-use/PetBlockEvent.html | 204 + .../events/class-use/PetBlockMoveEvent.html | 126 + .../events/class-use/PetBlockRideEvent.html | 126 + .../events/class-use/PetBlockSpawnEvent.html | 126 + .../events/class-use/PetBlockWearEvent.html | 126 + .../petblocks/api/events/package-frame.html | 28 + .../petblocks/api/events/package-summary.html | 188 + .../petblocks/api/events/package-tree.html | 160 + .../petblocks/api/events/package-use.html | 166 + .../shynixn/petblocks/api/package-frame.html | 21 + .../petblocks/api/package-summary.html | 144 + .../shynixn/petblocks/api/package-tree.html | 139 + .../shynixn/petblocks/api/package-use.html | 126 + .../persistence/controller/IController.html | 314 ++ .../controller/IDatabaseController.html | 259 ++ .../ParticleEffectMetaController.html | 260 ++ .../controller/PetMetaController.html | 284 ++ .../controller/PlayerMetaController.html | 284 ++ .../controller/class-use/IController.html | 238 ++ .../class-use/IDatabaseController.html | 234 ++ .../ParticleEffectMetaController.html | 188 + .../class-use/PetMetaController.html | 190 + .../class-use/PlayerMetaController.html | 190 + .../persistence/controller/package-frame.html | 25 + .../controller/package-summary.html | 160 + .../persistence/controller/package-tree.html | 149 + .../persistence/controller/package-use.html | 240 ++ .../ParticleEffectMeta.ParticleColor.html | 576 +++ ...ParticleEffectMeta.ParticleEffectType.html | 964 +++++ .../entity/ParticleEffectMeta.html | 912 +++++ .../persistence/entity/Persistenceable.html | 243 ++ .../api/persistence/entity/PetMeta.html | 389 ++ .../api/persistence/entity/PlayerMeta.html | 326 ++ .../ParticleEffectMeta.ParticleColor.html | 214 ++ ...ParticleEffectMeta.ParticleEffectType.html | 241 ++ .../entity/class-use/ParticleEffectMeta.html | 439 +++ .../entity/class-use/Persistenceable.html | 212 + .../persistence/entity/class-use/PetMeta.html | 340 ++ .../entity/class-use/PlayerMeta.html | 349 ++ .../api/persistence/entity/package-frame.html | 29 + .../persistence/entity/package-summary.html | 179 + .../api/persistence/entity/package-tree.html | 163 + .../api/persistence/entity/package-use.html | 317 ++ .../shynixn/petblocks/business/Config.html | 426 +++ .../shynixn/petblocks/business/Language.html | 1050 +++++ .../petblocks/business/Permission.html | 524 +++ .../business/bukkit/PetBlocksPlugin.html | 383 ++ .../bukkit/class-use/PetBlocksPlugin.html | 126 + .../clearlag/ClearLagListener.html | 297 ++ .../clearlag/class-use/ClearLagListener.html | 126 + .../dependencies/clearlag/package-frame.html | 21 + .../clearlag/package-summary.html | 144 + .../dependencies/clearlag/package-tree.html | 143 + .../dependencies/clearlag/package-use.html | 126 + .../supervanish/SuperVanishConnection.html | 273 ++ .../class-use/SuperVanishConnection.html | 126 + .../supervanish/package-frame.html | 21 + .../supervanish/package-summary.html | 144 + .../supervanish/package-tree.html | 139 + .../dependencies/supervanish/package-use.html | 126 + .../worldguard/WorldGuardConnection5.html | 271 ++ .../worldguard/WorldGuardConnection6.html | 287 ++ .../class-use/WorldGuardConnection5.html | 126 + .../class-use/WorldGuardConnection6.html | 126 + .../worldguard/package-frame.html | 22 + .../worldguard/package-summary.html | 148 + .../dependencies/worldguard/package-tree.html | 140 + .../dependencies/worldguard/package-use.html | 126 + .../business/bukkit/nms/NMSRegistry.html | 394 ++ .../bukkit/nms/class-use/NMSRegistry.html | 126 + .../helper/PetBlockHelper.TickCallBack.html | 232 ++ .../bukkit/nms/helper/PetBlockHelper.html | 537 +++ .../PetBlockHelper.TickCallBack.html | 192 + .../nms/helper/class-use/PetBlockHelper.html | 126 + .../bukkit/nms/helper/package-frame.html | 25 + .../bukkit/nms/helper/package-summary.html | 161 + .../bukkit/nms/helper/package-tree.html | 143 + .../bukkit/nms/helper/package-use.html | 159 + .../business/bukkit/nms/package-frame.html | 21 + .../business/bukkit/nms/package-summary.html | 144 + .../business/bukkit/nms/package-tree.html | 139 + .../business/bukkit/nms/package-use.html | 126 + .../bukkit/nms/v1_10_R1/CustomRabbit.html | 486 +++ .../bukkit/nms/v1_10_R1/CustomZombie.html | 470 +++ .../bukkit/nms/v1_10_R1/OwnerPathfinder.html | 336 ++ .../nms/v1_10_R1/class-use/CustomRabbit.html | 126 + .../nms/v1_10_R1/class-use/CustomZombie.html | 126 + .../v1_10_R1/class-use/OwnerPathfinder.html | 126 + .../bukkit/nms/v1_10_R1/package-frame.html | 23 + .../bukkit/nms/v1_10_R1/package-summary.html | 154 + .../bukkit/nms/v1_10_R1/package-tree.html | 181 + .../bukkit/nms/v1_10_R1/package-use.html | 126 + .../bukkit/nms/v1_11_R1/CustomRabbit.html | 486 +++ .../bukkit/nms/v1_11_R1/CustomZombie.html | 470 +++ .../bukkit/nms/v1_11_R1/OwnerPathfinder.html | 336 ++ .../nms/v1_11_R1/class-use/CustomRabbit.html | 126 + .../nms/v1_11_R1/class-use/CustomZombie.html | 126 + .../v1_11_R1/class-use/OwnerPathfinder.html | 126 + .../bukkit/nms/v1_11_R1/package-frame.html | 23 + .../bukkit/nms/v1_11_R1/package-summary.html | 154 + .../bukkit/nms/v1_11_R1/package-tree.html | 181 + .../bukkit/nms/v1_11_R1/package-use.html | 126 + .../bukkit/nms/v1_12_R1/CustomRabbit.html | 486 +++ .../bukkit/nms/v1_12_R1/CustomZombie.html | 470 +++ .../bukkit/nms/v1_12_R1/OwnerPathfinder.html | 336 ++ .../nms/v1_12_R1/class-use/CustomRabbit.html | 126 + .../nms/v1_12_R1/class-use/CustomZombie.html | 126 + .../v1_12_R1/class-use/OwnerPathfinder.html | 126 + .../bukkit/nms/v1_12_R1/package-frame.html | 23 + .../bukkit/nms/v1_12_R1/package-summary.html | 154 + .../bukkit/nms/v1_12_R1/package-tree.html | 181 + .../bukkit/nms/v1_12_R1/package-use.html | 126 + .../bukkit/nms/v1_8_R1/CustomRabbit.html | 481 +++ .../bukkit/nms/v1_8_R1/CustomZombie.html | 462 +++ .../bukkit/nms/v1_8_R1/OwnerPathfinder.html | 336 ++ .../nms/v1_8_R1/class-use/CustomRabbit.html | 126 + .../nms/v1_8_R1/class-use/CustomZombie.html | 126 + .../v1_8_R1/class-use/OwnerPathfinder.html | 126 + .../bukkit/nms/v1_8_R1/package-frame.html | 23 + .../bukkit/nms/v1_8_R1/package-summary.html | 154 + .../bukkit/nms/v1_8_R1/package-tree.html | 181 + .../bukkit/nms/v1_8_R1/package-use.html | 126 + .../bukkit/nms/v1_8_R2/CustomRabbit.html | 486 +++ .../bukkit/nms/v1_8_R2/CustomZombie.html | 470 +++ .../bukkit/nms/v1_8_R2/OwnerPathfinder.html | 336 ++ .../nms/v1_8_R2/class-use/CustomRabbit.html | 126 + .../nms/v1_8_R2/class-use/CustomZombie.html | 126 + .../v1_8_R2/class-use/OwnerPathfinder.html | 126 + .../bukkit/nms/v1_8_R2/package-frame.html | 23 + .../bukkit/nms/v1_8_R2/package-summary.html | 154 + .../bukkit/nms/v1_8_R2/package-tree.html | 181 + .../bukkit/nms/v1_8_R2/package-use.html | 126 + .../bukkit/nms/v1_8_R3/CustomRabbit.html | 486 +++ .../bukkit/nms/v1_8_R3/CustomZombie.html | 470 +++ .../bukkit/nms/v1_8_R3/OwnerPathfinder.html | 336 ++ .../nms/v1_8_R3/class-use/CustomRabbit.html | 126 + .../nms/v1_8_R3/class-use/CustomZombie.html | 126 + .../v1_8_R3/class-use/OwnerPathfinder.html | 126 + .../bukkit/nms/v1_8_R3/package-frame.html | 23 + .../bukkit/nms/v1_8_R3/package-summary.html | 154 + .../bukkit/nms/v1_8_R3/package-tree.html | 181 + .../bukkit/nms/v1_8_R3/package-use.html | 126 + .../bukkit/nms/v1_9_R1/CustomRabbit.html | 486 +++ .../bukkit/nms/v1_9_R1/CustomZombie.html | 470 +++ .../bukkit/nms/v1_9_R1/Listener19.html | 299 ++ .../bukkit/nms/v1_9_R1/OwnerPathfinder.html | 336 ++ .../nms/v1_9_R1/class-use/CustomRabbit.html | 126 + .../nms/v1_9_R1/class-use/CustomZombie.html | 126 + .../nms/v1_9_R1/class-use/Listener19.html | 126 + .../v1_9_R1/class-use/OwnerPathfinder.html | 126 + .../bukkit/nms/v1_9_R1/package-frame.html | 24 + .../bukkit/nms/v1_9_R1/package-summary.html | 158 + .../bukkit/nms/v1_9_R1/package-tree.html | 186 + .../bukkit/nms/v1_9_R1/package-use.html | 126 + .../bukkit/nms/v1_9_R2/CustomRabbit.html | 486 +++ .../bukkit/nms/v1_9_R2/CustomZombie.html | 470 +++ .../bukkit/nms/v1_9_R2/OwnerPathfinder.html | 336 ++ .../nms/v1_9_R2/class-use/CustomRabbit.html | 126 + .../nms/v1_9_R2/class-use/CustomZombie.html | 126 + .../v1_9_R2/class-use/OwnerPathfinder.html | 126 + .../bukkit/nms/v1_9_R2/package-frame.html | 23 + .../bukkit/nms/v1_9_R2/package-summary.html | 154 + .../bukkit/nms/v1_9_R2/package-tree.html | 181 + .../bukkit/nms/v1_9_R2/package-use.html | 126 + .../business/bukkit/package-frame.html | 21 + .../business/bukkit/package-summary.html | 144 + .../business/bukkit/package-tree.html | 147 + .../business/bukkit/package-use.html | 126 + .../petblocks/business/class-use/Config.html | 166 + .../business/class-use/Language.html | 126 + .../business/class-use/Permission.html | 214 ++ .../logic/business/PetBlockManager.html | 331 ++ .../logic/business/PetDataManager.html | 327 ++ .../business/class-use/PetBlockManager.html | 126 + .../business/class-use/PetDataManager.html | 165 + .../logic/business/package-frame.html | 22 + .../logic/business/package-summary.html | 148 + .../business/logic/business/package-tree.html | 140 + .../business/logic/business/package-use.html | 159 + .../logic/configuration/ConfigCommands.html | 279 ++ .../logic/configuration/ConfigGUI.html | 591 +++ .../logic/configuration/ConfigParticle.html | 279 ++ .../logic/configuration/ConfigPet.html | 526 +++ .../class-use/ConfigCommands.html | 166 + .../configuration/class-use/ConfigGUI.html | 166 + .../class-use/ConfigParticle.html | 166 + .../configuration/class-use/ConfigPet.html | 166 + .../logic/configuration/package-frame.html | 24 + .../logic/configuration/package-summary.html | 164 + .../logic/configuration/package-tree.html | 142 + .../logic/configuration/package-use.html | 176 + .../business/logic/persistence/Factory.html | 325 ++ .../logic/persistence/class-use/Factory.html | 126 + .../ParticleEffectDataRepository.html | 516 +++ .../controller/PetDataRepository.html | 543 +++ .../controller/PlayerDataRepository.html | 543 +++ .../ParticleEffectDataRepository.html | 126 + .../class-use/PetDataRepository.html | 126 + .../class-use/PlayerDataRepository.html | 126 + .../persistence/controller/package-frame.html | 23 + .../controller/package-summary.html | 156 + .../persistence/controller/package-tree.html | 145 + .../persistence/controller/package-use.html | 126 + .../entity/ParticleEffectData.html | 1260 ++++++ .../persistence/entity/PersistenceObject.html | 311 ++ .../logic/persistence/entity/PetData.html | 1524 ++++++++ .../logic/persistence/entity/PlayerData.html | 416 ++ .../entity/class-use/ParticleEffectData.html | 260 ++ .../entity/class-use/PersistenceObject.html | 178 + .../persistence/entity/class-use/PetData.html | 168 + .../entity/class-use/PlayerData.html | 192 + .../persistence/entity/package-frame.html | 24 + .../persistence/entity/package-summary.html | 160 + .../persistence/entity/package-tree.html | 145 + .../logic/persistence/entity/package-use.html | 191 + .../logic/persistence/package-frame.html | 21 + .../logic/persistence/package-summary.html | 144 + .../logic/persistence/package-tree.html | 139 + .../logic/persistence/package-use.html | 126 + .../petblocks/business/package-frame.html | 26 + .../petblocks/business/package-summary.html | 163 + .../petblocks/business/package-tree.html | 152 + .../petblocks/business/package-use.html | 181 + .../petblocks/lib/BukkitChatColor.html | 540 +++ .../shynixn/petblocks/lib/BukkitCommands.html | 350 ++ .../petblocks/lib/BukkitUtilities.html | 424 ++ .../petblocks/lib/DataBaseRepository.html | 522 +++ ...DynamicCommandHelper.CommandContainer.html | 344 ++ .../petblocks/lib/DynamicCommandHelper.html | 361 ++ ...nHikariConnectionContext.SQlRetriever.html | 241 ++ .../lib/ExtensionHikariConnectionContext.html | 723 ++++ .../shynixn/petblocks/lib/Filtering.html | 273 ++ .../shynixn/petblocks/lib/Interpreter19.html | 306 ++ .../shynixn/petblocks/lib/LightRegistry.html | 394 ++ .../shynixn/petblocks/lib/Particle.html | 640 ++++ .../petblocks/lib/ParticleBuilder.html | 814 ++++ .../lib/ParticleEffect.BlockData.html | 262 ++ .../lib/ParticleEffect.ItemData.html | 257 ++ .../lib/ParticleEffect.NoteColor.html | 325 ++ .../lib/ParticleEffect.OrdinaryColor.html | 380 ++ .../lib/ParticleEffect.ParticleColor.html | 307 ++ .../lib/ParticleEffect.ParticleData.html | 322 ++ .../lib/ParticleEffect.ParticlePacket.html | 430 +++ .../lib/ParticleEffect.ParticleProperty.html | 371 ++ .../shynixn/petblocks/lib/ParticleEffect.html | 1635 ++++++++ .../lib/ParticleReflectionUtils.DataType.html | 560 +++ .../ParticleReflectionUtils.PackageType.html | 633 +++ .../lib/ParticleReflectionUtils.html | 815 ++++ .../lib/PluginLoader.PluginLoad.html | 167 + .../lib/PluginLoader.PluginUnload.html | 167 + .../shynixn/petblocks/lib/PluginLoader.html | 279 ++ .../shynixn/petblocks/lib/ReflectionLib.html | 358 ++ .../petblocks/lib/ReflectionUtils.html | 649 ++++ .../shynixn/petblocks/lib/RegisterHelper.html | 402 ++ .../shynixn/petblocks/lib/SimpleListener.html | 337 ++ .../petblocks/lib/SkullMetaRegistry.html | 258 ++ .../shynixn/petblocks/lib/SoundData.html | 344 ++ .../shynixn/petblocks/lib/SpigotEvent.html | 321 ++ .../lib/class-use/BukkitChatColor.html | 175 + .../lib/class-use/BukkitCommands.html | 126 + .../lib/class-use/BukkitUtilities.html | 126 + .../lib/class-use/DataBaseRepository.html | 178 + ...DynamicCommandHelper.CommandContainer.html | 190 + .../lib/class-use/DynamicCommandHelper.html | 126 + ...nHikariConnectionContext.SQlRetriever.html | 183 + .../ExtensionHikariConnectionContext.html | 209 + .../petblocks/lib/class-use/Filtering.html | 126 + .../lib/class-use/Interpreter19.html | 126 + .../lib/class-use/LightRegistry.html | 175 + .../petblocks/lib/class-use/Particle.html | 168 + .../lib/class-use/ParticleBuilder.html | 269 ++ .../class-use/ParticleEffect.BlockData.html | 126 + .../class-use/ParticleEffect.ItemData.html | 126 + .../class-use/ParticleEffect.NoteColor.html | 126 + .../ParticleEffect.OrdinaryColor.html | 126 + .../ParticleEffect.ParticleColor.html | 220 ++ .../ParticleEffect.ParticleData.html | 277 ++ .../ParticleEffect.ParticlePacket.html | 126 + .../ParticleEffect.ParticleProperty.html | 190 + .../lib/class-use/ParticleEffect.html | 329 ++ .../ParticleReflectionUtils.DataType.html | 179 + .../ParticleReflectionUtils.PackageType.html | 249 ++ .../class-use/ParticleReflectionUtils.html | 126 + .../class-use/PluginLoader.PluginLoad.html | 126 + .../class-use/PluginLoader.PluginUnload.html | 126 + .../petblocks/lib/class-use/PluginLoader.html | 126 + .../lib/class-use/ReflectionLib.html | 126 + .../lib/class-use/ReflectionUtils.html | 126 + .../lib/class-use/RegisterHelper.html | 126 + .../lib/class-use/SimpleListener.html | 188 + .../lib/class-use/SkullMetaRegistry.html | 126 + .../petblocks/lib/class-use/SoundData.html | 126 + .../petblocks/lib/class-use/SpigotEvent.html | 210 + .../shynixn/petblocks/lib/package-frame.html | 64 + .../petblocks/lib/package-summary.html | 343 ++ .../shynixn/petblocks/lib/package-tree.html | 208 + .../shynixn/petblocks/lib/package-use.html | 377 ++ docs/apidocs/constant-values.html | 162 + docs/apidocs/deprecated-list.html | 298 ++ docs/apidocs/help-doc.html | 231 ++ docs/apidocs/index-all.html | 3394 +++++++++++++++++ docs/apidocs/index.html | 76 + docs/apidocs/overview-frame.html | 47 + docs/apidocs/overview-summary.html | 240 ++ docs/apidocs/overview-tree.html | 693 ++++ docs/apidocs/package-list | 26 + docs/apidocs/script.js | 30 + docs/apidocs/serialized-form.html | 277 ++ docs/apidocs/stylesheet.css | 574 +++ docs/index.html | 14 + pom.xml | 6 +- .../nms/v1_12_R1/CustomGroundArmorstand.java | 7 +- .../bukkit/nms/v1_12_R1/CustomRabbit.java | 4 +- src/main/resources/plugin.yml | 2 +- 354 files changed, 89811 insertions(+), 14 deletions(-) create mode 100644 docs/apidocs/META-INF/MANIFEST.MF create mode 100644 docs/apidocs/allclasses-frame.html create mode 100644 docs/apidocs/allclasses-noframe.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/PetBlocksApi.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/class-use/PetBlocksApi.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/Age.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/CustomEntity.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/ItemContainer.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/MoveType.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/Movement.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/Particle.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/PetBlock.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/PetMeta.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/PetType.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Age.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/CustomEntity.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/ItemContainer.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/MoveType.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Movement.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Particle.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetBlock.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetMeta.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetType.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/entities/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockCancelAbleEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockCannonEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockDeathEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockMoveEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockRideEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockSpawnEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockWearEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockCancelAbleEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockCannonEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockDeathEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockMoveEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockRideEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockSpawnEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockWearEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/events/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/IController.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/ParticleEffectMetaController.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/IController.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/IDatabaseController.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/ParticleEffectMetaController.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/PetMetaController.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/PlayerMetaController.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.ParticleColor.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.ParticleEffectType.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/PetMeta.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/PlayerMeta.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.ParticleColor.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.ParticleEffectType.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/Persistenceable.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/PetMeta.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/PlayerMeta.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/Config.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/Language.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/Permission.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/class-use/PetBlocksPlugin.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/ClearLagListener.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/class-use/ClearLagListener.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/SuperVanishConnection.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/class-use/SuperVanishConnection.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/WorldGuardConnection5.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/WorldGuardConnection6.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/class-use/WorldGuardConnection5.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/class-use/WorldGuardConnection6.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/NMSRegistry.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/class-use/NMSRegistry.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.TickCallBack.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/class-use/PetBlockHelper.TickCallBack.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/class-use/PetBlockHelper.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/Listener19.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/Listener19.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/CustomRabbit.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/CustomZombie.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/OwnerPathfinder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/class-use/Config.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/class-use/Language.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/class-use/Permission.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/business/PetDataManager.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/business/class-use/PetBlockManager.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/business/class-use/PetDataManager.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigCommands.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigPet.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigCommands.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigGUI.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigParticle.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigPet.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/Factory.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/class-use/Factory.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/ParticleEffectDataRepository.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/PetDataRepository.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/PlayerDataRepository.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PersistenceObject.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PlayerData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/ParticleEffectData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PersistenceObject.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PetData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PlayerData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/business/package-use.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/BukkitChatColor.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/BukkitCommands.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/BukkitUtilities.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/DataBaseRepository.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/DynamicCommandHelper.CommandContainer.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/DynamicCommandHelper.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.SQlRetriever.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/Filtering.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/Interpreter19.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/LightRegistry.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/Particle.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleBuilder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.BlockData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ItemData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.NoteColor.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.OrdinaryColor.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleColor.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticlePacket.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleProperty.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.DataType.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.PackageType.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.PluginLoad.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.PluginUnload.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ReflectionLib.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/ReflectionUtils.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/RegisterHelper.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/SimpleListener.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/SkullMetaRegistry.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/SoundData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/SpigotEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitChatColor.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitCommands.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitUtilities.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DataBaseRepository.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DynamicCommandHelper.CommandContainer.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DynamicCommandHelper.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ExtensionHikariConnectionContext.SQlRetriever.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ExtensionHikariConnectionContext.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Filtering.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Interpreter19.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/LightRegistry.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Particle.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleBuilder.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.BlockData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ItemData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.NoteColor.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.OrdinaryColor.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleColor.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticlePacket.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleProperty.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.DataType.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.PackageType.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.PluginLoad.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.PluginUnload.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ReflectionLib.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ReflectionUtils.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/RegisterHelper.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SimpleListener.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SkullMetaRegistry.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SoundData.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SpigotEvent.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/package-frame.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/package-summary.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/package-tree.html create mode 100644 docs/apidocs/com/github/shynixn/petblocks/lib/package-use.html create mode 100644 docs/apidocs/constant-values.html create mode 100644 docs/apidocs/deprecated-list.html create mode 100644 docs/apidocs/help-doc.html create mode 100644 docs/apidocs/index-all.html create mode 100644 docs/apidocs/index.html create mode 100644 docs/apidocs/overview-frame.html create mode 100644 docs/apidocs/overview-summary.html create mode 100644 docs/apidocs/overview-tree.html create mode 100644 docs/apidocs/package-list create mode 100644 docs/apidocs/script.js create mode 100644 docs/apidocs/serialized-form.html create mode 100644 docs/apidocs/stylesheet.css create mode 100644 docs/index.html diff --git a/.travis.yml b/.travis.yml index 77a9dbc35..ef2c76a9f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,8 @@ script: - java -jar BuildTools.jar --rev 1.9 - java -jar BuildTools.jar --rev 1.9.4 - java -jar BuildTools.jar --rev 1.10 - - java -jar BuildTools.jar - - java -jar BuildTools.jar --dev + - java -jar BuildTools.jar --rev 1.11 + - java -jar BuildTools.jar --rev 1.12 - cd - - mvn compile test jdk: diff --git a/README.md b/README.md index 4c22cee04..1cb7b1625 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ | master | [![Build Status](https://travis-ci.org/Shynixn/PetBlocks.svg?branch=master)](https://travis-ci.org/Shynixn/PetBlocks) |[Download latest release (recommend)](https://github.com/Shynixn/PetBlocks/releases)| | workflow | [![Build Status](https://travis-ci.org/Shynixn/PetBlocks.svg?branch=workflow)](https://travis-ci.org/Shynixn/PetBlocks) | [Download snapshots](https://oss.sonatype.org/content/repositories/snapshots/com/github/shynixn/petblocks/) | +JavaDocs: https://shynixn.github.io/PetBlocks/apidocs/ + ## Description Spigot plugin to use blocks as pets in minecraft. @@ -33,7 +35,7 @@ Spigot plugin to use blocks as pets in minecraft. com.github.shynixn petblocks - 5.7.0 + 6.0.0 ``` diff --git a/docs/apidocs/META-INF/MANIFEST.MF b/docs/apidocs/META-INF/MANIFEST.MF new file mode 100644 index 000000000..74f7fa5e2 --- /dev/null +++ b/docs/apidocs/META-INF/MANIFEST.MF @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Archiver-Version: Plexus Archiver +Built-By: Christoph +Created-By: Apache Maven +Build-Jdk: 1.8.0_112 + diff --git a/docs/apidocs/allclasses-frame.html b/docs/apidocs/allclasses-frame.html new file mode 100644 index 000000000..96e93ce9c --- /dev/null +++ b/docs/apidocs/allclasses-frame.html @@ -0,0 +1,133 @@ + + + + + + +All Classes (PetBlocks 6.0.0 API) + + + + + +

All Classes

+
+ +
+ + diff --git a/docs/apidocs/allclasses-noframe.html b/docs/apidocs/allclasses-noframe.html new file mode 100644 index 000000000..3e0493b32 --- /dev/null +++ b/docs/apidocs/allclasses-noframe.html @@ -0,0 +1,133 @@ + + + + + + +All Classes (PetBlocks 6.0.0 API) + + + + + +

All Classes

+
+ +
+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/PetBlocksApi.html b/docs/apidocs/com/github/shynixn/petblocks/api/PetBlocksApi.html new file mode 100644 index 000000000..f76e40789 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/PetBlocksApi.html @@ -0,0 +1,398 @@ + + + + + + +PetBlocksApi (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api
+

Class PetBlocksApi

+
+
+ +
+
    +
  • +
    +
    +
    public final class PetBlocksApi
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlocksApi

        +
        public PetBlocksApi()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setPetBlock

        +
        public static void setPetBlock(org.bukkit.entity.Player player,
        +                               PetMeta petMeta)
        +
      • +
      + + + +
        +
      • +

        setPetBlock

        +
        public static void setPetBlock(org.bukkit.entity.Player player,
        +                               PetMeta petMeta,
        +                               int delay)
        +
      • +
      + + + +
        +
      • +

        removePetBlock

        +
        public static void removePetBlock(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        hasPetBlock

        +
        public static boolean hasPetBlock(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        getPetBlock

        +
        public static PetBlock getPetBlock(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        getPetMeta

        +
        public static PetMeta getPetMeta(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        removePetMeta

        +
        public static void removePetMeta(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        setPetMeta

        +
        public static void setPetMeta(org.bukkit.entity.Player player,
        +                              PetType petType)
        +
      • +
      + + + +
        +
      • +

        persistPetMeta

        +
        public static void persistPetMeta(PetMeta petMeta)
        +
      • +
      + + + +
        +
      • +

        hasPetMeta

        +
        public static boolean hasPetMeta(org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/class-use/PetBlocksApi.html b/docs/apidocs/com/github/shynixn/petblocks/api/class-use/PetBlocksApi.html new file mode 100644 index 000000000..93b2c367d --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/class-use/PetBlocksApi.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.PetBlocksApi (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.PetBlocksApi

+
+
No usage of com.github.shynixn.petblocks.api.PetBlocksApi
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/Age.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/Age.html new file mode 100644 index 000000000..24a64460c --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/Age.html @@ -0,0 +1,370 @@ + + + + + + +Age (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.entities
+

Enum Age

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        SMALL

        +
        public static final Age SMALL
        +
      • +
      + + + +
        +
      • +

        LARGE

        +
        public static final Age LARGE
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Age[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Age c : Age.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Age valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getTicks

        +
        public int getTicks()
        +
      • +
      + + + +
        +
      • +

        getAgeFromTicks

        +
        public static Age getAgeFromTicks(int ticks)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/CustomEntity.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/CustomEntity.html new file mode 100644 index 000000000..b6b2a6666 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/CustomEntity.html @@ -0,0 +1,241 @@ + + + + + + +CustomEntity (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.entities
+

Interface CustomEntity

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getSpigotEntity

        +
        org.bukkit.entity.LivingEntity getSpigotEntity()
        +
      • +
      + + + +
        +
      • +

        spawn

        +
        void spawn(org.bukkit.Location location)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/ItemContainer.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/ItemContainer.html new file mode 100644 index 000000000..53563daf8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/ItemContainer.html @@ -0,0 +1,358 @@ + + + + + + +ItemContainer (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.entities
+

Interface ItemContainer

+
+
+
+
    +
  • +
    +
    +
    public interface ItemContainer
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getMoveType

        +
        MoveType getMoveType()
        +
      • +
      + + + +
        +
      • +

        generate

        +
        org.bukkit.inventory.ItemStack generate()
        +
      • +
      + + + +
        +
      • +

        getLore

        +
        String[] getLore()
        +
      • +
      + + + +
        +
      • +

        setEnabled

        +
        void setEnabled(boolean enabled)
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        int getPosition()
        +
      • +
      + + + +
        +
      • +

        getLore

        +
        String[] getLore(org.bukkit.entity.Player player,
        +                 Permission... permission)
        +
      • +
      + + + +
        +
      • +

        getLore

        +
        String[] getLore(org.bukkit.entity.Player player,
        +                 String... permission)
        +
      • +
      + + + +
        +
      • +

        getSkullName

        +
        String getSkullName()
        +
      • +
      + + + +
        +
      • +

        getId

        +
        int getId()
        +
      • +
      + + + +
        +
      • +

        getDamage

        +
        int getDamage()
        +
      • +
      + + + +
        +
      • +

        getMovement

        +
        Movement getMovement()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/MoveType.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/MoveType.html new file mode 100644 index 000000000..8f21c3136 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/MoveType.html @@ -0,0 +1,356 @@ + + + + + + +MoveType (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.entities
+

Enum MoveType

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        FLYING

        +
        public static final MoveType FLYING
        +
      • +
      + + + +
        +
      • +

        WALKING

        +
        public static final MoveType WALKING
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static MoveType[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (MoveType c : MoveType.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static MoveType valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getMoveTypeFromName

        +
        public static MoveType getMoveTypeFromName(String name)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/Movement.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/Movement.html new file mode 100644 index 000000000..42e179f76 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/Movement.html @@ -0,0 +1,357 @@ + + + + + + +Movement (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.entities
+

Enum Movement

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        CRAWLING

        +
        public static final Movement CRAWLING
        +
      • +
      + + + +
        +
      • +

        HOPPING

        +
        public static final Movement HOPPING
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Movement[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Movement c : Movement.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Movement valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getMovementFromName

        +
        public static Movement getMovementFromName(String name)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/Particle.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/Particle.html new file mode 100644 index 000000000..574eb1336 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/Particle.html @@ -0,0 +1,364 @@ + + + + + + +Particle (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.entities
+

Interface Particle

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        play

        +
        void play(org.bukkit.Location location)
        +
      • +
      + + + +
        +
      • +

        play

        +
        void play(org.bukkit.Location location,
        +          org.bukkit.entity.Player... players)
        +
      • +
      + + + + + + + +
        +
      • +

        getX

        +
        double getX()
        +
      • +
      + + + +
        +
      • +

        getY

        +
        double getY()
        +
      • +
      + + + +
        +
      • +

        getZ

        +
        double getZ()
        +
      • +
      + + + +
        +
      • +

        getSpeed

        +
        double getSpeed()
        +
      • +
      + + + +
        +
      • +

        getAmount

        +
        int getAmount()
        +
      • +
      + + + +
        +
      • +

        getMaterial

        +
        org.bukkit.Material getMaterial()
        +
      • +
      + + + +
        +
      • +

        getMaterialId

        +
        int getMaterialId()
        +
      • +
      + + + +
        +
      • +

        getData

        +
        byte getData()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/PetBlock.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/PetBlock.html new file mode 100644 index 000000000..8bee14ec7 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/PetBlock.html @@ -0,0 +1,524 @@ + + + + + + +PetBlock (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.entities
+

Interface PetBlock

+
+
+
+
    +
  • +
    +
    +
    public interface PetBlock
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        remove

        +
        void remove()
        +
      • +
      + + + +
        +
      • +

        ride

        +
        void ride(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        wear

        +
        void wear(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        setDisplayName

        +
        void setDisplayName(String name)
        +
      • +
      + + + +
        +
      • +

        getDisplayName

        +
        String getDisplayName()
        +
      • +
      + + + +
        +
      • +

        respawn

        +
        void respawn()
        +
      • +
      + + + +
        +
      • +

        isDead

        +
        boolean isDead()
        +
      • +
      + + + +
        +
      • +

        getArmorStand

        +
        org.bukkit.entity.ArmorStand getArmorStand()
        +
      • +
      + + + +
        +
      • +

        setSkin

        +
        void setSkin(String skin)
        +
      • +
      + + + +
        +
      • +

        setSkin

        +
        void setSkin(org.bukkit.Material material,
        +             byte data)
        +
      • +
      + + + +
        +
      • +

        getMovementEntity

        +
        org.bukkit.entity.LivingEntity getMovementEntity()
        +
      • +
      + + + +
        +
      • +

        eject

        +
        void eject(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        damage

        +
        void damage(double amount)
        +
      • +
      + + + +
        +
      • +

        teleport

        +
        void teleport(org.bukkit.Location location)
        +
      • +
      + + + +
        +
      • +

        teleport

        +
        void teleport(org.bukkit.entity.Entity entity)
        +
      • +
      + + + +
        +
      • +

        setDieing

        +
        void setDieing()
        +
      • +
      + + + +
        +
      • +

        getOwner

        +
        org.bukkit.entity.Player getOwner()
        +
      • +
      + + + +
        +
      • +

        jump

        +
        void jump()
        +
      • +
      + + + +
        +
      • +

        launch

        +
        void launch(org.bukkit.util.Vector vector)
        +
      • +
      + + + +
        +
      • +

        getLocation

        +
        org.bukkit.Location getLocation()
        +
      • +
      + + + +
        +
      • +

        getPetMeta

        +
        PetMeta getPetMeta()
        +
      • +
      + + + +
        +
      • +

        teleportWithOwner

        +
        void teleportWithOwner(org.bukkit.Location location)
        +
      • +
      + + + +
        +
      • +

        isDieing

        +
        boolean isDieing()
        +
      • +
      + + + +
        +
      • +

        refreshHeadMeta

        +
        void refreshHeadMeta()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/PetMeta.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/PetMeta.html new file mode 100644 index 000000000..ac7cd1e93 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/PetMeta.html @@ -0,0 +1,728 @@ + + + + + + +PetMeta (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.entities
+

Interface PetMeta

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getMovementType

        +
        Movement getMovementType()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setMovementType

        +
        void setMovementType(Movement movementType)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getType

        +
        PetType getType()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        boolean isUnbreakable()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setUnbreakable

        +
        void setUnbreakable(boolean unbreakable)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setSoundsEnabled

        +
        void setSoundsEnabled(boolean enabled)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        isSoundsEnabled

        +
        boolean isSoundsEnabled()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setHidden

        +
        void setHidden(boolean enabled)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        isHidden

        +
        boolean isHidden()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getSkin

        +
        String getSkin()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getDisplayName

        +
        String getDisplayName()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getHeadDisplayName

        +
        String getHeadDisplayName()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setHeadDisplayName

        +
        void setHeadDisplayName(String headDisplayName)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getHeadLore

        +
        String[] getHeadLore()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setHeadLore

        +
        void setHeadLore(String[] headLore)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setPetType

        +
        void setPetType(PetType petType)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setDisplayName

        +
        void setDisplayName(String name)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getMoveType

        +
        MoveType getMoveType()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setMoveType

        +
        void setMoveType(MoveType moveType)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getSkinMaterial

        +
        org.bukkit.Material getSkinMaterial()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getSkinDurability

        +
        short getSkinDurability()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setEnabled

        +
        void setEnabled(boolean enabled)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        isEnabled

        +
        boolean isEnabled()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setSkin

        +
        void setSkin(org.bukkit.Material material,
        +             short durability,
        +             String skin)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setAge

        +
        void setAge(Age age)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setAgeInTicks

        +
        void setAgeInTicks(int ticks)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getAgeInTicks

        +
        int getAgeInTicks()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getAge

        +
        Age getAge()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getOwner

        +
        @Deprecated
        +org.bukkit.entity.Player getOwner()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setParticleEffect

        +
        @Deprecated
        +void setParticleEffect(Particle particle)
        +
        Deprecated. 
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/PetType.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/PetType.html new file mode 100644 index 000000000..859469c69 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/PetType.html @@ -0,0 +1,714 @@ + + + + + + +PetType (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.entities
+

Enum PetType

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        PIG

        +
        public static final PetType PIG
        +
      • +
      + + + +
        +
      • +

        CHICKEN

        +
        public static final PetType CHICKEN
        +
      • +
      + + + +
        +
      • +

        DOG

        +
        public static final PetType DOG
        +
      • +
      + + + +
        +
      • +

        CAT

        +
        public static final PetType CAT
        +
      • +
      + + + +
        +
      • +

        BIRD

        +
        public static final PetType BIRD
        +
      • +
      + + + +
        +
      • +

        COW

        +
        public static final PetType COW
        +
      • +
      + + + +
        +
      • +

        SHEEP

        +
        public static final PetType SHEEP
        +
      • +
      + + + +
        +
      • +

        IRONGOLEM

        +
        public static final PetType IRONGOLEM
        +
      • +
      + + + +
        +
      • +

        ZOMBIE

        +
        public static final PetType ZOMBIE
        +
      • +
      + + + +
        +
      • +

        SKELETON

        +
        public static final PetType SKELETON
        +
      • +
      + + + +
        +
      • +

        CREEPER

        +
        public static final PetType CREEPER
        +
      • +
      + + + +
        +
      • +

        SPIDER

        +
        public static final PetType SPIDER
        +
      • +
      + + + +
        +
      • +

        VILLAGER

        +
        public static final PetType VILLAGER
        +
      • +
      + + + +
        +
      • +

        HORSE

        +
        public static final PetType HORSE
        +
      • +
      + + + +
        +
      • +

        HUMAN

        +
        public static final PetType HUMAN
        +
      • +
      + + + +
        +
      • +

        ENDERMAN

        +
        public static final PetType ENDERMAN
        +
      • +
      + + + +
        +
      • +

        SILVERFISH

        +
        public static final PetType SILVERFISH
        +
      • +
      + + + +
        +
      • +

        BAT

        +
        public static final PetType BAT
        +
      • +
      + + + +
        +
      • +

        SLIME

        +
        public static final PetType SLIME
        +
      • +
      + + + +
        +
      • +

        LAVASLIME

        +
        public static final PetType LAVASLIME
        +
      • +
      + + + +
        +
      • +

        PIGZOMBIE

        +
        public static final PetType PIGZOMBIE
        +
      • +
      + + + +
        +
      • +

        GHAST

        +
        public static final PetType GHAST
        +
      • +
      + + + +
        +
      • +

        BLAZE

        +
        public static final PetType BLAZE
        +
      • +
      + + + +
        +
      • +

        WITHER

        +
        public static final PetType WITHER
        +
      • +
      + + + +
        +
      • +

        DRAGON

        +
        public static final PetType DRAGON
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static PetType[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (PetType c : PetType.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static PetType valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + + + + + +
        +
      • +

        playMovingSound

        +
        public void playMovingSound(org.bukkit.Location location)
        +
      • +
      + + + +
        +
      • +

        playMovingSound

        +
        public void playMovingSound(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        playRandomSound

        +
        public void playRandomSound(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        playRandomSound

        +
        public void playRandomSound(org.bukkit.Location location)
        +
      • +
      + + + +
        +
      • +

        getNames

        +
        public static String[] getNames()
        +
      • +
      + + + +
        +
      • +

        getPetTypeFromName

        +
        public static PetType getPetTypeFromName(String name)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Age.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Age.html new file mode 100644 index 000000000..d4d383b38 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Age.html @@ -0,0 +1,257 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.entities.Age (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.entities.Age

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/CustomEntity.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/CustomEntity.html new file mode 100644 index 000000000..3bdcb18c0 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/CustomEntity.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.entities.CustomEntity (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.entities.CustomEntity

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/ItemContainer.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/ItemContainer.html new file mode 100644 index 000000000..aabd226eb --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/ItemContainer.html @@ -0,0 +1,285 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.entities.ItemContainer (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.entities.ItemContainer

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/MoveType.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/MoveType.html new file mode 100644 index 000000000..3c041bd02 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/MoveType.html @@ -0,0 +1,267 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.entities.MoveType (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.entities.MoveType

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Movement.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Movement.html new file mode 100644 index 000000000..94cb143f1 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Movement.html @@ -0,0 +1,239 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.entities.Movement (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.entities.Movement

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Particle.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Particle.html new file mode 100644 index 000000000..5f5f7524f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/Particle.html @@ -0,0 +1,268 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.entities.Particle (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.entities.Particle

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetBlock.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetBlock.html new file mode 100644 index 000000000..c0bdcce99 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetBlock.html @@ -0,0 +1,371 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.entities.PetBlock (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.entities.PetBlock

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetMeta.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetMeta.html new file mode 100644 index 000000000..25fa05d61 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetMeta.html @@ -0,0 +1,515 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.entities.PetMeta (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.entities.PetMeta

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetType.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetType.html new file mode 100644 index 000000000..95b6fa231 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/class-use/PetType.html @@ -0,0 +1,346 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.entities.PetType (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.entities.PetType

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-frame.html new file mode 100644 index 000000000..8fc7decee --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-frame.html @@ -0,0 +1,32 @@ + + + + + + +com.github.shynixn.petblocks.api.entities (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.api.entities

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-summary.html new file mode 100644 index 000000000..410df0f27 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-summary.html @@ -0,0 +1,195 @@ + + + + + + +com.github.shynixn.petblocks.api.entities (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.api.entities

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-tree.html new file mode 100644 index 000000000..2a7772002 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-tree.html @@ -0,0 +1,158 @@ + + + + + + +com.github.shynixn.petblocks.api.entities Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.api.entities

+Package Hierarchies: + +
+
+

Interface Hierarchy

+ +

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) +
        +
      • com.github.shynixn.petblocks.api.entities.PetType
      • +
      • com.github.shynixn.petblocks.api.entities.MoveType
      • +
      • com.github.shynixn.petblocks.api.entities.Movement
      • +
      • com.github.shynixn.petblocks.api.entities.Age
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-use.html new file mode 100644 index 000000000..2a6dafbe1 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/entities/package-use.html @@ -0,0 +1,466 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.api.entities (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.api.entities

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockCancelAbleEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockCancelAbleEvent.html new file mode 100644 index 000000000..88c7e4cb5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockCancelAbleEvent.html @@ -0,0 +1,342 @@ + + + + + + +PetBlockCancelAbleEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.events
+

Class PetBlockCancelAbleEvent

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlockCancelAbleEvent

        +
        public PetBlockCancelAbleEvent(PetBlock petBlock)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isCanceled

        +
        public boolean isCanceled()
        +
      • +
      + + + +
        +
      • +

        setCanceled

        +
        public void setCanceled(boolean isCanceled)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockCannonEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockCannonEvent.html new file mode 100644 index 000000000..6f47ccf20 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockCannonEvent.html @@ -0,0 +1,303 @@ + + + + + + +PetBlockCannonEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.events
+

Class PetBlockCannonEvent

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlockCannonEvent

        +
        public PetBlockCannonEvent(PetBlock petBlock)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockDeathEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockDeathEvent.html new file mode 100644 index 000000000..7860b40d1 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockDeathEvent.html @@ -0,0 +1,303 @@ + + + + + + +PetBlockDeathEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.events
+

Class PetBlockDeathEvent

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlockDeathEvent

        +
        public PetBlockDeathEvent(PetBlock petBlock)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockEvent.html new file mode 100644 index 000000000..751fe83a5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockEvent.html @@ -0,0 +1,330 @@ + + + + + + +PetBlockEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.events
+

Class PetBlockEvent

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlockEvent

        +
        public PetBlockEvent(PetBlock petBlock)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getPetBlock

        +
        public PetBlock getPetBlock()
        +
      • +
      + + + +
        +
      • +

        getPlayer

        +
        public org.bukkit.entity.Player getPlayer()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockMoveEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockMoveEvent.html new file mode 100644 index 000000000..3310bf982 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockMoveEvent.html @@ -0,0 +1,291 @@ + + + + + + +PetBlockMoveEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.events
+

Class PetBlockMoveEvent

+
+
+ +
+
    +
  • +
    +
    +
    public class PetBlockMoveEvent
    +extends PetBlockEvent
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlockMoveEvent

        +
        public PetBlockMoveEvent(PetBlock petBlock)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockRideEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockRideEvent.html new file mode 100644 index 000000000..75587ce21 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockRideEvent.html @@ -0,0 +1,339 @@ + + + + + + +PetBlockRideEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.events
+

Class PetBlockRideEvent

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlockRideEvent

        +
        public PetBlockRideEvent(PetBlock petBlock,
        +                         boolean isRiding)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isRiding

        +
        public boolean isRiding()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockSpawnEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockSpawnEvent.html new file mode 100644 index 000000000..ce893f783 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockSpawnEvent.html @@ -0,0 +1,303 @@ + + + + + + +PetBlockSpawnEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.events
+

Class PetBlockSpawnEvent

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlockSpawnEvent

        +
        public PetBlockSpawnEvent(PetBlock petBlock)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockWearEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockWearEvent.html new file mode 100644 index 000000000..1a6995b7a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/PetBlockWearEvent.html @@ -0,0 +1,339 @@ + + + + + + +PetBlockWearEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.events
+

Class PetBlockWearEvent

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlockWearEvent

        +
        public PetBlockWearEvent(PetBlock petBlock,
        +                         boolean wearing)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isWearning

        +
        public boolean isWearning()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockCancelAbleEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockCancelAbleEvent.html new file mode 100644 index 000000000..52569485f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockCancelAbleEvent.html @@ -0,0 +1,192 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.events.PetBlockCancelAbleEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.events.PetBlockCancelAbleEvent

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockCannonEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockCannonEvent.html new file mode 100644 index 000000000..60eca6add --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockCannonEvent.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.events.PetBlockCannonEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.events.PetBlockCannonEvent

+
+
No usage of com.github.shynixn.petblocks.api.events.PetBlockCannonEvent
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockDeathEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockDeathEvent.html new file mode 100644 index 000000000..8553c31f4 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockDeathEvent.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.events.PetBlockDeathEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.events.PetBlockDeathEvent

+
+
No usage of com.github.shynixn.petblocks.api.events.PetBlockDeathEvent
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockEvent.html new file mode 100644 index 000000000..a8dac9789 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockEvent.html @@ -0,0 +1,204 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.events.PetBlockEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.events.PetBlockEvent

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockMoveEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockMoveEvent.html new file mode 100644 index 000000000..2bca7fc18 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockMoveEvent.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.events.PetBlockMoveEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.events.PetBlockMoveEvent

+
+
No usage of com.github.shynixn.petblocks.api.events.PetBlockMoveEvent
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockRideEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockRideEvent.html new file mode 100644 index 000000000..1ed3d5d30 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockRideEvent.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.events.PetBlockRideEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.events.PetBlockRideEvent

+
+
No usage of com.github.shynixn.petblocks.api.events.PetBlockRideEvent
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockSpawnEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockSpawnEvent.html new file mode 100644 index 000000000..9dc0a1038 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockSpawnEvent.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.events.PetBlockSpawnEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.events.PetBlockSpawnEvent

+
+
No usage of com.github.shynixn.petblocks.api.events.PetBlockSpawnEvent
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockWearEvent.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockWearEvent.html new file mode 100644 index 000000000..b08010db7 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/class-use/PetBlockWearEvent.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.events.PetBlockWearEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.events.PetBlockWearEvent

+
+
No usage of com.github.shynixn.petblocks.api.events.PetBlockWearEvent
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/package-frame.html new file mode 100644 index 000000000..4fa2f81c8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/package-frame.html @@ -0,0 +1,28 @@ + + + + + + +com.github.shynixn.petblocks.api.events (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.api.events

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/package-summary.html new file mode 100644 index 000000000..69f34ce99 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/package-summary.html @@ -0,0 +1,188 @@ + + + + + + +com.github.shynixn.petblocks.api.events (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.api.events

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/package-tree.html new file mode 100644 index 000000000..9dc249eb8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/package-tree.html @@ -0,0 +1,160 @@ + + + + + + +com.github.shynixn.petblocks.api.events Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.api.events

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/events/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/api/events/package-use.html new file mode 100644 index 000000000..5c8b097b4 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/events/package-use.html @@ -0,0 +1,166 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.api.events (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.api.events

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/api/package-frame.html new file mode 100644 index 000000000..764980e0a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.github.shynixn.petblocks.api (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.api

+
+

Classes

+ +
+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/api/package-summary.html new file mode 100644 index 000000000..10c412548 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/package-summary.html @@ -0,0 +1,144 @@ + + + + + + +com.github.shynixn.petblocks.api (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.api

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    PetBlocksApi 
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/api/package-tree.html new file mode 100644 index 000000000..56990cf81 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/package-tree.html @@ -0,0 +1,139 @@ + + + + + + +com.github.shynixn.petblocks.api Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.api

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/api/package-use.html new file mode 100644 index 000000000..390d3253e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.api (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.api

+
+
No usage of com.github.shynixn.petblocks.api
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/IController.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/IController.html new file mode 100644 index 000000000..d9a1367da --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/IController.html @@ -0,0 +1,314 @@ + + + + + + +IController (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.controller
+

Interface IController<T>

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      List<T>getAll() +
      Returns all items from the repository as unmodifiableList
      +
      voidremove(T item) +
      Removes an item from the repository
      +
      intsize() +
      Returns the amount of items in the repository
      +
      voidstore(T item) +
      Stores a new a item in the repository
      +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        store

        +
        void store(T item)
        +
        Stores a new a item in the repository
        +
        +
        Parameters:
        +
        item - item
        +
        +
      • +
      + + + + + +
        +
      • +

        remove

        +
        void remove(T item)
        +
        Removes an item from the repository
        +
        +
        Parameters:
        +
        item - item
        +
        +
      • +
      + + + +
        +
      • +

        size

        +
        int size()
        +
        Returns the amount of items in the repository
        +
        +
        Returns:
        +
        size
        +
        +
      • +
      + + + +
        +
      • +

        getAll

        +
        List<T> getAll()
        +
        Returns all items from the repository as unmodifiableList
        +
        +
        Returns:
        +
        items
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.html new file mode 100644 index 000000000..abea8e681 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/IDatabaseController.html @@ -0,0 +1,259 @@ + + + + + + +IDatabaseController (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.controller
+

Interface IDatabaseController<T>

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getById

        +
        T getById(long id)
        +
        Returns the item of the given id
        +
        +
        Parameters:
        +
        id - id
        +
        Returns:
        +
        item
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/ParticleEffectMetaController.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/ParticleEffectMetaController.html new file mode 100644 index 000000000..27edccd0f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/ParticleEffectMetaController.html @@ -0,0 +1,260 @@ + + + + + + +ParticleEffectMetaController (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.controller
+

Interface ParticleEffectMetaController

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        create

        +
        ParticleEffectMeta create()
        +
        Creates a new particleEffectMeta
        +
        +
        Returns:
        +
        meta
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.html new file mode 100644 index 000000000..c6e2bf841 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/PetMetaController.html @@ -0,0 +1,284 @@ + + + + + + +PetMetaController (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.controller
+

Interface PetMetaController

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getByPlayer

        +
        PetMeta getByPlayer(org.bukkit.entity.Player player)
        +
        Returns the petdata from the given player
        +
        +
        Parameters:
        +
        player - player
        +
        Returns:
        +
        petData
        +
        +
      • +
      + + + +
        +
      • +

        hasEntry

        +
        boolean hasEntry(org.bukkit.entity.Player player)
        +
        Checks if the player has got an entry in the database
        +
        +
        Parameters:
        +
        player - player
        +
        Returns:
        +
        hasEntry
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.html new file mode 100644 index 000000000..a83064927 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/PlayerMetaController.html @@ -0,0 +1,284 @@ + + + + + + +PlayerMetaController (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.controller
+

Interface PlayerMetaController

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        create

        +
        PlayerMeta create(org.bukkit.entity.Player player)
        +
        Creates a new playerData from the given player
        +
        +
        Parameters:
        +
        player - player
        +
        Returns:
        +
        playerData
        +
        +
      • +
      + + + +
        +
      • +

        getByUUID

        +
        PlayerMeta getByUUID(UUID uuid)
        +
        Returns the playerMeta of the given uuid
        +
        +
        Parameters:
        +
        uuid - uuid
        +
        Returns:
        +
        playerMeta
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/IController.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/IController.html new file mode 100644 index 000000000..486430893 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/IController.html @@ -0,0 +1,238 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.persistence.controller.IController (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.persistence.controller.IController

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/IDatabaseController.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/IDatabaseController.html new file mode 100644 index 000000000..4b3d2ae6f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/IDatabaseController.html @@ -0,0 +1,234 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.persistence.controller.IDatabaseController (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.persistence.controller.IDatabaseController

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/ParticleEffectMetaController.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/ParticleEffectMetaController.html new file mode 100644 index 000000000..7d63d6278 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/ParticleEffectMetaController.html @@ -0,0 +1,188 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController

+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/PetMetaController.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/PetMetaController.html new file mode 100644 index 000000000..704013ab8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/PetMetaController.html @@ -0,0 +1,190 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.persistence.controller.PetMetaController (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.persistence.controller.PetMetaController

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/PlayerMetaController.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/PlayerMetaController.html new file mode 100644 index 000000000..757317b21 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/class-use/PlayerMetaController.html @@ -0,0 +1,190 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-frame.html new file mode 100644 index 000000000..da5e68be2 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-frame.html @@ -0,0 +1,25 @@ + + + + + + +com.github.shynixn.petblocks.api.persistence.controller (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.api.persistence.controller

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-summary.html new file mode 100644 index 000000000..6acd72f06 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-summary.html @@ -0,0 +1,160 @@ + + + + + + +com.github.shynixn.petblocks.api.persistence.controller (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.api.persistence.controller

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-tree.html new file mode 100644 index 000000000..5553d9cf5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-tree.html @@ -0,0 +1,149 @@ + + + + + + +com.github.shynixn.petblocks.api.persistence.controller Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.api.persistence.controller

+Package Hierarchies: + +
+
+

Interface Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-use.html new file mode 100644 index 000000000..98d2c94fb --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/controller/package-use.html @@ -0,0 +1,240 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.api.persistence.controller (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.api.persistence.controller

+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.ParticleColor.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.ParticleColor.html new file mode 100644 index 000000000..e4fd1025b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.ParticleColor.html @@ -0,0 +1,576 @@ + + + + + + +ParticleEffectMeta.ParticleColor (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.entity
+

Enum ParticleEffectMeta.ParticleColor

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.ParticleEffectType.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.ParticleEffectType.html new file mode 100644 index 000000000..d3581007b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.ParticleEffectType.html @@ -0,0 +1,964 @@ + + + + + + +ParticleEffectMeta.ParticleEffectType (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.entity
+

Enum ParticleEffectMeta.ParticleEffectType

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.html new file mode 100644 index 000000000..74007a863 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/ParticleEffectMeta.html @@ -0,0 +1,912 @@ + + + + + + +ParticleEffectMeta (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.entity
+

Interface ParticleEffectMeta

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setColor

        +
        ParticleEffectMeta setColor(int red,
        +                            int green,
        +                            int blue)
        +
        Sets the RGB colors of the particleEffect
        +
        +
        Parameters:
        +
        red - red
        +
        green - green
        +
        blue - blue
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + + + + + +
        +
      • +

        setNoteColor

        +
        ParticleEffectMeta setNoteColor(int color)
        +
        Sets the color for note particleEffect
        +
        +
        Parameters:
        +
        color - color
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setAmount

        +
        ParticleEffectMeta setAmount(int amount)
        +
        Sets the amount of particles of the particleEffect
        +
        +
        Parameters:
        +
        amount - amount
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setSpeed

        +
        ParticleEffectMeta setSpeed(double speed)
        +
        Sets the speed of the particleEffect
        +
        +
        Parameters:
        +
        speed - speed
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setX

        +
        ParticleEffectMeta setX(double x)
        +
        Sets the x coordinate of the particleEffect
        +
        +
        Parameters:
        +
        x - x
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setY

        +
        ParticleEffectMeta setY(double y)
        +
        Sets the y coordinate of the particleEffect
        +
        +
        Parameters:
        +
        y - y
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setZ

        +
        ParticleEffectMeta setZ(double z)
        +
        Sets the z coordinate of the particleEffect
        +
        +
        Parameters:
        +
        z - z
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setEffectName

        +
        ParticleEffectMeta setEffectName(String name)
        +
        Sets the effectType of the particleEffect
        +
        +
        Parameters:
        +
        name - name
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + + + + + +
        +
      • +

        setBlue

        +
        ParticleEffectMeta setBlue(int blue)
        +
        Sets the blue of the RGB color
        +
        +
        Parameters:
        +
        blue - blue
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setRed

        +
        ParticleEffectMeta setRed(int red)
        +
        Sets the red of the RGB color
        +
        +
        Parameters:
        +
        red - red
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setGreen

        +
        ParticleEffectMeta setGreen(int green)
        +
        Sets the green of the RGB color
        +
        +
        Parameters:
        +
        green - green
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setMaterial

        +
        ParticleEffectMeta setMaterial(org.bukkit.Material material)
        +
        Sets the material of the particleEffect
        +
        +
        Parameters:
        +
        material - material
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setData

        +
        ParticleEffectMeta setData(Byte data)
        +
        Sets the data of the material of the particleEffect
        +
        +
        Parameters:
        +
        data - data
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        getEffectName

        +
        String getEffectName()
        +
        Returns the effect of the particleEffect
        +
        +
        Returns:
        +
        effectName
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getAmount

        +
        int getAmount()
        +
        Returns the amount of particles of the particleEffect
        +
        +
        Returns:
        +
        amount
        +
        +
      • +
      + + + +
        +
      • +

        getSpeed

        +
        double getSpeed()
        +
        Returns the speed of the particleEffect
        +
        +
        Returns:
        +
        speed
        +
        +
      • +
      + + + +
        +
      • +

        getX

        +
        double getX()
        +
        Returns the x coordinate of the particleEffect
        +
        +
        Returns:
        +
        x
        +
        +
      • +
      + + + +
        +
      • +

        getY

        +
        double getY()
        +
        Returns the y coordinate of the particleEffect
        +
        +
        Returns:
        +
        y
        +
        +
      • +
      + + + +
        +
      • +

        getZ

        +
        double getZ()
        +
        Returns the z coordinate of the particleEffect
        +
        +
        Returns:
        +
        z
        +
        +
      • +
      + + + +
        +
      • +

        getBlue

        +
        int getBlue()
        +
        Returns the RGB color blue of the particleEffect
        +
        +
        Returns:
        +
        blue
        +
        +
      • +
      + + + +
        +
      • +

        getRed

        +
        int getRed()
        +
        Returns the RGB color red of the particleEffect
        +
        +
        Returns:
        +
        red
        +
        +
      • +
      + + + +
        +
      • +

        getGreen

        +
        int getGreen()
        +
        Returns the RGB color green of the particleEffect
        +
        +
        Returns:
        +
        green
        +
        +
      • +
      + + + +
        +
      • +

        getMaterial

        +
        org.bukkit.Material getMaterial()
        +
        Returns the material of the particleEffect
        +
        +
        Returns:
        +
        material
        +
        +
      • +
      + + + +
        +
      • +

        getData

        +
        Byte getData()
        +
        Returns the data of the particleEffect
        +
        +
        Returns:
        +
        data
        +
        +
      • +
      + + + +
        +
      • +

        isColorParticleEffect

        +
        boolean isColorParticleEffect()
        +
        Returns if the particleEffect is a color particleEffect
        +
        +
        Returns:
        +
        isColor
        +
        +
      • +
      + + + +
        +
      • +

        isNoteParticleEffect

        +
        boolean isNoteParticleEffect()
        +
        Returns if the particleEffect is a note particleEffect
        +
        +
        Returns:
        +
        isNote
        +
        +
      • +
      + + + +
        +
      • +

        isMaterialParticleEffect

        +
        boolean isMaterialParticleEffect()
        +
        Returns if the particleEffect is a materialParticleEffect
        +
        +
        Returns:
        +
        isMaterial
        +
        +
      • +
      + + + +
        +
      • +

        apply

        +
        void apply(org.bukkit.Location location,
        +           org.bukkit.entity.Player... players)
        +
        Plays the effect at the given location to the given players.
        +
        +
        Parameters:
        +
        location - location
        +
        players - players
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.html new file mode 100644 index 000000000..f33171e76 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/Persistenceable.html @@ -0,0 +1,243 @@ + + + + + + +Persistenceable (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.entity
+

Interface Persistenceable

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getId

        +
        long getId()
        +
        Returns the id of the object
        +
        +
        Returns:
        +
        id
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/PetMeta.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/PetMeta.html new file mode 100644 index 000000000..0e623859e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/PetMeta.html @@ -0,0 +1,389 @@ + + + + + + +PetMeta (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.entity
+

Interface PetMeta

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getPlayerId

        +
        long getPlayerId()
        +
        Returns the id of the player
        +
        +
        Returns:
        +
        playerId
        +
        +
      • +
      + + + +
        +
      • +

        setPlayerId

        +
        void setPlayerId(long id)
        +
        Sets the id of the player
        +
        +
        Parameters:
        +
        id - id
        +
        +
      • +
      + + + +
        +
      • +

        getParticleId

        +
        long getParticleId()
        +
        Returns the id of the particle
        +
        +
        Returns:
        +
        particleId
        +
        +
      • +
      + + + +
        +
      • +

        setParticleId

        +
        void setParticleId(long id)
        +
        Sets the id of the particle
        +
        +
        Parameters:
        +
        id - id
        +
        +
      • +
      + + + +
        +
      • +

        setParticleEffectMeta

        +
        void setParticleEffectMeta(ParticleEffectMeta meta)
        +
        Sets the particleEffect meta
        +
        +
        Parameters:
        +
        meta - meta
        +
        +
      • +
      + + + +
        +
      • +

        getParticleEffectMeta

        +
        ParticleEffectMeta getParticleEffectMeta()
        +
        Returns the particleEffect meta
        +
        +
        Returns:
        +
        meta
        +
        +
      • +
      + + + +
        +
      • +

        setPlayerMeta

        +
        void setPlayerMeta(PlayerMeta meta)
        +
        Sets the own meta
        +
        +
        Parameters:
        +
        meta - meta
        +
        +
      • +
      + + + +
        +
      • +

        getPlayerMeta

        +
        PlayerMeta getPlayerMeta()
        +
        Returns the meta of the owner
        +
        +
        Returns:
        +
        player
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/PlayerMeta.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/PlayerMeta.html new file mode 100644 index 000000000..63f9c5c0b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/PlayerMeta.html @@ -0,0 +1,326 @@ + + + + + + +PlayerMeta (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.api.persistence.entity
+

Interface PlayerMeta

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      StringgetName() +
      Returns the name of the playerData
      +
      org.bukkit.entity.PlayergetPlayer() +
      Returns the player of the playerData
      +
      UUIDgetUUID() +
      Returns the uuid of the playerData
      +
      voidsetName(String name) +
      Sets the name of the playerData
      +
      voidsetUuid(UUID uuid) +
      Sets the uuid of the playerData
      +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getName

        +
        String getName()
        +
        Returns the name of the playerData
        +
        +
        Returns:
        +
        playerData
        +
        +
      • +
      + + + +
        +
      • +

        setName

        +
        void setName(String name)
        +
        Sets the name of the playerData
        +
        +
        Parameters:
        +
        name - name
        +
        +
      • +
      + + + +
        +
      • +

        getUUID

        +
        UUID getUUID()
        +
        Returns the uuid of the playerData
        +
        +
        Returns:
        +
        uuid
        +
        +
      • +
      + + + +
        +
      • +

        setUuid

        +
        void setUuid(UUID uuid)
        +
        Sets the uuid of the playerData
        +
        +
        Parameters:
        +
        uuid - uuid
        +
        +
      • +
      + + + +
        +
      • +

        getPlayer

        +
        org.bukkit.entity.Player getPlayer()
        +
        Returns the player of the playerData
        +
        +
        Returns:
        +
        player
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.ParticleColor.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.ParticleColor.html new file mode 100644 index 000000000..aa729e44d --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.ParticleColor.html @@ -0,0 +1,214 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleColor (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleColor

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.ParticleEffectType.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.ParticleEffectType.html new file mode 100644 index 000000000..1090e7c3c --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.ParticleEffectType.html @@ -0,0 +1,241 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleEffectType (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleEffectType

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.html new file mode 100644 index 000000000..d7b15f2d9 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/ParticleEffectMeta.html @@ -0,0 +1,439 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/Persistenceable.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/Persistenceable.html new file mode 100644 index 000000000..1231242c2 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/Persistenceable.html @@ -0,0 +1,212 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.persistence.entity.Persistenceable (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.persistence.entity.Persistenceable

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/PetMeta.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/PetMeta.html new file mode 100644 index 000000000..0152fb48d --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/PetMeta.html @@ -0,0 +1,340 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.persistence.entity.PetMeta (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.persistence.entity.PetMeta

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/PlayerMeta.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/PlayerMeta.html new file mode 100644 index 000000000..f7d160a5f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/class-use/PlayerMeta.html @@ -0,0 +1,349 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-frame.html new file mode 100644 index 000000000..0f8a1630e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-frame.html @@ -0,0 +1,29 @@ + + + + + + +com.github.shynixn.petblocks.api.persistence.entity (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.api.persistence.entity

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-summary.html new file mode 100644 index 000000000..e7c95d2a4 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-summary.html @@ -0,0 +1,179 @@ + + + + + + +com.github.shynixn.petblocks.api.persistence.entity (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.api.persistence.entity

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-tree.html new file mode 100644 index 000000000..fec6b0cfa --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-tree.html @@ -0,0 +1,163 @@ + + + + + + +com.github.shynixn.petblocks.api.persistence.entity Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.api.persistence.entity

+Package Hierarchies: + +
+
+

Interface Hierarchy

+
    +
  • com.github.shynixn.petblocks.api.persistence.entity.Persistenceable +
      +
    • com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
    • +
    • com.github.shynixn.petblocks.api.persistence.entity.PetMeta (also extends com.github.shynixn.petblocks.api.entities.PetMeta)
    • +
    • com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta
    • +
    +
  • +
  • java.io.Serializable +
      +
    • com.github.shynixn.petblocks.api.entities.PetMeta +
        +
      • com.github.shynixn.petblocks.api.persistence.entity.PetMeta (also extends com.github.shynixn.petblocks.api.persistence.entity.Persistenceable)
      • +
      +
    • +
    +
  • +
+

Enum Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-use.html new file mode 100644 index 000000000..7f08429c1 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/api/persistence/entity/package-use.html @@ -0,0 +1,317 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.api.persistence.entity (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.api.persistence.entity

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/Config.html b/docs/apidocs/com/github/shynixn/petblocks/business/Config.html new file mode 100644 index 000000000..75422b87e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/Config.html @@ -0,0 +1,426 @@ + + + + + + +Config (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business
+

Class Config

+
+
+ +
+
    +
  • +
    +
    +
    public final class Config
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        initiliaze

        +
        public static void initiliaze(org.bukkit.plugin.Plugin plugin)
        +
      • +
      + + + +
        +
      • +

        getInstance

        +
        public static Config getInstance()
        +
      • +
      + + + +
        +
      • +

        reload

        +
        public void reload()
        +
      • +
      + + + +
        +
      • +

        allowPetSpawning

        +
        public boolean allowPetSpawning(org.bukkit.Location location)
        +
      • +
      + + + +
        +
      • +

        getTicksFromAge

        +
        public int getTicksFromAge(Age age)
        +
      • +
      + + + +
        +
      • +

        fixJoinDefaultPet

        +
        public void fixJoinDefaultPet(PetMeta petMeta)
        +
      • +
      + + + +
        +
      • +

        setMyContainer

        +
        public void setMyContainer(org.bukkit.inventory.Inventory inventory,
        +                           String title,
        +                           ItemContainer container,
        +                           Permission... permission)
        +
      • +
      + + + +
        +
      • +

        setMyContainer

        +
        public void setMyContainer(org.bukkit.inventory.Inventory inventory,
        +                           String title,
        +                           ItemContainer container,
        +                           String... permission)
        +
      • +
      + + + +
        +
      • +

        getMyItemStack

        +
        public org.bukkit.inventory.ItemStack getMyItemStack(org.bukkit.entity.Player player,
        +                                                     String title,
        +                                                     ItemContainer container,
        +                                                     String... permission)
        +
      • +
      + + + + + + + +
        +
      • +

        isJoin_enabled

        +
        public boolean isJoin_enabled()
        +
      • +
      + + + +
        +
      • +

        isJoin_overwriteExistingPet

        +
        public boolean isJoin_overwriteExistingPet()
        +
      • +
      + + + +
        +
      • +

        isChat_async

        +
        public boolean isChat_async()
        +
      • +
      + + + +
        +
      • +

        isChat_highestpriority

        +
        public boolean isChat_highestpriority()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/Language.html b/docs/apidocs/com/github/shynixn/petblocks/business/Language.html new file mode 100644 index 000000000..9718fc4d8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/Language.html @@ -0,0 +1,1050 @@ + + + + + + +Language (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business
+

Class Language

+
+
+ +
+
    +
  • +
    +
    +
    public final class Language
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        GUI_TITLE

        +
        public static String GUI_TITLE
        +
      • +
      + + + +
        +
      • +

        PREFIX

        +
        public static String PREFIX
        +
      • +
      + + + +
        +
      • +

        NUMBER_PREFIX

        +
        public static String NUMBER_PREFIX
        +
      • +
      + + + +
        +
      • +

        PIG_DISPLAYNAME

        +
        public static String PIG_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        CHICKEN_DISPLAYNAME

        +
        public static String CHICKEN_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        DOG_DISPLAYNAME

        +
        public static String DOG_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        CAT_DISPLAYNAME

        +
        public static String CAT_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        BIRD_DISPLAYNAME

        +
        public static String BIRD_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        COW_DISPLAYNAME

        +
        public static String COW_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        SHEEP_DISPLAYNAME

        +
        public static String SHEEP_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        IRONGOLEM_DISPLAYNAME

        +
        public static String IRONGOLEM_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        DRAGON_DISPLAYNAME

        +
        public static String DRAGON_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        CREEPER_DISPLAYNAME

        +
        public static String CREEPER_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        ZOMBIE_DISPLAYNAME

        +
        public static String ZOMBIE_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        SKELETON_DISPLAYNAME

        +
        public static String SKELETON_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        HORSE_DISPLAYNAME

        +
        public static String HORSE_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        VILLAGER_DISPLAYNAME

        +
        public static String VILLAGER_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        SPIDER_DISPLAYNAME

        +
        public static String SPIDER_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        HUMAN_DISPLAYNAME

        +
        public static String HUMAN_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        BAT_DISPLAYNAME

        +
        public static String BAT_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        ENDERMAN_DISPLAYNAME

        +
        public static String ENDERMAN_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        SILVERFISH_DISPLAYNAME

        +
        public static String SILVERFISH_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        PIGZOMBIE_DISPLAYNAME

        +
        public static String PIGZOMBIE_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        SLIME_DISPLAYNAME

        +
        public static String SLIME_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        LAVASLIME_DISPLAYNAME

        +
        public static String LAVASLIME_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        GHAST_DISPLAYNAME

        +
        public static String GHAST_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        BLAZE_DISPLAYNAME

        +
        public static String BLAZE_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        WITHER_DISPLAYNAME

        +
        public static String WITHER_DISPLAYNAME
        +
      • +
      + + + +
        +
      • +

        ENABLE_PET

        +
        public static String ENABLE_PET
        +
      • +
      + + + +
        +
      • +

        DISABLE_PET

        +
        public static String DISABLE_PET
        +
      • +
      + + + +
        +
      • +

        MY_PET

        +
        public static String MY_PET
        +
      • +
      + + + +
        +
      • +

        COSTUME

        +
        public static String COSTUME
        +
      • +
      + + + +
        +
      • +

        COLOR_COSTUME

        +
        public static String COLOR_COSTUME
        +
      • +
      + + + +
        +
      • +

        CUSTOM_COSTUME

        +
        public static String CUSTOM_COSTUME
        +
      • +
      + + + +
        +
      • +

        NAMING

        +
        public static String NAMING
        +
      • +
      + + + +
        +
      • +

        RIDING

        +
        public static String RIDING
        +
      • +
      + + + +
        +
      • +

        HAT

        +
        public static String HAT
        +
      • +
      + + + +
        +
      • +

        CANNON

        +
        public static String CANNON
        +
      • +
      + + + +
        +
      • +

        SKULL_NAMING

        +
        public static String SKULL_NAMING
        +
      • +
      + + + +
        +
      • +

        CANCEL

        +
        public static String CANCEL
        +
      • +
      + + + +
        +
      • +

        CALL

        +
        public static String CALL
        +
      • +
      + + + +
        +
      • +

        PARTICLE

        +
        public static String PARTICLE
        +
      • +
      + + + +
        +
      • +

        EMPTY

        +
        public static String EMPTY
        +
      • +
      + + + +
        +
      • +

        NEXT

        +
        public static String NEXT
        +
      • +
      + + + +
        +
      • +

        PREVIOUS

        +
        public static String PREVIOUS
        +
      • +
      + + + +
        +
      • +

        MUTE

        +
        public static String MUTE
        +
      • +
      + + + +
        +
      • +

        UNMUTE

        +
        public static String UNMUTE
        +
      • +
      + + + +
        +
      • +

        NAME_MESSAGE

        +
        public static String NAME_MESSAGE
        +
      • +
      + + + +
        +
      • +

        NAME_SUCCES_MESSAGE

        +
        public static String NAME_SUCCES_MESSAGE
        +
      • +
      + + + +
        +
      • +

        NAME_ERROR_MESSAGE

        +
        public static String NAME_ERROR_MESSAGE
        +
      • +
      + + + +
        +
      • +

        SNAME_MESSAGE

        +
        public static String SNAME_MESSAGE
        +
      • +
      + + + +
        +
      • +

        SNAME_SUCCES_MESSAGE

        +
        public static String SNAME_SUCCES_MESSAGE
        +
      • +
      + + + +
        +
      • +

        SNAME_ERROR_MESSAGE

        +
        public static String SNAME_ERROR_MESSAGE
        +
      • +
      + + + +
        +
      • +

        ICO_PERMS_YES

        +
        public static String ICO_PERMS_YES
        +
      • +
      + + + +
        +
      • +

        ICO_PERMS_NO

        +
        public static String ICO_PERMS_NO
        +
      • +
      + + + +
        +
      • +

        NO_PERMISSION

        +
        public static String NO_PERMISSION
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Language

        +
        public Language()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        reload

        +
        public static void reload(org.bukkit.plugin.Plugin plugin)
        +
      • +
      + + + +
        +
      • +

        getDisplayName

        +
        public static String getDisplayName(String petName)
        +
      • +
      + + + +
        +
      • +

        getDefaultPetName

        +
        public static String getDefaultPetName(org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/Permission.html b/docs/apidocs/com/github/shynixn/petblocks/business/Permission.html new file mode 100644 index 000000000..26ab325c4 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/Permission.html @@ -0,0 +1,524 @@ + + + + + + +Permission (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business
+

Enum Permission

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        ALLPETTYPES

        +
        public static final Permission ALLPETTYPES
        +
      • +
      + + + +
        +
      • +

        SINGLEPETTYPE

        +
        public static final Permission SINGLEPETTYPE
        +
      • +
      + + + +
        +
      • +

        RENAMEPET

        +
        public static final Permission RENAMEPET
        +
      • +
      + + + +
        +
      • +

        RENAMESKULL

        +
        public static final Permission RENAMESKULL
        +
      • +
      + + + +
        +
      • +

        CANNON

        +
        public static final Permission CANNON
        +
      • +
      + + + +
        +
      • +

        RIDEPET

        +
        public static final Permission RIDEPET
        +
      • +
      + + + +
        +
      • +

        WEARPET

        +
        public static final Permission WEARPET
        +
      • +
      + + + +
        +
      • +

        ALLDEFAULTCOSTUMES

        +
        public static final Permission ALLDEFAULTCOSTUMES
        +
      • +
      + + + +
        +
      • +

        SINGLEDEFAULTCOSTUME

        +
        public static final Permission SINGLEDEFAULTCOSTUME
        +
      • +
      + + + +
        +
      • +

        ALLCOLORCOSTUMES

        +
        public static final Permission ALLCOLORCOSTUMES
        +
      • +
      + + + +
        +
      • +

        SINGLECOLORCOSTUME

        +
        public static final Permission SINGLECOLORCOSTUME
        +
      • +
      + + + +
        +
      • +

        ALLCUSTOMCOSTUMES

        +
        public static final Permission ALLCUSTOMCOSTUMES
        +
      • +
      + + + +
        +
      • +

        SINGLECUSTOMCOSTUME

        +
        public static final Permission SINGLECUSTOMCOSTUME
        +
      • +
      + + + +
        +
      • +

        ALLPARTICLES

        +
        public static final Permission ALLPARTICLES
        +
      • +
      + + + +
        +
      • +

        SINGLEPARTICLE

        +
        public static final Permission SINGLEPARTICLE
        +
      • +
      + + + +
        +
      • +

        OWNINGAMECOSTUMES

        +
        public static final Permission OWNINGAMECOSTUMES
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Permission[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Permission c : Permission.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Permission valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public String get()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.html new file mode 100644 index 000000000..635be65bc --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/PetBlocksPlugin.html @@ -0,0 +1,383 @@ + + + + + + +PetBlocksPlugin (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit
+

Class PetBlocksPlugin

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.bukkit.plugin.PluginBase
    • +
    • +
        +
      • org.bukkit.plugin.java.JavaPlugin
      • +
      • +
          +
        • com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin
    +
    +
    +
    +
    public final class PetBlocksPlugin
    +extends org.bukkit.plugin.java.JavaPlugin
    +
    +
    Author:
    +
    Shynixn!
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static StringPREFIX_CONSOLE 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      PetBlocksPlugin() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      List<Class<?>>getDatabaseClasses() 
      voidonDisable() 
      voidonEnable() 
      +
        +
      • + + +

        Methods inherited from class org.bukkit.plugin.java.JavaPlugin

        +getClassLoader, getCommand, getConfig, getDatabase, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, initialize, installDDL, isEnabled, isInitialized, isNaggable, onCommand, onLoad, onTabComplete, reloadConfig, removeDDL, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString
      • +
      +
        +
      • + + +

        Methods inherited from class org.bukkit.plugin.PluginBase

        +equals, getName, hashCode
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        PREFIX_CONSOLE

        +
        public static final String PREFIX_CONSOLE
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlocksPlugin

        +
        public PetBlocksPlugin()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        onEnable

        +
        public void onEnable()
        +
        +
        Specified by:
        +
        onEnable in interface org.bukkit.plugin.Plugin
        +
        Overrides:
        +
        onEnable in class org.bukkit.plugin.java.JavaPlugin
        +
        +
      • +
      + + + +
        +
      • +

        onDisable

        +
        public void onDisable()
        +
        +
        Specified by:
        +
        onDisable in interface org.bukkit.plugin.Plugin
        +
        Overrides:
        +
        onDisable in class org.bukkit.plugin.java.JavaPlugin
        +
        +
      • +
      + + + +
        +
      • +

        getDatabaseClasses

        +
        public List<Class<?>> getDatabaseClasses()
        +
        +
        Overrides:
        +
        getDatabaseClasses in class org.bukkit.plugin.java.JavaPlugin
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/class-use/PetBlocksPlugin.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/class-use/PetBlocksPlugin.html new file mode 100644 index 000000000..f28348b88 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/class-use/PetBlocksPlugin.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/ClearLagListener.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/ClearLagListener.html new file mode 100644 index 000000000..3ed9351d8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/ClearLagListener.html @@ -0,0 +1,297 @@ + + + + + + +ClearLagListener (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag
+

Class ClearLagListener

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    org.bukkit.event.Listener
    +
    +
    +
    +
    public final class ClearLagListener
    +extends SimpleListener
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ClearLagListener

        +
        public ClearLagListener(org.bukkit.plugin.java.JavaPlugin plugin)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        onEntityRemoveEvent

        +
        public void onEntityRemoveEvent(me.minebuilders.clearlag.events.EntityRemoveEvent event)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/class-use/ClearLagListener.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/class-use/ClearLagListener.html new file mode 100644 index 000000000..e1575a48e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/class-use/ClearLagListener.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag.ClearLagListener (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag.ClearLagListener

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag.ClearLagListener
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-frame.html new file mode 100644 index 000000000..7decbfaa4 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag

+
+

Classes

+ +
+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-summary.html new file mode 100644 index 000000000..397ef2f85 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-summary.html @@ -0,0 +1,144 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    ClearLagListener 
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-tree.html new file mode 100644 index 000000000..05ce33b61 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-tree.html @@ -0,0 +1,143 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.github.shynixn.petblocks.lib.SimpleListener (implements org.bukkit.event.Listener) +
        +
      • com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag.ClearLagListener
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-use.html new file mode 100644 index 000000000..6dc208101 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/clearlag/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/SuperVanishConnection.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/SuperVanishConnection.html new file mode 100644 index 000000000..7234f19de --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/SuperVanishConnection.html @@ -0,0 +1,273 @@ + + + + + + +SuperVanishConnection (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish
+

Class SuperVanishConnection

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish.SuperVanishConnection
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class SuperVanishConnection
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SuperVanishConnection

        +
        public SuperVanishConnection()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        register

        +
        public static void register(org.bukkit.plugin.java.JavaPlugin plugin)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/class-use/SuperVanishConnection.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/class-use/SuperVanishConnection.html new file mode 100644 index 000000000..8c509e0d6 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/class-use/SuperVanishConnection.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish.SuperVanishConnection (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish.SuperVanishConnection

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish.SuperVanishConnection
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-frame.html new file mode 100644 index 000000000..bd4c36872 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish

+
+

Classes

+ +
+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-summary.html new file mode 100644 index 000000000..ea64e4e44 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-summary.html @@ -0,0 +1,144 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-tree.html new file mode 100644 index 000000000..005d33b13 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-tree.html @@ -0,0 +1,139 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-use.html new file mode 100644 index 000000000..d1d4643d3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/supervanish/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/WorldGuardConnection5.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/WorldGuardConnection5.html new file mode 100644 index 000000000..b07a25dd5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/WorldGuardConnection5.html @@ -0,0 +1,271 @@ + + + + + + +WorldGuardConnection5 (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard
+

Class WorldGuardConnection5

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection5
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class WorldGuardConnection5
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        allowSpawn

        +
        public static void allowSpawn(org.bukkit.Location location,
        +                              org.bukkit.plugin.Plugin plugin)
        +
      • +
      + + + +
        +
      • +

        canSpawnInRegion

        +
        public static boolean canSpawnInRegion(String[] regionList,
        +                                       org.bukkit.Location location,
        +                                       org.bukkit.plugin.Plugin plugin)
        +
      • +
      + + + +
        +
      • +

        rollBack

        +
        public static void rollBack()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/WorldGuardConnection6.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/WorldGuardConnection6.html new file mode 100644 index 000000000..38d1366ae --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/WorldGuardConnection6.html @@ -0,0 +1,287 @@ + + + + + + +WorldGuardConnection6 (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard
+

Class WorldGuardConnection6

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection6
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class WorldGuardConnection6
    +extends Object
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/class-use/WorldGuardConnection5.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/class-use/WorldGuardConnection5.html new file mode 100644 index 000000000..57d267248 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/class-use/WorldGuardConnection5.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection5 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection5

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection5
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/class-use/WorldGuardConnection6.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/class-use/WorldGuardConnection6.html new file mode 100644 index 000000000..d4a4cc3ce --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/class-use/WorldGuardConnection6.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection6 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection6

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection6
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-frame.html new file mode 100644 index 000000000..9e6302705 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-frame.html @@ -0,0 +1,22 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-summary.html new file mode 100644 index 000000000..da87eb9dc --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-summary.html @@ -0,0 +1,148 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-tree.html new file mode 100644 index 000000000..0d0073932 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-tree.html @@ -0,0 +1,140 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-use.html new file mode 100644 index 000000000..62ea93970 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/dependencies/worldguard/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/NMSRegistry.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/NMSRegistry.html new file mode 100644 index 000000000..bb5ec19e2 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/NMSRegistry.html @@ -0,0 +1,394 @@ + + + + + + +NMSRegistry (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms
+

Class NMSRegistry

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class NMSRegistry
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        createPetBlock

        +
        public static PetBlock createPetBlock(org.bukkit.Location location,
        +                                      PetMeta meta)
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        public static boolean isUnbreakable(org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        setItemStackTag

        +
        public static org.bukkit.inventory.ItemStack setItemStackTag(org.bukkit.inventory.ItemStack itemStack,
        +                                                             Map<String,Object> tags)
        +
      • +
      + + + +
        +
      • +

        registerListener19

        +
        public static void registerListener19(List<org.bukkit.entity.Player> players,
        +                                      org.bukkit.plugin.Plugin plugin)
        +
      • +
      + + + +
        +
      • +

        unregisterAll

        +
        public static void unregisterAll()
        +
      • +
      + + + +
        +
      • +

        registerDynamicCommand

        +
        public static void registerDynamicCommand(String command,
        +                                          org.bukkit.command.defaults.BukkitCommand clazz)
        +
      • +
      + + + +
        +
      • +

        changeSkullSkin

        +
        public static org.bukkit.inventory.ItemStack changeSkullSkin(org.bukkit.inventory.ItemStack itemStack,
        +                                                             String skinUrl)
        +
      • +
      + + + +
        +
      • +

        getSkinUrl

        +
        public static String getSkinUrl(org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        registerAll

        +
        public static void registerAll()
        +
      • +
      + + + +
        +
      • +

        accessWorldGuardSpawn

        +
        public static void accessWorldGuardSpawn(org.bukkit.Location location)
        +
      • +
      + + + +
        +
      • +

        canSpawnInRegion

        +
        public static boolean canSpawnInRegion(String[] regionList,
        +                                       org.bukkit.Location location)
        +
      • +
      + + + +
        +
      • +

        rollbackWorldGuardSpawn

        +
        public static void rollbackWorldGuardSpawn(org.bukkit.Location location)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/class-use/NMSRegistry.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/class-use/NMSRegistry.html new file mode 100644 index 000000000..728d133f3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/class-use/NMSRegistry.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.TickCallBack.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.TickCallBack.html new file mode 100644 index 000000000..f77a091a5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.TickCallBack.html @@ -0,0 +1,232 @@ + + + + + + +PetBlockHelper.TickCallBack (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.helper
+

Interface PetBlockHelper.TickCallBack

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    PetBlockHelper
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    +public static interface PetBlockHelper.TickCallBack
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        run

        +
        void run(org.bukkit.Location location)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.html new file mode 100644 index 000000000..137de83d5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/PetBlockHelper.html @@ -0,0 +1,537 @@ + + + + + + +PetBlockHelper (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.helper
+

Class PetBlockHelper

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class PetBlockHelper
    +extends Object
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        afraidWaterEffect

        +
        public static int afraidWaterEffect(org.bukkit.entity.Entity entity,
        +                                    int counter)
        +
      • +
      + + + +
        +
      • +

        setSkin

        +
        public static void setSkin(PetBlock petBlock,
        +                           String skin)
        +
      • +
      + + + +
        +
      • +

        executeMovingSound

        +
        public static long executeMovingSound(org.bukkit.entity.Entity entity,
        +                                      org.bukkit.entity.Player owner,
        +                                      PetMeta petMeta,
        +                                      long previous)
        +
      • +
      + + + +
        +
      • +

        setSkin

        +
        public static void setSkin(PetBlock petBlock,
        +                           org.bukkit.Material material,
        +                           byte data)
        +
      • +
      + + + + + + + +
        +
      • +

        refreshHeadItemMeta

        +
        public static void refreshHeadItemMeta(PetBlock petBlock,
        +                                       org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        setItemConsideringAge

        +
        public static void setItemConsideringAge(PetBlock petBlock)
        +
      • +
      + + + +
        +
      • +

        setRiding

        +
        public static void setRiding(PetBlock petBlock,
        +                             org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        setDieing

        +
        public static boolean setDieing(PetBlock petBlock)
        +
      • +
      + + + + + + + +
        +
      • +

        launch

        +
        public static void launch(PetBlock petBlock,
        +                          org.bukkit.util.Vector vector)
        +
      • +
      + + + + + + + +
        +
      • +

        jump

        +
        public static void jump(PetBlock petBlock)
        +
      • +
      + + + +
        +
      • +

        teleport

        +
        public static void teleport(PetBlock petBlock,
        +                            org.bukkit.Location location)
        +
      • +
      + + + +
        +
      • +

        isDead

        +
        public static boolean isDead(PetBlock petBlock)
        +
      • +
      + + + +
        +
      • +

        setDisplayName

        +
        public static void setDisplayName(PetBlock petBlock,
        +                                  String name)
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        remove

        +
        public static void remove(PetBlock petBlock)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/class-use/PetBlockHelper.TickCallBack.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/class-use/PetBlockHelper.TickCallBack.html new file mode 100644 index 000000000..08c8c8b9e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/class-use/PetBlockHelper.TickCallBack.html @@ -0,0 +1,192 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper.TickCallBack (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper.TickCallBack

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/class-use/PetBlockHelper.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/class-use/PetBlockHelper.html new file mode 100644 index 000000000..d90497cf3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/class-use/PetBlockHelper.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-frame.html new file mode 100644 index 000000000..7d6973477 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-frame.html @@ -0,0 +1,25 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.helper (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.nms.helper

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-summary.html new file mode 100644 index 000000000..829246d7d --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-summary.html @@ -0,0 +1,161 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.helper (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.nms.helper

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-tree.html new file mode 100644 index 000000000..b53ab33ee --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-tree.html @@ -0,0 +1,143 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.helper Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.nms.helper

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-use.html new file mode 100644 index 000000000..b09c152b8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/helper/package-use.html @@ -0,0 +1,159 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.nms.helper (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.nms.helper

+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-frame.html new file mode 100644 index 000000000..ee40d99e2 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.nms

+
+

Classes

+ +
+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-summary.html new file mode 100644 index 000000000..5807d42b4 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-summary.html @@ -0,0 +1,144 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.nms

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    NMSRegistry 
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-tree.html new file mode 100644 index 000000000..83e6a25cf --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-tree.html @@ -0,0 +1,139 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.nms

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-use.html new file mode 100644 index 000000000..f747558a1 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.nms (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.nms

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomRabbit.html new file mode 100644 index 000000000..5feff19a1 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomRabbit.html @@ -0,0 +1,486 @@ + + + + + + +CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1
+

Class CustomRabbit

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_10_R1.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_10_R1.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_10_R1.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_10_R1.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_10_R1.EntityAgeable
            • +
            • +
                +
              • net.minecraft.server.v1_10_R1.EntityAnimal
              • +
              • +
                  +
                • net.minecraft.server.v1_10_R1.EntityRabbit
                • +
                • +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit
                  • +
                  +
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_10_R1.IAnimal, net.minecraft.server.v1_10_R1.ICommandListener
    +
    +
    +
    +
    public final class CustomRabbit
    +extends net.minecraft.server.v1_10_R1.EntityRabbit
    +implements CustomEntity
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_10_R1.EntityRabbit

        +net.minecraft.server.v1_10_R1.EntityRabbit.ControllerJumpRabbit, net.minecraft.server.v1_10_R1.EntityRabbit.GroupDataRabbit
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_10_R1.EntityInsentient

        +net.minecraft.server.v1_10_R1.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.EntityAnimal

        +bA, breedItem
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.EntityAgeable

        +a, ageLocked, b, c
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.EntityCreature

        +bv, bw
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.EntityInsentient

        +a_, b_, canPickUpLoot, dropChanceArmor, dropChanceHand, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.EntityLiving

        +aA, aB, aD, aE, aF, aG, aH, aI, aK, aL, aM, aN, aO, aP, aQ, aR, aS, au, av, aV, aw, ax, aX, ay, aY, aZ, ba, bb, bc, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, collides, combatTracker, craftAttributes, deathTicks, effects, expToDrop, HEALTH, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.Entity

        +aa, ab, ac, activatedTick, activationType, ad, ae, ai, al, am, ao, ap, aq, as, attachedToPlayer, B, bukkitEntity, C, datawatcher, dead, defaultActivationState, dimension, E, fallDistance, fireProof, fireTicks, forceExplosionKnockback, fromMobSpawner, glowing, i, I, impulse, inWater, j, J, justCreated, K, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noclip, noDamageTicks, numCollisions, O, onGround, P, passengers, pitch, portalCooldown, positionChanged, projectileSource, R, random, ticksLived, tickTimer, uniqueID, valid, velocityChanged, width, world, yaw
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomRabbit(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomRabbit(net.minecraft.server.v1_10_R1.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected net.minecraft.server.v1_10_R1.SoundEffectdf() 
      org.bukkit.entity.RabbitgetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityRabbit

        +a, a, am, b, B, b, b, bC, bV, bW, c, ck, cl, createChild, damageEntity, de, dh, e, G, getRabbitType, i, initAttributes, initializePathFinderGoals, J, l, M, n, prepare, r, setRabbitType
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityAnimal

        +a, a, a, ax, C, c, cK, getBreedCause, getExpValue, isInLove, isTypeNotPersistent, mate, resetLove
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityAgeable

        +a, a, getAge, inactiveTick, isBaby, o, setAge, setAge, setAgeRaw, setSize
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityCreature

        +a, cT, cY, cZ, da, db, dc, dd, f, q
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityInsentient

        +A, a, a, a, a, a, a, a, a, a, a, a, a, a, aG, aY, b, b, b, c, c, c, canSpawn, cJ, cO, cP, cQ, cR, ct, cX, D, d, d, doSpawnEffect, doTick, dropDeathLoot, dropEquipment, getArmorItems, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getGoalTarget, getLeashHolder, getLoot, getMainHand, getNavigation, h, hasAI, isLeashed, isPersistent, L, l, m, m, N, o, o, p, s, setAI, setGoalTarget, setGoalTarget, setLeashHolder, setSlot, U, unleash
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityLiving

        +a_, a, a, A, a, a, a, a, a, a, a, aB, addEffect, alwaysGivesExp, ap, applyArmorModifier, applyMagicModifier, aw, b, b, b, b, bE, bF, bK, bL, bM, bN, bP, bS, bU, bZ, C, c, c, cA, cb, cB, cc, cC, cE, cG, ch, ci, cI, cj, clearActiveItem, cm, cn, co, cp, cs, cv, cx, cy, cz, d, d, damageArmor, damageEntity0, die, e, e, enterCombat, exitCombat, F, f, f, g, getAbsorptionHearts, getArmorStrength, getAttributeInstance, getAttributeMap, getCombatTracker, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getItemInMainHand, getItemInOffHand, getLastDamager, getMaxHealth, getMonsterType, getRandom, h, hasEffect, hasLineOfSight, heal, heal, i, isAlive, isBlocking, isCollidable, isDropExperience, isInteractable, isSleeping, k, k, m_, Q, receive, removeAllEffects, removeEffect, setAbsorptionHearts, setHealth, setSprinting, stopRiding, tickPotionEffects, v, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aa, aA, ab, aE, ag, ai, aI, ak, al, an, ao, aO, appendEntityCrashDetails, aQ, as, aS, at, aT, aV, aX, ay, az, b, b, b, b, b, b, bA, bB, bf, bg, bm, bn, br, bs, bt, bu, burn, burnFromLava, bv, bw, bx, by, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, die, e, e, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, g, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getFlag, getHeadHeight, getId, getName, getPortalDirection, getPortalOffset, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getVehicle, getWorld, h, H, h, h, hasCustomName, hashCode, inBlock, isBurning, isFireProof, isIgnoreBlockTrigger, isInvisible, isInvulnerable, isInWater, isNoGravity, isPassenger, isSilent, isSneaking, isSprinting, isVehicle, j, j, k, k, move, n, o_, o, onLightningStrike, P, p, playStepSound, q, r, recalcPosition, s, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setEquipment, setFlag, setInvisible, setInvulnerable, setLocation, setNoGravity, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSilent, setSneaking, setYawPitch, spawnIn, startRiding, t, teleportTo, toString, u, V, v, w, x, y
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(net.minecraft.server.v1_10_R1.World world)
        +
      • +
      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        df

        +
        protected net.minecraft.server.v1_10_R1.SoundEffect df()
        +
        +
        Overrides:
        +
        df in class net.minecraft.server.v1_10_R1.EntityRabbit
        +
        +
      • +
      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.Rabbit getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomZombie.html new file mode 100644 index 000000000..63a678442 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/CustomZombie.html @@ -0,0 +1,470 @@ + + + + + + +CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1
+

Class CustomZombie

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_10_R1.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_10_R1.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_10_R1.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_10_R1.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_10_R1.EntityMonster
            • +
            • +
                +
              • net.minecraft.server.v1_10_R1.EntityZombie
              • +
              • +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_10_R1.IAnimal, net.minecraft.server.v1_10_R1.ICommandListener, net.minecraft.server.v1_10_R1.IMonster
    +
    +
    +
    +
    public final class CustomZombie
    +extends net.minecraft.server.v1_10_R1.EntityZombie
    +implements CustomEntity
    +
    Created by Shynixn
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_10_R1.EntityInsentient

        +net.minecraft.server.v1_10_R1.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.EntityZombie

        +a
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.EntityCreature

        +bv, bw
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.EntityInsentient

        +a_, b_, canPickUpLoot, dropChanceArmor, dropChanceHand, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.EntityLiving

        +aA, aB, aD, aE, aF, aG, aH, aI, aK, aL, aM, aN, aO, aP, aQ, aR, aS, au, av, aV, aw, ax, aX, ay, aY, aZ, ba, bb, bc, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, collides, combatTracker, craftAttributes, deathTicks, effects, expToDrop, HEALTH, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_10_R1.Entity

        +aa, ab, ac, activatedTick, activationType, ad, ae, ai, al, am, ao, ap, aq, as, attachedToPlayer, B, bukkitEntity, C, datawatcher, dead, defaultActivationState, dimension, E, fallDistance, fireProof, fireTicks, forceExplosionKnockback, fromMobSpawner, glowing, i, I, impulse, inWater, j, J, justCreated, K, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noclip, noDamageTicks, numCollisions, O, onGround, P, passengers, pitch, portalCooldown, positionChanged, projectileSource, R, random, ticksLived, tickTimer, uniqueID, valid, velocityChanged, width, world, yaw
      • +
      +
        +
      • + + +

        Fields inherited from interface net.minecraft.server.v1_10_R1.IMonster

        +d, e
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomZombie(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomZombie(net.minecraft.server.v1_10_R1.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected voida(net.minecraft.server.v1_10_R1.BlockPosition blockposition, + net.minecraft.server.v1_10_R1.Block block) 
      org.bukkit.entity.LivingEntitygetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityZombie

        +a, a, a, a, a, a, a, ax, B, b, b, bV, bW, c, d, damageEntity, dh, die, dk, dm, G, getConversionTime, getExpValue, getHeadHeight, getMonsterType, getName, getVillagerType, i, initAttributes, isBaby, isConverting, isTypeNotPersistent, isVillager, J, m, n, o, p, prepare, r, r, setBaby, setSize, setVillagerType
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityMonster

        +a, aa, ab, bC, c, cK, e, isDropExperience, s_
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityCreature

        +a, cT, cY, cZ, da, db, dc, dd, f, q
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityInsentient

        +A, a, a, a, a, a, a, a, a, a, a, a, a, aG, aY, b, b, b, C, c, c, canSpawn, cJ, cO, cP, cQ, cR, ct, cX, D, d, d, doSpawnEffect, doTick, dropDeathLoot, dropEquipment, getArmorItems, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getGoalTarget, getLeashHolder, getLoot, getMainHand, getNavigation, h, hasAI, isLeashed, isPersistent, L, l, M, m, N, o, o, p, s, setAI, setGoalTarget, setGoalTarget, setLeashHolder, setSlot, U, unleash
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.EntityLiving

        +a_, a, a, A, a, a, a, a, a, a, a, aB, addEffect, alwaysGivesExp, ap, applyArmorModifier, applyMagicModifier, aw, b, b, b, b, bE, bF, bK, bL, bM, bN, bP, bS, bU, bZ, C, c, c, cA, cb, cB, cc, cC, cE, cG, ch, ci, cI, cj, ck, cl, clearActiveItem, cm, cn, co, cp, cs, cv, cx, cy, cz, d, d, damageArmor, damageEntity0, e, enterCombat, exitCombat, F, f, f, g, getAbsorptionHearts, getArmorStrength, getAttributeInstance, getAttributeMap, getCombatTracker, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getItemInMainHand, getItemInOffHand, getLastDamager, getMaxHealth, getRandom, h, hasEffect, hasLineOfSight, heal, heal, i, inactiveTick, isAlive, isBlocking, isCollidable, isInteractable, isSleeping, k, k, l, m_, Q, receive, removeAllEffects, removeEffect, setAbsorptionHearts, setHealth, setSprinting, stopRiding, tickPotionEffects, v, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_10_R1.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aA, aE, ag, ai, aI, ak, al, am, an, ao, aO, appendEntityCrashDetails, aQ, as, aS, at, aT, aV, aX, ay, az, b, b, b, b, b, bA, bB, bf, bg, bm, bn, br, bs, bt, bu, burn, burnFromLava, bv, bw, bx, by, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, die, e, e, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, g, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getFlag, getId, getPortalDirection, getPortalOffset, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getVehicle, getWorld, h, H, h, h, hasCustomName, hashCode, inBlock, isBurning, isFireProof, isIgnoreBlockTrigger, isInvisible, isInvulnerable, isInWater, isNoGravity, isPassenger, isSilent, isSneaking, isSprinting, isVehicle, j, j, k, k, move, n, o_, o, onLightningStrike, P, p, playStepSound, q, r, recalcPosition, s, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setEquipment, setFlag, setInvisible, setInvulnerable, setLocation, setNoGravity, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSilent, setSneaking, setYawPitch, spawnIn, startRiding, t, teleportTo, toString, u, V, v, w, x, y
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(net.minecraft.server.v1_10_R1.World world)
        +
      • +
      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        a

        +
        protected void a(net.minecraft.server.v1_10_R1.BlockPosition blockposition,
        +                 net.minecraft.server.v1_10_R1.Block block)
        +
        +
        Overrides:
        +
        a in class net.minecraft.server.v1_10_R1.EntityZombie
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.LivingEntity getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/OwnerPathfinder.html new file mode 100644 index 000000000..094a1f1fd --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/OwnerPathfinder.html @@ -0,0 +1,336 @@ + + + + + + +OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1
+

Class OwnerPathfinder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_10_R1.PathfinderGoal
    • +
    • +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class OwnerPathfinder
    +extends net.minecraft.server.v1_10_R1.PathfinderGoal
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        OwnerPathfinder

        +
        public OwnerPathfinder(net.minecraft.server.v1_10_R1.EntityInsentient entitycreature,
        +                       org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        a

        +
        public boolean a()
        +
        +
        Specified by:
        +
        a in class net.minecraft.server.v1_10_R1.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        c

        +
        public void c()
        +
        +
        Overrides:
        +
        c in class net.minecraft.server.v1_10_R1.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        public static boolean isUnbreakable(org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        setItemstackTag

        +
        public static org.bukkit.inventory.ItemStack setItemstackTag(org.bukkit.inventory.ItemStack itemStack,
        +                                                             Map<String,Object> tags)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/CustomRabbit.html new file mode 100644 index 000000000..39614c77c --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/CustomRabbit.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/CustomZombie.html new file mode 100644 index 000000000..d567c8758 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/CustomZombie.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/OwnerPathfinder.html new file mode 100644 index 000000000..221a2bea8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/class-use/OwnerPathfinder.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-frame.html new file mode 100644 index 000000000..a507d6f18 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-frame.html @@ -0,0 +1,23 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1 (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-summary.html new file mode 100644 index 000000000..2ee7d773a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-summary.html @@ -0,0 +1,154 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-tree.html new file mode 100644 index 000000000..b85149afe --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-tree.html @@ -0,0 +1,181 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1 Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • net.minecraft.server.v1_10_R1.Entity (implements net.minecraft.server.v1_10_R1.ICommandListener) +
        +
      • net.minecraft.server.v1_10_R1.EntityLiving +
          +
        • net.minecraft.server.v1_10_R1.EntityInsentient +
            +
          • net.minecraft.server.v1_10_R1.EntityCreature +
              +
            • net.minecraft.server.v1_10_R1.EntityAgeable +
                +
              • net.minecraft.server.v1_10_R1.EntityAnimal (implements net.minecraft.server.v1_10_R1.IAnimal) +
                  +
                • net.minecraft.server.v1_10_R1.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_10_R1.EntityMonster (implements net.minecraft.server.v1_10_R1.IMonster) +
                +
              • net.minecraft.server.v1_10_R1.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_10_R1.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-use.html new file mode 100644 index 000000000..1a17bae8a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_10_R1/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomRabbit.html new file mode 100644 index 000000000..b2dce8bb9 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomRabbit.html @@ -0,0 +1,486 @@ + + + + + + +CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1
+

Class CustomRabbit

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_11_R1.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_11_R1.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_11_R1.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_11_R1.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_11_R1.EntityAgeable
            • +
            • +
                +
              • net.minecraft.server.v1_11_R1.EntityAnimal
              • +
              • +
                  +
                • net.minecraft.server.v1_11_R1.EntityRabbit
                • +
                • +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit
                  • +
                  +
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_11_R1.IAnimal, net.minecraft.server.v1_11_R1.ICommandListener
    +
    +
    +
    +
    public final class CustomRabbit
    +extends net.minecraft.server.v1_11_R1.EntityRabbit
    +implements CustomEntity
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_11_R1.EntityRabbit

        +net.minecraft.server.v1_11_R1.EntityRabbit.ControllerJumpRabbit, net.minecraft.server.v1_11_R1.EntityRabbit.GroupDataRabbit
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_11_R1.EntityInsentient

        +net.minecraft.server.v1_11_R1.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.EntityAnimal

        +breedItem, bz
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.EntityAgeable

        +a, ageLocked, b, c
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.EntityCreature

        +bu, bv
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.EntityInsentient

        +a_, b_, canPickUpLoot, dropChanceArmor, dropChanceHand, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.EntityLiving

        +aA, aC, activeItem, aD, aE, aF, aG, aH, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, at, au, aU, av, aw, aW, ax, aX, aY, az, aZ, ba, bb, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bo, bp, collides, combatTracker, craftAttributes, deathTicks, effects, expToDrop, HEALTH, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.Entity

        +aa, ab, ac, activatedTick, activationType, ad, ah, ak, al, an, ao, ap, ar, attachedToPlayer, B, bukkitEntity, C, datawatcher, dead, defaultActivationState, dimension, E, fallDistance, fireProof, fireTicks, forceExplosionKnockback, fromMobSpawner, glowing, i, I, impulse, inWater, j, J, justCreated, K, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, motX, motY, motZ, N, noclip, noDamageTicks, O, onGround, P, passengers, pitch, portalCooldown, positionChanged, projectileSource, R, random, ticksLived, tickTimer, uniqueID, valid, velocityChanged, width, world, yaw, Z
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomRabbit(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomRabbit(net.minecraft.server.v1_11_R1.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected net.minecraft.server.v1_11_R1.SoundEffectdi() 
      org.bukkit.entity.RabbitgetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityRabbit

        +a, a, am, B, b, b, bC, bW, bX, c, cl, cm, createChild, damageEntity, dh, dk, e, G, getRabbitType, i, initAttributes, initializePathFinderGoals, J, l, M, n, prepare, r, setRabbitType
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityAnimal

        +a, a, a, ax, C, c, cM, getBreedCause, getExpValue, isInLove, isTypeNotPersistent, mate, resetLove
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityAgeable

        +a, a, a, a, getAge, inactiveTick, isBaby, o, setAge, setAge, setAgeRaw, setSize
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityCreature

        +a, cV, da, db, dc, dd, de, df, dg, f, q
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityInsentient

        +A_, A, a, a, a, a, a, a, a, a, a, a, a, aG, aY, b, b, b, b, bA, c, c, c, canSpawn, cL, cQ, cR, cS, cT, cu, cZ, D, d, d, doSpawnEffect, doTick, dropDeathLoot, dropEquipment, getArmorItems, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getGoalTarget, getLeashHolder, getLoot, getMainHand, getNavigation, h, hasAI, isLeashed, isPersistent, L, l, m, N, o, o, p, s, setAI, setGoalTarget, setGoalTarget, setLeashHolder, setSlot, U, unleash
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityLiving

        +a_, a, a, A, a, a, a, a, a, a, a, a, aB, addEffect, alwaysGivesExp, ap, applyArmorModifier, applyMagicModifier, aw, b, b, b, b, bF, bG, bL, bM, bN, bO, bQ, bT, bV, C, c, c, c, ca, cA, cB, cc, cC, cd, cD, cF, cH, ci, cj, cJ, cK, clearActiveItem, cn, co, cp, cq, ct, cw, cz, d, d, damageArmor, damageEntity0, damageShield, die, e, e, enterCombat, exitCombat, F, f, f, g, getAbsorptionHearts, getArmorStrength, getAttributeInstance, getAttributeMap, getCombatTracker, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getItemInMainHand, getItemInOffHand, getLastDamager, getMaxHealth, getMonsterType, getRandom, h, hasEffect, hasLineOfSight, heal, heal, i, isAlive, isBlocking, isCollidable, isDropExperience, isFrozen, isHandRaised, isInteractable, isSleeping, j, m_, Q, receive, removeAllEffects, removeEffect, setAbsorptionHearts, setHealth, setSprinting, stopRiding, tickPotionEffects, v, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aa, aA, ab, aE, ag, ai, aI, ak, al, an, ao, aO, appendEntityCrashDetails, aQ, as, aS, at, aT, aV, aW, aX, ay, az, B_, b, b, b, b, b, b, b, bB, bf, bg, bm, bn, br, bs, bt, bu, burn, burnFromLava, bv, bw, bx, by, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, d, die, e, e, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, g, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getFlag, getHeadHeight, getId, getMaxFireTicks, getName, getPortalDirection, getPortalOffset, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getVehicle, getWorld, H, h, h, hasCustomName, hashCode, i, inBlock, isBurning, isFireProof, isIgnoreBlockTrigger, isInvisible, isInvulnerable, isInWater, isNoGravity, isPassenger, isSilent, isSneaking, isSprinting, isVehicle, j, k, k, move, n, o_, o, onLightningStrike, P, p, playStepSound, q, r, recalcPosition, s, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setEquipment, setFlag, setInvisible, setInvulnerable, setLocation, setNoGravity, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSilent, setSneaking, setYawPitch, spawnIn, startRiding, t, teleportTo, toString, u, V, v, w, x, y
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(net.minecraft.server.v1_11_R1.World world)
        +
      • +
      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        di

        +
        protected net.minecraft.server.v1_11_R1.SoundEffect di()
        +
        +
        Overrides:
        +
        di in class net.minecraft.server.v1_11_R1.EntityRabbit
        +
        +
      • +
      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.Rabbit getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomZombie.html new file mode 100644 index 000000000..e141ce9d3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/CustomZombie.html @@ -0,0 +1,470 @@ + + + + + + +CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1
+

Class CustomZombie

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_11_R1.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_11_R1.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_11_R1.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_11_R1.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_11_R1.EntityMonster
            • +
            • +
                +
              • net.minecraft.server.v1_11_R1.EntityZombie
              • +
              • +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_11_R1.IAnimal, net.minecraft.server.v1_11_R1.ICommandListener, net.minecraft.server.v1_11_R1.IMonster
    +
    +
    +
    +
    public final class CustomZombie
    +extends net.minecraft.server.v1_11_R1.EntityZombie
    +implements CustomEntity
    +
    Created by Shynixn
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_11_R1.EntityInsentient

        +net.minecraft.server.v1_11_R1.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.EntityZombie

        +a
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.EntityCreature

        +bu, bv
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.EntityInsentient

        +a_, b_, canPickUpLoot, dropChanceArmor, dropChanceHand, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.EntityLiving

        +aA, aC, activeItem, aD, aE, aF, aG, aH, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, at, au, aU, av, aw, aW, ax, aX, aY, az, aZ, ba, bb, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bo, bp, collides, combatTracker, craftAttributes, deathTicks, effects, expToDrop, HEALTH, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_11_R1.Entity

        +aa, ab, ac, activatedTick, activationType, ad, ah, ak, al, an, ao, ap, ar, attachedToPlayer, B, bukkitEntity, C, datawatcher, dead, defaultActivationState, dimension, E, fallDistance, fireProof, fireTicks, forceExplosionKnockback, fromMobSpawner, glowing, i, I, impulse, inWater, j, J, justCreated, K, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, motX, motY, motZ, N, noclip, noDamageTicks, O, onGround, P, passengers, pitch, portalCooldown, positionChanged, projectileSource, R, random, ticksLived, tickTimer, uniqueID, valid, velocityChanged, width, world, yaw, Z
      • +
      +
        +
      • + + +

        Fields inherited from interface net.minecraft.server.v1_11_R1.IMonster

        +d, e
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomZombie(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomZombie(net.minecraft.server.v1_11_R1.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected voida(net.minecraft.server.v1_11_R1.BlockPosition blockposition, + net.minecraft.server.v1_11_R1.Block block) 
      org.bukkit.entity.LivingEntitygetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityZombie

        +a, a, a, a, a, ax, B, b, b, bW, bX, c, c, damageEntity, di, die, dj, dk, dn, G, getExpValue, getHeadHeight, getMonsterType, i, initAttributes, isBaby, J, n, o, p, prepare, r, r, setBaby, setSize
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityMonster

        +A_, a, aa, ab, bC, cM, e, isDropExperience, r_
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityCreature

        +a, cV, da, db, dc, dd, de, df, dg, f, q
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityInsentient

        +A, a, a, a, a, a, a, a, a, a, a, a, aG, aY, b, b, b, b, bA, C, c, c, canSpawn, cL, cQ, cR, cS, cT, cu, cZ, D, d, d, doSpawnEffect, doTick, dropDeathLoot, dropEquipment, getArmorItems, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getGoalTarget, getLeashHolder, getLoot, getMainHand, getNavigation, h, hasAI, isLeashed, isPersistent, isTypeNotPersistent, L, l, M, m, N, o, o, p, s, setAI, setGoalTarget, setGoalTarget, setLeashHolder, setSlot, U, unleash
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.EntityLiving

        +a_, a, a, A, a, a, a, a, a, a, a, a, aB, addEffect, alwaysGivesExp, ap, applyArmorModifier, applyMagicModifier, aw, b, b, b, b, bF, bG, bL, bM, bN, bO, bQ, bT, bV, C, c, c, c, ca, cA, cB, cc, cC, cd, cD, cF, cH, ci, cj, cJ, cK, cl, clearActiveItem, cm, cn, co, cp, cq, ct, cw, cz, d, d, damageArmor, damageEntity0, damageShield, e, enterCombat, exitCombat, F, f, f, g, getAbsorptionHearts, getArmorStrength, getAttributeInstance, getAttributeMap, getCombatTracker, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getItemInMainHand, getItemInOffHand, getLastDamager, getMaxHealth, getRandom, h, hasEffect, hasLineOfSight, heal, heal, i, inactiveTick, isAlive, isBlocking, isCollidable, isFrozen, isHandRaised, isInteractable, isSleeping, j, l, m_, Q, receive, removeAllEffects, removeEffect, setAbsorptionHearts, setHealth, setSprinting, stopRiding, tickPotionEffects, v, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_11_R1.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aA, aE, ag, ai, aI, ak, al, am, an, ao, aO, appendEntityCrashDetails, aQ, as, aS, at, aT, aV, aW, aX, ay, az, B_, b, b, b, b, b, b, bB, bf, bg, bm, bn, br, bs, bt, bu, burn, burnFromLava, bv, bw, bx, by, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, d, die, e, e, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, g, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getFlag, getId, getMaxFireTicks, getName, getPortalDirection, getPortalOffset, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getVehicle, getWorld, H, h, h, hasCustomName, hashCode, i, inBlock, isBurning, isFireProof, isIgnoreBlockTrigger, isInvisible, isInvulnerable, isInWater, isNoGravity, isPassenger, isSilent, isSneaking, isSprinting, isVehicle, j, k, k, move, n, o_, o, onLightningStrike, P, p, playStepSound, q, r, recalcPosition, s, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setEquipment, setFlag, setInvisible, setInvulnerable, setLocation, setNoGravity, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSilent, setSneaking, setYawPitch, spawnIn, startRiding, t, teleportTo, toString, u, V, v, w, x, y
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(net.minecraft.server.v1_11_R1.World world)
        +
      • +
      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        a

        +
        protected void a(net.minecraft.server.v1_11_R1.BlockPosition blockposition,
        +                 net.minecraft.server.v1_11_R1.Block block)
        +
        +
        Overrides:
        +
        a in class net.minecraft.server.v1_11_R1.EntityZombie
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.LivingEntity getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/OwnerPathfinder.html new file mode 100644 index 000000000..defe651df --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/OwnerPathfinder.html @@ -0,0 +1,336 @@ + + + + + + +OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1
+

Class OwnerPathfinder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_11_R1.PathfinderGoal
    • +
    • +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class OwnerPathfinder
    +extends net.minecraft.server.v1_11_R1.PathfinderGoal
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        OwnerPathfinder

        +
        public OwnerPathfinder(net.minecraft.server.v1_11_R1.EntityInsentient entitycreature,
        +                       org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        a

        +
        public boolean a()
        +
        +
        Specified by:
        +
        a in class net.minecraft.server.v1_11_R1.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        c

        +
        public void c()
        +
        +
        Overrides:
        +
        c in class net.minecraft.server.v1_11_R1.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        public static boolean isUnbreakable(org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        setItemstackTag

        +
        public static org.bukkit.inventory.ItemStack setItemstackTag(org.bukkit.inventory.ItemStack itemStack,
        +                                                             Map<String,Object> tags)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/CustomRabbit.html new file mode 100644 index 000000000..42d79aafb --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/CustomRabbit.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/CustomZombie.html new file mode 100644 index 000000000..34f30b818 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/CustomZombie.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/OwnerPathfinder.html new file mode 100644 index 000000000..f66095e4d --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/class-use/OwnerPathfinder.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-frame.html new file mode 100644 index 000000000..8f31b3c0b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-frame.html @@ -0,0 +1,23 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1 (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-summary.html new file mode 100644 index 000000000..057a11555 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-summary.html @@ -0,0 +1,154 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-tree.html new file mode 100644 index 000000000..37d0be7dc --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-tree.html @@ -0,0 +1,181 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1 Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • net.minecraft.server.v1_11_R1.Entity (implements net.minecraft.server.v1_11_R1.ICommandListener) +
        +
      • net.minecraft.server.v1_11_R1.EntityLiving +
          +
        • net.minecraft.server.v1_11_R1.EntityInsentient +
            +
          • net.minecraft.server.v1_11_R1.EntityCreature +
              +
            • net.minecraft.server.v1_11_R1.EntityAgeable +
                +
              • net.minecraft.server.v1_11_R1.EntityAnimal (implements net.minecraft.server.v1_11_R1.IAnimal) +
                  +
                • net.minecraft.server.v1_11_R1.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_11_R1.EntityMonster (implements net.minecraft.server.v1_11_R1.IMonster) +
                +
              • net.minecraft.server.v1_11_R1.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_11_R1.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-use.html new file mode 100644 index 000000000..62df00525 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_11_R1/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.html new file mode 100644 index 000000000..15cbf8544 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.html @@ -0,0 +1,486 @@ + + + + + + +CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1
+

Class CustomRabbit

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_12_R1.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_12_R1.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_12_R1.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_12_R1.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_12_R1.EntityAgeable
            • +
            • +
                +
              • net.minecraft.server.v1_12_R1.EntityAnimal
              • +
              • +
                  +
                • net.minecraft.server.v1_12_R1.EntityRabbit
                • +
                • +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit
                  • +
                  +
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_12_R1.IAnimal, net.minecraft.server.v1_12_R1.ICommandListener
    +
    +
    +
    +
    public final class CustomRabbit
    +extends net.minecraft.server.v1_12_R1.EntityRabbit
    +implements CustomEntity
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_12_R1.EntityRabbit

        +net.minecraft.server.v1_12_R1.EntityRabbit.ControllerJumpRabbit, net.minecraft.server.v1_12_R1.EntityRabbit.GroupDataRabbit
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_12_R1.EntityInsentient

        +net.minecraft.server.v1_12_R1.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.EntityAnimal

        +bA, breedItem
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.EntityAgeable

        +a, ageLocked, b, c
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.EntityCreature

        +bv, bw
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.EntityInsentient

        +a_, b_, canPickUpLoot, dropChanceArmor, dropChanceHand, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.EntityLiving

        +aA, aC, activeItem, aD, aE, aF, aG, aH, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, at, au, aU, av, aw, aW, ax, aX, aY, az, aZ, ba, bb, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bp, bq, collides, combatTracker, craftAttributes, deathTicks, effects, expToDrop, HEALTH, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.Entity

        +aa, ab, ac, activatedTick, activationType, ad, ah, ak, al, an, ao, ap, ar, attachedToPlayer, B, bukkitEntity, C, datawatcher, dead, defaultActivationState, dimension, E, fallDistance, fireProof, fireTicks, forceExplosionKnockback, glowing, i, I, impulse, inWater, j, J, justCreated, K, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, motX, motY, motZ, N, noclip, noDamageTicks, O, onGround, P, passengers, pitch, portalCooldown, positionChanged, projectileSource, R, random, ticksLived, tickTimer, uniqueID, valid, velocityChanged, width, world, yaw, Z
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomRabbit(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomRabbit(net.minecraft.server.v1_12_R1.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected net.minecraft.server.v1_12_R1.SoundEffectdm() 
      org.bukkit.entity.RabbitgetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityRabbit

        +a, a, as, B, b, b, bK, c, cf, createChild, ct, cu, d, damageEntity, dl, do_, e, F, getRabbitType, i, initAttributes, initializePathFinderGoals, J, l, M, n, prepare, r, setRabbitType
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityAnimal

        +a, a, a, aF, C, f, getBreedCause, getExpValue, isInLove, isTypeNotPersistent, mate, P, resetLove
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityAgeable

        +a, a, a, a, getAge, inactiveTick, isBaby, p, setAge, setAge, setAgeRaw, setSize
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityCreature

        +a, cZ, de, df, dg, dh, di, dj, dk, f, q
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityInsentient

        +A, a, a, a, a, a, a, a, a, a, a, a, aO, B_, b, b, b, b, bg, bI, c, c, c, canSpawn, cC, cU, cV, cW, cX, D, d, d, dd, doSpawnEffect, doTick, dropDeathLoot, dropEquipment, g, getArmorItems, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getGoalTarget, getLeashHolder, getLoot, getMainHand, getNavigation, isLeashed, isNoAI, isPersistent, k, L, m, N, n, O, o, o, p, s, setGoalTarget, setGoalTarget, setLeashHolder, setNoAI, setSlot, unleash, Y
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityLiving

        +a_, a, a, A, a, a, a, a, a, a, a, a, ac, addEffect, aE, alwaysGivesExp, applyArmorModifier, applyMagicModifier, ax, b, b, b, b, b, bN, bO, bT, bU, bV, bW, bY, C, c, c, c, cb, cB, cc, ce, cE, cH, ci, cI, cJ, cK, cl, cL, clearActiveItem, cN, cP, cq, cr, cR, cS, cv, cw, cx, cy, d, d, damageArmor, damageEntity0, damageShield, die, e, e, e, enterCombat, exitCombat, G, getAbsorptionHearts, getArmorStrength, getArrowCount, getAttributeInstance, getAttributeMap, getCombatTracker, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getItemInMainHand, getItemInOffHand, getLastDamager, getMaxHealth, getMonsterType, getRandom, h, hasEffect, hasLineOfSight, heal, heal, isAlive, isBlocking, isCollidable, isDropExperience, isFrozen, isHandRaised, isInteractable, isSleeping, j, killEntity, m_, receive, removeAllEffects, removeEffect, setAbsorptionHearts, setArrowCount, setHeadRotation, setHealth, setSprinting, stopRiding, tickPotionEffects, v, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aA, addScoreboardTag, ae, af, aG, ah, aI, aJ, al, aM, an, ap, appendEntityCrashDetails, aq, aQ, ar, at, au, aw, aW, aY, b, b, b, b, b, b, b, ba, bA, bb, bB, bC, bd, bD, be, bE, bf, bF, bG, bJ, bn, bo, bu, burn, burnFromLava, bv, bz, C_, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, d, d, die, e, e, ejectPassengers, enderTeleportTo, equals, extinguish, f, f, f, f, f, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getFlag, getHeadHeight, getId, getMaxFireTicks, getName, getPortalDirection, getPortalOffset, getSaveID, getScoreboardDisplayName, getScoreboardTags, getSendCommandFeedback, getUniqueID, getVehicle, getWorld, h, h, hasCustomName, hashCode, I, i, inBlock, isBurning, isFireProof, isIgnoreBlockTrigger, isInvisible, isInvulnerable, isInWater, isNoGravity, isPassenger, isSilent, isSneaking, isSprinting, isVehicle, j, k, k, move, n, o_, o, onLightningStrike, p, playStepSound, postTick, q, r, recalcPosition, removeScoreboardTag, s, save, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setEquipment, setFlag, setInvisible, setInvulnerable, setLocation, setNoGravity, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSilent, setSneaking, setYawPitch, spawnIn, startRiding, t, teleportTo, toString, u, v, w, x, y, Z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(net.minecraft.server.v1_12_R1.World world)
        +
      • +
      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        dm

        +
        protected net.minecraft.server.v1_12_R1.SoundEffect dm()
        +
        +
        Overrides:
        +
        dm in class net.minecraft.server.v1_12_R1.EntityRabbit
        +
        +
      • +
      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.Rabbit getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.html new file mode 100644 index 000000000..7499a23bb --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomZombie.html @@ -0,0 +1,470 @@ + + + + + + +CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1
+

Class CustomZombie

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_12_R1.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_12_R1.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_12_R1.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_12_R1.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_12_R1.EntityMonster
            • +
            • +
                +
              • net.minecraft.server.v1_12_R1.EntityZombie
              • +
              • +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_12_R1.IAnimal, net.minecraft.server.v1_12_R1.ICommandListener, net.minecraft.server.v1_12_R1.IMonster
    +
    +
    +
    +
    public final class CustomZombie
    +extends net.minecraft.server.v1_12_R1.EntityZombie
    +implements CustomEntity
    +
    Created by Shynixn
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_12_R1.EntityInsentient

        +net.minecraft.server.v1_12_R1.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.EntityZombie

        +a
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.EntityCreature

        +bv, bw
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.EntityInsentient

        +a_, b_, canPickUpLoot, dropChanceArmor, dropChanceHand, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.EntityLiving

        +aA, aC, activeItem, aD, aE, aF, aG, aH, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, at, au, aU, av, aw, aW, ax, aX, aY, az, aZ, ba, bb, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bp, bq, collides, combatTracker, craftAttributes, deathTicks, effects, expToDrop, HEALTH, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_12_R1.Entity

        +aa, ab, ac, activatedTick, activationType, ad, ah, ak, al, an, ao, ap, ar, attachedToPlayer, B, bukkitEntity, C, datawatcher, dead, defaultActivationState, dimension, E, fallDistance, fireProof, fireTicks, forceExplosionKnockback, glowing, i, I, impulse, inWater, j, J, justCreated, K, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, motX, motY, motZ, N, noclip, noDamageTicks, O, onGround, P, passengers, pitch, portalCooldown, positionChanged, projectileSource, R, random, ticksLived, tickTimer, uniqueID, valid, velocityChanged, width, world, yaw, Z
      • +
      +
        +
      • + + +

        Fields inherited from interface net.minecraft.server.v1_12_R1.IMonster

        +d, e
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomZombie(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomZombie(net.minecraft.server.v1_12_R1.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected voida(net.minecraft.server.v1_12_R1.BlockPosition blockposition, + net.minecraft.server.v1_12_R1.Block block) 
      org.bukkit.entity.LivingEntitygetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityZombie

        +a, a, a, a, a, aF, B, b, b, c, c, cf, d, damageEntity, die, dm, dn, do_, dr, F, getExpValue, getHeadHeight, getMonsterType, i, initAttributes, isBaby, J, n, p, p, prepare, r, r, setBaby, setSize
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityMonster

        +a, ae, af, B_, bK, c, e, isDropExperience, P, s_
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityCreature

        +a, cZ, de, df, dg, dh, di, dj, dk, f, q
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityInsentient

        +A, a, a, a, a, a, a, a, a, a, a, a, aO, b, b, b, b, bg, bI, C, c, c, canSpawn, cC, cU, cV, cW, cX, D, d, d, dd, doSpawnEffect, doTick, dropDeathLoot, dropEquipment, g, getArmorItems, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getGoalTarget, getLeashHolder, getLoot, getMainHand, getNavigation, isLeashed, isNoAI, isPersistent, isTypeNotPersistent, k, L, M, m, N, n, O, o, o, p, s, setGoalTarget, setGoalTarget, setLeashHolder, setNoAI, setSlot, unleash, Y
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.EntityLiving

        +a_, a, a, A, a, a, a, a, a, a, a, a, ac, addEffect, aE, alwaysGivesExp, applyArmorModifier, applyMagicModifier, ax, b, b, b, b, b, bN, bO, bT, bU, bV, bW, bY, C, c, c, c, cb, cB, cc, ce, cE, cH, ci, cI, cJ, cK, cl, cL, clearActiveItem, cN, cP, cq, cr, cR, cS, ct, cu, cv, cw, cx, cy, d, d, damageArmor, damageEntity0, damageShield, e, e, enterCombat, exitCombat, G, getAbsorptionHearts, getArmorStrength, getArrowCount, getAttributeInstance, getAttributeMap, getCombatTracker, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getItemInMainHand, getItemInOffHand, getLastDamager, getMaxHealth, getRandom, h, hasEffect, hasLineOfSight, heal, heal, inactiveTick, isAlive, isBlocking, isCollidable, isFrozen, isHandRaised, isInteractable, isSleeping, j, killEntity, l, m_, receive, removeAllEffects, removeEffect, setAbsorptionHearts, setArrowCount, setHeadRotation, setHealth, setSprinting, stopRiding, tickPotionEffects, v, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_12_R1.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aA, addScoreboardTag, aG, ah, aI, aJ, al, aM, an, ap, appendEntityCrashDetails, aq, aQ, ar, as, at, au, aw, aW, aY, b, b, b, b, b, b, ba, bA, bb, bB, bC, bd, bD, be, bE, bf, bF, bG, bJ, bn, bo, bu, burn, burnFromLava, bv, bz, C_, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, d, d, die, e, e, ejectPassengers, enderTeleportTo, equals, extinguish, f, f, f, f, f, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getFlag, getId, getMaxFireTicks, getName, getPortalDirection, getPortalOffset, getSaveID, getScoreboardDisplayName, getScoreboardTags, getSendCommandFeedback, getUniqueID, getVehicle, getWorld, h, h, hasCustomName, hashCode, I, i, inBlock, isBurning, isFireProof, isIgnoreBlockTrigger, isInvisible, isInvulnerable, isInWater, isNoGravity, isPassenger, isSilent, isSneaking, isSprinting, isVehicle, j, k, k, move, n, o_, o, onLightningStrike, p, playStepSound, postTick, q, r, recalcPosition, removeScoreboardTag, s, save, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setEquipment, setFlag, setInvisible, setInvulnerable, setLocation, setNoGravity, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSilent, setSneaking, setYawPitch, spawnIn, startRiding, t, teleportTo, toString, u, v, w, x, y, Z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(net.minecraft.server.v1_12_R1.World world)
        +
      • +
      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        a

        +
        protected void a(net.minecraft.server.v1_12_R1.BlockPosition blockposition,
        +                 net.minecraft.server.v1_12_R1.Block block)
        +
        +
        Overrides:
        +
        a in class net.minecraft.server.v1_12_R1.EntityZombie
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.LivingEntity getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.html new file mode 100644 index 000000000..2cccb4b40 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/OwnerPathfinder.html @@ -0,0 +1,336 @@ + + + + + + +OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1
+

Class OwnerPathfinder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_12_R1.PathfinderGoal
    • +
    • +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class OwnerPathfinder
    +extends net.minecraft.server.v1_12_R1.PathfinderGoal
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        OwnerPathfinder

        +
        public OwnerPathfinder(net.minecraft.server.v1_12_R1.EntityInsentient entitycreature,
        +                       org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        a

        +
        public boolean a()
        +
        +
        Specified by:
        +
        a in class net.minecraft.server.v1_12_R1.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        c

        +
        public void c()
        +
        +
        Overrides:
        +
        c in class net.minecraft.server.v1_12_R1.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        public static boolean isUnbreakable(org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        setItemstackTag

        +
        public static org.bukkit.inventory.ItemStack setItemstackTag(org.bukkit.inventory.ItemStack itemStack,
        +                                                             Map<String,Object> tags)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/CustomRabbit.html new file mode 100644 index 000000000..bff6ef2b8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/CustomRabbit.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/CustomZombie.html new file mode 100644 index 000000000..a2944f93c --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/CustomZombie.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/OwnerPathfinder.html new file mode 100644 index 000000000..ce62eaf6b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/class-use/OwnerPathfinder.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-frame.html new file mode 100644 index 000000000..41f55dd5a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-frame.html @@ -0,0 +1,23 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1 (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-summary.html new file mode 100644 index 000000000..1ac9fb3bd --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-summary.html @@ -0,0 +1,154 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-tree.html new file mode 100644 index 000000000..868b2752f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-tree.html @@ -0,0 +1,181 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1 Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • net.minecraft.server.v1_12_R1.Entity (implements net.minecraft.server.v1_12_R1.ICommandListener) +
        +
      • net.minecraft.server.v1_12_R1.EntityLiving +
          +
        • net.minecraft.server.v1_12_R1.EntityInsentient +
            +
          • net.minecraft.server.v1_12_R1.EntityCreature +
              +
            • net.minecraft.server.v1_12_R1.EntityAgeable +
                +
              • net.minecraft.server.v1_12_R1.EntityAnimal (implements net.minecraft.server.v1_12_R1.IAnimal) +
                  +
                • net.minecraft.server.v1_12_R1.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_12_R1.EntityMonster (implements net.minecraft.server.v1_12_R1.IMonster) +
                +
              • net.minecraft.server.v1_12_R1.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_12_R1.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-use.html new file mode 100644 index 000000000..fd5bec20f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomRabbit.html new file mode 100644 index 000000000..3d8af7ceb --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomRabbit.html @@ -0,0 +1,481 @@ + + + + + + +CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1
+

Class CustomRabbit

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_8_R1.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_8_R1.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_8_R1.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_8_R1.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_8_R1.EntityAgeable
            • +
            • +
                +
              • net.minecraft.server.v1_8_R1.EntityAnimal
              • +
              • +
                  +
                • net.minecraft.server.v1_8_R1.EntityRabbit
                • +
                • +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit
                  • +
                  +
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_8_R1.IAnimal, net.minecraft.server.v1_8_R1.ICommandListener
    +
    +
    +
    +
    public final class CustomRabbit
    +extends net.minecraft.server.v1_8_R1.EntityRabbit
    +implements CustomEntity
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.EntityAnimal

        +bl
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.EntityAgeable

        +a, ageLocked, b, c
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.EntityCreature

        +bi, bj
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.EntityInsentient

        +a_, b_, canPickUpLoot, dropChances, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.EntityLiving

        +aA, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aN, aO, ap, aP, aq, aQ, ar, aR, aS, at, aT, au, aU, aw, aW, ax, aX, ay, aY, az, aZ, ba, bb, bc, bd, be, bf, combatTracker, deathTicks, effects, expToDrop, hurtTicks, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.Entity

        +activatedTick, activationType, ad, ae, af, ag, ah, ai, ak, al, an, attachedToPlayer, bukkitEntity, datawatcher, dead, defaultActivationState, dimension, E, F, fallDistance, fireProof, fireTicks, fromMobSpawner, H, inWater, j, justCreated, k, L, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noDamageTicks, onGround, P, passenger, pitch, portalCooldown, positionChanged, projectileSource, Q, R, random, S, T, ticksLived, tickTimer, U, uniqueID, valid, vehicle, velocityChanged, width, world, yaw
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomRabbit(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomRabbit(net.minecraft.server.v1_8_R1.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected Stringck() 
      net.minecraft.server.v1_8_R1.EntityAgeablecreateChild(net.minecraft.server.v1_8_R1.EntityAgeable entityAgeable) 
      org.bukkit.entity.RabbitgetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityRabbit

        +a, a, a, aW, b, b, b, b, bD, bn, bo, bq, cj, cl, cm, cn, d, damageEntity, dropDeathLoot, E, getRareDrop, h, initializePathFinderGoals, m, prepare, r, r, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityAnimal

        +a, a, a, bQ, c, co, cp, cq, getExpValue, isTypeNotPersistent, mate, w
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityAgeable

        +a, a, a, getAge, inactiveTick, isBaby, n, setAge, setAge, setAgeRaw
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityCreature

        +a, bZ, cd, ce, cf, cg, ch, ci, d, n
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityInsentient

        +a, a, a, a, a, a, a, aF, b, b, bL, bP, bU, bV, bW, bX, bz, c, ca, canSpawn, cb, D, d, doTick, dropEquipment, e, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getEquipment, getGoalTarget, getLeashHolder, getLoot, getNavigation, h, isPersistent, j, j, K, k, m, q, s_, setEquipment, setGoalTarget, setGoalTarget, setLeashHolder, unleash, v, x, y
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityLiving

        +a, a, a, a, a, ac, ad, addEffect, ae, ak, alwaysGivesExp, ap, applyArmorModifier, applyMagicModifier, aX, aY, aZ, B, b, b, b, bA, bb, bB, bC, bd, be, bE, bf, bF, bg, bG, bh, bH, bi, bK, bl, bO, br, bs, bu, bv, bw, c, d, d, d, damageArmor, die, e, enterCombat, exitCombat, f, G, g, getAbsorptionHearts, getAttributeInstance, getAttributeMap, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getLastDamager, getMaxHealth, getMonsterType, getScoreboardTeam, hasEffect, hasEffect, hasLineOfSight, heal, heal, i, isAlive, isSleeping, j_, j, mount, n, O, o, p, q, receive, removeAllEffects, removeEffect, s, setAbsorptionHearts, setHealth, setSprinting
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aa, ab, aB, aC, aE, af, ag, aG, ah, aH, aK, al, am, an, ao, aP, appendEntityCrashDetails, aq, ar, aS, aT, av, aV, b, b, b, b, burn, burnFromLava, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, die, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, f, g, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getHeadHeight, getId, getName, getNBTTag, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getWorld, h, h, hasCustomName, hashCode, i, inBlock, isAddedToChunk, isBurning, isFireProof, isInvisible, isInvulnerable, isSneaking, isSprinting, j, j, k, L, l, m, makeSound, move, n, o, onLightningStrike, P, r_, R, S, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setInvisible, setLocation, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSneaking, setYawPitch, spawnIn, teleportTo, toString, U, V, W, X, Z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(net.minecraft.server.v1_8_R1.World world)
        +
      • +
      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        createChild

        +
        public net.minecraft.server.v1_8_R1.EntityAgeable createChild(net.minecraft.server.v1_8_R1.EntityAgeable entityAgeable)
        +
        +
        Overrides:
        +
        createChild in class net.minecraft.server.v1_8_R1.EntityRabbit
        +
        +
      • +
      + + + +
        +
      • +

        ck

        +
        protected String ck()
        +
        +
        Overrides:
        +
        ck in class net.minecraft.server.v1_8_R1.EntityRabbit
        +
        +
      • +
      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.Rabbit getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomZombie.html new file mode 100644 index 000000000..cb81e01d1 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/CustomZombie.html @@ -0,0 +1,462 @@ + + + + + + +CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1
+

Class CustomZombie

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_8_R1.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_8_R1.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_8_R1.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_8_R1.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_8_R1.EntityMonster
            • +
            • +
                +
              • net.minecraft.server.v1_8_R1.EntityZombie
              • +
              • +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_8_R1.IAnimal, net.minecraft.server.v1_8_R1.ICommandListener, net.minecraft.server.v1_8_R1.IMonster
    +
    +
    +
    +
    public final class CustomZombie
    +extends net.minecraft.server.v1_8_R1.EntityZombie
    +implements CustomEntity
    +
    Created by Shynixn
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.EntityZombie

        +b
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.EntityMonster

        +a
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.EntityCreature

        +bi, bj
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.EntityInsentient

        +a_, b_, canPickUpLoot, dropChances, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.EntityLiving

        +aA, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aN, aO, ap, aP, aq, aQ, ar, aR, aS, at, aT, au, aU, aw, aW, ax, aX, ay, aY, az, aZ, ba, bb, bc, bd, be, bf, combatTracker, deathTicks, effects, expToDrop, hurtTicks, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R1.Entity

        +activatedTick, activationType, ad, ae, af, ag, ah, ai, ak, al, an, attachedToPlayer, bukkitEntity, datawatcher, dead, defaultActivationState, dimension, E, F, fallDistance, fireProof, fireTicks, fromMobSpawner, H, inWater, j, justCreated, k, L, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noDamageTicks, onGround, P, passenger, pitch, portalCooldown, positionChanged, projectileSource, Q, R, random, S, T, ticksLived, tickTimer, U, uniqueID, valid, vehicle, velocityChanged, width, world, yaw
      • +
      +
        +
      • + + +

        Fields inherited from interface net.minecraft.server.v1_8_R1.IMonster

        +d, e
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomZombie(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomZombie(net.minecraft.server.v1_8_R1.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected voida(net.minecraft.server.v1_8_R1.BlockPosition blockposition, + net.minecraft.server.v1_8_R1.Block block) 
      org.bukkit.entity.LivingEntitygetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityZombie

        +a, a, a, a, a, a, a, a, a, am, aW, b, bn, bo, bq, cl, cn, co, cp, damageEntity, die, getExpValue, getHeadHeight, getLoot, getMonsterType, getRareDrop, h, isBaby, isTypeNotPersistent, isVillager, m, n, n, prepare, r, s_, setBaby, setVillager, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityMonster

        +a, aa, aZ, bQ, m_, n, P
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityCreature

        +a, bZ, cd, ce, cf, cg, ch, ci, d, n
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityInsentient

        +a, a, a, a, a, aF, b, b, bL, bP, bU, bV, bW, bX, bz, c, ca, canSpawn, cb, D, d, doTick, dropDeathLoot, dropEquipment, E, e, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getEquipment, getGoalTarget, getLeashHolder, getNavigation, h, isPersistent, j, j, K, k, m, q, setEquipment, setGoalTarget, setGoalTarget, setLeashHolder, unleash, v, w, x, y
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.EntityLiving

        +a, a, a, a, a, ac, ad, addEffect, ae, ak, alwaysGivesExp, ap, applyArmorModifier, applyMagicModifier, aX, aY, B, b, b, b, bA, bb, bB, bC, bd, bD, be, bE, bf, bF, bg, bG, bh, bH, bi, bK, bl, bO, br, bs, bu, bv, bw, c, d, d, d, damageArmor, e, enterCombat, exitCombat, f, G, g, getAbsorptionHearts, getAttributeInstance, getAttributeMap, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getLastDamager, getMaxHealth, getScoreboardTeam, hasEffect, hasEffect, hasLineOfSight, heal, heal, i, inactiveTick, isAlive, isSleeping, j_, j, mount, O, o, p, q, receive, removeAllEffects, removeEffect, s, setAbsorptionHearts, setHealth, setSprinting
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R1.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, ab, aB, aC, aE, af, ag, aG, ah, aH, aK, al, an, ao, aP, appendEntityCrashDetails, aq, ar, aS, aT, av, aV, b, b, b, b, burn, burnFromLava, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, die, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, f, g, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getId, getName, getNBTTag, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getWorld, h, h, hasCustomName, hashCode, i, inBlock, isAddedToChunk, isBurning, isFireProof, isInvisible, isInvulnerable, isSneaking, isSprinting, j, j, k, L, l, m, makeSound, move, n, o, onLightningStrike, r_, R, S, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setInvisible, setLocation, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSneaking, setYawPitch, spawnIn, teleportTo, toString, U, V, W, X, Y, Z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(net.minecraft.server.v1_8_R1.World world)
        +
      • +
      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        a

        +
        protected void a(net.minecraft.server.v1_8_R1.BlockPosition blockposition,
        +                 net.minecraft.server.v1_8_R1.Block block)
        +
        +
        Overrides:
        +
        a in class net.minecraft.server.v1_8_R1.EntityZombie
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.LivingEntity getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/OwnerPathfinder.html new file mode 100644 index 000000000..82c50d812 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/OwnerPathfinder.html @@ -0,0 +1,336 @@ + + + + + + +OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1
+

Class OwnerPathfinder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_8_R1.PathfinderGoal
    • +
    • +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class OwnerPathfinder
    +extends net.minecraft.server.v1_8_R1.PathfinderGoal
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        OwnerPathfinder

        +
        public OwnerPathfinder(net.minecraft.server.v1_8_R1.EntityInsentient entitycreature,
        +                       org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        a

        +
        public boolean a()
        +
        +
        Specified by:
        +
        a in class net.minecraft.server.v1_8_R1.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        public static boolean isUnbreakable(org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        c

        +
        public void c()
        +
        +
        Overrides:
        +
        c in class net.minecraft.server.v1_8_R1.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        setItemstackTag

        +
        public static org.bukkit.inventory.ItemStack setItemstackTag(org.bukkit.inventory.ItemStack itemStack,
        +                                                             Map<String,Object> tags)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/CustomRabbit.html new file mode 100644 index 000000000..40abe98ba --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/CustomRabbit.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/CustomZombie.html new file mode 100644 index 000000000..5eaa7dc1d --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/CustomZombie.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/OwnerPathfinder.html new file mode 100644 index 000000000..48fd2df4a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/class-use/OwnerPathfinder.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-frame.html new file mode 100644 index 000000000..af42b3f3e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-frame.html @@ -0,0 +1,23 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1 (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-summary.html new file mode 100644 index 000000000..c071495bc --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-summary.html @@ -0,0 +1,154 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-tree.html new file mode 100644 index 000000000..7d40d576b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-tree.html @@ -0,0 +1,181 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1 Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • net.minecraft.server.v1_8_R1.Entity (implements net.minecraft.server.v1_8_R1.ICommandListener) +
        +
      • net.minecraft.server.v1_8_R1.EntityLiving +
          +
        • net.minecraft.server.v1_8_R1.EntityInsentient +
            +
          • net.minecraft.server.v1_8_R1.EntityCreature +
              +
            • net.minecraft.server.v1_8_R1.EntityAgeable +
                +
              • net.minecraft.server.v1_8_R1.EntityAnimal (implements net.minecraft.server.v1_8_R1.IAnimal) +
                  +
                • net.minecraft.server.v1_8_R1.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_8_R1.EntityMonster (implements net.minecraft.server.v1_8_R1.IMonster) +
                +
              • net.minecraft.server.v1_8_R1.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_8_R1.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-use.html new file mode 100644 index 000000000..c3fb46b23 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R1/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomRabbit.html new file mode 100644 index 000000000..b315da333 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomRabbit.html @@ -0,0 +1,486 @@ + + + + + + +CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2
+

Class CustomRabbit

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_8_R2.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_8_R2.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_8_R2.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_8_R2.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_8_R2.EntityAgeable
            • +
            • +
                +
              • net.minecraft.server.v1_8_R2.EntityAnimal
              • +
              • +
                  +
                • net.minecraft.server.v1_8_R2.EntityRabbit
                • +
                • +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit
                  • +
                  +
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_8_R2.IAnimal, net.minecraft.server.v1_8_R2.ICommandListener
    +
    +
    +
    +
    public final class CustomRabbit
    +extends net.minecraft.server.v1_8_R2.EntityRabbit
    +implements CustomEntity
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_8_R2.EntityRabbit

        +net.minecraft.server.v1_8_R2.EntityRabbit.ControllerJumpRabbit, net.minecraft.server.v1_8_R2.EntityRabbit.GroupDataRabbit
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_8_R2.EntityInsentient

        +net.minecraft.server.v1_8_R2.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.EntityAnimal

        +bn
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.EntityAgeable

        +a, ageLocked, b, c
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.EntityCreature

        +bk, bl
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.EntityInsentient

        +a_, b_, canPickUpLoot, dropChances, g, goalSelector, headDrop, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.EntityLiving

        +aA, aB, aC, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aP, ar, aR, as, aS, at, aT, aU, av, aV, aw, aW, ay, aY, az, aZ, ba, bb, bc, bd, be, bf, bg, bh, combatTracker, deathTicks, effects, expToDrop, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.Entity

        +activatedTick, activationType, ad, ae, af, ag, ah, ai, ak, al, an, ao, ap, attachedToPlayer, bukkitEntity, datawatcher, dead, defaultActivationState, dimension, E, F, fallDistance, fireProof, fireTicks, fromMobSpawner, H, inWater, j, justCreated, k, L, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noclip, noDamageTicks, onGround, P, passenger, pitch, portalCooldown, positionChanged, projectileSource, Q, R, random, S, ticksLived, tickTimer, U, uniqueID, valid, vehicle, velocityChanged, width, world, yaw
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomRabbit(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomRabbit(net.minecraft.server.v1_8_R2.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected Stringcm() 
      org.bukkit.entity.RabbitgetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityRabbit

        +a, a, a, b, b, b, b, bE, bo, bp, br, cl, co, cp, createChild, d, damageEntity, dropDeathLoot, E, getRabbitType, getRareDrop, h, initAttributes, initializePathFinderGoals, m, prepare, r, setRabbitType, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityAnimal

        +a, a, a, bR, c, cq, cs, getExpValue, isInLove, isTypeNotPersistent, mate, w
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityAgeable

        +a, a, getAge, inactiveTick, isBaby, n, setAge, setAge, setAgeRaw, setSize
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityCreature

        +a, ca, cf, cg, ch, ci, cj, ck, e, o
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityInsentient

        +a, a, a, a, a, a, a, aE, b, b, bA, bM, bQ, bV, bW, bX, bY, c, canSpawn, cb, cc, ce, D, d, doTick, dropEquipment, e, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getEquipment, getGoalTarget, getLeashHolder, getLoot, getNavigation, h, isPersistent, j, K, k, k, n, q, setEquipment, setGoalTarget, setGoalTarget, setLeashHolder, t_, unleash, v, x, y
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityLiving

        +a, a, a, a, a, ac, ad, addEffect, ae, ak, alwaysGivesExp, ap, applyArmorModifier, applyMagicModifier, aY, aZ, B, b, b, b, ba, bB, bc, bC, bD, be, bf, bF, bg, bG, bh, bH, bi, bI, bj, bL, bm, bP, bs, bt, bv, bw, bx, c, d, d, d, damageArmor, die, e, enterCombat, exitCombat, f, G, g, g, getAbsorptionHearts, getAttributeInstance, getAttributeMap, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getLastDamager, getMaxHealth, getMonsterType, getScoreboardTeam, hasEffect, hasEffect, hasLineOfSight, heal, heal, i, isAlive, isSleeping, j, k_, mount, n, O, o, p, q, receive, removeAllEffects, removeEffect, s, setAbsorptionHearts, setHealth, setSprinting
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aa, aA, ab, aB, aD, af, ag, aG, ah, aH, aI, al, aL, am, an, ao, appendEntityCrashDetails, aq, aQ, aT, au, aU, aW, b, b, b, b, burn, burnFromLava, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, d, die, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, f, g, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getHeadHeight, getId, getName, getNBTTag, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getWorld, h, h, hasCustomName, hashCode, i, inBlock, isAddedToChunk, isBurning, isFireProof, isInvisible, isInvulnerable, isSneaking, isSprinting, j, j, k, L, l, m, makeSound, move, n, o, onLightningStrike, P, R, s_, S, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setInvisible, setLocation, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSneaking, setYawPitch, spawnIn, teleportTo, toString, U, V, W, X, Z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(net.minecraft.server.v1_8_R2.World world)
        +
      • +
      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        cm

        +
        protected String cm()
        +
        +
        Overrides:
        +
        cm in class net.minecraft.server.v1_8_R2.EntityRabbit
        +
        +
      • +
      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.Rabbit getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomZombie.html new file mode 100644 index 000000000..adea949fb --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/CustomZombie.html @@ -0,0 +1,470 @@ + + + + + + +CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2
+

Class CustomZombie

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_8_R2.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_8_R2.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_8_R2.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_8_R2.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_8_R2.EntityMonster
            • +
            • +
                +
              • net.minecraft.server.v1_8_R2.EntityZombie
              • +
              • +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_8_R2.IAnimal, net.minecraft.server.v1_8_R2.ICommandListener, net.minecraft.server.v1_8_R2.IMonster
    +
    +
    +
    +
    public final class CustomZombie
    +extends net.minecraft.server.v1_8_R2.EntityZombie
    +implements CustomEntity
    +
    Created by Shynixn
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_8_R2.EntityInsentient

        +net.minecraft.server.v1_8_R2.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.EntityZombie

        +a
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.EntityCreature

        +bk, bl
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.EntityInsentient

        +a_, b_, canPickUpLoot, dropChances, g, goalSelector, headDrop, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.EntityLiving

        +aA, aB, aC, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aP, ar, aR, as, aS, at, aT, aU, av, aV, aw, aW, ay, aY, az, aZ, ba, bb, bc, bd, be, bf, bg, bh, combatTracker, deathTicks, effects, expToDrop, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R2.Entity

        +activatedTick, activationType, ad, ae, af, ag, ah, ai, ak, al, an, ao, ap, attachedToPlayer, bukkitEntity, datawatcher, dead, defaultActivationState, dimension, E, F, fallDistance, fireProof, fireTicks, fromMobSpawner, H, inWater, j, justCreated, k, L, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noclip, noDamageTicks, onGround, P, passenger, pitch, portalCooldown, positionChanged, projectileSource, Q, R, random, S, ticksLived, tickTimer, U, uniqueID, valid, vehicle, velocityChanged, width, world, yaw
      • +
      +
        +
      • + + +

        Fields inherited from interface net.minecraft.server.v1_8_R2.IMonster

        +d, e
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomZombie(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomZombie(net.minecraft.server.v1_8_R2.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected voida(net.minecraft.server.v1_8_R2.BlockPosition blockposition, + net.minecraft.server.v1_8_R2.Block block) 
      org.bukkit.entity.LivingEntitygetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityZombie

        +a, a, a, a, a, a, a, a, am, b, bo, bp, br, cn, cp, cq, cr, damageEntity, die, getExpValue, getHeadHeight, getLoot, getMonsterType, getRareDrop, h, initAttributes, isBaby, isTypeNotPersistent, isVillager, m, n, n, prepare, r, setBaby, setSize, setVillager, t_, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityMonster

        +a, aa, ba, bR, n_, n, P
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityCreature

        +a, ca, cf, cg, ch, ci, cj, ck, e, o
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityInsentient

        +a, a, a, a, a, aE, b, b, bA, bM, bQ, bV, bW, bX, bY, c, canSpawn, cb, cc, ce, D, d, doTick, dropDeathLoot, dropEquipment, E, e, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getEquipment, getGoalTarget, getLeashHolder, getNavigation, h, isPersistent, j, K, k, k, n, q, setEquipment, setGoalTarget, setGoalTarget, setLeashHolder, unleash, v, w, x, y
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.EntityLiving

        +a, a, a, a, a, ac, ad, addEffect, ae, ak, alwaysGivesExp, ap, applyArmorModifier, applyMagicModifier, aY, aZ, B, b, b, b, bB, bc, bC, bD, be, bE, bf, bF, bg, bG, bh, bH, bi, bI, bj, bL, bm, bP, bs, bt, bv, bw, bx, c, d, d, d, damageArmor, e, enterCombat, exitCombat, f, G, g, g, getAbsorptionHearts, getAttributeInstance, getAttributeMap, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getLastDamager, getMaxHealth, getScoreboardTeam, hasEffect, hasEffect, hasLineOfSight, heal, heal, i, inactiveTick, isAlive, isSleeping, j, k_, mount, O, o, p, q, receive, removeAllEffects, removeEffect, s, setAbsorptionHearts, setHealth, setSprinting
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R2.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aA, ab, aB, aD, af, ag, aG, ah, aH, aI, al, aL, an, ao, appendEntityCrashDetails, aq, aQ, aT, au, aU, aW, b, b, b, b, burn, burnFromLava, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, d, die, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, f, g, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getId, getName, getNBTTag, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getWorld, h, h, hasCustomName, hashCode, i, inBlock, isAddedToChunk, isBurning, isFireProof, isInvisible, isInvulnerable, isSneaking, isSprinting, j, j, k, L, l, m, makeSound, move, n, o, onLightningStrike, R, s_, S, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setInvisible, setLocation, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSneaking, setYawPitch, spawnIn, teleportTo, toString, U, V, W, X, Y, Z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(net.minecraft.server.v1_8_R2.World world)
        +
      • +
      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        a

        +
        protected void a(net.minecraft.server.v1_8_R2.BlockPosition blockposition,
        +                 net.minecraft.server.v1_8_R2.Block block)
        +
        +
        Overrides:
        +
        a in class net.minecraft.server.v1_8_R2.EntityZombie
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.LivingEntity getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/OwnerPathfinder.html new file mode 100644 index 000000000..c8c670629 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/OwnerPathfinder.html @@ -0,0 +1,336 @@ + + + + + + +OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2
+

Class OwnerPathfinder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_8_R2.PathfinderGoal
    • +
    • +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class OwnerPathfinder
    +extends net.minecraft.server.v1_8_R2.PathfinderGoal
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        OwnerPathfinder

        +
        public OwnerPathfinder(net.minecraft.server.v1_8_R2.EntityInsentient entitycreature,
        +                       org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        a

        +
        public boolean a()
        +
        +
        Specified by:
        +
        a in class net.minecraft.server.v1_8_R2.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        c

        +
        public void c()
        +
        +
        Overrides:
        +
        c in class net.minecraft.server.v1_8_R2.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        public static boolean isUnbreakable(org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        setItemstackTag

        +
        public static org.bukkit.inventory.ItemStack setItemstackTag(org.bukkit.inventory.ItemStack itemStack,
        +                                                             Map<String,Object> tags)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/CustomRabbit.html new file mode 100644 index 000000000..4d4df452a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/CustomRabbit.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/CustomZombie.html new file mode 100644 index 000000000..7a980a243 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/CustomZombie.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/OwnerPathfinder.html new file mode 100644 index 000000000..1d0d7e0f8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/class-use/OwnerPathfinder.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-frame.html new file mode 100644 index 000000000..791798c6e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-frame.html @@ -0,0 +1,23 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2 (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-summary.html new file mode 100644 index 000000000..cd5756f5c --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-summary.html @@ -0,0 +1,154 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-tree.html new file mode 100644 index 000000000..57539efb3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-tree.html @@ -0,0 +1,181 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2 Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • net.minecraft.server.v1_8_R2.Entity (implements net.minecraft.server.v1_8_R2.ICommandListener) +
        +
      • net.minecraft.server.v1_8_R2.EntityLiving +
          +
        • net.minecraft.server.v1_8_R2.EntityInsentient +
            +
          • net.minecraft.server.v1_8_R2.EntityCreature +
              +
            • net.minecraft.server.v1_8_R2.EntityAgeable +
                +
              • net.minecraft.server.v1_8_R2.EntityAnimal (implements net.minecraft.server.v1_8_R2.IAnimal) +
                  +
                • net.minecraft.server.v1_8_R2.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_8_R2.EntityMonster (implements net.minecraft.server.v1_8_R2.IMonster) +
                +
              • net.minecraft.server.v1_8_R2.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_8_R2.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-use.html new file mode 100644 index 000000000..7a0515343 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R2/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomRabbit.html new file mode 100644 index 000000000..cc704641f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomRabbit.html @@ -0,0 +1,486 @@ + + + + + + +CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3
+

Class CustomRabbit

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_8_R3.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_8_R3.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_8_R3.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_8_R3.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_8_R3.EntityAgeable
            • +
            • +
                +
              • net.minecraft.server.v1_8_R3.EntityAnimal
              • +
              • +
                  +
                • net.minecraft.server.v1_8_R3.EntityRabbit
                • +
                • +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit
                  • +
                  +
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_8_R3.IAnimal, net.minecraft.server.v1_8_R3.ICommandListener
    +
    +
    +
    +
    public final class CustomRabbit
    +extends net.minecraft.server.v1_8_R3.EntityRabbit
    +implements CustomEntity
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_8_R3.EntityRabbit

        +net.minecraft.server.v1_8_R3.EntityRabbit.ControllerJumpRabbit, net.minecraft.server.v1_8_R3.EntityRabbit.GroupDataRabbit
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_8_R3.EntityInsentient

        +net.minecraft.server.v1_8_R3.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.EntityAnimal

        +bn
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.EntityAgeable

        +a, ageLocked, b, c
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.EntityCreature

        +bk, bl
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.EntityInsentient

        +a_, b_, canPickUpLoot, dropChances, g, goalSelector, headDrop, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.EntityLiving

        +aA, aB, aC, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aP, ar, aR, as, aS, at, aT, aU, av, aV, aw, aW, ay, aY, az, aZ, ba, bb, bc, bd, be, bf, bg, bh, combatTracker, deathTicks, effects, expToDrop, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.Entity

        +activatedTick, activationType, ad, ae, af, ag, ah, ai, ak, al, an, ao, ap, attachedToPlayer, bukkitEntity, datawatcher, dead, defaultActivationState, dimension, E, F, fallDistance, fireProof, fireTicks, forceExplosionKnockback, fromMobSpawner, H, inWater, j, justCreated, k, L, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noclip, noDamageTicks, onGround, P, passenger, pitch, portalCooldown, positionChanged, projectileSource, Q, R, random, S, ticksLived, tickTimer, U, uniqueID, valid, vehicle, velocityChanged, width, world, yaw
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomRabbit(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomRabbit(net.minecraft.server.v1_8_R3.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected Stringcm() 
      org.bukkit.entity.RabbitgetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityRabbit

        +a, a, a, b, b, b, b, bE, bo, bp, br, cl, co, cp, createChild, d, damageEntity, dropDeathLoot, E, getRabbitType, getRareDrop, h, initAttributes, initializePathFinderGoals, m, prepare, r, setRabbitType, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityAnimal

        +a, a, a, bR, c, cq, cs, getExpValue, isInLove, isTypeNotPersistent, mate, w
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityAgeable

        +a, a, getAge, inactiveTick, isBaby, n, setAge, setAge, setAgeRaw, setSize
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityCreature

        +a, ca, cf, cg, ch, ci, cj, ck, e, o
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityInsentient

        +a, a, a, a, a, a, a, aE, b, b, bA, bM, bQ, bV, bW, bX, bY, c, canSpawn, cb, cc, ce, D, d, doTick, dropEquipment, e, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getEquipment, getGoalTarget, getLeashHolder, getLoot, getNavigation, h, isPersistent, j, K, k, k, n, q, setEquipment, setGoalTarget, setGoalTarget, setLeashHolder, t_, unleash, v, x, y
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityLiving

        +a, a, a, a, a, ac, ad, addEffect, ae, ak, alwaysGivesExp, ap, applyArmorModifier, applyMagicModifier, aY, aZ, B, b, b, b, ba, bB, bc, bC, bD, be, bf, bF, bg, bG, bh, bH, bi, bI, bj, bL, bm, bP, bs, bt, bv, bw, bx, c, d, d, d, damageArmor, die, e, enterCombat, exitCombat, f, G, g, g, getAbsorptionHearts, getAttributeInstance, getAttributeMap, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getLastDamager, getMaxHealth, getMonsterType, getScoreboardTeam, hasEffect, hasEffect, hasLineOfSight, heal, heal, i, isAlive, isSleeping, j, k_, mount, n, O, o, p, q, receive, removeAllEffects, removeEffect, s, setAbsorptionHearts, setHealth, setSprinting
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aa, aA, ab, aB, aD, af, ag, aG, ah, aH, aI, al, aL, am, an, ao, appendEntityCrashDetails, aq, aQ, aT, au, aU, aW, b, b, b, b, burn, burnFromLava, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, d, die, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, f, g, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getHeadHeight, getId, getName, getNBTTag, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getWorld, h, h, hasCustomName, hashCode, i, inBlock, isAddedToChunk, isBurning, isFireProof, isInvisible, isInvulnerable, isSneaking, isSprinting, j, j, k, L, l, m, makeSound, move, n, o, onLightningStrike, P, R, s_, S, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setInvisible, setLocation, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSneaking, setYawPitch, spawnIn, teleportTo, toString, U, V, W, X, Z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(net.minecraft.server.v1_8_R3.World world)
        +
      • +
      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        cm

        +
        protected String cm()
        +
        +
        Overrides:
        +
        cm in class net.minecraft.server.v1_8_R3.EntityRabbit
        +
        +
      • +
      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.Rabbit getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomZombie.html new file mode 100644 index 000000000..e9653d0ab --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/CustomZombie.html @@ -0,0 +1,470 @@ + + + + + + +CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3
+

Class CustomZombie

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_8_R3.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_8_R3.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_8_R3.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_8_R3.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_8_R3.EntityMonster
            • +
            • +
                +
              • net.minecraft.server.v1_8_R3.EntityZombie
              • +
              • +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_8_R3.IAnimal, net.minecraft.server.v1_8_R3.ICommandListener, net.minecraft.server.v1_8_R3.IMonster
    +
    +
    +
    +
    public final class CustomZombie
    +extends net.minecraft.server.v1_8_R3.EntityZombie
    +implements CustomEntity
    +
    Created by Shynixn
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_8_R3.EntityInsentient

        +net.minecraft.server.v1_8_R3.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.EntityZombie

        +a
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.EntityCreature

        +bk, bl
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.EntityInsentient

        +a_, b_, canPickUpLoot, dropChances, g, goalSelector, headDrop, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.EntityLiving

        +aA, aB, aC, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aP, ar, aR, as, aS, at, aT, aU, av, aV, aw, aW, ay, aY, az, aZ, ba, bb, bc, bd, be, bf, bg, bh, combatTracker, deathTicks, effects, expToDrop, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_8_R3.Entity

        +activatedTick, activationType, ad, ae, af, ag, ah, ai, ak, al, an, ao, ap, attachedToPlayer, bukkitEntity, datawatcher, dead, defaultActivationState, dimension, E, F, fallDistance, fireProof, fireTicks, forceExplosionKnockback, fromMobSpawner, H, inWater, j, justCreated, k, L, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noclip, noDamageTicks, onGround, P, passenger, pitch, portalCooldown, positionChanged, projectileSource, Q, R, random, S, ticksLived, tickTimer, U, uniqueID, valid, vehicle, velocityChanged, width, world, yaw
      • +
      +
        +
      • + + +

        Fields inherited from interface net.minecraft.server.v1_8_R3.IMonster

        +d, e
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomZombie(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomZombie(net.minecraft.server.v1_8_R3.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected voida(net.minecraft.server.v1_8_R3.BlockPosition blockposition, + net.minecraft.server.v1_8_R3.Block block) 
      org.bukkit.entity.LivingEntitygetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityZombie

        +a, a, a, a, a, a, a, a, am, b, bo, bp, br, cn, cp, cq, cr, damageEntity, die, getExpValue, getHeadHeight, getLoot, getMonsterType, getRareDrop, h, initAttributes, isBaby, isTypeNotPersistent, isVillager, m, n, n, prepare, r, setBaby, setSize, setVillager, t_, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityMonster

        +a, aa, ba, bR, n_, n, P
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityCreature

        +a, ca, cf, cg, ch, ci, cj, ck, e, o
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityInsentient

        +a, a, a, a, a, aE, b, b, bA, bM, bQ, bV, bW, bX, bY, c, canSpawn, cb, cc, ce, D, d, doTick, dropDeathLoot, dropEquipment, E, e, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getEquipment, getGoalTarget, getLeashHolder, getNavigation, h, isPersistent, j, K, k, k, n, q, setEquipment, setGoalTarget, setGoalTarget, setLeashHolder, unleash, v, w, x, y
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.EntityLiving

        +a, a, a, a, a, ac, ad, addEffect, ae, ak, alwaysGivesExp, ap, applyArmorModifier, applyMagicModifier, aY, aZ, B, b, b, b, bB, bc, bC, bD, be, bE, bf, bF, bg, bG, bh, bH, bi, bI, bj, bL, bm, bP, bs, bt, bv, bw, bx, c, d, d, d, damageArmor, e, enterCombat, exitCombat, f, G, g, g, getAbsorptionHearts, getAttributeInstance, getAttributeMap, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getLastDamager, getMaxHealth, getScoreboardTeam, hasEffect, hasEffect, hasLineOfSight, heal, heal, i, inactiveTick, isAlive, isSleeping, j, k_, mount, O, o, p, q, receive, removeAllEffects, removeEffect, s, setAbsorptionHearts, setHealth, setSprinting
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_8_R3.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aA, ab, aB, aD, af, ag, aG, ah, aH, aI, al, aL, an, ao, appendEntityCrashDetails, aq, aQ, aT, au, aU, aW, b, b, b, b, burn, burnFromLava, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, d, die, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, f, g, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getId, getName, getNBTTag, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getWorld, h, h, hasCustomName, hashCode, i, inBlock, isAddedToChunk, isBurning, isFireProof, isInvisible, isInvulnerable, isSneaking, isSprinting, j, j, k, L, l, m, makeSound, move, n, o, onLightningStrike, R, s_, S, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setInvisible, setLocation, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSneaking, setYawPitch, spawnIn, teleportTo, toString, U, V, W, X, Y, Z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(net.minecraft.server.v1_8_R3.World world)
        +
      • +
      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        a

        +
        protected void a(net.minecraft.server.v1_8_R3.BlockPosition blockposition,
        +                 net.minecraft.server.v1_8_R3.Block block)
        +
        +
        Overrides:
        +
        a in class net.minecraft.server.v1_8_R3.EntityZombie
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.LivingEntity getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/OwnerPathfinder.html new file mode 100644 index 000000000..6d93b02e3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/OwnerPathfinder.html @@ -0,0 +1,336 @@ + + + + + + +OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3
+

Class OwnerPathfinder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_8_R3.PathfinderGoal
    • +
    • +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class OwnerPathfinder
    +extends net.minecraft.server.v1_8_R3.PathfinderGoal
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        OwnerPathfinder

        +
        public OwnerPathfinder(net.minecraft.server.v1_8_R3.EntityInsentient entitycreature,
        +                       org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        a

        +
        public boolean a()
        +
        +
        Specified by:
        +
        a in class net.minecraft.server.v1_8_R3.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        c

        +
        public void c()
        +
        +
        Overrides:
        +
        c in class net.minecraft.server.v1_8_R3.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        public static boolean isUnbreakable(org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        setItemstackTag

        +
        public static org.bukkit.inventory.ItemStack setItemstackTag(org.bukkit.inventory.ItemStack itemStack,
        +                                                             Map<String,Object> tags)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/CustomRabbit.html new file mode 100644 index 000000000..9e1e012e3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/CustomRabbit.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/CustomZombie.html new file mode 100644 index 000000000..408f7d5f3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/CustomZombie.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/OwnerPathfinder.html new file mode 100644 index 000000000..220de6e7f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/class-use/OwnerPathfinder.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-frame.html new file mode 100644 index 000000000..ee8646545 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-frame.html @@ -0,0 +1,23 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3 (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-summary.html new file mode 100644 index 000000000..53c0aec70 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-summary.html @@ -0,0 +1,154 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-tree.html new file mode 100644 index 000000000..0a3856659 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-tree.html @@ -0,0 +1,181 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3 Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • net.minecraft.server.v1_8_R3.Entity (implements net.minecraft.server.v1_8_R3.ICommandListener) +
        +
      • net.minecraft.server.v1_8_R3.EntityLiving +
          +
        • net.minecraft.server.v1_8_R3.EntityInsentient +
            +
          • net.minecraft.server.v1_8_R3.EntityCreature +
              +
            • net.minecraft.server.v1_8_R3.EntityAgeable +
                +
              • net.minecraft.server.v1_8_R3.EntityAnimal (implements net.minecraft.server.v1_8_R3.IAnimal) +
                  +
                • net.minecraft.server.v1_8_R3.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_8_R3.EntityMonster (implements net.minecraft.server.v1_8_R3.IMonster) +
                +
              • net.minecraft.server.v1_8_R3.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_8_R3.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-use.html new file mode 100644 index 000000000..7f20807e9 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_8_R3/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomRabbit.html new file mode 100644 index 000000000..63c629111 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomRabbit.html @@ -0,0 +1,486 @@ + + + + + + +CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1
+

Class CustomRabbit

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_9_R1.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_9_R1.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_9_R1.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_9_R1.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_9_R1.EntityAgeable
            • +
            • +
                +
              • net.minecraft.server.v1_9_R1.EntityAnimal
              • +
              • +
                  +
                • net.minecraft.server.v1_9_R1.EntityRabbit
                • +
                • +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit
                  • +
                  +
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_9_R1.IAnimal, net.minecraft.server.v1_9_R1.ICommandListener
    +
    +
    +
    +
    public final class CustomRabbit
    +extends net.minecraft.server.v1_9_R1.EntityRabbit
    +implements CustomEntity
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_9_R1.EntityRabbit

        +net.minecraft.server.v1_9_R1.EntityRabbit.ControllerJumpRabbit, net.minecraft.server.v1_9_R1.EntityRabbit.GroupDataRabbit
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_9_R1.EntityInsentient

        +net.minecraft.server.v1_9_R1.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.EntityAnimal

        +by
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.EntityAgeable

        +a, ageLocked, b, c
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.EntityCreature

        +bt, bu
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.EntityInsentient

        +a_, b_, canPickUpLoot, dropChanceArmor, dropChanceHand, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.EntityLiving

        +aB, aC, aD, aE, aF, aG, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, as, at, aT, au, av, aV, aw, aW, aX, ay, aY, az, aZ, ba, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, collides, combatTracker, craftAttributes, deathTicks, effects, expToDrop, HEALTH, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.Entity

        +aa, ab, ac, activatedTick, activationType, ad, ah, ak, al, an, ao, ap, attachedToPlayer, B, bukkitEntity, C, datawatcher, dead, defaultActivationState, dimension, E, fallDistance, fireProof, fireTicks, forceExplosionKnockback, fromMobSpawner, glowing, i, I, impulse, inWater, j, J, justCreated, K, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noclip, noDamageTicks, numCollisions, O, onGround, P, passengers, pitch, portalCooldown, positionChanged, projectileSource, R, random, ticksLived, tickTimer, uniqueID, valid, velocityChanged, width, world, yaw
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomRabbit(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomRabbit(net.minecraft.server.v1_9_R1.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected net.minecraft.server.v1_9_R1.SoundEffectda() 
      org.bukkit.entity.RabbitgetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityRabbit

        +a, a, al, B, b, b, bR, bS, bz, c, cg, ch, createChild, cZ, damageEntity, dc, e, G, getRabbitType, i, initAttributes, initializePathFinderGoals, J, k, M, n, prepare, r, setRabbitType
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityAnimal

        +a, a, a, ax, C, c, cF, getBreedCause, getExpValue, isInLove, isTypeNotPersistent, mate, resetLove
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityAgeable

        +a, a, getAge, inactiveTick, isBaby, o, setAge, setAge, setAgeRaw, setSize
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityCreature

        +a, cO, cT, cU, cV, cW, cX, cY, f, q
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityInsentient

        +a, a, a, a, a, a, a, a, a, a, a, aE, aW, B, b, b, b, c, c, c, canSpawn, cE, cJ, cK, cL, cM, co, cr, cR, cS, D, d, d, doSpawnEffect, doTick, dropDeathLoot, dropEquipment, getArmorItems, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getGoalTarget, getLeashHolder, getLoot, getNavigation, h, isLeashed, isPersistent, L, l, l, m, m, N, n, o, p, s, setGoalTarget, setGoalTarget, setLeashHolder, setSlot, U, unleash
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityLiving

        +a_, a, a, A, a, a, a, a, a, a, a, aB, addEffect, alwaysGivesExp, ao, applyArmorModifier, applyMagicModifier, aw, b, b, b, b, bB, bC, bH, bI, bJ, bK, bM, bP, bV, bX, bY, C, c, c, cB, cd, cD, ce, cf, ci, cj, ck, clearActiveItem, cn, cq, cs, ct, cu, cv, cw, cx, cz, d, d, damageArmor, damageEntity0, die, e, e, enterCombat, exitCombat, F, f, g, getAbsorptionHearts, getArmorStrength, getAttributeInstance, getAttributeMap, getCombatTracker, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getItemInMainHand, getItemInOffHand, getLastDamager, getMaxHealth, getMonsterType, getRandom, h, hasEffect, hasLineOfSight, heal, heal, i, isAlive, isBlocking, isCollidable, isDropExperience, isInteractable, isSleeping, k, k, k, n_, Q, receive, removeAllEffects, removeEffect, setAbsorptionHearts, setHealth, setSprinting, stopRiding, tickPotionEffects, v, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aa, aA, ab, aC, ad, af, aG, ah, aj, ak, am, aM, an, aO, appendEntityCrashDetails, aQ, ar, aR, as, at, aT, aV, ay, az, b, b, b, b, b, b, bd, bj, bk, bo, bp, bq, br, bs, bt, bu, burn, burnFromLava, bv, bx, by, c, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, die, e, e, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, f, f, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getFlag, getHeadHeight, getId, getName, getPortalDirection, getPortalOffset, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getVehicle, getWorld, h, H, h, h, hasCustomName, hashCode, inBlock, isBurning, isFireProof, isIgnoreBlockTrigger, isInvisible, isInvulnerable, isInWater, isPassenger, isSneaking, isSprinting, isVehicle, j, j, j, k, move, n, o, onLightningStrike, P, p, playStepSound, q, r, recalcPosition, s, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setEquipment, setFlag, setInvisible, setLocation, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSneaking, setYawPitch, spawnIn, startRiding, t, teleportTo, toString, u, V, v, w, x, y, z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(net.minecraft.server.v1_9_R1.World world)
        +
      • +
      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        da

        +
        protected net.minecraft.server.v1_9_R1.SoundEffect da()
        +
        +
        Overrides:
        +
        da in class net.minecraft.server.v1_9_R1.EntityRabbit
        +
        +
      • +
      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.Rabbit getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomZombie.html new file mode 100644 index 000000000..9e1ae3d23 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/CustomZombie.html @@ -0,0 +1,470 @@ + + + + + + +CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1
+

Class CustomZombie

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_9_R1.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_9_R1.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_9_R1.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_9_R1.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_9_R1.EntityMonster
            • +
            • +
                +
              • net.minecraft.server.v1_9_R1.EntityZombie
              • +
              • +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_9_R1.IAnimal, net.minecraft.server.v1_9_R1.ICommandListener, net.minecraft.server.v1_9_R1.IMonster
    +
    +
    +
    +
    public final class CustomZombie
    +extends net.minecraft.server.v1_9_R1.EntityZombie
    +implements CustomEntity
    +
    Created by Shynixn
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_9_R1.EntityInsentient

        +net.minecraft.server.v1_9_R1.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.EntityZombie

        +a
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.EntityCreature

        +bt, bu
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.EntityInsentient

        +a_, b_, canPickUpLoot, dropChanceArmor, dropChanceHand, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.EntityLiving

        +aB, aC, aD, aE, aF, aG, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, as, at, aT, au, av, aV, aw, aW, aX, ay, aY, az, aZ, ba, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, collides, combatTracker, craftAttributes, deathTicks, effects, expToDrop, HEALTH, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R1.Entity

        +aa, ab, ac, activatedTick, activationType, ad, ah, ak, al, an, ao, ap, attachedToPlayer, B, bukkitEntity, C, datawatcher, dead, defaultActivationState, dimension, E, fallDistance, fireProof, fireTicks, forceExplosionKnockback, fromMobSpawner, glowing, i, I, impulse, inWater, j, J, justCreated, K, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noclip, noDamageTicks, numCollisions, O, onGround, P, passengers, pitch, portalCooldown, positionChanged, projectileSource, R, random, ticksLived, tickTimer, uniqueID, valid, velocityChanged, width, world, yaw
      • +
      +
        +
      • + + +

        Fields inherited from interface net.minecraft.server.v1_9_R1.IMonster

        +d, e
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomZombie(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomZombie(net.minecraft.server.v1_9_R1.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected voida(net.minecraft.server.v1_9_R1.BlockPosition blockposition, + net.minecraft.server.v1_9_R1.Block block) 
      org.bukkit.entity.LivingEntitygetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityZombie

        +a, a, a, a, a, a, ax, B, b, b, b, bR, bS, c, clearVillagerType, damageEntity, dc, dh, die, G, getConversionTime, getExpValue, getHeadHeight, getMonsterType, getVillagerType, i, initAttributes, isBaby, isConverting, isTypeNotPersistent, isVillager, J, m, n, o, o, prepare, q, r, setBaby, setSize, setVillagerType
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityMonster

        +a, aa, ab, bz, cF, e, isDropExperience, s_
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityCreature

        +a, cO, cT, cU, cV, cW, cX, cY, f, q
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityInsentient

        +a, a, a, a, a, a, a, a, a, a, aE, aW, B, b, b, b, C, c, c, canSpawn, cE, cJ, cK, cL, cM, co, cr, cR, cS, D, d, d, doSpawnEffect, doTick, dropDeathLoot, dropEquipment, getArmorItems, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getGoalTarget, getLeashHolder, getLoot, getNavigation, h, isLeashed, isPersistent, L, l, l, M, m, N, n, o, p, s, setGoalTarget, setGoalTarget, setLeashHolder, setSlot, U, unleash
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.EntityLiving

        +a_, a, a, A, a, a, a, a, a, a, a, aB, addEffect, alwaysGivesExp, ao, applyArmorModifier, applyMagicModifier, aw, b, b, b, b, bB, bC, bH, bI, bJ, bK, bM, bP, bV, bX, bY, C, c, c, cB, cd, cD, ce, cf, cg, ch, ci, cj, ck, clearActiveItem, cn, cq, cs, ct, cu, cv, cw, cx, cz, d, d, damageArmor, damageEntity0, e, enterCombat, exitCombat, F, f, g, getAbsorptionHearts, getArmorStrength, getAttributeInstance, getAttributeMap, getCombatTracker, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getItemInMainHand, getItemInOffHand, getLastDamager, getMaxHealth, getRandom, h, hasEffect, hasLineOfSight, heal, heal, i, inactiveTick, isAlive, isBlocking, isCollidable, isInteractable, isSleeping, k, k, k, k, n_, Q, receive, removeAllEffects, removeEffect, setAbsorptionHearts, setHealth, setSprinting, stopRiding, tickPotionEffects, v, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R1.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aA, aC, ad, af, aG, ah, aj, ak, al, am, aM, an, aO, appendEntityCrashDetails, aQ, ar, aR, as, at, aT, aV, ay, az, b, b, b, b, b, bd, bj, bk, bo, bp, bq, br, bs, bt, bu, burn, burnFromLava, bv, bx, by, c, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, die, e, e, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, f, f, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getFlag, getId, getName, getPortalDirection, getPortalOffset, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getVehicle, getWorld, h, H, h, h, hasCustomName, hashCode, inBlock, isBurning, isFireProof, isIgnoreBlockTrigger, isInvisible, isInvulnerable, isInWater, isPassenger, isSneaking, isSprinting, isVehicle, j, j, j, k, move, n, o, onLightningStrike, P, p, playStepSound, q, r, recalcPosition, s, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setEquipment, setFlag, setInvisible, setLocation, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSneaking, setYawPitch, spawnIn, startRiding, t, teleportTo, toString, u, V, v, w, x, y, z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(net.minecraft.server.v1_9_R1.World world)
        +
      • +
      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        a

        +
        protected void a(net.minecraft.server.v1_9_R1.BlockPosition blockposition,
        +                 net.minecraft.server.v1_9_R1.Block block)
        +
        +
        Overrides:
        +
        a in class net.minecraft.server.v1_9_R1.EntityZombie
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.LivingEntity getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/Listener19.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/Listener19.html new file mode 100644 index 000000000..6ecd63c07 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/Listener19.html @@ -0,0 +1,299 @@ + + + + + + +Listener19 (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1
+

Class Listener19

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    org.bukkit.event.Listener
    +
    +
    +
    +
    public final class Listener19
    +extends SimpleListener
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Listener19

        +
        public Listener19(List<org.bukkit.entity.Player> carryingPet,
        +                  org.bukkit.plugin.Plugin plugin)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        onPlayerSwapItems

        +
        public void onPlayerSwapItems(org.bukkit.event.player.PlayerSwapHandItemsEvent event)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/OwnerPathfinder.html new file mode 100644 index 000000000..2897ea7ba --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/OwnerPathfinder.html @@ -0,0 +1,336 @@ + + + + + + +OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1
+

Class OwnerPathfinder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_9_R1.PathfinderGoal
    • +
    • +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class OwnerPathfinder
    +extends net.minecraft.server.v1_9_R1.PathfinderGoal
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        OwnerPathfinder

        +
        public OwnerPathfinder(net.minecraft.server.v1_9_R1.EntityInsentient entitycreature,
        +                       org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        a

        +
        public boolean a()
        +
        +
        Specified by:
        +
        a in class net.minecraft.server.v1_9_R1.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        c

        +
        public void c()
        +
        +
        Overrides:
        +
        c in class net.minecraft.server.v1_9_R1.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        public static boolean isUnbreakable(org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        setItemstackTag

        +
        public static org.bukkit.inventory.ItemStack setItemstackTag(org.bukkit.inventory.ItemStack itemStack,
        +                                                             Map<String,Object> tags)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/CustomRabbit.html new file mode 100644 index 000000000..c2105275b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/CustomRabbit.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/CustomZombie.html new file mode 100644 index 000000000..8e28cdaca --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/CustomZombie.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/Listener19.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/Listener19.html new file mode 100644 index 000000000..bda945a4f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/Listener19.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.Listener19 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.Listener19

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.Listener19
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/OwnerPathfinder.html new file mode 100644 index 000000000..9d51593fc --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/class-use/OwnerPathfinder.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-frame.html new file mode 100644 index 000000000..a12af6c27 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-frame.html @@ -0,0 +1,24 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1 (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-summary.html new file mode 100644 index 000000000..3fa74a8ac --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-summary.html @@ -0,0 +1,158 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-tree.html new file mode 100644 index 000000000..06399be85 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-tree.html @@ -0,0 +1,186 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1 Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • net.minecraft.server.v1_9_R1.Entity (implements net.minecraft.server.v1_9_R1.ICommandListener) +
        +
      • net.minecraft.server.v1_9_R1.EntityLiving +
          +
        • net.minecraft.server.v1_9_R1.EntityInsentient +
            +
          • net.minecraft.server.v1_9_R1.EntityCreature +
              +
            • net.minecraft.server.v1_9_R1.EntityAgeable +
                +
              • net.minecraft.server.v1_9_R1.EntityAnimal (implements net.minecraft.server.v1_9_R1.IAnimal) +
                  +
                • net.minecraft.server.v1_9_R1.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_9_R1.EntityMonster (implements net.minecraft.server.v1_9_R1.IMonster) +
                +
              • net.minecraft.server.v1_9_R1.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_9_R1.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder
      • +
      +
    • +
    • com.github.shynixn.petblocks.lib.SimpleListener (implements org.bukkit.event.Listener) +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.Listener19
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-use.html new file mode 100644 index 000000000..4f589c9f7 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R1/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomRabbit.html new file mode 100644 index 000000000..df2762540 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomRabbit.html @@ -0,0 +1,486 @@ + + + + + + +CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2
+

Class CustomRabbit

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_9_R2.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_9_R2.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_9_R2.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_9_R2.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_9_R2.EntityAgeable
            • +
            • +
                +
              • net.minecraft.server.v1_9_R2.EntityAnimal
              • +
              • +
                  +
                • net.minecraft.server.v1_9_R2.EntityRabbit
                • +
                • +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit
                  • +
                  +
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_9_R2.IAnimal, net.minecraft.server.v1_9_R2.ICommandListener
    +
    +
    +
    +
    public final class CustomRabbit
    +extends net.minecraft.server.v1_9_R2.EntityRabbit
    +implements CustomEntity
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_9_R2.EntityRabbit

        +net.minecraft.server.v1_9_R2.EntityRabbit.ControllerJumpRabbit, net.minecraft.server.v1_9_R2.EntityRabbit.GroupDataRabbit
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_9_R2.EntityInsentient

        +net.minecraft.server.v1_9_R2.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.EntityAnimal

        +bz
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.EntityAgeable

        +a, ageLocked, b, c
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.EntityCreature

        +bu, bv
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.EntityInsentient

        +a_, b_, canPickUpLoot, dropChanceArmor, dropChanceHand, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.EntityLiving

        +aA, aC, aD, aE, aF, aG, aH, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, at, au, aU, av, aw, aW, ax, aX, aY, az, aZ, ba, bb, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, collides, combatTracker, craftAttributes, deathTicks, effects, expToDrop, HEALTH, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.Entity

        +aa, ab, ac, activatedTick, activationType, ad, ah, ak, al, an, ao, ap, ar, attachedToPlayer, B, bukkitEntity, C, datawatcher, dead, defaultActivationState, dimension, E, fallDistance, fireProof, fireTicks, forceExplosionKnockback, fromMobSpawner, glowing, i, I, impulse, inWater, j, J, justCreated, K, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noclip, noDamageTicks, numCollisions, O, onGround, P, passengers, pitch, portalCooldown, positionChanged, projectileSource, R, random, ticksLived, tickTimer, uniqueID, valid, velocityChanged, width, world, yaw
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomRabbit(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomRabbit(net.minecraft.server.v1_9_R2.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected net.minecraft.server.v1_9_R2.SoundEffectdb() 
      org.bukkit.entity.RabbitgetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityRabbit

        +a, a, al, B, b, b, bA, bS, bT, c, ch, ci, createChild, da, damageEntity, dd, e, G, getRabbitType, i, initAttributes, initializePathFinderGoals, J, k, M, n, prepare, r, setRabbitType
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityAnimal

        +a, a, a, ax, C, c, cG, getBreedCause, getExpValue, isInLove, isTypeNotPersistent, mate, resetLove
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityAgeable

        +a, a, getAge, inactiveTick, isBaby, o, setAge, setAge, setAgeRaw, setSize
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityCreature

        +a, cP, cU, cV, cW, cX, cY, cZ, f, q
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityInsentient

        +a, a, a, a, a, a, a, a, a, a, a, aE, aW, B, b, b, b, c, c, c, canSpawn, cF, cK, cL, cM, cN, cp, cT, D, d, d, doSpawnEffect, doTick, dropDeathLoot, dropEquipment, getArmorItems, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getGoalTarget, getLeashHolder, getLoot, getMainHand, getNavigation, h, hasAI, isLeashed, isPersistent, L, l, l, m, N, n, o, p, s, setAI, setGoalTarget, setGoalTarget, setLeashHolder, setSlot, U, unleash
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityLiving

        +a_, a, a, A, a, a, a, a, a, a, a, aB, addEffect, alwaysGivesExp, ao, applyArmorModifier, applyMagicModifier, aw, b, b, b, b, bC, bD, bI, bJ, bK, bL, bN, bQ, bW, bY, bZ, C, c, c, cA, cC, ce, cE, cf, cg, cj, ck, cl, clearActiveItem, co, cr, ct, cu, cv, cw, cx, cy, d, d, damageArmor, damageEntity0, die, e, e, enterCombat, exitCombat, F, f, g, getAbsorptionHearts, getArmorStrength, getAttributeInstance, getAttributeMap, getCombatTracker, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getItemInMainHand, getItemInOffHand, getLastDamager, getMaxHealth, getMonsterType, getRandom, h, hasEffect, hasLineOfSight, heal, heal, i, isAlive, isBlocking, isCollidable, isDropExperience, isInteractable, isSleeping, k, k, k, n_, Q, receive, removeAllEffects, removeEffect, setAbsorptionHearts, setHealth, setSprinting, stopRiding, tickPotionEffects, v, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aa, aA, ab, aC, ad, af, aG, ah, aj, ak, am, aM, an, aO, appendEntityCrashDetails, aQ, ar, aR, as, at, aT, aV, ay, az, b, b, b, b, b, b, bd, be, bk, bl, bp, bq, br, bs, bt, bu, burn, burnFromLava, bv, bw, by, bz, c, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, die, e, e, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, f, f, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getFlag, getHeadHeight, getId, getName, getPortalDirection, getPortalOffset, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getVehicle, getWorld, h, H, h, hasCustomName, hashCode, inBlock, isBurning, isFireProof, isIgnoreBlockTrigger, isInvisible, isInvulnerable, isInWater, isPassenger, isSneaking, isSprinting, isVehicle, j, j, j, k, move, n, o, onLightningStrike, P, p, playStepSound, q, r, recalcPosition, s, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setEquipment, setFlag, setInvisible, setInvulnerable, setLocation, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSneaking, setYawPitch, spawnIn, startRiding, t, teleportTo, toString, u, V, v, w, x, y, z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(net.minecraft.server.v1_9_R2.World world)
        +
      • +
      + + + +
        +
      • +

        CustomRabbit

        +
        public CustomRabbit(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        db

        +
        protected net.minecraft.server.v1_9_R2.SoundEffect db()
        +
        +
        Overrides:
        +
        db in class net.minecraft.server.v1_9_R2.EntityRabbit
        +
        +
      • +
      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.Rabbit getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomZombie.html new file mode 100644 index 000000000..1087fe720 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/CustomZombie.html @@ -0,0 +1,470 @@ + + + + + + +CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2
+

Class CustomZombie

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_9_R2.Entity
    • +
    • +
        +
      • net.minecraft.server.v1_9_R2.EntityLiving
      • +
      • +
          +
        • net.minecraft.server.v1_9_R2.EntityInsentient
        • +
        • +
            +
          • net.minecraft.server.v1_9_R2.EntityCreature
          • +
          • +
              +
            • net.minecraft.server.v1_9_R2.EntityMonster
            • +
            • +
                +
              • net.minecraft.server.v1_9_R2.EntityZombie
              • +
              • +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    CustomEntity, net.minecraft.server.v1_9_R2.IAnimal, net.minecraft.server.v1_9_R2.ICommandListener, net.minecraft.server.v1_9_R2.IMonster
    +
    +
    +
    +
    public final class CustomZombie
    +extends net.minecraft.server.v1_9_R2.EntityZombie
    +implements CustomEntity
    +
    Created by Shynixn
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class net.minecraft.server.v1_9_R2.EntityInsentient

        +net.minecraft.server.v1_9_R2.EntityInsentient.EnumEntityPositionType
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.EntityZombie

        +a
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.EntityCreature

        +bu, bv
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.EntityInsentient

        +a_, b_, canPickUpLoot, dropChanceArmor, dropChanceHand, g, goalSelector, moveController, navigation, persistent, targetSelector
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.EntityLiving

        +aA, aC, aD, aE, aF, aG, aH, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, at, au, aU, av, aw, aW, ax, aX, aY, az, aZ, ba, bb, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, collides, combatTracker, craftAttributes, deathTicks, effects, expToDrop, HEALTH, hurtTicks, hurtTimestamp, killer, lastDamage, lastDamageByPlayerTime, lastDamager, maxAirTicks, maxNoDamageTicks, ticksFarFromPlayer, updateEffects
      • +
      +
        +
      • + + +

        Fields inherited from class net.minecraft.server.v1_9_R2.Entity

        +aa, ab, ac, activatedTick, activationType, ad, ah, ak, al, an, ao, ap, ar, attachedToPlayer, B, bukkitEntity, C, datawatcher, dead, defaultActivationState, dimension, E, fallDistance, fireProof, fireTicks, forceExplosionKnockback, fromMobSpawner, glowing, i, I, impulse, inWater, j, J, justCreated, K, lastPitch, lastX, lastY, lastYaw, lastZ, length, locX, locY, locZ, M, maxFireTicks, motX, motY, motZ, N, noclip, noDamageTicks, numCollisions, O, onGround, P, passengers, pitch, portalCooldown, positionChanged, projectileSource, R, random, ticksLived, tickTimer, uniqueID, valid, velocityChanged, width, world, yaw
      • +
      +
        +
      • + + +

        Fields inherited from interface net.minecraft.server.v1_9_R2.IMonster

        +d, e
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CustomZombie(org.bukkit.entity.Player player, + PetMeta meta) 
      CustomZombie(net.minecraft.server.v1_9_R2.World world) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected voida(net.minecraft.server.v1_9_R2.BlockPosition blockposition, + net.minecraft.server.v1_9_R2.Block block) 
      org.bukkit.entity.LivingEntitygetSpigotEntity() 
      voidspawn(org.bukkit.Location location) 
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityZombie

        +a, a, a, a, a, a, ax, B, b, b, b, bS, bT, c, clearVillagerType, damageEntity, dd, di, die, G, getConversionTime, getExpValue, getHeadHeight, getMonsterType, getVillagerType, i, initAttributes, isBaby, isConverting, isTypeNotPersistent, isVillager, J, m, n, o, o, prepare, q, r, setBaby, setSize, setVillagerType
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityMonster

        +a, aa, ab, bA, cG, e, isDropExperience, s_
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityCreature

        +a, cP, cU, cV, cW, cX, cY, cZ, f, q
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityInsentient

        +a, a, a, a, a, a, a, a, a, a, aE, aW, B, b, b, b, C, c, c, canSpawn, cF, cK, cL, cM, cN, cp, cT, D, d, d, doSpawnEffect, doTick, dropDeathLoot, dropEquipment, getArmorItems, getControllerJump, getControllerLook, getControllerMove, getEntitySenses, getEquipment, getGoalTarget, getLeashHolder, getLoot, getMainHand, getNavigation, h, hasAI, isLeashed, isPersistent, L, l, l, M, N, n, o, p, s, setAI, setGoalTarget, setGoalTarget, setLeashHolder, setSlot, U, unleash
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.EntityLiving

        +a_, a, a, A, a, a, a, a, a, a, a, aB, addEffect, alwaysGivesExp, ao, applyArmorModifier, applyMagicModifier, aw, b, b, b, b, bC, bD, bI, bJ, bK, bL, bN, bQ, bW, bY, bZ, C, c, c, cA, cC, ce, cE, cf, cg, ch, ci, cj, ck, cl, clearActiveItem, co, cr, ct, cu, cv, cw, cx, cy, d, d, damageArmor, damageEntity0, e, enterCombat, exitCombat, F, f, g, getAbsorptionHearts, getArmorStrength, getAttributeInstance, getAttributeMap, getCombatTracker, getEffect, getEffects, getExpReward, getHeadRotation, getHealth, getItemInMainHand, getItemInOffHand, getLastDamager, getMaxHealth, getRandom, h, hasEffect, hasLineOfSight, heal, heal, i, inactiveTick, isAlive, isBlocking, isCollidable, isInteractable, isSleeping, k, k, k, k, n_, Q, receive, removeAllEffects, removeEffect, setAbsorptionHearts, setHealth, setSprinting, stopRiding, tickPotionEffects, v, Y, z
      • +
      +
        +
      • + + +

        Methods inherited from class net.minecraft.server.v1_9_R2.Entity

        +a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, aA, aC, ad, af, aG, ah, aj, ak, al, am, aM, an, aO, appendEntityCrashDetails, aQ, ar, aR, as, at, aT, aV, ay, az, b, b, b, b, b, bd, be, bk, bl, bp, bq, br, bs, bt, bu, burn, burnFromLava, bv, bw, by, bz, c, c, c, c, c, c, checkBlockCollisions, collide, d, d, d, d, die, e, e, e, e, enderTeleportTo, equals, extinguish, f, f, f, f, f, f, g, g, getAirTicks, getBoundingBox, getBukkitEntity, getChunkCoordinates, getCustomName, getCustomNameVisible, getDataWatcher, getDirection, getFlag, getId, getName, getPortalDirection, getPortalOffset, getScoreboardDisplayName, getSendCommandFeedback, getUniqueID, getVehicle, getWorld, h, H, h, hasCustomName, hashCode, inBlock, isBurning, isFireProof, isIgnoreBlockTrigger, isInvisible, isInvulnerable, isInWater, isPassenger, isSneaking, isSprinting, isVehicle, j, j, j, k, move, n, o, onLightningStrike, P, p, playStepSound, q, r, recalcPosition, s, sendMessage, setAirTicks, setCustomName, setCustomNameVisible, setEquipment, setFlag, setInvisible, setInvulnerable, setLocation, setOnFire, setPosition, setPositionRotation, setPositionRotation, setSneaking, setYawPitch, spawnIn, startRiding, t, teleportTo, toString, u, V, v, w, x, y, z
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(net.minecraft.server.v1_9_R2.World world)
        +
      • +
      + + + +
        +
      • +

        CustomZombie

        +
        public CustomZombie(org.bukkit.entity.Player player,
        +                    PetMeta meta)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        spawn

        +
        public void spawn(org.bukkit.Location location)
        +
        +
        Specified by:
        +
        spawn in interface CustomEntity
        +
        +
      • +
      + + + +
        +
      • +

        a

        +
        protected void a(net.minecraft.server.v1_9_R2.BlockPosition blockposition,
        +                 net.minecraft.server.v1_9_R2.Block block)
        +
        +
        Overrides:
        +
        a in class net.minecraft.server.v1_9_R2.EntityZombie
        +
        +
      • +
      + + + +
        +
      • +

        getSpigotEntity

        +
        public org.bukkit.entity.LivingEntity getSpigotEntity()
        +
        +
        Specified by:
        +
        getSpigotEntity in interface CustomEntity
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/OwnerPathfinder.html new file mode 100644 index 000000000..a9ad1d0e8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/OwnerPathfinder.html @@ -0,0 +1,336 @@ + + + + + + +OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2
+

Class OwnerPathfinder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • net.minecraft.server.v1_9_R2.PathfinderGoal
    • +
    • +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class OwnerPathfinder
    +extends net.minecraft.server.v1_9_R2.PathfinderGoal
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        OwnerPathfinder

        +
        public OwnerPathfinder(net.minecraft.server.v1_9_R2.EntityInsentient entitycreature,
        +                       org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        a

        +
        public boolean a()
        +
        +
        Specified by:
        +
        a in class net.minecraft.server.v1_9_R2.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        c

        +
        public void c()
        +
        +
        Overrides:
        +
        c in class net.minecraft.server.v1_9_R2.PathfinderGoal
        +
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        public static boolean isUnbreakable(org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      + + + +
        +
      • +

        setItemstackTag

        +
        public static org.bukkit.inventory.ItemStack setItemstackTag(org.bukkit.inventory.ItemStack itemStack,
        +                                                             Map<String,Object> tags)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/CustomRabbit.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/CustomRabbit.html new file mode 100644 index 000000000..b9c1551f7 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/CustomRabbit.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/CustomZombie.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/CustomZombie.html new file mode 100644 index 000000000..ce57565e9 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/CustomZombie.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/OwnerPathfinder.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/OwnerPathfinder.html new file mode 100644 index 000000000..c92d40da5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/class-use/OwnerPathfinder.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-frame.html new file mode 100644 index 000000000..f5f4c9925 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-frame.html @@ -0,0 +1,23 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2 (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-summary.html new file mode 100644 index 000000000..f7f45b9d2 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-summary.html @@ -0,0 +1,154 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-tree.html new file mode 100644 index 000000000..52616a257 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-tree.html @@ -0,0 +1,181 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2 Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • net.minecraft.server.v1_9_R2.Entity (implements net.minecraft.server.v1_9_R2.ICommandListener) +
        +
      • net.minecraft.server.v1_9_R2.EntityLiving +
          +
        • net.minecraft.server.v1_9_R2.EntityInsentient +
            +
          • net.minecraft.server.v1_9_R2.EntityCreature +
              +
            • net.minecraft.server.v1_9_R2.EntityAgeable +
                +
              • net.minecraft.server.v1_9_R2.EntityAnimal (implements net.minecraft.server.v1_9_R2.IAnimal) +
                  +
                • net.minecraft.server.v1_9_R2.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_9_R2.EntityMonster (implements net.minecraft.server.v1_9_R2.IMonster) +
                +
              • net.minecraft.server.v1_9_R2.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_9_R2.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-use.html new file mode 100644 index 000000000..43f740513 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/nms/v1_9_R2/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2

+
+
No usage of com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-frame.html new file mode 100644 index 000000000..8194597c1 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.bukkit

+
+

Classes

+ +
+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-summary.html new file mode 100644 index 000000000..88f8dbd88 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-summary.html @@ -0,0 +1,144 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.bukkit

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    PetBlocksPlugin 
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-tree.html new file mode 100644 index 000000000..508c5adc5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-tree.html @@ -0,0 +1,147 @@ + + + + + + +com.github.shynixn.petblocks.business.bukkit Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.bukkit

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • org.bukkit.plugin.PluginBase (implements org.bukkit.plugin.Plugin) +
        +
      • org.bukkit.plugin.java.JavaPlugin + +
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-use.html new file mode 100644 index 000000000..9583cb017 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/bukkit/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.bukkit (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.bukkit

+
+
No usage of com.github.shynixn.petblocks.business.bukkit
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/class-use/Config.html b/docs/apidocs/com/github/shynixn/petblocks/business/class-use/Config.html new file mode 100644 index 000000000..9521720db --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/class-use/Config.html @@ -0,0 +1,166 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.Config (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.Config

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/class-use/Language.html b/docs/apidocs/com/github/shynixn/petblocks/business/class-use/Language.html new file mode 100644 index 000000000..f500da0d7 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/class-use/Language.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.Language (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.Language

+
+
No usage of com.github.shynixn.petblocks.business.Language
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/class-use/Permission.html b/docs/apidocs/com/github/shynixn/petblocks/business/class-use/Permission.html new file mode 100644 index 000000000..9e59ebddd --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/class-use/Permission.html @@ -0,0 +1,214 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.Permission (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.Permission

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.html new file mode 100644 index 000000000..2ac9f6206 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/PetBlockManager.html @@ -0,0 +1,331 @@ + + + + + + +PetBlockManager (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.business
+

Class PetBlockManager

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.logic.business.PetBlockManager
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class PetBlockManager
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetBlockManager

        +
        public PetBlockManager(PetDataManager dataManager,
        +                       org.bukkit.plugin.Plugin plugin)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        hasPetBlock

        +
        public boolean hasPetBlock(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        getPetBlock

        +
        public PetBlock getPetBlock(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        setPetBlock

        +
        public void setPetBlock(org.bukkit.entity.Player player,
        +                        PetMeta petMeta,
        +                        int delay)
        +
      • +
      + + + +
        +
      • +

        removePetBlock

        +
        public void removePetBlock(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        killAll

        +
        public void killAll()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/PetDataManager.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/PetDataManager.html new file mode 100644 index 000000000..a9bd2d68e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/PetDataManager.html @@ -0,0 +1,327 @@ + + + + + + +PetDataManager (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.business
+

Class PetDataManager

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.logic.business.PetDataManager
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class PetDataManager
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetDataManager

        +
        public PetDataManager(org.bukkit.plugin.Plugin plugin)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        createPetMeta

        +
        public PetMeta createPetMeta(org.bukkit.entity.Player player,
        +                             PetType petType)
        +
      • +
      + + + +
        +
      • +

        persist

        +
        public void persist(PetMeta petMeta)
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public void remove(PetMeta petMeta)
        +
      • +
      + + + +
        +
      • +

        getPetMeta

        +
        public PetMeta getPetMeta(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        hasPetMeta

        +
        public boolean hasPetMeta(org.bukkit.entity.Player player)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/class-use/PetBlockManager.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/class-use/PetBlockManager.html new file mode 100644 index 000000000..fbfdcb64f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/class-use/PetBlockManager.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.business.PetBlockManager (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.business.PetBlockManager

+
+
No usage of com.github.shynixn.petblocks.business.logic.business.PetBlockManager
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/class-use/PetDataManager.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/class-use/PetDataManager.html new file mode 100644 index 000000000..f8ce24c17 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/class-use/PetDataManager.html @@ -0,0 +1,165 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.business.PetDataManager (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.business.PetDataManager

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-frame.html new file mode 100644 index 000000000..ff45cc7d8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-frame.html @@ -0,0 +1,22 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.business (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.logic.business

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-summary.html new file mode 100644 index 000000000..2a01c90a6 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-summary.html @@ -0,0 +1,148 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.business (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.logic.business

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-tree.html new file mode 100644 index 000000000..bae43faac --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-tree.html @@ -0,0 +1,140 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.business Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.logic.business

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-use.html new file mode 100644 index 000000000..e9aed5042 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/business/package-use.html @@ -0,0 +1,159 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.logic.business (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.logic.business

+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigCommands.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigCommands.html new file mode 100644 index 000000000..c7bae3b9b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigCommands.html @@ -0,0 +1,279 @@ + + + + + + +ConfigCommands (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.configuration
+

Class ConfigCommands

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ConfigCommands
    +extends Object
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.html new file mode 100644 index 000000000..30d715c90 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigGUI.html @@ -0,0 +1,591 @@ + + + + + + +ConfigGUI (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.configuration
+

Class ConfigGUI

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class ConfigGUI
    +extends Object
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInstance

        +
        public static ConfigGUI getInstance()
        +
      • +
      + + + +
        +
      • +

        load

        +
        public void load(org.bukkit.configuration.file.FileConfiguration c)
        +
      • +
      + + + + + + + +
        +
      • +

        getItems_soundEnabledContainer

        +
        public ItemContainer getItems_soundEnabledContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_soundDisabledContainer

        +
        public ItemContainer getItems_soundDisabledContainer()
        +
      • +
      + + + +
        +
      • +

        getColoredItemStacks

        +
        public org.bukkit.inventory.ItemStack[] getColoredItemStacks()
        +
      • +
      + + + +
        +
      • +

        getDefaultItemStacks

        +
        public org.bukkit.inventory.ItemStack[] getDefaultItemStacks()
        +
      • +
      + + + +
        +
      • +

        getCustomItemStacks

        +
        public org.bukkit.inventory.ItemStack[] getCustomItemStacks()
        +
      • +
      + + + +
        +
      • +

        getGeneral_myContainer

        +
        public ItemContainer getGeneral_myContainer()
        +
      • +
      + + + +
        +
      • +

        getGeneral_emptyslotContainer

        +
        public ItemContainer getGeneral_emptyslotContainer()
        +
      • +
      + + + +
        +
      • +

        getGeneral_previouspageContainer

        +
        public ItemContainer getGeneral_previouspageContainer()
        +
      • +
      + + + +
        +
      • +

        getGeneral_nextpageContainer

        +
        public ItemContainer getGeneral_nextpageContainer()
        +
      • +
      + + + +
        +
      • +

        isSettings_copyskin

        +
        public boolean isSettings_copyskin()
        +
      • +
      + + + +
        +
      • +

        isSettings_clickemptyback

        +
        public boolean isSettings_clickemptyback()
        +
      • +
      + + + +
        +
      • +

        getGeneral_defaultAppearanceContainer

        +
        public ItemContainer getGeneral_defaultAppearanceContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_defaultcostumeContainer

        +
        public ItemContainer getItems_defaultcostumeContainer()
        +
      • +
      + + + +
        +
      • +

        getGeneral_enablePetContainer

        +
        public ItemContainer getGeneral_enablePetContainer()
        +
      • +
      + + + +
        +
      • +

        getGeneral_disablePetContainer

        +
        public ItemContainer getGeneral_disablePetContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_colorcostumeContainer

        +
        public ItemContainer getItems_colorcostumeContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_customcostumeContainer

        +
        public ItemContainer getItems_customcostumeContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_callpetContainer

        +
        public ItemContainer getItems_callpetContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_particlepetContainer

        +
        public ItemContainer getItems_particlepetContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_cancelpetContainer

        +
        public ItemContainer getItems_cancelpetContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_cannonpetContainer

        +
        public ItemContainer getItems_cannonpetContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_skullNamingContainer

        +
        public ItemContainer getItems_skullNamingContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_namingContainer

        +
        public ItemContainer getItems_namingContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_hatpetContainer

        +
        public ItemContainer getItems_hatpetContainer()
        +
      • +
      + + + +
        +
      • +

        getItems_ridingpetContainer

        +
        public ItemContainer getItems_ridingpetContainer()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.html new file mode 100644 index 000000000..65fc56a65 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigParticle.html @@ -0,0 +1,279 @@ + + + + + + +ConfigParticle (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.configuration
+

Class ConfigParticle

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ConfigParticle
    +extends Object
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        getParticleItemStacks

        +
        public org.bukkit.inventory.ItemStack[] getParticleItemStacks()
        +
      • +
      + + + +
        +
      • +

        load

        +
        public void load(org.bukkit.configuration.file.FileConfiguration c)
        +
      • +
      + + + +
        +
      • +

        getParticle

        +
        public Particle getParticle(int slot)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigPet.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigPet.html new file mode 100644 index 000000000..51a6d8223 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/ConfigPet.html @@ -0,0 +1,526 @@ + + + + + + +ConfigPet (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.configuration
+

Class ConfigPet

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ConfigPet
    +extends Object
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInstance

        +
        public static ConfigPet getInstance()
        +
      • +
      + + + +
        +
      • +

        load

        +
        public void load(org.bukkit.configuration.file.FileConfiguration c)
        +
      • +
      + + + +
        +
      • +

        isAfraidOfwater

        +
        public boolean isAfraidOfwater()
        +
      • +
      + + + +
        +
      • +

        isAfraidwaterParticles

        +
        public boolean isAfraidwaterParticles()
        +
      • +
      + + + +
        +
      • +

        getAge_smallticks

        +
        public int getAge_smallticks()
        +
      • +
      + + + +
        +
      • +

        getAge_largeticks

        +
        public int getAge_largeticks()
        +
      • +
      + + + +
        +
      • +

        getAge_maxticks

        +
        public int getAge_maxticks()
        +
      • +
      + + + +
        +
      • +

        isAge_deathOnMaxTicks

        +
        public boolean isAge_deathOnMaxTicks()
        +
      • +
      + + + +
        +
      • +

        getCombat_health

        +
        public double getCombat_health()
        +
      • +
      + + + +
        +
      • +

        isCombat_invincible

        +
        public boolean isCombat_invincible()
        +
      • +
      + + + +
        +
      • +

        getFollow_maxRangeTeleport

        +
        public int getFollow_maxRangeTeleport()
        +
      • +
      + + + +
        +
      • +

        isFollow_fallOffHead

        +
        public boolean isFollow_fallOffHead()
        +
      • +
      + + + +
        +
      • +

        isFollow_carry

        +
        public boolean isFollow_carry()
        +
      • +
      + + + +
        +
      • +

        getDesign_maxPetNameLength

        +
        public int getDesign_maxPetNameLength()
        +
      • +
      + + + +
        +
      • +

        isDesign_showDamageAnimation

        +
        public boolean isDesign_showDamageAnimation()
        +
      • +
      + + + +
        +
      • +

        isDesign_allowOtherHearSound

        +
        public boolean isDesign_allowOtherHearSound()
        +
      • +
      + + + +
        +
      • +

        getModifier_petriding

        +
        public double getModifier_petriding()
        +
      • +
      + + + +
        +
      • +

        getModifier_petwalking

        +
        public double getModifier_petwalking()
        +
      • +
      + + + +
        +
      • +

        getModifier_petclimbing

        +
        public double getModifier_petclimbing()
        +
      • +
      + + + +
        +
      • +

        isFollow_wallcolliding

        +
        public boolean isFollow_wallcolliding()
        +
      • +
      + + + +
        +
      • +

        isFleesInCombat

        +
        public boolean isFleesInCombat()
        +
      • +
      + + + +
        +
      • +

        getReappearsInSeconds

        +
        public int getReappearsInSeconds()
        +
      • +
      + + + +
        +
      • +

        getWarpDelay

        +
        public int getWarpDelay()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigCommands.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigCommands.html new file mode 100644 index 000000000..545daa4a7 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigCommands.html @@ -0,0 +1,166 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigGUI.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigGUI.html new file mode 100644 index 000000000..0d4794a69 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigGUI.html @@ -0,0 +1,166 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigParticle.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigParticle.html new file mode 100644 index 000000000..698cba431 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigParticle.html @@ -0,0 +1,166 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigPet.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigPet.html new file mode 100644 index 000000000..999cb2195 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/class-use/ConfigPet.html @@ -0,0 +1,166 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.configuration.ConfigPet

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-frame.html new file mode 100644 index 000000000..67fb40a86 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-frame.html @@ -0,0 +1,24 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.configuration (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.logic.configuration

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-summary.html new file mode 100644 index 000000000..dc4b704b7 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-summary.html @@ -0,0 +1,164 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.configuration (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.logic.configuration

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-tree.html new file mode 100644 index 000000000..029fcee7f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-tree.html @@ -0,0 +1,142 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.configuration Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.logic.configuration

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands
    • +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
    • +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle
    • +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-use.html new file mode 100644 index 000000000..2a5257dc0 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/configuration/package-use.html @@ -0,0 +1,176 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.logic.configuration (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.logic.configuration

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/Factory.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/Factory.html new file mode 100644 index 000000000..62192b1ee --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/Factory.html @@ -0,0 +1,325 @@ + + + + + + +Factory (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.persistence
+

Class Factory

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.logic.persistence.Factory
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class Factory
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Factory

        +
        public Factory()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        createPlayerDataController

        +
        public static PlayerMetaController createPlayerDataController()
        +
      • +
      + + + + + + + +
        +
      • +

        createPetDataController

        +
        public static PetMetaController createPetDataController()
        +
      • +
      + + + +
        +
      • +

        disable

        +
        public static void disable()
        +
      • +
      + + + +
        +
      • +

        initialize

        +
        public static void initialize(org.bukkit.plugin.Plugin plugin)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/class-use/Factory.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/class-use/Factory.html new file mode 100644 index 000000000..2c00b25e3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/class-use/Factory.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.persistence.Factory (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.persistence.Factory

+
+
No usage of com.github.shynixn.petblocks.business.logic.persistence.Factory
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.html new file mode 100644 index 000000000..71eec91ec --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/ParticleEffectDataRepository.html @@ -0,0 +1,516 @@ + + + + + + +ParticleEffectDataRepository (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.persistence.controller
+

Class ParticleEffectDataRepository

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.html new file mode 100644 index 000000000..9c6543247 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/PetDataRepository.html @@ -0,0 +1,543 @@ + + + + + + +PetDataRepository (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.persistence.controller
+

Class PetDataRepository

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getByPlayer

        +
        public PetMeta getByPlayer(org.bukkit.entity.Player player)
        +
        Returns the petdata from the given player
        +
        +
        Specified by:
        +
        getByPlayer in interface PetMetaController
        +
        Parameters:
        +
        player - player
        +
        Returns:
        +
        petData
        +
        +
      • +
      + + + +
        +
      • +

        hasEntry

        +
        public boolean hasEntry(org.bukkit.entity.Player player)
        +
        Checks if the player has got an entry in the database
        +
        +
        Specified by:
        +
        hasEntry in interface PetMetaController
        +
        Parameters:
        +
        player - player
        +
        Returns:
        +
        hasEntry
        +
        +
      • +
      + + + + + + + +
        +
      • +

        hasId

        +
        public boolean hasId(PetMeta item)
        +
        Checks if the item has got an valid databaseId
        +
        +
        Specified by:
        +
        hasId in class DataBaseRepository<PetMeta>
        +
        Parameters:
        +
        item - item
        +
        Returns:
        +
        hasGivenId
        +
        +
      • +
      + + + + + + + + + + + + + + + +
        +
      • +

        insert

        +
        public void insert(PetMeta item)
        +
        Inserts the item into the database and sets the id
        +
        +
        Specified by:
        +
        insert in class DataBaseRepository<PetMeta>
        +
        Parameters:
        +
        item - item
        +
        +
      • +
      + + + + + + + +
        +
      • +

        size

        +
        public int size()
        +
        Returns the amount of items in the repository
        +
        +
        Specified by:
        +
        size in interface IController<PetMeta>
        +
        Returns:
        +
        size
        +
        +
      • +
      + + + +
        +
      • +

        close

        +
        public void close()
        +           throws Exception
        +
        Closes this resource, relinquishing any underlying resources. + This method is invoked automatically on objects managed by the + try-with-resources statement.
        +
        +
        Specified by:
        +
        close in interface AutoCloseable
        +
        Throws:
        +
        Exception - if this resource cannot be closed
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.html new file mode 100644 index 000000000..0e12fdced --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/PlayerDataRepository.html @@ -0,0 +1,543 @@ + + + + + + +PlayerDataRepository (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.persistence.controller
+

Class PlayerDataRepository

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/ParticleEffectDataRepository.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/ParticleEffectDataRepository.html new file mode 100644 index 000000000..45f0cac81 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/ParticleEffectDataRepository.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository

+
+
No usage of com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/PetDataRepository.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/PetDataRepository.html new file mode 100644 index 000000000..d67990a1c --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/PetDataRepository.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository

+
+
No usage of com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/PlayerDataRepository.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/PlayerDataRepository.html new file mode 100644 index 000000000..4a99b061b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/class-use/PlayerDataRepository.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository

+
+
No usage of com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-frame.html new file mode 100644 index 000000000..d7e036b20 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-frame.html @@ -0,0 +1,23 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.persistence.controller (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.logic.persistence.controller

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-summary.html new file mode 100644 index 000000000..d8e9d68b2 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-summary.html @@ -0,0 +1,156 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.persistence.controller (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.logic.persistence.controller

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-tree.html new file mode 100644 index 000000000..cbcf3dd7b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-tree.html @@ -0,0 +1,145 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.persistence.controller Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.logic.persistence.controller

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-use.html new file mode 100644 index 000000000..2213e8683 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/controller/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.logic.persistence.controller (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.logic.persistence.controller

+
+
No usage of com.github.shynixn.petblocks.business.logic.persistence.controller
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.html new file mode 100644 index 000000000..e5666c802 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/ParticleEffectData.html @@ -0,0 +1,1260 @@ + + + + + + +ParticleEffectData (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.persistence.entity
+

Class ParticleEffectData

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    ParticleEffectMeta, Persistenceable, org.bukkit.configuration.serialization.ConfigurationSerializable
    +
    +
    +
    +
    public class ParticleEffectData
    +extends PersistenceObject
    +implements org.bukkit.configuration.serialization.ConfigurationSerializable, ParticleEffectMeta
    +
    Copyright 2017 Shynixn +

    + Do not remove this header! +

    + Version 1.0 +

    + MIT License +

    + Copyright (c) 2016 +

    + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: +

    + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. +

    + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ParticleEffectData

        +
        public ParticleEffectData()
        +
        Initializes a new ParticleEffectData
        +
      • +
      + + + +
        +
      • +

        ParticleEffectData

        +
        public ParticleEffectData(String effectName,
        +                          int amount,
        +                          double speed,
        +                          double x,
        +                          double y,
        +                          double z)
        +
        Initializes a new ParticleEffectData with the given params
        +
        +
        Parameters:
        +
        effectName - effect
        +
        amount - amount
        +
        speed - speed
        +
        x - x
        +
        y - y
        +
        z - u
        +
        +
      • +
      + + + +
        +
      • +

        ParticleEffectData

        +
        public ParticleEffectData(Map<String,Object> items)
        +                   throws Exception
        +
        Parses the potioneffect out of the map
        +
        +
        Parameters:
        +
        items - items
        +
        Throws:
        +
        Exception - mapParseException
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setColor

        +
        public ParticleEffectData setColor(int red,
        +                                   int green,
        +                                   int blue)
        +
        Sets the RGB colors of the particleEffect
        +
        +
        Specified by:
        +
        setColor in interface ParticleEffectMeta
        +
        Parameters:
        +
        red - red
        +
        green - green
        +
        blue - blue
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        setAmount

        +
        public ParticleEffectData setAmount(int amount)
        +
        Sets the amount of particles of the particleEffect
        +
        +
        Specified by:
        +
        setAmount in interface ParticleEffectMeta
        +
        Parameters:
        +
        amount - amount
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + + + + + +
        +
      • +

        setX

        +
        public ParticleEffectData setX(double x)
        +
        Sets the x coordinate of the particleEffect
        +
        +
        Specified by:
        +
        setX in interface ParticleEffectMeta
        +
        Parameters:
        +
        x - x
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setY

        +
        public ParticleEffectData setY(double y)
        +
        Sets the y coordinate of the particleEffect
        +
        +
        Specified by:
        +
        setY in interface ParticleEffectMeta
        +
        Parameters:
        +
        y - y
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + +
        +
      • +

        setZ

        +
        public ParticleEffectData setZ(double z)
        +
        Sets the z coordinate of the particleEffect
        +
        +
        Specified by:
        +
        setZ in interface ParticleEffectMeta
        +
        Parameters:
        +
        z - z
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + + + + + + + + + + + + + + + + + + + + + +
        +
      • +

        setMaterial

        +
        public ParticleEffectData setMaterial(org.bukkit.Material material)
        +
        Sets the material of the particleEffect
        +
        +
        Specified by:
        +
        setMaterial in interface ParticleEffectMeta
        +
        Parameters:
        +
        material - material
        +
        Returns:
        +
        builder
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getEffectName

        +
        public String getEffectName()
        +
        Returns the effect of the particleEffect
        +
        +
        Specified by:
        +
        getEffectName in interface ParticleEffectMeta
        +
        Returns:
        +
        effectName
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getAmount

        +
        public int getAmount()
        +
        Returns the amount of particles of the particleEffect
        +
        +
        Specified by:
        +
        getAmount in interface ParticleEffectMeta
        +
        Returns:
        +
        amount
        +
        +
      • +
      + + + +
        +
      • +

        getSpeed

        +
        public double getSpeed()
        +
        Returns the speed of the particleEffect
        +
        +
        Specified by:
        +
        getSpeed in interface ParticleEffectMeta
        +
        Returns:
        +
        speed
        +
        +
      • +
      + + + +
        +
      • +

        getX

        +
        public double getX()
        +
        Returns the x coordinate of the particleEffect
        +
        +
        Specified by:
        +
        getX in interface ParticleEffectMeta
        +
        Returns:
        +
        x
        +
        +
      • +
      + + + +
        +
      • +

        getY

        +
        public double getY()
        +
        Returns the y coordinate of the particleEffect
        +
        +
        Specified by:
        +
        getY in interface ParticleEffectMeta
        +
        Returns:
        +
        y
        +
        +
      • +
      + + + +
        +
      • +

        getZ

        +
        public double getZ()
        +
        Returns the z coordinate of the particleEffect
        +
        +
        Specified by:
        +
        getZ in interface ParticleEffectMeta
        +
        Returns:
        +
        z
        +
        +
      • +
      + + + +
        +
      • +

        getBlue

        +
        public int getBlue()
        +
        Returns the RGB color blue of the particleEffect
        +
        +
        Specified by:
        +
        getBlue in interface ParticleEffectMeta
        +
        Returns:
        +
        blue
        +
        +
      • +
      + + + +
        +
      • +

        getRed

        +
        public int getRed()
        +
        Returns the RGB color red of the particleEffect
        +
        +
        Specified by:
        +
        getRed in interface ParticleEffectMeta
        +
        Returns:
        +
        red
        +
        +
      • +
      + + + +
        +
      • +

        getGreen

        +
        public int getGreen()
        +
        Returns the RGB color green of the particleEffect
        +
        +
        Specified by:
        +
        getGreen in interface ParticleEffectMeta
        +
        Returns:
        +
        green
        +
        +
      • +
      + + + +
        +
      • +

        getMaterial

        +
        public org.bukkit.Material getMaterial()
        +
        Returns the material of the particleEffect
        +
        +
        Specified by:
        +
        getMaterial in interface ParticleEffectMeta
        +
        Returns:
        +
        material
        +
        +
      • +
      + + + +
        +
      • +

        getData

        +
        public Byte getData()
        +
        Returns the data of the particleEffect
        +
        +
        Specified by:
        +
        getData in interface ParticleEffectMeta
        +
        Returns:
        +
        data
        +
        +
      • +
      + + + +
        +
      • +

        copy

        +
        public ParticleEffectData copy()
        +
        Copies the current builder
        +
        +
        Returns:
        +
        copyOfBuilder
        +
        +
      • +
      + + + +
        +
      • +

        toParticle

        +
        public <T extends Enum<T>> T toParticle(Class<?> clazz)
        +
        Converts the effect to a bukkitParticle
        +
        +
        Type Parameters:
        +
        T - Particle
        +
        Parameters:
        +
        clazz - Clazz to be given for compatibility
        +
        Returns:
        +
        bukkitParticle
        +
        +
      • +
      + + + +
        +
      • +

        isColorParticleEffect

        +
        public boolean isColorParticleEffect()
        +
        Returns if the particleEffect is a color particleEffect
        +
        +
        Specified by:
        +
        isColorParticleEffect in interface ParticleEffectMeta
        +
        Returns:
        +
        isColor
        +
        +
      • +
      + + + +
        +
      • +

        isNoteParticleEffect

        +
        public boolean isNoteParticleEffect()
        +
        Returns if the particleEffect is a note particleEffect
        +
        +
        Specified by:
        +
        isNoteParticleEffect in interface ParticleEffectMeta
        +
        Returns:
        +
        isNote
        +
        +
      • +
      + + + +
        +
      • +

        isMaterialParticleEffect

        +
        public boolean isMaterialParticleEffect()
        +
        Returns if the particleEffect is a materialParticleEffect
        +
        +
        Specified by:
        +
        isMaterialParticleEffect in interface ParticleEffectMeta
        +
        Returns:
        +
        isMaterial
        +
        +
      • +
      + + + +
        +
      • +

        apply

        +
        public void apply(org.bukkit.Location location,
        +                  org.bukkit.entity.Player... players)
        +
        Plays the effect at the given location to the given players.
        +
        +
        Specified by:
        +
        apply in interface ParticleEffectMeta
        +
        Parameters:
        +
        location - location
        +
        players - players
        +
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(Object o)
        +
        Checks if 2 builders are equal
        +
        +
        Overrides:
        +
        equals in class Object
        +
        Parameters:
        +
        o - secondBuilder
        +
        Returns:
        +
        isSame
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Displays the builder as string
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        string
        +
        +
      • +
      + + + +
        +
      • +

        serialize

        +
        public Map<String,Object> serialize()
        +
        Serializes the particleEffect data to be stored to the filesystem
        +
        +
        Specified by:
        +
        serialize in interface org.bukkit.configuration.serialization.ConfigurationSerializable
        +
        Returns:
        +
        serializedContent
        +
        +
      • +
      + + + +
        +
      • +

        getParticlesText

        +
        public static String getParticlesText()
        +
        Returns a text of all particleEffects to let the user easily view them
        +
        +
        Returns:
        +
        potionEffects
        +
        +
      • +
      + + + +
        +
      • +

        getParticleEffectFromName

        +
        public static ParticleEffectMeta.ParticleEffectType getParticleEffectFromName(String name)
        +
        Returns the particleEffectType from name
        +
        +
        Parameters:
        +
        name - name
        +
        Returns:
        +
        particleEffectType
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PersistenceObject.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PersistenceObject.html new file mode 100644 index 000000000..96ec0543c --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PersistenceObject.html @@ -0,0 +1,311 @@ + + + + + + +PersistenceObject (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.persistence.entity
+

Class PersistenceObject

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.business.logic.persistence.entity.PersistenceObject
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PersistenceObject

        +
        public PersistenceObject()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getId

        +
        public long getId()
        +
        Returns the id of the object
        +
        +
        Specified by:
        +
        getId in interface Persistenceable
        +
        Returns:
        +
        id
        +
        +
      • +
      + + + +
        +
      • +

        setId

        +
        public void setId(long id)
        +
        Sets the id of the object
        +
        +
        Parameters:
        +
        id - id
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.html new file mode 100644 index 000000000..abab17452 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PetData.html @@ -0,0 +1,1524 @@ + + + + + + +PetData (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.persistence.entity
+

Class PetData

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PetData

        +
        public PetData(org.bukkit.entity.Player player,
        +               PetType petType,
        +               String name,
        +               org.bukkit.inventory.ItemStack itemStack,
        +               String owner)
        +
      • +
      + + + +
        +
      • +

        PetData

        +
        public PetData()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getPlayerId

        +
        public long getPlayerId()
        +
        Returns the id of the player
        +
        +
        Returns:
        +
        playerId
        +
        +
      • +
      + + + +
        +
      • +

        setPlayerId

        +
        public void setPlayerId(long id)
        +
        Sets the id of the player
        +
        +
        Parameters:
        +
        id - id
        +
        +
      • +
      + + + +
        +
      • +

        getParticleId

        +
        public long getParticleId()
        +
        Returns the id of the particle
        +
        +
        Returns:
        +
        particleId
        +
        +
      • +
      + + + +
        +
      • +

        setParticleId

        +
        public void setParticleId(long id)
        +
        Sets the id of the particle
        +
        +
        Parameters:
        +
        id - id
        +
        +
      • +
      + + + +
        +
      • +

        setParticleEffectMeta

        +
        public void setParticleEffectMeta(ParticleEffectMeta meta)
        +
        Sets the particleEffect meta
        +
        +
        Parameters:
        +
        meta - meta
        +
        +
      • +
      + + + +
        +
      • +

        getParticleEffectMeta

        +
        public ParticleEffectMeta getParticleEffectMeta()
        +
        Returns the particleEffect meta
        +
        +
        Returns:
        +
        meta
        +
        +
      • +
      + + + +
        +
      • +

        setPlayerMeta

        +
        public void setPlayerMeta(PlayerMeta meta)
        +
        Sets the own meta
        +
        +
        Parameters:
        +
        meta - meta
        +
        +
      • +
      + + + +
        +
      • +

        getPlayerMeta

        +
        public PlayerMeta getPlayerMeta()
        +
        Returns the meta of the owner
        +
        +
        Returns:
        +
        player
        +
        +
      • +
      + + + +
        +
      • +

        isBuild

        +
        public boolean isBuild()
        +
      • +
      + + + +
        +
      • +

        setIsBuild

        +
        public void setIsBuild(boolean isBuild)
        +
      • +
      + + + +
        +
      • +

        isSounds

        +
        public boolean isSounds()
        +
      • +
      + + + +
        +
      • +

        setSounds

        +
        public void setSounds(boolean sounds)
        +
      • +
      + + + +
        +
      • +

        setSkin

        +
        public void setSkin(org.bukkit.Material material,
        +                    short durability,
        +                    String skin)
        +
        +
        Specified by:
        +
        setSkin in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        setAge

        +
        public void setAge(Age age)
        +
        +
        Specified by:
        +
        setAge in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        setAgeInTicks

        +
        public void setAgeInTicks(int ticks)
        +
        +
        Specified by:
        +
        setAgeInTicks in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        getAgeInTicks

        +
        public int getAgeInTicks()
        +
        +
        Specified by:
        +
        getAgeInTicks in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        getAge

        +
        public Age getAge()
        +
        +
        Specified by:
        +
        getAge in interface PetMeta
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getMovement

        +
        public String getMovement()
        +
      • +
      + + + +
        +
      • +

        setMovement

        +
        public void setMovement(String movement)
        +
      • +
      + + + + + + + + + + + + + + + +
        +
      • +

        isHidden

        +
        public boolean isHidden()
        +
        +
        Specified by:
        +
        isHidden in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        setHidden

        +
        public void setHidden(boolean isHidden)
        +
        +
        Specified by:
        +
        setHidden in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        setSoundsEnabled

        +
        public void setSoundsEnabled(boolean enabled)
        +
        +
        Specified by:
        +
        setSoundsEnabled in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        isSoundsEnabled

        +
        public boolean isSoundsEnabled()
        +
        +
        Specified by:
        +
        isSoundsEnabled in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        isUnbreakable

        +
        public boolean isUnbreakable()
        +
        +
        Specified by:
        +
        isUnbreakable in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        setUnbreakable

        +
        public void setUnbreakable(boolean unbreakable)
        +
        +
        Specified by:
        +
        setUnbreakable in interface PetMeta
        +
        +
      • +
      + + + + + + + + + + + + + + + +
        +
      • +

        setHeadLore

        +
        public void setHeadLore(String[] headLore)
        +
        +
        Specified by:
        +
        setHeadLore in interface PetMeta
        +
        +
      • +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
      • +

        getSkinMaterial

        +
        public org.bukkit.Material getSkinMaterial()
        +
        +
        Specified by:
        +
        getSkinMaterial in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        getSkinDurability

        +
        public short getSkinDurability()
        +
        +
        Specified by:
        +
        getSkinDurability in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        setEnabled

        +
        public void setEnabled(boolean enabled)
        +
        +
        Specified by:
        +
        setEnabled in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        isEnabled

        +
        public boolean isEnabled()
        +
        +
        Specified by:
        +
        isEnabled in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        getCostume

        +
        public org.bukkit.Material getCostume()
        +
      • +
      + + + +
        +
      • +

        setCostume

        +
        public void setCostume(org.bukkit.Material costume)
        +
      • +
      + + + +
        +
      • +

        getDurability

        +
        public short getDurability()
        +
      • +
      + + + +
        +
      • +

        setDurability

        +
        public void setDurability(short durability)
        +
      • +
      + + + +
        +
      • +

        getSkullName

        +
        public String getSkullName()
        +
      • +
      + + + +
        +
      • +

        setSkullName

        +
        public void setSkullName(String skullName)
        +
      • +
      + + + +
        +
      • +

        getOwner

        +
        @Deprecated
        +public org.bukkit.entity.Player getOwner()
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        getOwner in interface PetMeta
        +
        +
      • +
      + + + +
        +
      • +

        setOwner

        +
        @Deprecated
        +public void setOwner(org.bukkit.entity.Player player)
        +
        Deprecated. 
        +
      • +
      + + + + + + + + + + + + + + + + + + + + + + + +
        +
      • +

        getData

        +
        @Deprecated
        +public byte getData()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setData

        +
        @Deprecated
        +public void setData(byte data)
        +
        Deprecated. 
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        getX

        +
        @Deprecated
        +public double getX()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setX

        +
        @Deprecated
        +public void setX(double x)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getY

        +
        @Deprecated
        +public double getY()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setY

        +
        @Deprecated
        +public void setY(double y)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getZ

        +
        @Deprecated
        +public double getZ()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setZ

        +
        @Deprecated
        +public void setZ(double z)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getSpeed

        +
        @Deprecated
        +public double getSpeed()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setSpeed

        +
        @Deprecated
        +public void setSpeed(double speed)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getAmount

        +
        @Deprecated
        +public int getAmount()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setAmount

        +
        @Deprecated
        +public void setAmount(int amount)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getMaterial

        +
        @Deprecated
        +public org.bukkit.Material getMaterial()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setMaterial

        +
        @Deprecated
        +public void setMaterial(org.bukkit.Material material)
        +
        Deprecated. 
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PlayerData.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PlayerData.html new file mode 100644 index 000000000..a72178b5a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/PlayerData.html @@ -0,0 +1,416 @@ + + + + + + +PlayerData (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.business.logic.persistence.entity
+

Class PlayerData

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PlayerData

        +
        public PlayerData()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getName

        +
        public String getName()
        +
        Returns the name of the playerData
        +
        +
        Specified by:
        +
        getName in interface PlayerMeta
        +
        Returns:
        +
        playerData
        +
        +
      • +
      + + + +
        +
      • +

        setName

        +
        public void setName(String name)
        +
        Sets the name of the playerData
        +
        +
        Specified by:
        +
        setName in interface PlayerMeta
        +
        Parameters:
        +
        name - name
        +
        +
      • +
      + + + +
        +
      • +

        getUUID

        +
        public UUID getUUID()
        +
        Returns the uuid of the playerData
        +
        +
        Specified by:
        +
        getUUID in interface PlayerMeta
        +
        Returns:
        +
        uuid
        +
        +
      • +
      + + + +
        +
      • +

        setUuid

        +
        public void setUuid(UUID uuid)
        +
        Sets the uuid of the playerData
        +
        +
        Specified by:
        +
        setUuid in interface PlayerMeta
        +
        Parameters:
        +
        uuid - uuid
        +
        +
      • +
      + + + +
        +
      • +

        getPlayer

        +
        public org.bukkit.entity.Player getPlayer()
        +
        Returns the player of the playerData
        +
        +
        Specified by:
        +
        getPlayer in interface PlayerMeta
        +
        Returns:
        +
        player
        +
        +
      • +
      + + + +
        +
      • +

        from

        +
        public static PlayerData from(org.bukkit.entity.Player player)
        +
        Generates the playerData from a player
        +
        +
        Parameters:
        +
        player - player
        +
        Returns:
        +
        playerData
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/ParticleEffectData.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/ParticleEffectData.html new file mode 100644 index 000000000..7880f8415 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/ParticleEffectData.html @@ -0,0 +1,260 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PersistenceObject.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PersistenceObject.html new file mode 100644 index 000000000..61d9fc181 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PersistenceObject.html @@ -0,0 +1,178 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.persistence.entity.PersistenceObject (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.persistence.entity.PersistenceObject

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PetData.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PetData.html new file mode 100644 index 000000000..a2172b3c6 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PetData.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.persistence.entity.PetData

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PlayerData.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PlayerData.html new file mode 100644 index 000000000..6d2685297 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/class-use/PlayerData.html @@ -0,0 +1,192 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-frame.html new file mode 100644 index 000000000..e678cc114 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-frame.html @@ -0,0 +1,24 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.persistence.entity (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.logic.persistence.entity

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-summary.html new file mode 100644 index 000000000..65c8ffd08 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-summary.html @@ -0,0 +1,160 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.persistence.entity (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.logic.persistence.entity

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-tree.html new file mode 100644 index 000000000..7caa5f299 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-tree.html @@ -0,0 +1,145 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.persistence.entity Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.logic.persistence.entity

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.github.shynixn.petblocks.business.logic.persistence.entity.PersistenceObject (implements com.github.shynixn.petblocks.api.persistence.entity.Persistenceable) +
        +
      • com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData (implements org.bukkit.configuration.serialization.ConfigurationSerializable, com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta)
      • +
      • com.github.shynixn.petblocks.business.logic.persistence.entity.PetData (implements com.github.shynixn.petblocks.api.persistence.entity.PetMeta)
      • +
      • com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData (implements com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta)
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-use.html new file mode 100644 index 000000000..3533b3703 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/entity/package-use.html @@ -0,0 +1,191 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.logic.persistence.entity (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.logic.persistence.entity

+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-frame.html new file mode 100644 index 000000000..32e058352 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.persistence (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business.logic.persistence

+
+

Classes

+ +
+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-summary.html new file mode 100644 index 000000000..d8d70b85b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-summary.html @@ -0,0 +1,144 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.persistence (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business.logic.persistence

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Factory 
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-tree.html new file mode 100644 index 000000000..a8783235b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-tree.html @@ -0,0 +1,139 @@ + + + + + + +com.github.shynixn.petblocks.business.logic.persistence Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business.logic.persistence

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.github.shynixn.petblocks.business.logic.persistence.Factory
    • +
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-use.html new file mode 100644 index 000000000..401bbf7f8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/logic/persistence/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business.logic.persistence (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business.logic.persistence

+
+
No usage of com.github.shynixn.petblocks.business.logic.persistence
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/business/package-frame.html new file mode 100644 index 000000000..a309180e1 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/package-frame.html @@ -0,0 +1,26 @@ + + + + + + +com.github.shynixn.petblocks.business (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.business

+
+

Classes

+ +

Enums

+ +
+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/business/package-summary.html new file mode 100644 index 000000000..f713e2653 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/package-summary.html @@ -0,0 +1,163 @@ + + + + + + +com.github.shynixn.petblocks.business (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.business

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Config 
    Language 
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    Permission 
    +
  • +
+
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/business/package-tree.html new file mode 100644 index 000000000..a6d0a7f57 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/package-tree.html @@ -0,0 +1,152 @@ + + + + + + +com.github.shynixn.petblocks.business Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.business

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.github.shynixn.petblocks.business.Config
    • +
    • com.github.shynixn.petblocks.business.Language
    • +
    +
  • +
+

Enum Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/business/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/business/package-use.html new file mode 100644 index 000000000..1cced1fd3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/business/package-use.html @@ -0,0 +1,181 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.business (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.business

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/BukkitChatColor.html b/docs/apidocs/com/github/shynixn/petblocks/lib/BukkitChatColor.html new file mode 100644 index 000000000..d248f9f17 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/BukkitChatColor.html @@ -0,0 +1,540 @@ + + + + + + +BukkitChatColor (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Enum BukkitChatColor

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static BukkitChatColor[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (BukkitChatColor c : BukkitChatColor.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static BukkitChatColor valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/BukkitCommands.html b/docs/apidocs/com/github/shynixn/petblocks/lib/BukkitCommands.html new file mode 100644 index 000000000..9ad808303 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/BukkitCommands.html @@ -0,0 +1,350 @@ + + + + + + +BukkitCommands (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class BukkitCommands

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    org.bukkit.command.CommandExecutor
    +
    +
    +
    Deprecated.
    +
    +
    @Deprecated
    +public abstract class BukkitCommands
    +extends Object
    +implements org.bukkit.command.CommandExecutor
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        BukkitCommands

        +
        public BukkitCommands(String command,
        +                      org.bukkit.plugin.Plugin plugin)
        +
        Deprecated. 
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getPlugin

        +
        protected org.bukkit.plugin.Plugin getPlugin()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        consoleSendCommandEvent

        +
        public void consoleSendCommandEvent(org.bukkit.command.CommandSender sender,
        +                                    String[] args)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        onCommand

        +
        public final boolean onCommand(org.bukkit.command.CommandSender arg0,
        +                               org.bukkit.command.Command arg1,
        +                               String arg2,
        +                               String[] arg3)
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        onCommand in interface org.bukkit.command.CommandExecutor
        +
        +
      • +
      + + + +
        +
      • +

        playerSendCommandEvent

        +
        public void playerSendCommandEvent(org.bukkit.entity.Player player,
        +                                   String[] args)
        +
        Deprecated. 
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/BukkitUtilities.html b/docs/apidocs/com/github/shynixn/petblocks/lib/BukkitUtilities.html new file mode 100644 index 000000000..f70f796c3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/BukkitUtilities.html @@ -0,0 +1,424 @@ + + + + + + +BukkitUtilities (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class BukkitUtilities

+
+
+ +
+
    +
  • +
    +
    +
    public final class BukkitUtilities
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getOnlinePlayers

        +
        public static List<org.bukkit.entity.Player> getOnlinePlayers()
        +
      • +
      + + + +
        +
      • +

        sendColorMessage

        +
        public static void sendColorMessage(String message,
        +                                    org.bukkit.ChatColor color,
        +                                    String prefix)
        +
      • +
      + + + +
        +
      • +

        tryParseInt

        +
        public static boolean tryParseInt(String value)
        +
      • +
      + + + +
        +
      • +

        nameItem

        +
        public static org.bukkit.inventory.ItemStack nameItem(org.bukkit.inventory.ItemStack item,
        +                                                      String name,
        +                                                      String[] lore)
        +
      • +
      + + + +
        +
      • +

        nameItemDisplay

        +
        public static org.bukkit.inventory.ItemStack nameItemDisplay(org.bukkit.inventory.ItemStack item,
        +                                                             String name)
        +
      • +
      + + + +
        +
      • +

        copyFile

        +
        public static boolean copyFile(InputStream in,
        +                               File file)
        +
      • +
      + + + +
        +
      • +

        createFile

        +
        public static File createFile(File file)
        +
      • +
      + + + +
        +
      • +

        isNegative

        +
        public static int isNegative(Random rand)
        +
      • +
      + + + +
        +
      • +

        startFiltering

        +
        public static void startFiltering()
        +
      • +
      + + + +
        +
      • +

        compareItemName

        +
        public static boolean compareItemName(org.bukkit.inventory.ItemStack itemStack,
        +                                      String displayname)
        +
      • +
      + + + +
        +
      • +

        isVersionSupported

        +
        public static boolean isVersionSupported()
        +
      • +
      + + + +
        +
      • +

        replaceServerVersion

        +
        public static String replaceServerVersion(String text)
        +
      • +
      + + + +
        +
      • +

        getServerVersion

        +
        public static String getServerVersion()
        +
      • +
      + + + +
        +
      • +

        activateHead

        +
        public static org.bukkit.inventory.ItemStack activateHead(String name,
        +                                                          org.bukkit.inventory.ItemStack itemStack)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/DataBaseRepository.html b/docs/apidocs/com/github/shynixn/petblocks/lib/DataBaseRepository.html new file mode 100644 index 000000000..49dcc8cdd --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/DataBaseRepository.html @@ -0,0 +1,522 @@ + + + + + + +DataBaseRepository (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class DataBaseRepository<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.lib.DataBaseRepository<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    IController<T>, IDatabaseController<T>, AutoCloseable
    +
    +
    +
    Direct Known Subclasses:
    +
    ParticleEffectDataRepository, PetDataRepository, PlayerDataRepository
    +
    +
    +
    +
    public abstract class DataBaseRepository<T>
    +extends Object
    +implements IDatabaseController<T>
    +
    Copyright 2017 Shynixn +

    + Do not remove this header! +

    + Version 1.0 +

    + MIT License +

    + Copyright (c) 2017 +

    + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: +

    + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. +

    + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DataBaseRepository

        +
        public DataBaseRepository()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        store

        +
        public void store(T item)
        +
        Stores a new a item in the repository
        +
        +
        Specified by:
        +
        store in interface IController<T>
        +
        Parameters:
        +
        item - item
        +
        +
      • +
      + + + + + +
        +
      • +

        remove

        +
        public void remove(T item)
        +
        Removes an item from the repository
        +
        +
        Specified by:
        +
        remove in interface IController<T>
        +
        Parameters:
        +
        item - item
        +
        +
      • +
      + + + +
        +
      • +

        getAll

        +
        public List<T> getAll()
        +
        Returns all items from the repository as unmodifiableList
        +
        +
        Specified by:
        +
        getAll in interface IController<T>
        +
        Returns:
        +
        items
        +
        +
      • +
      + + + + + +
        +
      • +

        hasId

        +
        public abstract boolean hasId(T item)
        +
        Checks if the item has got an valid databaseId
        +
        +
        Parameters:
        +
        item - item
        +
        Returns:
        +
        hasGivenId
        +
        +
      • +
      + + + +
        +
      • +

        select

        +
        public abstract List<T> select()
        +
        Selects all items from the database into the list
        +
        +
        Returns:
        +
        listOfItems
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public abstract void update(T item)
        +
        Updates the item inside of the database
        +
        +
        Parameters:
        +
        item - item
        +
        +
      • +
      + + + + + +
        +
      • +

        delete

        +
        public abstract void delete(T item)
        +
        Deletes the item from the database
        +
        +
        Parameters:
        +
        item - item
        +
        +
      • +
      + + + + + +
        +
      • +

        insert

        +
        public abstract void insert(T item)
        +
        Inserts the item into the database and sets the id
        +
        +
        Parameters:
        +
        item - item
        +
        +
      • +
      + + + +
        +
      • +

        from

        +
        public abstract T from(ResultSet resultSet)
        +                throws SQLException
        +
        Generates the entity from the given resultSet
        +
        +
        Parameters:
        +
        resultSet - resultSet
        +
        Returns:
        +
        entity
        +
        Throws:
        +
        SQLException - exception
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/DynamicCommandHelper.CommandContainer.html b/docs/apidocs/com/github/shynixn/petblocks/lib/DynamicCommandHelper.CommandContainer.html new file mode 100644 index 000000000..af766b44e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/DynamicCommandHelper.CommandContainer.html @@ -0,0 +1,344 @@ + + + + + + +DynamicCommandHelper.CommandContainer (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class DynamicCommandHelper.CommandContainer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CommandContainer

        +
        public CommandContainer(String upper,
        +                        org.bukkit.configuration.file.FileConfiguration c)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCommand

        +
        public String getCommand()
        +
      • +
      + + + +
        +
      • +

        isEnabled

        +
        public boolean isEnabled()
        +
      • +
      + + + +
        +
      • +

        getUseage

        +
        public String getUseage()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
      • +
      + + + +
        +
      • +

        getPermission

        +
        public String getPermission()
        +
      • +
      + + + +
        +
      • +

        getPermissionMessage

        +
        public String getPermissionMessage()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/DynamicCommandHelper.html b/docs/apidocs/com/github/shynixn/petblocks/lib/DynamicCommandHelper.html new file mode 100644 index 000000000..7351fcc68 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/DynamicCommandHelper.html @@ -0,0 +1,361 @@ + + + + + + +DynamicCommandHelper (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class DynamicCommandHelper

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.bukkit.command.Command
    • +
    • +
        +
      • org.bukkit.command.defaults.BukkitCommand
      • +
      • +
          +
        • com.github.shynixn.petblocks.lib.DynamicCommandHelper
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public abstract class DynamicCommandHelper
    +extends org.bukkit.command.defaults.BukkitCommand
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        execute

        +
        public boolean execute(org.bukkit.command.CommandSender sender,
        +                       String alias,
        +                       String[] args)
        +
        +
        Specified by:
        +
        execute in class org.bukkit.command.Command
        +
        +
      • +
      + + + +
        +
      • +

        onCommandSend

        +
        public abstract void onCommandSend(org.bukkit.command.CommandSender sender,
        +                                   String[] args)
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.SQlRetriever.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.SQlRetriever.html new file mode 100644 index 000000000..1b62f746e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.SQlRetriever.html @@ -0,0 +1,241 @@ + + + + + + +ExtensionHikariConnectionContext.SQlRetriever (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Interface ExtensionHikariConnectionContext.SQlRetriever

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    ExtensionHikariConnectionContext
    +
    +
    +
    Functional Interface:
    +
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
    +
    +
    +
    +
    @FunctionalInterface
    +public static interface ExtensionHikariConnectionContext.SQlRetriever
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        loadSqlStatement

        +
        String loadSqlStatement(String fileName)
        +
        Loads a sqlStatement from the givenFile
        +
        +
        Parameters:
        +
        fileName - fileName
        +
        Returns:
        +
        sqlStatement
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.html new file mode 100644 index 000000000..a8eeaeff0 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ExtensionHikariConnectionContext.html @@ -0,0 +1,723 @@ + + + + + + +ExtensionHikariConnectionContext (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ExtensionHikariConnectionContext

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    AutoCloseable
    +
    +
    +
    +
    public class ExtensionHikariConnectionContext
    +extends Object
    +implements AutoCloseable
    +
    Copyright 2017 Shynixn +

    + Do not remove this header! +

    + Version 1.0 +

    + MIT License +

    + Copyright (c) 2017 +

    + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: +

    + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. +

    + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE.

    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getConnection

        +
        public Connection getConnection()
        +                         throws SQLException
        +
        Provides an connection to the database which has to be closed after being used
        +
        +
        Returns:
        +
        connection
        +
        Throws:
        +
        SQLException - exception
        +
        +
      • +
      + + + +
        +
      • +

        executeStored

        +
        public boolean executeStored(String fileName,
        +                             Connection connection,
        +                             Object... parameters)
        +                      throws SQLException
        +
        Reads a sqlStatement from the given fileName, executes it and sets the given parameter
        +
        +
        Parameters:
        +
        fileName - fileName
        +
        connection - connection
        +
        parameters - parameters
        +
        Returns:
        +
        success
        +
        Throws:
        +
        SQLException - exception
        +
        +
      • +
      + + + +
        +
      • +

        execute

        +
        public boolean execute(String sql,
        +                       Connection connection,
        +                       Object... parameters)
        +                throws SQLException
        +
        Executes a preparedStatement and sets the given parameters to the statement
        +
        +
        Parameters:
        +
        sql - sql
        +
        connection - connection
        +
        parameters - parameters
        +
        Returns:
        +
        success
        +
        Throws:
        +
        SQLException - exception
        +
        +
      • +
      + + + +
        +
      • +

        executeStoredQuery

        +
        public PreparedStatement executeStoredQuery(String fileName,
        +                                            Connection connection,
        +                                            Object... parameters)
        +                                     throws SQLException
        +
        Reads a sqlStatement from the given fileName, executes it and sets the given parameter
        +
        +
        Parameters:
        +
        fileName - fileName
        +
        connection - connection
        +
        parameters - parameters
        +
        Returns:
        +
        resultSet
        +
        Throws:
        +
        SQLException - exception
        +
        +
      • +
      + + + +
        +
      • +

        executeQuery

        +
        public PreparedStatement executeQuery(String sql,
        +                                      Connection connection,
        +                                      Object... parameters)
        +                               throws SQLException
        +
        Executes a preparedStatement and sets the given parameters to the statement
        +
        +
        Parameters:
        +
        sql - sql
        +
        connection - connection
        +
        parameters - parameters
        +
        Returns:
        +
        resultSet
        +
        Throws:
        +
        SQLException - exception
        +
        +
      • +
      + + + +
        +
      • +

        executeStoredUpdate

        +
        public int executeStoredUpdate(String fileName,
        +                               Connection connection,
        +                               Object... parameters)
        +                        throws SQLException
        +
        Reads a sqlStatement from the given fileName, executes it and sets the given parameter
        +
        +
        Parameters:
        +
        fileName - fileName
        +
        connection - connection
        +
        parameters - parameters
        +
        Returns:
        +
        resultCode
        +
        Throws:
        +
        SQLException - exception
        +
        +
      • +
      + + + +
        +
      • +

        executeUpdate

        +
        public int executeUpdate(String sql,
        +                         Connection connection,
        +                         Object... parameters)
        +                  throws SQLException
        +
        Executes a preparedStatement and sets the given parameters to the statement
        +
        +
        Parameters:
        +
        sql - sql
        +
        connection - connection
        +
        parameters - parameters
        +
        Returns:
        +
        resultCode
        +
        Throws:
        +
        SQLException - exception
        +
        +
      • +
      + + + +
        +
      • +

        executeStoredInsert

        +
        public int executeStoredInsert(String fileName,
        +                               Connection connection,
        +                               Object... parameters)
        +                        throws SQLException
        +
        Reads a sqlStatement from the given fileName, executes it and sets the given parameter
        +
        +
        Parameters:
        +
        fileName - fileName
        +
        connection - connection
        +
        parameters - parameters
        +
        Returns:
        +
        id
        +
        Throws:
        +
        SQLException - exception
        +
        +
      • +
      + + + +
        +
      • +

        executeInsert

        +
        public int executeInsert(String sql,
        +                         Connection connection,
        +                         Object... parameters)
        +                  throws SQLException
        +
        Executes a preparedStatement and sets the given parameters to the statement
        +
        +
        Parameters:
        +
        sql - sql
        +
        connection - connection
        +
        parameters - parameters
        +
        Returns:
        +
        id
        +
        Throws:
        +
        SQLException - exception
        +
        +
      • +
      + + + +
        +
      • +

        close

        +
        public void close()
        +
        Closes the database context
        +
        +
        Specified by:
        +
        close in interface AutoCloseable
        +
        +
      • +
      + + + +
        +
      • +

        getStringFromFile

        +
        public String getStringFromFile(String statementName)
        +
        Manages caching of statements
        +
        +
        Parameters:
        +
        statementName - statementName
        +
        Returns:
        +
        sqlStatement
        +
        +
      • +
      + + + + + + + + +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/Filtering.html b/docs/apidocs/com/github/shynixn/petblocks/lib/Filtering.html new file mode 100644 index 000000000..06d120459 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/Filtering.html @@ -0,0 +1,273 @@ + + + + + + +Filtering (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class Filtering

+
+
+ +
+
    +
  • +
    +
    +
    public class Filtering
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Filtering

        +
        public Filtering()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        filterMessages

        +
        public static void filterMessages()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/Interpreter19.html b/docs/apidocs/com/github/shynixn/petblocks/lib/Interpreter19.html new file mode 100644 index 000000000..61176e2a2 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/Interpreter19.html @@ -0,0 +1,306 @@ + + + + + + +Interpreter19 (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class Interpreter19

+
+
+ +
+
    +
  • +
    +
    +
    public class Interpreter19
    +extends Object
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Interpreter19

        +
        public Interpreter19()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        interPretSounds19

        +
        public static org.bukkit.Sound interPretSounds19(String sound)
        +
      • +
      + + + +
        +
      • +

        getItemInHand19

        +
        public static org.bukkit.inventory.ItemStack getItemInHand19(org.bukkit.entity.Player player,
        +                                                             boolean offHand)
        +
      • +
      + + + +
        +
      • +

        setItemInHand19

        +
        public static void setItemInHand19(org.bukkit.entity.Player player,
        +                                   org.bukkit.inventory.ItemStack itemStack,
        +                                   boolean offHand)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/LightRegistry.html b/docs/apidocs/com/github/shynixn/petblocks/lib/LightRegistry.html new file mode 100644 index 000000000..9556dac93 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/LightRegistry.html @@ -0,0 +1,394 @@ + + + + + + +LightRegistry (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Enum LightRegistry

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static LightRegistry[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (LightRegistry c : LightRegistry.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static LightRegistry valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        unregister

        +
        public static void unregister()
        +
      • +
      + + + +
        +
      • +

        register

        +
        public void register(String customEntityClazzName)
        +
      • +
      + + + +
        +
      • +

        register

        +
        public void register(Class<?> customEntityClazz)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/Particle.html b/docs/apidocs/com/github/shynixn/petblocks/lib/Particle.html new file mode 100644 index 000000000..c84a9b53f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/Particle.html @@ -0,0 +1,640 @@ + + + + + + +Particle (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class Particle

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Particle

        +
        public Particle(ParticleBuilder builder)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        Particle

        +
        public Particle()
        +
        Deprecated. 
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setEffect

        +
        public void setEffect(ParticleEffect effect)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setX

        +
        public void setX(double x)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setY

        +
        public void setY(double y)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setZ

        +
        public void setZ(double z)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setSpeed

        +
        public void setSpeed(double speed)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setAmount

        +
        public void setAmount(int amount)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setMaterial

        +
        public void setMaterial(org.bukkit.Material material)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setData

        +
        public void setData(byte data)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        play

        +
        public void play(org.bukkit.Location location)
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        play in interface Particle
        +
        +
      • +
      + + + +
        +
      • +

        play

        +
        public void play(org.bukkit.Location location,
        +                 org.bukkit.entity.Player... players)
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        play in interface Particle
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getX

        +
        public double getX()
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        getX in interface Particle
        +
        +
      • +
      + + + +
        +
      • +

        getY

        +
        public double getY()
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        getY in interface Particle
        +
        +
      • +
      + + + +
        +
      • +

        getZ

        +
        public double getZ()
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        getZ in interface Particle
        +
        +
      • +
      + + + +
        +
      • +

        getSpeed

        +
        public double getSpeed()
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        getSpeed in interface Particle
        +
        +
      • +
      + + + +
        +
      • +

        getAmount

        +
        public int getAmount()
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        getAmount in interface Particle
        +
        +
      • +
      + + + +
        +
      • +

        getMaterial

        +
        public org.bukkit.Material getMaterial()
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        getMaterial in interface Particle
        +
        +
      • +
      + + + +
        +
      • +

        getMaterialId

        +
        public int getMaterialId()
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        getMaterialId in interface Particle
        +
        +
      • +
      + + + +
        +
      • +

        getData

        +
        public byte getData()
        +
        Deprecated. 
        +
        +
        Specified by:
        +
        getData in interface Particle
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleBuilder.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleBuilder.html new file mode 100644 index 000000000..738a494e8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleBuilder.html @@ -0,0 +1,814 @@ + + + + + + +ParticleBuilder (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ParticleBuilder

+
+
+ +
+
    +
  • +
    +
    Deprecated.
    +
    +
    @Deprecated
    +public final class ParticleBuilder
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ParticleBuilder

        +
        public ParticleBuilder()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        ParticleBuilder

        +
        public ParticleBuilder(ParticleEffect effect,
        +                       double x,
        +                       double y,
        +                       double z,
        +                       double speed,
        +                       int amount)
        +
        Deprecated. 
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        setBlue

        +
        public ParticleBuilder setBlue(int blue)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setGreen

        +
        public ParticleBuilder setGreen(int green)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setColor

        +
        public ParticleBuilder setColor(int red,
        +                                int green,
        +                                int blue)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getRed

        +
        public int getRed()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getBlue

        +
        public int getBlue()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getGreen

        +
        public int getGreen()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setNoteColor

        +
        public ParticleBuilder setNoteColor(int color)
        +
        Deprecated. 
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        getAmount

        +
        public int getAmount()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setAmount

        +
        public ParticleBuilder setAmount(int amount)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getX

        +
        public double getX()
        +
        Deprecated. 
        +
      • +
      + + + + + + + +
        +
      • +

        getY

        +
        public double getY()
        +
        Deprecated. 
        +
      • +
      + + + + + + + +
        +
      • +

        getZ

        +
        public double getZ()
        +
        Deprecated. 
        +
      • +
      + + + + + + + +
        +
      • +

        setOffset

        +
        public ParticleBuilder setOffset(double x,
        +                                 double y,
        +                                 double z)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getSpeed

        +
        public double getSpeed()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setSpeed

        +
        public ParticleBuilder setSpeed(double speed)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getMaterial

        +
        public org.bukkit.Material getMaterial()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setMaterial

        +
        public ParticleBuilder setMaterial(org.bukkit.Material material)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getMaterialId

        +
        public int getMaterialId()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setMaterialId

        +
        public ParticleBuilder setMaterialId(int id)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        build

        +
        public Particle build()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getData

        +
        public byte getData()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        setData

        +
        public ParticleBuilder setData(byte data)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        isColorParticleEffect

        +
        public boolean isColorParticleEffect()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        isNoteParticleEffect

        +
        public boolean isNoteParticleEffect()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        isMaterialParticleEffect

        +
        public boolean isMaterialParticleEffect()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Deprecated. 
        +
        +
        Overrides:
        +
        toString in class Object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.BlockData.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.BlockData.html new file mode 100644 index 000000000..44a5e06a1 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.BlockData.html @@ -0,0 +1,262 @@ + + + + + + +ParticleEffect.BlockData (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ParticleEffect.BlockData

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ItemData.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ItemData.html new file mode 100644 index 000000000..16b8f9b1a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ItemData.html @@ -0,0 +1,257 @@ + + + + + + +ParticleEffect.ItemData (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ParticleEffect.ItemData

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ItemData

        +
        public ItemData(org.bukkit.Material material,
        +                byte data)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.NoteColor.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.NoteColor.html new file mode 100644 index 000000000..d5d110726 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.NoteColor.html @@ -0,0 +1,325 @@ + + + + + + +ParticleEffect.NoteColor (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ParticleEffect.NoteColor

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.OrdinaryColor.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.OrdinaryColor.html new file mode 100644 index 000000000..5ae25b962 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.OrdinaryColor.html @@ -0,0 +1,380 @@ + + + + + + +ParticleEffect.OrdinaryColor (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ParticleEffect.OrdinaryColor

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleColor.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleColor.html new file mode 100644 index 000000000..c5c2ca937 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleColor.html @@ -0,0 +1,307 @@ + + + + + + +ParticleEffect.ParticleColor (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ParticleEffect.ParticleColor

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColor
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ParticleColor

        +
        public ParticleColor()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getValueX

        +
        public abstract float getValueX()
        +
      • +
      + + + +
        +
      • +

        getValueY

        +
        public abstract float getValueY()
        +
      • +
      + + + +
        +
      • +

        getValueZ

        +
        public abstract float getValueZ()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleData.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleData.html new file mode 100644 index 000000000..30b4c310f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleData.html @@ -0,0 +1,322 @@ + + + + + + +ParticleEffect.ParticleData (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ParticleEffect.ParticleData

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.lib.ParticleEffect.ParticleData
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ParticleData

        +
        public ParticleData(org.bukkit.Material material,
        +                    byte data)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getMaterial

        +
        public org.bukkit.Material getMaterial()
        +
      • +
      + + + +
        +
      • +

        getData

        +
        public byte getData()
        +
      • +
      + + + +
        +
      • +

        getPacketData

        +
        public int[] getPacketData()
        +
      • +
      + + + +
        +
      • +

        getPacketDataString

        +
        public String getPacketDataString()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticlePacket.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticlePacket.html new file mode 100644 index 000000000..74e1170f6 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticlePacket.html @@ -0,0 +1,430 @@ + + + + + + +ParticleEffect.ParticlePacket (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ParticleEffect.ParticlePacket

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    ParticleEffect
    +
    +
    +
    +
    public static final class ParticleEffect.ParticlePacket
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        initialize

        +
        public static void initialize()
        +                       throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket.VersionIncompatibleException
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket.VersionIncompatibleException
        +
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        public static int getVersion()
        +
      • +
      + + + +
        +
      • +

        isInitialized

        +
        public static boolean isInitialized()
        +
      • +
      + + + +
        +
      • +

        sendTo

        +
        public void sendTo(org.bukkit.Location center,
        +                   org.bukkit.entity.Player player)
        +            throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket.PacketInstantiationException,
        +                   com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket.PacketSendingException
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket.PacketInstantiationException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket.PacketSendingException
        +
        +
      • +
      + + + + + + + + +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleProperty.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleProperty.html new file mode 100644 index 000000000..c464c58b0 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.ParticleProperty.html @@ -0,0 +1,371 @@ + + + + + + +ParticleEffect.ParticleProperty (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Enum ParticleEffect.ParticleProperty

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static ParticleEffect.ParticleProperty[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (ParticleEffect.ParticleProperty c : ParticleEffect.ParticleProperty.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static ParticleEffect.ParticleProperty valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.html new file mode 100644 index 000000000..163b47202 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleEffect.html @@ -0,0 +1,1635 @@ + + + + + + +ParticleEffect (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Enum ParticleEffect

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static ParticleEffect[] values()
        +
        Deprecated. 
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (ParticleEffect c : ParticleEffect.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static ParticleEffect valueOf(String name)
        +
        Deprecated. 
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getName

        +
        public String getName()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getId

        +
        public int getId()
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getRequiredVersion

        +
        public int getRequiredVersion()
        +
        Deprecated. 
        +
      • +
      + + + + + + + +
        +
      • +

        isSupported

        +
        public boolean isSupported()
        +
        Deprecated. 
        +
      • +
      + + + + + + + +
        +
      • +

        fromId

        +
        public static ParticleEffect fromId(int id)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(float offsetX,
        +                    float offsetY,
        +                    float offsetZ,
        +                    float speed,
        +                    int amount,
        +                    org.bukkit.Location center,
        +                    double range)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException,
        +                    IllegalArgumentException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(float offsetX,
        +                    float offsetY,
        +                    float offsetZ,
        +                    float speed,
        +                    int amount,
        +                    org.bukkit.Location center,
        +                    List<org.bukkit.entity.Player> players)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException,
        +                    IllegalArgumentException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(float offsetX,
        +                    float offsetY,
        +                    float offsetZ,
        +                    float speed,
        +                    int amount,
        +                    org.bukkit.Location center,
        +                    org.bukkit.entity.Player... players)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException,
        +                    IllegalArgumentException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(org.bukkit.util.Vector direction,
        +                    float speed,
        +                    org.bukkit.Location center,
        +                    double range)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException,
        +                    IllegalArgumentException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(org.bukkit.util.Vector direction,
        +                    float speed,
        +                    org.bukkit.Location center,
        +                    List<org.bukkit.entity.Player> players)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException,
        +                    IllegalArgumentException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(org.bukkit.util.Vector direction,
        +                    float speed,
        +                    org.bukkit.Location center,
        +                    org.bukkit.entity.Player... players)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException,
        +                    IllegalArgumentException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(ParticleEffect.ParticleColor color,
        +                    org.bukkit.Location center,
        +                    double range)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColorException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColorException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(ParticleEffect.ParticleColor color,
        +                    org.bukkit.Location center,
        +                    List<org.bukkit.entity.Player> players)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColorException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColorException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(ParticleEffect.ParticleColor color,
        +                    org.bukkit.Location center,
        +                    org.bukkit.entity.Player... players)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColorException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColorException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(ParticleEffect.ParticleData data,
        +                    float offsetX,
        +                    float offsetY,
        +                    float offsetZ,
        +                    float speed,
        +                    int amount,
        +                    org.bukkit.Location center,
        +                    double range)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(ParticleEffect.ParticleData data,
        +                    float offsetX,
        +                    float offsetY,
        +                    float offsetZ,
        +                    float speed,
        +                    int amount,
        +                    org.bukkit.Location center,
        +                    List<org.bukkit.entity.Player> players)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(ParticleEffect.ParticleData data,
        +                    float offsetX,
        +                    float offsetY,
        +                    float offsetZ,
        +                    float speed,
        +                    int amount,
        +                    org.bukkit.Location center,
        +                    org.bukkit.entity.Player... players)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(ParticleEffect.ParticleData data,
        +                    org.bukkit.util.Vector direction,
        +                    float speed,
        +                    org.bukkit.Location center,
        +                    double range)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(ParticleEffect.ParticleData data,
        +                    org.bukkit.util.Vector direction,
        +                    float speed,
        +                    org.bukkit.Location center,
        +                    List<org.bukkit.entity.Player> players)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        +
      • +
      + + + +
        +
      • +

        display

        +
        public void display(ParticleEffect.ParticleData data,
        +                    org.bukkit.util.Vector direction,
        +                    float speed,
        +                    org.bukkit.Location center,
        +                    org.bukkit.entity.Player... players)
        +             throws com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException,
        +                    com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        Deprecated. 
        +
        +
        Throws:
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleVersionException
        +
        com.github.shynixn.petblocks.lib.ParticleEffect.ParticleDataException
        +
        +
      • +
      + + + +
        +
      • +

        getParticleEffectFromName

        +
        public static ParticleEffect getParticleEffectFromName(String name)
        +
        Deprecated. 
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.DataType.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.DataType.html new file mode 100644 index 000000000..4e761bbad --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.DataType.html @@ -0,0 +1,560 @@ + + + + + + +ParticleReflectionUtils.DataType (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Enum ParticleReflectionUtils.DataType

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.PackageType.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.PackageType.html new file mode 100644 index 000000000..ab1fc37a4 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.PackageType.html @@ -0,0 +1,633 @@ + + + + + + +ParticleReflectionUtils.PackageType (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Enum ParticleReflectionUtils.PackageType

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.html new file mode 100644 index 000000000..f681bf2a5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ParticleReflectionUtils.html @@ -0,0 +1,815 @@ + + + + + + +ParticleReflectionUtils (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ParticleReflectionUtils

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.lib.ParticleReflectionUtils
    • +
    +
  • +
+
+
    +
  • +
    +
    Deprecated.
    +
    +
    @Deprecated
    +public final class ParticleReflectionUtils
    +extends Object
    +
    ReflectionUtils +

    + This class provides useful methods which makes dealing with reflection much easier, especially when working with Bukkit +

    + You are welcome to use it, modify it and redistribute it under the following conditions: +

      +
    • Don't claim this class as your own +
    • Don't remove this disclaimer +
    +

    + It would be nice if you provide credit to me if you use this class in a published project

    +
    +
    Version:
    +
    1.1
    +
    Author:
    +
    DarkBlade12
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.PluginLoad.html b/docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.PluginLoad.html new file mode 100644 index 000000000..0d9961d01 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.PluginLoad.html @@ -0,0 +1,167 @@ + + + + + + +PluginLoader.PluginLoad (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Annotation Type PluginLoader.PluginLoad

+
+
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.PluginUnload.html b/docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.PluginUnload.html new file mode 100644 index 000000000..b2c3a2b50 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.PluginUnload.html @@ -0,0 +1,167 @@ + + + + + + +PluginLoader.PluginUnload (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Annotation Type PluginLoader.PluginUnload

+
+
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.html b/docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.html new file mode 100644 index 000000000..4bfcef056 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/PluginLoader.html @@ -0,0 +1,279 @@ + + + + + + +PluginLoader (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class PluginLoader

+
+
+ +
+
    +
  • +
    +
    +
    public final class PluginLoader
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        load

        +
        public static void load(org.bukkit.plugin.java.JavaPlugin plugin,
        +                        Class<?>... classes)
        +
      • +
      + + + +
        +
      • +

        unload

        +
        public static void unload(org.bukkit.plugin.java.JavaPlugin plugin,
        +                          Class<?>... classes)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ReflectionLib.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ReflectionLib.html new file mode 100644 index 000000000..195b0784d --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ReflectionLib.html @@ -0,0 +1,358 @@ + + + + + + +ReflectionLib (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ReflectionLib

+
+
+ +
+
    +
  • +
    +
    Deprecated.
    +
    +
    @Deprecated
    +public final class ReflectionLib
    +extends Object
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ReflectionLib

        +
        public ReflectionLib()
        +
        Deprecated. 
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        invokeConstructor

        +
        public static Object invokeConstructor(Class<?> clazz,
        +                                       Object... params)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        invokeMethodByObject

        +
        public static Object invokeMethodByObject(Object object,
        +                                          String name,
        +                                          Object... params)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getValueFromField

        +
        public static Object getValueFromField(String fieldName,
        +                                       Object object)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        invokeMethodByClazz

        +
        public static Object invokeMethodByClazz(Class<?> clazz,
        +                                         String name,
        +                                         Object... params)
        +
        Deprecated. 
        +
      • +
      + + + +
        +
      • +

        getClassFromName

        +
        public static Class<?> getClassFromName(String name)
        +
        Deprecated. 
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/ReflectionUtils.html b/docs/apidocs/com/github/shynixn/petblocks/lib/ReflectionUtils.html new file mode 100644 index 000000000..258989afe --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/ReflectionUtils.html @@ -0,0 +1,649 @@ + + + + + + +ReflectionUtils (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class ReflectionUtils

+
+
+ +
+
    +
  • +
    +
    +
    public final class ReflectionUtils
    +extends Object
    +
    Copyright 2017 Shynixn +

    + Do not remove this header! +

    + Version 1.0 +

    + MIT License +

    + Copyright (c) 2016 +

    + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: +

    + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. +

    + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE.

    +
  • +
+
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/RegisterHelper.html b/docs/apidocs/com/github/shynixn/petblocks/lib/RegisterHelper.html new file mode 100644 index 000000000..58a261068 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/RegisterHelper.html @@ -0,0 +1,402 @@ + + + + + + +RegisterHelper (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class RegisterHelper

+
+
+ +
+
    +
  • +
    +
    +
    public final class RegisterHelper
    +extends Object
    +
    Created by Shynixn
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        PREFIX

        +
        public static String PREFIX
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RegisterHelper

        +
        public RegisterHelper()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        register

        +
        public static boolean register(String pluginName)
        +
      • +
      + + + +
        +
      • +

        register

        +
        public static boolean register(String pluginName,
        +                               String path)
        +
      • +
      + + + +
        +
      • +

        isRegistered

        +
        public static boolean isRegistered(String pluginName)
        +
      • +
      + + + +
        +
      • +

        isRegistered

        +
        public static boolean isRegistered(String pluginName,
        +                                   char version)
        +
      • +
      + + + +
        +
      • +

        isRegistered

        +
        public static boolean isRegistered(String pluginName,
        +                                   String version)
        +
      • +
      + + + +
        +
      • +

        register

        +
        public static boolean register(String pluginName,
        +                               String path,
        +                               char version)
        +
      • +
      + + + +
        +
      • +

        register

        +
        public static boolean register(String pluginName,
        +                               String path,
        +                               String version)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/SimpleListener.html b/docs/apidocs/com/github/shynixn/petblocks/lib/SimpleListener.html new file mode 100644 index 000000000..7658b8065 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/SimpleListener.html @@ -0,0 +1,337 @@ + + + + + + +SimpleListener (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class SimpleListener

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    org.bukkit.event.Listener
    +
    +
    +
    Direct Known Subclasses:
    +
    ClearLagListener, Listener19
    +
    +
    +
    +
    public class SimpleListener
    +extends Object
    +implements org.bukkit.event.Listener
    +
    Copyright 2017 Shynixn +

    + Do not remove this header! +

    + Version 1.0 +

    + MIT License +

    + Copyright (c) 2016 +

    + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: +

    + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. +

    + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        plugin

        +
        protected final org.bukkit.plugin.Plugin plugin
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SimpleListener

        +
        public SimpleListener(org.bukkit.plugin.Plugin plugin)
        +
        Initializes a new listener by plugin
        +
        +
        Parameters:
        +
        plugin - plugin
        +
        +
      • +
      + + + +
        +
      • +

        SimpleListener

        +
        public SimpleListener(String plugin)
        +
        Initializes a new listener by pluginname
        +
        +
        Parameters:
        +
        plugin - plugin
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/SkullMetaRegistry.html b/docs/apidocs/com/github/shynixn/petblocks/lib/SkullMetaRegistry.html new file mode 100644 index 000000000..f7fd42b9b --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/SkullMetaRegistry.html @@ -0,0 +1,258 @@ + + + + + + +SkullMetaRegistry (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class SkullMetaRegistry

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.github.shynixn.petblocks.lib.SkullMetaRegistry
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class SkullMetaRegistry
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        convertToSkinSkull

        +
        public static org.bukkit.inventory.ItemStack convertToSkinSkull(org.bukkit.inventory.ItemStack itemStack,
        +                                                                String skinUrl,
        +                                                                String v)
        +
      • +
      + + + +
        +
      • +

        getLink

        +
        public static String getLink(org.bukkit.inventory.ItemStack itemStack,
        +                             String v)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/SoundData.html b/docs/apidocs/com/github/shynixn/petblocks/lib/SoundData.html new file mode 100644 index 000000000..c394b942a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/SoundData.html @@ -0,0 +1,344 @@ + + + + + + +SoundData (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class SoundData

+
+
+ +
+
    +
  • +
    +
    +
    public class SoundData
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SoundData

        +
        public SoundData(org.bukkit.Sound sound,
        +                 double pitch,
        +                 double volume)
        +
      • +
      + + + +
        +
      • +

        SoundData

        +
        public SoundData(org.bukkit.Sound sound,
        +                 double pitch)
        +
      • +
      + + + +
        +
      • +

        SoundData

        +
        public SoundData(org.bukkit.Sound sound)
        +
      • +
      + + + +
        +
      • +

        SoundData

        +
        public SoundData(String name,
        +                 double pitch,
        +                 double volume)
        +
      • +
      + + + +
        +
      • +

        SoundData

        +
        public SoundData(String name)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        playTo

        +
        public void playTo(org.bukkit.entity.Player player)
        +
      • +
      + + + +
        +
      • +

        play

        +
        public void play(org.bukkit.Location location)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/SpigotEvent.html b/docs/apidocs/com/github/shynixn/petblocks/lib/SpigotEvent.html new file mode 100644 index 000000000..d5c9fb671 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/SpigotEvent.html @@ -0,0 +1,321 @@ + + + + + + +SpigotEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + + +
+
com.github.shynixn.petblocks.lib
+

Class SpigotEvent

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.bukkit.event.Event
    • +
    • +
        +
      • com.github.shynixn.petblocks.lib.SpigotEvent
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    PetBlockEvent
    +
    +
    +
    +
    public class SpigotEvent
    +extends org.bukkit.event.Event
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SpigotEvent

        +
        public SpigotEvent()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getHandlers

        +
        public org.bukkit.event.HandlerList getHandlers()
        +
        +
        Specified by:
        +
        getHandlers in class org.bukkit.event.Event
        +
        +
      • +
      + + + +
        +
      • +

        getHandlerList

        +
        public static org.bukkit.event.HandlerList getHandlerList()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitChatColor.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitChatColor.html new file mode 100644 index 000000000..f4ba5d75d --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitChatColor.html @@ -0,0 +1,175 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.BukkitChatColor (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.BukkitChatColor

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitCommands.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitCommands.html new file mode 100644 index 000000000..f51d2f16e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitCommands.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.BukkitCommands (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.BukkitCommands

+
+
No usage of com.github.shynixn.petblocks.lib.BukkitCommands
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitUtilities.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitUtilities.html new file mode 100644 index 000000000..3e0e7b9b3 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/BukkitUtilities.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.BukkitUtilities (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.BukkitUtilities

+
+
No usage of com.github.shynixn.petblocks.lib.BukkitUtilities
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DataBaseRepository.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DataBaseRepository.html new file mode 100644 index 000000000..c7ca87ec4 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DataBaseRepository.html @@ -0,0 +1,178 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.DataBaseRepository (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.DataBaseRepository

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DynamicCommandHelper.CommandContainer.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DynamicCommandHelper.CommandContainer.html new file mode 100644 index 000000000..9002c7e80 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DynamicCommandHelper.CommandContainer.html @@ -0,0 +1,190 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer

+
+ + + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DynamicCommandHelper.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DynamicCommandHelper.html new file mode 100644 index 000000000..06cb38e8f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/DynamicCommandHelper.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.DynamicCommandHelper (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.DynamicCommandHelper

+
+
No usage of com.github.shynixn.petblocks.lib.DynamicCommandHelper
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ExtensionHikariConnectionContext.SQlRetriever.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ExtensionHikariConnectionContext.SQlRetriever.html new file mode 100644 index 000000000..e7fa72465 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ExtensionHikariConnectionContext.SQlRetriever.html @@ -0,0 +1,183 @@ + + + + + + +Uses of Interface com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext.SQlRetriever (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext.SQlRetriever

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ExtensionHikariConnectionContext.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ExtensionHikariConnectionContext.html new file mode 100644 index 000000000..2cdd875de --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ExtensionHikariConnectionContext.html @@ -0,0 +1,209 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Filtering.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Filtering.html new file mode 100644 index 000000000..45316f16e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Filtering.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.Filtering (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.Filtering

+
+
No usage of com.github.shynixn.petblocks.lib.Filtering
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Interpreter19.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Interpreter19.html new file mode 100644 index 000000000..032b842bd --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Interpreter19.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.Interpreter19 (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.Interpreter19

+
+
No usage of com.github.shynixn.petblocks.lib.Interpreter19
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/LightRegistry.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/LightRegistry.html new file mode 100644 index 000000000..28d1236fc --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/LightRegistry.html @@ -0,0 +1,175 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.LightRegistry (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.LightRegistry

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Particle.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Particle.html new file mode 100644 index 000000000..81a3023ae --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/Particle.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.Particle (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.Particle

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleBuilder.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleBuilder.html new file mode 100644 index 000000000..253c42d0a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleBuilder.html @@ -0,0 +1,269 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleBuilder (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleBuilder

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.BlockData.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.BlockData.html new file mode 100644 index 000000000..cea484d5f --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.BlockData.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleEffect.BlockData (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleEffect.BlockData

+
+
No usage of com.github.shynixn.petblocks.lib.ParticleEffect.BlockData
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ItemData.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ItemData.html new file mode 100644 index 000000000..7db1e95d5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ItemData.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleEffect.ItemData (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleEffect.ItemData

+
+
No usage of com.github.shynixn.petblocks.lib.ParticleEffect.ItemData
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.NoteColor.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.NoteColor.html new file mode 100644 index 000000000..5b004bf99 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.NoteColor.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleEffect.NoteColor (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleEffect.NoteColor

+
+
No usage of com.github.shynixn.petblocks.lib.ParticleEffect.NoteColor
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.OrdinaryColor.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.OrdinaryColor.html new file mode 100644 index 000000000..4517ffc00 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.OrdinaryColor.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor

+
+
No usage of com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleColor.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleColor.html new file mode 100644 index 000000000..6397cb575 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleColor.html @@ -0,0 +1,220 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColor (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColor

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleData.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleData.html new file mode 100644 index 000000000..5e6634ba6 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleData.html @@ -0,0 +1,277 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleData (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleEffect.ParticleData

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticlePacket.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticlePacket.html new file mode 100644 index 000000000..51d18bf46 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticlePacket.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket

+
+
No usage of com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleProperty.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleProperty.html new file mode 100644 index 000000000..1f4eb8d94 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.ParticleProperty.html @@ -0,0 +1,190 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleProperty (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleEffect.ParticleProperty

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.html new file mode 100644 index 000000000..90dc62dac --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleEffect.html @@ -0,0 +1,329 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleEffect (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleEffect

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.DataType.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.DataType.html new file mode 100644 index 000000000..59359b203 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.DataType.html @@ -0,0 +1,179 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.PackageType.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.PackageType.html new file mode 100644 index 000000000..b29a989fa --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.PackageType.html @@ -0,0 +1,249 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleReflectionUtils.PackageType (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleReflectionUtils.PackageType

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.html new file mode 100644 index 000000000..05d93de69 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ParticleReflectionUtils.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ParticleReflectionUtils (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ParticleReflectionUtils

+
+
No usage of com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.PluginLoad.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.PluginLoad.html new file mode 100644 index 000000000..616fc322e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.PluginLoad.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.PluginLoader.PluginLoad (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.PluginLoader.PluginLoad

+
+
No usage of com.github.shynixn.petblocks.lib.PluginLoader.PluginLoad
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.PluginUnload.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.PluginUnload.html new file mode 100644 index 000000000..972c0606e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.PluginUnload.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.PluginLoader.PluginUnload (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.PluginLoader.PluginUnload

+
+
No usage of com.github.shynixn.petblocks.lib.PluginLoader.PluginUnload
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.html new file mode 100644 index 000000000..2b82b7f3e --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/PluginLoader.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.PluginLoader (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.PluginLoader

+
+
No usage of com.github.shynixn.petblocks.lib.PluginLoader
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ReflectionLib.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ReflectionLib.html new file mode 100644 index 000000000..21c62ff47 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ReflectionLib.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ReflectionLib (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ReflectionLib

+
+
No usage of com.github.shynixn.petblocks.lib.ReflectionLib
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ReflectionUtils.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ReflectionUtils.html new file mode 100644 index 000000000..a794e1a54 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/ReflectionUtils.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.ReflectionUtils (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.ReflectionUtils

+
+
No usage of com.github.shynixn.petblocks.lib.ReflectionUtils
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/RegisterHelper.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/RegisterHelper.html new file mode 100644 index 000000000..142ce3000 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/RegisterHelper.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.RegisterHelper (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.RegisterHelper

+
+
No usage of com.github.shynixn.petblocks.lib.RegisterHelper
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SimpleListener.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SimpleListener.html new file mode 100644 index 000000000..f9231fa2a --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SimpleListener.html @@ -0,0 +1,188 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.SimpleListener (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.SimpleListener

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SkullMetaRegistry.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SkullMetaRegistry.html new file mode 100644 index 000000000..4c1d8fdf0 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SkullMetaRegistry.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.SkullMetaRegistry (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.SkullMetaRegistry

+
+
No usage of com.github.shynixn.petblocks.lib.SkullMetaRegistry
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SoundData.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SoundData.html new file mode 100644 index 000000000..133fa044c --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SoundData.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.SoundData (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.SoundData

+
+
No usage of com.github.shynixn.petblocks.lib.SoundData
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SpigotEvent.html b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SpigotEvent.html new file mode 100644 index 000000000..c7e641b16 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/class-use/SpigotEvent.html @@ -0,0 +1,210 @@ + + + + + + +Uses of Class com.github.shynixn.petblocks.lib.SpigotEvent (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Class
com.github.shynixn.petblocks.lib.SpigotEvent

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/package-frame.html b/docs/apidocs/com/github/shynixn/petblocks/lib/package-frame.html new file mode 100644 index 000000000..2521546a5 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/package-frame.html @@ -0,0 +1,64 @@ + + + + + + +com.github.shynixn.petblocks.lib (PetBlocks 6.0.0 API) + + + + + +

com.github.shynixn.petblocks.lib

+ + + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/package-summary.html b/docs/apidocs/com/github/shynixn/petblocks/lib/package-summary.html new file mode 100644 index 000000000..e70d3a2e8 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/package-summary.html @@ -0,0 +1,343 @@ + + + + + + +com.github.shynixn.petblocks.lib (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Package com.github.shynixn.petblocks.lib

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/package-tree.html b/docs/apidocs/com/github/shynixn/petblocks/lib/package-tree.html new file mode 100644 index 000000000..bfab7cec2 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/package-tree.html @@ -0,0 +1,208 @@ + + + + + + +com.github.shynixn.petblocks.lib Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.github.shynixn.petblocks.lib

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Annotation Type Hierarchy

+ +

Enum Hierarchy

+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/com/github/shynixn/petblocks/lib/package-use.html b/docs/apidocs/com/github/shynixn/petblocks/lib/package-use.html new file mode 100644 index 000000000..e5f00f453 --- /dev/null +++ b/docs/apidocs/com/github/shynixn/petblocks/lib/package-use.html @@ -0,0 +1,377 @@ + + + + + + +Uses of Package com.github.shynixn.petblocks.lib (PetBlocks 6.0.0 API) + + + + + + + + + + + +
+

Uses of Package
com.github.shynixn.petblocks.lib

+
+
+ +
+ + + + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/constant-values.html b/docs/apidocs/constant-values.html new file mode 100644 index 000000000..09ad7e1bc --- /dev/null +++ b/docs/apidocs/constant-values.html @@ -0,0 +1,162 @@ + + + + + + +Constant Field Values (PetBlocks 6.0.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Constant Field Values

+

Contents

+ +
+
+ + +

com.github.*

+ +
+ +
+ + + + + + + +
+ + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/deprecated-list.html b/docs/apidocs/deprecated-list.html new file mode 100644 index 000000000..efdf0dfa1 --- /dev/null +++ b/docs/apidocs/deprecated-list.html @@ -0,0 +1,298 @@ + + + + + + +Deprecated List (PetBlocks 6.0.0 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/help-doc.html b/docs/apidocs/help-doc.html new file mode 100644 index 000000000..8d9a644bd --- /dev/null +++ b/docs/apidocs/help-doc.html @@ -0,0 +1,231 @@ + + + + + + +API Help (PetBlocks 6.0.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/index-all.html b/docs/apidocs/index-all.html new file mode 100644 index 000000000..949ae87fc --- /dev/null +++ b/docs/apidocs/index-all.html @@ -0,0 +1,3394 @@ + + + + + + +Index (PetBlocks 6.0.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I J K L M N O P R S T U V W Z  + + +

A

+
+
a(BlockPosition, Block) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie
+
 
+
a() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder
+
 
+
a(BlockPosition, Block) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie
+
 
+
a() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder
+
 
+
a(BlockPosition, Block) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie
+
 
+
a() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder
+
 
+
a(BlockPosition, Block) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie
+
 
+
a() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder
+
 
+
a(BlockPosition, Block) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie
+
 
+
a() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder
+
 
+
a(BlockPosition, Block) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie
+
 
+
a() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder
+
 
+
a(BlockPosition, Block) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie
+
 
+
a() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder
+
 
+
a(BlockPosition, Block) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie
+
 
+
a() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder
+
 
+
accessWorldGuardSpawn(Location) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
activateHead(String, ItemStack) - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
afraidWaterEffect(Entity, int) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
Age - Enum in com.github.shynixn.petblocks.api.entities
+
+
Created by Shynixn
+
+
allowPetSpawning(Location) - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
allowSpawn(Location, Plugin) - Static method in class com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection5
+
 
+
allowSpawn(Location, Plugin) - Static method in class com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection6
+
 
+
apply(Location, Player...) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Plays the effect at the given location to the given players.
+
+
apply(Location, Player...) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Plays the effect at the given location to the given players.
+
+
+ + + +

B

+
+
BAT_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
BIRD_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
BLAZE_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
BlockData(Material, byte) - Constructor for class com.github.shynixn.petblocks.lib.ParticleEffect.BlockData
+
+
Deprecated.
+
build() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
BukkitChatColor - Enum in com.github.shynixn.petblocks.lib
+
 
+
BukkitCommands - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
+
BukkitCommands(String, Plugin) - Constructor for class com.github.shynixn.petblocks.lib.BukkitCommands
+
+
Deprecated.
+
BukkitUtilities - Class in com.github.shynixn.petblocks.lib
+
 
+
+ + + +

C

+
+
c() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder
+
 
+
c() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder
+
 
+
c() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder
+
 
+
c() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder
+
 
+
c() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder
+
 
+
c() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder
+
 
+
c() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder
+
 
+
c() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder
+
 
+
CALL - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
CANCEL - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
CANNON - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
canSpawnInRegion(String[], Location, Plugin) - Static method in class com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection5
+
 
+
canSpawnInRegion(String[], Location, Plugin) - Static method in class com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection6
+
 
+
canSpawnInRegion(String[], Location) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
CAT_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
changeSkullSkin(ItemStack, String) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
CHICKEN_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
ck() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit
+
 
+
ClearLagListener - Class in com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag
+
 
+
ClearLagListener(JavaPlugin) - Constructor for class com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag.ClearLagListener
+
 
+
close() - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
+
Closes this resource, relinquishing any underlying resources.
+
+
close() - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Closes this resource, relinquishing any underlying resources.
+
+
close() - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Closes this resource, relinquishing any underlying resources.
+
+
close() - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Closes the database context
+
+
cm() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit
+
 
+
cm() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit
+
 
+
COLOR_COSTUME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
com.github.shynixn.petblocks.api - package com.github.shynixn.petblocks.api
+
 
+
com.github.shynixn.petblocks.api.entities - package com.github.shynixn.petblocks.api.entities
+
 
+
com.github.shynixn.petblocks.api.events - package com.github.shynixn.petblocks.api.events
+
 
+
com.github.shynixn.petblocks.api.persistence.controller - package com.github.shynixn.petblocks.api.persistence.controller
+
 
+
com.github.shynixn.petblocks.api.persistence.entity - package com.github.shynixn.petblocks.api.persistence.entity
+
 
+
com.github.shynixn.petblocks.business - package com.github.shynixn.petblocks.business
+
 
+
com.github.shynixn.petblocks.business.bukkit - package com.github.shynixn.petblocks.business.bukkit
+
 
+
com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag - package com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag
+
 
+
com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish - package com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish
+
 
+
com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard - package com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard
+
 
+
com.github.shynixn.petblocks.business.bukkit.nms - package com.github.shynixn.petblocks.business.bukkit.nms
+
 
+
com.github.shynixn.petblocks.business.bukkit.nms.helper - package com.github.shynixn.petblocks.business.bukkit.nms.helper
+
 
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1 - package com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1
+
 
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1 - package com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1
+
 
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1 - package com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1
+
 
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1 - package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1
+
 
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2 - package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2
+
 
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3 - package com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3
+
 
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1 - package com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1
+
 
+
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2 - package com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2
+
 
+
com.github.shynixn.petblocks.business.logic.business - package com.github.shynixn.petblocks.business.logic.business
+
 
+
com.github.shynixn.petblocks.business.logic.configuration - package com.github.shynixn.petblocks.business.logic.configuration
+
 
+
com.github.shynixn.petblocks.business.logic.persistence - package com.github.shynixn.petblocks.business.logic.persistence
+
 
+
com.github.shynixn.petblocks.business.logic.persistence.controller - package com.github.shynixn.petblocks.business.logic.persistence.controller
+
 
+
com.github.shynixn.petblocks.business.logic.persistence.entity - package com.github.shynixn.petblocks.business.logic.persistence.entity
+
 
+
com.github.shynixn.petblocks.lib - package com.github.shynixn.petblocks.lib
+
 
+
CommandContainer(String, FileConfiguration) - Constructor for class com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer
+
 
+
compare(Class<?>[], Class<?>[]) - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
compareItemName(ItemStack, String) - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
Config - Class in com.github.shynixn.petblocks.business
+
 
+
ConfigCommands - Class in com.github.shynixn.petblocks.business.logic.configuration
+
+
Created by Shynixn
+
+
ConfigGUI - Class in com.github.shynixn.petblocks.business.logic.configuration
+
+
Created by Shynixn
+
+
ConfigParticle - Class in com.github.shynixn.petblocks.business.logic.configuration
+
+
Created by Shynixn
+
+
ConfigPet - Class in com.github.shynixn.petblocks.business.logic.configuration
+
+
Created by Shynixn
+
+
consoleSendCommandEvent(CommandSender, String[]) - Method in class com.github.shynixn.petblocks.lib.BukkitCommands
+
+
Deprecated.
+
convertToSkinSkull(ItemStack, String, String) - Static method in class com.github.shynixn.petblocks.lib.SkullMetaRegistry
+
 
+
copy() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Copies the current builder
+
+
copy() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
copyFile(InputStream, File) - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
COSTUME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
COW_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
create() - Method in interface com.github.shynixn.petblocks.api.persistence.controller.ParticleEffectMetaController
+
+
Creates a new particleEffectMeta
+
+
create(Player) - Method in interface com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController
+
+
Creates a new playerData from the given player
+
+
create() - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
+
Creates a new particleEffectMeta
+
+
create(Player) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Creates a new playerData from the given player
+
+
createChild(EntityAgeable) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit
+
 
+
createFile(File) - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
createParticleEffectController() - Static method in class com.github.shynixn.petblocks.business.logic.persistence.Factory
+
 
+
createPetBlock(Location, PetMeta) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
createPetDataController() - Static method in class com.github.shynixn.petblocks.business.logic.persistence.Factory
+
 
+
createPetMeta(Player, PetType) - Method in class com.github.shynixn.petblocks.business.logic.business.PetDataManager
+
 
+
createPlayerDataController() - Static method in class com.github.shynixn.petblocks.business.logic.persistence.Factory
+
 
+
CREEPER_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
CUSTOM_COSTUME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
CustomEntity - Interface in com.github.shynixn.petblocks.api.entities
+
+
Created by Shynixn
+
+
CustomRabbit - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1
+
 
+
CustomRabbit(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit
+
 
+
CustomRabbit(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit
+
 
+
CustomRabbit - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1
+
 
+
CustomRabbit(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit
+
 
+
CustomRabbit(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit
+
 
+
CustomRabbit - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1
+
 
+
CustomRabbit(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit
+
 
+
CustomRabbit(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit
+
 
+
CustomRabbit - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1
+
 
+
CustomRabbit(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit
+
 
+
CustomRabbit(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit
+
 
+
CustomRabbit - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2
+
 
+
CustomRabbit(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit
+
 
+
CustomRabbit(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit
+
 
+
CustomRabbit - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3
+
 
+
CustomRabbit(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit
+
 
+
CustomRabbit(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit
+
 
+
CustomRabbit - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1
+
 
+
CustomRabbit(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit
+
 
+
CustomRabbit(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit
+
 
+
CustomRabbit - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2
+
 
+
CustomRabbit(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit
+
 
+
CustomRabbit(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit
+
 
+
CustomZombie - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1
+
+
Created by Shynixn
+
+
CustomZombie(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie
+
 
+
CustomZombie(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie
+
 
+
CustomZombie - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1
+
+
Created by Shynixn
+
+
CustomZombie(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie
+
 
+
CustomZombie(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie
+
 
+
CustomZombie - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1
+
+
Created by Shynixn
+
+
CustomZombie(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie
+
 
+
CustomZombie(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie
+
 
+
CustomZombie - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1
+
+
Created by Shynixn
+
+
CustomZombie(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie
+
 
+
CustomZombie(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie
+
 
+
CustomZombie - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2
+
+
Created by Shynixn
+
+
CustomZombie(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie
+
 
+
CustomZombie(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie
+
 
+
CustomZombie - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3
+
+
Created by Shynixn
+
+
CustomZombie(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie
+
 
+
CustomZombie(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie
+
 
+
CustomZombie - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1
+
+
Created by Shynixn
+
+
CustomZombie(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie
+
 
+
CustomZombie(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie
+
 
+
CustomZombie - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2
+
+
Created by Shynixn
+
+
CustomZombie(World) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie
+
 
+
CustomZombie(Player, PetMeta) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie
+
 
+
+ + + +

D

+
+
da() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit
+
 
+
damage(double) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
DataBaseRepository<T> - Class in com.github.shynixn.petblocks.lib
+
+
Copyright 2017 Shynixn + + Do not remove this header!
+
+
DataBaseRepository() - Constructor for class com.github.shynixn.petblocks.lib.DataBaseRepository
+
 
+
db() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit
+
 
+
delete(ParticleEffectMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
+
Deletes the item from the database
+
+
delete(PetMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Deletes the item from the database
+
+
delete(PlayerMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Deletes the item from the database
+
+
delete(T) - Method in class com.github.shynixn.petblocks.lib.DataBaseRepository
+
+
Deletes the item from the database
+
+
df() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit
+
 
+
di() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit
+
 
+
disable() - Static method in class com.github.shynixn.petblocks.business.logic.persistence.Factory
+
 
+
DISABLE_PET - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
display(float, float, float, float, int, Location, double) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(float, float, float, float, int, Location, List<Player>) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(float, float, float, float, int, Location, Player...) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(Vector, float, Location, double) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(Vector, float, Location, List<Player>) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(Vector, float, Location, Player...) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(ParticleEffect.ParticleColor, Location, double) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(ParticleEffect.ParticleColor, Location, List<Player>) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(ParticleEffect.ParticleColor, Location, Player...) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(ParticleEffect.ParticleData, float, float, float, float, int, Location, double) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(ParticleEffect.ParticleData, float, float, float, float, int, Location, List<Player>) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(ParticleEffect.ParticleData, float, float, float, float, int, Location, Player...) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(ParticleEffect.ParticleData, Vector, float, Location, double) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(ParticleEffect.ParticleData, Vector, float, Location, List<Player>) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
display(ParticleEffect.ParticleData, Vector, float, Location, Player...) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
dm() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit
+
 
+
DOG_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
doTick(int, PetBlock, PetBlockHelper.TickCallBack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
DRAGON_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
DynamicCommandHelper - Class in com.github.shynixn.petblocks.lib
+
+
Created by Shynixn
+
+
DynamicCommandHelper(DynamicCommandHelper.CommandContainer) - Constructor for class com.github.shynixn.petblocks.lib.DynamicCommandHelper
+
 
+
DynamicCommandHelper.CommandContainer - Class in com.github.shynixn.petblocks.lib
+
 
+
+ + + +

E

+
+
eject(Player) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
eject(PetBlock, Player, PetBlockHelper.TickCallBack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
EMPTY - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
ENABLE_PET - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
ENDERMAN_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
equals(Object) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Checks if 2 builders are equal
+
+
execute(CommandSender, String, String[]) - Method in class com.github.shynixn.petblocks.lib.DynamicCommandHelper
+
 
+
execute(String, Connection, Object...) - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Executes a preparedStatement and sets the given parameters to the statement
+
+
executeInsert(String, Connection, Object...) - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Executes a preparedStatement and sets the given parameters to the statement
+
+
executeMovingSound(Entity, Player, PetMeta, long) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
executeQuery(String, Connection, Object...) - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Executes a preparedStatement and sets the given parameters to the statement
+
+
executeStored(String, Connection, Object...) - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Reads a sqlStatement from the given fileName, executes it and sets the given parameter
+
+
executeStoredInsert(String, Connection, Object...) - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Reads a sqlStatement from the given fileName, executes it and sets the given parameter
+
+
executeStoredQuery(String, Connection, Object...) - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Reads a sqlStatement from the given fileName, executes it and sets the given parameter
+
+
executeStoredUpdate(String, Connection, Object...) - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Reads a sqlStatement from the given fileName, executes it and sets the given parameter
+
+
executeUpdate(String, Connection, Object...) - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Executes a preparedStatement and sets the given parameters to the statement
+
+
ExtensionHikariConnectionContext - Class in com.github.shynixn.petblocks.lib
+
+
Copyright 2017 Shynixn + + Do not remove this header!
+
+
ExtensionHikariConnectionContext.SQlRetriever - Interface in com.github.shynixn.petblocks.lib
+
 
+
+ + + +

F

+
+
Factory - Class in com.github.shynixn.petblocks.business.logic.persistence
+
 
+
Factory() - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.Factory
+
 
+
Filtering - Class in com.github.shynixn.petblocks.lib
+
 
+
Filtering() - Constructor for class com.github.shynixn.petblocks.lib.Filtering
+
 
+
filterMessages() - Static method in class com.github.shynixn.petblocks.lib.Filtering
+
 
+
fixJoinDefaultPet(PetMeta) - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
from(ResultSet) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
+
Generates the entity from the given resultSet
+
+
from(ResultSet) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Generates the entity from the given resultSet
+
+
from(ResultSet) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Generates the entity from the given resultSet
+
+
from(Player) - Static method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData
+
+
Generates the playerData from a player
+
+
from(ResultSet) - Method in class com.github.shynixn.petblocks.lib.DataBaseRepository
+
+
Generates the entity from the given resultSet
+
+
from(String, String, ExtensionHikariConnectionContext.SQlRetriever) - Static method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Opens a new DatabaseContext for the given url
+
+
from(String, String, String, int, String, String, String, ExtensionHikariConnectionContext.SQlRetriever) - Static method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Opens a new DatabaseContext for the given ip, port, database, username and password
+
+
fromClass(Class<?>) - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
fromId(int) - Static method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
fromName(String) - Static method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
+ + + +

G

+
+
generate() - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
get() - Method in enum com.github.shynixn.petblocks.business.Permission
+
 
+
getAge() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getAge() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getAge_largeticks() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getAge_maxticks() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getAge_smallticks() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getAgeFromTicks(int) - Static method in enum com.github.shynixn.petblocks.api.entities.Age
+
 
+
getAgeInTicks() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getAgeInTicks() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getAll() - Method in interface com.github.shynixn.petblocks.api.persistence.controller.IController
+
+
Returns all items from the repository as unmodifiableList
+
+
getAll() - Method in class com.github.shynixn.petblocks.lib.DataBaseRepository
+
+
Returns all items from the repository as unmodifiableList
+
+
getAmount() - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
getAmount() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the amount of particles of the particleEffect
+
+
getAmount() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the amount of particles of the particleEffect
+
+
getAmount() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getAmount() - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
getAmount() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getArmorStand() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
getBlue() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the RGB color blue of the particleEffect
+
+
getBlue() - Method in enum com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleColor
+
+
Returns the RGB value blue
+
+
getBlue() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the RGB color blue of the particleEffect
+
+
getBlue() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getBlue() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor
+
+
Deprecated.
+
getById(long) - Method in interface com.github.shynixn.petblocks.api.persistence.controller.IDatabaseController
+
+
Returns the item of the given id
+
+
getById(long) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
+
Returns the item of the given id
+
+
getById(long) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Returns the item of the given id
+
+
getById(long) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Returns the item of the given id
+
+
getByPlayer(Player) - Method in interface com.github.shynixn.petblocks.api.persistence.controller.PetMetaController
+
+
Returns the petdata from the given player
+
+
getByPlayer(Player) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Returns the petdata from the given player
+
+
getByUUID(UUID) - Method in interface com.github.shynixn.petblocks.api.persistence.controller.PlayerMetaController
+
+
Returns the playerMeta of the given uuid
+
+
getByUUID(UUID) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Returns the playerMeta of the given uuid
+
+
getClass(String) - Method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.PackageType
+
+
Deprecated.
+
getClassFromName(String) - Static method in class com.github.shynixn.petblocks.lib.ReflectionLib
+
+
Deprecated.
+
getColoredItemStacks() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getCombat_health() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getCommand() - Method in class com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer
+
 
+
getConnection() - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Provides an connection to the database which has to be closed after being used
+
+
getConstructor(Class<?>, Class<?>...) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
getConstructor(String, ParticleReflectionUtils.PackageType, Class<?>...) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
getContainer(PetType) - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getCostume() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getCustomItemStacks() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getDamage() - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
getData() - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
getData() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the data of the particleEffect
+
+
getData() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the data of the particleEffect
+
+
getData() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getData() - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
getData() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getData() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleData
+
+
Deprecated.
+
getDatabaseClasses() - Method in class com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin
+
 
+
getDefaultItemStacks() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getDefaultPetName(Player) - Static method in class com.github.shynixn.petblocks.business.Language
+
 
+
getDescription() - Method in class com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer
+
 
+
getDesign_maxPetNameLength() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getDisplayName() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
getDisplayName() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getDisplayName(String) - Static method in class com.github.shynixn.petblocks.business.Language
+
 
+
getDisplayName() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getDurability() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getEffect() - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
getEffect() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getEffect() - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
getEffect() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getEffectName() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the effect of the particleEffect
+
+
getEffectName() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the effect of the particleEffect
+
+
getEffectType() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the particleEffectType of the particleEffect
+
+
getEffectType() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the particleEffectType of the particleEffect
+
+
getField(Class<?>, boolean, String) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
getField(String, ParticleReflectionUtils.PackageType, boolean, String) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
getFollow_maxRangeTeleport() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getGeneral_defaultAppearanceContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getGeneral_disablePetContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getGeneral_emptyslotContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getGeneral_enablePetContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getGeneral_myContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getGeneral_nextpageContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getGeneral_previouspageContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getGreen() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the RGB color green of the particleEffect
+
+
getGreen() - Method in enum com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleColor
+
+
Returns the RGB value green
+
+
getGreen() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the RGB color green of the particleEffect
+
+
getGreen() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getGreen() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor
+
+
Deprecated.
+
getHandlerList() - Static method in class com.github.shynixn.petblocks.lib.SpigotEvent
+
 
+
getHandlers() - Method in class com.github.shynixn.petblocks.lib.SpigotEvent
+
 
+
getHeadDisplayName() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getHeadDisplayName() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getHeadLore() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getHeadLore() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getId() - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
getId() - Method in enum com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleEffectType
+
+
Returns the id of the particleEffectType
+
+
getId() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.Persistenceable
+
+
Returns the id of the object
+
+
getId() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PersistenceObject
+
+
Returns the id of the object
+
+
getId() - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
getInstance() - Static method in class com.github.shynixn.petblocks.business.Config
+
 
+
getInstance() - Static method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands
+
 
+
getInstance() - Static method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getInstance() - Static method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle
+
 
+
getInstance() - Static method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getItemInHand19(Player, boolean) - Static method in class com.github.shynixn.petblocks.lib.Interpreter19
+
 
+
getItems_callpetContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_cancelpetContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_cannonpetContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_colorcostumeContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_customcostumeContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_defaultcostumeContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_hatpetContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_namingContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_particlepetContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_ridingpetContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_skullNamingContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_soundDisabledContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getItems_soundEnabledContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
getLink(ItemStack, String) - Static method in class com.github.shynixn.petblocks.lib.SkullMetaRegistry
+
 
+
getLocation() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
getLore() - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
getLore(Player, Permission...) - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
getLore(Player, String...) - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
getMaterial() - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
getMaterial() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the material of the particleEffect
+
+
getMaterial() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the material of the particleEffect
+
+
getMaterial() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getMaterial() - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
getMaterial() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getMaterial() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleData
+
+
Deprecated.
+
getMaterialId() - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
getMaterialId() - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
getMaterialId() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getMethod(Class<?>, String, Class<?>...) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
getMethod(String, ParticleReflectionUtils.PackageType, String, Class<?>...) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
getModifier_petclimbing() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getModifier_petriding() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getModifier_petwalking() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getMovement() - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
getMovement() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getMovementEntity() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
getMovementFromName(String) - Static method in enum com.github.shynixn.petblocks.api.entities.Movement
+
 
+
getMovementType() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getMovementType() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getMoveType() - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
getMoveType() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getMoveType() - Method in enum com.github.shynixn.petblocks.api.entities.PetType
+
+
Deprecated.
+
+
getMoveType() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getMoveTypeFromName(String) - Static method in enum com.github.shynixn.petblocks.api.entities.MoveType
+
 
+
getMovingType(PetType) - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
getMyItemStack(Player, String, ItemContainer, String...) - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
getName() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta
+
+
Returns the name of the playerData
+
+
getName() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData
+
+
Returns the name of the playerData
+
+
getName() - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
getNames() - Static method in enum com.github.shynixn.petblocks.api.entities.PetType
+
 
+
getOnlinePlayers() - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
getOwner() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
getOwner() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
+
getOwner() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getPacketData() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleData
+
+
Deprecated.
+
getPacketDataString() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleData
+
+
Deprecated.
+
getParticle(int) - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle
+
 
+
getParticleEffect() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
+
getParticleEffect() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getParticleEffectFromName(String) - Static method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the particleEffectType from name
+
+
getParticleEffectFromName(String) - Static method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
getParticleEffectMeta() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PetMeta
+
+
Returns the particleEffect meta
+
+
getParticleEffectMeta() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Returns the particleEffect meta
+
+
getParticleId() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PetMeta
+
+
Returns the id of the particle
+
+
getParticleId() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Returns the id of the particle
+
+
getParticleItemStacks() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle
+
 
+
getParticlesText() - Static method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns a text of all particleEffects to let the user easily view them
+
+
getPath() - Method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.PackageType
+
+
Deprecated.
+
getPermission() - Method in class com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer
+
 
+
getPermissionMessage() - Method in class com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer
+
 
+
getPetBlock() - Method in class com.github.shynixn.petblocks.api.events.PetBlockEvent
+
 
+
getPetBlock(Player) - Static method in class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
getPetBlock(Player) - Method in class com.github.shynixn.petblocks.business.logic.business.PetBlockManager
+
 
+
getPetblockGuiCommandContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands
+
 
+
getPetblocksConfigurationCommandContainer() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands
+
 
+
getPetMeta() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
getPetMeta(Player) - Static method in class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
getPetMeta(Player) - Method in class com.github.shynixn.petblocks.business.logic.business.PetDataManager
+
 
+
getPetType() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getPetTypeFromName(String) - Static method in enum com.github.shynixn.petblocks.api.entities.PetType
+
 
+
getPlayer() - Method in class com.github.shynixn.petblocks.api.events.PetBlockEvent
+
 
+
getPlayer() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta
+
+
Returns the player of the playerData
+
+
getPlayer() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData
+
+
Returns the player of the playerData
+
+
getPlayerId() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PetMeta
+
+
Returns the id of the player
+
+
getPlayerId() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Returns the id of the player
+
+
getPlayerMeta() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PetMeta
+
+
Returns the meta of the owner
+
+
getPlayerMeta() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Returns the meta of the owner
+
+
getPlugin() - Method in class com.github.shynixn.petblocks.lib.BukkitCommands
+
+
Deprecated.
+
getPosition() - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
getPrimitive() - Method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
getPrimitive(Class<?>) - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
getPrimitive(Class<?>[]) - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
getPrimitive(Object[]) - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
getReappearsInSeconds() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getRed() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the RGB color red of the particleEffect
+
+
getRed() - Method in enum com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleColor
+
+
Returns the RGB value red
+
+
getRed() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the RGB color red of the particleEffect
+
+
getRed() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getRed() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor
+
+
Deprecated.
+
getReference() - Method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
getReference(Class<?>) - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
getReference(Class<?>[]) - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
getReference(Object[]) - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
getRequiredVersion() - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
getServerVersion() - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
getServerVersion() - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.PackageType
+
+
Deprecated.
+
getSimpleName() - Method in enum com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleEffectType
+
+
Returns the name of the particleEffectType
+
+
getSkin() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getSkin() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getSkinDurability() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getSkinDurability() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getSkinMaterial() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getSkinMaterial() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getSkinUrl(ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
getSkullName() - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
getSkullName() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getSpeed() - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
getSpeed() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the speed of the particleEffect
+
+
getSpeed() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the speed of the particleEffect
+
+
getSpeed() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getSpeed() - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
getSpeed() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getSpigotEntity() - Method in interface com.github.shynixn.petblocks.api.entities.CustomEntity
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit
+
 
+
getSpigotEntity() - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie
+
 
+
getStringFromFile(String) - Method in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
+
Manages caching of statements
+
+
getText(String[]) - Method in class com.github.shynixn.petblocks.lib.DynamicCommandHelper
+
 
+
getTicks() - Method in enum com.github.shynixn.petblocks.api.entities.Age
+
 
+
getTicksFromAge(Age) - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
getType() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
getType() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
getUseage() - Method in class com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer
+
 
+
getUUID() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta
+
+
Returns the uuid of the playerData
+
+
getUuid() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getUUID() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData
+
+
Returns the uuid of the playerData
+
+
getValue(Object, Class<?>, boolean, String) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
getValue(Object, String, ParticleReflectionUtils.PackageType, boolean, String) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
getValue(Object, boolean, String) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
getValueFromField(String, Object) - Static method in class com.github.shynixn.petblocks.lib.ReflectionLib
+
+
Deprecated.
+
getValueX() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.NoteColor
+
+
Deprecated.
+
getValueX() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor
+
+
Deprecated.
+
getValueX() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColor
+
+
Deprecated.
+
getValueY() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.NoteColor
+
+
Deprecated.
+
getValueY() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor
+
+
Deprecated.
+
getValueY() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColor
+
+
Deprecated.
+
getValueZ() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.NoteColor
+
+
Deprecated.
+
getValueZ() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor
+
+
Deprecated.
+
getValueZ() - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColor
+
+
Deprecated.
+
getVersion() - Static method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
+
+
Deprecated.
+
getWarpDelay() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
getX() - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
getX() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the x coordinate of the particleEffect
+
+
getX() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the x coordinate of the particleEffect
+
+
getX() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getX() - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
getX() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getY() - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
getY() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the y coordinate of the particleEffect
+
+
getY() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the y coordinate of the particleEffect
+
+
getY() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getY() - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
getY() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
getZ() - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
getZ() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns the z coordinate of the particleEffect
+
+
getZ() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns the z coordinate of the particleEffect
+
+
getZ() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
getZ() - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
getZ() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
GHAST_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
GUI_TITLE - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
+ + + +

H

+
+
hasEntry(Player) - Method in interface com.github.shynixn.petblocks.api.persistence.controller.PetMetaController
+
+
Checks if the player has got an entry in the database
+
+
hasEntry(Player) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Checks if the player has got an entry in the database
+
+
hasId(ParticleEffectMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
+
Checks if the item has got an valid databaseId
+
+
hasId(PetMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Checks if the item has got an valid databaseId
+
+
hasId(PlayerMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Checks if the item has got an valid databaseId
+
+
hasId(T) - Method in class com.github.shynixn.petblocks.lib.DataBaseRepository
+
+
Checks if the item has got an valid databaseId
+
+
hasPetBlock(Player) - Static method in class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
hasPetBlock(Player) - Method in class com.github.shynixn.petblocks.business.logic.business.PetBlockManager
+
 
+
hasPetMeta(Player) - Static method in class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
hasPetMeta(Player) - Method in class com.github.shynixn.petblocks.business.logic.business.PetDataManager
+
 
+
hasProperty(ParticleEffect.ParticleProperty) - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
HAT - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
HORSE_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
HUMAN_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
+ + + +

I

+
+
ICO_PERMS_NO - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
ICO_PERMS_YES - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
IController<T> - Interface in com.github.shynixn.petblocks.api.persistence.controller
+
 
+
IDatabaseController<T> - Interface in com.github.shynixn.petblocks.api.persistence.controller
+
 
+
initialize(Plugin) - Static method in class com.github.shynixn.petblocks.business.logic.persistence.Factory
+
 
+
initialize() - Static method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
+
+
Deprecated.
+
initiliaze(Plugin) - Static method in class com.github.shynixn.petblocks.business.Config
+
 
+
insert(ParticleEffectMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
+
Inserts the item into the database and sets the id
+
+
insert(PetMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Inserts the item into the database and sets the id
+
+
insert(PlayerMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Inserts the item into the database and sets the id
+
+
insert(T) - Method in class com.github.shynixn.petblocks.lib.DataBaseRepository
+
+
Inserts the item into the database and sets the id
+
+
instantiateObject(Class<?>, Object...) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
instantiateObject(String, ParticleReflectionUtils.PackageType, Object...) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
Interpreter19 - Class in com.github.shynixn.petblocks.lib
+
+
Created by Shynixn
+
+
Interpreter19() - Constructor for class com.github.shynixn.petblocks.lib.Interpreter19
+
 
+
interPretSounds19(String) - Static method in class com.github.shynixn.petblocks.lib.Interpreter19
+
 
+
invokeAnnotationByClass(Class<?>, Class<T>) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Invokes the annotation of the given clazz
+
+
invokeAnnotationByField(Field, Class<T>) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Invokes the annotation of the given field
+
+
invokeAnnotationByMethod(Method, Class<T>) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Invokes the annotation of the given method
+
+
invokeClass(String) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Returns the class from the name and converts VERSION to the current server version.
+
+
invokeConstructor(Class<?>, Object...) - Static method in class com.github.shynixn.petblocks.lib.ReflectionLib
+
+
Deprecated.
+
invokeConstructor(Class<T>, Class<?>[], Object[]) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Creates a new instance of the given clazz, paramTypes, params
+
+
invokeDefaultConstructor(Class<T>) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Creates a new instance of the given clazz with the default constructor
+
+
invokeFieldByClass(Class<?>, String) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Invokes the field of the given class and name
+
+
invokeFieldByObject(Object, String) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Invokes the field of the given instance and name
+
+
invokeFieldByObject(Object, String, Class<?>) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Invokes the field of the given instance and name
+
+
invokeMethod(Object, String, Object...) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
invokeMethod(Object, Class<?>, String, Object...) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
invokeMethod(Object, String, ParticleReflectionUtils.PackageType, String, Object...) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
invokeMethodByClass(Class<?>, String, Class<?>[], Object[]) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Invokes the static method of the given clazz, name, paramTypes, params
+
+
invokeMethodByClazz(Class<?>, String, Object...) - Static method in class com.github.shynixn.petblocks.lib.ReflectionLib
+
+
Deprecated.
+
invokeMethodByObject(Object, String, Object...) - Static method in class com.github.shynixn.petblocks.lib.ReflectionLib
+
+
Deprecated.
+
invokeMethodByObject(Object, String, Class<?>[], Object[]) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Invokes the method of the given instance, name, paramTypes, params
+
+
invokeMethodByObject(Object, String, Class<?>[], Object[], Class<?>) - Static method in class com.github.shynixn.petblocks.lib.ReflectionUtils
+
+
Invokes the method of the given instance, name, paramTypes, params
+
+
IRONGOLEM_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
isAfraidOfwater() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
isAfraidwaterParticles() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
isAge_deathOnMaxTicks() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
isBuild() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
isCanceled() - Method in class com.github.shynixn.petblocks.api.events.PetBlockCancelAbleEvent
+
 
+
isChat_async() - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
isChat_highestpriority() - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
isColorParticleEffect() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns if the particleEffect is a color particleEffect
+
+
isColorParticleEffect() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns if the particleEffect is a color particleEffect
+
+
isColorParticleEffect() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
isCombat_invincible() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
isDead() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
isDead(PetBlock) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
isDesign_allowOtherHearSound() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
isDesign_showDamageAnimation() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
isDieing() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
isEnabled() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
isEnabled() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
isEnabled() - Method in class com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer
+
 
+
isFleesInCombat() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
isFollow_carry() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
isFollow_fallOffHead() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
isFollow_wallcolliding() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
isHidden() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
isHidden() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
isInitialized() - Static method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
+
+
Deprecated.
+
isJoin_enabled() - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
isJoin_overwriteExistingPet() - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
isMaterialParticleEffect() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns if the particleEffect is a materialParticleEffect
+
+
isMaterialParticleEffect() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns if the particleEffect is a materialParticleEffect
+
+
isMaterialParticleEffect() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
isNegative(Random) - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
isNoteParticleEffect() - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Returns if the particleEffect is a note particleEffect
+
+
isNoteParticleEffect() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Returns if the particleEffect is a note particleEffect
+
+
isNoteParticleEffect() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
isRegistered(String) - Static method in class com.github.shynixn.petblocks.lib.RegisterHelper
+
 
+
isRegistered(String, char) - Static method in class com.github.shynixn.petblocks.lib.RegisterHelper
+
 
+
isRegistered(String, String) - Static method in class com.github.shynixn.petblocks.lib.RegisterHelper
+
 
+
isRiding() - Method in class com.github.shynixn.petblocks.api.events.PetBlockRideEvent
+
 
+
isSettings_clickemptyback() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
isSettings_copyskin() - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
isSounds() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
isSoundsEnabled() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
isSoundsEnabled() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
isSupported() - Method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
isUnbreakable() - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
isUnbreakable(ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
isUnbreakable(ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder
+
 
+
isUnbreakable(ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder
+
 
+
isUnbreakable(ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder
+
 
+
isUnbreakable(ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder
+
 
+
isUnbreakable(ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder
+
 
+
isUnbreakable(ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder
+
 
+
isUnbreakable(ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder
+
 
+
isUnbreakable(ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder
+
 
+
isUnbreakable() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
isVersionSupported() - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
isWearning() - Method in class com.github.shynixn.petblocks.api.events.PetBlockWearEvent
+
 
+
ItemContainer - Interface in com.github.shynixn.petblocks.api.entities
+
+
Created by Shynixn
+
+
ItemData(Material, byte) - Constructor for class com.github.shynixn.petblocks.lib.ParticleEffect.ItemData
+
+
Deprecated.
+
+ + + +

J

+
+
jump() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
jump(PetBlock) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
+ + + +

K

+
+
killAll() - Method in class com.github.shynixn.petblocks.business.logic.business.PetBlockManager
+
 
+
+ + + +

L

+
+
Language - Class in com.github.shynixn.petblocks.business
+
 
+
Language() - Constructor for class com.github.shynixn.petblocks.business.Language
+
 
+
launch(Vector) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
launch(PetBlock, Vector) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
LAVASLIME_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
LightRegistry - Enum in com.github.shynixn.petblocks.lib
+
 
+
Listener19 - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1
+
 
+
Listener19(List<Player>, Plugin) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.Listener19
+
 
+
load(FileConfiguration) - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands
+
 
+
load(FileConfiguration) - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
+
 
+
load(FileConfiguration) - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle
+
 
+
load(FileConfiguration) - Method in class com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
+
 
+
load(JavaPlugin, Class<?>...) - Static method in class com.github.shynixn.petblocks.lib.PluginLoader
+
 
+
loadSqlStatement(String) - Method in interface com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext.SQlRetriever
+
+
Loads a sqlStatement from the givenFile
+
+
+ + + +

M

+
+
Movement - Enum in com.github.shynixn.petblocks.api.entities
+
+
Created by Shynixn
+
+
MoveType - Enum in com.github.shynixn.petblocks.api.entities
+
 
+
MUTE - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
MY_PET - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
MYSQL_DRIVER - Static variable in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
 
+
+ + + +

N

+
+
NAME_ERROR_MESSAGE - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
NAME_MESSAGE - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
NAME_SUCCES_MESSAGE - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
nameItem(ItemStack, String, String[]) - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
nameItemDisplay(ItemStack, String) - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
NAMING - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
NEXT - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
NMSRegistry - Class in com.github.shynixn.petblocks.business.bukkit.nms
+
 
+
NO_PERMISSION - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
NoteColor(int) - Constructor for class com.github.shynixn.petblocks.lib.ParticleEffect.NoteColor
+
+
Deprecated.
+
NUMBER_PREFIX - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
+ + + +

O

+
+
onCommand(CommandSender, Command, String, String[]) - Method in class com.github.shynixn.petblocks.lib.BukkitCommands
+
+
Deprecated.
+
onCommandSend(CommandSender, String[]) - Method in class com.github.shynixn.petblocks.lib.DynamicCommandHelper
+
 
+
onDisable() - Method in class com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin
+
 
+
onEnable() - Method in class com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin
+
 
+
onEntityRemoveEvent(EntityRemoveEvent) - Method in class com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag.ClearLagListener
+
 
+
onPlayerSwapItems(PlayerSwapHandItemsEvent) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.Listener19
+
 
+
OrdinaryColor(int, int, int) - Constructor for class com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor
+
+
Deprecated.
+
OrdinaryColor(Color) - Constructor for class com.github.shynixn.petblocks.lib.ParticleEffect.OrdinaryColor
+
+
Deprecated.
+
OwnerPathfinder - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1
+
 
+
OwnerPathfinder(EntityInsentient, Player) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder
+
 
+
OwnerPathfinder - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1
+
 
+
OwnerPathfinder(EntityInsentient, Player) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder
+
 
+
OwnerPathfinder - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1
+
 
+
OwnerPathfinder(EntityInsentient, Player) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder
+
 
+
OwnerPathfinder - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1
+
 
+
OwnerPathfinder(EntityInsentient, Player) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder
+
 
+
OwnerPathfinder - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2
+
 
+
OwnerPathfinder(EntityInsentient, Player) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder
+
 
+
OwnerPathfinder - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3
+
 
+
OwnerPathfinder(EntityInsentient, Player) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder
+
 
+
OwnerPathfinder - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1
+
 
+
OwnerPathfinder(EntityInsentient, Player) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder
+
 
+
OwnerPathfinder - Class in com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2
+
 
+
OwnerPathfinder(EntityInsentient, Player) - Constructor for class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder
+
 
+
+ + + +

P

+
+
Particle - Interface in com.github.shynixn.petblocks.api.entities
+
 
+
PARTICLE - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
Particle - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
+
Particle(ParticleBuilder) - Constructor for class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
Particle() - Constructor for class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
ParticleBuilder - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
+
ParticleBuilder() - Constructor for class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
ParticleBuilder(ParticleEffect, double, double, double, double, int) - Constructor for class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
ParticleColor() - Constructor for class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColor
+
+
Deprecated.
+
ParticleData(Material, byte) - Constructor for class com.github.shynixn.petblocks.lib.ParticleEffect.ParticleData
+
+
Deprecated.
+
ParticleEffect - Enum in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
+
ParticleEffect.BlockData - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
ParticleEffect.ItemData - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
ParticleEffect.NoteColor - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
ParticleEffect.OrdinaryColor - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
ParticleEffect.ParticleColor - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
ParticleEffect.ParticleData - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
ParticleEffect.ParticlePacket - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
ParticleEffect.ParticleProperty - Enum in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
ParticleEffectData - Class in com.github.shynixn.petblocks.business.logic.persistence.entity
+
+
Copyright 2017 Shynixn + + Do not remove this header!
+
+
ParticleEffectData() - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Initializes a new ParticleEffectData
+
+
ParticleEffectData(String, int, double, double, double, double) - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Initializes a new ParticleEffectData with the given params
+
+
ParticleEffectData(Map<String, Object>) - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Parses the potioneffect out of the map
+
+
ParticleEffectDataRepository - Class in com.github.shynixn.petblocks.business.logic.persistence.controller
+
 
+
ParticleEffectDataRepository(ExtensionHikariConnectionContext) - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
 
+
ParticleEffectMeta - Interface in com.github.shynixn.petblocks.api.persistence.entity
+
 
+
ParticleEffectMeta.ParticleColor - Enum in com.github.shynixn.petblocks.api.persistence.entity
+
+
ParticleColors
+
+
ParticleEffectMeta.ParticleEffectType - Enum in com.github.shynixn.petblocks.api.persistence.entity
+
+
ParticleEffectTypes
+
+
ParticleEffectMetaController - Interface in com.github.shynixn.petblocks.api.persistence.controller
+
 
+
ParticlePacket(ParticleEffect, float, float, float, float, int, boolean, ParticleEffect.ParticleData) - Constructor for class com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
+
+
Deprecated.
+
ParticlePacket(ParticleEffect, Vector, float, boolean, ParticleEffect.ParticleData) - Constructor for class com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
+
+
Deprecated.
+
ParticlePacket(ParticleEffect, ParticleEffect.ParticleColor, boolean) - Constructor for class com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
+
+
Deprecated.
+
ParticleReflectionUtils - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
+
ParticleReflectionUtils.DataType - Enum in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
Represents an enumeration of Java persistence types with corresponding classes + + This class is part of the ReflectionUtils and follows the same usage conditions
+
+
ParticleReflectionUtils.PackageType - Enum in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
Represents an enumeration of dynamic packages of NMS and CraftBukkit + + This class is part of the ReflectionUtils and follows the same usage conditions
+
+
Permission - Enum in com.github.shynixn.petblocks.business
+
 
+
persist(PetMeta) - Method in class com.github.shynixn.petblocks.business.logic.business.PetDataManager
+
 
+
Persistenceable - Interface in com.github.shynixn.petblocks.api.persistence.entity
+
 
+
PersistenceObject - Class in com.github.shynixn.petblocks.business.logic.persistence.entity
+
 
+
PersistenceObject() - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.entity.PersistenceObject
+
 
+
persistPetMeta(PetMeta) - Static method in class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
PetBlock - Interface in com.github.shynixn.petblocks.api.entities
+
 
+
PetBlockCancelAbleEvent - Class in com.github.shynixn.petblocks.api.events
+
+
Created by Shynixn
+
+
PetBlockCancelAbleEvent(PetBlock) - Constructor for class com.github.shynixn.petblocks.api.events.PetBlockCancelAbleEvent
+
 
+
PetBlockCannonEvent - Class in com.github.shynixn.petblocks.api.events
+
+
Created by Shynixn
+
+
PetBlockCannonEvent(PetBlock) - Constructor for class com.github.shynixn.petblocks.api.events.PetBlockCannonEvent
+
 
+
PetBlockDeathEvent - Class in com.github.shynixn.petblocks.api.events
+
+
Created by Shynixn
+
+
PetBlockDeathEvent(PetBlock) - Constructor for class com.github.shynixn.petblocks.api.events.PetBlockDeathEvent
+
 
+
PetBlockEvent - Class in com.github.shynixn.petblocks.api.events
+
+
Created by Shynixn
+
+
PetBlockEvent(PetBlock) - Constructor for class com.github.shynixn.petblocks.api.events.PetBlockEvent
+
 
+
PetBlockHelper - Class in com.github.shynixn.petblocks.business.bukkit.nms.helper
+
+
Created by Shynixn
+
+
PetBlockHelper.TickCallBack - Interface in com.github.shynixn.petblocks.business.bukkit.nms.helper
+
 
+
PetBlockManager - Class in com.github.shynixn.petblocks.business.logic.business
+
 
+
PetBlockManager(PetDataManager, Plugin) - Constructor for class com.github.shynixn.petblocks.business.logic.business.PetBlockManager
+
 
+
PetBlockMoveEvent - Class in com.github.shynixn.petblocks.api.events
+
+
Created by Shynixn
+
+
PetBlockMoveEvent(PetBlock) - Constructor for class com.github.shynixn.petblocks.api.events.PetBlockMoveEvent
+
 
+
PetBlockRideEvent - Class in com.github.shynixn.petblocks.api.events
+
+
Created by Shynixn
+
+
PetBlockRideEvent(PetBlock, boolean) - Constructor for class com.github.shynixn.petblocks.api.events.PetBlockRideEvent
+
 
+
PetBlocksApi - Class in com.github.shynixn.petblocks.api
+
 
+
PetBlocksApi() - Constructor for class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
PetBlockSpawnEvent - Class in com.github.shynixn.petblocks.api.events
+
+
Created by Shynixn
+
+
PetBlockSpawnEvent(PetBlock) - Constructor for class com.github.shynixn.petblocks.api.events.PetBlockSpawnEvent
+
 
+
PetBlocksPlugin - Class in com.github.shynixn.petblocks.business.bukkit
+
 
+
PetBlocksPlugin() - Constructor for class com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin
+
 
+
PetBlockWearEvent - Class in com.github.shynixn.petblocks.api.events
+
+
Created by Shynixn
+
+
PetBlockWearEvent(PetBlock, boolean) - Constructor for class com.github.shynixn.petblocks.api.events.PetBlockWearEvent
+
 
+
PetData - Class in com.github.shynixn.petblocks.business.logic.persistence.entity
+
 
+
PetData(Player, PetType, String, ItemStack, String) - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
PetData() - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
PetDataManager - Class in com.github.shynixn.petblocks.business.logic.business
+
 
+
PetDataManager(Plugin) - Constructor for class com.github.shynixn.petblocks.business.logic.business.PetDataManager
+
 
+
PetDataRepository - Class in com.github.shynixn.petblocks.business.logic.persistence.controller
+
+
Created by Shynixn
+
+
PetDataRepository(ExtensionHikariConnectionContext) - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
 
+
PetMeta - Interface in com.github.shynixn.petblocks.api.entities
+
+
Deprecated.
+
+
PetMeta - Interface in com.github.shynixn.petblocks.api.persistence.entity
+
 
+
PetMetaController - Interface in com.github.shynixn.petblocks.api.persistence.controller
+
 
+
PetType - Enum in com.github.shynixn.petblocks.api.entities
+
 
+
PIG_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
PIGZOMBIE_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
play(Location) - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
play(Location, Player...) - Method in interface com.github.shynixn.petblocks.api.entities.Particle
+
 
+
play(Location) - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
play(Location, Player...) - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
play(Location) - Method in class com.github.shynixn.petblocks.lib.SoundData
+
 
+
PlayerData - Class in com.github.shynixn.petblocks.business.logic.persistence.entity
+
 
+
PlayerData() - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData
+
 
+
PlayerDataRepository - Class in com.github.shynixn.petblocks.business.logic.persistence.controller
+
+
Created by Shynixn
+
+
PlayerDataRepository(ExtensionHikariConnectionContext) - Constructor for class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
 
+
PlayerMeta - Interface in com.github.shynixn.petblocks.api.persistence.entity
+
 
+
PlayerMetaController - Interface in com.github.shynixn.petblocks.api.persistence.controller
+
 
+
playerSendCommandEvent(Player, String[]) - Method in class com.github.shynixn.petblocks.lib.BukkitCommands
+
+
Deprecated.
+
playMovingSound(Location) - Method in enum com.github.shynixn.petblocks.api.entities.PetType
+
 
+
playMovingSound(Player) - Method in enum com.github.shynixn.petblocks.api.entities.PetType
+
 
+
playRandomSound(Player) - Method in enum com.github.shynixn.petblocks.api.entities.PetType
+
 
+
playRandomSound(Location) - Method in enum com.github.shynixn.petblocks.api.entities.PetType
+
 
+
playTo(Player) - Method in class com.github.shynixn.petblocks.lib.SoundData
+
 
+
plugin - Variable in class com.github.shynixn.petblocks.lib.SimpleListener
+
 
+
PluginLoader - Class in com.github.shynixn.petblocks.lib
+
 
+
PluginLoader.PluginLoad - Annotation Type in com.github.shynixn.petblocks.lib
+
 
+
PluginLoader.PluginUnload - Annotation Type in com.github.shynixn.petblocks.lib
+
 
+
PREFIX - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
PREFIX - Static variable in class com.github.shynixn.petblocks.lib.RegisterHelper
+
 
+
PREFIX_CONSOLE - Static variable in class com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin
+
 
+
PREVIOUS - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
+ + + +

R

+
+
ReflectionLib - Class in com.github.shynixn.petblocks.lib
+
+
Deprecated.
+
+
ReflectionLib() - Constructor for class com.github.shynixn.petblocks.lib.ReflectionLib
+
+
Deprecated.
+
ReflectionUtils - Class in com.github.shynixn.petblocks.lib
+
+
Copyright 2017 Shynixn + + Do not remove this header!
+
+
refreshHeadItemMeta(PetBlock, ItemStack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
refreshHeadMeta() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
register(JavaPlugin) - Static method in class com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish.SuperVanishConnection
+
 
+
register(String) - Method in enum com.github.shynixn.petblocks.lib.LightRegistry
+
 
+
register(Class<?>) - Method in enum com.github.shynixn.petblocks.lib.LightRegistry
+
 
+
register(String) - Static method in class com.github.shynixn.petblocks.lib.RegisterHelper
+
 
+
register(String, String) - Static method in class com.github.shynixn.petblocks.lib.RegisterHelper
+
 
+
register(String, String, char) - Static method in class com.github.shynixn.petblocks.lib.RegisterHelper
+
 
+
register(String, String, String) - Static method in class com.github.shynixn.petblocks.lib.RegisterHelper
+
 
+
registerAll() - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
registerDynamicCommand(String, BukkitCommand) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
RegisterHelper - Class in com.github.shynixn.petblocks.lib
+
+
Created by Shynixn
+
+
RegisterHelper() - Constructor for class com.github.shynixn.petblocks.lib.RegisterHelper
+
 
+
registerListener19(List<Player>, Plugin) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
reload() - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
reload(Plugin) - Static method in class com.github.shynixn.petblocks.business.Language
+
 
+
remove() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
remove(T) - Method in interface com.github.shynixn.petblocks.api.persistence.controller.IController
+
+
Removes an item from the repository
+
+
remove(PetBlock) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
remove(PetMeta) - Method in class com.github.shynixn.petblocks.business.logic.business.PetDataManager
+
 
+
remove(T) - Method in class com.github.shynixn.petblocks.lib.DataBaseRepository
+
+
Removes an item from the repository
+
+
removePetBlock(Player) - Static method in class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
removePetBlock(Player) - Method in class com.github.shynixn.petblocks.business.logic.business.PetBlockManager
+
 
+
removePetMeta(Player) - Static method in class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
replaceServerVersion(String) - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
respawn() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
respawn(PetBlock, PetBlockHelper.TickCallBack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
ride(Player) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
RIDING - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
rollBack() - Static method in class com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection5
+
 
+
rollBack() - Static method in class com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection6
+
 
+
rollbackWorldGuardSpawn(Location) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
run(Location) - Method in interface com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper.TickCallBack
+
 
+
+ + + +

S

+
+
select() - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
+
Selects all items from the database into the list
+
+
select() - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Selects all items from the database into the list
+
+
select() - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Selects all items from the database into the list
+
+
select() - Method in class com.github.shynixn.petblocks.lib.DataBaseRepository
+
+
Selects all items from the database into the list
+
+
sendColorMessage(String, ChatColor, String) - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
sendTo(Location, Player) - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
+
+
Deprecated.
+
sendTo(Location, List<Player>) - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
+
+
Deprecated.
+
sendTo(Location, double) - Method in class com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
+
+
Deprecated.
+
serialize() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Serializes the particleEffect data to be stored to the filesystem
+
+
setAge(Age) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setAge(Age) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setAgeInTicks(int) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setAgeInTicks(int) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setAmount(int) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the amount of particles of the particleEffect
+
+
setAmount(int) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the amount of particles of the particleEffect
+
+
setAmount(int) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setAmount(int) - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
setAmount(int) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setBlue(int) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the blue of the RGB color
+
+
setBlue(int) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the blue of the RGB color
+
+
setBlue(int) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setCanceled(boolean) - Method in class com.github.shynixn.petblocks.api.events.PetBlockCancelAbleEvent
+
 
+
setColor(int, int, int) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the RGB colors of the particleEffect
+
+
setColor(ParticleEffectMeta.ParticleColor) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the color of the particleEffect
+
+
setColor(int, int, int) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the RGB colors of the particleEffect
+
+
setColor(ParticleEffectMeta.ParticleColor) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the color of the particleEffect
+
+
setColor(int, int, int) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setCostume(Material) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setDamage(PetBlock, double, double, PetBlockHelper.TickCallBack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
setData(Byte) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the data of the material of the particleEffect
+
+
setData(Byte) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the data of the material of the particleEffect
+
+
setData(byte) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setData(byte) - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
setData(byte) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setDieing() - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
setDieing(PetBlock) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
setDisplayName(String) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
setDisplayName(String) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setDisplayName(PetBlock, String) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
setDisplayName(String) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setDurability(short) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setEffect(ParticleEffect) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setEffect(ParticleEffect) - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
setEffect(ParticleEffect) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setEffectName(String) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the effectType of the particleEffect
+
+
setEffectName(String) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the effectType of the particleEffect
+
+
setEffectType(ParticleEffectMeta.ParticleEffectType) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the effectType of the particlEffect
+
+
setEffectType(ParticleEffectMeta.ParticleEffectType) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the effectType of the particlEffect
+
+
setEnabled(boolean) - Method in interface com.github.shynixn.petblocks.api.entities.ItemContainer
+
 
+
setEnabled(boolean) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setEnabled(boolean) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setGreen(int) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the green of the RGB color
+
+
setGreen(int) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the green of the RGB color
+
+
setGreen(int) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setHeadDisplayName(String) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setHeadDisplayName(String) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setHeadLore(String[]) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setHeadLore(String[]) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setHidden(boolean) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setHidden(boolean) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setId(long) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PersistenceObject
+
+
Sets the id of the object
+
+
setIsBuild(boolean) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setItemConsideringAge(PetBlock) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
setItemInHand19(Player, ItemStack, boolean) - Static method in class com.github.shynixn.petblocks.lib.Interpreter19
+
 
+
setItemStackTag(ItemStack, Map<String, Object>) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
setItemstackTag(ItemStack, Map<String, Object>) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder
+
 
+
setItemstackTag(ItemStack, Map<String, Object>) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder
+
 
+
setItemstackTag(ItemStack, Map<String, Object>) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder
+
 
+
setItemstackTag(ItemStack, Map<String, Object>) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder
+
 
+
setItemstackTag(ItemStack, Map<String, Object>) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder
+
 
+
setItemstackTag(ItemStack, Map<String, Object>) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder
+
 
+
setItemstackTag(ItemStack, Map<String, Object>) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder
+
 
+
setItemstackTag(ItemStack, Map<String, Object>) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder
+
 
+
setMaterial(Material) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the material of the particleEffect
+
+
setMaterial(Material) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the material of the particleEffect
+
+
setMaterial(Material) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setMaterial(Material) - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
setMaterial(Material) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setMaterialId(int) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setMovement(String) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setMovementType(Movement) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setMovementType(Movement) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setMoveType(MoveType) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setMoveType(MoveType) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setMyContainer(Inventory, String, ItemContainer, Permission...) - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
setMyContainer(Inventory, String, ItemContainer, String...) - Method in class com.github.shynixn.petblocks.business.Config
+
 
+
setName(String) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta
+
+
Sets the name of the playerData
+
+
setName(String) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData
+
+
Sets the name of the playerData
+
+
setNoteColor(int) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the color for note particleEffect
+
+
setNoteColor(int) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the color for note particleEffect
+
+
setNoteColor(int) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setOffset(double, double, double) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setOwner(Player) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setParticleEffect(Particle) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
+
setParticleEffect(Particle) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setParticleEffectMeta(ParticleEffectMeta) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PetMeta
+
+
Sets the particleEffect meta
+
+
setParticleEffectMeta(ParticleEffectMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Sets the particleEffect meta
+
+
setParticleId(long) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PetMeta
+
+
Sets the id of the particle
+
+
setParticleId(long) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Sets the id of the particle
+
+
setPetBlock(Player, PetMeta) - Static method in class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
setPetBlock(Player, PetMeta, int) - Static method in class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
setPetBlock(Player, PetMeta, int) - Method in class com.github.shynixn.petblocks.business.logic.business.PetBlockManager
+
 
+
setPetMeta(Player, PetType) - Static method in class com.github.shynixn.petblocks.api.PetBlocksApi
+
 
+
setPetType(PetType) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setPetType(PetType) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setPlayerId(long) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PetMeta
+
+
Sets the id of the player
+
+
setPlayerId(long) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Sets the id of the player
+
+
setPlayerMeta(PlayerMeta) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PetMeta
+
+
Sets the own meta
+
+
setPlayerMeta(PlayerMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Sets the own meta
+
+
setRed(int) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the red of the RGB color
+
+
setRed(int) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the red of the RGB color
+
+
setRed(int) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setRiding(PetBlock, Player) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
setSkin(String) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
setSkin(Material, byte) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
setSkin(Material, short, String) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setSkin(PetBlock, String) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
setSkin(PetBlock, Material, byte) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
setSkin(Material, short, String) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setSkullName(String) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setSounds(boolean) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setSoundsEnabled(boolean) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setSoundsEnabled(boolean) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setSpeed(double) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the speed of the particleEffect
+
+
setSpeed(double) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the speed of the particleEffect
+
+
setSpeed(double) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setSpeed(double) - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
setSpeed(double) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setUnbreakable(boolean) - Method in interface com.github.shynixn.petblocks.api.entities.PetMeta
+
+
Deprecated.
+
setUnbreakable(boolean) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
 
+
setUuid(UUID) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta
+
+
Sets the uuid of the playerData
+
+
setUuid(String) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setUuid(UUID) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData
+
+
Sets the uuid of the playerData
+
+
setValue(Object, Class<?>, boolean, String, Object) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
setValue(Object, String, ParticleReflectionUtils.PackageType, boolean, String, Object) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
setValue(Object, boolean, String, Object) - Static method in class com.github.shynixn.petblocks.lib.ParticleReflectionUtils
+
+
Deprecated.
+
setX(double) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the x coordinate of the particleEffect
+
+
setX(double) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the x coordinate of the particleEffect
+
+
setX(double) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setX(double) - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
setX(double) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setY(double) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the y coordinate of the particleEffect
+
+
setY(double) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the y coordinate of the particleEffect
+
+
setY(double) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setY(double) - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
setY(double) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
setZ(double) - Method in interface com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta
+
+
Sets the z coordinate of the particleEffect
+
+
setZ(double) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Sets the z coordinate of the particleEffect
+
+
setZ(double) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.PetData
+
+
Deprecated.
+
+
setZ(double) - Method in class com.github.shynixn.petblocks.lib.Particle
+
+
Deprecated.
+
setZ(double) - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
SHEEP_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
SILVERFISH_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
SimpleListener - Class in com.github.shynixn.petblocks.lib
+
+
Copyright 2017 Shynixn + + Do not remove this header!
+
+
SimpleListener(Plugin) - Constructor for class com.github.shynixn.petblocks.lib.SimpleListener
+
+
Initializes a new listener by plugin
+
+
SimpleListener(String) - Constructor for class com.github.shynixn.petblocks.lib.SimpleListener
+
+
Initializes a new listener by pluginname
+
+
size() - Method in interface com.github.shynixn.petblocks.api.persistence.controller.IController
+
+
Returns the amount of items in the repository
+
+
size() - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
+
Returns the amount of items in the repository
+
+
size() - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Returns the amount of items in the repository
+
+
size() - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Returns the amount of items in the repository
+
+
SKELETON_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
SKULL_NAMING - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
SkullMetaRegistry - Class in com.github.shynixn.petblocks.lib
+
 
+
SLIME_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
SNAME_ERROR_MESSAGE - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
SNAME_MESSAGE - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
SNAME_SUCCES_MESSAGE - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
SoundData - Class in com.github.shynixn.petblocks.lib
+
 
+
SoundData(Sound, double, double) - Constructor for class com.github.shynixn.petblocks.lib.SoundData
+
 
+
SoundData(Sound, double) - Constructor for class com.github.shynixn.petblocks.lib.SoundData
+
 
+
SoundData(Sound) - Constructor for class com.github.shynixn.petblocks.lib.SoundData
+
 
+
SoundData(String, double, double) - Constructor for class com.github.shynixn.petblocks.lib.SoundData
+
 
+
SoundData(String) - Constructor for class com.github.shynixn.petblocks.lib.SoundData
+
 
+
spawn(Location) - Method in interface com.github.shynixn.petblocks.api.entities.CustomEntity
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit
+
 
+
spawn(Location) - Method in class com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie
+
 
+
SPIDER_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
SpigotEvent - Class in com.github.shynixn.petblocks.lib
+
 
+
SpigotEvent() - Constructor for class com.github.shynixn.petblocks.lib.SpigotEvent
+
 
+
SQLITE_DRIVER - Static variable in class com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext
+
 
+
startFiltering() - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
store(T) - Method in interface com.github.shynixn.petblocks.api.persistence.controller.IController
+
+
Stores a new a item in the repository
+
+
store(T) - Method in class com.github.shynixn.petblocks.lib.DataBaseRepository
+
+
Stores a new a item in the repository
+
+
SuperVanishConnection - Class in com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish
+
 
+
SuperVanishConnection() - Constructor for class com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish.SuperVanishConnection
+
 
+
+ + + +

T

+
+
teleport(Location) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
teleport(Entity) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
teleport(PetBlock, Location) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
teleportWithOwner(Location) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
toParticle(Class<?>) - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Converts the effect to a bukkitParticle
+
+
toString() - Method in class com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData
+
+
Displays the builder as string
+
+
toString() - Method in enum com.github.shynixn.petblocks.lib.BukkitChatColor
+
 
+
toString() - Method in class com.github.shynixn.petblocks.lib.ParticleBuilder
+
+
Deprecated.
+
toString() - Method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.PackageType
+
+
Deprecated.
+
tryParseInt(String) - Static method in class com.github.shynixn.petblocks.lib.BukkitUtilities
+
 
+
+ + + +

U

+
+
unload(JavaPlugin, Class<?>...) - Static method in class com.github.shynixn.petblocks.lib.PluginLoader
+
 
+
UNMUTE - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
unregister() - Static method in enum com.github.shynixn.petblocks.lib.LightRegistry
+
 
+
unregisterAll() - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
+
 
+
update(ParticleEffectMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.ParticleEffectDataRepository
+
+
Updates the item inside of the database
+
+
update(PetMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PetDataRepository
+
+
Updates the item inside of the database
+
+
update(PlayerMeta) - Method in class com.github.shynixn.petblocks.business.logic.persistence.controller.PlayerDataRepository
+
+
Updates the item inside of the database
+
+
update(T) - Method in class com.github.shynixn.petblocks.lib.DataBaseRepository
+
+
Updates the item inside of the database
+
+
+ + + +

V

+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.api.entities.Age
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.api.entities.Movement
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.api.entities.MoveType
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.api.entities.PetType
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleColor
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleEffectType
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.business.Permission
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.lib.BukkitChatColor
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.lib.LightRegistry
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.lib.ParticleEffect.ParticleProperty
+
+
Deprecated.
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.PackageType
+
+
Deprecated.
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum com.github.shynixn.petblocks.api.entities.Age
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.api.entities.Movement
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.api.entities.MoveType
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.api.entities.PetType
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleColor
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta.ParticleEffectType
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.business.Permission
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.lib.BukkitChatColor
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.lib.LightRegistry
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.lib.ParticleEffect.ParticleProperty
+
+
Deprecated.
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.lib.ParticleEffect
+
+
Deprecated.
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.DataType
+
+
Deprecated.
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.github.shynixn.petblocks.lib.ParticleReflectionUtils.PackageType
+
+
Deprecated.
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
VILLAGER_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
+ + + +

W

+
+
wear(Player) - Method in interface com.github.shynixn.petblocks.api.entities.PetBlock
+
 
+
wear(PetBlock, Player, PetBlockHelper.TickCallBack) - Static method in class com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
+
 
+
WITHER_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
WorldGuardConnection5 - Class in com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard
+
 
+
WorldGuardConnection6 - Class in com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard
+
 
+
+ + + +

Z

+
+
ZOMBIE_DISPLAYNAME - Static variable in class com.github.shynixn.petblocks.business.Language
+
 
+
+A B C D E F G H I J K L M N O P R S T U V W Z 
+ +
+ + + + + + + +
+ + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/index.html b/docs/apidocs/index.html new file mode 100644 index 000000000..5354b1905 --- /dev/null +++ b/docs/apidocs/index.html @@ -0,0 +1,76 @@ + + + + + + +PetBlocks 6.0.0 API + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/docs/apidocs/overview-frame.html b/docs/apidocs/overview-frame.html new file mode 100644 index 000000000..41e47bf4c --- /dev/null +++ b/docs/apidocs/overview-frame.html @@ -0,0 +1,47 @@ + + + + + + +Overview List (PetBlocks 6.0.0 API) + + + + + + + +

 

+ + diff --git a/docs/apidocs/overview-summary.html b/docs/apidocs/overview-summary.html new file mode 100644 index 000000000..f1fe0f749 --- /dev/null +++ b/docs/apidocs/overview-summary.html @@ -0,0 +1,240 @@ + + + + + + +Overview (PetBlocks 6.0.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

PetBlocks 6.0.0 API

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
com.github.shynixn.petblocks.api 
com.github.shynixn.petblocks.api.entities 
com.github.shynixn.petblocks.api.events 
com.github.shynixn.petblocks.api.persistence.controller 
com.github.shynixn.petblocks.api.persistence.entity 
com.github.shynixn.petblocks.business 
com.github.shynixn.petblocks.business.bukkit 
com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag 
com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish 
com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard 
com.github.shynixn.petblocks.business.bukkit.nms 
com.github.shynixn.petblocks.business.bukkit.nms.helper 
com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1 
com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1 
com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1 
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1 
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2 
com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3 
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1 
com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2 
com.github.shynixn.petblocks.business.logic.business 
com.github.shynixn.petblocks.business.logic.configuration 
com.github.shynixn.petblocks.business.logic.persistence 
com.github.shynixn.petblocks.business.logic.persistence.controller 
com.github.shynixn.petblocks.business.logic.persistence.entity 
com.github.shynixn.petblocks.lib 
+
+ +
+ + + + + + + +
+ + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/overview-tree.html b/docs/apidocs/overview-tree.html new file mode 100644 index 000000000..8afa7c8c4 --- /dev/null +++ b/docs/apidocs/overview-tree.html @@ -0,0 +1,693 @@ + + + + + + +Class Hierarchy (PetBlocks 6.0.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.github.shynixn.petblocks.lib.BukkitCommands (implements org.bukkit.command.CommandExecutor)
    • +
    • com.github.shynixn.petblocks.lib.BukkitUtilities
    • +
    • org.bukkit.command.Command +
        +
      • org.bukkit.command.defaults.BukkitCommand + +
      • +
      +
    • +
    • com.github.shynixn.petblocks.business.Config
    • +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigCommands
    • +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigGUI
    • +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigParticle
    • +
    • com.github.shynixn.petblocks.business.logic.configuration.ConfigPet
    • +
    • com.github.shynixn.petblocks.lib.DataBaseRepository<T> (implements com.github.shynixn.petblocks.api.persistence.controller.IDatabaseController<T>) + +
    • +
    • com.github.shynixn.petblocks.lib.DynamicCommandHelper.CommandContainer
    • +
    • net.minecraft.server.v1_10_R1.Entity (implements net.minecraft.server.v1_10_R1.ICommandListener) +
        +
      • net.minecraft.server.v1_10_R1.EntityLiving +
          +
        • net.minecraft.server.v1_10_R1.EntityInsentient +
            +
          • net.minecraft.server.v1_10_R1.EntityCreature +
              +
            • net.minecraft.server.v1_10_R1.EntityAgeable +
                +
              • net.minecraft.server.v1_10_R1.EntityAnimal (implements net.minecraft.server.v1_10_R1.IAnimal) +
                  +
                • net.minecraft.server.v1_10_R1.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_10_R1.EntityMonster (implements net.minecraft.server.v1_10_R1.IMonster) +
                +
              • net.minecraft.server.v1_10_R1.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_11_R1.Entity (implements net.minecraft.server.v1_11_R1.ICommandListener) +
        +
      • net.minecraft.server.v1_11_R1.EntityLiving +
          +
        • net.minecraft.server.v1_11_R1.EntityInsentient +
            +
          • net.minecraft.server.v1_11_R1.EntityCreature +
              +
            • net.minecraft.server.v1_11_R1.EntityAgeable +
                +
              • net.minecraft.server.v1_11_R1.EntityAnimal (implements net.minecraft.server.v1_11_R1.IAnimal) +
                  +
                • net.minecraft.server.v1_11_R1.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_11_R1.EntityMonster (implements net.minecraft.server.v1_11_R1.IMonster) +
                +
              • net.minecraft.server.v1_11_R1.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_12_R1.Entity (implements net.minecraft.server.v1_12_R1.ICommandListener) +
        +
      • net.minecraft.server.v1_12_R1.EntityLiving +
          +
        • net.minecraft.server.v1_12_R1.EntityInsentient +
            +
          • net.minecraft.server.v1_12_R1.EntityCreature +
              +
            • net.minecraft.server.v1_12_R1.EntityAgeable +
                +
              • net.minecraft.server.v1_12_R1.EntityAnimal (implements net.minecraft.server.v1_12_R1.IAnimal) +
                  +
                • net.minecraft.server.v1_12_R1.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_12_R1.EntityMonster (implements net.minecraft.server.v1_12_R1.IMonster) +
                +
              • net.minecraft.server.v1_12_R1.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_8_R1.Entity (implements net.minecraft.server.v1_8_R1.ICommandListener) +
        +
      • net.minecraft.server.v1_8_R1.EntityLiving +
          +
        • net.minecraft.server.v1_8_R1.EntityInsentient +
            +
          • net.minecraft.server.v1_8_R1.EntityCreature +
              +
            • net.minecraft.server.v1_8_R1.EntityAgeable +
                +
              • net.minecraft.server.v1_8_R1.EntityAnimal (implements net.minecraft.server.v1_8_R1.IAnimal) +
                  +
                • net.minecraft.server.v1_8_R1.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_8_R1.EntityMonster (implements net.minecraft.server.v1_8_R1.IMonster) +
                +
              • net.minecraft.server.v1_8_R1.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_8_R2.Entity (implements net.minecraft.server.v1_8_R2.ICommandListener) +
        +
      • net.minecraft.server.v1_8_R2.EntityLiving +
          +
        • net.minecraft.server.v1_8_R2.EntityInsentient +
            +
          • net.minecraft.server.v1_8_R2.EntityCreature +
              +
            • net.minecraft.server.v1_8_R2.EntityAgeable +
                +
              • net.minecraft.server.v1_8_R2.EntityAnimal (implements net.minecraft.server.v1_8_R2.IAnimal) +
                  +
                • net.minecraft.server.v1_8_R2.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_8_R2.EntityMonster (implements net.minecraft.server.v1_8_R2.IMonster) +
                +
              • net.minecraft.server.v1_8_R2.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_8_R3.Entity (implements net.minecraft.server.v1_8_R3.ICommandListener) +
        +
      • net.minecraft.server.v1_8_R3.EntityLiving +
          +
        • net.minecraft.server.v1_8_R3.EntityInsentient +
            +
          • net.minecraft.server.v1_8_R3.EntityCreature +
              +
            • net.minecraft.server.v1_8_R3.EntityAgeable +
                +
              • net.minecraft.server.v1_8_R3.EntityAnimal (implements net.minecraft.server.v1_8_R3.IAnimal) +
                  +
                • net.minecraft.server.v1_8_R3.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_8_R3.EntityMonster (implements net.minecraft.server.v1_8_R3.IMonster) +
                +
              • net.minecraft.server.v1_8_R3.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_9_R1.Entity (implements net.minecraft.server.v1_9_R1.ICommandListener) +
        +
      • net.minecraft.server.v1_9_R1.EntityLiving +
          +
        • net.minecraft.server.v1_9_R1.EntityInsentient +
            +
          • net.minecraft.server.v1_9_R1.EntityCreature +
              +
            • net.minecraft.server.v1_9_R1.EntityAgeable +
                +
              • net.minecraft.server.v1_9_R1.EntityAnimal (implements net.minecraft.server.v1_9_R1.IAnimal) +
                  +
                • net.minecraft.server.v1_9_R1.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_9_R1.EntityMonster (implements net.minecraft.server.v1_9_R1.IMonster) +
                +
              • net.minecraft.server.v1_9_R1.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • net.minecraft.server.v1_9_R2.Entity (implements net.minecraft.server.v1_9_R2.ICommandListener) +
        +
      • net.minecraft.server.v1_9_R2.EntityLiving +
          +
        • net.minecraft.server.v1_9_R2.EntityInsentient +
            +
          • net.minecraft.server.v1_9_R2.EntityCreature +
              +
            • net.minecraft.server.v1_9_R2.EntityAgeable +
                +
              • net.minecraft.server.v1_9_R2.EntityAnimal (implements net.minecraft.server.v1_9_R2.IAnimal) +
                  +
                • net.minecraft.server.v1_9_R2.EntityRabbit +
                    +
                  • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomRabbit (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                  • +
                  +
                • +
                +
              • +
              +
            • +
            • net.minecraft.server.v1_9_R2.EntityMonster (implements net.minecraft.server.v1_9_R2.IMonster) +
                +
              • net.minecraft.server.v1_9_R2.EntityZombie +
                  +
                • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.CustomZombie (implements com.github.shynixn.petblocks.api.entities.CustomEntity)
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • org.bukkit.event.Event + +
    • +
    • com.github.shynixn.petblocks.lib.ExtensionHikariConnectionContext (implements java.lang.AutoCloseable)
    • +
    • com.github.shynixn.petblocks.business.logic.persistence.Factory
    • +
    • com.github.shynixn.petblocks.lib.Filtering
    • +
    • com.github.shynixn.petblocks.lib.Interpreter19
    • +
    • com.github.shynixn.petblocks.business.Language
    • +
    • com.github.shynixn.petblocks.business.bukkit.nms.NMSRegistry
    • +
    • com.github.shynixn.petblocks.lib.Particle (implements com.github.shynixn.petblocks.api.entities.Particle)
    • +
    • com.github.shynixn.petblocks.lib.ParticleBuilder
    • +
    • com.github.shynixn.petblocks.lib.ParticleEffect.ParticleColor + +
    • +
    • com.github.shynixn.petblocks.lib.ParticleEffect.ParticleData + +
    • +
    • com.github.shynixn.petblocks.lib.ParticleEffect.ParticlePacket
    • +
    • com.github.shynixn.petblocks.lib.ParticleReflectionUtils
    • +
    • net.minecraft.server.v1_10_R1.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1.OwnerPathfinder
      • +
      +
    • +
    • net.minecraft.server.v1_11_R1.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1.OwnerPathfinder
      • +
      +
    • +
    • net.minecraft.server.v1_12_R1.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1.OwnerPathfinder
      • +
      +
    • +
    • net.minecraft.server.v1_8_R1.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1.OwnerPathfinder
      • +
      +
    • +
    • net.minecraft.server.v1_8_R2.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2.OwnerPathfinder
      • +
      +
    • +
    • net.minecraft.server.v1_8_R3.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3.OwnerPathfinder
      • +
      +
    • +
    • net.minecraft.server.v1_9_R1.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.OwnerPathfinder
      • +
      +
    • +
    • net.minecraft.server.v1_9_R2.PathfinderGoal +
        +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2.OwnerPathfinder
      • +
      +
    • +
    • com.github.shynixn.petblocks.business.logic.persistence.entity.PersistenceObject (implements com.github.shynixn.petblocks.api.persistence.entity.Persistenceable) +
        +
      • com.github.shynixn.petblocks.business.logic.persistence.entity.ParticleEffectData (implements org.bukkit.configuration.serialization.ConfigurationSerializable, com.github.shynixn.petblocks.api.persistence.entity.ParticleEffectMeta)
      • +
      • com.github.shynixn.petblocks.business.logic.persistence.entity.PetData (implements com.github.shynixn.petblocks.api.persistence.entity.PetMeta)
      • +
      • com.github.shynixn.petblocks.business.logic.persistence.entity.PlayerData (implements com.github.shynixn.petblocks.api.persistence.entity.PlayerMeta)
      • +
      +
    • +
    • com.github.shynixn.petblocks.business.bukkit.nms.helper.PetBlockHelper
    • +
    • com.github.shynixn.petblocks.business.logic.business.PetBlockManager
    • +
    • com.github.shynixn.petblocks.api.PetBlocksApi
    • +
    • com.github.shynixn.petblocks.business.logic.business.PetDataManager
    • +
    • org.bukkit.plugin.PluginBase (implements org.bukkit.plugin.Plugin) +
        +
      • org.bukkit.plugin.java.JavaPlugin + +
      • +
      +
    • +
    • com.github.shynixn.petblocks.lib.PluginLoader
    • +
    • com.github.shynixn.petblocks.lib.ReflectionLib
    • +
    • com.github.shynixn.petblocks.lib.ReflectionUtils
    • +
    • com.github.shynixn.petblocks.lib.RegisterHelper
    • +
    • com.github.shynixn.petblocks.lib.SimpleListener (implements org.bukkit.event.Listener) +
        +
      • com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag.ClearLagListener
      • +
      • com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1.Listener19
      • +
      +
    • +
    • com.github.shynixn.petblocks.lib.SkullMetaRegistry
    • +
    • com.github.shynixn.petblocks.lib.SoundData
    • +
    • com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish.SuperVanishConnection
    • +
    • com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection5
    • +
    • com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard.WorldGuardConnection6
    • +
    +
  • +
+

Interface Hierarchy

+ +

Annotation Type Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/package-list b/docs/apidocs/package-list new file mode 100644 index 000000000..109fac58f --- /dev/null +++ b/docs/apidocs/package-list @@ -0,0 +1,26 @@ +com.github.shynixn.petblocks.api +com.github.shynixn.petblocks.api.entities +com.github.shynixn.petblocks.api.events +com.github.shynixn.petblocks.api.persistence.controller +com.github.shynixn.petblocks.api.persistence.entity +com.github.shynixn.petblocks.business +com.github.shynixn.petblocks.business.bukkit +com.github.shynixn.petblocks.business.bukkit.dependencies.clearlag +com.github.shynixn.petblocks.business.bukkit.dependencies.supervanish +com.github.shynixn.petblocks.business.bukkit.dependencies.worldguard +com.github.shynixn.petblocks.business.bukkit.nms +com.github.shynixn.petblocks.business.bukkit.nms.helper +com.github.shynixn.petblocks.business.bukkit.nms.v1_10_R1 +com.github.shynixn.petblocks.business.bukkit.nms.v1_11_R1 +com.github.shynixn.petblocks.business.bukkit.nms.v1_12_R1 +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R1 +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R2 +com.github.shynixn.petblocks.business.bukkit.nms.v1_8_R3 +com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R1 +com.github.shynixn.petblocks.business.bukkit.nms.v1_9_R2 +com.github.shynixn.petblocks.business.logic.business +com.github.shynixn.petblocks.business.logic.configuration +com.github.shynixn.petblocks.business.logic.persistence +com.github.shynixn.petblocks.business.logic.persistence.controller +com.github.shynixn.petblocks.business.logic.persistence.entity +com.github.shynixn.petblocks.lib diff --git a/docs/apidocs/script.js b/docs/apidocs/script.js new file mode 100644 index 000000000..b34635693 --- /dev/null +++ b/docs/apidocs/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/docs/apidocs/serialized-form.html b/docs/apidocs/serialized-form.html new file mode 100644 index 000000000..ddcb75a84 --- /dev/null +++ b/docs/apidocs/serialized-form.html @@ -0,0 +1,277 @@ + + + + + + +Serialized Form (PetBlocks 6.0.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Serialized Form

+
+
+
    +
  • +

    Package com.github.shynixn.petblocks.api.entities

    +
  • +
  • +

    Package com.github.shynixn.petblocks.api.persistence.entity

    +
  • +
  • +

    Package com.github.shynixn.petblocks.business.logic.persistence.entity

    + +
  • +
  • +

    Package com.github.shynixn.petblocks.lib

    +
      +
    • + + +

      Class com.github.shynixn.petblocks.lib.Particle extends Object implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          effect

          +
          ParticleEffect effect
          +
          Deprecated. 
          +
        • +
        • +

          x

          +
          double x
          +
          Deprecated. 
          +
        • +
        • +

          y

          +
          double y
          +
          Deprecated. 
          +
        • +
        • +

          z

          +
          double z
          +
          Deprecated. 
          +
        • +
        • +

          speed

          +
          double speed
          +
          Deprecated. 
          +
        • +
        • +

          amount

          +
          int amount
          +
          Deprecated. 
          +
        • +
        • +

          material

          +
          org.bukkit.Material material
          +
          Deprecated. 
          +
        • +
        • +

          data

          +
          byte data
          +
          Deprecated. 
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ +
+ + + + + + + +
+ + +

Copyright © 2017. All rights reserved.

+ + diff --git a/docs/apidocs/stylesheet.css b/docs/apidocs/stylesheet.css new file mode 100644 index 000000000..98055b22d --- /dev/null +++ b/docs/apidocs/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 000000000..7826ea9dc --- /dev/null +++ b/docs/index.html @@ -0,0 +1,14 @@ + + + + + + Page Redirection + + +If you are not redirected automatically, follow this Link + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 576a7193e..ac618c049 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ Spigot plugin to use blocks as pets in minecraft. https://github.com/Shynixn/PetBlocks jar - 6.0.0-SNAPSHOT + 6.0.0 @@ -183,10 +183,10 @@ net - minecraft112-PRE-R1 + minecraft112R1 system 1.0 - ${basedir}/lib/spigot-1.12-pre5.jar + ${basedir}/lib/spigot-1.12.jar de.myzelyam diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java index 9a878f34e..a417eb274 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomGroundArmorstand.java @@ -96,9 +96,6 @@ protected void doTick() { super.doTick(); } - - - @Override public void a(float sideMot,float f2, float forMot) { if (this.isSpecial) { @@ -117,10 +114,10 @@ public void a(float sideMot,float f2, float forMot) { this.motY = 0.5D; } this.P = (float) ConfigPet.getInstance().getModifier_petclimbing(); - this.aR = (this.cw() * 0.1F); + this.aR = (this.cy() * 0.1F); if (!this.world.isClientSide) { - this.m(0.35F); + this.k(0.35F); super.a(sideMot * (float) ConfigPet.getInstance().getModifier_petriding(), f2, forMot * (float) ConfigPet.getInstance().getModifier_petriding()); } diff --git a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java index 54de28209..505d9ccf6 100644 --- a/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java +++ b/src/main/java/com/github/shynixn/petblocks/business/bukkit/nms/v1_12_R1/CustomRabbit.java @@ -61,9 +61,9 @@ private void ignoreFinalField(Field field) throws NoSuchFieldException, Security } @Override - protected SoundEffect dk() { + protected SoundEffect dm() { this.playedMovingSound = PetBlockHelper.executeMovingSound(this.getBukkitEntity(), this.player, this.petData, this.playedMovingSound); - return super.dk(); + return super.dm(); } @Override diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 35c51f829..fee5584d1 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: PetBlocks -version: 6.0.0-SNAPSHOT +version: 6.0.0 author: Shynixn main: com.github.shynixn.petblocks.business.bukkit.PetBlocksPlugin softdepend: [WorldGuard, SuperVanish, PremiumVanish, ClearLag] From b8f1b29689c8a910ce0aea40a0acc6b6cee27ace Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 9 Jun 2017 20:08:22 +0200 Subject: [PATCH 19/23] Create .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ef2c76a9f..e9ae54c90 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ install: - wget https://github.com/MyzelYam/SuperVanish/releases/download/v5.7.0/SuperVanish.jar -P /home/travis/build/Shynixn/PetBlocks/lib/ script: - cd /home/travis/build/Shynixn/PetBlocks/lib/ - - java -jar BuildTools.jar --rev 1.8 + - java -jar BuildTools.jar --rev 1.8 > /dev/null #Test Build Because travis fails on large log - java -jar BuildTools.jar --rev 1.8.3 - java -jar BuildTools.jar --rev 1.8.8 - java -jar BuildTools.jar --rev 1.9 From 81819fc9a9e79b64a0c096a714a06d75a7ef5704 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 9 Jun 2017 20:21:31 +0200 Subject: [PATCH 20/23] Changed travis build script --- .travis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9ae54c90..0bf921ece 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,13 +7,13 @@ install: - wget https://github.com/MyzelYam/SuperVanish/releases/download/v5.7.0/SuperVanish.jar -P /home/travis/build/Shynixn/PetBlocks/lib/ script: - cd /home/travis/build/Shynixn/PetBlocks/lib/ - - java -jar BuildTools.jar --rev 1.8 > /dev/null #Test Build Because travis fails on large log - - java -jar BuildTools.jar --rev 1.8.3 - - java -jar BuildTools.jar --rev 1.8.8 - - java -jar BuildTools.jar --rev 1.9 - - java -jar BuildTools.jar --rev 1.9.4 - - java -jar BuildTools.jar --rev 1.10 - - java -jar BuildTools.jar --rev 1.11 + - java -jar BuildTools.jar --rev 1.8 > /dev/null + - java -jar BuildTools.jar --rev 1.8.3 > /dev/null + - java -jar BuildTools.jar --rev 1.8.8 > /dev/null + - java -jar BuildTools.jar --rev 1.9 > /dev/null + - java -jar BuildTools.jar --rev 1.9.4 > /dev/null + - java -jar BuildTools.jar --rev 1.10 > /dev/null + - java -jar BuildTools.jar --rev 1.11 > /dev/null - java -jar BuildTools.jar --rev 1.12 - cd - - mvn compile test From c8af05ef2bb4bcd63624c0d44765e83d7b9eb122 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 9 Jun 2017 21:03:43 +0200 Subject: [PATCH 21/23] Create .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0bf921ece..202d5b4ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ script: - java -jar BuildTools.jar --rev 1.9 > /dev/null - java -jar BuildTools.jar --rev 1.9.4 > /dev/null - java -jar BuildTools.jar --rev 1.10 > /dev/null - - java -jar BuildTools.jar --rev 1.11 > /dev/null + - java -jar BuildTools.jar --rev 1.11 - java -jar BuildTools.jar --rev 1.12 - cd - - mvn compile test From c55b4139cf8f89903270ccbf9297cae29a8b6098 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 9 Jun 2017 21:41:25 +0200 Subject: [PATCH 22/23] Fixed travis build --- .travis.yml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 202d5b4ad..0bf921ece 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ script: - java -jar BuildTools.jar --rev 1.9 > /dev/null - java -jar BuildTools.jar --rev 1.9.4 > /dev/null - java -jar BuildTools.jar --rev 1.10 > /dev/null - - java -jar BuildTools.jar --rev 1.11 + - java -jar BuildTools.jar --rev 1.11 > /dev/null - java -jar BuildTools.jar --rev 1.12 - cd - - mvn compile test diff --git a/pom.xml b/pom.xml index ac618c049..7705be7ff 100644 --- a/pom.xml +++ b/pom.xml @@ -179,7 +179,7 @@ minecraft111R1 system 1.0 - ${basedir}/lib/spigot-1.11.2.jar + ${basedir}/lib/spigot-1.11.jar net From 51b3bcbe57f8c1221f734b4c478fc6bef5cd750e Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 9 Jun 2017 22:57:13 +0200 Subject: [PATCH 23/23] Fixed travis build --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 0bf921ece..ff0d143b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ install: - mkdir lib - wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastStableBuild/artifact/target/BuildTools.jar -P /home/travis/build/Shynixn/PetBlocks/lib/ - wget https://github.com/MyzelYam/SuperVanish/releases/download/v5.7.0/SuperVanish.jar -P /home/travis/build/Shynixn/PetBlocks/lib/ +before_script: + - sudo /etc/init.d/mysql stop script: - cd /home/travis/build/Shynixn/PetBlocks/lib/ - java -jar BuildTools.jar --rev 1.8 > /dev/null