Update to MC 1.12, completely untested. Compile against Java 1.8, fix

deprecated config loading. Removed broken support for Bukkit 1.7.2,
cleanup unused classes. QuestMob no longer uses NMS. Bump version number
This commit is contained in:
HappyPikachu 2017-06-15 01:40:32 -04:00
parent 23c50673e4
commit 7ef239ba4f
10 changed files with 653 additions and 559 deletions

View File

@ -1,6 +1,6 @@
# Quests
Quests mod for Spigot. This plugin depends highly on code contributions!
Quests plugin for Spigot. This work depends highly on code contributions!
## Usage

BIN
lib/craftbukkit-1.12.jar Normal file

Binary file not shown.

594
pom.xml
View File

@ -1,195 +1,401 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>2.7.6</version>
<name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging>
<description></description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>citizens</id>
<url>http://repo.citizensnpcs.co</url>
</repository>
<repository>
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit186</artifactId>
<version>1.8.6-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.8.6.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit183</artifactId>
<version>1.8.3-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.8.3.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>spigot18</artifactId>
<version>1.8-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.8.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>spigot192</artifactId>
<version>1.9.2-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.9.2.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>spigot194</artifactId>
<version>1.9.4-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.9.4.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>spigot110</artifactId>
<version>1.10-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.10.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>spigot111</artifactId>
<version>1.11-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.11.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit1710</artifactId>
<version>1.7.10-R0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.7.10-R0.1.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit179</artifactId>
<version>1.7.9-R0.3</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.7.9-R0.3.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit172</artifactId>
<version>1.7.2-R0.4</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.7.2-R0.4.jar</systemPath>
</dependency>
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizens</artifactId>
<version>2.0.16-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.aufdemrand</groupId>
<artifactId>denizen</artifactId>
<version>0.9.7-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/denizen-0.9.7-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>1.4.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Vault.jar</systemPath>
</dependency>
<dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>1.5.00</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/mcMMO.jar</systemPath>
</dependency>
<dependency>
<groupId>com.herocraftonline</groupId>
<artifactId>Heroes</artifactId>
<version>1.5.5.4</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Heroes.jar</systemPath>
</dependency>
<dependency>
<groupId>com.codisimus</groupId>
<artifactId>PhatLoots</artifactId>
<version>3.8.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/PhatLoots.jar</systemPath>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldedit</artifactId>
<version>LATEST</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>LATEST</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>Quests-${project.version}</finalName>
<resources>
<resource>
<targetPath>.</targetPath>
<directory>${basedir}/src/main/resources/</directory>
<filtering>true</filtering>
<includes>
<include>config.yml</include>
<include>plugin.yml</include>
<include>events.yml</include>
<include>quests.yml</include>
</includes>
</resource>
<resource>
<targetPath>.</targetPath>
<directory>${basedir}/</directory>
<filtering>false</filtering>
<includes>
<include>README.md</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<showDeprecation>true</showDeprecation>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>2.8.0</version>
<name>quests</name>
<description></description>
<url>https://github.com/FlyingPikachu/Quests/</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit112</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/craftbukkit-1.12.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit111</artifactId>
<version>1.11-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/craftbukkit-1.11.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit110</artifactId>
<version>1.10-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/craftbukkit-1.10.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit194</artifactId>
<version>1.9.4-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/craftbukkit-1.9.4.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit192</artifactId>
<version>1.9.2-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/craftbukkit-1.9.2.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit186</artifactId>
<version>1.8.6-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/craftbukkit-1.8.6.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit183</artifactId>
<version>1.8.3-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/craftbukkit-1.8.3.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit18</artifactId>
<version>1.8-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/craftbukkit-1.8.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit1710</artifactId>
<version>1.7.10-R0.1</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/craftbukkit-1.7.10-R0.1.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit179</artifactId>
<version>1.7.9-R0.3</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/craftbukkit-1.7.9-R0.3.jar</systemPath>
</dependency>
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizens</artifactId>
<version>2.0.16-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.aufdemrand</groupId>
<artifactId>denizen</artifactId>
<version>0.9.7-SNAPSHOT</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/denizen-0.9.7-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>1.4.1</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/Vault.jar</systemPath>
</dependency>
<dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>1.5.00</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/mcMMO.jar</systemPath>
</dependency>
<dependency>
<groupId>com.herocraftonline</groupId>
<artifactId>Heroes</artifactId>
<version>1.5.5.4</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/Heroes.jar</systemPath>
</dependency>
<dependency>
<groupId>com.codisimus</groupId>
<artifactId>PhatLoots</artifactId>
<version>3.8.1</version>
<scope>system</scope>
<systemPath>C:\Users\Dylan\git\Quests/lib/PhatLoots.jar</systemPath>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldedit</artifactId>
<version>LATEST</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>LATEST</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>citizens</id>
<url>http://repo.citizensnpcs.co</url>
</repository>
<repository>
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/repo/</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>http://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>http://repo.maven.apache.org/maven2</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>C:\Users\Dylan\git\Quests\src\main\java</sourceDirectory>
<scriptSourceDirectory>C:\Users\Dylan\git\Quests\src\main\scripts</scriptSourceDirectory>
<testSourceDirectory>C:\Users\Dylan\git\Quests\src\test\java</testSourceDirectory>
<outputDirectory>C:\Users\Dylan\git\Quests\target\classes</outputDirectory>
<testOutputDirectory>C:\Users\Dylan\git\Quests\target\test-classes</testOutputDirectory>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>C:\Users\Dylan\git\Quests\src\main\resources</directory>
<includes>
<include>config.yml</include>
<include>plugin.yml</include>
<include>events.yml</include>
<include>quests.yml</include>
</includes>
</resource>
<resource>
<targetPath>.</targetPath>
<filtering>false</filtering>
<directory>C:\Users\Dylan\git\Quests</directory>
<includes>
<include>README.md</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>C:\Users\Dylan\git\Quests\src\test\resources</directory>
</testResource>
</testResources>
<directory>C:\Users\Dylan\git\Quests\target</directory>
<finalName>Quests-2.8.0</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<showDeprecation>true</showDeprecation>
<source>1.6</source>
<target>1.6</target>
</configuration>
</execution>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<showDeprecation>true</showDeprecation>
<source>1.6</source>
<target>1.6</target>
</configuration>
</execution>
</executions>
<configuration>
<showDeprecation>true</showDeprecation>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>default-testResources</id>
<phase>process-test-resources</phase>
<goals>
<goal>testResources</goal>
</goals>
</execution>
<execution>
<id>default-resources</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<executions>
<execution>
<id>default-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default-install</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
<executions>
<execution>
<id>default-site</id>
<phase>site</phase>
<goals>
<goal>site</goal>
</goals>
<configuration>
<outputDirectory>C:\Users\Dylan\git\Quests\target\site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</execution>
<execution>
<id>default-deploy</id>
<phase>site-deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<outputDirectory>C:\Users\Dylan\git\Quests\target\site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</execution>
</executions>
<configuration>
<outputDirectory>C:\Users\Dylan\git\Quests\target\site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<outputDirectory>C:\Users\Dylan\git\Quests\target\site</outputDirectory>
</reporting>
</project>

View File

@ -0,0 +1,86 @@
package me.blackvein.particles;
import me.blackvein.quests.util.ReflectionUtil;
import net.minecraft.server.v1_12_R1.EnumParticle;
import net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
public enum Eff_1_12_R1 {
EXPLOSION(EnumParticle.EXPLOSION_NORMAL),
EXPLOSION_LARGE(EnumParticle.EXPLOSION_LARGE),
EXPLOSION_HUGE(EnumParticle.EXPLOSION_HUGE),
FIREWORKS_SPARK(EnumParticle.FIREWORKS_SPARK),
BUBBLE(EnumParticle.WATER_BUBBLE),
WAKE(EnumParticle.WATER_WAKE),
SPLASH(EnumParticle.WATER_SPLASH),
SUSPENDED(EnumParticle.SUSPENDED),
DEPTH_SUSPEND(EnumParticle.SUSPENDED_DEPTH),
CRIT(EnumParticle.CRIT),
MAGIC_CRIT(EnumParticle.CRIT_MAGIC),
SMOKE(EnumParticle.SMOKE_NORMAL),
LARGE_SMOKE(EnumParticle.SMOKE_LARGE),
SPELL(EnumParticle.SPELL),
INSTANT_SPELL(EnumParticle.SPELL_INSTANT),
MOB_SPELL(EnumParticle.SPELL_MOB),
MOB_SPELL_AMBIENT(EnumParticle.SPELL_MOB_AMBIENT),
WITCH_MAGIC(EnumParticle.SPELL_WITCH),
DRIP_WATER(EnumParticle.DRIP_WATER),
DRIP_LAVA(EnumParticle.DRIP_LAVA),
ANGRY_VILLAGER(EnumParticle.VILLAGER_ANGRY),
HAPPY_VILLAGER(EnumParticle.VILLAGER_HAPPY),
TOWN_AURA(EnumParticle.TOWN_AURA),
NOTE(EnumParticle.NOTE),
PORTAL(EnumParticle.PORTAL),
ENCHANTMENT_TABLE(EnumParticle.ENCHANTMENT_TABLE),
FLAME(EnumParticle.FLAME),
LAVA(EnumParticle.LAVA),
FOOTSTEP(EnumParticle.FOOTSTEP),
CLOUD(EnumParticle.CLOUD),
RED_DUST(EnumParticle.REDSTONE),
SNOWBALL_POOF(EnumParticle.SNOWBALL),
SNOW_SHOVEL(EnumParticle.SNOW_SHOVEL),
SLIME(EnumParticle.SLIME),
HEART(EnumParticle.HEART),
BARRIER(EnumParticle.BARRIER),
ICONCRACK_(EnumParticle.ITEM_CRACK),
BLOCKCRACK_(EnumParticle.BLOCK_CRACK),
BLOCKDUST_(EnumParticle.BLOCK_DUST),
DROPLET(EnumParticle.WATER_DROP),
TAKE(EnumParticle.ITEM_TAKE),
MOB_APPEARANCE(EnumParticle.MOB_APPEARANCE),
SWEEPING_DUST(EnumParticle.SWEEP_ATTACK),
DRAGON_BREATH(EnumParticle.DRAGON_BREATH),
ENDROD(EnumParticle.END_ROD),
DAMAGE_INDICATOR(EnumParticle.DAMAGE_INDICATOR),
FALLING_DUST(EnumParticle.FALLING_DUST),
SPIT(EnumParticle.SPIT),
TOTEM(EnumParticle.TOTEM);
private final EnumParticle particleEnum;
Eff_1_12_R1(EnumParticle particleEnum) {
this.particleEnum = particleEnum;
}
public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception {
PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles();
ReflectionUtil.setValue(packet, "a", particleEnum);
ReflectionUtil.setValue(packet, "b", (float) location.getX());
ReflectionUtil.setValue(packet, "c", (float) location.getY());
ReflectionUtil.setValue(packet, "d", (float) location.getZ());
ReflectionUtil.setValue(packet, "e", offsetX);
ReflectionUtil.setValue(packet, "f", offsetY);
ReflectionUtil.setValue(packet, "g", offsetZ);
ReflectionUtil.setValue(packet, "h", speed);
ReflectionUtil.setValue(packet, "i", count);
ReflectionUtil.setValue(packet, "k", data);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
}

View File

@ -1,68 +0,0 @@
package me.blackvein.particles;
import me.blackvein.quests.util.ReflectionUtil;
import net.minecraft.server.v1_7_R1.PacketPlayOutWorldParticles;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
public enum Eff_1_7_R1 {
HUGE_EXPLOSION("hugeexplosion"),
LARGE_EXPLODE("largeexplode"),
FIREWORKS_SPARK("fireworksSpark"),
BUBBLE("bubble"),
SUSPEND("susgpend"),
DEPTH_SUSPEND("depthSuspend"),
TOWN_AURA("townaura"),
CRIT("crit"),
MAGIC_CRIT("magicCrit"),
MOB_SPELL("mobSpell"),
MOB_SPELL_AMBIENT("mobSpellAmbient"),
SPELL("spell"),
INSTANT_SPELL("instantSpell"),
WITCH_MAGIC("witchMagic"),
NOTE("note"),
PORTAL("portal"),
ENCHANTMENT_TABLE("enchantmenttable"),
EXPLODE("explode"),
FLAME("flame"),
LAVA("lava"),
FOOTSTEP("footstep"),
SPLASH("splash"),
LARGE_SMOKE("largesmoke"),
CLOUD("cloud"),
RED_DUST("reddust"),
SNOWBALL_POOF("snowballpoof"),
DRIP_WATER("dripWater"),
DRIP_LAVA("dripLava"),
SNOW_SHOVEL("snowshovel"),
SLIME("slime"),
HEART("heart"),
ANGRY_VILLAGER("angryVillager"),
HAPPY_VILLAGER("happyVillager"),
ICONCRACK("iconcrack_"),
TILECRACK("tilecrack_");
private final String particleName;
Eff_1_7_R1(String particleName) {
this.particleName = particleName;
}
public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count) throws Exception {
PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles();
ReflectionUtil.setValue(packet, "a", particleName);
ReflectionUtil.setValue(packet, "b", (float) location.getX());
ReflectionUtil.setValue(packet, "c", (float) location.getY());
ReflectionUtil.setValue(packet, "d", (float) location.getZ());
ReflectionUtil.setValue(packet, "e", offsetX);
ReflectionUtil.setValue(packet, "f", offsetY);
ReflectionUtil.setValue(packet, "g", offsetZ);
ReflectionUtil.setValue(packet, "h", speed);
ReflectionUtil.setValue(packet, "i", count);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
}

View File

@ -2,7 +2,6 @@ package me.blackvein.quests;
import java.util.List;
import me.blackvein.particles.Eff_1_7_R1;
import me.blackvein.particles.Eff_1_7_R3;
import me.blackvein.particles.Eff_1_7_R4;
import me.blackvein.particles.Eff_1_8_R1;
@ -12,6 +11,7 @@ import me.blackvein.particles.Eff_1_9_R1;
import me.blackvein.particles.Eff_1_9_R2;
import me.blackvein.particles.Eff_1_10_R1;
import me.blackvein.particles.Eff_1_11_R1;
import me.blackvein.particles.Eff_1_12_R1;
import net.citizensnpcs.api.npc.NPC;
import org.bukkit.Bukkit;
@ -61,9 +61,7 @@ public class NpcEffectThread implements Runnable {
private static void showEffect(Player player, NPC npc) {
if (Bukkit.getBukkitVersion().contains("1.7.2")) {
showEffect_R1(player, npc);
} else if (Bukkit.getBukkitVersion().contains("1.7.9")) {
if (Bukkit.getBukkitVersion().contains("1.7.9")) {
showEffect_R3(player, npc);
} else if (Bukkit.getBukkitVersion().contains("1.7.10")) {
showEffect_R4(player, npc);
@ -85,8 +83,132 @@ public class NpcEffectThread implements Runnable {
showEffect_1_10_R1(player, npc);
} else if (Bukkit.getBukkitVersion().contains("1.11")) {
showEffect_1_11_R1(player, npc);
} else if (Bukkit.getBukkitVersion().contains("1.12")) {
showEffect_1_12_R1(player, npc);
}
}
private static void showEffect_1_12_R1(Player player, NPC npc) {
//Get and set eye location, because npc.getBukkitEntity() is deprecated.
Location eyeLoc = npc.getEntity().getLocation();
eyeLoc.setY(eyeLoc.getY() + 1.5);
if (Quests.effect.equalsIgnoreCase("enchant")) {
try {
Eff_1_12_R1.ENCHANTMENT_TABLE.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 10, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("crit")) {
try {
Eff_1_12_R1.CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("spell")) {
try {
Eff_1_12_R1.INSTANT_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("magiccrit")) {
try {
Eff_1_12_R1.MAGIC_CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("mobspell")) {
try {
Eff_1_12_R1.MOB_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("note")) {
try {
Location old = eyeLoc;
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
Eff_1_12_R1.NOTE.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("portal")) {
try {
Eff_1_12_R1.PORTAL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 5, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("dust")) {
try {
Location newLoc = new Location(player.getWorld(), eyeLoc.getX(), eyeLoc.getY() + (float) 0.5, eyeLoc.getZ());
Eff_1_12_R1.RED_DUST.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("witch")) {
try {
Eff_1_12_R1.WITCH_MAGIC.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("snowball")) {
try {
Location old = eyeLoc;
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
Eff_1_12_R1.SNOWBALL_POOF.sendToPlayer(player, newLoc, 0, 0, 0, 1, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("splash")) {
try {
Location old = eyeLoc;
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
Eff_1_12_R1.SPLASH.sendToPlayer(player, newLoc, 0, 0, 0, 1, 4, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("smoke")) {
try {
Eff_1_12_R1.TOWN_AURA.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 20, null);
} catch (Exception e) {
e.printStackTrace();
}
} else {
try {
Eff_1_12_R1.valueOf(Quests.effect).sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null);
} catch (Exception e) {
Quests.getInstance().getLogger().info(Quests.effect + " is not a valid effect name!");
e.printStackTrace();
}
}
}
private static void showEffect_1_11_R1(Player player, NPC npc) {
//Get and set eye location, because npc.getBukkitEntity() is deprecated.
@ -1161,118 +1283,4 @@ private static void showEffect_1_9_R2(Player player, NPC npc) {
}
private static void showEffect_R1(Player player, NPC npc) {
//Get and set eye location, because npc.getBukkitEntity() is deprecated.
Location eyeLoc = npc.getEntity().getLocation();
eyeLoc.setY(eyeLoc.getY() + 1.5);
if (Quests.effect.equalsIgnoreCase("enchant")) {
try {
Eff_1_7_R1.ENCHANTMENT_TABLE.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 10);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("crit")) {
try {
Eff_1_7_R1.CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("spell")) {
try {
Eff_1_7_R1.INSTANT_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("magiccrit")) {
try {
Eff_1_7_R1.MAGIC_CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("mobspell")) {
try {
Eff_1_7_R1.MOB_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("note")) {
try {
Location old = eyeLoc;
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
Eff_1_7_R1.NOTE.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("portal")) {
try {
Eff_1_7_R1.PORTAL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 5);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("dust")) {
try {
Location old = eyeLoc;
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
Eff_1_7_R1.RED_DUST.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("witch")) {
try {
Eff_1_7_R1.WITCH_MAGIC.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("snowball")) {
try {
Location old = eyeLoc;
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
Eff_1_7_R1.SNOWBALL_POOF.sendToPlayer(player, newLoc, 0, 0, 0, 1, 3);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("splash")) {
try {
Location old = eyeLoc;
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
Eff_1_7_R1.SPLASH.sendToPlayer(player, newLoc, 0, 0, 0, 1, 4);
} catch (Exception e) {
e.printStackTrace();
}
} else if (Quests.effect.equalsIgnoreCase("smoke")) {
try {
Eff_1_7_R1.TOWN_AURA.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 20);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

View File

@ -1,69 +0,0 @@
package me.blackvein.quests;
import me.blackvein.quests.util.ReflectionUtil;
import net.minecraft.server.v1_8_R1.PacketPlayOutWorldParticles;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
public enum ParticleEffect {
HUGE_EXPLOSION("hugeexplosion"),
LARGE_EXPLODE("largeexplode"),
FIREWORKS_SPARK("fireworksSpark"),
BUBBLE("bubble"),
SUSPEND("susgpend"),
DEPTH_SUSPEND("depthSuspend"),
TOWN_AURA("townaura"),
CRIT("crit"),
MAGIC_CRIT("magicCrit"),
MOB_SPELL("mobSpell"),
MOB_SPELL_AMBIENT("mobSpellAmbient"),
SPELL("spell"),
INSTANT_SPELL("instantSpell"),
WITCH_MAGIC("witchMagic"),
NOTE("note"),
PORTAL("portal"),
ENCHANTMENT_TABLE("enchantmenttable"),
EXPLODE("explode"),
FLAME("flame"),
LAVA("lava"),
FOOTSTEP("footstep"),
SPLASH("splash"),
LARGE_SMOKE("largesmoke"),
CLOUD("cloud"),
RED_DUST("reddust"),
SNOWBALL_POOF("snowballpoof"),
DRIP_WATER("dripWater"),
DRIP_LAVA("dripLava"),
SNOW_SHOVEL("snowshovel"),
SLIME("slime"),
HEART("heart"),
ANGRY_VILLAGER("angryVillager"),
HAPPY_VILLAGER("happyVillager"),
ICONCRACK("iconcrack_"),
TILECRACK("tilecrack_");
private final String particleName;
ParticleEffect(String particleName) {
this.particleName = particleName;
}
public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] unknown) throws Exception {
PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles();
ReflectionUtil.setValue(packet, "a", particleName);
ReflectionUtil.setValue(packet, "b", (float) location.getX());
ReflectionUtil.setValue(packet, "c", (float) location.getY());
ReflectionUtil.setValue(packet, "d", (float) location.getZ());
ReflectionUtil.setValue(packet, "e", offsetX);
ReflectionUtil.setValue(packet, "f", offsetY);
ReflectionUtil.setValue(packet, "g", offsetZ);
ReflectionUtil.setValue(packet, "h", speed);
ReflectionUtil.setValue(packet, "i", count);
ReflectionUtil.setValue(packet, "k", unknown);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
}

View File

@ -33,6 +33,7 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.Potion;
public class Quester {
@ -2058,52 +2059,6 @@ public class Quester {
return prettyString;
}
public static String fullPotionString(ItemStack is) {
Potion potion = Potion.fromItemStack(is);
String potionName = "";
boolean isPrimary = false;
try {
potionName = "Potion of " + potion.getType().getEffectType().getName();
} catch (NullPointerException e) { // Potion is primary
isPrimary = true;
if (is.getDurability() == 0) {
potionName = "Water Bottle";
} else if (is.getDurability() == 16) {
potionName = "Awkward Potion";
} else if (is.getDurability() == 32) {
potionName = "Thick Potion";
} else if (is.getDurability() == 64) {
potionName = "Mundane Potion (Extended)";
} else if (is.getDurability() == 8192) {
potionName = "Mundane Potion";
}
}
if (isPrimary == false) {
if (potion.hasExtendedDuration()) {
potionName = potionName + " (Extended)";
} else if (potion.getLevel() == 2) {
potionName = potionName + " II";
}
if (potion.isSplash()) {
potionName = "Splash " + potionName;
}
}
return potionName;
}
public static String prettyMobString(EntityType type) {
String baseString = type.toString();

View File

@ -5,7 +5,6 @@ import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
@ -148,15 +147,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
@Override
public void onEnable() {
/*if(getServer().getBukkitVersion().equalsIgnoreCase(validVersion) == false) {
getLogger().severe("Your current version of CraftBukkit is " + getServer().getBukkitVersion() + ", this version of Quests is built for version " + validVersion);
getLogger().severe("Disabling...");
getServer().getPluginManager().disablePlugin(this);
return;
} */
pListener = new PlayerListener(this);
effListener = new NpcEffectThread(this);
npcListener = new NpcListener(this);
@ -182,16 +172,21 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
linkOtherPlugins();
defaultConfigFile();
saveDefaultConfig();
//defaultConfigFile();
saveResource("quests.yml", false);
saveResource("events.yml", false);
saveResource("data.yml", false);
defaultLangFile();
//defaultQuestsFile();
//defaultEventsFile();
//defaultDataFile();
loadConfig();
loadModules();
defaultLangFile();
defaultQuestsFile();
defaultEventsFile();
defaultDataFile();
loadData();
loadCommands();
getServer().getPluginManager().registerEvents(pListener, this);
@ -241,7 +236,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
}, 5L);
}
private void defaultDataFile() {
/*private void defaultDataFile() {
if (new File(this.getDataFolder(), "data.yml").exists() == false) {
getLogger().info("Data file not found, writing default to file.");
FileConfiguration data = new YamlConfiguration();
@ -255,17 +250,16 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
} else {
loadData();
}
}
}*/
@SuppressWarnings("deprecation")
private void defaultEventsFile() {
/*private void defaultEventsFile() {
if (new File(this.getDataFolder(), "events.yml").exists() == false) {
getLogger().info("Events data not found, writing defaults to file.");
FileConfiguration data = new YamlConfiguration();
data.options().copyHeader(true);
data.options().copyDefaults(true);
try {
data.load(this.getResource("events.yml"));
data.load(this.getTextResource("events.yml"));
data.save(new File(this.getDataFolder(), "events.yml"));
} catch (IOException e) {
e.printStackTrace();
@ -273,16 +267,15 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
e.printStackTrace();
}
}
}
}*/
@SuppressWarnings("deprecation")
private void defaultQuestsFile() {
/*private void defaultQuestsFile() {
if (new File(this.getDataFolder(), "quests.yml").exists() == false) {
getLogger().info("Quest data not found, writing defaults to file.");
FileConfiguration data = new YamlConfiguration();
try {
data.load(this.getResource("quests.yml"));
data.load(this.getTextResource("quests.yml"));
data.set("events", null);
data.save(new File(this.getDataFolder(), "quests.yml"));
} catch (IOException e) {
@ -292,15 +285,14 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
}
}
}
}*/
@SuppressWarnings("deprecation")
private void defaultConfigFile() {
/*private void defaultConfigFile() {
if (new File(this.getDataFolder(), "config.yml").exists() == false) {
getLogger().info("Config not found, writing default to file.");
FileConfiguration config = new YamlConfiguration();
try {
config.load(this.getResource("config.yml"));
config.load(this.getTextResource("config.yml"));
config.save(new File(this.getDataFolder(), "config.yml"));
} catch (IOException e) {
e.printStackTrace();
@ -308,7 +300,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
e.printStackTrace();
}
}
}
}*/
public void loadCommands() {
@ -624,6 +616,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
JarFile jarFile = new JarFile(jar);
Enumeration<JarEntry> e = jarFile.entries();
jarFile.close();
URL[] urls = {new URL("jar:file:" + jar.getPath() + "!/")};
@ -1936,7 +1929,8 @@ try{
cs.sendMessage(completed);
}
private void questsJournal(final Player player) {
@SuppressWarnings("deprecation")
private void questsJournal(final Player player) {
Quester quester = getQuester(player.getUniqueId());
@ -2803,7 +2797,6 @@ try{
failedToLoad = false;
if (config.contains("quests." + questName + ".name")) {
// TODO why have a name attr then path key can be guest name?
quest.name = parseString(config.getString("quests." + questName + ".name"), quest);
} else {
skipQuestProcess("Quest block \'" + questName + "\' is missing " + RED + "name:");
@ -3430,8 +3423,6 @@ try{
}
private void processStages(Quest quest, FileConfiguration config, String questName) throws StageFailedException {
int index = 1;
ConfigurationSection questStages = config.getConfigurationSection("quests." + questName + ".stages.ordered");
for (String s2 : questStages.getKeys(false)) {

View File

@ -1,13 +1,9 @@
package me.blackvein.quests.util;
import me.blackvein.quests.Quests;
import net.minecraft.server.v1_10_R1.EnumItemSlot;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.EntityEquipment;
@ -89,44 +85,33 @@ public class QuestMob {
dropChances[0] = dropChance;
}
public void spawn() {
@SuppressWarnings("deprecation")
public void spawn() {
World world = spawnLocation.getWorld();
for (int i = 0; i < spawnAmounts; i++) {
Entity entity = world.spawnEntity(spawnLocation, entityType);
LivingEntity entity = (LivingEntity) world.spawnEntity(spawnLocation, entityType);
if (name != null) {
((LivingEntity) entity).setCustomName(name);
((LivingEntity) entity).setCustomNameVisible(true);
entity.setCustomName(name);
entity.setCustomNameVisible(true);
}
EntityEquipment eq = entity.getEquipment();
try{
((CraftEntity) entity).getHandle().setEquipment(EnumItemSlot.MAINHAND, CraftItemStack.asNMSCopy(inventory[0]));
((CraftEntity) entity).getHandle().setEquipment(EnumItemSlot.FEET, CraftItemStack.asNMSCopy(inventory[1]));
((CraftEntity) entity).getHandle().setEquipment(EnumItemSlot.LEGS, CraftItemStack.asNMSCopy(inventory[2]));
((CraftEntity) entity).getHandle().setEquipment(EnumItemSlot.CHEST, CraftItemStack.asNMSCopy(inventory[3]));
((CraftEntity) entity).getHandle().setEquipment(EnumItemSlot.HEAD, CraftItemStack.asNMSCopy(inventory[4]));
eq.setItemInHand(inventory[0]);
eq.setBoots(inventory[1]);
eq.setLeggings(inventory[2]);
eq.setChestplate(inventory[3]);
eq.setHelmet(inventory[4]);
} catch (Exception e) {
Bukkit.getLogger().severe("Entity NMS is invalid for this version of CraftBukkit. Please notify the developer");
e.printStackTrace();
}
/*for (int j = 0; j < 5; j++) {
if (inventory[j] != null) {
try{
((CraftEntity) entity).getHandle().setEquipment(j, CraftItemStack.asNMSCopy(inventory[j]));
} catch (Exception e) {
Bukkit.getLogger().severe("Entity NMS is invalid for this version of CraftBukkit. Please notify the developer");
e.printStackTrace();
}
}
}*/
//EntityEquipment eq = ((CraftLivingEntity) entity).getEquipment();
EntityEquipment eq = ((LivingEntity)entity).getEquipment();
if (dropChances[0] != null) {
eq.setItemInHandDropChance(dropChances[0]);
}