"Tekkit" Plugin - Interacting

Discussion in 'Plugin Development' started by ZenKristoffer, Dec 18, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    ZenKristoffer

    So I just started on a plugin, it is going to have machines and all that good stuff.
    I made a crafting recipe and made it give me a furnace named "Generator"

    Code:
    package me.technic;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.ShapedRecipe;
    import org.bukkit.inventory.meta.ItemMeta;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class main extends JavaPlugin {
    
        public void onEnable() {
            hrecipe();
    }
    
    private void hrecipe() {
            ItemStack shape1 = new ItemStack(Material.FURNACE, 1);
            ItemMeta meta = shape1.getItemMeta();
            meta.setDisplayName(ChatColor.WHITE + "Generator");
            shape1.setItemMeta(meta);
          
            ShapedRecipe hrecipe = new ShapedRecipe(shape1);
            hrecipe.shape(
                            " 2 ",
                            "1 1",
                            "131");
            hrecipe.setIngredient('1', Material.IRON_INGOT);
            hrecipe.setIngredient('2', Material.GOLD_INGOT);
            hrecipe.setIngredient('3', Material.FURNACE);
            Bukkit.getServer().addRecipe(hrecipe);
    }
    
    
    }
    
    
    But I can't seem to figure out how I'm going to make it so i can put coal in the bottom of the "Generator" and make it burn. And then how I'm going to input it into some sort of system and make "Energy".
     
    Last edited: Dec 18, 2016
  2. @ZenKristoffer I'm making the same thing right now but mine seems to be a lot more complex. I have a head textured as a generator and I am using an inventory for it. Allows me a lot more freedom and control over it. If you want to look at mine you can find it on GitHub http://github.com/bwfcwalshyPluginDev/EasierMC

    Let me give you a heads up, you may want to make your own crafting system and things, make it a lot easier. And if you are making wires and have energy carried along them make sure to only run checks when needed. If you run it every tick like me it is a small amount of time to calculate all of that. @I Al Istannen made a Node system for mine which I am going to be utilizing soon. That kind of system might be needed if you want cables and want it per tick
     
Thread Status:
Not open for further replies.

Share This Page