1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Added research check

This commit is contained in:
Seggan 2020-10-04 15:07:11 -04:00
parent 107125802c
commit f87a1d3660

View File

@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.listeners;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.items.armor.ElytraCap; import io.github.thebusybiscuit.slimefun4.implementation.items.armor.ElytraCap;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.api.Slimefun;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -32,6 +33,7 @@ public class ElytraCapListener implements Listener {
Player p = (Player) e.getEntity(); Player p = (Player) e.getEntity();
if (p.isGliding()) { if (p.isGliding()) {
ItemStack stack = p.getInventory().getHelmet(); ItemStack stack = p.getInventory().getHelmet();
if (!Slimefun.hasUnlocked(p, stack, true)) return;
SlimefunItem item = SlimefunItem.getByItem(stack); SlimefunItem item = SlimefunItem.getByItem(stack);
if (item instanceof ElytraCap) { if (item instanceof ElytraCap) {
e.setDamage(0); e.setDamage(0);