Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.Camer047;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.block.Block;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- public class DefenceClass extends JavaPlugin {
- @Override
- public void onEnable() {
- new ListenerClass(this);
- }
- @Override
- public void onDisable() {
- }
- //Unused command boolean
- //
- // public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- //
- // if (cmd.getName().equalsIgnoreCase("BLANK") && sender instanceof Player) {
- //
- // Player player = (Player) sender;
- //
- // return true;
- //
- // }
- //
- // return false;
- // }
- public void chestTimer() {
- //Teaching the array how to count
- final int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 , 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60};
- //Import bukkit schedular
- Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
- public void run(){
- //Create var 't' t uses above counting sequence
- for(int t : array){
- //After we get to 60,
- if(t == 60){
- //we spawn a chest with all random junk in it
- Location loc = Bukkit.getServer().getWorld("Survival").getSpawnLocation();
- Block block = loc.getBlock();
- loc.getBlock().setType(Material.CHEST);
- Chest chest = (Chest)block.getState();
- Inventory inv = chest.getInventory();
- }
- break;
- }
- }
- }, 0, 20);
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement