Click Only If you could spoon feed me code :D

Discussion in 'Spigot Plugin Development' started by Crafter145, Apr 24, 2017.

Thread Status:
Not open for further replies.
  1. Thanks in advanced i cant figure out how to do this im new to java ik im going to do the basics later i need to do this. Plus if you spoon feed me than write what everything means in // then ill understand some of it. So the plugin is for tekkit 1.6.4 and i need to make it so you cant put Aluminumwire(Galactic Craft Mod) on a Tesseract(Thermal Expansion) vise versa because it crashes the server thanks for anyone who will do this. If you dont care for this just leave.
     
    • Optimistic Optimistic x 2
  2. Leave.
     
    • Agree Agree x 4
  3. xD i got some of it
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.block.BlockPlaceEvent;
    import org.bukkit.event.player.PlayerInteractEntityEvent;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.inventory.meta.ItemMeta;
    import org.bukkit.plugin.java.JavaPlugin;

    import thermalexpansion.block.ender.TileTesseract;

    public class Main extends JavaPlugin {

    @Override
    public void onEnable() {
    Bukkit.getPluginManager.registerEvents(this, this))

    }

    @Override
    public void onDisable() {


    }



    @EventHandler
    public void onBlockPlaceEvent(BlockPlaceEvent event){
    Player player = (Player) event.getBlockPlaced();
    TileTesseract blockMeta = (TileTesseract) player.getItemInHand().getItemMeta();







    }

    Idk what to do next i need someone to walk me through
     
  4. This is a new level of stupid.
     
    • Agree Agree x 7
  5. What are you even trying to do buddy? If you're going to have events in the main class it has to implement listeners too. So do main extends java plugin implements listener
     
  6. I mentioned that since the OP is developing a forge mod.
     
  7. I'm sorry, I thought you quoted me lol
     
  8. Get the block placed, make sure it's one of the two blocks, check the locations around it, get the blocks around it, if it's the opposing block then see if they have the same x and z axis, with y being only 1 apart, if so, cancel the event.
     
  9. Someone who understands my stupidity xD
     
  10. Thanks
     
  11. implement Listener so the class declaration should look like:

    public class Main extends JavaPlugin implements Listener {

    AND WHY IN THE WORLD R U TRYING TO DO? ADD THERMAL EXPANSION TO SPIGOT OR HAVE A SPIGOT PLUGIN IN A SPONGE SERVER???
     
    • Funny Funny x 1
  12. Sorry, This is a mod?

    LEARN THE FORGE API!!!
     
  13. Code (Java):
    Bukkit.getServer().getPluginManager().registerEvents(this, this));
     
  14. First of all, 1.6.4 is fucking outdated like shit and we don't even support it at all in these forums, second, we don't support mods, thirdly, we won't fucking spoon-feed you at all. You should take a look at learning Java instead and finding an updated mod pack if you're going to have support over at Sponge(the best to mod).
     
    • Agree Agree x 2
Thread Status:
Not open for further replies.