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** + diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 03fe03ce3..d385640e4 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -8,7 +8,6 @@ import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.LocationUtil; import com.earth2me.essentials.utils.MaterialUtil; import net.ess3.api.IEssentials; -import net.ess3.nms.refl.ReflUtil; import org.bukkit.BanEntry; import org.bukkit.BanList; @@ -58,10 +57,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); } } @@ -787,6 +786,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)