From 05effaa82cba7e75f0d37321aedb278d313ee75f Mon Sep 17 00:00:00 2001 From: NavidK0 Date: Wed, 12 Aug 2015 17:20:41 -0700 Subject: [PATCH] Updated timings for runnable task Updated version for 8.6.5 --- build.gradle | 46 +++++++++---------- .../disguise/DisguiseListener.java | 18 ++++---- src/main/resources/plugin.yml | 2 +- 3 files changed, 32 insertions(+), 34 deletions(-) diff --git a/build.gradle b/build.gradle index 466cc99b..38f8d337 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,7 @@ - -import java.nio.file.* -import java.nio.file.Path - plugins { - id 'java' - id 'maven-publish' - id "com.jfrog.artifactory" version "3.1.1" + id 'java' + id 'maven-publish' + id "com.jfrog.artifactory" version "3.1.1" } println 'Compiling LibsDisguises via Gradle ver. ' + gradle.gradleVersion @@ -13,36 +9,36 @@ println 'Compiling LibsDisguises via Gradle ver. ' + gradle.gradleVersion sourceCompatibility = '1.7' ext.spigotVersion = '1.8.8-R0.1-SNAPSHOT' -ext.disguisesVersion = '8.6.4' +ext.disguisesVersion = '8.6.5' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' repositories { - + mavenCentral() - + maven { name 'Spigot' url 'https://hub.spigotmc.org/nexus/content/groups/public/' } - + maven { name 'Vault-Repo' url 'http://nexus.theyeticave.net/content/repositories/pub_releases' } - + maven { name 'dmulloy2-repo' url 'http://repo.dmulloy2.net/content/groups/public/' } } -task sourceJar (type : Jar, dependsOn: classes) { +task sourceJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource } -task javadocJar (type: Jar, dependsOn: javadoc) { +task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir } @@ -79,17 +75,17 @@ artifactoryPublish.skip = false artifactory { contextUrl = 'http://localhost:8081/artifactory' publish { - repository { - repoKey = 'libs-snapshot-local' - username = '${artifactory_user}' - password = '${artifactory_password}' - } - defaults { - publications('mavenJava') - } + repository { + repoKey = 'libs-snapshot-local' + username = '${artifactory_user}' + password = '${artifactory_password}' + } + defaults { + publications('mavenJava') + } } - resolve { - repoKey = 'repo' + resolve { + repoKey = 'repo' } } @@ -102,7 +98,7 @@ dependencies { compile 'org.bukkit:bukkit:' + project.ext.spigotVersion compile 'com.comphenix.protocol:ProtocolLib:3.6.5-SNAPSHOT' compile files( - 'libs/spigot.jar' + 'libs/spigot.jar' ) testCompile group: 'junit', name: 'junit', version: '4.10' } diff --git a/src/main/java/me/libraryaddict/disguise/DisguiseListener.java b/src/main/java/me/libraryaddict/disguise/DisguiseListener.java index ddba863d..62a23fc4 100644 --- a/src/main/java/me/libraryaddict/disguise/DisguiseListener.java +++ b/src/main/java/me/libraryaddict/disguise/DisguiseListener.java @@ -367,14 +367,16 @@ public class DisguiseListener implements Listener { } else { //Stupid hack to fix worldswitch invisibility bug final boolean viewSelfToggled = DisguiseAPI.isViewSelfToggled(event.getPlayer()); - final Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer()); - disguise.setViewSelfDisguise(!viewSelfToggled); - Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { - @Override - public void run() { - disguise.setViewSelfDisguise(viewSelfToggled); - } - }, 4L); //I wish I could use lambdas here, so badly + if (viewSelfToggled) { + final Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer()); + disguise.setViewSelfDisguise(false); + Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { + @Override + public void run() { + disguise.setViewSelfDisguise(true); + } + }, 20L); //I wish I could use lambdas here, so badly + } } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index a5659874..9fba23ee 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: LibsDisguises main: me.libraryaddict.disguise.LibsDisguises -version: 8.6.4 +version: 8.6.5 author: libraryaddict authors: [Byteflux, Navid K.] depend: [ProtocolLib]