Solved Pressing a button, drops loot, button respawns (Repeat)

Discussion in 'Plugin Development' started by wdfghj, Oct 10, 2016.

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

    wdfghj

    Hello Guys, i'm a bit new to this whole plugin thing, and coding in general, so go easy !

    I'm having an issue with my plugin where, it's for
    1) not loading (because of the next reason) ##########(Fixed: Now Loads However #2 Doesn't work))############
    2) Buttons being pressed do not drop loot, nor do they respawn, they're normal buttons

    So i understand that when the plugin isn't loaded, it doesn't work, however before i added the whole button idea, it worked, the sets of code you probable need are as follows:

    This Defines what is dropped(May be ugly because i haven't figured out %'s yet):
    Code:
    package me.palycraft.groundzero;
    
    import java.lang.reflect.Array;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Random;
    import org.bukkit.Bukkit;
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.World;
    import org.bukkit.block.Block;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;
    import me.palycraft.groundzero.Main;
    import me.palycraft.groundzero.ButtonPressItemSpawn$1;
    import me.palycraft.groundzero.ButtonPressItemSpawn$2;
    
    public class ButtonPressItemSpawn implements Listener {
        private final Main plugin;
    
        public ButtonPressItemSpawn(Main plugin) {
            this.plugin = plugin;
        }
    
        @EventHandler
       public void onPlayerInteract(PlayerInteractEvent event) {
          Block b = event.getClickedBlock();
          if(b != null && b.getType() == Material.STONE_BUTTON) {
             Location l = event.getClickedBlock().getLocation();
             World world = l.getWorld();
             Material[] itemTypes = new Material[]{Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.REDSTONE, Material.DIAMOND, Material.DIAMOND, Material.DIAMOND, Material.DIAMOND, Material.DIAMOND, Material.DIAMOND, Material.DIAMOND, Material.DIAMOND, Material.DIAMOND, Material.DIAMOND, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.STRING, Material.CLAY_BRICK, Material.CLAY_BRICK, Material.CLAY_BRICK, Material.CLAY_BRICK, Material.CLAY_BRICK, Material.CLAY_BRICK, Material.CLAY_BRICK, Material.CLAY_BRICK, Material.CLAY_BRICK, Material.CLAY_BRICK, Material.CLAY_BALL, Material.CLAY_BALL, Material.CLAY_BALL, Material.CLAY_BALL, Material.CLAY_BALL, Material.CLAY_BALL, Material.CLAY_BALL, Material.CLAY_BALL, Material.CLAY_BALL, Material.CLAY_BALL, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.FLINT, Material.GLOWSTONE_DUST, Material.GLOWSTONE_DUST, Material.SEEDS, Material.SEEDS, Material.SEEDS, Material.SEEDS, Material.SEEDS, Material.SEEDS, Material.SEEDS, Material.SEEDS, Material.BOWL, Material.BOWL, Material.BOWL, Material.BOWL, Material.BOWL, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.STICK, Material.MAGMA_CREAM, Material.MAGMA_CREAM, Material.MAGMA_CREAM, Material.MAGMA_CREAM, Material.MAGMA_CREAM, Material.POISONOUS_POTATO, Material.POISONOUS_POTATO, Material.POISONOUS_POTATO, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.SUGAR_CANE, Material.BOOK, Material.BOOK, Material.BOOK, Material.BOOK, Material.BOOK, Material.BOOK, Material.BOOK, Material.BOOK, Material.BOOK, Material.BOOK, Material.WHEAT, Material.WHEAT, Material.WHEAT, Material.WHEAT, Material.WHEAT, Material.WHEAT, Material.WHEAT, Material.WHEAT, Material.WHEAT, Material.WHEAT, Material.POTION, Material.POTION, Material.POTION, Material.POTION, Material.POTION, Material.POTION, Material.POTION, Material.POTION, Material.POTION, Material.POTION, Material.LEATHER_CHESTPLATE, Material.LEATHER_CHESTPLATE, Material.LEATHER_CHESTPLATE, Material.LEATHER_CHESTPLATE, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.QUARTZ, Material.FLINT_AND_STEEL, Material.FLINT_AND_STEEL, Material.FLINT_AND_STEEL, Material.FLINT_AND_STEEL, Material.FLINT_AND_STEEL, Material.EMERALD, Material.EMERALD, Material.EMERALD, Material.EMERALD, Material.EMERALD, Material.EMERALD, Material.EMERALD, Material.IRON_INGOT, Material.IRON_INGOT, Material.IRON_INGOT, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.SUGAR, Material.GOLD_NUGGET, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.IRON_HOE, Material.ROTTEN_FLESH, Material.ROTTEN_FLESH, Material.ROTTEN_FLESH, Material.ROTTEN_FLESH, Material.ROTTEN_FLESH, Material.ROTTEN_FLESH, Material.ROTTEN_FLESH, Material.ROTTEN_FLESH, Material.APPLE, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.MUSHROOM_SOUP, Material.STONE_SWORD, Material.STONE_SWORD, Material.STONE_SWORD, Material.STONE_SWORD, Material.STONE_SWORD, Material.WOOD_SWORD, Material.WOOD_SWORD, Material.WOOD_SWORD, Material.WOOD_SWORD, Material.WOOD_SWORD, Material.WOOD_SWORD, Material.WOOD_SWORD, Material.WOOD_SWORD, Material.WOOD_SWORD, Material.WOOD_SWORD, Material.LEATHER_BOOTS, Material.LEATHER_BOOTS, Material.LEATHER_BOOTS, Material.LEATHER_HELMET, Material.LEATHER_HELMET, Material.LEATHER_HELMET, Material.LEATHER_HELMET, Material.LEATHER_HELMET, Material.IRON_HELMET, Material.IRON_HELMET, Material.LEATHER_HELMET, Material.IRON_CHESTPLATE, Material.IRON_CHESTPLATE, Material.IRON_LEGGINGS, Material.IRON_LEGGINGS, Material.IRON_BOOTS, Material.IRON_BOOTS, Material.LEATHER_BOOTS, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.EGG, Material.FERMENTED_SPIDER_EYE, Material.FERMENTED_SPIDER_EYE, Material.FERMENTED_SPIDER_EYE, Material.FERMENTED_SPIDER_EYE, Material.FERMENTED_SPIDER_EYE, Material.SLIME_BALL, Material.SLIME_BALL, Material.SLIME_BALL, Material.SLIME_BALL, Material.PUMPKIN_SEEDS, Material.PUMPKIN_SEEDS, Material.PUMPKIN_SEEDS, Material.MELON_SEEDS, Material.BLAZE_POWDER, Material.BLAZE_POWDER, Material.BLAZE_POWDER, Material.BLAZE_POWDER, Material.BLAZE_POWDER, Material.BLAZE_POWDER, Material.BLAZE_POWDER, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.WOOD_SPADE, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO, Material.BAKED_POTATO};
             HashMap displayNames = new HashMap();
             displayNames.put(Material.REDSTONE, "Stripped Wires");
             displayNames.put(Material.DIAMOND, "Broken Electronics");
             displayNames.put(Material.STRING, "Tangled String");
             displayNames.put(Material.CLAY_BRICK, "Old Brick");
             displayNames.put(Material.CLAY_BALL, "Rubble");
             displayNames.put(Material.FLINT, "Metal Scraps");
             displayNames.put(Material.GLOWSTONE_DUST, "Cracked Neon Tube");
             displayNames.put(Material.SEEDS, "Seeds");
             displayNames.put(Material.BOWL, "Empty Can");
             displayNames.put(Material.STICK, "Hard Wood Stick");
             displayNames.put(Material.MAGMA_CREAM, "Metal Sheeting");
             displayNames.put(Material.POISONOUS_POTATO, "Rodent");
             displayNames.put(Material.SUGAR_CANE, "Plastic Ring");
             displayNames.put(Material.BOOK, "Old Magazine");
             displayNames.put(Material.WHEAT, "Blue Ring");
             displayNames.put(Material.POTION, "Full Bottle");
             displayNames.put(Material.LEATHER_CHESTPLATE, "Thick Coat");
             displayNames.put(Material.QUARTZ, "Old battery");
             displayNames.put(Material.FLINT_AND_STEEL, "Lighter");
             displayNames.put(Material.EMERALD, "Gas Can");
             displayNames.put(Material.IRON_INGOT, "Metal Chunk");
             displayNames.put(Material.SUGAR, "Wheat");
             displayNames.put(Material.GOLD_NUGGET, "Old Wedding Ring");
             displayNames.put(Material.BAKED_POTATO, "Cooked Radish");
             displayNames.put(Material.IRON_HOE, "Bloodbag");
             displayNames.put(Material.ROTTEN_FLESH, "Expired MRE");
             displayNames.put(Material.EGG, "Stone");
             displayNames.put(Material.MUSHROOM_SOUP, "Canned Food");
             displayNames.put(Material.STONE_SWORD, "Nailed Bat");
             displayNames.put(Material.WOOD_SWORD, "Wood Bat");
             displayNames.put(Material.LEATHER_BOOTS, "Old Boots");
             displayNames.put(Material.LEATHER_HELMET, "Old Cap");
             displayNames.put(Material.IRON_HELMET, "Bullet Resistant Helmet");
             displayNames.put(Material.IRON_CHESTPLATE, "Bullet Resistant Coat");
             displayNames.put(Material.IRON_LEGGINGS, "Bullet Resistant Pants");
             displayNames.put(Material.IRON_BOOTS, "Steel Toed Boots");
             displayNames.put(Material.FERMENTED_SPIDER_EYE, "Pistol Magazine");
             displayNames.put(Material.SLIME_BALL, "Shotgun Shells");
             displayNames.put(Material.PUMPKIN_SEEDS, "Assault Rifle Magazine");
             displayNames.put(Material.MELON_SEEDS, "Sniper Magazine");
             displayNames.put(Material.BLAZE_POWDER, "Medpack");
             displayNames.put(Material.WOOD_SPADE, "Blueprint");
             displayNames.put(Material.BAKED_POTATO, "Old Radish");
             HashMap loreNames = new HashMap();
             loreNames.put(Material.REDSTONE, "Taken straight from a wall");
             loreNames.put(Material.DIAMOND, "May be able to craft with it...");
             loreNames.put(Material.STRING, "Looks impossible to untangle");
             loreNames.put(Material.CLAY_BRICK, "Just an old Brick");
             loreNames.put(Material.CLAY_BALL, "Useless Rubble");
             loreNames.put(Material.FLINT, "May be useful...");
             loreNames.put(Material.GLOWSTONE_DUST, "Only looks usful");
             loreNames.put(Material.SEEDS, "Wont Survive long out here...");
             loreNames.put(Material.BOWL, "It even has a hole in the bottom...");
             loreNames.put(Material.STICK, "Go hit something with it!");
             loreNames.put(Material.MAGMA_CREAM, "Heavy Duty");
             loreNames.put(Material.POISONOUS_POTATO, "Ewww... Gross");
             loreNames.put(Material.SUGAR_CANE, "Lowest form of Currency");
             loreNames.put(Material.BOOK, "Not much help");
             loreNames.put(Material.WHEAT, "2nd Lowest form of Currency");
             loreNames.put(Material.POTION, "Drink up!");
             loreNames.put(Material.LEATHER_CHESTPLATE, "Minimal Protection");
             loreNames.put(Material.QUARTZ, "Still has power");
             loreNames.put(Material.FLINT_AND_STEEL, "Still here...");
             loreNames.put(Material.EMERALD, "Old, but still usable");
             loreNames.put(Material.IRON_INGOT, "Very Heavy");
             loreNames.put(Material.SUGAR, "Make Food!");
             loreNames.put(Material.GOLD_NUGGET, "Beautiful");
             loreNames.put(Material.BAKED_POTATO, "Hey! This looks good!");
             loreNames.put(Material.IRON_HOE, "Right click to use");
             loreNames.put(Material.ROTTEN_FLESH, "Barely Edible");
             loreNames.put(Material.EGG, "Throw it at something!");
             loreNames.put(Material.MUSHROOM_SOUP, "Filling");
             loreNames.put(Material.STONE_SWORD, "This thing looks rusty...");
             loreNames.put(Material.WOOD_SWORD, "It\'ll do");
             loreNames.put(Material.LEATHER_BOOTS, "Only a few holes");
             loreNames.put(Material.LEATHER_HELMET, "Snug and warm");
             loreNames.put(Material.IRON_HELMET, "Heavy Duty");
             loreNames.put(Material.IRON_CHESTPLATE, "Heavy Duty");
             loreNames.put(Material.IRON_LEGGINGS, "Heavy Duty");
             loreNames.put(Material.IRON_BOOTS, "Just dont go around kicking people!");
             loreNames.put(Material.FERMENTED_SPIDER_EYE, "For any type of pistol");
             loreNames.put(Material.SLIME_BALL, "Six Shells for six kills");
             loreNames.put(Material.PUMPKIN_SEEDS, "Magazine for any Automatic Rifle");
             loreNames.put(Material.MELON_SEEDS, "Ten shot magazine for long range shots");
             loreNames.put(Material.BLAZE_POWDER, "Use for Regeneration");
             loreNames.put(Material.WOOD_SPADE, "Randomized recipe, right click to use.");
             loreNames.put(Material.BAKED_POTATO, "Simple");
             l.setZ(l.getZ() + 0.5D);
             l.setX(l.getX() + 0.5D);
             int len = Array.getLength(itemTypes);
             Random rand = new Random();
             int index = rand.nextInt(len);
             Material item = itemTypes[index];
             ItemStack i = new ItemStack(item);
             ItemMeta meta = i.getItemMeta();
             String displayName = (String)displayNames.get(item);
             String loreName = (String)loreNames.get(item);
             meta.setDisplayName(displayName);
             ArrayList lore = new ArrayList();
             lore.add(loreName);
             meta.setLore(lore);
             i.setItemMeta(meta);
             world.dropItem(l, i);
             if(b != null) {
                b.setType(Material.AIR);
             }
    
             Bukkit.getScheduler().runTaskLater(this.plugin, new ButtonPressItemSpawn$1(this, world, l), 40L);
             Bukkit.getScheduler().runTaskLater(this.plugin, new ButtonPressItemSpawn$2(this, world, l), 3600L);
          }
    
       }
    }
    This Defines/Tells it to, Set air:
    Code:
    package me.palycraft.groundzero;
    
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.World;
    import org.bukkit.block.Block;
    import me.palycraft.groundzero.ButtonPressItemSpawn;
    
    class ButtonPressItemSpawn$1 implements Runnable {
        private ButtonPressItemSpawn this$0;
        private World val$world;
        private Location val$l;
    
        ButtonPressItemSpawn$1(ButtonPressItemSpawn arg0, World arg1, Location arg2) {
            this.this$0 = arg0;
            this.val$world = arg1;
            this.val$l = arg2;
        }
    
        public void run() {
            Block buttonBlock = this.val$world.getBlockAt(this.val$l);
            buttonBlock.setType(Material.AIR);
        }
    }
    This Defines what Button it is (Stone):
    Code:
    package me.palycraft.groundzero;
    
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.World;
    import org.bukkit.block.Block;
    import org.bukkit.block.BlockFace;
    import org.bukkit.block.BlockState;
    import org.bukkit.material.Button;
    import me.palycraft.groundzero.ButtonPressItemSpawn;
    
    class ButtonPressItemSpawn$2 implements Runnable {
        private ButtonPressItemSpawn this$0;
        private World val$world;
        private Location val$l;
    
        ButtonPressItemSpawn$2(ButtonPressItemSpawn arg0, World arg1, Location arg2) {
            this.this$0 = arg0;
            this.val$world = arg1;
            this.val$l = arg2;
        }
    
        public void run() {
            Block buttonBlock = this.val$world.getBlockAt(this.val$l);
            buttonBlock.setType(Material.STONE_BUTTON);
            BlockState state = buttonBlock.getState();
            Button button = (Button) state.getData();
            button.setFacingDirection(BlockFace.UP);
            state.setData(button);
            state.update(true);
            button = (Button) buttonBlock.getState().getData();
        }
    }

    Sorry for the LONG post, however i believe all this information is needed to figure out my issue.


    #############
    EDIT: I fixed the plugin loading issue, however now the plugin doesn't do what i told it to do
    #############

    Anything would be helpful right now, i'm at a loss, Thanks for your time guys!

    For anyone having the issue, it's in your "Main.class" the main class that's being called on plugin start.

    You must remember to put
    this.registerEvents();

    under your onEnable(){

    }

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 10, 2016
Thread Status:
Not open for further replies.

Share This Page