diff --git a/Common/src/main/java/at/petrak/hexcasting/api/addldata/ADHexHolder.java b/Common/src/main/java/at/petrak/hexcasting/api/addldata/ADHexHolder.java index 15defd673b..1363b721c6 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/addldata/ADHexHolder.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/addldata/ADHexHolder.java @@ -16,7 +16,7 @@ public interface ADHexHolder { @Nullable List getHex(ServerLevel level); - void writeHex(List patterns, @Nullable FrozenPigment pigment, long media); + void writeHex(List patterns, FrozenPigment pigment, long media); void clearHex(); diff --git a/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/CastingEnvironment.java b/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/CastingEnvironment.java index c47b742c62..f7da049cef 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/CastingEnvironment.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/CastingEnvironment.java @@ -622,7 +622,7 @@ public enum StackDiscoveryMode { public abstract FrozenPigment getPigment(); - public abstract @Nullable FrozenPigment setPigment(@Nullable FrozenPigment pigment); + public abstract FrozenPigment setPigment(FrozenPigment pigment); public abstract void produceParticles(ParticleSpray particles, FrozenPigment colorizer); diff --git a/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/CircleCastEnv.java b/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/CircleCastEnv.java index 6c6b363928..020002c00f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/CircleCastEnv.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/CircleCastEnv.java @@ -200,7 +200,7 @@ public FrozenPigment getPigment() { } @Override - public @Nullable FrozenPigment setPigment(@Nullable FrozenPigment pigment) { + public FrozenPigment setPigment(FrozenPigment pigment) { var impetus = this.getImpetus(); if (impetus == null) return null; diff --git a/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/PlayerBasedCastEnv.java b/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/PlayerBasedCastEnv.java index d6a82de01a..f4da434a7a 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/PlayerBasedCastEnv.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/casting/eval/env/PlayerBasedCastEnv.java @@ -201,7 +201,7 @@ protected boolean canOvercast() { } @Override - public @Nullable FrozenPigment setPigment(@Nullable FrozenPigment pigment) { + public FrozenPigment setPigment(FrozenPigment pigment) { return IXplatAbstractions.INSTANCE.setPigment(caster, pigment); } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/item/HexHolderItem.java b/Common/src/main/java/at/petrak/hexcasting/api/item/HexHolderItem.java index a27ef900f1..907bfe058d 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/item/HexHolderItem.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/item/HexHolderItem.java @@ -25,7 +25,7 @@ public interface HexHolderItem extends MediaHolderItem { @Nullable List getHex(ItemStack stack, ServerLevel level); - void writeHex(ItemStack stack, List program, @Nullable FrozenPigment pigment, long media); + void writeHex(ItemStack stack, List program, FrozenPigment pigment, long media); void clearHex(ItemStack stack); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemAncientCypher.java b/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemAncientCypher.java index bcc242ddae..d1f6c44f90 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemAncientCypher.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemAncientCypher.java @@ -9,8 +9,6 @@ import java.util.List; public class ItemAncientCypher extends ItemCypher { - public static final String TAG_HEX_NAME = "hex_name"; - public ItemAncientCypher(Properties pProperties) { super(pProperties); } @@ -37,13 +35,12 @@ public void appendHoverText(ItemStack stack, TooltipContext context, List getHex(ItemStack stack, ServerLevel level) { - return stack.get(HexDataComponents.HEX_HOLDER_PATTERNS.get()); + var hexHolder = stack.get(HexDataComponents.HEX_HOLDER.get()); + return (hexHolder != null) ? hexHolder.hex() : null; } @Override - public void writeHex(ItemStack stack, List program, @Nullable FrozenPigment pigment, long media) { - stack.set(HexDataComponents.HEX_HOLDER_PATTERNS.get(), program); - if (pigment != null) - stack.set(HexDataComponents.PIGMENT.get(), pigment); - + public void writeHex(ItemStack stack, List program, FrozenPigment pigment, long media) { + stack.set(HexDataComponents.HEX_HOLDER.get(), new HexHolder(program, pigment)); withMedia(stack, media, media); } @Override public void clearHex(ItemStack stack) { - stack.remove(HexDataComponents.HEX_HOLDER_PATTERNS.get()); - stack.remove(HexDataComponents.PIGMENT.get()); + stack.remove(HexDataComponents.HEX_HOLDER.get()); stack.remove(HexDataComponents.MEDIA.get()); stack.remove(HexDataComponents.MEDIA_MAX.get()); } @Override public @Nullable FrozenPigment getPigment(ItemStack stack) { - return stack.get(HexDataComponents.PIGMENT.get()); + var hexHolder = stack.get(HexDataComponents.HEX_HOLDER.get()); + return (hexHolder != null) ? hexHolder.pigment() : null; } @Override @@ -147,4 +147,18 @@ public InteractionResultHolder use(Level world, Player player, Intera public UseAnim getUseAnimation(ItemStack pStack) { return UseAnim.BLOCK; } + + public record HexHolder(@NotNull List hex, @NotNull FrozenPigment pigment) { + public static final Codec CODEC = RecordCodecBuilder.create(inst -> + inst.group( + IotaType.TYPED_CODEC.listOf().fieldOf("hex").forGetter(HexHolder::hex), + FrozenPigment.CODEC.fieldOf("pigment").forGetter(HexHolder::pigment) + ).apply(inst, HexHolder::new) + ); + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + IotaType.TYPED_STREAM_CODEC.apply(ByteBufCodecs.list()), HexHolder::hex, + FrozenPigment.STREAM_CODEC, HexHolder::pigment, + HexHolder::new + ); + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemScroll.java b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemScroll.java index 7da53d57d1..f7e87c2621 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemScroll.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemScroll.java @@ -10,6 +10,7 @@ import at.petrak.hexcasting.common.lib.HexDataComponents; import at.petrak.hexcasting.common.misc.PatternTooltip; import at.petrak.hexcasting.interop.inline.InlinePatternData; +import at.petrak.hexcasting.xplat.IXplatAbstractions; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -36,11 +37,11 @@ import static at.petrak.hexcasting.api.HexAPI.modLoc; /** - * TAG_OP_ID and TAG_PATTERN: "Ancient Scroll of %s" (per-world pattern preloaded) + * ACTION and PATTERN components: "Ancient Scroll of %s" (per-world pattern preloaded) *
- * TAG_OP_ID: "Ancient Scroll of %s" (per-world pattern loaded on inv tick) + * Only ACTION component: "Ancient Scroll of %s" (per-world pattern loaded on inv tick) *
- * TAG_PATTERN: "Scroll" (custom) + * Only PATTERN component: "Scroll" (custom) *
* (none): "Empty Scroll" */ @@ -146,21 +147,21 @@ public Component getName(ItemStack pStack) { @Override public void inventoryTick(ItemStack pStack, Level pLevel, Entity pEntity, int pSlotId, boolean pIsSelected) { - // the needs_purchase tag is used so you can't see the pattern on scrolls sold by a wandering trader - // once you put the scroll into your inventory, this removes the tag to reveal the pattern + // the NEEDS_PURCHASE component is used so you can't see the pattern on scrolls sold by a wandering trader + // once you put the scroll into your inventory, this removes the component to reveal the pattern if(pStack.has(HexDataComponents.NEEDS_PURCHASE.get())) pStack.remove(HexDataComponents.NEEDS_PURCHASE.get()); - // if op_id is set but there's no stored pattern, attempt to load the pattern on inv tick + // if ACTION is present but PATTERN is not present, attempt to load the pattern on inv tick if (pStack.has(HexDataComponents.ACTION.get()) && !pStack.has(HexDataComponents.PATTERN.get()) && pEntity.getServer() != null) { var action = pStack.get(HexDataComponents.ACTION.get()); - if (action == null) { - // if the provided op_id is invalid, remove it so we don't keep trying every tick + if (!IXplatAbstractions.INSTANCE.getActionRegistry().containsKey(action)) { + // if the specified Action doesn't actually exist, remove the component so we don't keep trying every tick pStack.remove(HexDataComponents.ACTION.get()); return; } var pat = PatternRegistryManifest.getCanonicalStrokesPerWorld(action, pEntity.getServer().overworld()); if (pat == null) { - // if pat is null, the per-world order hasn't been registered; remove the op_id and warn the player + // if pat is null, the per-world order hasn't been registered; remove the ACTION component and warn the player pStack.set(HexDataComponents.RECALC_WARNING.get(), action); pStack.remove(HexDataComponents.ACTION.get()); return; @@ -175,7 +176,7 @@ public void appendHoverText(ItemStack stack, TooltipContext context, List(savedNames); mutNames.put(nameKey, customName); stack.set(HexDataComponents.SPELLBOOK_PAGE_NAMES.get(), mutNames); @@ -99,9 +101,11 @@ public void inventoryTick(ItemStack stack, Level level, Entity pEntity, int pSlo } else { var mutNames = new HashMap(); mutNames.put(nameKey, customName); + // if the savedNames map doesn't exist at all, create it and map the stack's current name to this page stack.set(HexDataComponents.SPELLBOOK_PAGE_NAMES.get(), mutNames); } } else if(savedNames != null) { + // the stack does not have a custom name, or it has been removed var mutNames = new HashMap<>(savedNames); mutNames.remove(nameKey); if(mutNames.isEmpty()) { @@ -151,10 +155,12 @@ public void writeDatum(ItemStack stack, Iota datum) { var pages = stack.get(HexDataComponents.SPELLBOOK_PAGES.get()); if (pages != null) { + // if the pages map exists, modify it accordingly var pagesMut = new HashMap<>(pages); if (datum == null) { pagesMut.remove(key); + // erasing the current page (needs to unseal as well, if possible) var seals = stack.get(HexDataComponents.SPELLBOOK_PAGE_SEALS.get()); if(seals != null) { var sealsMut = new HashMap<>(seals); @@ -169,6 +175,7 @@ public void writeDatum(ItemStack stack, Iota datum) { } } else { pagesMut.put(key, datum); + // updating the current page } if (pagesMut.isEmpty()) { @@ -179,8 +186,11 @@ public void writeDatum(ItemStack stack, Iota datum) { } else if (datum != null) { var map = new HashMap(); map.put(key, datum); + // if the pages map doesn't exist and you're trying to update a page, create the map first stack.set(HexDataComponents.SPELLBOOK_PAGES.get(), map); } else { + // if the pages map doesn't exist and you're trying to erase a page, check for a seal to remove + // this can happen if somebody seals an empty book for some reason var seals = stack.get(HexDataComponents.SPELLBOOK_PAGE_SEALS.get()); if(seals != null) { var sealsMut = new HashMap<>(seals); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexDataComponents.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexDataComponents.java index f09596afae..6f816b6984 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexDataComponents.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexDataComponents.java @@ -4,7 +4,7 @@ import at.petrak.hexcasting.api.casting.iota.Iota; import at.petrak.hexcasting.api.casting.iota.IotaType; import at.petrak.hexcasting.api.casting.math.HexPattern; -import at.petrak.hexcasting.api.pigment.FrozenPigment; +import at.petrak.hexcasting.common.items.magic.ItemPackagedHex.HexHolder; import at.petrak.hexcasting.xplat.IXplatAbstractions; import at.petrak.hexcasting.xplat.IXplatRegister; import com.mojang.serialization.Codec; @@ -27,6 +27,8 @@ public static void register() { REGISTER.registerAll(); } + // ==== SCROLLS ==== + public static final Supplier> PATTERN = REGISTER.register("pattern", () -> DataComponentType.builder() .persistent(HexPattern.CODEC) @@ -46,38 +48,49 @@ public static void register() { DataComponentType.builder() .networkSynchronized(StreamCodec.unit(Unit.INSTANCE)) .build()); - /** - * If this datacomponent is set on the item, we ignore the rest of the item and render this as if it were of the - * {@link at.petrak.hexcasting.api.casting.iota.IotaType IotaType} given by the resource location. - *

- * This is not useful to the player at all. - */ - public static final Supplier>>> VISUAL_OVERRIDE = REGISTER.register("visual_override", () -> - DataComponentType.>>builder() - .networkSynchronized(ByteBufCodecs.optional(ByteBufCodecs.registry(HexRegistries.IOTA_TYPE))) - .build()); + + // ==== ANYTHING WITH TEXTURE VARIANTS ==== + public static final Supplier> ITEM_VARIANT = REGISTER.register("variant", () -> DataComponentType.builder() .persistent(Codec.intRange(0, Integer.MAX_VALUE)) .networkSynchronized(ByteBufCodecs.VAR_INT) .build()); + + // ==== IOTA HOLDERS ==== + public static final Supplier> SEALED_IOTA_HOLDER = REGISTER.register("sealed", () -> DataComponentType.builder() .persistent(Codec.unit(Unit.INSTANCE)) .networkSynchronized(StreamCodec.unit(Unit.INSTANCE)) .build()); - // TODO port: Data components must implement equals and hashCode. Keep in mind they must also be immutable + // TODO port: Data components are supposed to be immutable - is EntityIota.isPlayer a problem here? public static final Supplier> IOTA_HOLDER_IOTA = REGISTER.register("iota", () -> DataComponentType.builder() .persistent(IotaType.TYPED_CODEC) .networkSynchronized(IotaType.TYPED_STREAM_CODEC) .build()); + /** + * If this datacomponent is set on the item, we ignore the rest of the item and render this as if it were of the + * {@link at.petrak.hexcasting.api.casting.iota.IotaType IotaType} given by the resource location. + *

+ * This is not useful to the player at all. + */ + public static final Supplier>>> VISUAL_OVERRIDE = REGISTER.register("visual_override", () -> + DataComponentType.>>builder() + .networkSynchronized(ByteBufCodecs.optional(ByteBufCodecs.registry(HexRegistries.IOTA_TYPE))) + .build()); + + // ==== CASTING ITEMS ==== - public static final Supplier>> HEX_HOLDER_PATTERNS = REGISTER.register("patterns", () -> - DataComponentType.>builder() - .persistent(IotaType.TYPED_CODEC.listOf()) - .networkSynchronized(IotaType.TYPED_STREAM_CODEC.apply(ByteBufCodecs.list())) + public static final Supplier> HEX_HOLDER = REGISTER.register("hex_holder", () -> + DataComponentType.builder() + .persistent(HexHolder.CODEC) + .networkSynchronized(HexHolder.STREAM_CODEC) .build()); + + // ==== CASTING ITEMS & PHIALS ==== + public static final Supplier> MEDIA = REGISTER.register("media", () -> DataComponentType.builder() .persistent(Codec.LONG) @@ -88,17 +101,16 @@ public static void register() { .persistent(Codec.LONG) .networkSynchronized(ByteBufCodecs.VAR_LONG) .build()); + + // ==== ANCIENT CYPHERS ==== + public static final Supplier> HEX_NAME = REGISTER.register("hex_name", () -> DataComponentType.builder() .persistent(Codec.STRING) .networkSynchronized(ByteBufCodecs.STRING_UTF8) .build()); - public static final Supplier> PIGMENT = REGISTER.register("pigment", () -> - DataComponentType.builder() - .persistent(FrozenPigment.CODEC) - .networkSynchronized(FrozenPigment.STREAM_CODEC) - .build()); + // ==== ABACUS ==== public static final Supplier> ABACUS_VALUE = REGISTER.register("abacus_value", () -> DataComponentType.builder() @@ -106,6 +118,8 @@ public static void register() { .networkSynchronized(ByteBufCodecs.DOUBLE) .build()); + // ==== SPELLBOOKS ==== + public static final Supplier> SELECTED_SPELLBOOK_PAGE = REGISTER.register("page_idx", () -> DataComponentType.builder() .persistent(Codec.INT) @@ -142,6 +156,8 @@ public static void register() { )) .build()); + // ==== MEDIA CUBE ==== + public static final Supplier>> MEDIA_EXTRACTIONS = REGISTER.register("media_extractions", () -> DataComponentType.>builder() .persistent(Codec.LONG.listOf()) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/loot/AddHexToAncientCypherFunc.java b/Common/src/main/java/at/petrak/hexcasting/common/loot/AddHexToAncientCypherFunc.java index f922ead847..7c74529419 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/loot/AddHexToAncientCypherFunc.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/loot/AddHexToAncientCypherFunc.java @@ -1,9 +1,12 @@ package at.petrak.hexcasting.common.loot; +import at.petrak.hexcasting.api.casting.iota.Iota; import at.petrak.hexcasting.api.casting.iota.PatternIota; import at.petrak.hexcasting.api.casting.math.HexDir; import at.petrak.hexcasting.api.casting.math.HexPattern; import at.petrak.hexcasting.api.misc.MediaConstants; +import at.petrak.hexcasting.api.pigment.FrozenPigment; +import at.petrak.hexcasting.common.items.magic.ItemPackagedHex.HexHolder; import at.petrak.hexcasting.common.lib.HexDataComponents; import at.petrak.hexcasting.common.lib.HexLootFunctions; import com.mojang.datafixers.util.Pair; @@ -40,16 +43,17 @@ public AddHexToAncientCypherFunc(List lootItemConditions) { * This doesn't actually have any params so extract behaviour out for the benefit of forge */ public static ItemStack doStatic(ItemStack stack, RandomSource rand) { - var hex = LOOT_HEXES.get(rand.nextInt(LOOT_HEXES.size())); + var hexAndName = LOOT_HEXES.get(rand.nextInt(LOOT_HEXES.size())); + var hex = Arrays.stream(hexAndName.getSecond()).map(stringifiedPat -> { + var pieces = stringifiedPat.split(" "); + return (Iota) new PatternIota(HexPattern.fromAngles(pieces[1],HexDir.fromString(pieces[0]))); + }).toList(); - stack.set(HexDataComponents.HEX_NAME.get(), hex.getFirst()); + stack.set(HexDataComponents.HEX_NAME.get(), hexAndName.getFirst()); stack.set(HexDataComponents.MEDIA.get(), 32 * MediaConstants.SHARD_UNIT); stack.set(HexDataComponents.MEDIA_MAX.get(), 32 * MediaConstants.SHARD_UNIT); stack.set(HexDataComponents.ITEM_VARIANT.get(), rand.nextInt(8)); - stack.set(HexDataComponents.HEX_HOLDER_PATTERNS.get(), Arrays.stream(hex.getSecond()).map(el -> { - var pieces = el.split(" "); - return new PatternIota(HexPattern.fromAngles(pieces[1],HexDir.fromString(pieces[0]))); - }).collect(Collectors.toList())); + stack.set(HexDataComponents.HEX_HOLDER.get(), new HexHolder(hex, FrozenPigment.ANCIENT.get())); return stack; } diff --git a/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatAbstractions.java b/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatAbstractions.java index 125479390d..84231c0292 100644 --- a/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatAbstractions.java +++ b/Common/src/main/java/at/petrak/hexcasting/xplat/IXplatAbstractions.java @@ -90,7 +90,7 @@ public interface IXplatAbstractions { boolean isBrainswept(Mob mob); - @Nullable FrozenPigment setPigment(Player target, @Nullable FrozenPigment colorizer); + FrozenPigment setPigment(Player target, FrozenPigment colorizer); void setSentinel(Player target, @Nullable Sentinel sentinel); diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/cc/HexCardinalComponents.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/cc/HexCardinalComponents.java index b60bc9a1c6..939de31e58 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/cc/HexCardinalComponents.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/cc/HexCardinalComponents.java @@ -88,9 +88,11 @@ public void registerEntityComponentFactories(EntityComponentFactoryRegistry regi wrapItemEntityDelegate(ItemDelegatingEntityIotaHolder.ToWallScroll::new)); } + // I'm disabling this stuff rather than changing it to fit the merged components, + // because it doesn't seem to work anyway (tested fabric 1.20 -> 1.21, nothing got migrated) @Override public void registerItemComponentMigrations(ItemComponentMigrationRegistry registry) { - registry.registerMigration(modLoc("pigment"), HexDataComponents.PIGMENT.get()); + //registry.registerMigration(modLoc("pigment"), HexDataComponents.PIGMENT.get()); registry.registerMigration(modLoc("iota_holder"), HexDataComponents.IOTA_HOLDER_IOTA.get()); // oh havoc, you think you're so funny @@ -98,7 +100,7 @@ public void registerItemComponentMigrations(ItemComponentMigrationRegistry regis registry.registerMigration(modLoc("media_holder"), HexDataComponents.MEDIA.get()); - registry.registerMigration(modLoc("hex_holder"), HexDataComponents.HEX_HOLDER_PATTERNS.get()); + //registry.registerMigration(modLoc("hex_holder"), HexDataComponents.HEX_HOLDER_PATTERNS.get()); registry.registerMigration(modLoc("variant_item"), HexDataComponents.ITEM_VARIANT.get()); } diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/cc/adimpl/CCHexHolder.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/cc/adimpl/CCHexHolder.java index d155ed9446..c019ab7901 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/cc/adimpl/CCHexHolder.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/cc/adimpl/CCHexHolder.java @@ -48,7 +48,7 @@ public boolean hasHex() { } @Override - public void writeHex(List patterns, @Nullable FrozenPigment pigment, long media) { + public void writeHex(List patterns, FrozenPigment pigment, long media) { this.hexHolder.writeHex(this.stack, patterns, pigment, media); } @@ -58,7 +58,7 @@ public void clearHex() { } @Override - public @Nullable FrozenPigment getPigment() { + public FrozenPigment getPigment() { return this.hexHolder.getPigment(this.stack); } diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricXplatImpl.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricXplatImpl.java index fbad939683..38f49e7e92 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricXplatImpl.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/xplat/FabricXplatImpl.java @@ -154,7 +154,7 @@ public void setBrainsweepAddlData(Mob mob) { } @Override - public @Nullable FrozenPigment setPigment(Player target, @Nullable FrozenPigment pigment) { + public FrozenPigment setPigment(Player target, FrozenPigment pigment) { var cc = HexCardinalComponents.FAVORED_PIGMENT.get(target); var old = cc.getPigment(); cc.setPigment(pigment); diff --git a/Neoforge/src/main/java/at/petrak/hexcasting/forge/cap/adimpl/CapItemHexHolder.java b/Neoforge/src/main/java/at/petrak/hexcasting/forge/cap/adimpl/CapItemHexHolder.java index 5e246d01f9..c9b1da1182 100644 --- a/Neoforge/src/main/java/at/petrak/hexcasting/forge/cap/adimpl/CapItemHexHolder.java +++ b/Neoforge/src/main/java/at/petrak/hexcasting/forge/cap/adimpl/CapItemHexHolder.java @@ -29,7 +29,7 @@ public boolean hasHex() { } @Override - public void writeHex(List patterns, @Nullable FrozenPigment pigment, long media) { + public void writeHex(List patterns, FrozenPigment pigment, long media) { holder.writeHex(stack, patterns, pigment, media); } diff --git a/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeXplatImpl.java b/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeXplatImpl.java index 65d77b6329..a270d6466d 100644 --- a/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeXplatImpl.java +++ b/Neoforge/src/main/java/at/petrak/hexcasting/forge/xplat/ForgeXplatImpl.java @@ -187,7 +187,7 @@ public void setAltiora(Player player, @Nullable AltioraAbility altiora) { } @Override - public @Nullable FrozenPigment setPigment(Player player, @Nullable FrozenPigment pigment) { + public FrozenPigment setPigment(Player player, FrozenPigment pigment) { var old = getPigment(player); CompoundTag tag = player.getPersistentData();