mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-07-23 07:10:51 +00:00
laDEDA
This commit is contained in:
@@ -90,12 +90,21 @@ public class DataFixerV1217 extends DataFixerV1213 {
|
||||
@Override
|
||||
public JSONObject fixCustomBiome(IrisBiomeCustom biome, JSONObject json) {
|
||||
json = super.fixCustomBiome(biome, json);
|
||||
var effects = json.getJSONObject("effects");
|
||||
var attributes = new JSONObject();
|
||||
JSONObject effects = json.getJSONObject("effects");
|
||||
JSONObject attributes = new JSONObject();
|
||||
|
||||
attributes.put("minecraft:visual/fog_color", effects.remove("fog_color"));
|
||||
attributes.put("minecraft:visual/sky_color", effects.remove("sky_color"));
|
||||
attributes.put("minecraft:visual/water_color", effects.remove("water_color"));
|
||||
attributes.put("minecraft:visual/water_fog_color", effects.remove("water_fog_color"));
|
||||
Object grassColor = effects.remove("grass_color");
|
||||
if (grassColor != null) {
|
||||
attributes.put("minecraft:visual/grass_color", grassColor);
|
||||
}
|
||||
Object foliageColor = effects.remove("foliage_color");
|
||||
if (foliageColor != null) {
|
||||
attributes.put("minecraft:visual/foliage_color", foliageColor);
|
||||
}
|
||||
|
||||
JSONObject particle = (JSONObject) effects.remove("particle");
|
||||
if (particle != null) {
|
||||
@@ -112,7 +121,7 @@ public class DataFixerV1217 extends DataFixerV1213 {
|
||||
public void fixDimension(Dimension dimension, JSONObject json) {
|
||||
super.fixDimension(dimension, json);
|
||||
|
||||
var attributes = new JSONObject();
|
||||
JSONObject attributes = new JSONObject();
|
||||
if ((Boolean) json.remove("ultrawarm")) {
|
||||
attributes.put("minecraft:gameplay/water_evaporates", true);
|
||||
attributes.put("minecraft:gameplay/fast_lava", true);
|
||||
@@ -138,8 +147,10 @@ public class DataFixerV1217 extends DataFixerV1213 {
|
||||
attributes.put("minecraft:gameplay/piglins_zombify", !(Boolean) json.remove("piglin_safe"));
|
||||
attributes.put("minecraft:gameplay/can_start_raid", json.remove("has_raids"));
|
||||
|
||||
var cloud_height = json.remove("cloud_height");
|
||||
if (cloud_height != null) attributes.put("minecraft:visual/cloud_height", cloud_height);
|
||||
Object cloudHeight = json.remove("cloud_height");
|
||||
if (cloudHeight != null) {
|
||||
attributes.put("minecraft:visual/cloud_height", cloudHeight);
|
||||
}
|
||||
|
||||
boolean natural = (Boolean) json.remove("natural");
|
||||
attributes.put("minecraft:gameplay/nether_portal_spawns_piglin", natural);
|
||||
@@ -152,7 +163,7 @@ public class DataFixerV1217 extends DataFixerV1213 {
|
||||
json.put("attributes", attributes);
|
||||
|
||||
json.remove("effects");
|
||||
var defaults = new JSONObject(DIMENSIONS.get(dimension));
|
||||
JSONObject defaults = new JSONObject(DIMENSIONS.get(dimension));
|
||||
merge(json, defaults);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.EngineAssignedActuator;
|
||||
import art.arcane.iris.engine.object.IrisBiome;
|
||||
import art.arcane.iris.engine.object.IrisBiomeCustom;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBiome;
|
||||
import art.arcane.iris.util.project.context.ChunkContext;
|
||||
import art.arcane.volmlib.util.documentation.BlockCoordinates;
|
||||
import art.arcane.iris.util.project.hunk.Hunk;
|
||||
@@ -53,15 +54,27 @@ public class IrisBiomeActuator extends EngineAssignedActuator<PlatformBiome> {
|
||||
for (int zf = 0; zf < h.getDepth(); zf++) {
|
||||
ib = context.getBiome().get(xf, zf);
|
||||
MatterBiomeInject matter;
|
||||
PlatformBiome biome;
|
||||
|
||||
if (ib.isCustom()) {
|
||||
IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z);
|
||||
matter = BiomeInjectMatter.get(IrisPlatforms.get().biomeWriter().biomeIdFor(getDimension().getLoadKey() + ":" + custom.getId()));
|
||||
String key = getDimension().getLoadKey() + ":" + custom.getId();
|
||||
biome = IrisPlatforms.get().registries().biome(key);
|
||||
matter = BiomeInjectMatter.get(IrisPlatforms.get().biomeWriter().biomeIdFor(key));
|
||||
} else {
|
||||
Biome v = ib.getSkyBiome(rng, x, 0, z);
|
||||
PlatformBiome fallback = BukkitBiome.of(v);
|
||||
PlatformBiome resolved = IrisPlatforms.get().registries().biome(fallback.key());
|
||||
biome = resolved == null ? fallback : resolved;
|
||||
matter = BiomeInjectMatter.get(v);
|
||||
}
|
||||
|
||||
if (biome != null) {
|
||||
for (int yf = 0; yf < h.getHeight(); yf++) {
|
||||
h.set(xf, yf, zf, biome);
|
||||
}
|
||||
}
|
||||
|
||||
getEngine().getMantle().getMantle().set(x + xf, 0, z + zf, matter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class IrisBiomeCustom {
|
||||
private int parseColor(String c) {
|
||||
String v = (c.startsWith("#") ? c : "#" + c).trim();
|
||||
try {
|
||||
return Color.decode(v).getRGB();
|
||||
return Color.decode(v).getRGB() & 0x00FFFFFF;
|
||||
} catch (Throwable e) {
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Error Parsing '''color''', (" + c + ")");
|
||||
|
||||
Reference in New Issue
Block a user