mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-02-16 10:30:53 +00:00
Compare commits
23 Commits
2.3.13-1.1
...
2.4.1-1.19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5c64c7480 | ||
|
|
085f63a915 | ||
|
|
3e022e1931 | ||
|
|
0dba3725ae | ||
|
|
8bb409df4e | ||
|
|
603168a147 | ||
|
|
2a95edd860 | ||
|
|
e94406fb45 | ||
|
|
e5a7b5d0c6 | ||
|
|
d6f816fe2f | ||
|
|
c15d4a349f | ||
|
|
3ce832583c | ||
|
|
5514fd2645 | ||
|
|
66d07dcaca | ||
|
|
c1cf8e88ee | ||
|
|
684bd739b9 | ||
|
|
d4c0e07b1d | ||
|
|
a6ea6fcfb2 | ||
|
|
c366ec0c40 | ||
|
|
8d715e2e4e | ||
|
|
dea3ec80ac | ||
|
|
4053f05ba9 | ||
|
|
ef07ec2c62 |
@@ -24,7 +24,7 @@ plugins {
|
||||
id "de.undercouch.download" version "5.0.1"
|
||||
}
|
||||
|
||||
version '2.3.13-1.19.3' // Needs to be version specific
|
||||
version '2.3.14-1.19.3' // Needs to be version specific
|
||||
def nmsVersion = "1.19.3" //[NMS]
|
||||
def apiVersion = '1.19'
|
||||
def specialSourceVersion = '1.11.0' //[NMS]
|
||||
|
||||
@@ -87,7 +87,7 @@ import java.util.Map;
|
||||
|
||||
@SuppressWarnings("CanBeFinal")
|
||||
public class Iris extends VolmitPlugin implements Listener {
|
||||
public static final String OVERWORLD_TAG = "2092";
|
||||
public static final String OVERWORLD_TAG = "2100";
|
||||
|
||||
private static final Queue<Runnable> syncJobs = new ShurikenQueue<>();
|
||||
|
||||
|
||||
@@ -49,6 +49,14 @@ 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();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
double x, z;
|
||||
|
||||
@@ -19,5 +19,5 @@
|
||||
package com.volmit.iris.core.gui.components;
|
||||
|
||||
public enum RenderType {
|
||||
BIOME, BIOME_LAND, BIOME_SEA, REGION, CAVE_LAND, HEIGHT, OBJECT_LOAD, DECORATOR_LOAD, LAYER_LOAD
|
||||
BIOME, BIOME_LAND, BIOME_SEA, REGION, CAVE_LAND, HEIGHT, OBJECT_LOAD, DECORATOR_LOAD, CONTINENT, LAYER_LOAD
|
||||
}
|
||||
|
||||
@@ -54,20 +54,70 @@ public class IrisDimension extends IrisRegistrant {
|
||||
public static final BlockData WATER = Material.WATER.createBlockData();
|
||||
private static final String DP_OVERWORLD_DEFAULT = """
|
||||
{
|
||||
"ultrawarm": false,
|
||||
"natural": true,
|
||||
"coordinate_scale": 1.0,
|
||||
"has_skylight": true,
|
||||
"has_ceiling": false,
|
||||
"ambient_light": 0,
|
||||
"piglin_safe": false,
|
||||
"bed_works": true,
|
||||
"respawn_anchor_works": true,
|
||||
"has_raids": true,
|
||||
"monster_spawn_block_light_limit": 7,
|
||||
"monster_spawn_light_level": 7,
|
||||
"infiniburn": "#minecraft:infiniburn_overworld",
|
||||
"effects": "minecraft:overworld"
|
||||
"ambient_light": 0.0,
|
||||
"bed_works": true,
|
||||
"coordinate_scale": 1.0,
|
||||
"effects": "minecraft:overworld",
|
||||
"has_ceiling": false,
|
||||
"has_raids": true,
|
||||
"has_skylight": true,
|
||||
"infiniburn": "#minecraft:infiniburn_overworld",
|
||||
"monster_spawn_block_light_limit": 0,
|
||||
"monster_spawn_light_level": {
|
||||
"type": "minecraft:uniform",
|
||||
"value": {
|
||||
"max_inclusive": 7,
|
||||
"min_inclusive": 0
|
||||
}
|
||||
},
|
||||
"natural": true,
|
||||
"piglin_safe": false,
|
||||
"respawn_anchor_works": false,
|
||||
"ultrawarm": false
|
||||
}""";
|
||||
|
||||
private static final String DP_NETHER_DEFAULT = """
|
||||
{
|
||||
"ambient_light": 0.1,
|
||||
"bed_works": false,
|
||||
"coordinate_scale": 8.0,
|
||||
"effects": "minecraft:the_nether",
|
||||
"fixed_time": 18000,
|
||||
"has_ceiling": true,
|
||||
"has_raids": false,
|
||||
"has_skylight": false,
|
||||
"infiniburn": "#minecraft:infiniburn_nether",
|
||||
"monster_spawn_block_light_limit": 15,
|
||||
"monster_spawn_light_level": 7,
|
||||
"natural": false,
|
||||
"piglin_safe": true,
|
||||
"respawn_anchor_works": true,
|
||||
"ultrawarm": true
|
||||
}""";
|
||||
|
||||
private static final String DP_END_DEFAULT = """
|
||||
{
|
||||
"ambient_light": 0.0,
|
||||
"bed_works": false,
|
||||
"coordinate_scale": 1.0,
|
||||
"effects": "minecraft:the_end",
|
||||
"fixed_time": 6000,
|
||||
"has_ceiling": false,
|
||||
"has_raids": true,
|
||||
"has_skylight": false,
|
||||
"infiniburn": "#minecraft:infiniburn_end",
|
||||
"monster_spawn_block_light_limit": 0,
|
||||
"monster_spawn_light_level": {
|
||||
"type": "minecraft:uniform",
|
||||
"value": {
|
||||
"max_inclusive": 7,
|
||||
"min_inclusive": 0
|
||||
}
|
||||
},
|
||||
"natural": false,
|
||||
"piglin_safe": false,
|
||||
"respawn_anchor_works": false,
|
||||
"ultrawarm": false
|
||||
}""";
|
||||
private final transient AtomicCache<Position2> parallaxSize = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> rockLayerGenerator = new AtomicCache<>();
|
||||
@@ -86,6 +136,10 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@MaxNumber(2032)
|
||||
@Desc("Maximum height at which players can be teleported to through gameplay.")
|
||||
private int logicalHeight = 256;
|
||||
@Desc("Maximum height at which players can be teleported to through gameplay.")
|
||||
private int logicalHeightEnd = 256;
|
||||
@Desc("Maximum height at which players can be teleported to through gameplay.")
|
||||
private int logicalHeightNether = 256;
|
||||
@RegistryListResource(IrisJigsawStructure.class)
|
||||
@Desc("If defined, Iris will place the given jigsaw structure where minecraft should place the overworld stronghold.")
|
||||
private String stronghold;
|
||||
@@ -107,12 +161,8 @@ public class IrisDimension extends IrisRegistrant {
|
||||
private int strongholdJumpDistance = 1280;
|
||||
@Desc("Define the maximum strongholds to place")
|
||||
private int maxStrongholds = 14;
|
||||
@Desc("Improves the biome grid variation by shuffling the cell grid more depending on the seed. This makes biomes across multiple seeds look far different than before.")
|
||||
private boolean aggressiveBiomeReshuffle = false;
|
||||
@Desc("Tree growth override settings")
|
||||
private IrisTreeSettings treeSettings = new IrisTreeSettings();
|
||||
@Desc("Upon joining this world, Iris will send a resource pack request to the client. If they have previously selected yes, it will auto-switch depending on which dimension they go to.")
|
||||
private String resourcePack = "";
|
||||
@Desc("Spawn Entities in this dimension over time. Iris will continually replenish these mobs just like vanilla does.")
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@RegistryListResource(IrisSpawner.class)
|
||||
@@ -174,6 +224,10 @@ public class IrisDimension extends IrisRegistrant {
|
||||
private int fluidHeight = 63;
|
||||
@Desc("Define the min and max Y bounds of this dimension. Please keep in mind that Iris internally generates from 0 to (max - min). \n\nFor example at -64 to 320, Iris is internally generating to 0 to 384, then on outputting chunks, it shifts it down by the min height (64 blocks). The default is -64 to 320. \n\nThe fluid height is placed at (fluid height + min height). So a fluid height of 63 would actually show up in the world at 1.")
|
||||
private IrisRange dimensionHeight = new IrisRange(-64, 320);
|
||||
@Desc("Define the min and max Y bounds of this dimension. Please keep in mind that Iris internally generates from 0 to (max - min). \n\nFor example at -64 to 320, Iris is internally generating to 0 to 384, then on outputting chunks, it shifts it down by the min height (64 blocks). The default is -64 to 320. \n\nThe fluid height is placed at (fluid height + min height). So a fluid height of 63 would actually show up in the world at 1.")
|
||||
private IrisRange dimensionHeightEnd = new IrisRange(-64, 320);
|
||||
@Desc("Define the min and max Y bounds of this dimension. Please keep in mind that Iris internally generates from 0 to (max - min). \n\nFor example at -64 to 320, Iris is internally generating to 0 to 384, then on outputting chunks, it shifts it down by the min height (64 blocks). The default is -64 to 320. \n\nThe fluid height is placed at (fluid height + min height). So a fluid height of 63 would actually show up in the world at 1.")
|
||||
private IrisRange dimensionHeightNether = new IrisRange(-64, 320);
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("Keep this either undefined or empty. Setting any biome name into this will force iris to only generate the specified biome. Great for testing.")
|
||||
private String focus = "";
|
||||
@@ -279,7 +333,6 @@ public class IrisDimension extends IrisRegistrant {
|
||||
KList<Position2> pos = new KList<>();
|
||||
int jump = strongholdJumpDistance;
|
||||
RNG rng = new RNG((seed * 223) + 12945);
|
||||
|
||||
for (int i = 0; i < maxStrongholds + 1; i++) {
|
||||
int m = i + 1;
|
||||
pos.add(new Position2(
|
||||
@@ -416,7 +469,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
}
|
||||
|
||||
if (!dimensionHeight.equals(new IrisRange(-64, 320)) && this.name.equalsIgnoreCase("overworld")) {
|
||||
Iris.verbose(" Installing Data Pack Dimension Type: \"minecraft:overworld\"");
|
||||
Iris.verbose(" Installing Data Pack Dimension Types: \"minecraft:overworld\", \"minecraft:the_nether\", \"minecraft:the_end\"");
|
||||
changed = writeDimensionType(changed, datapacks);
|
||||
}
|
||||
|
||||
@@ -457,24 +510,63 @@ public class IrisDimension extends IrisRegistrant {
|
||||
}
|
||||
|
||||
public boolean writeDimensionType(boolean changed, File datapacks) {
|
||||
File dimType = new File(datapacks, "iris/data/minecraft/dimension_type/overworld.json");
|
||||
if (!dimType.exists())
|
||||
File dimTypeOverworld = new File(datapacks, "iris/data/minecraft/dimension_type/overworld.json");
|
||||
if (!dimTypeOverworld.exists())
|
||||
changed = true;
|
||||
dimType.getParentFile().mkdirs();
|
||||
dimTypeOverworld.getParentFile().mkdirs();
|
||||
try {
|
||||
IO.writeAll(dimType, generateDatapackJson());
|
||||
IO.writeAll(dimTypeOverworld, generateDatapackJsonOverworld());
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
File dimTypeNether = new File(datapacks, "iris/data/minecraft/dimension_type/the_nether.json");
|
||||
if (!dimTypeNether.exists())
|
||||
changed = true;
|
||||
dimTypeNether.getParentFile().mkdirs();
|
||||
try {
|
||||
IO.writeAll(dimTypeNether, generateDatapackJsonNether());
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
File dimTypeEnd = new File(datapacks, "iris/data/minecraft/dimension_type/the_end.json");
|
||||
if (!dimTypeEnd.exists())
|
||||
changed = true;
|
||||
dimTypeEnd.getParentFile().mkdirs();
|
||||
try {
|
||||
IO.writeAll(dimTypeEnd, generateDatapackJsonEnd());
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
private String generateDatapackJson() {
|
||||
private String generateDatapackJsonOverworld() {
|
||||
JSONObject obj = new JSONObject(DP_OVERWORLD_DEFAULT);
|
||||
obj.put("min_y", dimensionHeight.getMin());
|
||||
obj.put("height", dimensionHeight.getMax() - dimensionHeight.getMin());
|
||||
obj.put("logical_height", logicalHeight);
|
||||
return obj.toString(4);
|
||||
}
|
||||
private String generateDatapackJsonNether() {
|
||||
JSONObject obj = new JSONObject(DP_NETHER_DEFAULT);
|
||||
obj.put("min_y", dimensionHeightNether.getMin());
|
||||
obj.put("height", dimensionHeightNether.getMax() - dimensionHeightNether.getMin());
|
||||
obj.put("logical_height", logicalHeightNether);
|
||||
return obj.toString(4);
|
||||
}
|
||||
private String generateDatapackJsonEnd() {
|
||||
JSONObject obj = new JSONObject(DP_END_DEFAULT);
|
||||
obj.put("min_y", dimensionHeightEnd.getMin());
|
||||
obj.put("height", dimensionHeightEnd.getMax() - dimensionHeightEnd.getMin());
|
||||
obj.put("logical_height", logicalHeightEnd);
|
||||
return obj.toString(4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,6 +154,9 @@ public class IrisEntity extends IrisRegistrant {
|
||||
@Desc("Create a mob from another plugin, such as Mythic Mobs. Should be in the format of a namespace of PluginName:MobName")
|
||||
private String specialType = "";
|
||||
|
||||
@Desc("Set to true if you want to apply all of the settings here to the mob, even though an external plugin has already done so. Scripts are always applied.")
|
||||
private boolean applySettingsToCustomMobAnyways = false;
|
||||
|
||||
@Desc("Set the entity type to UNKNOWN, then define a script here which ends with the entity variable (the result). You can use Iris.getLocation() to find the target location. You can spawn any entity this way.")
|
||||
@RegistryListResource(IrisScript.class)
|
||||
private String spawnerScript = "";
|
||||
@@ -211,6 +214,10 @@ public class IrisEntity extends IrisRegistrant {
|
||||
}
|
||||
}
|
||||
|
||||
if (isSpecialType() && !applySettingsToCustomMobAnyways) {
|
||||
return ee;
|
||||
}
|
||||
|
||||
if (ee == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Snippet("carving")
|
||||
@Snippet("image-map")
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@@ -68,6 +68,7 @@ public class IrisImageMap {
|
||||
IrisImage i = imageCache.aquire(() -> data.getImageLoader().load(image));
|
||||
if (i == null) {
|
||||
Iris.error("NULL IMAGE FOR " + image);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return IrisInterpolation.getNoise(interpolationMethod, x, z, coordinateScale, (xx, zz) -> rawNoise(i, xx, zz));
|
||||
@@ -76,11 +77,27 @@ public class IrisImageMap {
|
||||
private double rawNoise(IrisImage i, double x, double z) {
|
||||
x /= coordinateScale;
|
||||
z /= coordinateScale;
|
||||
x = isCentered() ? x + ((i.getWidth() / 2D) * coordinateScale) : x;
|
||||
z = isCentered() ? z + ((i.getHeight() / 2D) * coordinateScale) : z;
|
||||
x = isTiled() ? x % i.getWidth() : x;
|
||||
z = isTiled() ? z % i.getHeight() : z;
|
||||
|
||||
// X and Z are now scaled to the image
|
||||
|
||||
// Add half the image width & height if centered
|
||||
if (isCentered()) {
|
||||
x += i.getWidth() / 2D;
|
||||
z += i.getHeight() / 2D;
|
||||
}
|
||||
|
||||
// If tiled modulo over width and height
|
||||
if (isTiled()) {
|
||||
x = x % i.getWidth();
|
||||
x = x < 0 ? x + i.getWidth() : x; // Fix java's negative modulo shit
|
||||
z = z % i.getHeight();
|
||||
z = z < 0 ? z + i.getHeight() : z; // Fix java's negative modulo shit
|
||||
}
|
||||
|
||||
// Retrieve value from image
|
||||
double v = i.getValue(getChannel(), (int) x, (int) z);
|
||||
|
||||
// Return value, or 1 - value if inverted (value is in double set [0, 1] so this will return [0, 1])
|
||||
return isInverted() ? 1D - v : v;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,16 +30,14 @@ import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.util.format.Form;
|
||||
import com.volmit.iris.util.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.util.json.JSONObject;
|
||||
import com.volmit.iris.util.math.AxisAlignedBB;
|
||||
import com.volmit.iris.util.math.BlockPosition;
|
||||
import com.volmit.iris.util.math.Position2;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.math.*;
|
||||
import com.volmit.iris.util.matter.MatterMarker;
|
||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
import com.volmit.iris.util.plugin.VolmitSender;
|
||||
import com.volmit.iris.util.scheduling.IrisLock;
|
||||
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
||||
import com.volmit.iris.util.stream.ProceduralStream;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -496,6 +494,30 @@ public class IrisObject extends IrisRegistrant {
|
||||
public int place(int x, int yv, int z, IObjectPlacer oplacer, IrisObjectPlacement config, RNG rng, BiConsumer<BlockPosition, BlockData> listener, CarveResult c, IrisData rdata) {
|
||||
IObjectPlacer placer = (config.getHeightmap() != null) ? new HeightmapObjectPlacer(oplacer.getEngine() == null ? IrisContext.get().getEngine() : oplacer.getEngine(), rng, x, yv, z, config, oplacer) : oplacer;
|
||||
|
||||
// Rotation calculation
|
||||
int slopeRotationY = 0;
|
||||
ProceduralStream<Double> heightStream = rdata.getEngine().getComplex().getHeightStream();
|
||||
if (config.isRotateTowardsSlope()) {
|
||||
// Whichever side of the rectangle that bounds the object is lowest is the 'direction' of the slope (simply said).
|
||||
double hNorth = heightStream.get(x, z + ((float)d) / 2);
|
||||
double hEast = heightStream.get(x + ((float)w) / 2, z);
|
||||
double hSouth = heightStream.get(x, z - ((float)d) / 2);
|
||||
double hWest = heightStream.get(x - ((float)w) / 2, z);
|
||||
double min = Math.min(Math.min(hNorth, hEast), Math.min(hSouth, hWest));
|
||||
if (min == hNorth) {
|
||||
slopeRotationY = 0;
|
||||
} else if (min == hEast) {
|
||||
slopeRotationY = 90;
|
||||
} else if (min == hSouth) {
|
||||
slopeRotationY = 180;
|
||||
} else if (min == hWest) {
|
||||
slopeRotationY = 270;
|
||||
}
|
||||
}
|
||||
double newRotation = config.getRotation().getYAxis().getMin() + slopeRotationY;
|
||||
config.getRotation().setYAxis(new IrisAxisRotationClamp(true, false, newRotation, newRotation, 360));
|
||||
config.getRotation().setEnabled(true);
|
||||
|
||||
if (config.isSmartBore()) {
|
||||
ensureSmartBored(placer.isDebugSmartBore());
|
||||
}
|
||||
|
||||
@@ -62,6 +62,9 @@ public class IrisObjectPlacement {
|
||||
private double snow = 0;
|
||||
@Desc("Whether or not this object can be targeted by a dolphin.")
|
||||
private boolean isDolphinTarget = false;
|
||||
@Desc("Set to true to add the rotation of the direction of the slope of the terrain (wherever the slope is going down) to the y-axis rotation of the object." +
|
||||
"Rounded to 90 degrees. Adds the *min* rotation of the y axis as well (to still allow you to rotate objects nicely). Discards *max* and *interval* on *yaxis*")
|
||||
private boolean rotateTowardsSlope = false;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("The chance for this to place in a chunk. If you need multiple per chunk, set this to 1 and use density.")
|
||||
|
||||
@@ -23,10 +23,7 @@ import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.collection.KSet;
|
||||
import com.volmit.iris.util.decree.DecreeContext;
|
||||
import com.volmit.iris.util.decree.DecreeContextHandler;
|
||||
import com.volmit.iris.util.decree.DecreeNode;
|
||||
import com.volmit.iris.util.decree.DecreeParameter;
|
||||
import com.volmit.iris.util.decree.*;
|
||||
import com.volmit.iris.util.decree.annotations.Decree;
|
||||
import com.volmit.iris.util.decree.exceptions.DecreeParsingException;
|
||||
import com.volmit.iris.util.format.C;
|
||||
@@ -381,6 +378,12 @@ public class VirtualDecreeCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
DecreeOrigin origin = type.getDeclaredAnnotation(Decree.class).origin();
|
||||
if (origin.validFor(sender)) {
|
||||
sender.sendMessage(C.RED + "This command has to be sent from another origin: " + C.GOLD + origin);
|
||||
return false;
|
||||
}
|
||||
|
||||
Iris.debug("@ " + getPath() + " with " + args.toString(", "));
|
||||
if (isNode()) {
|
||||
Iris.debug("Invoke " + getPath() + "(" + args.toString(",") + ") at ");
|
||||
|
||||
Reference in New Issue
Block a user