9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2026-01-06 15:51:30 +00:00

Compare commits

...

10 Commits

Author SHA1 Message Date
Brian Neumann-Fopiano
c3ac41f894 V+
lol
2024-08-15 12:58:01 -04:00
Julian Krings
d0688782b1 fix getEngineData NullPointer 2024-08-15 18:47:27 +02:00
Julian Krings
25b41fe62c add 1.21.1 support 2024-08-15 18:42:23 +02:00
repixelatedmc
68ad206252 Eh yeah should do 2024-08-12 08:08:23 +02:00
Brian Neumann-Fopiano
79d6f34879 v+ 2024-08-03 14:42:07 -04:00
Julian Krings
ceb6c15c97 tall_seagrass isnt sticking out of water anymore
by RePixelatedMC
2024-08-03 18:45:44 +02:00
Julian Krings
7cf43ad7ab fix world creation 2024-08-03 18:04:37 +02:00
Julian Krings
ab3397a373 fix pack download command 2024-08-03 15:30:56 +02:00
Julian Krings
8e9f78e982 fix region zoom 2024-08-03 13:03:50 +02:00
Julian Krings
61bbfee640 Update README.md 2024-08-02 18:20:25 +02:00
15 changed files with 69 additions and 29 deletions

View File

@@ -30,14 +30,11 @@ Consider supporting our development by buying Iris on spigot! We work hard to ma
3. Add `export JAVA_HOME=$(/usr/libexec/java_home)` as a new line
4. Use `CTRL + X`, then Press `Y`, Then `ENTER`
5. Quit & Reopen Terminal and verify with `echo $JAVA_HOME`. It should print a directory
3. If this is your first time building Iris for MC 1.18+ run `gradlew setup` inside the root Iris project folder.
Otherwise, skip this step. Grab a coffee, this may take up to 45 minutes depending on your cpu & internet connection.
4. Once the project has setup, run `gradlew iris`
5. The Iris jar will be placed in `Iris/build/Iris-XXX-XXX.jar` Enjoy! Consider supporting us by buying it on spigot!
3. Once the project has setup, run `gradlew iris`
4. The Iris jar will be placed in `Iris/build/Iris-XXX-XXX.jar` Enjoy! Consider supporting us by buying it on spigot!
### IDE Builds (for development)
* Run `gradlew setup` any time you get dependency issues with craftbukkit
* Configure ITJ Gradle to use JDK 17 (in settings, search for gradle)
* Add a build line in the build.gradle for your own build task to directly compile Iris into your plugins folder if you
prefer.

View File

@@ -32,7 +32,7 @@ plugins {
id "de.undercouch.download" version "5.0.1"
}
version '3.4.0-1.19.2-1.21'
version '3.4.1-1.19.2-1.21.1'
// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED
// ======================== WINDOWS =============================
@@ -47,6 +47,7 @@ registerCustomOutputTask('Pixel', 'C://Users/repix/Iris Dimension Engine/1.20.4
// ========================== UNIX ==============================
registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/development/server/plugins')
registerCustomOutputTaskUnix('PsychoLT', '/Users/brianfopiano/Developer/RemoteGit/Server/plugins')
registerCustomOutputTaskUnix('PixelMac', '/Users/test/Desktop/mcserver/plugins')
registerCustomOutputTaskUnix('CrazyDev22LT', '/home/julian/Desktop/server/plugins')
// ==============================================================

View File

@@ -29,7 +29,8 @@ public class INMS {
private static final Map<String, String> REVISION = Map.of(
"1.20.5", "v1_20_R4",
"1.20.6", "v1_20_R4",
"1.21", "v1_21_R1"
"1.21", "v1_21_R1",
"1.21.1", "v1_21_R1"
);
//@done
private static final INMSBinding binding = bind();

View File

@@ -120,4 +120,8 @@ public interface INMSBinding {
default DataVersion getDataVersion() {
return DataVersion.V1192;
}
default int getSpawnChunkCount(World world) {
return 441;
}
}

View File

@@ -50,7 +50,7 @@ public class ModesSFG {
Iris.info(C.DARK_RED + "Go to plugins/iris/settings.json and set DoomsdayAnnihilationSelfDestructMode to true if you wish to proceed.");
while (true) {
try {
Thread.sleep(1000);
Thread.sleep(Long.MAX_VALUE);
} catch (InterruptedException e) {
// no
}

View File

@@ -37,7 +37,7 @@ public class UtilsSFG {
}
if (ServerBootSFG.unsuportedversion) {
Iris.safeguard(C.RED + "Server Version");
Iris.safeguard(C.RED + "- Iris only supports 1.19.2 > 1.20.6");
Iris.safeguard(C.RED + "- Iris only supports 1.19.2 > 1.21.1");
}
if (!ServerBootSFG.passedserversoftware) {
Iris.safeguard(C.YELLOW + "Unsupported Server Software");

View File

@@ -232,7 +232,7 @@ public class StudioSVC implements IrisService {
}
try {
dir = zipFiles.length == 1 && zipFiles[0].isDirectory() ? zipFiles[0] : null;
dir = zipFiles.length > 1 ? work : zipFiles[0].isDirectory() ? zipFiles[0] : null;
} catch (NullPointerException e) {
Iris.reportError(e);
sender.sendMessage("Error when finding home directory. Are there any non-text characters in the file name?");

View File

@@ -152,7 +152,6 @@ public class IrisCreator {
J.a(() ->
{
int req = 441;
Supplier<Integer> g = () -> {
if (finalAccess1 == null || finalAccess1.getEngine() == null) {
return 0;
@@ -160,6 +159,9 @@ public class IrisCreator {
return finalAccess1.getEngine().getGenerated();
};
if(!benchmark) {
if (finalAccess1 == null) return;
int req = finalAccess1.getSpawnChunks().join();
while (g.get() < req) {
double v = (double) g.get() / (double) req;
if (sender.isPlayer()) {

View File

@@ -124,7 +124,6 @@ public class IrisComplex implements DataProvider {
ProceduralStream.of((x, z) -> focusRegion,
Interpolated.of(a -> 0D, a -> focusRegion))
: regionStyleStream
.zoom(engine.getDimension().getRegionZoom())
.selectRarity(data.getRegionLoader().loadAll(engine.getDimension().getRegions()))
.cache2D("regionStream", engine, cacheSize).waste("Region Stream");
regionIDStream = regionIdentityStream.convertCached((i) -> new UUID(Double.doubleToLongBits(i),

View File

@@ -254,30 +254,40 @@ public class IrisEngine implements Engine {
return engineData.aquire(() -> {
//TODO: Method this file
File f = new File(getWorld().worldFolder(), "iris/engine-data/" + getDimension().getLoadKey() + ".json");
IrisEngineData data = null;
if (!f.exists()) {
if (f.exists()) {
try {
f.getParentFile().mkdirs();
IrisEngineData data = new IrisEngineData();
data.getStatistics().setVersion(Iris.instance.getIrisVersion());
data.getStatistics().setMCVersion(Iris.instance.getMCVersion());
data.getStatistics().setUpgradedVersion(Iris.instance.getIrisVersion());
if (data.getStatistics().getVersion() == -1 || data.getStatistics().getMCVersion() == -1 ) {
Iris.error("Failed to setup Engine Data!");
data = new Gson().fromJson(IO.readAll(f), IrisEngineData.class);
if (data == null) {
Iris.error("Failed to read Engine Data! Corrupted File? recreating...");
}
IO.writeAll(f, new Gson().toJson(data));
} catch (IOException e) {
e.printStackTrace();
}
}
try {
return new Gson().fromJson(IO.readAll(f), IrisEngineData.class);
} catch (Throwable e) {
e.printStackTrace();
if (data == null) {
data = new IrisEngineData();
data.getStatistics().setVersion(Iris.instance.getIrisVersion());
data.getStatistics().setMCVersion(Iris.instance.getMCVersion());
data.getStatistics().setUpgradedVersion(Iris.instance.getIrisVersion());
if (data.getStatistics().getVersion() == -1 || data.getStatistics().getMCVersion() == -1 ) {
Iris.error("Failed to setup Engine Data!");
}
if (f.getParentFile().exists() || f.getParentFile().mkdirs()) {
try {
IO.writeAll(f, new Gson().toJson(data));
} catch (IOException e) {
e.printStackTrace();
}
} else {
Iris.error("Failed to setup Engine Data!");
}
}
return new IrisEngineData();
return data;
});
}

View File

@@ -45,9 +45,11 @@ public class IrisSeaFloorDecorator extends IrisEngineDecorator {
}
if (height >= 0 || height < getEngine().getHeight()) {
if (null != decorator.getBlockDataForTop(biome, getRng(), realX, height, realZ, getData())) {
data.set(x, height, z, decorator.getBlockData100(biome, getRng(), realX, height, realZ, getData()));
height++;
data.set(x, height, z, decorator.getBlockDataForTop(biome, getRng(), realX, height, realZ, getData()));
if (height == getDimension().getFluidHeight() - 1) {
data.set(x, height, z, decorator.getBlockData100(biome, getRng(), realX, height, realZ, getData()));
height++;
data.set(x, height, z, decorator.getBlockDataForTop(biome, getRng(), realX, height, realZ, getData()));
}
} else {
data.set(x, height, z, decorator.getBlockData100(biome, getRng(), realX, height, realZ, getData()));
}

View File

@@ -63,6 +63,7 @@ import java.io.IOException;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Random;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -84,6 +85,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
private final AtomicBoolean setup;
private final boolean studio;
private final AtomicInteger a = new AtomicInteger(0);
private final CompletableFuture<Integer> spawnChunks = new CompletableFuture<>();
private final boolean smartVanillaHeight;
private Engine engine;
private Looper hotloader;
@@ -148,6 +150,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
} else {
INMS.get().inject(event.getWorld().getSeed(), engine, event.getWorld());
Iris.info("Injected Iris Biome Source into " + event.getWorld().getName());
spawnChunks.complete(INMS.get().getSpawnChunkCount(event.getWorld()));
initialized = true;
}
}

View File

@@ -25,6 +25,7 @@ import com.volmit.iris.engine.framework.Hotloadable;
import com.volmit.iris.util.data.DataProvider;
import org.bukkit.World;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
public interface PlatformChunkGenerator extends Hotloadable, DataProvider {
@@ -46,4 +47,6 @@ public interface PlatformChunkGenerator extends Hotloadable, DataProvider {
boolean isStudio();
void touch(World world);
CompletableFuture<Integer> getSpawnChunks();
}

View File

@@ -10,6 +10,7 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Vector;
import java.util.concurrent.atomic.AtomicInteger;
@@ -576,4 +577,12 @@ public class NMSBinding implements INMSBinding {
public DataVersion getDataVersion() {
return DataVersion.V1205;
}
@Override
public int getSpawnChunkCount(World world) {
var radius = Optional.ofNullable(world.getGameRuleValue(GameRule.SPAWN_CHUNK_RADIUS))
.orElseGet(() -> world.getGameRuleDefault(GameRule.SPAWN_CHUNK_RADIUS));
if (radius == null) throw new IllegalStateException("GameRule.SPAWN_CHUNK_RADIUS is null!");
return (int) Math.pow(2 * radius + 1, 2);
}
}

View File

@@ -10,6 +10,7 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Vector;
import java.util.concurrent.atomic.AtomicInteger;
@@ -581,4 +582,12 @@ public class NMSBinding implements INMSBinding {
public DataVersion getDataVersion() {
return DataVersion.V1205;
}
@Override
public int getSpawnChunkCount(World world) {
var radius = Optional.ofNullable(world.getGameRuleValue(GameRule.SPAWN_CHUNK_RADIUS))
.orElseGet(() -> world.getGameRuleDefault(GameRule.SPAWN_CHUNK_RADIUS));
if (radius == null) throw new IllegalStateException("GameRule.SPAWN_CHUNK_RADIUS is null!");
return (int) Math.pow(2 * radius + 1, 2);
}
}