mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-01-04 15:41:30 +00:00
Compare commits
17 Commits
2.4.1-1.19
...
2.4.2-1.19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ec2f8fb7b | ||
|
|
6c5fac154e | ||
|
|
540ab8f0d2 | ||
|
|
17d2ac8d70 | ||
|
|
a6ebdead19 | ||
|
|
aa7631ecd0 | ||
|
|
4e138cad9f | ||
|
|
7e55b5fcee | ||
|
|
e19e5278b4 | ||
|
|
dfcd2dc83e | ||
|
|
8775f842e6 | ||
|
|
7b07a4ba6c | ||
|
|
d78e5973e9 | ||
|
|
110d296184 | ||
|
|
23cd5c117b | ||
|
|
131c4692bc | ||
|
|
f6571367db |
@@ -24,7 +24,7 @@ plugins {
|
||||
id "de.undercouch.download" version "5.0.1"
|
||||
}
|
||||
|
||||
version '2.3.14-1.19.3' // Needs to be version specific
|
||||
version '2.4.1-1.19.3'
|
||||
def nmsVersion = "1.19.3" //[NMS]
|
||||
def apiVersion = '1.19'
|
||||
def specialSourceVersion = '1.11.0' //[NMS]
|
||||
@@ -37,7 +37,7 @@ def main = 'com.volmit.iris.Iris'
|
||||
registerCustomOutputTask('Cyberpwn', 'C://Users/cyberpwn/Documents/development/server/plugins')
|
||||
registerCustomOutputTask('Psycho', 'C://Dan/MinecraftDevelopment/Server/plugins')
|
||||
registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/server/plugins')
|
||||
registerCustomOutputTask('Coco', 'D://Documents/MC/plugins')
|
||||
registerCustomOutputTask('Coco', 'D://mcsm/plugins')
|
||||
registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/plugins')
|
||||
registerCustomOutputTask('Vatuu', 'D://Minecraft/Servers/1.19.3/plugins')
|
||||
// ========================== UNIX ==============================
|
||||
@@ -75,7 +75,7 @@ repositories {
|
||||
}
|
||||
}
|
||||
maven { url "https://arcanearts.jfrog.io/artifactory/archives" }
|
||||
|
||||
maven { url "https://mvn.lumine.io/repository/maven-public/" }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,6 +134,7 @@ dependencies {
|
||||
implementation "net.kyori:adventure-text-minimessage:4.11.0"
|
||||
implementation 'net.kyori:adventure-platform-bukkit:4.1.0'
|
||||
implementation 'net.kyori:adventure-api:4.11.0'
|
||||
implementation 'io.lumine:Mythic-Dist:5.2.1'
|
||||
|
||||
// Dynamically Loaded
|
||||
implementation 'io.timeandspace:smoothie-map:2.0.2'
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.volmit.iris.core.service.StudioSVC;
|
||||
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.IrisEntity;
|
||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.decree.DecreeContext;
|
||||
@@ -40,7 +41,9 @@ import com.volmit.iris.util.scheduling.J;
|
||||
import com.volmit.iris.util.scheduling.jobs.QueueJob;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -325,7 +328,7 @@ public class CommandIris implements DecreeExecutor {
|
||||
C.YELLOW + " - Caves not lining up",
|
||||
C.YELLOW + " - Terrain layers not lining up",
|
||||
C.RED + "Now that you are aware of the risks, and have made a back-up:",
|
||||
C.RED + "/iris ^world <world> <pack> confirm=true"
|
||||
C.RED + "/iris ^world " + world.getName() + " " + pack.getLoadKey() + " confirm=true"
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -464,19 +464,16 @@ public class CommandStudio implements DecreeExecutor {
|
||||
sender().sendMessage(C.GREEN + "Done! " + report.getPath());
|
||||
}
|
||||
|
||||
@Decree(description = "Summon an Iris Entity", origin = DecreeOrigin.PLAYER)
|
||||
public void summon(
|
||||
@Param(description = "The Iris Entity to spawn")
|
||||
@Decree(description = "Spawn an Iris entity", aliases = "summon", origin = DecreeOrigin.PLAYER)
|
||||
public void spawn(
|
||||
@Param(description = "The entity to spawn")
|
||||
IrisEntity entity,
|
||||
@Param(description = "The location at which to spawn the entity", defaultValue = "self")
|
||||
@Param(description = "The location to spawn the entity at", contextual = true)
|
||||
Vector location
|
||||
) {
|
||||
if (!sender().isPlayer()) {
|
||||
sender().sendMessage(C.RED + "Players only (this is a config error. Ask support to add DecreeOrigin.PLAYER to the command you tried to run)");
|
||||
return;
|
||||
if (!IrisToolbelt.isIrisWorld(player().getWorld())) {
|
||||
sender().sendMessage(C.RED + "You have to be in an Iris world to spawn entities properly. Trying to spawn the best we can do.");
|
||||
}
|
||||
|
||||
sender().sendMessage(C.GREEN + "Spawning entity");
|
||||
entity.spawn(engine(), new Location(world(), location.getX(), location.getY(), location.getZ()));
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
package com.volmit.iris.core.gui.components;
|
||||
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisBiomeGeneratorLink;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
|
||||
import java.awt.*;
|
||||
@@ -49,14 +51,23 @@ public class IrisRenderer {
|
||||
colorFunction = (x, z) -> renderer.getComplex().getCaveBiomeStream().get(x, z).getColor(renderer, currentType).getRGB();
|
||||
case HEIGHT ->
|
||||
colorFunction = (x, z) -> Color.getHSBColor(renderer.getComplex().getHeightStream().get(x, z).floatValue(), 100, 100).getRGB();
|
||||
case CONTINENT -> {
|
||||
double fluidHeight = renderer.getComplex().getFluidHeight();
|
||||
int deltaHeight = renderer.getMaxHeight() - renderer.getMinHeight();
|
||||
colorFunction = (x, z) -> {
|
||||
double h = renderer.getComplex().getHeightStream().get(x, z);
|
||||
return new Color((int) (h * 255d / deltaHeight), 128, h > fluidHeight ? 0 : 255).getRGB();
|
||||
};
|
||||
}
|
||||
case CONTINENT ->
|
||||
colorFunction = (x, z) -> {
|
||||
IrisBiome b = renderer.getBiome((int) Math.round(x), renderer.getMaxHeight() - 1, (int) Math.round(z));
|
||||
IrisBiomeGeneratorLink g = b.getGenerators().get(0);
|
||||
Color c;
|
||||
if (g.getMax() <= 0) {
|
||||
// Max is below water level, so it is most likely an ocean biome
|
||||
c = Color.BLUE;
|
||||
} else if (g.getMin() < 0) {
|
||||
// Min is below water level, but max is not, so it is most likely a shore biome
|
||||
c = Color.YELLOW;
|
||||
} else {
|
||||
// Both min and max are above water level, so it is most likely a land biome
|
||||
c = Color.GREEN;
|
||||
}
|
||||
return c.getRGB();
|
||||
};
|
||||
}
|
||||
|
||||
double x, z;
|
||||
|
||||
@@ -18,23 +18,17 @@
|
||||
|
||||
package com.volmit.iris.core.link;
|
||||
|
||||
import io.lumine.mythic.bukkit.MythicBukkit;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class MythicMobsLink {
|
||||
|
||||
private Collection<String> mobs;
|
||||
private BiFunction<String, Location, Entity> spawnMobFunction;
|
||||
|
||||
public MythicMobsLink() {
|
||||
|
||||
}
|
||||
@@ -56,59 +50,10 @@ public class MythicMobsLink {
|
||||
*/
|
||||
public @Nullable
|
||||
Entity spawnMob(String mob, Location location) {
|
||||
if (!isEnabled()) return null;
|
||||
|
||||
if (spawnMobFunction != null) {
|
||||
return spawnMobFunction.apply(mob, location);
|
||||
}
|
||||
|
||||
try {
|
||||
Class<?> mythicMobClass = Class.forName("io.lumine.mythic.bukkit.MythicBukkit");
|
||||
Method getInst = mythicMobClass.getDeclaredMethod("inst");
|
||||
Object inst = getInst.invoke(null);
|
||||
Method getAPIHelper = mythicMobClass.getDeclaredMethod("getAPIHelper");
|
||||
Object apiHelper = getAPIHelper.invoke(inst);
|
||||
Method spawnMobMethod = apiHelper.getClass().getDeclaredMethod("spawnMythicMob", String.class, Location.class);
|
||||
|
||||
spawnMobFunction = (str, loc) -> {
|
||||
try {
|
||||
return (Entity) spawnMobMethod.invoke(apiHelper, str, loc);
|
||||
} catch (InvocationTargetException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
return spawnMobFunction.apply(mob, location);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return null;
|
||||
return isEnabled() ? MythicBukkit.inst().getMobManager().spawnMob(mob, location).getEntity().getBukkitEntity() : null;
|
||||
}
|
||||
|
||||
public Collection<String> getMythicMobTypes() {
|
||||
if (mobs != null) {
|
||||
return mobs;
|
||||
}
|
||||
|
||||
if (isEnabled()) {
|
||||
|
||||
try {
|
||||
Class<?> mythicMobClass = Class.forName("io.lumine.xikage.mythicmobs.MythicMobs");
|
||||
Method getInst = mythicMobClass.getDeclaredMethod("inst");
|
||||
Object inst = getInst.invoke(null);
|
||||
Method getMobManager = mythicMobClass.getDeclaredMethod("getMobManager");
|
||||
Object mobManager = getMobManager.invoke(inst);
|
||||
Method getMobNames = mobManager.getClass().getDeclaredMethod("getMobNames");
|
||||
mobs = (Collection<String>) getMobNames.invoke(mobManager);
|
||||
return mobs;
|
||||
} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |
|
||||
IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return new ArrayList<>();
|
||||
return isEnabled() ? MythicBukkit.inst().getMobManager().getMobNames() : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,6 @@ public class IrisComplex implements DataProvider {
|
||||
return seaBiomeStream;
|
||||
case SHORE:
|
||||
return shoreBiomeStream;
|
||||
case DEFER:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -32,8 +32,5 @@ public enum InferredType {
|
||||
SEA,
|
||||
|
||||
@Desc("Represents any cave biome type")
|
||||
CAVE,
|
||||
|
||||
@Desc("Defers the type to whatever another biome type that already exists is.")
|
||||
DEFER
|
||||
CAVE
|
||||
}
|
||||
|
||||
@@ -484,11 +484,6 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
});
|
||||
}
|
||||
|
||||
public IrisBiome infer(InferredType t, InferredType type) {
|
||||
setInferredType(t.equals(InferredType.DEFER) ? type : t);
|
||||
return this;
|
||||
}
|
||||
|
||||
public KList<BlockData> generateSeaLayers(double wx, double wz, RNG random, int maxDepth, IrisData rdata) {
|
||||
KList<BlockData> data = new KList<>();
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ public class IrisEntity extends IrisRegistrant {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (type.equals(EntityType.UNKNOWN)) {
|
||||
if (type.equals(EntityType.UNKNOWN) && !isSpecialType()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,17 +76,17 @@ public class IrisSpawner extends IrisRegistrant {
|
||||
public boolean isValid(IrisBiome biome) {
|
||||
return switch (group) {
|
||||
case NORMAL -> switch (biome.getInferredType()) {
|
||||
case SHORE, SEA, CAVE, DEFER -> false;
|
||||
case SHORE, SEA, CAVE -> false;
|
||||
case LAND -> true;
|
||||
};
|
||||
case CAVE -> true;
|
||||
case UNDERWATER -> switch (biome.getInferredType()) {
|
||||
case SHORE, LAND, CAVE, DEFER -> false;
|
||||
case SHORE, LAND, CAVE -> false;
|
||||
case SEA -> true;
|
||||
};
|
||||
case BEACH -> switch (biome.getInferredType()) {
|
||||
case SHORE -> true;
|
||||
case LAND, CAVE, SEA, DEFER -> false;
|
||||
case LAND, CAVE, SEA -> false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util.decree.context;
|
||||
|
||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.util.decree.DecreeContextHandler;
|
||||
import com.volmit.iris.util.plugin.VolmitSender;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class VectorContextHandler implements DecreeContextHandler<Vector> {
|
||||
public Class<Vector> getType() {
|
||||
return Vector.class;
|
||||
}
|
||||
|
||||
public Vector handle(VolmitSender sender) {
|
||||
if (sender.isPlayer()) {
|
||||
return sender.player().getLocation().toVector();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class DimensionHandler implements DecreeParameterHandler<IrisDimension> {
|
||||
try {
|
||||
return options.stream().filter((i) -> toString(i).equalsIgnoreCase(in)).toList().get(0);
|
||||
} catch (Throwable e) {
|
||||
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
||||
throw new DecreeParsingException("Unable to filter which Dimension \"" + in + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class EntityHandler implements DecreeParameterHandler<IrisEntity> {
|
||||
try {
|
||||
return options.stream().filter((i) -> toString(i).equalsIgnoreCase(in)).collect(Collectors.toList()).get(0);
|
||||
} catch (Throwable e) {
|
||||
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
||||
throw new DecreeParsingException("Unable to filter which Entity \"" + in + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class GeneratorHandler implements DecreeParameterHandler<IrisGenerator> {
|
||||
try {
|
||||
return options.stream().filter((i) -> toString(i).equalsIgnoreCase(in)).collect(Collectors.toList()).get(0);
|
||||
} catch (Throwable e) {
|
||||
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
||||
throw new DecreeParsingException("Unable to filter which Generator \"" + in + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class PlayerHandler implements DecreeParameterHandler<Player> {
|
||||
try {
|
||||
return options.stream().filter((i) -> toString(i).equalsIgnoreCase(in)).collect(Collectors.toList()).get(0);
|
||||
} catch (Throwable e) {
|
||||
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
||||
throw new DecreeParsingException("Unable to filter which Player \"" + in + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class RegionHandler implements DecreeParameterHandler<IrisRegion> {
|
||||
try {
|
||||
return options.stream().filter((i) -> toString(i).equalsIgnoreCase(in)).collect(Collectors.toList()).get(0);
|
||||
} catch (Throwable e) {
|
||||
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
||||
throw new DecreeParsingException("Unable to filter which Region \"" + in + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class ScriptHandler implements DecreeParameterHandler<IrisScript> {
|
||||
try {
|
||||
return options.stream().filter((i) -> toString(i).equalsIgnoreCase(in)).collect(Collectors.toList()).get(0);
|
||||
} catch (Throwable e) {
|
||||
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
||||
throw new DecreeParsingException("Unable to filter which Script \"" + in + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class WorldHandler implements DecreeParameterHandler<World> {
|
||||
try {
|
||||
return options.stream().filter((i) -> toString(i).equalsIgnoreCase(in)).collect(Collectors.toList()).get(0);
|
||||
} catch (Throwable e) {
|
||||
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
||||
throw new DecreeParsingException("Unable to filter which World \"" + in + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ObjectHandler implements DecreeParameterHandler<String> {
|
||||
try {
|
||||
return options.stream().filter((i) -> toString(i).equalsIgnoreCase(in)).collect(Collectors.toList()).get(0);
|
||||
} catch (Throwable e) {
|
||||
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
||||
throw new DecreeParsingException("Unable to filter which Object \"" + in + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ public class VirtualDecreeCommand {
|
||||
}
|
||||
|
||||
DecreeOrigin origin = type.getDeclaredAnnotation(Decree.class).origin();
|
||||
if (origin.validFor(sender)) {
|
||||
if (!origin.validFor(sender)) {
|
||||
sender.sendMessage(C.RED + "This command has to be sent from another origin: " + C.GOLD + origin);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user