Fix two null pointers
This commit is contained in:
@@ -247,9 +247,8 @@ public class Inventories implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOW)
|
||||
@EventHandler(priority=EventPriority.HIGH)
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
event.getPlayer().getInventory().clear();
|
||||
addInvItems(event.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@ public class AnuraCore extends JavaPlugin {
|
||||
Setup.setupEvents();
|
||||
Setup.setupClasses();
|
||||
Setup.setupTasks();
|
||||
Setup.setupInventories();
|
||||
Setup.setupCommands();
|
||||
this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", signs);
|
||||
sql.queryUpdate("DELETE FROM coreServers WHERE name = '" + this.getConfig().getString("server-name") + "'");
|
||||
|
||||
@@ -88,6 +88,7 @@ public class Setup {
|
||||
public static void setupClasses() {
|
||||
Core.getMainClass().lang = new LanguageSupport(Core.getMainClass());
|
||||
new Inventories(Core.getMainClass());
|
||||
setupInventories();
|
||||
Core.getMainClass().perms = new Permissions(Core.getMainClass());
|
||||
Core.getMainClass().tools = new Tools();
|
||||
Core.getMainClass().pots = new FlowerPots();
|
||||
@@ -212,7 +213,7 @@ public class Setup {
|
||||
Core.getMainClass().getCommand("addAimTWWin").setExecutor(oc);
|
||||
}
|
||||
|
||||
public static void setupInventories() {
|
||||
private static void setupInventories() {
|
||||
Inventories.registerInventory("GAMEMODES", "select_gamemode_inv", ChatColor.DARK_BLUE);
|
||||
Inventories.putIntoInventory("GAMEMODES", 0, Inventories.buildItems(Material.RED_ROSE, "inv_lobby_tps", ChatColor.DARK_GREEN));
|
||||
Inventories.putIntoInventory("GAMEMODES", 2, Inventories.buildItems(Material.CARROT_STICK, "inv_lobby_minigames", ChatColor.BLUE));
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package de.anura.core.events;
|
||||
|
||||
import de.anura.core.API.Core;
|
||||
import de.anura.core.API.Inventories;
|
||||
import de.anura.core.AnuraCore;
|
||||
import de.anura.core.Features;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
@@ -37,6 +35,7 @@ public class PlayerJoin implements Listener {
|
||||
} catch (SQLException e) {
|
||||
}
|
||||
event.setJoinMessage(null);
|
||||
event.getPlayer().getInventory().clear();
|
||||
plugin.pots.refreshCache(event.getPlayer());
|
||||
plugin.pots.refreshPlayer(event.getPlayer());
|
||||
plugin.getFeatures().updateFeatures(event.getPlayer());
|
||||
|
||||
Reference in New Issue
Block a user