mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-17 08:05:19 +01:00
Added code to check if the material exists
This commit is contained in:
parent
3435e508b6
commit
cb0d388251
@ -1,11 +1,14 @@
|
|||||||
package com.sekwah.advancedportals.coreconnector;
|
package com.sekwah.advancedportals.coreconnector;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets info from the specific implementation
|
* Gets info from the specific implementation
|
||||||
*/
|
*/
|
||||||
public class ConnectorDataCollector {
|
public class ConnectorDataCollector {
|
||||||
public boolean materialExists(String materialName) {
|
public boolean materialExists(String materialName) {
|
||||||
return false;
|
String sameCase = materialName.toUpperCase();
|
||||||
|
return Material.getMaterial(sameCase) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.sekwah.advancedportals.spigot;
|
|||||||
|
|
||||||
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
|
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
|
||||||
import com.sekwah.advancedportals.core.util.DataStorage;
|
import com.sekwah.advancedportals.core.util.DataStorage;
|
||||||
|
import com.sekwah.advancedportals.coreconnector.ConnectorDataCollector;
|
||||||
import com.sekwah.advancedportals.coreconnector.command.CommandRegister;
|
import com.sekwah.advancedportals.coreconnector.command.CommandRegister;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
@ -12,7 +13,7 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
|||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
// TODO actually get the minecraft version
|
// TODO actually get the minecraft version
|
||||||
this.portalsCore = new AdvancedPortalsCore(new DataStorage(this.getDataFolder()),
|
this.portalsCore = new AdvancedPortalsCore(new DataStorage(this.getDataFolder()),
|
||||||
new SpigotInfoLogger(this), new CommandRegister(this), new int[]{1,12,2});
|
new SpigotInfoLogger(this), new CommandRegister(this), new ConnectorDataCollector(), new int[]{1,12,2});
|
||||||
this.getServer().getPluginManager().registerEvents(new Listeners(this), this);
|
this.getServer().getPluginManager().registerEvents(new Listeners(this), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user