This commit is contained in:
Daniel Mills 2020-01-11 04:45:31 -05:00
parent 58632b8da3
commit 7e45835424
8 changed files with 7 additions and 63 deletions

View File

@ -18,7 +18,7 @@
<include>**/*.yml</include> <include>**/*.yml</include>
<include>**/*.txt</include> <include>**/*.txt</include>
<include>**/*.properties</include> <include>**/*.properties</include>
<include>**/*.html</include> <include>**/*.json</include>
</includes> </includes>
</resource> </resource>
</resources> </resources>
@ -33,7 +33,7 @@
<goal>shade</goal> <goal>shade</goal>
</goals> </goals>
<configuration> <configuration>
<minimizeJar>true</minimizeJar> <minimizeJar>false</minimizeJar>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>

View File

@ -28,7 +28,7 @@
<include>**/*.yml</include> <include>**/*.yml</include>
<include>**/*.txt</include> <include>**/*.txt</include>
<include>**/*.properties</include> <include>**/*.properties</include>
<include>**/*.html</include> <include>**/*.json</include>
</includes> </includes>
</resource> </resource>
</resources> </resources>
@ -44,7 +44,7 @@
<goal>shade</goal> <goal>shade</goal>
</goals> </goals>
<configuration> <configuration>
<minimizeJar>true</minimizeJar> <minimizeJar>false</minimizeJar>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>

View File

@ -1,9 +1,6 @@
package ninja.bytecode.iris; package ninja.bytecode.iris;
import java.io.File;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Sound;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
@ -13,9 +10,7 @@ import org.bukkit.entity.Player;
import ninja.bytecode.iris.controller.TimingsController; import ninja.bytecode.iris.controller.TimingsController;
import ninja.bytecode.iris.generator.IrisGenerator; import ninja.bytecode.iris.generator.IrisGenerator;
import ninja.bytecode.iris.pack.IrisBiome; import ninja.bytecode.iris.pack.IrisBiome;
import ninja.bytecode.shuriken.execution.J;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.F;
import ninja.bytecode.shuriken.io.IO;
public class CommandIris implements CommandExecutor public class CommandIris implements CommandExecutor
{ {
@ -113,18 +108,6 @@ public class CommandIris implements CommandExecutor
msg(sender, "Reloading Iris..."); msg(sender, "Reloading Iris...");
Iris.instance.reload(); Iris.instance.reload();
} }
if(args[0].equalsIgnoreCase("clean"))
{
msg(sender, "Poof!");
if(sender instanceof Player)
{
((Player) sender).playSound(((Player) sender).getLocation(), Sound.BLOCK_END_PORTAL_SPAWN, 0.33f, (float) 1.65);
}
J.attempt(() -> IO.delete(new File(Iris.instance.getDataFolder(), "pack")));
}
} }
return false; return false;

View File

@ -46,7 +46,6 @@ public class Iris extends JavaPlugin implements Listener
getServer().getPluginManager().registerEvents((Listener) this, this); getServer().getPluginManager().registerEvents((Listener) this, this);
getCommand("iris").setExecutor(new CommandIris()); getCommand("iris").setExecutor(new CommandIris());
getCommand("ish").setExecutor(new CommandIsh()); getCommand("ish").setExecutor(new CommandIsh());
getController(PackController.class).createTempCache(getFile());
if(!settings.performance.debugMode) if(!settings.performance.debugMode)
{ {

View File

@ -2,12 +2,8 @@ package ninja.bytecode.iris.controller;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
import ninja.bytecode.iris.Iris; import ninja.bytecode.iris.Iris;
@ -19,7 +15,6 @@ import ninja.bytecode.iris.pack.IrisPack;
import ninja.bytecode.iris.util.IrisController; import ninja.bytecode.iris.util.IrisController;
import ninja.bytecode.shuriken.bench.PrecisionStopwatch; import ninja.bytecode.shuriken.bench.PrecisionStopwatch;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.GMap;
import ninja.bytecode.shuriken.execution.J;
import ninja.bytecode.shuriken.execution.TaskExecutor; import ninja.bytecode.shuriken.execution.TaskExecutor;
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup; import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.F;
@ -55,40 +50,6 @@ public class PackController implements IrisController
return ready; return ready;
} }
public void createTempCache(File jar)
{
try
{
J.a(() -> IO.delete(new File(Iris.instance.getDataFolder(), "pack")));
File temp = Iris.instance.getDataFolder();
temp.mkdirs();
L.i("Iris Cache: " + temp.getAbsolutePath());
ZipFile zipFile = new ZipFile(jar);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while(entries.hasMoreElements())
{
ZipEntry entry = entries.nextElement();
if(entry.getName().startsWith("pack/") && !entry.isDirectory())
{
File f = new File(temp, entry.getName());
f.getParentFile().mkdirs();
InputStream stream = zipFile.getInputStream(entry);
FileOutputStream fos = new FileOutputStream(f);
IO.fullTransfer(stream, fos, 16921);
fos.close();
stream.close();
}
}
zipFile.close();
}
catch(Throwable e)
{
L.w(ChatColor.YELLOW + "Failed to cache internal resources. Did you reload Iris externally?");
}
}
public void loadContent() public void loadContent()
{ {
dimensions = new GMap<>(); dimensions = new GMap<>();

View File

@ -7,6 +7,6 @@
"LONG_GRASS:2=0.13" "LONG_GRASS:2=0.13"
], ],
"objects": [ "objects": [
"colossal/jungle/massive=0.001" "colossal/jungle/massive=0.0005"
] ]
} }

View File

@ -7,6 +7,6 @@
"LONG_GRASS:2=0.02" "LONG_GRASS:2=0.02"
], ],
"objects": [ "objects": [
"colossal/jungle/massive=0.001" "colossal/jungle/massive=0.0005"
] ]
} }

View File

@ -0,0 +1 @@
sink 8