mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 00:34:19 +00:00
Type platform keys and fold pack references into @Ref(kind)
Batch 6, findings 41 and 42. - Platform keys travel as ResourceId: enchantments, attributes, sounds, particles, potions, loot tables, sapling species, marker tags, upper dimension ids and jigsaw start pools. ResourceId.ofPlatformKey normalises a key a pack wrote. - Item and entity types are a ContentKey (Registered id, or Provided provider and name) instead of strings and a special-type flag. - ItemDrop groups into Look, Wear and PlatformExtras; colours are an RGB int and DyeColor, attribute operations an enum. - EntitySpec groups into Appearance, Behaviour, Company, Drops and Arrival, and carries host extensions instead of Iris-only fields. - @Ref(kind = Type.class) replaces @ResourceRef and the PACK_* references; expressions and image maps become the host kinds EXPRESSIONS and IMAGE_MAPS.
This commit is contained in:
1 parent
05f621d82d
commit
6b24e6f150
31 files changed
+620
-295
No files matched your search
@@ -6,6 +6,8 @@ import com.volmit.config.MinNumber;
|
||||
import com.volmit.config.Ref;
|
||||
import com.volmit.config.Reference;
|
||||
import com.volmit.config.Snippet;
|
||||
import com.volmit.resource.PackResources;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -37,13 +39,13 @@ public final class NoiseStyle {
|
||||
@Desc("The zoom of this style")
|
||||
private double zoom = 1;
|
||||
|
||||
@Ref(Reference.PACK_EXPRESSION)
|
||||
@Ref(kind = PackExpression.class)
|
||||
@Desc("Instead of using the style property, use a custom expression to represent this style.")
|
||||
private String expression;
|
||||
private ResourceId expression;
|
||||
|
||||
@Ref(Reference.PACK_IMAGE_MAP)
|
||||
@Ref(kind = PackImageMap.class)
|
||||
@Desc("Use an Image map instead of a generated value")
|
||||
private String imageMap;
|
||||
private ResourceId imageMap;
|
||||
|
||||
@MinNumber(0.00001)
|
||||
@Desc("The Output multiplier. Only used if parent is fracture.")
|
||||
@@ -109,13 +111,13 @@ public final class NoiseStyle {
|
||||
return zoom;
|
||||
}
|
||||
|
||||
/** The key of the pack expression that replaces the base style. */
|
||||
public Optional<String> expression() {
|
||||
/** The pack expression that replaces the base style, by the id the pack gives its key; see {@link PackResources#EXPRESSIONS}. */
|
||||
public Optional<ResourceId> expression() {
|
||||
return Optional.ofNullable(expression);
|
||||
}
|
||||
|
||||
/** The key of the pack image map that replaces the base style when there is no expression. */
|
||||
public Optional<String> imageMap() {
|
||||
/** The pack image map that replaces the base style when there is no expression; see {@link PackResources#IMAGE_MAPS}. */
|
||||
public Optional<ResourceId> imageMap() {
|
||||
return Optional.ofNullable(imageMap);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.volmit.noise;
|
||||
|
||||
import com.volmit.resource.ResourceId;
|
||||
import java.util.Objects;
|
||||
|
||||
/** An expression of the loaded pack, which a {@link NoiseStyle} can use instead of a base style. The host compiles it
|
||||
* and builds its noise ({@link NoiseFactory}); a module only names it, and can see that the pack has it through
|
||||
* {@code PackResources.find(PackResources.EXPRESSIONS, id)}.
|
||||
*/
|
||||
public record PackExpression(ResourceId id) {
|
||||
public PackExpression {
|
||||
Objects.requireNonNull(id, "id");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.volmit.noise;
|
||||
|
||||
import com.volmit.resource.ResourceId;
|
||||
import java.util.Objects;
|
||||
|
||||
/** An image map of the loaded pack, which a {@link NoiseStyle} can use instead of a base style. The host reads the
|
||||
* image and builds its noise ({@link NoiseFactory}); a module only names it, and can see that the pack has it through
|
||||
* {@code PackResources.find(PackResources.IMAGE_MAPS, id)}.
|
||||
*/
|
||||
public record PackImageMap(ResourceId id) {
|
||||
public PackImageMap {
|
||||
Objects.requireNonNull(id, "id");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user