mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-31 12:56:35 +00:00
- Fixed hotdrop being activated on world creation
- Improved /iris delete - Unfinished code
This commit is contained in:
@@ -23,6 +23,7 @@ import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.engine.object.IrisEngineWorldData;
|
||||
import com.volmit.iris.util.decree.DecreeExecutor;
|
||||
import com.volmit.iris.util.decree.DecreeOrigin;
|
||||
import com.volmit.iris.util.decree.annotations.Decree;
|
||||
@@ -66,6 +67,12 @@ public class CommandDeveloper implements DecreeExecutor {
|
||||
Iris.info(C.RED + "Engine is null!");
|
||||
}
|
||||
}
|
||||
@Decree(description = "Test", origin = DecreeOrigin.BOTH)
|
||||
public void test(){
|
||||
Iris.info("Test Developer CMD Executed");
|
||||
IrisEngineWorldData worldData = new IrisEngineWorldData();
|
||||
worldData.injection();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.volmit.iris.core.tools.IrisBenchmarking;
|
||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.object.IrisEngineWorldData;
|
||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
||||
import com.volmit.iris.core.safeguard.UtilsSFG;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -72,6 +73,7 @@ public class CommandIris implements DecreeExecutor {
|
||||
private CommandDeveloper developer;
|
||||
|
||||
public static @Getter String BenchDimension;
|
||||
public static boolean worldCreation = false;
|
||||
|
||||
@Decree(description = "Create a new world", aliases = {"+", "c"})
|
||||
public void create(
|
||||
@@ -117,6 +119,7 @@ public class CommandIris implements DecreeExecutor {
|
||||
}
|
||||
|
||||
try {
|
||||
worldCreation = true;
|
||||
IrisToolbelt.createWorld()
|
||||
.dimension(type.getLoadKey())
|
||||
.name(name)
|
||||
@@ -128,9 +131,10 @@ public class CommandIris implements DecreeExecutor {
|
||||
sender().sendMessage(C.RED + "Exception raised during creation. See the console for more details.");
|
||||
Iris.error("Exception raised during world creation: " + e.getMessage());
|
||||
Iris.reportError(e);
|
||||
worldCreation = false;
|
||||
return;
|
||||
}
|
||||
|
||||
worldCreation = false;
|
||||
sender().sendMessage(C.GREEN + "Successfully created your world!");
|
||||
}
|
||||
|
||||
@@ -163,6 +167,8 @@ public class CommandIris implements DecreeExecutor {
|
||||
public void version() {
|
||||
sender().sendMessage(C.GREEN + "Iris v" + Iris.instance.getDescription().getVersion() + " by Volmit Software");
|
||||
}
|
||||
|
||||
//todo Move to React
|
||||
@Decree(description = "Benchmark your server", origin = DecreeOrigin.CONSOLE)
|
||||
public void serverbenchmark() throws InterruptedException {
|
||||
if(!inProgress) {
|
||||
@@ -171,6 +177,7 @@ public class CommandIris implements DecreeExecutor {
|
||||
Iris.info(C.RED + "Benchmark already is in progress.");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/todo Fix PREGEN
|
||||
@Decree(description = "Benchmark a pack", origin = DecreeOrigin.CONSOLE)
|
||||
@@ -239,7 +246,7 @@ public class CommandIris implements DecreeExecutor {
|
||||
IrisToolbelt.evacuate(world, "Deleting world");
|
||||
deletingWorld = true;
|
||||
Bukkit.unloadWorld(world, false);
|
||||
int retries = 10;
|
||||
int retries = 12;
|
||||
if (delete) {
|
||||
if (deleteDirectory(world.getWorldFolder())) {
|
||||
sender().sendMessage(C.GREEN + "Successfully removed world folder");
|
||||
@@ -249,13 +256,12 @@ public class CommandIris implements DecreeExecutor {
|
||||
sender().sendMessage(C.GREEN + "Successfully removed world folder");
|
||||
break;
|
||||
}
|
||||
sender().sendMessage(C.GREEN + "DEBUG1");
|
||||
retries--;
|
||||
if (retries == 0){
|
||||
sender().sendMessage(C.RED + "Failed to remove world folder");
|
||||
break;
|
||||
}
|
||||
J.sleep(2000);
|
||||
J.sleep(3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.volmit.iris.core.service;
|
||||
|
||||
import java.nio.file.*;
|
||||
|
||||
import static com.volmit.iris.core.commands.CommandIris.worldCreation;
|
||||
import static java.nio.file.StandardWatchEventKinds.*;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
@@ -56,6 +58,9 @@ public class HotDropWorldSVC implements IrisService {
|
||||
protected long loop() {
|
||||
WatchKey key;
|
||||
try {
|
||||
if (worldCreation){
|
||||
return -1;
|
||||
}
|
||||
key = watchService.poll();
|
||||
if (key != null) {
|
||||
for (WatchEvent<?> event : key.pollEvents()) {
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
package com.volmit.iris.core.tools;
|
||||
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.object.IrisWorld;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.engine.platform.BukkitChunkGenerator;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
@@ -79,6 +78,7 @@ public class IrisWorldCreator {
|
||||
? dim.getLoader().getDataFolder() :
|
||||
new File(w.worldFolder(), "iris/pack"), dimensionName);
|
||||
|
||||
|
||||
return new WorldCreator(name)
|
||||
.environment(findEnvironment())
|
||||
.generateStructures(true)
|
||||
|
||||
@@ -26,6 +26,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class IrisEngineData {
|
||||
private IrisEngineStatistics statistics = new IrisEngineStatistics();
|
||||
private KList<IrisEngineWorldData> IrisEngineWorldData = new KList<>();
|
||||
private KList<IrisEngineSpawnerCooldown> spawnerCooldowns = new KList<>();
|
||||
private KList<IrisEngineChunkData> chunks = new KList<>();
|
||||
private Long seed = null;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IrisEngineWorldData {
|
||||
private int cooltest = 0;
|
||||
private String version = "null";
|
||||
|
||||
public IrisEngineWorldData() {
|
||||
this.cooltest = 0;
|
||||
this.version = "null";
|
||||
}
|
||||
|
||||
public void injection() {
|
||||
Iris.info("TEST");
|
||||
version = "test";
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return version.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user