mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
80136b4aff
@ -171,7 +171,7 @@ public class ProjectManager {
|
||||
Iris.info("Assuming URL " + url);
|
||||
String branch = "master";
|
||||
String[] nodes = url.split("\\Q/\\E");
|
||||
String repo = nodes[0] + "/" + nodes[1];
|
||||
String repo = nodes.length == 1 ? "IrisDimensions/" + nodes[0] : nodes[0] + "/" + nodes[1];
|
||||
branch = nodes.length > 2 ? nodes[2] : branch;
|
||||
download(sender, repo, branch, trim, forceOverwrite);
|
||||
} catch (Throwable e) {
|
||||
@ -192,6 +192,13 @@ public class ProjectManager {
|
||||
File temp = Iris.getTemp();
|
||||
File work = new File(temp, "dl-" + UUID.randomUUID());
|
||||
File packs = getWorkspaceFolder();
|
||||
|
||||
if (zip == null || !zip.exists()) {
|
||||
sender.sendMessage("Failed to find pack at " + url);
|
||||
sender.sendMessage("Make sure you specified the correct repo and branch!");
|
||||
sender.sendMessage("For example: /iris download IrisDimensions/overworld branch=master");
|
||||
return;
|
||||
}
|
||||
sender.sendMessage("Unpacking " + repo);
|
||||
try {
|
||||
ZipUtil.unpack(zip, work);
|
||||
|
@ -25,6 +25,8 @@ import com.volmit.iris.util.plugin.MortarCommand;
|
||||
import com.volmit.iris.util.plugin.VolmitSender;
|
||||
import com.volmit.iris.util.scheduling.J;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class CommandIrisDownload extends MortarCommand {
|
||||
public CommandIrisDownload() {
|
||||
super("download", "down", "dl");
|
||||
@ -42,28 +44,44 @@ public class CommandIrisDownload extends MortarCommand {
|
||||
@Override
|
||||
public boolean handle(VolmitSender sender, String[] args) {
|
||||
if (args.length < 1) {
|
||||
sender.sendMessage("/iris dl " + C.BOLD + "<NAME>");
|
||||
sender.sendMessage("/iris dl " + C.BOLD + "<NAME> [BRANCH=master]");
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean trim = false;
|
||||
String branch = "master";
|
||||
|
||||
for (String i : args) {
|
||||
for (String i : Arrays.copyOfRange(args, 1, args.length)) {
|
||||
if (i.equals("-t") || i.equals("--trim")) {
|
||||
trim = true;
|
||||
break;
|
||||
} else if (i.startsWith("-")) {
|
||||
sender.sendMessage("Invalid parameter.");
|
||||
sender.sendMessage("/iris dl " + C.BOLD + "<NAME> [BRANCH=master]");
|
||||
return true;
|
||||
} else {
|
||||
branch = i;
|
||||
if (branch.toLowerCase().startsWith("branch=")) branch = branch.substring(7);
|
||||
}
|
||||
}
|
||||
|
||||
boolean btrim = trim;
|
||||
|
||||
J.a(() -> Iris.proj.downloadSearch(sender, args[0], btrim));
|
||||
String pack = args[0];
|
||||
|
||||
if (!pack.contains("/")) {
|
||||
pack = "IrisDimensions/" + pack;
|
||||
}
|
||||
|
||||
final String finalPack = pack + "/" + branch;
|
||||
|
||||
J.a(() -> Iris.proj.downloadSearch(sender, finalPack, btrim));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage() {
|
||||
return "<name> [-t/--trim]";
|
||||
return "<name> [branch=master] [-t/--trim]";
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,6 @@ public class IrisGenerator extends IrisRegistrant {
|
||||
@Desc("The opacity, essentially a multiplier on the output.")
|
||||
private double opacity = 1;
|
||||
|
||||
|
||||
@Desc("Multiply the compsites instead of adding them")
|
||||
private boolean multiplicitive = false;
|
||||
|
||||
@ -80,12 +79,10 @@ public class IrisGenerator extends IrisRegistrant {
|
||||
private double offsetZ = 0;
|
||||
|
||||
@Required
|
||||
|
||||
@Desc("The seed for this generator")
|
||||
private long seed = 1;
|
||||
|
||||
@Required
|
||||
|
||||
@Desc("The interpolator to use when smoothing this generator into other regions & generators")
|
||||
private IrisInterpolator interpolator = new IrisInterpolator();
|
||||
|
||||
@ -227,12 +224,11 @@ public class IrisGenerator extends IrisRegistrant {
|
||||
}
|
||||
|
||||
int hc = (int) ((cliffHeightMin * 10) + 10 + cliffHeightMax * seed + offsetX + offsetZ);
|
||||
double h = 0;
|
||||
double tp = multiplicitive ? 1 : 0;
|
||||
double h = multiplicitive ? 1 : 0;
|
||||
double tp = 0;
|
||||
|
||||
for (IrisNoiseGenerator i : composite) {
|
||||
if (multiplicitive) {
|
||||
tp *= i.getOpacity();
|
||||
h *= i.getNoise(seed + superSeed + hc, (rx + offsetX) / zoom, (rz + offsetZ) / zoom);
|
||||
} else {
|
||||
tp += i.getOpacity();
|
||||
|
@ -23,6 +23,7 @@ import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@ -48,6 +49,7 @@ public class IrisNoiseGenerator {
|
||||
private boolean negative = false;
|
||||
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("The output multiplier")
|
||||
private double opacity = 1;
|
||||
|
||||
@ -56,7 +58,7 @@ public class IrisNoiseGenerator {
|
||||
private double offsetX = 0;
|
||||
|
||||
|
||||
@Desc("Height output offset y")
|
||||
@Desc("Height output offset y. Avoid using with terrain generation.")
|
||||
private double offsetY = 0;
|
||||
|
||||
|
||||
@ -64,7 +66,6 @@ public class IrisNoiseGenerator {
|
||||
private double offsetZ = 0;
|
||||
|
||||
@Required
|
||||
|
||||
@Desc("The seed")
|
||||
private long seed = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user