mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Fix dim creation
This commit is contained in:
parent
a462ab98e9
commit
8abaac56ff
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
|
||||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.volmit.iris.core.project;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class IrisPack {
|
|
||||||
private final File folder;
|
|
||||||
|
|
||||||
public IrisPack(File folder) {
|
|
||||||
this.folder = folder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return getFolder().getName();
|
|
||||||
}
|
|
||||||
}
|
|
@ -163,6 +163,12 @@ public class StudioSVC implements IrisService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
url = getListing(false).get(key);
|
url = getListing(false).get(key);
|
||||||
|
|
||||||
|
if(url == null)
|
||||||
|
{
|
||||||
|
Iris.warn("ITS ULL for " + key);
|
||||||
|
}
|
||||||
|
|
||||||
url = url == null ? key : url;
|
url = url == null ? key : url;
|
||||||
Iris.info("Assuming URL " + url);
|
Iris.info("Assuming URL " + url);
|
||||||
String branch = "master";
|
String branch = "master";
|
||||||
@ -289,10 +295,6 @@ public class StudioSVC implements IrisService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public KMap<String, String> getListing(boolean cached) {
|
public KMap<String, String> getListing(boolean cached) {
|
||||||
if (cached && cacheListing != null) {
|
|
||||||
return cacheListing;
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject a;
|
JSONObject a;
|
||||||
|
|
||||||
if (cached) {
|
if (cached) {
|
||||||
@ -308,6 +310,8 @@ public class StudioSVC implements IrisService {
|
|||||||
l.put(i, a.getString(i));
|
l.put(i, a.getString(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
l.put("IrisDimensions/overworld/master", "IrisDimensions/overworld/stable");
|
||||||
|
l.put("overworld", "IrisDimensions/overworld/stable");
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,40 +180,6 @@ public class IrisToolbelt {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Attempts to ensure that the pack is installed
|
|
||||||
*
|
|
||||||
* @param sender the sender
|
|
||||||
* @param url the dimension
|
|
||||||
* @throws Throwable shit happens
|
|
||||||
*/
|
|
||||||
public static void install(VolmitSender sender, String url) throws Throwable {
|
|
||||||
IrisProjectRepo r = IrisProjectRepo.from(url);
|
|
||||||
|
|
||||||
if (r != null) {
|
|
||||||
url = r.getRepo();
|
|
||||||
}
|
|
||||||
|
|
||||||
File f = Iris.instance.getDataFolder("packs", url);
|
|
||||||
IO.delete(f);
|
|
||||||
KList<Job> j = new KList<>();
|
|
||||||
File pack = new File(Iris.getTemp(), UUID.nameUUIDFromBytes(r.toURL().getBytes(StandardCharsets.UTF_8)) + ".zip");
|
|
||||||
j.add(new DownloadJob(r.toURL(), pack));
|
|
||||||
j.add(new SingleJob("Extracting", () -> {
|
|
||||||
File work = new File(Iris.getTemp(), "dltk-" + UUID.randomUUID());
|
|
||||||
ZipUtil.unpack(pack, work);
|
|
||||||
File raw = work.listFiles()[0];
|
|
||||||
try {
|
|
||||||
FileUtils.copyDirectory(raw, f);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
JobCollection c = new JobCollection("Pack", j);
|
|
||||||
c.execute(sender);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Evacuate all players from the world
|
* Evacuate all players from the world
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user