diff --git a/Common/src/generated/resources/assets/hexcasting/models/item/ancient_colorizer.json b/Common/src/generated/resources/assets/hexcasting/models/item/ancient_colorizer.json new file mode 100644 index 0000000000..8e99cad0e1 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/item/ancient_colorizer.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "hexcasting:item/colorizer/ancient" + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/item/default_colorizer.json b/Common/src/generated/resources/assets/hexcasting/models/item/default_colorizer.json index 0b76dd8f8f..9041330dd9 100644 --- a/Common/src/generated/resources/assets/hexcasting/models/item/default_colorizer.json +++ b/Common/src/generated/resources/assets/hexcasting/models/item/default_colorizer.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "hexcasting:item/colorizer/uuid" + "layer0": "hexcasting:item/colorizer/default" } } \ No newline at end of file diff --git a/Common/src/main/java/at/petrak/hexcasting/api/pigment/FrozenPigment.java b/Common/src/main/java/at/petrak/hexcasting/api/pigment/FrozenPigment.java index f5cd478e0e..4f2f1540bc 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/pigment/FrozenPigment.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/pigment/FrozenPigment.java @@ -23,6 +23,9 @@ public record FrozenPigment(ItemStack item, UUID owner) { public static final Supplier DEFAULT = () -> new FrozenPigment(new ItemStack(HexItems.DEFAULT_PIGMENT), Util.NIL_UUID); + public static final Supplier ANCIENT = + () -> new FrozenPigment(new ItemStack(HexItems.ANCIENT_PIGMENT), Util.NIL_UUID); + public CompoundTag serializeToNBT() { var out = new CompoundTag(); out.put(TAG_STACK, this.item.save(new CompoundTag())); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/pigment/ItemAmethystPigment.java b/Common/src/main/java/at/petrak/hexcasting/common/items/pigment/ItemAmethystPigment.java new file mode 100644 index 0000000000..c4a8c001ed --- /dev/null +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/pigment/ItemAmethystPigment.java @@ -0,0 +1,30 @@ +package at.petrak.hexcasting.common.items.pigment; + +import at.petrak.hexcasting.api.addldata.ADPigment; +import at.petrak.hexcasting.api.item.PigmentItem; +import at.petrak.hexcasting.api.pigment.ColorProvider; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.phys.Vec3; + +import java.util.UUID; + +public class ItemAmethystPigment extends Item implements PigmentItem { + public ItemAmethystPigment(Properties pProperties) { + super(pProperties); + } + + @Override + public ColorProvider provideColor(ItemStack stack, UUID owner) { + return colorProvider; + } + + protected MyColorProvider colorProvider = new MyColorProvider(); + + protected class MyColorProvider extends ColorProvider { + @Override + protected int getRawColor(float time, Vec3 position) { + return 0xff_ab65eb; + } + } +} diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexItems.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexItems.java index 73988b4b27..3cd0e47c32 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexItems.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexItems.java @@ -9,10 +9,7 @@ import at.petrak.hexcasting.common.items.ItemLoreFragment; import at.petrak.hexcasting.common.items.ItemStaff; import at.petrak.hexcasting.common.items.magic.*; -import at.petrak.hexcasting.common.items.pigment.ItemAmethystAndCopperPigment; -import at.petrak.hexcasting.common.items.pigment.ItemDyePigment; -import at.petrak.hexcasting.common.items.pigment.ItemPridePigment; -import at.petrak.hexcasting.common.items.pigment.ItemUUIDPigment; +import at.petrak.hexcasting.common.items.pigment.*; import at.petrak.hexcasting.common.items.storage.*; import at.petrak.hexcasting.xplat.IXplatAbstractions; import com.google.common.base.Suppliers; @@ -136,6 +133,8 @@ public static void registerItemCreativeTab(CreativeModeTab.Output r, CreativeMod public static final Item UUID_PIGMENT = make("uuid_colorizer", new ItemUUIDPigment(unstackable())); public static final Item DEFAULT_PIGMENT = make("default_colorizer", + new ItemAmethystPigment(unstackable())); + public static final Item ANCIENT_PIGMENT = make("ancient_colorizer", new ItemAmethystAndCopperPigment(unstackable())); // BUFF SANDVICH 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 aa0fa4af2b..7e99750f8f 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 @@ -8,11 +8,15 @@ import at.petrak.hexcasting.api.utils.HexUtils; import at.petrak.hexcasting.api.item.VariantItem; import at.petrak.hexcasting.api.misc.MediaConstants; +import at.petrak.hexcasting.api.pigment.FrozenPigment; import at.petrak.hexcasting.common.items.magic.ItemAncientCypher; +import at.petrak.hexcasting.common.items.magic.ItemPackagedHex; +import at.petrak.hexcasting.common.lib.HexItems; import at.petrak.hexcasting.common.lib.HexLootFunctions; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; import com.google.gson.JsonSerializationContext; +import net.minecraft.Util; import net.minecraft.util.RandomSource; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.CompoundTag; @@ -49,11 +53,14 @@ public static ItemStack doStatic(ItemStack stack, RandomSource rand) { } var tag = new CompoundTag(); + tag.putString(ItemAncientCypher.TAG_HEX_NAME, hex.getFirst()); + tag.put(ItemAncientCypher.TAG_PATTERNS, patsTag); + tag.put(ItemPackagedHex.TAG_PIGMENT, FrozenPigment.ANCIENT.get().serializeToNBT()); tag.putLong(ItemAncientCypher.TAG_MEDIA, 32*MediaConstants.SHARD_UNIT); tag.putLong(ItemAncientCypher.TAG_MAX_MEDIA, 32*MediaConstants.SHARD_UNIT); tag.putInt(VariantItem.TAG_VARIANT, rand.nextInt(8)); - tag.put(ItemAncientCypher.TAG_PATTERNS, patsTag); + stack.getOrCreateTag().merge(tag); return stack; diff --git a/Common/src/main/java/at/petrak/hexcasting/datagen/recipe/HexplatRecipes.java b/Common/src/main/java/at/petrak/hexcasting/datagen/recipe/HexplatRecipes.java index 8ea478517e..2ba8629a35 100644 --- a/Common/src/main/java/at/petrak/hexcasting/datagen/recipe/HexplatRecipes.java +++ b/Common/src/main/java/at/petrak/hexcasting/datagen/recipe/HexplatRecipes.java @@ -207,7 +207,9 @@ public void buildRecipes(Consumer recipes) { ring(RecipeCategory.MISC, HexItems.UUID_PIGMENT, 1, HexItems.AMETHYST_DUST, Items.AMETHYST_SHARD) .unlockedBy("has_item", hasItem(HexItems.AMETHYST_DUST)).save(recipes); - ring(RecipeCategory.MISC, HexItems.DEFAULT_PIGMENT, 1, HexItems.AMETHYST_DUST, Items.COPPER_INGOT) + ringCornerless(RecipeCategory.MISC, HexItems.DEFAULT_PIGMENT, 1, HexItems.AMETHYST_DUST, Items.AMETHYST_SHARD) + .unlockedBy("has_item", hasItem(HexItems.AMETHYST_DUST)).save(recipes); + ringCornerless(RecipeCategory.MISC, HexItems.ANCIENT_PIGMENT, 1, HexItems.AMETHYST_DUST, Items.COPPER_INGOT) .unlockedBy("has_item", hasItem(HexItems.AMETHYST_DUST)).save(recipes); ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, HexItems.SCROLL_SMOL) diff --git a/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 b/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 index 331a158405..412cb79b1b 100644 --- a/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 +++ b/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 @@ -103,6 +103,7 @@ uuid_colorizer: "Soulglimmer Pigment", default_colorizer: "Vacant Pigment", + ancient_colorizer: "Ancient Pigment", creative_unlocker: { "": "The Media Cube", @@ -1563,7 +1564,8 @@ ancient_cyphers: { "1": "While adventuring, I've come across what appear to be $(l:items/hexcasting)$(item)Cyphers/$ created by the Hexcasters of the ancient past. These $(item)Ancient Cyphers/$ work just like the ones I can craft: they can't be recharged, and will break when their reserve of _Media runs out. However, unlike my own $(l:items/hexcasting)$(item)Cyphers/$, their decayed structure allows me to glimpse the _Hex stored within.", - "2": "These may be useful for learning new techniques - who better to teach me than ancient masters of the art?$(br2)Alternatively, I could erase the contents of one and store my own _Hex inside, creating a casting item that clearly displays its own function." + "2": "These may be useful for learning new techniques - who better to teach me than ancient masters of the art?$(br2)Alternatively, I could erase the contents of one and store my own _Hex inside, creating a casting item that clearly displays its own function.", + "3": "The $(l:items/pigments)$(item)Pigment/$ baked into these relics is a unique blend of purple and orange, matching their copper-and-amethyst appearance. I can replicate it using the above recipe.", }, phials: { @@ -1586,7 +1588,7 @@ "colored.crafting.header": "Chromatic Pigments", "colored.crafting.desc": "Pigments in all the colors of the rainbow.", - special: "And finally, a pair of special pigments. $(item)Soulglimmer Pigment/$ shines with colors wholly unique to me, and $(item)Vacant Pigment/$ restores my original purplish-orange spread.$(br2)$(italic)And all the colors I am inside have not been invented yet./$", + special: "And finally, a pair of special pigments. $(item)Soulglimmer Pigment/$ shines with colors wholly unique to me, and $(item)Vacant Pigment/$ restores my original amethyst hue.$(br2)$(italic)And all the colors I am inside have not been invented yet./$", }, edified: { diff --git a/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/items/ancient_cyphers.json b/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/items/ancient_cyphers.json index e3fc78bda9..98b2fca094 100644 --- a/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/items/ancient_cyphers.json +++ b/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/items/ancient_cyphers.json @@ -13,6 +13,11 @@ "type": "patchouli:spotlight", "text": "hexcasting.page.ancient_cyphers.2", "item": "hexcasting:ancient_cypher{variant:0},hexcasting:ancient_cypher{variant:1},hexcasting:ancient_cypher{variant:2},hexcasting:ancient_cypher{variant:3},hexcasting:ancient_cypher{variant:4},hexcasting:ancient_cypher{variant:5},hexcasting:ancient_cypher{variant:6},hexcasting:ancient_cypher{variant:7}" + }, + { + "type": "patchouli:crafting", + "recipe": "hexcasting:ancient_colorizer", + "text": "hexcasting.page.ancient_cyphers.3" } ] } \ No newline at end of file diff --git a/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/ancient.png b/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/ancient.png new file mode 100644 index 0000000000..4085f2708f Binary files /dev/null and b/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/ancient.png differ diff --git a/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/ancient.png.mcmeta b/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/ancient.png.mcmeta new file mode 100644 index 0000000000..06c2f968c3 --- /dev/null +++ b/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/ancient.png.mcmeta @@ -0,0 +1,127 @@ +{ + "animation": { + "interpolate": false, + "frames": [ + { + "index": 0, + "time": 10 + }, + { + "index": 1, + "time": 2 + }, + { + "index": 2, + "time": 2 + }, + { + "index": 3, + "time": 2 + }, + { + "index": 4, + "time": 2 + }, + { + "index": 5, + "time": 2 + }, + { + "index": 6, + "time": 2 + }, + { + "index": 7, + "time": 2 + }, + { + "index": 8, + "time": 1 + }, + { + "index": 9, + "time": 1 + }, + { + "index": 10, + "time": 1 + }, + { + "index": 11, + "time": 1 + }, + { + "index": 12, + "time": 1 + }, + { + "index": 13, + "time": 10 + }, + { + "index": 14, + "time": 1 + }, + { + "index": 15, + "time": 4 + }, + { + "index": 16, + "time": 1 + }, + { + "index": 17, + "time": 1 + }, + { + "index": 18, + "time": 1 + }, + { + "index": 19, + "time": 1 + }, + { + "index": 20, + "time": 1 + }, + { + "index": 21, + "time": 1 + }, + { + "index": 22, + "time": 1 + }, + { + "index": 23, + "time": 1 + }, + { + "index": 24, + "time": 1 + }, + { + "index": 25, + "time": 1 + }, + { + "index": 26, + "time": 1 + }, + { + "index": 27, + "time": 1 + }, + { + "index": 28, + "time": 1 + }, + { + "index": 29, + "time": 1 + } + ] + } +} diff --git a/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/default.png b/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/default.png new file mode 100644 index 0000000000..9606445864 Binary files /dev/null and b/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/default.png differ diff --git a/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/default.png.mcmeta b/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/default.png.mcmeta new file mode 100644 index 0000000000..8b50908b6e --- /dev/null +++ b/Common/src/main/resources/assets/hexcasting/textures/item/colorizer/default.png.mcmeta @@ -0,0 +1,39 @@ +{ + "animation": { + "interpolate": false, + "frames": [ + { + "index": 0, + "time": 20 + }, + { + "index": 1, + "time": 4 + }, + { + "index": 2, + "time": 2 + }, + { + "index": 3, + "time": 2 + }, + { + "index": 4, + "time": 2 + }, + { + "index": 5, + "time": 1 + }, + { + "index": 6, + "time": 1 + }, + { + "index": 7, + "time": 1 + } + ] + } +} diff --git a/Fabric/src/generated/resources/data/hexcasting/advancements/recipes/misc/ancient_colorizer.json b/Fabric/src/generated/resources/data/hexcasting/advancements/recipes/misc/ancient_colorizer.json new file mode 100644 index 0000000000..e29d71dae5 --- /dev/null +++ b/Fabric/src/generated/resources/data/hexcasting/advancements/recipes/misc/ancient_colorizer.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "hexcasting:amethyst_dust" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "hexcasting:ancient_colorizer" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "hexcasting:ancient_colorizer" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/Fabric/src/generated/resources/data/hexcasting/recipes/ancient_colorizer.json b/Fabric/src/generated/resources/data/hexcasting/recipes/ancient_colorizer.json new file mode 100644 index 0000000000..41d540f77e --- /dev/null +++ b/Fabric/src/generated/resources/data/hexcasting/recipes/ancient_colorizer.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "hexcasting:amethyst_dust" + }, + "I": { + "item": "minecraft:copper_ingot" + } + }, + "pattern": [ + " C ", + "CIC", + " C " + ], + "result": { + "item": "hexcasting:ancient_colorizer" + }, + "show_notification": true +} \ No newline at end of file diff --git a/Fabric/src/generated/resources/data/hexcasting/recipes/default_colorizer.json b/Fabric/src/generated/resources/data/hexcasting/recipes/default_colorizer.json index 133b5b03bd..50c3da93a6 100644 --- a/Fabric/src/generated/resources/data/hexcasting/recipes/default_colorizer.json +++ b/Fabric/src/generated/resources/data/hexcasting/recipes/default_colorizer.json @@ -5,17 +5,14 @@ "C": { "item": "hexcasting:amethyst_dust" }, - "D": { - "item": "hexcasting:amethyst_dust" - }, "I": { - "item": "minecraft:copper_ingot" + "item": "minecraft:amethyst_shard" } }, "pattern": [ - "DCD", + " C ", "CIC", - "DCD" + " C " ], "result": { "item": "hexcasting:default_colorizer" diff --git a/Forge/src/generated/resources/data/hexcasting/advancements/recipes/misc/ancient_colorizer.json b/Forge/src/generated/resources/data/hexcasting/advancements/recipes/misc/ancient_colorizer.json new file mode 100644 index 0000000000..e29d71dae5 --- /dev/null +++ b/Forge/src/generated/resources/data/hexcasting/advancements/recipes/misc/ancient_colorizer.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "hexcasting:amethyst_dust" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "hexcasting:ancient_colorizer" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "hexcasting:ancient_colorizer" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/Forge/src/generated/resources/data/hexcasting/recipes/ancient_colorizer.json b/Forge/src/generated/resources/data/hexcasting/recipes/ancient_colorizer.json new file mode 100644 index 0000000000..41d540f77e --- /dev/null +++ b/Forge/src/generated/resources/data/hexcasting/recipes/ancient_colorizer.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "hexcasting:amethyst_dust" + }, + "I": { + "item": "minecraft:copper_ingot" + } + }, + "pattern": [ + " C ", + "CIC", + " C " + ], + "result": { + "item": "hexcasting:ancient_colorizer" + }, + "show_notification": true +} \ No newline at end of file diff --git a/Forge/src/generated/resources/data/hexcasting/recipes/default_colorizer.json b/Forge/src/generated/resources/data/hexcasting/recipes/default_colorizer.json index 133b5b03bd..50c3da93a6 100644 --- a/Forge/src/generated/resources/data/hexcasting/recipes/default_colorizer.json +++ b/Forge/src/generated/resources/data/hexcasting/recipes/default_colorizer.json @@ -5,17 +5,14 @@ "C": { "item": "hexcasting:amethyst_dust" }, - "D": { - "item": "hexcasting:amethyst_dust" - }, "I": { - "item": "minecraft:copper_ingot" + "item": "minecraft:amethyst_shard" } }, "pattern": [ - "DCD", + " C ", "CIC", - "DCD" + " C " ], "result": { "item": "hexcasting:default_colorizer" diff --git a/Forge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexItemModels.java b/Forge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexItemModels.java index f8a988459f..ff3d900357 100644 --- a/Forge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexItemModels.java +++ b/Forge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexItemModels.java @@ -155,7 +155,9 @@ protected void registerModels() { singleTexture(getPath(HexItems.UUID_PIGMENT), new ResourceLocation("item/generated"), "layer0", modLoc("item/colorizer/uuid")); singleTexture(getPath(HexItems.DEFAULT_PIGMENT), new ResourceLocation("item/generated"), - "layer0", modLoc("item/colorizer/uuid")); + "layer0", modLoc("item/colorizer/default")); + singleTexture(getPath(HexItems.ANCIENT_PIGMENT), new ResourceLocation("item/generated"), + "layer0", modLoc("item/colorizer/ancient")); simpleItem(modLoc("slate_blank")); simpleItem(modLoc("slate_written"));