()
+ .qput("studio", engine.isStudio())
+ .qput("closed", engine.isClosed())
+ .qput("pack", new KMap<>()
+ .qput("key", dimension == null ? "" : dimension.getLoadKey())
+ .qput("version", dimension == null ? "" : dimension.getVersion())
+ .qput("hash", hash32 == null ? "" : Long.toHexString(hash32)))
+ .qput("mantle", new KMap<>()
+ .qput("idle", mantle.getAdjustedIdleDuration())
+ .qput("loaded", mantle.getLoadedRegionCount())
+ .qput("queued", mantle.getUnloadRegionCount()));
+ }
}
diff --git a/core/src/main/java/com/volmit/iris/util/decree/DecreeSystem.java b/core/src/main/java/com/volmit/iris/util/decree/DecreeSystem.java
index e76f62965..d22a8b822 100644
--- a/core/src/main/java/com/volmit/iris/util/decree/DecreeSystem.java
+++ b/core/src/main/java/com/volmit/iris/util/decree/DecreeSystem.java
@@ -160,7 +160,8 @@ public interface DecreeSystem extends CommandExecutor, TabCompleter {
}
J.aBukkit(() -> {
- if (!call(new VolmitSender(sender), args)) {
+ var volmit = new VolmitSender(sender);
+ if (!call(volmit, args)) {
if (IrisSettings.get().getGeneral().isCommandSounds()) {
if (sender instanceof Player) {
@@ -169,7 +170,7 @@ public interface DecreeSystem extends CommandExecutor, TabCompleter {
}
}
- sender.sendMessage(C.RED + "Unknown Iris Command");
+ volmit.sendMessage(C.RED + "Unknown Iris Command");
} else {
if (IrisSettings.get().getGeneral().isCommandSounds()) {
if (sender instanceof Player) {
diff --git a/core/src/main/java/com/volmit/iris/util/format/C.java b/core/src/main/java/com/volmit/iris/util/format/C.java
index de1893c8f..85deb3cac 100644
--- a/core/src/main/java/com/volmit/iris/util/format/C.java
+++ b/core/src/main/java/com/volmit/iris/util/format/C.java
@@ -376,6 +376,28 @@ public enum C {
return "#" + Integer.toHexString(spin(color.awtColor(), h, s, b).getRGB()).substring(2);
}
+ public static String mini(String s) {
+ String msg = compress(s);
+ StringBuilder b = new StringBuilder();
+ boolean c = false;
+
+ for (char i : msg.toCharArray()) {
+ if (!c) {
+ if (i == C.COLOR_CHAR) {
+ c = true;
+ continue;
+ }
+ b.append(i);
+ } else {
+ c = false;
+ C o = C.getByChar(i);
+ b.append(o.token);
+ }
+ }
+
+ return b.toString();
+ }
+
public static String aura(String s, int hrad, int srad, int vrad) {
return aura(s, hrad, srad, vrad, 0.3D);
}
diff --git a/core/src/main/java/com/volmit/iris/util/mantle/Mantle.java b/core/src/main/java/com/volmit/iris/util/mantle/Mantle.java
index 9de145a3f..6e1e56e54 100644
--- a/core/src/main/java/com/volmit/iris/util/mantle/Mantle.java
+++ b/core/src/main/java/com/volmit/iris/util/mantle/Mantle.java
@@ -85,7 +85,6 @@ public class Mantle {
this.worldHeight = worldHeight;
this.ioTrim = new AtomicBoolean(false);
this.ioTectonicUnload = new AtomicBoolean(false);
- new File(dataFolder, ".tmp").mkdirs();
loadedRegions = new KMap<>();
lastUse = new KMap<>();
ioBurst = MultiBurst.burst;
@@ -370,11 +369,10 @@ public class Mantle {
*/
public synchronized void close() {
Iris.debug("Closing The Mantle " + C.DARK_AQUA + dataFolder.getAbsolutePath());
- if (closed.get()) {
+ if (closed.getAndSet(true)) {
return;
}
- closed.set(true);
hyperLock.disable();
BurstExecutor b = ioBurst.burst(toUnload.size());
loadedRegions.forEach((i, plate) -> b.queue(() -> {
@@ -384,11 +382,11 @@ public class Mantle {
oldFileForRegion(dataFolder, i).delete();
} catch (Throwable e) {
Iris.error("Failed to write Tectonic Plate " + C.DARK_GREEN + Cache.keyX(i) + " " + Cache.keyZ(i));
+ Iris.reportError(e);
e.printStackTrace();
}
}));
loadedRegions.clear();
- IO.delete(new File(dataFolder, ".tmp"));
try {
b.complete();
@@ -396,6 +394,7 @@ public class Mantle {
Iris.reportError(e);
}
+ IO.delete(new File(dataFolder, ".tmp"));
Iris.debug("The Mantle has Closed " + C.DARK_AQUA + dataFolder.getAbsolutePath());
}
diff --git a/core/src/main/java/com/volmit/iris/util/mantle/TectonicPlate.java b/core/src/main/java/com/volmit/iris/util/mantle/TectonicPlate.java
index 009993321..101019023 100644
--- a/core/src/main/java/com/volmit/iris/util/mantle/TectonicPlate.java
+++ b/core/src/main/java/com/volmit/iris/util/mantle/TectonicPlate.java
@@ -27,6 +27,7 @@ import com.volmit.iris.util.documentation.ChunkCoordinates;
import com.volmit.iris.util.format.C;
import com.volmit.iris.util.format.Form;
import com.volmit.iris.util.io.CountingDataInputStream;
+import com.volmit.iris.util.io.IO;
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
import lombok.Getter;
import net.jpountz.lz4.LZ4BlockInputStream;
@@ -222,16 +223,8 @@ public class TectonicPlate {
*/
public void write(File file) throws IOException {
PrecisionStopwatch p = PrecisionStopwatch.start();
- File temp = File.createTempFile("iris-tectonic-plate", ".bin", new File(file.getParentFile(), ".tmp"));
- try {
- try (DataOutputStream dos = new DataOutputStream(new LZ4BlockOutputStream(new FileOutputStream(temp)))) {
- write(dos);
- }
- Files.move(temp.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
- Iris.debug("Saved Tectonic Plate " + C.DARK_GREEN + file.getName() + C.RED + " in " + Form.duration(p.getMilliseconds(), 2));
- } finally {
- temp.delete();
- }
+ IO.write(file, out -> new DataOutputStream(new LZ4BlockOutputStream(out)), this::write);
+ Iris.debug("Saved Tectonic Plate " + C.DARK_GREEN + file.getName() + C.RED + " in " + Form.duration(p.getMilliseconds(), 2));
}
/**
diff --git a/core/src/main/java/com/volmit/iris/util/particle/FastParticle.java b/core/src/main/java/com/volmit/iris/util/particle/FastParticle.java
deleted file mode 100644
index 4052dbdd2..000000000
--- a/core/src/main/java/com/volmit/iris/util/particle/FastParticle.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.volmit.iris.util.particle;
-
-import org.bukkit.Location;
-import org.bukkit.World;
-import org.bukkit.entity.Player;
-
-/**
- * Simple Bukkit Particles API with 1.7 to 1.13.2 support !
- *
- * You can find the project on GitHub
- *
- * @author MrMicky
- */
-public final class FastParticle {
-
- private static final ParticleSender PARTICLE_SENDER;
-
- static {
- if (FastReflection.optionalClass("org.bukkit.Particle$DustOptions").isPresent()) {
- PARTICLE_SENDER = new ParticleSender.ParticleSender1_13();
- } else if (FastReflection.optionalClass("org.bukkit.Particle").isPresent()) {
- PARTICLE_SENDER = new ParticleSender.ParticleSenderImpl();
- } else {
- PARTICLE_SENDER = new ParticleSenderLegacy();
- }
- }
-
- private FastParticle() {
- throw new UnsupportedOperationException();
- }
-
- /*
- * Worlds methods
- */
- public static void spawnParticle(World world, ParticleType particle, Location location, int count) {
- spawnParticle(world, particle, location.getX(), location.getY(), location.getZ(), count);
- }
-
- public static void spawnParticle(World world, ParticleType particle, double x, double y, double z, int count) {
- spawnParticle(world, particle, x, y, z, count, null);
- }
-
- public static void spawnParticle(World world, ParticleType particle, Location location, int count, T data) {
- spawnParticle(world, particle, location.getX(), location.getY(), location.getZ(), count, data);
- }
-
- public static void spawnParticle(World world, ParticleType particle, double x, double y, double z, int count,
- T data) {
- spawnParticle(world, particle, x, y, z, count, 0.0D, 0.0D, 0.0D, data);
- }
-
- public static void spawnParticle(World world, ParticleType particle, Location location, int count, double offsetX,
- double offsetY, double offsetZ) {
- spawnParticle(world, particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ);
- }
-
- public static void spawnParticle(World world, ParticleType particle, double x, double y, double z, int count,
- double offsetX, double offsetY, double offsetZ) {
- spawnParticle(world, particle, x, y, z, count, offsetX, offsetY, offsetZ, null);
- }
-
- public static void spawnParticle(World world, ParticleType particle, Location location, int count,
- double offsetX, double offsetY, double offsetZ, T data) {
- spawnParticle(world, particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY,
- offsetZ, data);
- }
-
- public static void spawnParticle(World world, ParticleType particle, double x, double y, double z, int count,
- double offsetX, double offsetY, double offsetZ, T data) {
- spawnParticle(world, particle, x, y, z, count, offsetX, offsetY, offsetZ, 1.0D, data);
- }
-
- public static void spawnParticle(World world, ParticleType particle, Location location, int count, double offsetX,
- double offsetY, double offsetZ, double extra) {
- spawnParticle(world, particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra);
- }
-
- public static void spawnParticle(World world, ParticleType particle, double x, double y, double z, int count,
- double offsetX, double offsetY, double offsetZ, double extra) {
- spawnParticle(world, particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, null);
- }
-
- public static void spawnParticle(World world, ParticleType particle, Location location, int count,
- double offsetX, double offsetY, double offsetZ, double extra, T data) {
- spawnParticle(world, particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data);
- }
-
- public static void spawnParticle(World world, ParticleType particle, double x, double y, double z, int count,
- double offsetX, double offsetY, double offsetZ, double extra, T data) {
- sendParticle(world, particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, data);
- }
-
- /*
- * Player methods
- */
- public static void spawnParticle(Player player, ParticleType particle, Location location, int count) {
- spawnParticle(player, particle, location.getX(), location.getY(), location.getZ(), count);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, double x, double y, double z, int count) {
- spawnParticle(player, particle, x, y, z, count, null);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, Location location, int count, T data) {
- spawnParticle(player, particle, location.getX(), location.getY(), location.getZ(), count, data);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, double x, double y, double z, int count,
- T data) {
- spawnParticle(player, particle, x, y, z, count, 0.0D, 0.0D, 0.0D, data);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, Location location, int count, double offsetX,
- double offsetY, double offsetZ) {
- spawnParticle(player, particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, double x, double y, double z, int count,
- double offsetX, double offsetY, double offsetZ) {
- spawnParticle(player, particle, x, y, z, count, offsetX, offsetY, offsetZ, null);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, Location location, int count,
- double offsetX, double offsetY, double offsetZ, T data) {
- spawnParticle(player, particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, data);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, double x, double y, double z, int count,
- double offsetX, double offsetY, double offsetZ, T data) {
- spawnParticle(player, particle, x, y, z, count, offsetX, offsetY, offsetZ, 1.0D, data);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, Location location, int count, double offsetX,
- double offsetY, double offsetZ, double extra) {
- spawnParticle(player, particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, double x, double y, double z, int count,
- double offsetX, double offsetY, double offsetZ, double extra) {
- spawnParticle(player, particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, null);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, Location location, int count,
- double offsetX, double offsetY, double offsetZ, double extra, T data) {
- spawnParticle(player, particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data);
- }
-
- public static void spawnParticle(Player player, ParticleType particle, double x, double y, double z, int count,
- double offsetX, double offsetY, double offsetZ, double extra, T data) {
- sendParticle(player, particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, data);
- }
-
- private static void sendParticle(Object receiver, ParticleType particle, double x, double y, double z, int count,
- double offsetX, double offsetY, double offsetZ, double extra, Object data) {
- if (!particle.isSupported()) {
- throw new IllegalArgumentException("The particle '" + particle + "' is not compatible with your server version");
- }
-
- PARTICLE_SENDER.spawnParticle(receiver, particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, data);
- }
-}
diff --git a/core/src/main/java/com/volmit/iris/util/particle/FastReflection.java b/core/src/main/java/com/volmit/iris/util/particle/FastReflection.java
deleted file mode 100644
index ee5994fb6..000000000
--- a/core/src/main/java/com/volmit/iris/util/particle/FastReflection.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.volmit.iris.util.particle;
-
-import com.volmit.iris.Iris;
-import org.bukkit.Bukkit;
-
-import java.util.Optional;
-
-/**
- * Small reflection class to use CraftBukkit and NMS
- *
- * @author MrMicky
- */
-public final class FastReflection {
-
- public static final String OBC_PACKAGE = "org.bukkit.craftbukkit";
- public static final String NMS_PACKAGE = "net.minecraft.server";
-
- public static final String VERSION = Bukkit.getServer().getClass().getPackage().getName().substring(OBC_PACKAGE.length() + 1);
-
- private FastReflection() {
- throw new UnsupportedOperationException();
- }
-
- public static String nmsClassName(String className) {
- return NMS_PACKAGE + '.' + VERSION + '.' + className;
- }
-
- public static Class> nmsClass(String className) throws ClassNotFoundException {
- return Class.forName(nmsClassName(className));
- }
-
- public static Optional> nmsOptionalClass(String className) {
- return optionalClass(nmsClassName(className));
- }
-
- public static String obcClassName(String className) {
- return OBC_PACKAGE + '.' + VERSION + '.' + className;
- }
-
- public static Class> obcClass(String className) throws ClassNotFoundException {
- return Class.forName(obcClassName(className));
- }
-
- public static Optional> obcOptionalClass(String className) {
- return optionalClass(obcClassName(className));
- }
-
- public static Optional> optionalClass(String className) {
- try {
- return Optional.of(Class.forName(className));
- } catch (ClassNotFoundException e) {
- Iris.reportError(e);
- return Optional.empty();
- }
- }
-
- @SuppressWarnings({"unchecked", "rawtypes"})
- public static Object enumValueOf(Class> enumClass, String enumName) {
- return Enum.valueOf((Class) enumClass, enumName.toUpperCase());
- }
-}
\ No newline at end of file
diff --git a/core/src/main/java/com/volmit/iris/util/particle/ParticleSender.java b/core/src/main/java/com/volmit/iris/util/particle/ParticleSender.java
deleted file mode 100644
index d9ac0a401..000000000
--- a/core/src/main/java/com/volmit/iris/util/particle/ParticleSender.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.volmit.iris.util.particle;
-
-import com.volmit.iris.Iris;
-import org.bukkit.Bukkit;
-import org.bukkit.Color;
-import org.bukkit.Particle;
-import org.bukkit.World;
-import org.bukkit.block.data.BlockData;
-import org.bukkit.entity.Player;
-import org.bukkit.material.MaterialData;
-
-/**
- * Particle sender using the Bukkit particles API for 1.9+ servers
- *
- * @author MrMicky
- */
-@SuppressWarnings("deprecation")
-interface ParticleSender {
-
- void spawnParticle(Object receiver, ParticleType particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, Object data);
-
- Object getParticle(ParticleType particle);
-
- boolean isValidData(Object particle, Object data);
-
- default double color(double color) {
- return color / 255.0;
- }
-
- class ParticleSenderImpl implements ParticleSender {
-
- @Override
- public void spawnParticle(Object receiver, ParticleType particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, Object data) {
- Particle bukkitParticle = Particle.valueOf(particle.toString());
-
- if (data instanceof Color) {
- if (particle.getDataType() == Color.class) {
- Color color = (Color) data;
- count = 0;
- offsetX = color(color.getRed());
- offsetY = color(color.getGreen());
- offsetZ = color(color.getBlue());
- extra = 1.0;
- }
- data = null;
- }
-
- if (receiver instanceof World) {
- ((World) receiver).spawnParticle(bukkitParticle, x, y, z, count, offsetX, offsetY, offsetZ, extra, data);
- } else if (receiver instanceof Player) {
- ((Player) receiver).spawnParticle(bukkitParticle, x, y, z, count, offsetX, offsetY, offsetZ, extra, data);
- }
- }
-
- @Override
- public Particle getParticle(ParticleType particle) {
- try {
- return Particle.valueOf(particle.toString());
- } catch (IllegalArgumentException e) {
- Iris.reportError(e);
- return null;
- }
- }
-
- @Override
- public boolean isValidData(Object particle, Object data) {
- return isValidDataBukkit((Particle) particle, data);
- }
-
- public boolean isValidDataBukkit(Particle particle, Object data) {
- return particle.getDataType() == Void.class || particle.getDataType().isInstance(data);
- }
- }
-
- class ParticleSender1_13 extends ParticleSenderImpl {
- @Override
- public void spawnParticle(Object receiver, ParticleType particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, Object data) {
- Particle bukkitParticle = Particle.valueOf(particle.toString());
-
- if (bukkitParticle.getDataType() == Particle.DustOptions.class) {
- if (data instanceof Color) {
- data = new Particle.DustOptions((Color) data, 1);
- } else if (data == null) {
- data = new Particle.DustOptions(Color.RED, 1);
- }
- } else if (bukkitParticle.getDataType() == BlockData.class && data instanceof MaterialData) {
- data = Bukkit.createBlockData(((MaterialData) data).getItemType());
- }
-
- super.spawnParticle(receiver, particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, data);
- }
-
- @Override
- public boolean isValidDataBukkit(Particle particle, Object data) {
- if (particle.getDataType() == Particle.DustOptions.class && data instanceof Color) {
- return true;
- }
-
- if (particle.getDataType() == BlockData.class && data instanceof MaterialData) {
- return true;
- }
-
- return super.isValidDataBukkit(particle, data);
- }
- }
-}
diff --git a/core/src/main/java/com/volmit/iris/util/particle/ParticleSenderLegacy.java b/core/src/main/java/com/volmit/iris/util/particle/ParticleSenderLegacy.java
deleted file mode 100644
index 1668de313..000000000
--- a/core/src/main/java/com/volmit/iris/util/particle/ParticleSenderLegacy.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.volmit.iris.util.particle;
-
-import com.volmit.iris.Iris;
-import org.bukkit.Color;
-import org.bukkit.World;
-import org.bukkit.entity.Player;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.material.MaterialData;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-/**
- * Legacy particle sender with NMS for 1.7/1.8 servers
- *
- * @author MrMicky
- */
-@SuppressWarnings({"deprecation", "JavaReflectionInvocation"})
-class ParticleSenderLegacy implements ParticleSender {
-
- private static final boolean SERVER_IS_1_8;
-
- private static final Constructor> PACKET_PARTICLE;
- private static final Class> ENUM_PARTICLE;
-
- private static final Method WORLD_GET_HANDLE;
- private static final Method WORLD_SEND_PARTICLE;
-
- private static final Method PLAYER_GET_HANDLE;
- private static final Field PLAYER_CONNECTION;
- private static final Method SEND_PACKET;
- private static final int[] EMPTY = new int[0];
-
- static {
- ENUM_PARTICLE = FastReflection.nmsOptionalClass("EnumParticle").orElse(null);
- SERVER_IS_1_8 = ENUM_PARTICLE != null;
-
- try {
- Class> packetParticleClass = FastReflection.nmsClass("PacketPlayOutWorldParticles");
- Class> playerClass = FastReflection.nmsClass("EntityPlayer");
- Class> playerConnectionClass = FastReflection.nmsClass("PlayerConnection");
- Class> worldClass = FastReflection.nmsClass("WorldServer");
- Class> entityPlayerClass = FastReflection.nmsClass("EntityPlayer");
-
- Class> craftPlayerClass = FastReflection.obcClass("entity.CraftPlayer");
- Class> craftWorldClass = FastReflection.obcClass("CraftWorld");
-
- if (SERVER_IS_1_8) {
- PACKET_PARTICLE = packetParticleClass.getConstructor(ENUM_PARTICLE, boolean.class, float.class,
- float.class, float.class, float.class, float.class, float.class, float.class, int.class,
- int[].class);
- WORLD_SEND_PARTICLE = worldClass.getDeclaredMethod("sendParticles", entityPlayerClass, ENUM_PARTICLE,
- boolean.class, double.class, double.class, double.class, int.class, double.class, double.class,
- double.class, double.class, int[].class);
- } else {
- PACKET_PARTICLE = packetParticleClass.getConstructor(String.class, float.class, float.class, float.class,
- float.class, float.class, float.class, float.class, int.class);
- WORLD_SEND_PARTICLE = worldClass.getDeclaredMethod("a", String.class, double.class, double.class,
- double.class, int.class, double.class, double.class, double.class, double.class);
- }
-
- WORLD_GET_HANDLE = craftWorldClass.getDeclaredMethod("getHandle");
- PLAYER_GET_HANDLE = craftPlayerClass.getDeclaredMethod("getHandle");
- PLAYER_CONNECTION = playerClass.getField("playerConnection");
- SEND_PACKET = playerConnectionClass.getMethod("sendPacket", FastReflection.nmsClass("Packet"));
- } catch (ReflectiveOperationException e) {
- throw new ExceptionInInitializerError(e);
- }
- }
-
- @Override
- public void spawnParticle(Object receiver, ParticleType particle, double x, double y, double z, int count, double offsetX, double offsetY,
- double offsetZ, double extra, Object data) {
- try {
- int[] datas = toData(particle, data);
-
- if (data instanceof Color) {
- if (particle.getDataType() == Color.class) {
- Color color = (Color) data;
- count = 0;
- offsetX = color(color.getRed());
- offsetY = color(color.getGreen());
- offsetZ = color(color.getBlue());
- extra = 1.0;
- }
- }
-
- if (receiver instanceof World) {
- Object worldServer = WORLD_GET_HANDLE.invoke(receiver);
-
- if (SERVER_IS_1_8) {
- WORLD_SEND_PARTICLE.invoke(worldServer, null, getEnumParticle(particle), true, x, y, z, count, offsetX, offsetY, offsetZ, extra, datas);
- } else {
- String particleName = particle.getLegacyName() + (datas.length != 2 ? "" : "_" + datas[0] + "_" + datas[1]);
- WORLD_SEND_PARTICLE.invoke(worldServer, particleName, x, y, z, count, offsetX, offsetY, offsetZ, extra);
- }
- } else if (receiver instanceof Player) {
- Object packet;
-
- if (SERVER_IS_1_8) {
- packet = PACKET_PARTICLE.newInstance(getEnumParticle(particle), true, (float) x, (float) y,
- (float) z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count, datas);
- } else {
- String particleName = particle.getLegacyName() + (datas.length != 2 ? "" : "_" + datas[0] + "_" + datas[1]);
- packet = PACKET_PARTICLE.newInstance(particleName, (float) x, (float) y, (float) z,
- (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count);
- }
-
- Object entityPlayer = PLAYER_GET_HANDLE.invoke(receiver);
- Object playerConnection = PLAYER_CONNECTION.get(entityPlayer);
- SEND_PACKET.invoke(playerConnection, packet);
- }
- } catch (ReflectiveOperationException e) {
- Iris.reportError(e);
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public boolean isValidData(Object particle, Object data) {
- return true;
- }
-
- @Override
- public Object getParticle(ParticleType particle) {
- if (!SERVER_IS_1_8) {
- return particle.getLegacyName();
- }
-
- try {
- return getEnumParticle(particle);
- } catch (IllegalArgumentException e) {
- Iris.reportError(e);
- return null;
- }
- }
-
- private Object getEnumParticle(ParticleType particleType) {
- return FastReflection.enumValueOf(ENUM_PARTICLE, particleType.toString());
- }
-
- private int[] toData(ParticleType particle, Object data) {
- Class> dataType = particle.getDataType();
- if (dataType == ItemStack.class) {
- if (!(data instanceof ItemStack itemStack)) {
- return SERVER_IS_1_8 ? new int[2] : new int[]{1, 0};
- }
-
- return new int[]{itemStack.getType().getId(), itemStack.getDurability()};
- }
-
- if (dataType == MaterialData.class) {
- if (!(data instanceof MaterialData materialData)) {
- return SERVER_IS_1_8 ? new int[1] : new int[]{1, 0};
- }
-
- if (SERVER_IS_1_8) {
- return new int[]{materialData.getItemType().getId() + (materialData.getData() << 12)};
- } else {
- return new int[]{materialData.getItemType().getId(), materialData.getData()};
- }
- }
-
- return EMPTY;
- }
-}
diff --git a/core/src/main/java/com/volmit/iris/util/particle/ParticleType.java b/core/src/main/java/com/volmit/iris/util/particle/ParticleType.java
deleted file mode 100644
index 25da1bd75..000000000
--- a/core/src/main/java/com/volmit/iris/util/particle/ParticleType.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.volmit.iris.util.particle;
-
-import com.volmit.iris.Iris;
-import org.bukkit.Color;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.material.MaterialData;
-
-/**
- * @author MrMicky
- */
-@SuppressWarnings("deprecation")
-public enum ParticleType {
-
- // 1.7+
- EXPLOSION_NORMAL("explode", "poof"),
- EXPLOSION_LARGE("largeexplode", "explosion"),
- EXPLOSION_HUGE("hugeexplosion", "explosion_emitter"),
- FIREWORKS_SPARK("fireworksSpark", "firework"),
- WATER_BUBBLE("bubble", "bubble"),
- WATER_SPLASH("splash", "splash"),
- WATER_WAKE("wake", "fishing"),
- SUSPENDED("suspended", "underwater"),
- SUSPENDED_DEPTH("depthsuspend", "underwater"),
- CRIT("crit", "crit"),
- CRIT_MAGIC("magicCrit", "enchanted_hit"),
- SMOKE_NORMAL("smoke", "smoke"),
- SMOKE_LARGE("largesmoke", "large_smoke"),
- SPELL("spell", "effect"),
- SPELL_INSTANT("instantSpell", "instant_effect"),
- SPELL_MOB("mobSpell", "entity_effect"),
- SPELL_MOB_AMBIENT("mobSpellAmbient", "ambient_entity_effect"),
- SPELL_WITCH("witchMagic", "witch"),
- DRIP_WATER("dripWater", "dripping_water"),
- DRIP_LAVA("dripLava", "dripping_lava"),
- VILLAGER_ANGRY("angryVillager", "angry_villager"),
- VILLAGER_HAPPY("happyVillager", "happy_villager"),
- TOWN_AURA("townaura", "mycelium"),
- NOTE("note", "note"),
- PORTAL("portal", "portal"),
- ENCHANTMENT_TABLE("enchantmenttable", "enchant"),
- FLAME("flame", "flame"),
- LAVA("lava", "lava"),
- // FOOTSTEP("footstep", null),
- CLOUD("cloud", "cloud"),
- REDSTONE("reddust", "dust"),
- SNOWBALL("snowballpoof", "item_snowball"),
- SNOW_SHOVEL("snowshovel", "item_snowball"),
- SLIME("slime", "item_slime"),
- HEART("heart", "heart"),
- ITEM_CRACK("iconcrack", "item"),
- BLOCK_CRACK("blockcrack", "block"),
- BLOCK_DUST("blockdust", "block"),
-
- // 1.8+
- BARRIER("barrier", "barrier", 8),
- WATER_DROP("droplet", "rain", 8),
- MOB_APPEARANCE("mobappearance", "elder_guardian", 8),
- // ITEM_TAKE("take", null, 8),
-
- // 1.9+
- DRAGON_BREATH("dragonbreath", "dragon_breath", 9),
- END_ROD("endRod", "end_rod", 9),
- DAMAGE_INDICATOR("damageIndicator", "damage_indicator", 9),
- SWEEP_ATTACK("sweepAttack", "sweep_attack", 9),
-
- // 1.10+
- FALLING_DUST("fallingdust", "falling_dust", 10),
-
- // 1.11+
- TOTEM("totem", "totem_of_undying", 11),
- SPIT("spit", "spit", 11),
-
- // 1.13+
- SQUID_INK(13),
- BUBBLE_POP(13),
- CURRENT_DOWN(13),
- BUBBLE_COLUMN_UP(13),
- NAUTILUS(13),
- DOLPHIN(13),
-
- // 1.14+
- SNEEZE(14),
- CAMPFIRE_COSY_SMOKE(14),
- CAMPFIRE_SIGNAL_SMOKE(14),
- COMPOSTER(14),
- FLASH(14),
- FALLING_LAVA(14),
- LANDING_LAVA(14),
- FALLING_WATER(14),
-
- // 1.15+
- DRIPPING_HONEY(15),
- FALLING_HONEY(15),
- LANDING_HONEY(15),
- FALLING_NECTAR(15);
-
- private static final int SERVER_VERSION_ID;
-
- static {
- String ver = FastReflection.VERSION;
- SERVER_VERSION_ID = ver.charAt(4) == '_' ? Character.getNumericValue(ver.charAt(3)) : Integer.parseInt(ver.substring(3, 5));
- }
-
- private final String legacyName;
- private final String name;
- private final int minimumVersion;
-
- // 1.7 particles
- ParticleType(String legacyName, String name) {
- this(legacyName, name, -1);
- }
-
- // 1.13+ particles
- ParticleType(int minimumVersion) {
- this.legacyName = null;
- this.name = name().toLowerCase();
- this.minimumVersion = minimumVersion;
- }
-
- // 1.8-1.12 particles
- ParticleType(String legacyName, String name, int minimumVersion) {
- this.legacyName = legacyName;
- this.name = name;
- this.minimumVersion = minimumVersion;
- }
-
- public static ParticleType getParticle(String particleName) {
- try {
- return ParticleType.valueOf(particleName.toUpperCase());
- } catch (IllegalArgumentException e) {
- Iris.reportError(e);
- for (ParticleType particle : values()) {
- if (particle.getName().equalsIgnoreCase(particleName)) {
- return particle;
- }
-
- if (particle.hasLegacyName() && particle.getLegacyName().equalsIgnoreCase(particleName)) {
- return particle;
- }
- }
- }
- return null;
- }
-
- public boolean hasLegacyName() {
- return legacyName != null;
- }
-
- public String getLegacyName() {
- if (!hasLegacyName()) {
- throw new IllegalStateException("Particle " + name() + " don't have legacy name");
- }
- return legacyName;
- }
-
- public String getName() {
- return name;
- }
-
- public boolean isSupported() {
- return minimumVersion <= 0 || SERVER_VERSION_ID >= minimumVersion;
- }
-
- public Class> getDataType() {
- return switch (this) {
- case ITEM_CRACK -> ItemStack.class;
- case BLOCK_CRACK, BLOCK_DUST, FALLING_DUST ->
- //noinspection deprecation
- MaterialData.class;
- case REDSTONE -> Color.class;
- default -> Void.class;
- };
- }
-}
diff --git a/core/src/main/java/com/volmit/iris/util/plugin/VolmitSender.java b/core/src/main/java/com/volmit/iris/util/plugin/VolmitSender.java
index 217b44054..dccb95ce7 100644
--- a/core/src/main/java/com/volmit/iris/util/plugin/VolmitSender.java
+++ b/core/src/main/java/com/volmit/iris/util/plugin/VolmitSender.java
@@ -264,7 +264,7 @@ public class VolmitSender implements CommandSender {
private Component createNoPrefixComponent(String message) {
if (!IrisSettings.get().getGeneral().canUseCustomColors(this)) {
String t = C.translateAlternateColorCodes('&', MiniMessage.miniMessage().stripTags(message));
- return MiniMessage.miniMessage().deserialize(t);
+ return MiniMessage.miniMessage().deserialize(C.mini(t));
}
String t = C.translateAlternateColorCodes('&', message);
@@ -273,13 +273,13 @@ public class VolmitSender implements CommandSender {
}
private Component createNoPrefixComponentNoProcessing(String message) {
- return MiniMessage.builder().postProcessor(c -> c).build().deserialize(message);
+ return MiniMessage.builder().postProcessor(c -> c).build().deserialize(C.mini(message));
}
private Component createComponent(String message) {
if (!IrisSettings.get().getGeneral().canUseCustomColors(this)) {
String t = C.translateAlternateColorCodes('&', MiniMessage.miniMessage().stripTags(getTag() + message));
- return MiniMessage.miniMessage().deserialize(t);
+ return MiniMessage.miniMessage().deserialize(C.mini(t));
}
String t = C.translateAlternateColorCodes('&', getTag() + message);
@@ -290,11 +290,11 @@ public class VolmitSender implements CommandSender {
private Component createComponentRaw(String message) {
if (!IrisSettings.get().getGeneral().canUseCustomColors(this)) {
String t = C.translateAlternateColorCodes('&', MiniMessage.miniMessage().stripTags(getTag() + message));
- return MiniMessage.miniMessage().deserialize(t);
+ return MiniMessage.miniMessage().deserialize(C.mini(t));
}
String t = C.translateAlternateColorCodes('&', getTag() + message);
- return MiniMessage.miniMessage().deserialize(t);
+ return MiniMessage.miniMessage().deserialize(C.mini(t));
}
public void showWaiting(String passive, CompletableFuture f) {
diff --git a/core/src/main/java/com/volmit/iris/util/sentry/ServerID.java b/core/src/main/java/com/volmit/iris/util/sentry/ServerID.java
new file mode 100644
index 000000000..da766574e
--- /dev/null
+++ b/core/src/main/java/com/volmit/iris/util/sentry/ServerID.java
@@ -0,0 +1,59 @@
+package com.volmit.iris.util.sentry;
+
+import com.volmit.iris.util.io.IO;
+import io.sentry.protocol.User;
+import lombok.SneakyThrows;
+import org.bukkit.Bukkit;
+import oshi.SystemInfo;
+
+import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+public class ServerID {
+ public static final String ID = calculate();
+
+ public static User asUser() {
+ User u = new User();
+ u.setId(ID);
+ return u;
+ }
+
+ @SneakyThrows
+ private static String calculate() {
+ Digest md = new Digest();
+ md.update(System.getProperty("java.vm.name"));
+ md.update(System.getProperty("java.vm.version"));
+ md.update(new SystemInfo().getHardware().getProcessor().toString());
+ md.update(Runtime.getRuntime().maxMemory());
+ for (var p : Bukkit.getPluginManager().getPlugins()) {
+ md.update(p.getName());
+ }
+
+ return IO.bytesToHex(md.digest());
+ }
+
+ private static final class Digest {
+ private final MessageDigest md = MessageDigest.getInstance("SHA-256");
+ private final byte[] buffer = new byte[8];
+ private final ByteBuffer wrapped = ByteBuffer.wrap(buffer);
+
+ private Digest() throws NoSuchAlgorithmException {
+ }
+
+ public void update(String string) {
+ if (string == null) return;
+ md.update(string.getBytes(StandardCharsets.UTF_8));
+ }
+
+ public void update(long Long) {
+ wrapped.putLong(0, Long);
+ md.update(buffer, 0, 8);
+ }
+
+ public byte[] digest() {
+ return md.digest();
+ }
+ }
+}
diff --git a/core/src/main/resources/plugin.yml b/core/src/main/resources/plugin.yml
index 7ff73ff7e..0a58f5d00 100644
--- a/core/src/main/resources/plugin.yml
+++ b/core/src/main/resources/plugin.yml
@@ -23,5 +23,5 @@ libraries:
commands:
iris:
aliases: [ ir, irs ]
-api-version: '${apiversion}'
+api-version: '${apiVersion}'
hotload-dependencies: false
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 7454180f2..e6441136f 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 48c0a02ca..ff23a68d7 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 1b6c78733..1aa94a426 100755
--- a/gradlew
+++ b/gradlew
@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,11 @@ do
esac
done
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-APP_NAME="Gradle"
+# This is normally unused
+# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
+ fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi
-# Collect all arguments for the java command;
-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
-# shell script including quotes and variable substitutions, so put them in
-# double quotes to make sure that they get re-expanded; and
-# * put everything else in single quotes, so that it's not re-expanded.
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
@@ -205,6 +214,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
diff --git a/gradlew.bat b/gradlew.bat
index ac1b06f93..7101f8e46 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
-@if "%DEBUG%" == "" @echo off
+@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,13 +41,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
+if %ERRORLEVEL% equ 0 goto execute
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
+if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
diff --git a/settings.gradle b/settings.gradle.kts
similarity index 74%
rename from settings.gradle
rename to settings.gradle.kts
index 9315a1131..c45462895 100644
--- a/settings.gradle
+++ b/settings.gradle.kts
@@ -23,19 +23,19 @@ pluginManagement {
}
}
plugins {
- id "org.gradle.toolchains.foojay-resolver-convention" version "0.8.0"
+ id ("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}
-rootProject.name = 'Iris'
+rootProject.name = "Iris"
-include(':core')
+include(":core")
include(
- ':nms:v1_21_R4',
- ':nms:v1_21_R3',
- ':nms:v1_21_R2',
- ':nms:v1_21_R1',
- ':nms:v1_20_R4',
- ':nms:v1_20_R3',
- ':nms:v1_20_R2',
- ':nms:v1_20_R1',
+ ":nms:v1_21_R4",
+ ":nms:v1_21_R3",
+ ":nms:v1_21_R2",
+ ":nms:v1_21_R1",
+ ":nms:v1_20_R4",
+ ":nms:v1_20_R3",
+ ":nms:v1_20_R2",
+ ":nms:v1_20_R1",
)
\ No newline at end of file