Implementing MaterialAPI - Create new materials!

Discussion in 'Plugin Development' started by Ahmet094, Jun 14, 2013.

Thread Status:
Not open for further replies.

    I'm confused.
    I can't figure out how to use a map as "texture".
    Here's my code, pls help me out. I've been trying to get it working for 2 hours now, but I'm sure you guys know how it should be^^

    This code has to be inserted.
    CustomMap PICTURE = new CustomMap("pictureId", new File(Plugin.getDataFolder(), "Picture.png"));
    CustomMaterial MAP_PICTURE = new CustomMaterial("materialId", Material.MAP);

    [removed the unimportant parts of my code]
    Main class:
    public class ThaumTools extends JavaPlugin implements Listener {
        public static CustomMaterial ThaumAxe;
        public void onEnable() {
            getServer().getPluginManager().registerEvents(this, this);
            ThaumAxe = new ThaumAxe("ThaumAxe", Material.DIAMOND_AXE);
            CustomItemStack is1 = new CustomItemStack(ThaumAxe);
            CustomRecipeShaped r1 = new CustomRecipeShaped(is1);
                    new CustomItemStack[]{null, new CustomItemStack(Material.DIAMOND), null},
                    new CustomItemStack[]{new CustomItemStack(Material.DIAMOND), new CustomItemStack(Material.DIAMOND_AXE), new CustomItemStack(Material.DIAMOND)},
                    new CustomItemStack[]{null});

    Weapon class:
    public class ThaumAxe extends CustomMaterial {
        public ThaumTools plugin;
        CustomMap PICTURE;
        public ThaumAxe(String id, Material material) {
            super(id, material);
            this.PICTURE = new CustomMap("pictureId", new File("plugins/ThaumTools/axe.png"));
            this.setLore("Left-click a tree!");

    Thanks in advance!
  2. Offline


    Looking at the MaterialAPI code & examples, Cybermaxke is providing a way to easily set the image displayed on a map when you hold it. You can't use this to add custom textures to items (that isn't possible without a client mod).
  3. Offline


    desht I'm getting a error in netbeans saying its not abstract and doesnt override some things, why is this?
  4. Offline


    Uh, no idea. I would suggest you ask the API creator in the original thread.
Thread Status:
Not open for further replies.

Share This Page