Advertisement
Guest User

PasteCommand

a guest
Aug 12th, 2021
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. package com.bwpractice.commands.subcommands;
  2.  
  3. import com.bwpractice.Main.MainClass;
  4. import com.bwpractice.commands.SubCommands;
  5. import org.bukkit.Location;
  6. import org.bukkit.entity.Player;
  7.  
  8. public class PasteCommand extends SubCommands {
  9.     @Override
  10.     public String getName() {
  11.         return "paste";
  12.     }
  13.  
  14.     @Override
  15.     public String getDescription() {
  16.         return "Pastes blocks.";
  17.     }
  18.  
  19.     @Override
  20.     public String getSyntax() {
  21.         return "/bwp paste";
  22.     }
  23.  
  24.     @Override
  25.     public void perform(Player player, String[] args) {
  26.         for (int x = 0;x< MainClass.g_Paste.size();x++)
  27.             for(int y = 0;y<MainClass.g_Paste.get(x).size();y++)
  28.                 for(int z = 0;z<MainClass.g_Paste.get(x).get(y).size();z++)
  29.                 {
  30.                     Location newLocation = new Location(player.getWorld(),player.getLocation().toVector().getBlockX() ,player.getLocation().toVector().getBlockY()-1,player.getLocation().toVector().getBlockZ());
  31.                     newLocation.getBlock().setType(MainClass.g_Paste.get(x).get(y).get(z));
  32.                     player.sendMessage(MainClass.g_Paste.get(x).get(y).get(z).toString());
  33.                 }
  34.     }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement