From 9576ea25a67a9876cd603f83e89c5a770665df9f Mon Sep 17 00:00:00 2001 From: md678685 Date: Sat, 27 Oct 2018 15:37:29 +0100 Subject: [PATCH 1/3] Use reflection-based detection for pickup listener in player listener (#2151) Allows the plugin to start up on Glowstone correctly. Tested on Spigot 1.12.2, Spigot 1.9.4 and Glowstone 2018.7.0, works correctly on all. --- .../essentials/EssentialsPlayerListener.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 4ce7164c3..56e506276 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -7,7 +7,6 @@ import com.earth2me.essentials.textreader.TextPager; import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.LocationUtil; import net.ess3.api.IEssentials; -import net.ess3.nms.refl.ReflUtil; import org.bukkit.BanEntry; import org.bukkit.BanList; @@ -57,10 +56,10 @@ public class EssentialsPlayerListener implements Listener { public void registerEvents() { ess.getServer().getPluginManager().registerEvents(this, ess); - if (ReflUtil.getNmsVersionObject().isLowerThan(ReflUtil.V1_12_R1)) { - ess.getServer().getPluginManager().registerEvents(new PlayerListenerPre1_12(), ess); - } else { + if (isEntityPickupEvent()) { ess.getServer().getPluginManager().registerEvents(new PlayerListener1_12(), ess); + } else { + ess.getServer().getPluginManager().registerEvents(new PlayerListenerPre1_12(), ess); } } @@ -786,6 +785,15 @@ public class EssentialsPlayerListener implements Listener { user.updateActivityOnInteract(true); } + private static boolean isEntityPickupEvent() { + try { + Class.forName("org.bukkit.event.entity.EntityPickupItemEvent"); + return true; + } catch (ClassNotFoundException ignored) { + return false; + } + } + private final class PlayerListenerPre1_12 implements Listener { @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) From 96adef52690426543d5d5605d9b6210f2ca68a9b Mon Sep 17 00:00:00 2001 From: md678685 Date: Sat, 27 Oct 2018 15:42:56 +0100 Subject: [PATCH 2/3] Update issue templates (#2045) * Update issue templates Add new issue templates - I didn't even know GitHub had these now * Remove duplicate bug template * Remove duplicate feature template * Update help-.md * Update report-a-bug.md * Update request-a-feature.md * Delete ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 41 --------------- .github/ISSUE_TEMPLATE/help-.md | 45 ++++++++++++++++ .github/ISSUE_TEMPLATE/report-a-bug.md | 58 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/request-a-feature.md | 45 ++++++++++++++++ 4 files changed, 148 insertions(+), 41 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/ISSUE_TEMPLATE/help-.md create mode 100644 .github/ISSUE_TEMPLATE/report-a-bug.md create mode 100644 .github/ISSUE_TEMPLATE/request-a-feature.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index bbe3cacfd..000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,41 +0,0 @@ - - -### Information - -Full output of `/ess version`: - - - - -Server log (upload `logs/latest.log` to [Gist](https://gist.github.com/)): - -EssentialsX config (upload `plugins/Essentials/config.yml` to [Gist](https://gist.github.com/)): - -### Details - -Describe your issue here. diff --git a/.github/ISSUE_TEMPLATE/help-.md b/.github/ISSUE_TEMPLATE/help-.md new file mode 100644 index 000000000..4d6afa037 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/help-.md @@ -0,0 +1,45 @@ +--- +name: Help! +about: Encountered a problem with EssentialsX? Not sure how to fix it? + +--- + + + +### Information + +Full output of `/ess version`: + + + +**Server log:** + +**EssentialsX config** + +### Help request + +**Problem** + + +**What I have tried** + + +**Screenshots** + diff --git a/.github/ISSUE_TEMPLATE/report-a-bug.md b/.github/ISSUE_TEMPLATE/report-a-bug.md new file mode 100644 index 000000000..e3b382729 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/report-a-bug.md @@ -0,0 +1,58 @@ +--- +name: Report a bug +about: Report an EssentialsX bug. Only use this if you're 100% sure there's something wrong with EssentialsX - otherwise, try "Help!". + +--- + + + +### Information + +**Full output of `/ess version`**: + +``` + +``` + +**Server log**: + +**EssentialsX config**: + +### Details + +**Description** + + +**Steps to reproduce** + + +**Expected behavior** + + +**Screenshots** + diff --git a/.github/ISSUE_TEMPLATE/request-a-feature.md b/.github/ISSUE_TEMPLATE/request-a-feature.md new file mode 100644 index 000000000..8adc6dd90 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/request-a-feature.md @@ -0,0 +1,45 @@ +--- +name: Request a feature +about: Suggest a feature you want to see in EssentialsX! + +--- + + + +### Feature request + +**Feature description** + + +**How the feature is useful** + From 4bd946128252f78fd40cd2d2bc3eb45606533c81 Mon Sep 17 00:00:00 2001 From: md678685 Date: Sun, 28 Oct 2018 10:54:01 +0000 Subject: [PATCH 3/3] Rename help-.md to help.md --- .github/ISSUE_TEMPLATE/{help-.md => help.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/ISSUE_TEMPLATE/{help-.md => help.md} (100%) diff --git a/.github/ISSUE_TEMPLATE/help-.md b/.github/ISSUE_TEMPLATE/help.md similarity index 100% rename from .github/ISSUE_TEMPLATE/help-.md rename to .github/ISSUE_TEMPLATE/help.md