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