Skip to content

Commit

Permalink
fix: Gradle task runServer now copies the development resource pack f…
Browse files Browse the repository at this point in the history
…rom the configured version if one doesn't currently exist.
  • Loading branch information
ryantheleach committed Mar 3, 2024
1 parent 2c2ca35 commit 3441c14
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.google.common.io.Files;
import java.io.File;
import java.io.IOException;
import java.nio.file.StandardCopyOption;
import java.util.Properties;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down Expand Up @@ -73,7 +74,15 @@ public ResourcePackDistributor(Context<Core> context) {
public void on_enable() {
if (localDev) {
try {
var pack_output = new File("vane-resource-pack.zip");
File pack_output = new File("vane-resource-pack.zip");
if(!pack_output.exists()) {
// assume first clean run, and copy the latest resource pack
Properties properties = new Properties();
properties.load(Core.class.getResourceAsStream("/vane-core.properties"));
var version = properties.getProperty("version");
File src_path = new File("..\\docs\\resourcepacks\\v"+version+".zip");
Files.copy(src_path, pack_output);
}
file_watcher = new ResourcePackFileWatcher(this, pack_output);
dev_server = new ResourcePackDevServer(this, pack_output);
dev_server.serve();
Expand Down

0 comments on commit 3441c14

Please sign in to comment.