some bug fixes, but test command still doesn't work

This commit is contained in:
BuildTools 2018-01-21 18:16:15 +00:00
parent be8d780d5c
commit ffed682beb
6 changed files with 8 additions and 3 deletions

View file

@ -2,7 +2,6 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="/Users/kevinmathewson/Local_Test_Server_1.12.2/craftbukkit-1.12.2.jar" sourcepath="/Users/kevinmathewson/Local_Test_Server_1.12.2/Spigot/CraftBukkit/src/main"/>
<classpathentry kind="lib" path="/Users/kevinmathewson/Local_Test_Server_1.12.2/spigot-1.12.2.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/kevinmathewson/Local_Test_Server_1.12.2/craftbukkit-1.12.2.jar!/"/>

View file

@ -2,7 +2,7 @@ main: simpleWarBackup.Main
version: 1.0.0
name: SimpleWarBackup
commands:
testBackupChun:
testBackupChunk:
description: only iie gets to do this
testRestoreChunk:
description: only iie gets to do this, too

View file

@ -93,6 +93,7 @@ public class BackupIO
*/
public static void backupChunks(String backup, World world, Chunk... chunks) throws IOException
{
System.out.println("backupChunks has been called");//TODO
final File folder = backups.get(world).get(backup);
final net.minecraft.server.v1_12_R1.World worldNMS
= ((CraftWorld) world).getHandle();

View file

@ -40,6 +40,7 @@ public final class ChunkNBTWriter
*/
public static NBTTagCompound write(Chunk chunk, World world)
{
System.out.println("ChunkNBTWriter.write has been called");//TODO
NBTTagCompound chunkNBT = new NBTTagCompound();
NBTTagCompound levelNBT = new NBTTagCompound();

View file

@ -32,16 +32,19 @@ public class Main extends JavaPlugin implements Listener
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
if (!(sender instanceof Player) || !sender.getName().equals("iie")) return false;
System.out.println("player is iie");//TODO
Location loc = ((Player) sender).getLocation();
World world = loc.getWorld();
Chunk chunk = loc.getChunk();
if (label.equals("testBackupChunk"))
if (command.getName().equals("testBackupChunk"))
{
System.out.println("command label = testBackupChunk");//TODO
try {
BackupIO.backupChunks("test", world, chunk);
System.out.println("tried BackupIO.backupChunks");//TODO
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();

View file

@ -29,6 +29,7 @@ public class RegionFileCache
*/
public static synchronized RegionFile get(File backupFolder, int x, int z)
{
System.out.println("RegionFileCache.get has been called");//TODO
x >>= 5; z >>= 5;
File regionFolder = new File(backupFolder, "region");
File regionFileFile = new File(regionFolder, "r." + x + "." + z + ".mca");