Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package online.pixelbuilt.pixelbuiltgyms.Kanto;
- import com.flowpowered.math.vector.Vector3d;
- import config.AccountManagerGyms;
- import ninja.leaping.configurate.ConfigurationNode;
- import online.pixelbuilt.pixelbuiltgyms.PixelBuiltGyms;
- import org.spongepowered.api.Sponge;
- import org.spongepowered.api.block.BlockSnapshot;
- import org.spongepowered.api.block.BlockTypes;
- import org.spongepowered.api.command.CommandManager;
- import org.spongepowered.api.entity.Transform;
- import org.spongepowered.api.entity.living.player.Player;
- import org.spongepowered.api.event.Listener;
- import org.spongepowered.api.event.block.InteractBlockEvent;
- import org.spongepowered.api.event.entity.MoveEntityEvent;
- import org.spongepowered.api.event.filter.cause.Root;
- import org.spongepowered.api.text.Text;
- import org.spongepowered.api.text.format.TextColors;
- import org.spongepowered.api.world.Location;
- import org.spongepowered.api.world.World;
- import java.util.Random;
- import java.util.UUID;
- public class vermilionGym {
- public vermilionGym(PixelBuiltGyms plugin) {
- this.plugin = plugin;
- }
- public PixelBuiltGyms plugin;
- public ConfigurationNode config;
- public AccountManagerGyms accountManagerGyms;
- @Listener
- public void onRightClickonTrashCan(InteractBlockEvent.Secondary.MainHand event, @Root Player player) {
- UUID uuid = player.getUniqueId();
- accountManagerGyms = new AccountManagerGyms(plugin);
- Location<World> playerloc = player.getLocation();
- Location<World> eventLoc = event.getTargetBlock().getLocation().get();
- CommandManager cmdManager = Sponge.getCommandManager();
- BlockSnapshot block = event.getTargetBlock();
- ConfigurationNode node = accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans");
- String playername = player.getName();
- if (block.getState().getType().getName().contains("pixelmon:trash_can")) {
- if (!player.hasPermission("first.gate")) {
- if (playerloc.getBlockX() >= -1021) {
- if (playerloc.getBlockX() <= -1009) {
- if (node.getValue().equals(1)) {
- if (eventLoc.getBlockX() == -1020) {
- if (eventLoc.getBlockZ() == -1803) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(2)) {
- if (eventLoc.getBlockX() == -1018) {
- if (eventLoc.getBlockZ() == -1803) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(3)) {
- if (eventLoc.getBlockX() == -1016) {
- if (eventLoc.getBlockZ() == -1803) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(4)) {
- if (eventLoc.getBlockX() == -1014) {
- if (eventLoc.getBlockZ() == -1803) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(5)) {
- if (eventLoc.getBlockX() == -1012) {
- if (eventLoc.getBlockZ() == -1803) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(6)) {
- if (eventLoc.getBlockX() == -1020) {
- if (eventLoc.getBlockZ() == -1801) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(7)) {
- if (eventLoc.getBlockX() == -1018) {
- if (eventLoc.getBlockZ() == -1801) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(8)) {
- if (eventLoc.getBlockX() == -1016) {
- if (eventLoc.getBlockZ() == -1801) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(9)) {
- if (eventLoc.getBlockX() == -1014) {
- if (eventLoc.getBlockZ() == -1801) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(10)) {
- if (eventLoc.getBlockX() == -1012) {
- if (eventLoc.getBlockZ() == -1801) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(11)) {
- if (eventLoc.getBlockX() == -1020) {
- if (eventLoc.getBlockZ() == -1799) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(12)) {
- if (eventLoc.getBlockX() == -1018) {
- if (eventLoc.getBlockZ() == -1799) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(13)) {
- if (eventLoc.getBlockX() == -1016) {
- if (eventLoc.getBlockZ() == -1799) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(14)) {
- if (eventLoc.getBlockX() == -1014) {
- if (eventLoc.getBlockZ() == -1799) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else if (node.getValue().equals(15)) {
- if (eventLoc.getBlockX() == -1012) {
- if (eventLoc.getBlockZ() == -1799) {
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set first.gate true");
- player.sendMessage(Text.of(TextColors.GREEN, ("Hey! There's a switch under the trash! Turn it on!")));
- player.sendMessage(Text.of(TextColors.GREEN, ("The first electric lock opened!")));
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- } else {
- player.sendMessage(Text.of(TextColors.RED, ("Nope! There's only trash here.")));
- }
- }
- }
- }
- } else {
- if (!player.hasPermission("second.gate")) {
- ConfigurationNode node1 = accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord");
- ConfigurationNode node2 = accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord");
- if (node1.getValue().equals(eventLoc.getBlockX())) {
- if (node2.getValue().equals(eventLoc.getBlockZ())) {
- player.sendMessage(Text.of(TextColors.GREEN, "The second electric lock opened! The motorized door opened!"));
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission set second.gate true");
- } else {
- player.sendMessage(Text.of(TextColors.RED, "Hey! The electric locks were reset!"));
- cmdManager.process(Sponge.getServer().getConsole(), "lp user " + playername + " permission unset first.gate");
- Random newRandom = new Random();
- int vermilionGymRandom = newRandom.nextInt(15 - 1) + 1;
- if (vermilionGymRandom == 1) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(1);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 2) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(2);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 3) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(3);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 4) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(4);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 5) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(5);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 6) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(6);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 7) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(7);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 8) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(8);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 9) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(9);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 10) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(10);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 11) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(11);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 12) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(12);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 13) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(13);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 14) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(14);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 15) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(15);
- accountManagerGyms.saveConfig();
- }
- }
- }
- } else {
- player.sendMessage(Text.of("You have the permission!"));
- }
- }
- }
- }
- @Listener
- public void onWalkingonClay (MoveEntityEvent e, @Root Player player) {
- UUID uuid = player.getUniqueId();
- Location<World> loc1 = player.getLocation();
- Location<World> loc2 = loc1.sub(0, 1, 0);
- World world = Sponge.getServer().getWorlds().iterator().next();
- CommandManager cmdManager = Sponge.getCommandManager();
- String playername = player.getName();
- if (e.getCause().first(Player.class).isPresent()) {
- if (loc2.getBlockType() == (BlockTypes.STAINED_HARDENED_CLAY)) {
- if (loc1.getBlockX() >= -1019 && loc1.getBlockX() <= -1006 && loc1.getBlockY() >= 68 && loc1.getBlockY() <= 70 && loc1.getBlockZ() >= -1790 && loc1.getBlockZ() <= -1786) {
- Vector3d r = player.getRotation();
- Location<World> tpTo = new Location<World>(world, -1015, 59, -1795);
- Transform tpToT = new Transform(tpTo).addRotation(r);
- e.setToTransform(tpToT);
- player.sendMessage(Text.of("Welcome to the Vermilion Gym!"));
- Random newRandom = new Random();
- int vermilionGymRandom = newRandom.nextInt(15 - 1) + 1;
- if (vermilionGymRandom == 1) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(1);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 2) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(2);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 3) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(3);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 4) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(4);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 5) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(5);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 6) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(6);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 7) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(7);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 8) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(8);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 9) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(9);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 10) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(10);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 11) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(11);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 12) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(12);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 13) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(13);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 14) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(14);
- accountManagerGyms.saveConfig();
- } else if (vermilionGymRandom == 15) {
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans").setValue(15);
- accountManagerGyms.saveConfig();
- }
- ConfigurationNode node = accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "RNG for trash cans");
- if (node.getValue().equals(1)) {
- int xCoord = -1020;
- int zCoord = -1803;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(2 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1020 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1018);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1803);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 2) {
- int newZ = -1803 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1020);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- }
- } else if (node.getValue().equals(2)) {
- int xCoord = -1018;
- int zCoord = -1803;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(2 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1018 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1016);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1803);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 2) {
- int newZ = -1803 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1018);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- }
- } else if (node.getValue().equals(3)) {
- int xCoord = -1016;
- int zCoord = -1803;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(3 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1016 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1014);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1803);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 2) {
- int newX = -1016 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1018);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1803);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 3) {
- int newZ = -1803 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1016);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- }
- } else if (node.getValue().equals(4)) {
- int xCoord = -1014;
- int zCoord = -1803;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(2 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1014 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1012);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1803);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 2) {
- int newZ = -1803 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1014);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- }
- } else if (node.getValue().equals(5)) {
- int xCoord = -1012;
- int zCoord = -1803;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(2 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1012 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1014);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1803);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 2) {
- int newZ = -1803 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1012);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- }
- } else if (node.getValue().equals(6)) {
- int xCoord = -1020;
- int zCoord = -1801;
- int newX = -1020 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1018);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- } else if (node.getValue().equals(7)) {
- int xCoord = -1018;
- int zCoord = -1801;
- int newX = -1018 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1016);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- } else if (node.getValue().equals(8)) {
- int xCoord = -1016;
- int zCoord = -1801;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(2 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1016 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1018);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 2) {
- int newX = -1016 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1014);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- }
- } else if (node.getValue().equals(9)) {
- int xCoord = -1014;
- int zCoord = -1801;
- int newX = -1014 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1016);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- } else if (node.getValue().equals(10)) {
- int xCoord = -1012;
- int zCoord = -1801;
- int newX = -1012 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1014);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- } else if (node.getValue().equals(11)) {
- int xCoord = -1020;
- int zCoord = -1799;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(2 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1020 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1018);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1799);
- accountManagerGyms.saveConfig();
- } else {
- int newZ = -1799 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1020);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- }
- } else if (node.getValue().equals(12)) {
- int xCoord = -1018;
- int zCoord = -1799;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(2 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1018 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1016);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1799);
- accountManagerGyms.saveConfig();
- } else {
- int newZ = -1799 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1016);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- }
- } else if (node.getValue().equals(13)) {
- int xCoord = -1016;
- int zCoord = -1799;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(3 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1016 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1014);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1799);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 2) {
- int newZ = -1799 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1016);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 3) {
- int newX = -1016 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1018);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1799);
- accountManagerGyms.saveConfig();
- }
- } else if (node.getValue().equals(14)) {
- int xCoord = -1014;
- int zCoord = -1799;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(2 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1014 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1012);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1799);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 2) {
- int newZ = -1799 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1014);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- }
- } else if (node.getValue().equals(15)) {
- int xCoord = -1012;
- int zCoord = -1799;
- Random newCoords = new Random();
- int newCoord = newCoords.nextInt(2 - 1) + 1;
- if (newCoord == 1) {
- int newX = -1014 + 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1012);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1799);
- accountManagerGyms.saveConfig();
- } else if (newCoord == 2) {
- int newZ = -1799 - 2;
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "xCoord").setValue(-1012);
- accountManagerGyms.saveConfig();
- accountManagerGyms.getAccountsConfig().getNode(uuid.toString(), "Kanto Gyms", "Vermilion", "newCoords", "zCoord").setValue(-1801);
- accountManagerGyms.saveConfig();
- }
- }
- } else if (loc1.getBlockX() >= -1019 && loc1.getBlockX() <= -1011 && loc1.getBlockY() >= 59 && loc1.getBlockY() <= 61 && loc1.getBlockZ() >= -1804 && loc1.getBlockZ() <= -1803) {
- if (player.hasPermission("first.gate") && player.hasPermission("second.gate")) {
- Vector3d r = player.getRotation();
- Location<World> tpTo = new Location<World>(world, -1015, 59, -1808);
- Transform tpToT = new Transform(tpTo).addRotation(r);
- e.setToTransform(tpToT);
- } else {
- player.sendMessage(Text.of(TextColors.RED, "You have not unlocked the gates!"));
- }
- } else if (loc1.getBlockX() >= -1016 && loc1.getBlockX() <= -1014 && loc1.getBlockY() >= 59 && loc1.getBlockY() <= 61 && loc1.getBlockZ() >= -1807 && loc1.getBlockZ() <= -1804) {
- Vector3d r = player.getRotation();
- Location<World> tpTo = new Location<World>(world, -1014, 59, -1802);
- Transform tpToT = new Transform(tpTo).addRotation(r);
- e.setToTransform(tpToT);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement