diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java index 40a622ce6..ddb6cfa5c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunPlugin.java @@ -270,12 +270,20 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon { // Clear the Slimefun Guide History upon Player Leaving new PlayerProfileListener(this); - // Initiating various Stuff and all Items with a slightly delay (0ms after the Server finished loading) + // Initiating various Stuff and all items with a slight delay (0ms after the Server finished loading) Slimefun.runSync(new SlimefunStartupTask(this, () -> { protections = new ProtectionManager(getServer()); textureService.register(registry.getAllSlimefunItems(), true); permissionsService.register(registry.getAllSlimefunItems(), true); - recipeService.refresh(); + + // This try/catch should prevent buggy Spigot builds from blocking item loading + try { + recipeService.refresh(); + } + catch (Exception | LinkageError x) { + getLogger().log(Level.SEVERE, x, () -> "An Exception occured while iterating through the Recipe list on Minecraft Version " + minecraftVersion.getName() + " (Slimefun v" + getVersion() + ")"); + } + }), 0); // Setting up the command /sf and all subcommands diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookListener.java index 49ada3a45..f71d7bb7f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookListener.java @@ -18,6 +18,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityPortalEnterEvent; import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent; +import org.bukkit.event.player.PlayerKickEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.util.Vector; @@ -99,6 +100,17 @@ public class GrapplingHookListener implements Listener { invulnerability.remove(uuid); } + @EventHandler + public void onLeave(PlayerKickEvent e) { + if (!isEnabled()) { + return; + } + + UUID uuid = e.getPlayer().getUniqueId(); + activeHooks.remove(uuid); + invulnerability.remove(uuid); + } + @EventHandler public void onFallDamage(EntityDamageEvent e) { if (!isEnabled()) {