Skip to content

Commit

Permalink
Made item material more accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
tbvns committed Jan 26, 2024
1 parent b970e22 commit 63b9560
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ public void load() {
mods.Items.forEach(i -> {
try {
if (i.size() == 4) {
new RegisterItem().register(i.get(0), i.get(1), Material.getMaterial(i.get(2)), i.get(3));
new RegisterItem().register((String) i.get(0),(String) i.get(1),(Material) i.get(2),(String) i.get(3));
} else {
new RegisterItem().register(i.get(0), i.get(1), i.get(2), Material.getMaterial(i.get(3)), i.get(4));
new RegisterItem().register((String) i.get(0),(String) i.get(1),(String) i.get(2),(Material) i.get(3),(String) i.get(4));
}
} catch (Exception e) {
KelpModLoader.getPlugin(KelpModLoader.class).getServer().getConsoleSender().sendMessage("§4The item §c" + i.get(0) + " §4from the mod §c" + Mod.name + " §4has not loaded properly.");
Expand All @@ -104,7 +104,7 @@ public void load() {
});

mods.Blocks.forEach(b -> {
new RegisterBlock().Register(b.get(0), b.get(1));
new RegisterBlock().Register((String) b.get(0),(String) b.get(1));
});

mods.Textures.forEach(t -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.prismenetwork.kelpmodloader.ModsAPI;

import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.plugin.Plugin;
import xyz.prismenetwork.kelpmodloader.Constant;
Expand All @@ -14,8 +15,8 @@
import java.util.List;

public class Mods {
public List<ArrayList<String>> Items = new ArrayList<>();
public List<ArrayList<String>> Blocks = new ArrayList<>();
public List<ArrayList> Items = new ArrayList<>();
public List<ArrayList> Blocks = new ArrayList<>();
public List<ArrayList> Textures = new ArrayList<>();
public List<ArrayList> Models = new ArrayList<>();
private Server server = KelpModLoader.getPlugin(KelpModLoader.class).getServer();
Expand All @@ -38,7 +39,7 @@ public Plugin getKMLplugin() {
* @param texture The name of the texture that will be displayed on this item.
* @param material The base bukkit material of this item.
*/
public void addItem(String name, String lore, String texture, String material) {
public void addItem(String name, String lore, String texture, Material material) {
ArrayList Item = new ArrayList<>();
Item.add(name);
Item.add(texture);
Expand All @@ -54,7 +55,7 @@ public void addItem(String name, String lore, String texture, String material) {
* @param material The base bukkit material of this item.
* @param itemType The type of item to use.
*/
public void addItem(String name, String lore, String texture, String material, String itemType) {
public void addItem(String name, String lore, String texture, Material material, String itemType) {
ArrayList Item = new ArrayList<>();
Item.add(name);
Item.add(texture);
Expand Down

0 comments on commit 63b9560

Please sign in to comment.