Fixed not loading MMOItems properly, disabling some compatability.

(Mainly Custom Block Regen)
This commit is contained in:
Aria 2019-12-20 00:37:21 +01:00
parent 6888630355
commit db05b391b0
3 changed files with 8 additions and 5 deletions

View File

@ -138,7 +138,7 @@ public class MMOCore extends JavaPlugin {
public final MMOLoadManager loadManager = new MMOLoadManager();
public RPGUtilHandler rpgUtilHandler = new DefaultRPGUtilHandler();
private boolean miLoaded;
private boolean miLoaded, miChecked;
public void onLoad() {
plugin = this;
@ -363,8 +363,6 @@ public class MMOCore extends JavaPlugin {
}
}.runTaskTimerAsynchronously(MMOCore.plugin, autosave, autosave);
}
miLoaded = Bukkit.getPluginManager().isPluginEnabled("MMOItems");
}
public void onDisable() {
@ -444,6 +442,11 @@ public class MMOCore extends JavaPlugin {
}
public boolean isMILoaded() {
if(!miChecked) {
miLoaded = Bukkit.getPluginManager().isPluginEnabled("MMOItems");
miChecked = true;
}
return miLoaded;
}
}

View File

@ -64,7 +64,7 @@ public class BlockListener implements Listener {
return;
}
if (!perms.canMine(getBlockName(block))) {
if(!perms.canMine(getBlockName(block))) {
MMOCore.plugin.configManager.getSimpleMessage("cannot-break").send(player);
event.setCancelled(true);
return;

View File

@ -60,7 +60,7 @@ public class CustomBlockManager extends MMOManager {
if(MMOCore.plugin.isMILoaded())
if(MMOItems.plugin.getCustomBlocks().isMushroomBlock(block.getType())) {
CustomBlock cblock = CustomBlock.getFromData(block.getBlockData());
if(block != null)
if(cblock != null)
return map.getOrDefault("mi-custom-" + cblock.getId(), map.getOrDefault(block.getType().name(), null));
}