diff options
author | Leonard Kugis <leonard@kug.is> | 2022-04-25 18:39:58 +0200 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2022-04-25 18:39:58 +0200 |
commit | eaed2149f9f018a4486828fea612c7322af32171 (patch) | |
tree | 82806f5696266eedbeeaac95c08e14e7fed6420e /src/main/java/com/encrox/instanceddungeons/Dungeon.java | |
parent | aaf6bd00b1682ce22bab036ccd1d1c280d312a4a (diff) |
Added .gitignore
Diffstat (limited to 'src/main/java/com/encrox/instanceddungeons/Dungeon.java')
-rw-r--r-- | src/main/java/com/encrox/instanceddungeons/Dungeon.java | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/main/java/com/encrox/instanceddungeons/Dungeon.java b/src/main/java/com/encrox/instanceddungeons/Dungeon.java deleted file mode 100644 index 69cd847..0000000 --- a/src/main/java/com/encrox/instanceddungeons/Dungeon.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.encrox.instanceddungeons; - -import java.util.ArrayList; - -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.json.JSONObject; - -import com.sk89q.worldedit.BlockVector; - -public class Dungeon { - - private Section section; - private String id; - private int depth; - private ArrayList<Player> players; - - public Dungeon(Player player, String id, int depth) { - this.id = id; - this.depth = depth; - section = new Section(InstancedDungeons.startDescriptors.getJSONObject((int)Math.round(Math.random()*(InstancedDungeons.startDescriptors.length()-1))), 0, depth); - try { - section.load(); - section.instantiate(); - BlockVector[] destinations = section.getAbsoluteExits(); - BlockVector destination = destinations[(int)Math.round(Math.random()*(destinations.length-1))]; - addPlayer(player); - player.teleport(new Location(InstancedDungeons.dungeonWorld.getWorld(), destination.getBlockX(), destination.getBlockY(), destination.getBlockZ())); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void addPlayer(Player player) { - section.addPlayer(player); - } - - public void removePlayer(Player player) { - section.removePlayer(player); - } - - public String getId() { - return id; - } - -} |