Skip to content

Commit a0a5a50

Browse files
Default pigment rework (#912)
2 parents 6a82e64 + feb0c14 commit a0a5a50

File tree

20 files changed

+350
-22
lines changed

20 files changed

+350
-22
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "minecraft:item/generated",
3+
"textures": {
4+
"layer0": "hexcasting:item/colorizer/ancient"
5+
}
6+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parent": "minecraft:item/generated",
33
"textures": {
4-
"layer0": "hexcasting:item/colorizer/uuid"
4+
"layer0": "hexcasting:item/colorizer/default"
55
}
66
}

Common/src/main/java/at/petrak/hexcasting/api/pigment/FrozenPigment.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ public record FrozenPigment(ItemStack item, UUID owner) {
2323
public static final Supplier<FrozenPigment> DEFAULT =
2424
() -> new FrozenPigment(new ItemStack(HexItems.DEFAULT_PIGMENT), Util.NIL_UUID);
2525

26+
public static final Supplier<FrozenPigment> ANCIENT =
27+
() -> new FrozenPigment(new ItemStack(HexItems.ANCIENT_PIGMENT), Util.NIL_UUID);
28+
2629
public CompoundTag serializeToNBT() {
2730
var out = new CompoundTag();
2831
out.put(TAG_STACK, this.item.save(new CompoundTag()));
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package at.petrak.hexcasting.common.items.pigment;
2+
3+
import at.petrak.hexcasting.api.addldata.ADPigment;
4+
import at.petrak.hexcasting.api.item.PigmentItem;
5+
import at.petrak.hexcasting.api.pigment.ColorProvider;
6+
import net.minecraft.world.item.Item;
7+
import net.minecraft.world.item.ItemStack;
8+
import net.minecraft.world.phys.Vec3;
9+
10+
import java.util.UUID;
11+
12+
public class ItemAmethystPigment extends Item implements PigmentItem {
13+
public ItemAmethystPigment(Properties pProperties) {
14+
super(pProperties);
15+
}
16+
17+
@Override
18+
public ColorProvider provideColor(ItemStack stack, UUID owner) {
19+
return colorProvider;
20+
}
21+
22+
protected MyColorProvider colorProvider = new MyColorProvider();
23+
24+
protected class MyColorProvider extends ColorProvider {
25+
@Override
26+
protected int getRawColor(float time, Vec3 position) {
27+
return 0xff_ab65eb;
28+
}
29+
}
30+
}

Common/src/main/java/at/petrak/hexcasting/common/lib/HexItems.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
import at.petrak.hexcasting.common.items.ItemLoreFragment;
1010
import at.petrak.hexcasting.common.items.ItemStaff;
1111
import at.petrak.hexcasting.common.items.magic.*;
12-
import at.petrak.hexcasting.common.items.pigment.ItemAmethystAndCopperPigment;
13-
import at.petrak.hexcasting.common.items.pigment.ItemDyePigment;
14-
import at.petrak.hexcasting.common.items.pigment.ItemPridePigment;
15-
import at.petrak.hexcasting.common.items.pigment.ItemUUIDPigment;
12+
import at.petrak.hexcasting.common.items.pigment.*;
1613
import at.petrak.hexcasting.common.items.storage.*;
1714
import at.petrak.hexcasting.xplat.IXplatAbstractions;
1815
import com.google.common.base.Suppliers;
@@ -136,6 +133,8 @@ public static void registerItemCreativeTab(CreativeModeTab.Output r, CreativeMod
136133

137134
public static final Item UUID_PIGMENT = make("uuid_colorizer", new ItemUUIDPigment(unstackable()));
138135
public static final Item DEFAULT_PIGMENT = make("default_colorizer",
136+
new ItemAmethystPigment(unstackable()));
137+
public static final Item ANCIENT_PIGMENT = make("ancient_colorizer",
139138
new ItemAmethystAndCopperPigment(unstackable()));
140139

141140
// BUFF SANDVICH

Common/src/main/java/at/petrak/hexcasting/common/loot/AddHexToAncientCypherFunc.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88
import at.petrak.hexcasting.api.utils.HexUtils;
99
import at.petrak.hexcasting.api.item.VariantItem;
1010
import at.petrak.hexcasting.api.misc.MediaConstants;
11+
import at.petrak.hexcasting.api.pigment.FrozenPigment;
1112
import at.petrak.hexcasting.common.items.magic.ItemAncientCypher;
13+
import at.petrak.hexcasting.common.items.magic.ItemPackagedHex;
14+
import at.petrak.hexcasting.common.lib.HexItems;
1215
import at.petrak.hexcasting.common.lib.HexLootFunctions;
1316
import com.google.gson.JsonDeserializationContext;
1417
import com.google.gson.JsonObject;
1518
import com.google.gson.JsonSerializationContext;
19+
import net.minecraft.Util;
1620
import net.minecraft.util.RandomSource;
1721
import net.minecraft.nbt.ListTag;
1822
import net.minecraft.nbt.CompoundTag;
@@ -49,11 +53,14 @@ public static ItemStack doStatic(ItemStack stack, RandomSource rand) {
4953
}
5054

5155
var tag = new CompoundTag();
56+
5257
tag.putString(ItemAncientCypher.TAG_HEX_NAME, hex.getFirst());
58+
tag.put(ItemAncientCypher.TAG_PATTERNS, patsTag);
59+
tag.put(ItemPackagedHex.TAG_PIGMENT, FrozenPigment.ANCIENT.get().serializeToNBT());
5360
tag.putLong(ItemAncientCypher.TAG_MEDIA, 32*MediaConstants.SHARD_UNIT);
5461
tag.putLong(ItemAncientCypher.TAG_MAX_MEDIA, 32*MediaConstants.SHARD_UNIT);
5562
tag.putInt(VariantItem.TAG_VARIANT, rand.nextInt(8));
56-
tag.put(ItemAncientCypher.TAG_PATTERNS, patsTag);
63+
5764
stack.getOrCreateTag().merge(tag);
5865

5966
return stack;

Common/src/main/java/at/petrak/hexcasting/datagen/recipe/HexplatRecipes.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ public void buildRecipes(Consumer<FinishedRecipe> recipes) {
207207

208208
ring(RecipeCategory.MISC, HexItems.UUID_PIGMENT, 1, HexItems.AMETHYST_DUST, Items.AMETHYST_SHARD)
209209
.unlockedBy("has_item", hasItem(HexItems.AMETHYST_DUST)).save(recipes);
210-
ring(RecipeCategory.MISC, HexItems.DEFAULT_PIGMENT, 1, HexItems.AMETHYST_DUST, Items.COPPER_INGOT)
210+
ringCornerless(RecipeCategory.MISC, HexItems.DEFAULT_PIGMENT, 1, HexItems.AMETHYST_DUST, Items.AMETHYST_SHARD)
211+
.unlockedBy("has_item", hasItem(HexItems.AMETHYST_DUST)).save(recipes);
212+
ringCornerless(RecipeCategory.MISC, HexItems.ANCIENT_PIGMENT, 1, HexItems.AMETHYST_DUST, Items.COPPER_INGOT)
211213
.unlockedBy("has_item", hasItem(HexItems.AMETHYST_DUST)).save(recipes);
212214

213215
ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, HexItems.SCROLL_SMOL)

Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103

104104
uuid_colorizer: "Soulglimmer Pigment",
105105
default_colorizer: "Vacant Pigment",
106+
ancient_colorizer: "Ancient Pigment",
106107

107108
creative_unlocker: {
108109
"": "The Media Cube",
@@ -1565,7 +1566,8 @@
15651566

15661567
ancient_cyphers: {
15671568
"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.",
1568-
"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."
1569+
"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.",
1570+
"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.",
15691571
},
15701572

15711573
phials: {
@@ -1588,7 +1590,7 @@
15881590
"colored.crafting.header": "Chromatic Pigments",
15891591
"colored.crafting.desc": "Pigments in all the colors of the rainbow.",
15901592

1591-
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./$",
1593+
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./$",
15921594
},
15931595

15941596
edified: {

Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/items/ancient_cyphers.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"type": "patchouli:spotlight",
1414
"text": "hexcasting.page.ancient_cyphers.2",
1515
"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}"
16+
},
17+
{
18+
"type": "patchouli:crafting",
19+
"recipe": "hexcasting:ancient_colorizer",
20+
"text": "hexcasting.page.ancient_cyphers.3"
1621
}
1722
]
1823
}
2.9 KB
Loading

0 commit comments

Comments
 (0)