mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-03 16:36:00 +00:00
Patch MVC Stupidity
This commit is contained in:
parent
27b49f9d7e
commit
2c0576099a
@ -94,6 +94,10 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
@com.volmit.iris.util.plugin.Command
|
||||
public CommandIrisStudio commandStudio;
|
||||
|
||||
public static VolmitSender getSender() {
|
||||
return sender;
|
||||
}
|
||||
|
||||
private void preEnable() {
|
||||
instance = this;
|
||||
services = new KMap<>();
|
||||
@ -428,8 +432,6 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
|
||||
@Override
|
||||
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
|
||||
|
||||
Iris.debug("THE WORLD NAME PASSED IN WAS " + worldName);
|
||||
IrisDimension dim;
|
||||
if (id == null || id.isEmpty()) {
|
||||
dim = IrisData.loadAnyDimension(IrisSettings.get().getGenerator().getDefaultWorldType());
|
||||
@ -464,7 +466,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
|
||||
Iris.debug("Generator Config: " + w.toString());
|
||||
|
||||
File ff = new File(w.worldFolder(), "iris");
|
||||
File ff = new File(w.worldFolder(), "iris/pack");
|
||||
if(!ff.exists() || ff.listFiles().length == 0)
|
||||
{
|
||||
ff.mkdirs();
|
||||
|
@ -20,6 +20,7 @@ package com.volmit.iris.engine.platform;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.core.service.StudioSVC;
|
||||
import com.volmit.iris.engine.IrisEngine;
|
||||
import com.volmit.iris.engine.data.chunk.TerrainChunk;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
@ -45,6 +46,7 @@ import org.bukkit.generator.BlockPopulator;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.management.RuntimeErrorException;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@ -76,6 +78,41 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
this.folder = new ReactiveFolder(dataLocation, (_a, _b, _c) -> hotload());
|
||||
IrisData data = IrisData.get(dataLocation);
|
||||
IrisDimension dimension = data.getDimensionLoader().load(dimensionKey);
|
||||
|
||||
if(dimension == null)
|
||||
{
|
||||
Iris.error("Oh No! There's no pack in " + data.getDataFolder().getPath() + " or... there's no dimension for the key " + dimensionKey);
|
||||
IrisDimension test = IrisData.loadAnyDimension(dimensionKey);
|
||||
|
||||
if(test != null)
|
||||
{
|
||||
Iris.warn("Looks like " + dimensionKey + " exists in " + test.getLoadFile().getPath());
|
||||
Iris.service(StudioSVC.class).installIntoWorld(Iris.getSender(), dimensionKey, dataLocation.getParentFile().getParentFile());
|
||||
Iris.warn("Attempted to install into " + data.getDataFolder().getPath());
|
||||
data.dump();
|
||||
data.clearLists();
|
||||
test = data.getDimensionLoader().load(dimensionKey);
|
||||
|
||||
if(test != null)
|
||||
{
|
||||
Iris.success("Woo! Patched the Engine to work with MVC bugs. Have a nice day!");
|
||||
dimension = test;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Iris.error("Failed to patch dimension!");
|
||||
throw new RuntimeException("Missing Dimension: " + dimensionKey);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Iris.error("Nope, you don't have an installation containing " + dimensionKey + " try downloading it?");
|
||||
throw new RuntimeException("Missing Dimension: " + dimensionKey);
|
||||
}
|
||||
}
|
||||
|
||||
this.engine = new IrisEngine(new EngineTarget(world, dimension, data), studio);
|
||||
populators.add((BlockPopulator) engine);
|
||||
this.hotloader = new Looper() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user