Merge remote-tracking branch 'origin/hotfix' into DecreeCommands

This commit is contained in:
CocoTheOwner 2021-08-14 23:26:37 +02:00
commit a750241ec3
4 changed files with 24 additions and 21 deletions

View File

@ -443,40 +443,38 @@ public class Iris extends VolmitPlugin implements Listener {
@Override @Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) { public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
String dimension = IrisSettings.get().getGenerator().getDefaultWorldType();
if (id != null && !id.isEmpty()) { IrisDimension dim;
dimension = id; if (id == null || id.isEmpty()){
Iris.info("Generator ID: " + id + " requested by bukkit/plugin. Assuming IrisDimension: " + id); dim = IrisData.loadAnyDimension(IrisSettings.get().getGenerator().getDefaultWorldType());
} else {
dim = IrisData.loadAnyDimension(id);
} }
Iris.info("Generator ID: " + id + " requested by bukkit/plugin");
IrisDimension d = IrisData.loadAnyDimension(dimension); if (dim == null) {
if (d == null) {
Iris.warn("Unable to find dimension type " + id + " Looking for online packs..."); Iris.warn("Unable to find dimension type " + id + " Looking for online packs...");
d = IrisData.loadAnyDimension(dimension);
if (dimension == null) {
Iris.warn("Unable to find dimension type \"" + dimensionName + "\". Looking for online packs...");
Iris.proj.downloadSearch(new VolmitSender(Bukkit.getConsoleSender()), dimensionName, true);
dimension = IrisData.loadAnyDimension(dimensionName);
if (d == null) { Iris.proj.downloadSearch(new VolmitSender(Bukkit.getConsoleSender()), id, true);
throw new RuntimeException("Can't find dimension " + dimension + "!"); dim = IrisData.loadAnyDimension(id);
if (dim == null) {
throw new RuntimeException("Can't find dimension " + id + "!");
} else { } else {
Iris.info("Resolved missing dimension, proceeding with generation."); Iris.info("Resolved missing dimension, proceeding with generation.");
} }
} }
Iris.info("Assuming IrisDimension: " + dim.getName());
IrisWorld w = IrisWorld.builder() IrisWorld w = IrisWorld.builder()
.name(worldName) .name(worldName)
.seed(RNG.r.lmax()) .seed(RNG.r.lmax())
.environment(d.getEnvironment()) .environment(dim.getEnvironment())
.worldFolder(new File(worldName)) .worldFolder(new File(worldName))
.minHeight(0) .minHeight(0)
.maxHeight(256) .maxHeight(256)
.build(); .build();
return new BukkitChunkGenerator(w, false, new File(w.worldFolder(), "iris"), dim.getLoadKey());
return new BukkitChunkGenerator(w, false, new File(w.worldFolder(), "iris"), dimension);
} }
public static void msg(String string) { public static void msg(String string) {

View File

@ -364,7 +364,7 @@ public class ProjectManager {
} }
public File compilePackage(VolmitSender sender, IrisDimension d, boolean obfuscate, boolean minify) { public File compilePackage(VolmitSender sender, IrisDimension d, boolean obfuscate, boolean minify) {
return new IrisProject(new File(getWorkspaceFolder(), d.getName())).compilePackage(sender, obfuscate, minify); return new IrisProject(new File(getWorkspaceFolder(), d.getLoadKey())).compilePackage(sender, obfuscate, minify);
} }
public File compilePackage(VolmitSender sender, String d, boolean obfuscate, boolean minify) { public File compilePackage(VolmitSender sender, String d, boolean obfuscate, boolean minify) {

View File

@ -21,10 +21,7 @@ package com.volmit.iris.util.decree;
import com.volmit.iris.core.tools.IrisToolbelt; import com.volmit.iris.core.tools.IrisToolbelt;
import com.volmit.iris.engine.framework.Engine; import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.platform.PlatformChunkGenerator; import com.volmit.iris.engine.platform.PlatformChunkGenerator;
<<<<<<< HEAD
import com.volmit.iris.util.format.C; import com.volmit.iris.util.format.C;
=======
>>>>>>> master
import com.volmit.iris.util.plugin.VolmitSender; import com.volmit.iris.util.plugin.VolmitSender;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -617,6 +617,14 @@ public class VirtualDecreeCommand {
return Objects.hash(getName(), getDescription(), getType(), getPath()); return Objects.hash(getName(), getDescription(), getType(), getPath());
} }
@Override
public boolean equals(Object obj){
if (!(obj instanceof VirtualDecreeCommand)){
return false;
}
return this.hashCode() == obj.hashCode();
}
public boolean matches(String in) public boolean matches(String in)
{ {
KList<String> a = getNames(); KList<String> a = getNames();