From eaed2149f9f018a4486828fea612c7322af32171 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Mon, 25 Apr 2022 18:39:58 +0200 Subject: Added .gitignore --- .gitignore | 171 ++++++++++++++ dependency-reduced-pom.xml | 104 -------- pom.xml | 117 --------- .../com/encrox/instanceddungeons/Commander.java | 40 ---- .../com/encrox/instanceddungeons/Direction.java | 10 - .../java/com/encrox/instanceddungeons/Dungeon.java | 48 ---- .../com/encrox/instanceddungeons/DungeonWorld.java | 50 ---- .../instanceddungeons/InstancedDungeons.java | 253 -------------------- .../com/encrox/instanceddungeons/Schematic.java | 86 ------- .../java/com/encrox/instanceddungeons/Section.java | 263 --------------------- src/main/resources/config.json | 22 -- src/main/resources/descriptor.json | 72 ------ src/main/resources/lang/de-DE.properties | 1 - src/main/resources/lang/en-GB.properties | 1 - src/main/resources/plugin.yml | 9 - src/main/resources/schematics/endBottom.schematic | Bin 270 -> 0 bytes src/main/resources/schematics/endSide.schematic | Bin 317 -> 0 bytes src/main/resources/schematics/endTop.schematic | Bin 358 -> 0 bytes .../resources/schematics/startBottom.schematic | Bin 423 -> 0 bytes src/main/resources/schematics/startSide.schematic | Bin 252 -> 0 bytes src/main/resources/schematics/startTop.schematic | Bin 278 -> 0 bytes src/main/resources/schematics/test.schematic | Bin 345 -> 0 bytes .../com/encrox/instanceddungeons/Commander.class | Bin 1787 -> 0 bytes .../com/encrox/instanceddungeons/Direction.class | Bin 444 -> 0 bytes .../com/encrox/instanceddungeons/Dungeon.class | Bin 2362 -> 0 bytes .../encrox/instanceddungeons/DungeonWorld.class | Bin 2329 -> 0 bytes .../instanceddungeons/InstancedDungeons.class | Bin 8395 -> 0 bytes .../com/encrox/instanceddungeons/Schematic.class | Bin 3096 -> 0 bytes .../com/encrox/instanceddungeons/Section$1.class | Bin 954 -> 0 bytes .../com/encrox/instanceddungeons/Section$2$1.class | Bin 4193 -> 0 bytes .../com/encrox/instanceddungeons/Section$2.class | Bin 3034 -> 0 bytes .../com/encrox/instanceddungeons/Section.class | Bin 9723 -> 0 bytes target/classes/config.json | 22 -- target/classes/descriptor.json | 72 ------ target/classes/lang/de-DE.properties | 1 - target/classes/lang/en-GB.properties | 1 - target/classes/plugin.yml | 9 - target/classes/schematics/endBottom.schematic | Bin 270 -> 0 bytes target/classes/schematics/endSide.schematic | Bin 317 -> 0 bytes target/classes/schematics/endTop.schematic | Bin 358 -> 0 bytes target/classes/schematics/startBottom.schematic | Bin 423 -> 0 bytes target/classes/schematics/startSide.schematic | Bin 252 -> 0 bytes target/classes/schematics/startTop.schematic | Bin 278 -> 0 bytes target/classes/schematics/test.schematic | Bin 345 -> 0 bytes target/instanceddungeons-0.0.1-SNAPSHOT-shaded.jar | Bin 96433 -> 0 bytes target/instanceddungeons-0.0.1-SNAPSHOT.jar | Bin 96433 -> 0 bytes target/maven-archiver/pom.properties | 5 - .../compile/default-compile/createdFiles.lst | 0 .../compile/default-compile/inputFiles.lst | 7 - .../testCompile/default-testCompile/inputFiles.lst | 0 .../original-instanceddungeons-0.0.1-SNAPSHOT.jar | Bin 25293 -> 0 bytes 51 files changed, 171 insertions(+), 1193 deletions(-) create mode 100644 .gitignore delete mode 100644 dependency-reduced-pom.xml delete mode 100644 pom.xml delete mode 100644 src/main/java/com/encrox/instanceddungeons/Commander.java delete mode 100644 src/main/java/com/encrox/instanceddungeons/Direction.java delete mode 100644 src/main/java/com/encrox/instanceddungeons/Dungeon.java delete mode 100644 src/main/java/com/encrox/instanceddungeons/DungeonWorld.java delete mode 100644 src/main/java/com/encrox/instanceddungeons/InstancedDungeons.java delete mode 100644 src/main/java/com/encrox/instanceddungeons/Schematic.java delete mode 100644 src/main/java/com/encrox/instanceddungeons/Section.java delete mode 100644 src/main/resources/config.json delete mode 100644 src/main/resources/descriptor.json delete mode 100644 src/main/resources/lang/de-DE.properties delete mode 100644 src/main/resources/lang/en-GB.properties delete mode 100644 src/main/resources/plugin.yml delete mode 100644 src/main/resources/schematics/endBottom.schematic delete mode 100644 src/main/resources/schematics/endSide.schematic delete mode 100644 src/main/resources/schematics/endTop.schematic delete mode 100644 src/main/resources/schematics/startBottom.schematic delete mode 100644 src/main/resources/schematics/startSide.schematic delete mode 100644 src/main/resources/schematics/startTop.schematic delete mode 100644 src/main/resources/schematics/test.schematic delete mode 100644 target/classes/com/encrox/instanceddungeons/Commander.class delete mode 100644 target/classes/com/encrox/instanceddungeons/Direction.class delete mode 100644 target/classes/com/encrox/instanceddungeons/Dungeon.class delete mode 100644 target/classes/com/encrox/instanceddungeons/DungeonWorld.class delete mode 100644 target/classes/com/encrox/instanceddungeons/InstancedDungeons.class delete mode 100644 target/classes/com/encrox/instanceddungeons/Schematic.class delete mode 100644 target/classes/com/encrox/instanceddungeons/Section$1.class delete mode 100644 target/classes/com/encrox/instanceddungeons/Section$2$1.class delete mode 100644 target/classes/com/encrox/instanceddungeons/Section$2.class delete mode 100644 target/classes/com/encrox/instanceddungeons/Section.class delete mode 100644 target/classes/config.json delete mode 100644 target/classes/descriptor.json delete mode 100644 target/classes/lang/de-DE.properties delete mode 100644 target/classes/lang/en-GB.properties delete mode 100644 target/classes/plugin.yml delete mode 100644 target/classes/schematics/endBottom.schematic delete mode 100644 target/classes/schematics/endSide.schematic delete mode 100644 target/classes/schematics/endTop.schematic delete mode 100644 target/classes/schematics/startBottom.schematic delete mode 100644 target/classes/schematics/startSide.schematic delete mode 100644 target/classes/schematics/startTop.schematic delete mode 100644 target/classes/schematics/test.schematic delete mode 100644 target/instanceddungeons-0.0.1-SNAPSHOT-shaded.jar delete mode 100644 target/instanceddungeons-0.0.1-SNAPSHOT.jar delete mode 100644 target/maven-archiver/pom.properties delete mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst delete mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst delete mode 100644 target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst delete mode 100644 target/original-instanceddungeons-0.0.1-SNAPSHOT.jar diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d02df8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,171 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/eclipse,java,windows,linux,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=eclipse,java,windows,linux,macos + +### Eclipse ### +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +### Eclipse Patch ### +# Spring Boot Tooling +.sts4-cache/ + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/eclipse,java,windows,linux,macos diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml deleted file mode 100644 index bf11dfd..0000000 --- a/dependency-reduced-pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - 4.0.0 - com.encrox - instanceddungeons - InstancedDungeons - 0.0.1-SNAPSHOT - - - - src/main/resources - - plugin.yml - config.json - descriptor.json - - - - schematics - src/main/resources/schematics - - endBottom.schematic - endSide.schematic - endTop.schematic - startBottom.schematic - startSide.schematic - startTop.schematic - test.schematic - - - - lang - src/main/resources/lang - - de-DE.properties - en-GB.properties - - - - - - maven-compiler-plugin - 3.6.0 - - 1.8 - 1.8 - - - - maven-shade-plugin - 2.1 - - - package - - shade - - - - - org.jnbt:jnbt:* - org.json:json:* - - - - - - - - - - - org.bukkit - craftbukkit - LATEST - provided - - - com.sk89q - worledit - 6.1 - provided - - - com.sk89q - worldguard - 6.1 - provided - - - com.comphenix - protocollib - 4.2.0 - provided - - - com.encrox - instancedregions - 0.0.1-SNAPSHOT - provided - - - - diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 45671ed..0000000 --- a/pom.xml +++ /dev/null @@ -1,117 +0,0 @@ - - 4.0.0 - com.encrox - instanceddungeons - 0.0.1-SNAPSHOT - InstancedDungeons - - - - org.bukkit - craftbukkit - LATEST - provided - - - com.sk89q - worledit - 6.1 - provided - - - com.sk89q - worldguard - 6.1 - provided - - - com.comphenix - protocollib - 4.2.0 - provided - - - com.encrox - instancedregions - 0.0.1-SNAPSHOT - provided - - - org.json - json - 20160810 - package - - - org.jnbt - jnbt - 1.1 - package - - - - - - src/main/resources - - plugin.yml - config.json - descriptor.json - - - - src/main/resources/schematics - schematics - - endBottom.schematic - endSide.schematic - endTop.schematic - startBottom.schematic - startSide.schematic - startTop.schematic - test.schematic - - - - src/main/resources/lang - lang - - de-DE.properties - en-GB.properties - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.0 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-shade-plugin - 2.1 - - - package - - shade - - - - - org.jnbt:jnbt:* - org.json:json:* - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/com/encrox/instanceddungeons/Commander.java b/src/main/java/com/encrox/instanceddungeons/Commander.java deleted file mode 100644 index 0bc8ce9..0000000 --- a/src/main/java/com/encrox/instanceddungeons/Commander.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.encrox.instanceddungeons; - -import org.bukkit.ChatColor; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.json.JSONObject; - -public class Commander implements CommandExecutor { - - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if(sender instanceof Player) { - Player player = (Player)sender; - try { - switch(args[0]) { - case "open": - break; - case "invite": - break; - case "join": - break; - case "close": - break; - case "random": - Dungeon dungeon = new Dungeon(player, args[1], Integer.parseInt(args[2])); - InstancedDungeons.dungeons.add(dungeon); - return true; - } - } catch(Exception e) { - e.printStackTrace(); - } - } else { - sender.sendMessage("no player"); - } - return false; - } - -} diff --git a/src/main/java/com/encrox/instanceddungeons/Direction.java b/src/main/java/com/encrox/instanceddungeons/Direction.java deleted file mode 100644 index 05f391e..0000000 --- a/src/main/java/com/encrox/instanceddungeons/Direction.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.encrox.instanceddungeons; - -public class Direction { - - public static final byte NORTH = 0; - public static final byte EAST = 1; - public static final byte SOUTH = 2; - public static final byte WEST = 3; - -} 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 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; - } - -} diff --git a/src/main/java/com/encrox/instanceddungeons/DungeonWorld.java b/src/main/java/com/encrox/instanceddungeons/DungeonWorld.java deleted file mode 100644 index 643c787..0000000 --- a/src/main/java/com/encrox/instanceddungeons/DungeonWorld.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.encrox.instanceddungeons; - -import java.util.ArrayList; - -import org.bukkit.World; -import org.bukkit.plugin.Plugin; - -import com.encrox.instancedregions.InstancedProtectedCuboidRegion; -import com.sk89q.worldedit.BlockVector; -import com.sk89q.worldedit.BlockVector2D; -import com.sk89q.worldedit.regions.CuboidRegion; -import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion; -import com.sk89q.worldguard.protection.regions.ProtectedRegion; - -public class DungeonWorld { - - private Plugin plugin; - private World world; - private ArrayList regions; - private int lastX; - - public DungeonWorld(Plugin plugin, World world) { - this.world = world; - this.plugin = plugin; - regions = new ArrayList(); - lastX = 0; - } - - public InstancedProtectedCuboidRegion allocate(int width, int length) { - BlockVector min, max; - InstancedProtectedCuboidRegion region; - for(int i = 0; true; i+=16) { - if(new ProtectedCuboidRegion("current", (min = new BlockVector(lastX+i, 0, 0)), (max = new BlockVector(lastX+i+width, 255, length))).getIntersectingRegions(regions).isEmpty()) { - region = new InstancedProtectedCuboidRegion(plugin, world, ""+min.getBlockX(), min, max); - regions.add(region); - return region; - } - } - } - - //YOU STILL HAVE TO DISPOSE THE INSTANCED REGION MANUALLY! - public void deallocate(InstancedProtectedCuboidRegion region) { - regions.remove(region); - } - - public World getWorld() { - return world; - } - -} diff --git a/src/main/java/com/encrox/instanceddungeons/InstancedDungeons.java b/src/main/java/com/encrox/instanceddungeons/InstancedDungeons.java deleted file mode 100644 index 7064aa1..0000000 --- a/src/main/java/com/encrox/instanceddungeons/InstancedDungeons.java +++ /dev/null @@ -1,253 +0,0 @@ -package com.encrox.instanceddungeons; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Logger; - -import org.bukkit.Bukkit; -import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.PluginDescriptionFile; -import org.bukkit.plugin.java.JavaPlugin; -import org.json.JSONArray; -import org.json.JSONObject; - -public class InstancedDungeons extends JavaPlugin { - - public static Plugin plugin; - public static Logger logger; - public static PluginDescriptionFile pdf; - //public static Properties lang; - public static JSONObject config; - public static JSONArray resetDungeons, schematicDescriptors, startDescriptors, endDescriptors, normalDescriptors; - public static DungeonWorld dungeonWorld; - public static File schematicsDirectory; - public static ArrayList dungeons; - - public void onEnable() { - pdf = getDescription(); - logger = Logger.getLogger("Minecraft"); - if(setupMyself()) { - plugin = this; - getCommand("dungeon").setExecutor(new Commander()); - logger.info(pdf.getName() + " " + pdf.getVersion() + " has been enabled."); - } else { - logger.info(pdf.getName() + " " + pdf.getVersion() + " has been disabled."); - } - } - - public boolean setupMyself() { - if(!this.getDataFolder().exists()) - this.getDataFolder().mkdirs(); - schematicsDirectory = new File(this.getDataFolder(), "schematics"); - if(!schematicsDirectory.exists()) - schematicsDirectory.mkdirs(); - File configFile = new File(this.getDataFolder(), "config.json"); - if(!configFile.exists()) { - BufferedInputStream bis; - FileOutputStream out; - try { - bis = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream("config.json")); - out = new FileOutputStream(configFile); - int current; - while((current = bis.read()) != -1) { - out.write(current); - } - bis.close(); - out.close(); - } catch (Exception e) { - e.printStackTrace(); - return false; - } - } - BufferedReader br; - StringBuilder sb = new StringBuilder(); - String line; - try { - br = new BufferedReader(new FileReader(configFile)); - while((line = br.readLine()) != null) - sb.append(line); - br.close(); - } catch (Exception e1) { - e1.printStackTrace(); - return false; - } - config = new JSONObject(sb.toString()); - resetDungeons = config.getJSONArray("resetDungeons"); - File schematicDescriptorFile = new File(schematicsDirectory, "descriptor.json"); - if(!schematicDescriptorFile.exists()) { - int current; - try { - BufferedInputStream bis = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream("descriptor.json")); - FileOutputStream out = new FileOutputStream(schematicDescriptorFile); - while((current = bis.read()) != -1) { - out.write(current); - } - bis.close(); - out.close(); - } catch(Exception e) { - e.printStackTrace(); - return false; - } - try { - BufferedInputStream bis = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream("schematics/endBottom.schematic")); - FileOutputStream out = new FileOutputStream(new File(schematicsDirectory, "endBottom.schematic")); - while((current = bis.read()) != -1) { - out.write(current); - } - bis.close(); - out.close(); - } catch(Exception e) { - e.printStackTrace(); - return false; - } - try { - BufferedInputStream bis = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream("schematics/endSide.schematic")); - FileOutputStream out = new FileOutputStream(new File(schematicsDirectory, "endSide.schematic")); - while((current = bis.read()) != -1) { - out.write(current); - } - bis.close(); - out.close(); - } catch(Exception e) { - e.printStackTrace(); - return false; - } - try { - BufferedInputStream bis = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream("schematics/endTop.schematic")); - FileOutputStream out = new FileOutputStream(new File(schematicsDirectory, "endTop.schematic")); - while((current = bis.read()) != -1) { - out.write(current); - } - bis.close(); - out.close(); - } catch(Exception e) { - e.printStackTrace(); - return false; - } - try { - BufferedInputStream bis = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream("schematics/startBottom.schematic")); - FileOutputStream out = new FileOutputStream(new File(schematicsDirectory, "startBottom.schematic")); - while((current = bis.read()) != -1) { - out.write(current); - } - bis.close(); - out.close(); - } catch(Exception e) { - e.printStackTrace(); - return false; - } - try { - BufferedInputStream bis = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream("schematics/startSide.schematic")); - FileOutputStream out = new FileOutputStream(new File(schematicsDirectory, "startSide.schematic")); - while((current = bis.read()) != -1) { - out.write(current); - } - bis.close(); - out.close(); - } catch(Exception e) { - e.printStackTrace(); - return false; - } - try { - BufferedInputStream bis = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream("schematics/startTop.schematic")); - FileOutputStream out = new FileOutputStream(new File(schematicsDirectory, "startTop.schematic")); - while((current = bis.read()) != -1) { - out.write(current); - } - bis.close(); - out.close(); - } catch(Exception e) { - e.printStackTrace(); - return false; - } - try { - BufferedInputStream bis = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream("schematics/test.schematic")); - FileOutputStream out = new FileOutputStream(new File(schematicsDirectory, "test.schematic")); - while((current = bis.read()) != -1) { - out.write(current); - } - bis.close(); - out.close(); - } catch(Exception e) { - e.printStackTrace(); - return false; - } - } - sb = new StringBuilder(); - try { - br = new BufferedReader(new FileReader(schematicDescriptorFile)); - while((line = br.readLine()) != null) - sb.append(line); - br.close(); - } catch (Exception e1) { - e1.printStackTrace(); - return false; - } - schematicDescriptors = new JSONObject(sb.toString()).getJSONArray("schematics"); - startDescriptors = new JSONArray(); - endDescriptors = new JSONArray(); - normalDescriptors = new JSONArray(); - JSONObject current; - for(int i = 0, length = schematicDescriptors.length(); i(); - return true; - } - - public void onDisable() { - logger.info(pdf.getName() + " " + pdf.getVersion() + " has been disabled."); - } - - private void addClassPath(final URL url) throws IOException { - final URLClassLoader sysloader = (URLClassLoader) ClassLoader - .getSystemClassLoader(); - final Class sysclass = URLClassLoader.class; - try { - final Method method = sysclass.getDeclaredMethod("addURL", - new Class[] { URL.class }); - method.setAccessible(true); - method.invoke(sysloader, new Object[] { url }); - } catch (final Throwable t) { - t.printStackTrace(); - throw new IOException("Error adding " + url - + " to system classloader"); - } - } - -} diff --git a/src/main/java/com/encrox/instanceddungeons/Schematic.java b/src/main/java/com/encrox/instanceddungeons/Schematic.java deleted file mode 100644 index c20d83a..0000000 --- a/src/main/java/com/encrox/instanceddungeons/Schematic.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Dynamic Schematic object - * - * Currently not supporting entities. - */ - -package com.encrox.instanceddungeons; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import org.bukkit.Material; -import org.jnbt.ByteArrayTag; -import org.jnbt.CompoundTag; -import org.jnbt.ListTag; -import org.jnbt.NBTInputStream; -import org.jnbt.ShortTag; -import org.jnbt.StringTag; -import org.jnbt.Tag; - -public class Schematic { - - public int width, height, length, readIndex, writeIndex; - public String materials; - public byte[] blocks, data; - public List entities, tileEntities; - - public Schematic(int width, int height, int length, String materials, byte[] blocks, byte[] data, List entities, List tileEntities) { - this.width = width; - this.height = height; - this.length = length; - this.materials = materials; - this.blocks = blocks; - this.data = data; - this.entities = entities; - this.tileEntities = tileEntities; - readIndex = -1; - writeIndex = -1; - } - - public Schematic(File file) { - CompoundTag schematicTag = null; - try { - NBTInputStream in = new NBTInputStream(new FileInputStream(file)); - schematicTag = (CompoundTag)in.readTag(); - in.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - Map schematic = schematicTag.getValue(); - width = ((ShortTag)schematic.get("Width")).getValue(); - height = ((ShortTag)schematic.get("Height")).getValue(); - length = ((ShortTag)schematic.get("Length")).getValue(); - materials = ((StringTag)schematic.get("Materials")).getValue(); - blocks = ((ByteArrayTag)schematic.get("Blocks")).getValue(); - data = ((ByteArrayTag)schematic.get("Data")).getValue(); - entities = ((ListTag)schematic.get("Entities")).getValue(); - tileEntities = ((ListTag)schematic.get("TileEntities")).getValue(); - } - - public byte getBlockIdAt(int x, int y, int z) { - return blocks[(y*length + z)*width + x]; - } - - public byte getNextBlock() { - return blocks[readIndex++]; - } - - public void setBlockIdAt(int x, int y, int z, byte blockId) { - blocks[(y*length + z)*width + x] = blockId; - } - - public void setNextBlock(byte blockId) { - blocks[writeIndex++] = blockId; - } - - public void write(File file) { - - } - -} diff --git a/src/main/java/com/encrox/instanceddungeons/Section.java b/src/main/java/com/encrox/instanceddungeons/Section.java deleted file mode 100644 index 0c40b24..0000000 --- a/src/main/java/com/encrox/instanceddungeons/Section.java +++ /dev/null @@ -1,263 +0,0 @@ -package com.encrox.instanceddungeons; - -import java.io.File; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.HandlerList; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerMoveEvent; -import org.bukkit.plugin.Plugin; -import org.json.JSONArray; -import org.json.JSONObject; - -import com.encrox.instancedregions.InstancedProtectedCuboidRegion; -import com.sk89q.worldedit.BlockVector; - -public class Section { - - private Schematic schematic; - private String schematicFileName; - private Map exitMap; - private ArrayList players; - private BlockVector[] exits; - private BlockVector size; - private int index, depth; - private InstancedProtectedCuboidRegion region; - private Listener moveOutOfLoadingZoneListener, moveIntoLoadingZoneListener; - private volatile boolean justEntered, portal; - - public Section(JSONObject descriptor, int index, int depth) { - this.index = index; - this.depth = depth; - players = new ArrayList(); - schematicFileName = descriptor.getString("file"); - JSONArray size = descriptor.getJSONArray("size"); - this.size = new BlockVector(size.getInt(0), size.getInt(1), size.getInt(2)); - JSONArray exits = descriptor.getJSONArray("exits"); - this.exits = new BlockVector[exits.length()]; - for(int i = 0; i(); - this.schematic = new Schematic(new File(InstancedDungeons.schematicsDirectory, schematicFileName)); - if(index <= depth) { - Section next; - ArrayList
usable = new ArrayList
(); - for(int i = 0; i sections = exitMap.values().iterator(); - while(sections.hasNext()) - sections.next().addPlayer(player); - } - } - - public void removePlayer(Player player) { - players.add(player); - if(region != null) - region.removePlayer(player); - if(exitMap != null) { - Iterator
sections = exitMap.values().iterator(); - while(sections.hasNext()) - sections.next().removePlayer(player); - } - } - -} diff --git a/src/main/resources/config.json b/src/main/resources/config.json deleted file mode 100644 index d481467..0000000 --- a/src/main/resources/config.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "locale": "en-GB", - "world": "instance", - "loadingDepth": 2, - "resetDungeons": [ - { - "interval": 2592000, - "alias": "monthly", - "length": 10 - }, - { - "interval": 86400, - "alias": "daily", - "length": 10 - }, - { - "interval": 3600, - "alias": "hourly", - "length": 10 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/descriptor.json b/src/main/resources/descriptor.json deleted file mode 100644 index 81f3e6e..0000000 --- a/src/main/resources/descriptor.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "schematics": [ - { - "file": "startSide.schematic", - "modifier": 1, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 1, 0 ] - ], - "mobs": [ ] - }, - { - "file": "startBottom.schematic", - "modifier": 1, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 0, 4 ] - ], - "mobs": [ ] - }, - { - "file": "startTop.schematic", - "modifier": 1, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 9, 4 ] - ], - "mobs": [] - }, - { - "file": "endSide.schematic", - "modifier": 2, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 1, 0 ] - ], - "mobs": [] - }, - { - "file": "endBottom.schematic", - "modifier": 2, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 0, 4 ] - ], - "mobs": [] - }, - { - "file": "endTop.schematic", - "modifier": 2, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 9, 4 ] - ], - "mobs": [ ] - }, - { - "file": "test.schematic", - "modifier": 0, - "size": [ 10, 10, 10 ], - "exits": [ - [ 0, 1, 5 ], - [ 4, 1, 0 ], - [ 9, 1, 4 ], - [ 4, 1, 9 ], - [ 2, 0, 7 ], - [ 5, 9, 5 ] - ], - "mobs": [] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/lang/de-DE.properties b/src/main/resources/lang/de-DE.properties deleted file mode 100644 index fe1b047..0000000 --- a/src/main/resources/lang/de-DE.properties +++ /dev/null @@ -1 +0,0 @@ -no_player=no_player \ No newline at end of file diff --git a/src/main/resources/lang/en-GB.properties b/src/main/resources/lang/en-GB.properties deleted file mode 100644 index fe1b047..0000000 --- a/src/main/resources/lang/en-GB.properties +++ /dev/null @@ -1 +0,0 @@ -no_player=no_player \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml deleted file mode 100644 index 4922b8b..0000000 --- a/src/main/resources/plugin.yml +++ /dev/null @@ -1,9 +0,0 @@ -main: com.encrox.instanceddungeons.InstancedDungeons -name: InstancedDungeons -version: 1.0 -depend: [InstancedRegions] - -commands: - dungeon: - description: Generic dungeon command. - usage: /dungeon help \ No newline at end of file diff --git a/src/main/resources/schematics/endBottom.schematic b/src/main/resources/schematics/endBottom.schematic deleted file mode 100644 index 9db40b2..0000000 Binary files a/src/main/resources/schematics/endBottom.schematic and /dev/null differ diff --git a/src/main/resources/schematics/endSide.schematic b/src/main/resources/schematics/endSide.schematic deleted file mode 100644 index 37b5b2a..0000000 Binary files a/src/main/resources/schematics/endSide.schematic and /dev/null differ diff --git a/src/main/resources/schematics/endTop.schematic b/src/main/resources/schematics/endTop.schematic deleted file mode 100644 index a13a690..0000000 Binary files a/src/main/resources/schematics/endTop.schematic and /dev/null differ diff --git a/src/main/resources/schematics/startBottom.schematic b/src/main/resources/schematics/startBottom.schematic deleted file mode 100644 index c03c38d..0000000 Binary files a/src/main/resources/schematics/startBottom.schematic and /dev/null differ diff --git a/src/main/resources/schematics/startSide.schematic b/src/main/resources/schematics/startSide.schematic deleted file mode 100644 index 09c6c66..0000000 Binary files a/src/main/resources/schematics/startSide.schematic and /dev/null differ diff --git a/src/main/resources/schematics/startTop.schematic b/src/main/resources/schematics/startTop.schematic deleted file mode 100644 index f905219..0000000 Binary files a/src/main/resources/schematics/startTop.schematic and /dev/null differ diff --git a/src/main/resources/schematics/test.schematic b/src/main/resources/schematics/test.schematic deleted file mode 100644 index 624505f..0000000 Binary files a/src/main/resources/schematics/test.schematic and /dev/null differ diff --git a/target/classes/com/encrox/instanceddungeons/Commander.class b/target/classes/com/encrox/instanceddungeons/Commander.class deleted file mode 100644 index 15bb837..0000000 Binary files a/target/classes/com/encrox/instanceddungeons/Commander.class and /dev/null differ diff --git a/target/classes/com/encrox/instanceddungeons/Direction.class b/target/classes/com/encrox/instanceddungeons/Direction.class deleted file mode 100644 index 157ce9b..0000000 Binary files a/target/classes/com/encrox/instanceddungeons/Direction.class and /dev/null differ diff --git a/target/classes/com/encrox/instanceddungeons/Dungeon.class b/target/classes/com/encrox/instanceddungeons/Dungeon.class deleted file mode 100644 index 12a0543..0000000 Binary files a/target/classes/com/encrox/instanceddungeons/Dungeon.class and /dev/null differ diff --git a/target/classes/com/encrox/instanceddungeons/DungeonWorld.class b/target/classes/com/encrox/instanceddungeons/DungeonWorld.class deleted file mode 100644 index adadda4..0000000 Binary files a/target/classes/com/encrox/instanceddungeons/DungeonWorld.class and /dev/null differ diff --git a/target/classes/com/encrox/instanceddungeons/InstancedDungeons.class b/target/classes/com/encrox/instanceddungeons/InstancedDungeons.class deleted file mode 100644 index 6dc7ca9..0000000 Binary files a/target/classes/com/encrox/instanceddungeons/InstancedDungeons.class and /dev/null differ diff --git a/target/classes/com/encrox/instanceddungeons/Schematic.class b/target/classes/com/encrox/instanceddungeons/Schematic.class deleted file mode 100644 index 455311e..0000000 Binary files a/target/classes/com/encrox/instanceddungeons/Schematic.class and /dev/null differ diff --git a/target/classes/com/encrox/instanceddungeons/Section$1.class b/target/classes/com/encrox/instanceddungeons/Section$1.class deleted file mode 100644 index 99927d2..0000000 Binary files a/target/classes/com/encrox/instanceddungeons/Section$1.class and /dev/null differ diff --git a/target/classes/com/encrox/instanceddungeons/Section$2$1.class b/target/classes/com/encrox/instanceddungeons/Section$2$1.class deleted file mode 100644 index f4a5c63..0000000 Binary files a/target/classes/com/encrox/instanceddungeons/Section$2$1.class and /dev/null differ diff --git a/target/classes/com/encrox/instanceddungeons/Section$2.class b/target/classes/com/encrox/instanceddungeons/Section$2.class deleted file mode 100644 index 73540c7..0000000 Binary files a/target/classes/com/encrox/instanceddungeons/Section$2.class and /dev/null differ diff --git a/target/classes/com/encrox/instanceddungeons/Section.class b/target/classes/com/encrox/instanceddungeons/Section.class deleted file mode 100644 index 5e7504f..0000000 Binary files a/target/classes/com/encrox/instanceddungeons/Section.class and /dev/null differ diff --git a/target/classes/config.json b/target/classes/config.json deleted file mode 100644 index d481467..0000000 --- a/target/classes/config.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "locale": "en-GB", - "world": "instance", - "loadingDepth": 2, - "resetDungeons": [ - { - "interval": 2592000, - "alias": "monthly", - "length": 10 - }, - { - "interval": 86400, - "alias": "daily", - "length": 10 - }, - { - "interval": 3600, - "alias": "hourly", - "length": 10 - } - ] -} \ No newline at end of file diff --git a/target/classes/descriptor.json b/target/classes/descriptor.json deleted file mode 100644 index 81f3e6e..0000000 --- a/target/classes/descriptor.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "schematics": [ - { - "file": "startSide.schematic", - "modifier": 1, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 1, 0 ] - ], - "mobs": [ ] - }, - { - "file": "startBottom.schematic", - "modifier": 1, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 0, 4 ] - ], - "mobs": [ ] - }, - { - "file": "startTop.schematic", - "modifier": 1, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 9, 4 ] - ], - "mobs": [] - }, - { - "file": "endSide.schematic", - "modifier": 2, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 1, 0 ] - ], - "mobs": [] - }, - { - "file": "endBottom.schematic", - "modifier": 2, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 0, 4 ] - ], - "mobs": [] - }, - { - "file": "endTop.schematic", - "modifier": 2, - "size": [ 10, 10, 10 ], - "exits": [ - [ 4, 9, 4 ] - ], - "mobs": [ ] - }, - { - "file": "test.schematic", - "modifier": 0, - "size": [ 10, 10, 10 ], - "exits": [ - [ 0, 1, 5 ], - [ 4, 1, 0 ], - [ 9, 1, 4 ], - [ 4, 1, 9 ], - [ 2, 0, 7 ], - [ 5, 9, 5 ] - ], - "mobs": [] - } - ] -} \ No newline at end of file diff --git a/target/classes/lang/de-DE.properties b/target/classes/lang/de-DE.properties deleted file mode 100644 index fe1b047..0000000 --- a/target/classes/lang/de-DE.properties +++ /dev/null @@ -1 +0,0 @@ -no_player=no_player \ No newline at end of file diff --git a/target/classes/lang/en-GB.properties b/target/classes/lang/en-GB.properties deleted file mode 100644 index fe1b047..0000000 --- a/target/classes/lang/en-GB.properties +++ /dev/null @@ -1 +0,0 @@ -no_player=no_player \ No newline at end of file diff --git a/target/classes/plugin.yml b/target/classes/plugin.yml deleted file mode 100644 index 4922b8b..0000000 --- a/target/classes/plugin.yml +++ /dev/null @@ -1,9 +0,0 @@ -main: com.encrox.instanceddungeons.InstancedDungeons -name: InstancedDungeons -version: 1.0 -depend: [InstancedRegions] - -commands: - dungeon: - description: Generic dungeon command. - usage: /dungeon help \ No newline at end of file diff --git a/target/classes/schematics/endBottom.schematic b/target/classes/schematics/endBottom.schematic deleted file mode 100644 index 9db40b2..0000000 Binary files a/target/classes/schematics/endBottom.schematic and /dev/null differ diff --git a/target/classes/schematics/endSide.schematic b/target/classes/schematics/endSide.schematic deleted file mode 100644 index 37b5b2a..0000000 Binary files a/target/classes/schematics/endSide.schematic and /dev/null differ diff --git a/target/classes/schematics/endTop.schematic b/target/classes/schematics/endTop.schematic deleted file mode 100644 index a13a690..0000000 Binary files a/target/classes/schematics/endTop.schematic and /dev/null differ diff --git a/target/classes/schematics/startBottom.schematic b/target/classes/schematics/startBottom.schematic deleted file mode 100644 index c03c38d..0000000 Binary files a/target/classes/schematics/startBottom.schematic and /dev/null differ diff --git a/target/classes/schematics/startSide.schematic b/target/classes/schematics/startSide.schematic deleted file mode 100644 index 09c6c66..0000000 Binary files a/target/classes/schematics/startSide.schematic and /dev/null differ diff --git a/target/classes/schematics/startTop.schematic b/target/classes/schematics/startTop.schematic deleted file mode 100644 index f905219..0000000 Binary files a/target/classes/schematics/startTop.schematic and /dev/null differ diff --git a/target/classes/schematics/test.schematic b/target/classes/schematics/test.schematic deleted file mode 100644 index 624505f..0000000 Binary files a/target/classes/schematics/test.schematic and /dev/null differ diff --git a/target/instanceddungeons-0.0.1-SNAPSHOT-shaded.jar b/target/instanceddungeons-0.0.1-SNAPSHOT-shaded.jar deleted file mode 100644 index 96dfafa..0000000 Binary files a/target/instanceddungeons-0.0.1-SNAPSHOT-shaded.jar and /dev/null differ diff --git a/target/instanceddungeons-0.0.1-SNAPSHOT.jar b/target/instanceddungeons-0.0.1-SNAPSHOT.jar deleted file mode 100644 index 96dfafa..0000000 Binary files a/target/instanceddungeons-0.0.1-SNAPSHOT.jar and /dev/null differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties deleted file mode 100644 index 161850e..0000000 --- a/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Fri Dec 23 23:15:34 CET 2016 -version=0.0.1-SNAPSHOT -groupId=com.encrox -artifactId=instanceddungeons diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst deleted file mode 100644 index e69de29..0000000 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst deleted file mode 100644 index 5886397..0000000 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ /dev/null @@ -1,7 +0,0 @@ -C:\Users\Superleo1810\workspace\instanceddungeons\src\main\java\com\encrox\instanceddungeons\Commander.java -C:\Users\Superleo1810\workspace\instanceddungeons\src\main\java\com\encrox\instanceddungeons\Schematic.java -C:\Users\Superleo1810\workspace\instanceddungeons\src\main\java\com\encrox\instanceddungeons\Dungeon.java -C:\Users\Superleo1810\workspace\instanceddungeons\src\main\java\com\encrox\instanceddungeons\Direction.java -C:\Users\Superleo1810\workspace\instanceddungeons\src\main\java\com\encrox\instanceddungeons\DungeonWorld.java -C:\Users\Superleo1810\workspace\instanceddungeons\src\main\java\com\encrox\instanceddungeons\Section.java -C:\Users\Superleo1810\workspace\instanceddungeons\src\main\java\com\encrox\instanceddungeons\InstancedDungeons.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst deleted file mode 100644 index e69de29..0000000 diff --git a/target/original-instanceddungeons-0.0.1-SNAPSHOT.jar b/target/original-instanceddungeons-0.0.1-SNAPSHOT.jar deleted file mode 100644 index 2c42e65..0000000 Binary files a/target/original-instanceddungeons-0.0.1-SNAPSHOT.jar and /dev/null differ -- cgit v1.2.1