From 17869698d591437f622c927fcfba8ec8b79620ae Mon Sep 17 00:00:00 2001 From: NavidK0 Date: Sat, 30 May 2015 03:22:38 -0400 Subject: [PATCH] Updated for 1.8.6. --- build.gradle | 8 ++++---- .../disguise/utilities/BaseDisguiseCommand.java | 10 ++++++---- .../disguise/utilities/PacketsManager.java | 8 ++++---- .../disguise/utilities/ReflectionManager.java | 2 -- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index d316cd32..2189cd0a 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { println 'Compiling LibsDisguises via Gradle ver. ' + gradle.gradleVersion sourceCompatibility = '1.7' -ext.spigotVersion = '1.8.3-R0.1-SNAPSHOT' +ext.spigotVersion = '1.8.6-R0.1-SNAPSHOT' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' @@ -44,7 +44,7 @@ tasks.build.doLast { file('libs').mkdirs() -//Retrieves spigot-1.8.jar server file from link +//Retrieves spigot.jar server file from link ant.get src: 'https://www.dropbox.com/s/1ofgubrldjwamnk/spigot.jar?dl=1', dest: file('libs'), verbose: false, skipexisting: true jar { @@ -52,10 +52,10 @@ jar { } dependencies { + compile 'org.bukkit:bukkit:' + project.ext.spigotVersion + compile 'com.comphenix.protocol:ProtocolLib:3.6.3-SNAPSHOT' compile files( 'libs/spigot.jar' ) - compile 'org.bukkit:bukkit:' + project.ext.spigotVersion - compile 'com.comphenix.protocol:ProtocolLib:3.6.3-SNAPSHOT' testCompile group: 'junit', name: 'junit', version: '4.10' } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java b/src/main/java/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java index 5a7b9848..d5bc6b69 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/BaseDisguiseCommand.java @@ -103,13 +103,15 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { /** * Get perms for the node. Returns a hashmap of allowed disguisetypes and their options + * @param sender + * @param permissionNode + * @return */ - protected HashMap, Boolean>> getPermissions(CommandSender sender, - String permissionNode) { + protected HashMap, Boolean>> getPermissions(CommandSender sender, String permissionNode) { HashMap, Boolean>> singleDisguises = new HashMap, Boolean>>(); - HashMap, Boolean>> rangeDisguises = new HashMap, Boolean>>(); - HashMap perms = new HashMap(); + HashMap, Boolean>> rangeDisguises = new HashMap<>(); + HashMap perms = new HashMap<>(); for (PermissionAttachmentInfo permission : sender.getEffectivePermissions()) { String perm = permission.getPermission().toLowerCase(); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/main/java/me/libraryaddict/disguise/utilities/PacketsManager.java index 36c8ec2f..2df45bc3 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -54,7 +54,7 @@ import com.comphenix.protocol.wrappers.WrappedAttribute.Builder; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import com.comphenix.protocol.wrappers.WrappedGameProfile; import com.comphenix.protocol.wrappers.WrappedWatchableObject; -import net.minecraft.server.v1_8_R2.DamageSource; +import net.minecraft.server.v1_8_R3.DamageSource; public class PacketsManager { /** @@ -319,11 +319,11 @@ public class PacketsManager { createDataWatcher(player, WrappedDataWatcher.getEntityWatcher(disguisedEntity), disguise.getWatcher())); } else if (disguise.getType().isMisc()) { - + MiscDisguise msc = (MiscDisguise)disguise; int id = disguise.getType().getEntityId(); - int data = ((MiscDisguise) disguise).getData(); + int data = msc.getData(); if (disguise.getType() == DisguiseType.FALLING_BLOCK) { - data = ((MiscDisguise) disguise).getId() + (data << 12); + data = msc.getId() + (data << 0x12); } else if (disguise.getType() == DisguiseType.FISHING_HOOK && data == 0) { // If the MiscDisguise data isn't set. Then no entity id was provided, so default to the owners entity id data = disguisedEntity.getEntityId(); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/ReflectionManager.java b/src/main/java/me/libraryaddict/disguise/utilities/ReflectionManager.java index d0a09f3d..176d53e8 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/ReflectionManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/ReflectionManager.java @@ -26,8 +26,6 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import com.comphenix.protocol.wrappers.WrappedGameProfile; -import net.minecraft.server.v1_8_R2.EntityPlayer; -import net.minecraft.server.v1_8_R2.PlayerConnection; import org.bukkit.potion.PotionEffect; public class ReflectionManager {