From d5e65b51621e8375fbac4bb740d7cfbfe7932b07 Mon Sep 17 00:00:00 2001 From: "petrak@" Date: Sat, 4 Feb 2023 18:52:00 -0600 Subject: [PATCH 01/20] for kirin: cheapen break block and reduce packaged hex cooldowns --- .../petrak/hexcasting/api/mod/HexConfig.java | 10 +++++++ .../casting/operators/spells/OpBreakBlock.kt | 6 ++-- .../common/items/magic/ItemArtifact.java | 6 ++++ .../common/items/magic/ItemCypher.java | 6 ++++ .../common/items/magic/ItemPackagedHex.java | 6 ++-- .../common/items/magic/ItemTrinket.java | 6 ++++ .../assets/hexcasting/lang/en_us.json | 8 +++++- .../hexcasting/fabric/FabricHexConfig.java | 23 +++++++++++++++ .../hexcasting/forge/ForgeHexConfig.java | 28 +++++++++++++++++++ 9 files changed, 93 insertions(+), 6 deletions(-) diff --git a/Common/src/main/java/at/petrak/hexcasting/api/mod/HexConfig.java b/Common/src/main/java/at/petrak/hexcasting/api/mod/HexConfig.java index abfb66d4..e1b181da 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/mod/HexConfig.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/mod/HexConfig.java @@ -21,11 +21,21 @@ public class HexConfig { double mediaToHealthRate(); + int cypherCooldown(); + + int trinketCooldown(); + + int artifactCooldown(); + int DEFAULT_DUST_MEDIA_AMOUNT = MediaConstants.DUST_UNIT; int DEFAULT_SHARD_MEDIA_AMOUNT = MediaConstants.SHARD_UNIT; int DEFAULT_CHARGED_MEDIA_AMOUNT = MediaConstants.CRYSTAL_UNIT; double DEFAULT_MEDIA_TO_HEALTH_RATE = 2 * MediaConstants.CRYSTAL_UNIT / 20.0; + int DEFAULT_CYPHER_COOLDOWN = 8; + int DEFAULT_TRINKET_COOLDOWN = 5; + int DEFAULT_ARTIFACT_COOLDOWN = 3; + } public interface ClientConfigAccess { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBreakBlock.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBreakBlock.kt index 3b3906e8..3d241f64 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBreakBlock.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBreakBlock.kt @@ -1,13 +1,13 @@ package at.petrak.hexcasting.common.casting.operators.spells -import at.petrak.hexcasting.api.misc.MediaConstants -import at.petrak.hexcasting.api.mod.HexConfig import at.petrak.hexcasting.api.casting.ParticleSpray import at.petrak.hexcasting.api.casting.RenderedSpell import at.petrak.hexcasting.api.casting.castables.SpellAction import at.petrak.hexcasting.api.casting.eval.CastingEnvironment import at.petrak.hexcasting.api.casting.getBlockPos import at.petrak.hexcasting.api.casting.iota.Iota +import at.petrak.hexcasting.api.misc.MediaConstants +import at.petrak.hexcasting.api.mod.HexConfig import at.petrak.hexcasting.xplat.IXplatAbstractions import net.minecraft.core.BlockPos import net.minecraft.world.phys.Vec3 @@ -25,7 +25,7 @@ object OpBreakBlock : SpellAction { return Triple( Spell(pos), - (MediaConstants.DUST_UNIT * 1.125).toInt(), + MediaConstants.DUST_UNIT / 8, listOf(ParticleSpray.burst(Vec3.atCenterOf(pos), 1.0)) ) } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemArtifact.java b/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemArtifact.java index 4fd0f654..3fed34e1 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemArtifact.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemArtifact.java @@ -1,5 +1,6 @@ package at.petrak.hexcasting.common.items.magic; +import at.petrak.hexcasting.api.mod.HexConfig; import net.minecraft.world.item.ItemStack; public class ItemArtifact extends ItemPackagedHex { @@ -16,4 +17,9 @@ public class ItemArtifact extends ItemPackagedHex { public boolean breakAfterDepletion() { return false; } + + @Override + public int cooldown() { + return HexConfig.common().artifactCooldown(); + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemCypher.java b/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemCypher.java index c2c786cb..9d9016cc 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemCypher.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemCypher.java @@ -1,5 +1,6 @@ package at.petrak.hexcasting.common.items.magic; +import at.petrak.hexcasting.api.mod.HexConfig; import net.minecraft.world.item.ItemStack; public class ItemCypher extends ItemPackagedHex { @@ -16,4 +17,9 @@ public class ItemCypher extends ItemPackagedHex { public boolean breakAfterDepletion() { return true; } + + @Override + public int cooldown() { + return HexConfig.common().cypherCooldown(); + } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemPackagedHex.java b/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemPackagedHex.java index 50d463c0..4bbaeded 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemPackagedHex.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemPackagedHex.java @@ -1,9 +1,9 @@ package at.petrak.hexcasting.common.items.magic; -import at.petrak.hexcasting.api.item.HexHolderItem; import at.petrak.hexcasting.api.casting.eval.CastingEnvironment; import at.petrak.hexcasting.api.casting.eval.CastingHarness; import at.petrak.hexcasting.api.casting.iota.Iota; +import at.petrak.hexcasting.api.item.HexHolderItem; import at.petrak.hexcasting.api.utils.NBTHelper; import at.petrak.hexcasting.common.lib.hex.HexIotaTypes; import net.minecraft.nbt.CompoundTag; @@ -40,6 +40,8 @@ public abstract class ItemPackagedHex extends ItemMediaHolder implements HexHold public abstract boolean breakAfterDepletion(); + public abstract int cooldown(); + @Override public boolean canRecharge(ItemStack stack) { return !breakAfterDepletion(); @@ -120,7 +122,7 @@ public abstract class ItemPackagedHex extends ItemMediaHolder implements HexHold } player.awardStat(stat); - sPlayer.getCooldowns().addCooldown(this, 5); + sPlayer.getCooldowns().addCooldown(this, this.cooldown()); if (broken) { stack.shrink(1); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemTrinket.java b/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemTrinket.java index 4eb24e6a..38396297 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemTrinket.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/magic/ItemTrinket.java @@ -1,5 +1,6 @@ package at.petrak.hexcasting.common.items.magic; +import at.petrak.hexcasting.api.mod.HexConfig; import net.minecraft.world.item.ItemStack; public class ItemTrinket extends ItemPackagedHex { @@ -16,4 +17,9 @@ public class ItemTrinket extends ItemPackagedHex { public boolean breakAfterDepletion() { return false; } + + @Override + public int cooldown() { + return HexConfig.common().trinketCooldown(); + } } diff --git a/Common/src/main/resources/assets/hexcasting/lang/en_us.json b/Common/src/main/resources/assets/hexcasting/lang/en_us.json index 2e9880fa..d6fda312 100644 --- a/Common/src/main/resources/assets/hexcasting/lang/en_us.json +++ b/Common/src/main/resources/assets/hexcasting/lang/en_us.json @@ -184,10 +184,16 @@ "text.autoconfig.hexcasting.option.common.shardMediaAmount": "Shard Media Amount", "text.autoconfig.hexcasting.option.common.chargedCrystalMediaAmount": "Charged Crystal Media Amount", "text.autoconfig.hexcasting.option.common.mediaToHealthRate": "Media To Health Rate", + "text.autoconfig.hexcasting.option.common.cypherCooldown": "Cypher Cooldown", + "text.autoconfig.hexcasting.option.common.trinketCooldown": "Trinket Cooldown", + "text.autoconfig.hexcasting.option.common.artifactCooldown": "Artifact Cooldown", "text.autoconfig.hexcasting.option.common.dustMediaAmount.@Tooltip": "How much media a single Amethyst Dust item is worth", "text.autoconfig.hexcasting.option.common.shardMediaAmount.@Tooltip": "How much media a single Amethyst Shard item is worth", "text.autoconfig.hexcasting.option.common.chargedCrystalMediaAmount.@Tooltip": "How much media a single Charged Amethyst Crystal item is worth", "text.autoconfig.hexcasting.option.common.mediaToHealthRate.@Tooltip": "How many points of media a half-heart is worth when casting from HP", + "text.autoconfig.hexcasting.option.common.cypherCooldown.@Tooltip": "Cooldown of a cypher in ticks", + "text.autoconfig.hexcasting.option.common.trinketCooldown.@Tooltip": "Cooldown of a trinket in ticks", + "text.autoconfig.hexcasting.option.common.artifactCooldown.@Tooltip": "Cooldown of an artifact in ticks", "text.autoconfig.hexcasting.option.client.ctrlTogglesOffStrokeOrder": "Ctrl Toggles Off Stroke Order", "text.autoconfig.hexcasting.option.client.invertSpellbookScrollDirection": "Invert Spellbook Scroll Direction", @@ -1079,7 +1085,7 @@ "hexcasting.entry.blockworks": "Blockworks", "hexcasting.page.blockworks.place_block": "Remove a location from the stack, then pick a block item and place it at the given location.$(br)Costs a negligible amount of _media.", - "hexcasting.page.blockworks.break_block": "Remove a location from the stack, then break the block at the given location. This spell can break nearly anything a Diamond Pickaxe can break.$(br)Costs a bit more than one $(l:items/amethyst)$(item)Amethyst Dust/$.", + "hexcasting.page.blockworks.break_block": "Remove a location from the stack, then break the block at the given location. This spell can break nearly anything a Diamond Pickaxe can break.$(br)Costs about an eighth of one $(l:items/amethyst)$(item)Amethyst Dust/$.", "hexcasting.page.blockworks.create_water": "Summon a block of water (or insert up to a bucket's worth) into a block at the given position. Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$.", "hexcasting.page.blockworks.destroy_water": "Drains either a liquid container at, or a body of liquid around, the given position. Costs about two $(l:items/amethyst)$(item)Charged Amethyst/$.", "hexcasting.page.blockworks.conjure_block": "Conjure an ethereal, but solid, block that sparkles with my pigment at the given position. Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$.", diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/FabricHexConfig.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/FabricHexConfig.java index 2f207026..54a4a1a2 100644 --- a/Fabric/src/main/java/at/petrak/hexcasting/fabric/FabricHexConfig.java +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/FabricHexConfig.java @@ -64,6 +64,14 @@ public class FabricHexConfig extends PartitioningSerializer.GlobalData { @ConfigEntry.Gui.Tooltip private double mediaToHealthRate = DEFAULT_MEDIA_TO_HEALTH_RATE; + @ConfigEntry.Gui.Tooltip + private int cypherCooldown = DEFAULT_CYPHER_COOLDOWN; + @ConfigEntry.Gui.Tooltip + private int trinketCooldown = DEFAULT_TRINKET_COOLDOWN; + @ConfigEntry.Gui.Tooltip + private int artifactCooldown = DEFAULT_ARTIFACT_COOLDOWN; + + @Override public void validatePostLoad() throws ValidationException { this.dustMediaAmount = Math.max(this.dustMediaAmount, 0); @@ -91,6 +99,21 @@ public class FabricHexConfig extends PartitioningSerializer.GlobalData { public double mediaToHealthRate() { return mediaToHealthRate; } + + @Override + public int cypherCooldown() { + return cypherCooldown; + } + + @Override + public int trinketCooldown() { + return trinketCooldown; + } + + @Override + public int artifactCooldown() { + return artifactCooldown; + } } @Config(name = "client") diff --git a/Forge/src/main/java/at/petrak/hexcasting/forge/ForgeHexConfig.java b/Forge/src/main/java/at/petrak/hexcasting/forge/ForgeHexConfig.java index 9ba6a747..f8cfca9f 100644 --- a/Forge/src/main/java/at/petrak/hexcasting/forge/ForgeHexConfig.java +++ b/Forge/src/main/java/at/petrak/hexcasting/forge/ForgeHexConfig.java @@ -16,6 +16,10 @@ public class ForgeHexConfig implements HexConfig.CommonConfigAccess { private static ForgeConfigSpec.IntValue chargedCrystalMediaAmount; private static ForgeConfigSpec.DoubleValue mediaToHealthRate; + private static ForgeConfigSpec.IntValue cypherCooldown; + private static ForgeConfigSpec.IntValue trinketCooldown; + private static ForgeConfigSpec.IntValue artifactCooldown; + public ForgeHexConfig(ForgeConfigSpec.Builder builder) { builder.push("Media Amounts"); dustMediaAmount = builder.comment("How much media a single Amethyst Dust item is worth") @@ -27,6 +31,15 @@ public class ForgeHexConfig implements HexConfig.CommonConfigAccess { mediaToHealthRate = builder.comment("How many points of media a half-heart is worth when casting from HP") .defineInRange("mediaToHealthRate", DEFAULT_MEDIA_TO_HEALTH_RATE, 0.0, Double.POSITIVE_INFINITY); builder.pop(); + + builder.push("Cooldowns"); + cypherCooldown = builder.comment("Cooldown in ticks of a cypher") + .defineInRange("cypherCooldown", DEFAULT_CYPHER_COOLDOWN, 0, Integer.MAX_VALUE); + trinketCooldown = builder.comment("Cooldown in ticks of a trinket") + .defineInRange("trinketCooldown", DEFAULT_TRINKET_COOLDOWN, 0, Integer.MAX_VALUE); + artifactCooldown = builder.comment("Cooldown in ticks of a artifact") + .defineInRange("artifactCooldown", DEFAULT_ARTIFACT_COOLDOWN, 0, Integer.MAX_VALUE); + builder.pop(); } @Override @@ -49,6 +62,21 @@ public class ForgeHexConfig implements HexConfig.CommonConfigAccess { return mediaToHealthRate.get(); } + @Override + public int cypherCooldown() { + return cypherCooldown.get(); + } + + @Override + public int trinketCooldown() { + return trinketCooldown.get(); + } + + @Override + public int artifactCooldown() { + return artifactCooldown.get(); + } + public static class Client implements HexConfig.ClientConfigAccess { private static ForgeConfigSpec.BooleanValue ctrlTogglesOffStrokeOrder; private static ForgeConfigSpec.BooleanValue invertSpellbookScrollDirection; From 1dc3c88856fd48dc896c11c02ace2fcf562f4371 Mon Sep 17 00:00:00 2001 From: "petrak@" Date: Wed, 15 Feb 2023 01:37:09 -0600 Subject: [PATCH 02/20] it thinks, therefore you aren't --- .../8f7cd5c924d3264b7777ef1696459761f9a70902 | 4 +- .../hexcasting/models/item/thought_knot.json | 20 +++++++ .../models/item/thought_knot_written.json | 7 +++ .../client/RegisterClientStuff.java | 18 ++++-- .../blocks/akashic/BlockAkashicBookshelf.java | 2 +- .../common/command/ListPatternsCommand.java | 2 +- .../common/entities/EntityWallScroll.java | 8 +-- .../items/{ => storage}/ItemAbacus.java | 8 +-- .../common/items/{ => storage}/ItemFocus.java | 2 +- .../items/{ => storage}/ItemScroll.java | 2 +- .../common/items/{ => storage}/ItemSlate.java | 2 +- .../items/{ => storage}/ItemSpellbook.java | 6 +- .../common/items/storage/ItemThoughtKnot.java | 52 ++++++++++++++++++ .../hexcasting/common/lib/HexItems.java | 7 ++- .../loot/AddPerWorldPatternToScrollFunc.java | 2 +- .../common/network/MsgShiftScrollSyn.java | 6 +- .../common/recipe/SealSpellbookRecipe.java | 2 +- .../common/recipe/SealThingsRecipe.java | 4 +- .../assets/hexcasting/lang/en_us.json | 1 + .../hexcasting/textures/item/thought_knot.png | Bin 0 -> 232 bytes .../textures/item/thought_knot_overlay.png | Bin 0 -> 189 bytes .../03e4de26f1265135874f8cdcaebc09d9c08eb42b | 2 +- .../67cce32b1c3cbbcb1f646605f4914e3f196986c2 | 2 +- .../75bcd4dba6ca7d365462b0ec45e291d1056349c4 | 2 +- .../844611d4af49e23072b8a888c8e73c6c5d8c0768 | 2 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 2 +- .../forge/datagen/xplat/HexItemModels.java | 21 ++++++- 27 files changed, 149 insertions(+), 37 deletions(-) create mode 100644 Common/src/generated/resources/assets/hexcasting/models/item/thought_knot.json create mode 100644 Common/src/generated/resources/assets/hexcasting/models/item/thought_knot_written.json rename Common/src/main/java/at/petrak/hexcasting/common/items/{ => storage}/ItemAbacus.java (95%) rename Common/src/main/java/at/petrak/hexcasting/common/items/{ => storage}/ItemFocus.java (97%) rename Common/src/main/java/at/petrak/hexcasting/common/items/{ => storage}/ItemScroll.java (99%) rename Common/src/main/java/at/petrak/hexcasting/common/items/{ => storage}/ItemSlate.java (98%) rename Common/src/main/java/at/petrak/hexcasting/common/items/{ => storage}/ItemSpellbook.java (98%) create mode 100644 Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemThoughtKnot.java create mode 100644 Common/src/main/resources/assets/hexcasting/textures/item/thought_knot.png create mode 100644 Common/src/main/resources/assets/hexcasting/textures/item/thought_knot_overlay.png diff --git a/Common/src/generated/resources/.cache/8f7cd5c924d3264b7777ef1696459761f9a70902 b/Common/src/generated/resources/.cache/8f7cd5c924d3264b7777ef1696459761f9a70902 index 113ecb7a..d6ff03e6 100644 --- a/Common/src/generated/resources/.cache/8f7cd5c924d3264b7777ef1696459761f9a70902 +++ b/Common/src/generated/resources/.cache/8f7cd5c924d3264b7777ef1696459761f9a70902 @@ -1,4 +1,4 @@ -// 1.19.2 2023-01-22T12:41:02.49644171 Item Models: hexcasting +// 1.19.2 2023-02-15T01:34:30.703213817 Item Models: hexcasting f2156b3a7041cf99891b528393db64c6b9ca1a4f assets/hexcasting/models/item/abacus.json 933059cd7c2dbaff0e643c644c14af0c0e77aa29 assets/hexcasting/models/item/acacia_staff.json 19730853397b109cfedd0c3bbda83d5de6cd15b9 assets/hexcasting/models/item/akashic_record.json @@ -101,6 +101,8 @@ c29e6e7b2168eeeb13b1fc3e93ffc3e0c9bd11ce assets/hexcasting/models/item/spellbook d6ebc87cb0fa6f86bee3a4eade7329ebb0cf2d38 assets/hexcasting/models/item/stripped_edified_log.json ea3f18f75776022127f3a108119e3f7a5c211c0f assets/hexcasting/models/item/stripped_edified_wood.json 0a100b64e77394606018320bbc5752a546fe0af4 assets/hexcasting/models/item/sub_sandwich.json +6a7f5af82cf8ec72c3457ef4c1ae11a76717bf88 assets/hexcasting/models/item/thought_knot.json +93b2191ffab47003f661b75a85cd833ec64f0c15 assets/hexcasting/models/item/thought_knot_written.json 5f4831d11d8f45b037a6f48e12d2e794ada7b961 assets/hexcasting/models/item/trinket.json 946970e74b8d3c76c15191f494bc1f3d7e36aa43 assets/hexcasting/models/item/trinket_filled.json c6523de66cbfae3a1e6361c635cc693a0a089bb3 assets/hexcasting/models/item/uuid_colorizer.json diff --git a/Common/src/generated/resources/assets/hexcasting/models/item/thought_knot.json b/Common/src/generated/resources/assets/hexcasting/models/item/thought_knot.json new file mode 100644 index 00000000..4a991722 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/item/thought_knot.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:item/generated", + "overrides": [ + { + "model": "hexcasting:item/thought_knot", + "predicate": { + "hexcasting:written": 0.0 + } + }, + { + "model": "hexcasting:item/thought_knot_written", + "predicate": { + "hexcasting:written": 1.0 + } + } + ], + "textures": { + "layer0": "hexcasting:item/thought_knot" + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/item/thought_knot_written.json b/Common/src/generated/resources/assets/hexcasting/models/item/thought_knot_written.json new file mode 100644 index 00000000..f5b12c99 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/item/thought_knot_written.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "hexcasting:item/thought_knot", + "layer1": "hexcasting:item/thought_knot_overlay" + } +} \ No newline at end of file diff --git a/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java b/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java index 991d16b9..dd17f541 100644 --- a/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java +++ b/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java @@ -13,9 +13,10 @@ import at.petrak.hexcasting.client.entity.WallScrollRenderer; import at.petrak.hexcasting.common.blocks.akashic.BlockAkashicBookshelf; import at.petrak.hexcasting.common.blocks.akashic.BlockEntityAkashicBookshelf; import at.petrak.hexcasting.common.entities.HexEntities; -import at.petrak.hexcasting.common.items.*; +import at.petrak.hexcasting.common.items.ItemStaff; import at.petrak.hexcasting.common.items.magic.ItemMediaBattery; import at.petrak.hexcasting.common.items.magic.ItemPackagedHex; +import at.petrak.hexcasting.common.items.storage.*; import at.petrak.hexcasting.common.lib.HexBlockEntities; import at.petrak.hexcasting.common.lib.HexBlocks; import at.petrak.hexcasting.common.lib.HexItems; @@ -55,12 +56,20 @@ import java.util.function.UnaryOperator; public class RegisterClientStuff { public static void init() { - registerDataHolderOverrides(HexItems.FOCUS, + registerSealableDataHolderOverrides(HexItems.FOCUS, stack -> HexItems.FOCUS.readIotaTag(stack) != null, ItemFocus::isSealed); - registerDataHolderOverrides(HexItems.SPELLBOOK, + registerSealableDataHolderOverrides(HexItems.SPELLBOOK, stack -> HexItems.SPELLBOOK.readIotaTag(stack) != null, ItemSpellbook::isSealed); + IClientXplatAbstractions.INSTANCE.registerItemProperty(HexItems.THOUGHT_KNOT, ItemThoughtKnot.WRITTEN_PRED, + (stack, level, holder, holderID) -> { + if (NBTHelper.contains(stack, ItemThoughtKnot.TAG_DATA)) { + return 1; + } else { + return 0; + } + }); registerPackagedSpellOverrides(HexItems.CYPHER); registerPackagedSpellOverrides(HexItems.TRINKET); @@ -124,6 +133,7 @@ public class RegisterClientStuff { BiConsumer blockColorRegistry) { itemColorRegistry.accept(makeIotaStorageColorizer(HexItems.FOCUS::getColor), HexItems.FOCUS); itemColorRegistry.accept(makeIotaStorageColorizer(HexItems.SPELLBOOK::getColor), HexItems.SPELLBOOK); + itemColorRegistry.accept(makeIotaStorageColorizer(HexItems.THOUGHT_KNOT::getColor), HexItems.THOUGHT_KNOT); blockColorRegistry.accept((bs, level, pos, idx) -> { if (!bs.getValue(BlockAkashicBookshelf.HAS_BOOKS) || level == null || pos == null) { @@ -302,7 +312,7 @@ public class RegisterClientStuff { }; } - private static void registerDataHolderOverrides(IotaHolderItem item, Predicate hasIota, + private static void registerSealableDataHolderOverrides(IotaHolderItem item, Predicate hasIota, Predicate isSealed) { IClientXplatAbstractions.INSTANCE.registerItemProperty((Item) item, ItemFocus.OVERLAY_PRED, (stack, level, holder, holderID) -> { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java index 233773f8..39545fd9 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/akashic/BlockAkashicBookshelf.java @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.blocks.akashic; import at.petrak.hexcasting.annotations.SoftImplement; import at.petrak.hexcasting.api.casting.iota.PatternIota; -import at.petrak.hexcasting.common.items.ItemScroll; +import at.petrak.hexcasting.common.items.storage.ItemScroll; import at.petrak.hexcasting.common.lib.HexSounds; import at.petrak.hexcasting.xplat.IForgeLikeBlock; import net.minecraft.core.BlockPos; diff --git a/Common/src/main/java/at/petrak/hexcasting/common/command/ListPatternsCommand.java b/Common/src/main/java/at/petrak/hexcasting/common/command/ListPatternsCommand.java index 8e414e49..4a53d4d2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/command/ListPatternsCommand.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/command/ListPatternsCommand.java @@ -3,7 +3,7 @@ package at.petrak.hexcasting.common.command; import at.petrak.hexcasting.api.casting.iota.PatternIota; import at.petrak.hexcasting.api.casting.math.HexPattern; import at.petrak.hexcasting.common.casting.PatternRegistryManifest; -import at.petrak.hexcasting.common.items.ItemScroll; +import at.petrak.hexcasting.common.items.storage.ItemScroll; import at.petrak.hexcasting.common.lib.HexItems; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import net.minecraft.commands.CommandSourceStack; diff --git a/Common/src/main/java/at/petrak/hexcasting/common/entities/EntityWallScroll.java b/Common/src/main/java/at/petrak/hexcasting/common/entities/EntityWallScroll.java index 116247cc..aa78c9b0 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/entities/EntityWallScroll.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/entities/EntityWallScroll.java @@ -4,7 +4,7 @@ import at.petrak.hexcasting.api.casting.math.HexPattern; import at.petrak.hexcasting.api.utils.HexUtils; import at.petrak.hexcasting.api.utils.NBTHelper; import at.petrak.hexcasting.client.RenderLib; -import at.petrak.hexcasting.common.items.ItemScroll; +import at.petrak.hexcasting.common.items.storage.ItemScroll; import at.petrak.hexcasting.common.lib.HexItems; import at.petrak.hexcasting.common.lib.HexSounds; import at.petrak.hexcasting.common.network.MsgNewWallScrollAck; @@ -53,7 +53,7 @@ public class EntityWallScroll extends HangingEntity { } public EntityWallScroll(Level world, BlockPos pos, Direction dir, ItemStack scroll, boolean showStrokeOrder, - int blockSize) { + int blockSize) { super(HexEntities.WALL_SCROLL, world, pos); this.setDirection(dir); this.blockSize = blockSize; @@ -160,7 +160,7 @@ public class EntityWallScroll extends HangingEntity { } public void readSpawnData(BlockPos pos, Direction dir, ItemStack scrollItem, - boolean showsStrokeOrder, int blockSize) { + boolean showsStrokeOrder, int blockSize) { this.pos = pos; this.scroll = scrollItem; this.blockSize = blockSize; @@ -203,7 +203,7 @@ public class EntityWallScroll extends HangingEntity { @Override public void lerpTo(double pX, double pY, double pZ, float pYaw, float pPitch, int pPosRotationIncrements, - boolean pTeleport) { + boolean pTeleport) { BlockPos blockpos = this.pos.offset(pX - this.getX(), pY - this.getY(), pZ - this.getZ()); this.setPos(blockpos.getX(), blockpos.getY(), blockpos.getZ()); } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/ItemAbacus.java b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemAbacus.java similarity index 95% rename from Common/src/main/java/at/petrak/hexcasting/common/items/ItemAbacus.java rename to Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemAbacus.java index 8c933e68..c9d6ca85 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/ItemAbacus.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemAbacus.java @@ -1,11 +1,11 @@ -package at.petrak.hexcasting.common.items; +package at.petrak.hexcasting.common.items.storage; -import at.petrak.hexcasting.api.item.IotaHolderItem; import at.petrak.hexcasting.api.casting.iota.DoubleIota; import at.petrak.hexcasting.api.casting.iota.Iota; +import at.petrak.hexcasting.api.item.IotaHolderItem; import at.petrak.hexcasting.api.utils.NBTHelper; -import at.petrak.hexcasting.common.lib.hex.HexIotaTypes; import at.petrak.hexcasting.common.lib.HexSounds; +import at.petrak.hexcasting.common.lib.hex.HexIotaTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.InteractionHand; @@ -66,7 +66,7 @@ public class ItemAbacus extends Item implements IotaHolderItem { @Override public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, List pTooltipComponents, - TooltipFlag pIsAdvanced) { + TooltipFlag pIsAdvanced) { IotaHolderItem.appendHoverText(this, pStack, pTooltipComponents, pIsAdvanced); } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/ItemFocus.java b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemFocus.java similarity index 97% rename from Common/src/main/java/at/petrak/hexcasting/common/items/ItemFocus.java rename to Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemFocus.java index 48ea9b5e..24864975 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/ItemFocus.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemFocus.java @@ -1,4 +1,4 @@ -package at.petrak.hexcasting.common.items; +package at.petrak.hexcasting.common.items.storage; import at.petrak.hexcasting.api.casting.iota.Iota; import at.petrak.hexcasting.api.casting.iota.NullIota; diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/ItemScroll.java b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemScroll.java similarity index 99% rename from Common/src/main/java/at/petrak/hexcasting/common/items/ItemScroll.java rename to Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemScroll.java index c0fa5de2..4ed6093a 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/ItemScroll.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemScroll.java @@ -1,4 +1,4 @@ -package at.petrak.hexcasting.common.items; +package at.petrak.hexcasting.common.items.storage; import at.petrak.hexcasting.api.casting.iota.Iota; import at.petrak.hexcasting.api.casting.iota.PatternIota; diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/ItemSlate.java b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemSlate.java similarity index 98% rename from Common/src/main/java/at/petrak/hexcasting/common/items/ItemSlate.java rename to Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemSlate.java index db576751..3821a83e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/ItemSlate.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemSlate.java @@ -1,4 +1,4 @@ -package at.petrak.hexcasting.common.items; +package at.petrak.hexcasting.common.items.storage; import at.petrak.hexcasting.annotations.SoftImplement; import at.petrak.hexcasting.api.HexAPI; diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/ItemSpellbook.java b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemSpellbook.java similarity index 98% rename from Common/src/main/java/at/petrak/hexcasting/common/items/ItemSpellbook.java rename to Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemSpellbook.java index f05bcc4b..79b327a4 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/items/ItemSpellbook.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemSpellbook.java @@ -1,8 +1,8 @@ -package at.petrak.hexcasting.common.items; +package at.petrak.hexcasting.common.items.storage; -import at.petrak.hexcasting.api.item.IotaHolderItem; import at.petrak.hexcasting.api.casting.iota.Iota; import at.petrak.hexcasting.api.casting.iota.NullIota; +import at.petrak.hexcasting.api.item.IotaHolderItem; import at.petrak.hexcasting.api.utils.NBTHelper; import at.petrak.hexcasting.common.lib.hex.HexIotaTypes; import net.minecraft.ChatFormatting; @@ -42,7 +42,7 @@ public class ItemSpellbook extends Item implements IotaHolderItem { @Override public void appendHoverText(ItemStack stack, @Nullable Level level, List tooltip, - TooltipFlag isAdvanced) { + TooltipFlag isAdvanced) { boolean sealed = isSealed(stack); boolean empty = false; if (NBTHelper.hasNumber(stack, TAG_SELECTED_PAGE)) { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemThoughtKnot.java b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemThoughtKnot.java new file mode 100644 index 00000000..8f189716 --- /dev/null +++ b/Common/src/main/java/at/petrak/hexcasting/common/items/storage/ItemThoughtKnot.java @@ -0,0 +1,52 @@ +package at.petrak.hexcasting.common.items.storage; + +import at.petrak.hexcasting.api.casting.iota.Iota; +import at.petrak.hexcasting.api.item.IotaHolderItem; +import at.petrak.hexcasting.api.utils.NBTHelper; +import at.petrak.hexcasting.common.lib.hex.HexIotaTypes; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +import static at.petrak.hexcasting.api.HexAPI.modLoc; + +// Would love to be able to just write to a piece of string but the api requires it to be the same item +public class ItemThoughtKnot extends Item implements IotaHolderItem { + public static final ResourceLocation WRITTEN_PRED = modLoc("written"); + + public static final String TAG_DATA = "data"; + + public ItemThoughtKnot(Properties properties) { + super(properties); + } + + @Override + public @Nullable CompoundTag readIotaTag(ItemStack stack) { + return NBTHelper.getCompound(stack, TAG_DATA); + } + + @Override + public boolean canWrite(ItemStack stack, @Nullable Iota iota) { + return iota != null && !NBTHelper.contains(stack, TAG_DATA); + } + + @Override + public void writeDatum(ItemStack stack, @Nullable Iota iota) { + if (iota != null) { + NBTHelper.putCompound(stack, TAG_DATA, HexIotaTypes.serialize(iota)); + } + } + + @Override + public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, + List pTooltipComponents, TooltipFlag pIsAdvanced) { + IotaHolderItem.appendHoverText(this, pStack, pTooltipComponents, pIsAdvanced); + } +} 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 0dd1878b..d80e3a21 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 @@ -1,10 +1,14 @@ package at.petrak.hexcasting.common.lib; -import at.petrak.hexcasting.common.items.*; +import at.petrak.hexcasting.common.items.ItemJewelerHammer; +import at.petrak.hexcasting.common.items.ItemLens; +import at.petrak.hexcasting.common.items.ItemLoreFragment; +import at.petrak.hexcasting.common.items.ItemStaff; import at.petrak.hexcasting.common.items.colorizer.ItemDyeColorizer; import at.petrak.hexcasting.common.items.colorizer.ItemPrideColorizer; import at.petrak.hexcasting.common.items.colorizer.ItemUUIDColorizer; import at.petrak.hexcasting.common.items.magic.*; +import at.petrak.hexcasting.common.items.storage.*; import at.petrak.hexcasting.xplat.IXplatAbstractions; import net.minecraft.Util; import net.minecraft.resources.ResourceLocation; @@ -49,6 +53,7 @@ public class HexItems { .tab(IXplatAbstractions.INSTANCE.getTab()))); public static final ItemAbacus ABACUS = make("abacus", new ItemAbacus(unstackable())); + public static final ItemThoughtKnot THOUGHT_KNOT = make("thought_knot", new ItemThoughtKnot(unstackable())); public static final ItemFocus FOCUS = make("focus", new ItemFocus(unstackable())); public static final ItemSpellbook SPELLBOOK = make("spellbook", new ItemSpellbook(unstackable())); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/loot/AddPerWorldPatternToScrollFunc.java b/Common/src/main/java/at/petrak/hexcasting/common/loot/AddPerWorldPatternToScrollFunc.java index 5ed1ad4e..beb88a4b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/loot/AddPerWorldPatternToScrollFunc.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/loot/AddPerWorldPatternToScrollFunc.java @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.loot; import at.petrak.hexcasting.common.casting.PatternRegistryManifest; -import at.petrak.hexcasting.common.items.ItemScroll; +import at.petrak.hexcasting.common.items.storage.ItemScroll; import at.petrak.hexcasting.common.lib.HexLootFunctions; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; diff --git a/Common/src/main/java/at/petrak/hexcasting/common/network/MsgShiftScrollSyn.java b/Common/src/main/java/at/petrak/hexcasting/common/network/MsgShiftScrollSyn.java index 985491af..8b64955d 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/network/MsgShiftScrollSyn.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/network/MsgShiftScrollSyn.java @@ -1,11 +1,11 @@ package at.petrak.hexcasting.common.network; import at.petrak.hexcasting.api.utils.NBTHelper; -import at.petrak.hexcasting.common.items.ItemAbacus; -import at.petrak.hexcasting.common.items.ItemSpellbook; -import at.petrak.hexcasting.common.lib.hex.HexIotaTypes; +import at.petrak.hexcasting.common.items.storage.ItemAbacus; +import at.petrak.hexcasting.common.items.storage.ItemSpellbook; import at.petrak.hexcasting.common.lib.HexItems; import at.petrak.hexcasting.common.lib.HexSounds; +import at.petrak.hexcasting.common.lib.hex.HexIotaTypes; import io.netty.buffer.ByteBuf; import net.minecraft.ChatFormatting; import net.minecraft.network.FriendlyByteBuf; diff --git a/Common/src/main/java/at/petrak/hexcasting/common/recipe/SealSpellbookRecipe.java b/Common/src/main/java/at/petrak/hexcasting/common/recipe/SealSpellbookRecipe.java index 49156f35..b8130095 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/recipe/SealSpellbookRecipe.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/recipe/SealSpellbookRecipe.java @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.recipe; import at.petrak.hexcasting.api.item.IotaHolderItem; import at.petrak.hexcasting.api.utils.NBTHelper; -import at.petrak.hexcasting.common.items.ItemSpellbook; +import at.petrak.hexcasting.common.items.storage.ItemSpellbook; import at.petrak.hexcasting.common.lib.HexItems; import at.petrak.hexcasting.xplat.IXplatAbstractions; import net.minecraft.core.NonNullList; diff --git a/Common/src/main/java/at/petrak/hexcasting/common/recipe/SealThingsRecipe.java b/Common/src/main/java/at/petrak/hexcasting/common/recipe/SealThingsRecipe.java index 99941f1f..45cd78c3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/recipe/SealThingsRecipe.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/recipe/SealThingsRecipe.java @@ -1,8 +1,8 @@ package at.petrak.hexcasting.common.recipe; import at.petrak.hexcasting.api.mod.HexTags; -import at.petrak.hexcasting.common.items.ItemFocus; -import at.petrak.hexcasting.common.items.ItemSpellbook; +import at.petrak.hexcasting.common.items.storage.ItemFocus; +import at.petrak.hexcasting.common.items.storage.ItemSpellbook; import at.petrak.hexcasting.common.lib.HexItems; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.StringRepresentable; diff --git a/Common/src/main/resources/assets/hexcasting/lang/en_us.json b/Common/src/main/resources/assets/hexcasting/lang/en_us.json index d6fda312..eb047bbc 100644 --- a/Common/src/main/resources/assets/hexcasting/lang/en_us.json +++ b/Common/src/main/resources/assets/hexcasting/lang/en_us.json @@ -10,6 +10,7 @@ "item.hexcasting.warped_staff": "Warped Staff", "item.hexcasting.mangrove_staff": "Mangrove Staff", "item.hexcasting.edified_staff": "Edified Staff", + "item.hexcasting.thought_knot": "Thought-Knot", "item.hexcasting.focus": "Focus", "item.hexcasting.focus.sealed": "Sealed Focus", "item.hexcasting.spellbook": "Spellbook", diff --git a/Common/src/main/resources/assets/hexcasting/textures/item/thought_knot.png b/Common/src/main/resources/assets/hexcasting/textures/item/thought_knot.png new file mode 100644 index 0000000000000000000000000000000000000000..db2a0191aa760d388670eeb415361108bca2680c GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|7J0fjhFJ7& z4KfruY`{_c&g#hekGJ@L?0NdB-d2(SgNJ&RQG&YcsYxyhiVB*4m8;$}In2AVPlv(b z-tnKJr!4dB%flB2%`Pr{?KfF4($zb6QE$weNjkeq7PelW*QVb8P{!_V&5qeObFR-* zdG#(tc|zx(xGZ6Y$Mc*fIDP)}_E?95_pEt+oG~e$IxmiVF}e1x=ZW62Z(BFpO1{_n g6+AZ~B;_Ojw#)a{UfMgW5a?P4Pgg&ebxsLQ0GcskNdN!< literal 0 HcmV?d00001 diff --git a/Common/src/main/resources/assets/hexcasting/textures/item/thought_knot_overlay.png b/Common/src/main/resources/assets/hexcasting/textures/item/thought_knot_overlay.png new file mode 100644 index 0000000000000000000000000000000000000000..abc0d17e106199d52ee225f825194cff95f8da9e GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|$~|2iLo9mV zPEh1yHsoPh9?JZuE#SXN|4C*i-%tF(`xO-yq)zpl?lv{5!g=rJC`rA#XWOj5-J74r z*04J`+xDrvb!4cZ;4z6Ezm3Z8pVU+>I=6e`YbIl5r5VLSf*l;Ie$_G-%(xr1c*>?f m*FUkp`!_B0>*AV^>T$e|MoTWe=1~MXfx*+&&t;ucLK6T@Z$>Qu literal 0 HcmV?d00001 diff --git a/Fabric/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b b/Fabric/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b index 6c4f4c97..e84eed21 100644 --- a/Fabric/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b +++ b/Fabric/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b @@ -1,4 +1,4 @@ -// 1.19.2 2023-01-31T19:01:22.797440382 Tags for minecraft:item +// 1.19.2 2023-02-15T01:14:56.227341815 Tags for minecraft:item 5928bad07d3872bb60f29ef4f3c885c8e1967c20 data/hexcasting/tags/items/phial_base.json fdb48f194d7937ab6b423fa4b90a4d438bf6dd90 data/minecraft/tags/items/wooden_doors.json e5df19a1dc6eadf14cd9b0f0fe45a74330b745e9 data/hexcasting/tags/items/edified_planks.json diff --git a/Fabric/src/generated/resources/.cache/67cce32b1c3cbbcb1f646605f4914e3f196986c2 b/Fabric/src/generated/resources/.cache/67cce32b1c3cbbcb1f646605f4914e3f196986c2 index d9b94060..64515b52 100644 --- a/Fabric/src/generated/resources/.cache/67cce32b1c3cbbcb1f646605f4914e3f196986c2 +++ b/Fabric/src/generated/resources/.cache/67cce32b1c3cbbcb1f646605f4914e3f196986c2 @@ -1,4 +1,4 @@ -// 1.19.2 2023-01-31T19:01:22.799226001 LootTables +// 1.19.2 2023-02-15T01:14:56.222862371 LootTables dec1d3592e82f99d9e059d9c771530f103b2bda5 data/hexcasting/loot_tables/blocks/empty_directrix.json 2c42fc5d8c74c98ad15b8bd50f56541fccbef750 data/hexcasting/loot_tables/blocks/edified_tile.json cfb39e2151725fe4f9a7269d9b5de8031ea54a44 data/hexcasting/loot_tables/blocks/directrix_redstone.json diff --git a/Fabric/src/generated/resources/.cache/75bcd4dba6ca7d365462b0ec45e291d1056349c4 b/Fabric/src/generated/resources/.cache/75bcd4dba6ca7d365462b0ec45e291d1056349c4 index 50c7e562..e6647fcd 100644 --- a/Fabric/src/generated/resources/.cache/75bcd4dba6ca7d365462b0ec45e291d1056349c4 +++ b/Fabric/src/generated/resources/.cache/75bcd4dba6ca7d365462b0ec45e291d1056349c4 @@ -1,4 +1,4 @@ -// 1.19.2 2023-01-31T19:01:22.794241549 Tags for minecraft:block +// 1.19.2 2023-02-15T01:14:56.244629488 Tags for minecraft:block 20183cd61968ff6548df2dde1100b6378d68d64b data/minecraft/tags/blocks/wooden_buttons.json 357eddf3cee6f16725bed0701d57b2ca3097d74d data/minecraft/tags/blocks/mineable/shovel.json 5216ba5c57db29b8dee9aebc63a2e3b17c97dc17 data/minecraft/tags/blocks/wooden_trapdoors.json diff --git a/Fabric/src/generated/resources/.cache/844611d4af49e23072b8a888c8e73c6c5d8c0768 b/Fabric/src/generated/resources/.cache/844611d4af49e23072b8a888c8e73c6c5d8c0768 index 88edd941..ba4d8790 100644 --- a/Fabric/src/generated/resources/.cache/844611d4af49e23072b8a888c8e73c6c5d8c0768 +++ b/Fabric/src/generated/resources/.cache/844611d4af49e23072b8a888c8e73c6c5d8c0768 @@ -1,4 +1,4 @@ -// 1.19.2 2023-01-31T19:01:22.804380382 Tags for hexcasting:action +// 1.19.2 2023-02-15T01:14:56.245457869 Tags for hexcasting:action e5afc567ea17f035e4eb1d1d48825100b7f6ad68 data/hexcasting/tags/action/per_world_pattern.json e5afc567ea17f035e4eb1d1d48825100b7f6ad68 data/hexcasting/tags/action/requires_enlightenment.json e5afc567ea17f035e4eb1d1d48825100b7f6ad68 data/hexcasting/tags/action/can_start_enlighten.json diff --git a/Fabric/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/Fabric/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 2492ade0..9d9a65a8 100644 --- a/Fabric/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/Fabric/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.19.2 2023-01-31T19:01:22.800310741 Recipes +// 1.19.2 2023-02-15T01:14:56.228330969 Recipes 9f75d3e93ecbbbf3ed9a92b2943397e09dcae1a9 data/hexcasting/recipes/dye_colorizer_light_blue.json 04569ccadfd99f203b0485d0c3e877209290f2b3 data/hexcasting/advancements/recipes/hexcasting.creative_tab/dye_colorizer_pink.json 2a9d4a0f3618abf9e9b8699b318a984d2c836913 data/hexcasting/advancements/recipes/brainsweep/brainsweep/directrix_redstone.json 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 a4dd87da..554533e7 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 @@ -1,13 +1,14 @@ package at.petrak.hexcasting.forge.datagen.xplat; import at.petrak.hexcasting.api.HexAPI; -import at.petrak.hexcasting.common.items.ItemFocus; -import at.petrak.hexcasting.common.items.ItemScroll; -import at.petrak.hexcasting.common.items.ItemSlate; import at.petrak.hexcasting.common.items.ItemStaff; import at.petrak.hexcasting.common.items.colorizer.ItemPrideColorizer; import at.petrak.hexcasting.common.items.magic.ItemMediaBattery; import at.petrak.hexcasting.common.items.magic.ItemPackagedHex; +import at.petrak.hexcasting.common.items.storage.ItemFocus; +import at.petrak.hexcasting.common.items.storage.ItemScroll; +import at.petrak.hexcasting.common.items.storage.ItemSlate; +import at.petrak.hexcasting.common.items.storage.ItemThoughtKnot; import at.petrak.hexcasting.common.lib.HexBlocks; import at.petrak.hexcasting.common.lib.HexItems; import at.petrak.paucal.api.forge.datagen.PaucalItemModelProvider; @@ -88,6 +89,7 @@ public class HexItemModels extends PaucalItemModelProvider { simpleItem(modLoc("patchouli_book")); + buildThoughtKnot(); buildSealableIotaHolder(HexItems.FOCUS, "focus"); buildSealableIotaHolder(HexItems.SPELLBOOK, "spellbook"); @@ -161,6 +163,19 @@ public class HexItemModels extends PaucalItemModelProvider { .parent(new ModelFile.UncheckedModelFile(modLoc("block/edified_pressure_plate"))); } + private void buildThoughtKnot() { + var unwritten = singleTexture("thought_knot", new ResourceLocation("item/generated"), + "layer0", modLoc("item/thought_knot")); + var written = withExistingParent("thought_knot_written", new ResourceLocation("item/generated")) + .texture("layer0", modLoc("item/thought_knot")) + .texture("layer1", modLoc("item/thought_knot_overlay")); + getBuilder("thought_knot") + .override().predicate(ItemThoughtKnot.WRITTEN_PRED, 0f) + .model(unwritten).end() + .override().predicate(ItemThoughtKnot.WRITTEN_PRED, 1f) + .model(written).end(); + } + private void buildSealableIotaHolder(Item item, String stub) { var name = getPath(item); var plain = singleTexture(name, new ResourceLocation("item/generated"), From 588a554efa436138ba067f9f608b1a10e2ca7c63 Mon Sep 17 00:00:00 2001 From: "petrak@" Date: Wed, 15 Feb 2023 02:21:48 -0600 Subject: [PATCH 03/20] document and add recipe for thought knots --- .../datagen/recipe/HexplatRecipes.java | 5 +++ .../assets/hexcasting/lang/en_us.json | 16 +++++++--- .../thehexbook/en_us/entries/items/lens.json | 3 +- .../en_us/entries/items/thought_knot.json | 27 ++++++++++++++++ .../03e4de26f1265135874f8cdcaebc09d9c08eb42b | 2 +- .../67cce32b1c3cbbcb1f646605f4914e3f196986c2 | 2 +- .../75bcd4dba6ca7d365462b0ec45e291d1056349c4 | 2 +- .../844611d4af49e23072b8a888c8e73c6c5d8c0768 | 2 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 4 ++- .../hexcasting.creative_tab/thought_knot.json | 32 +++++++++++++++++++ .../data/hexcasting/recipes/thought_knot.json | 14 ++++++++ .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 4 ++- .../recipes/hexcasting/thought_knot.json | 32 +++++++++++++++++++ .../data/hexcasting/recipes/thought_knot.json | 14 ++++++++ 14 files changed, 147 insertions(+), 12 deletions(-) create mode 100644 Common/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/thought_knot.json create mode 100644 Fabric/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting.creative_tab/thought_knot.json create mode 100644 Fabric/src/generated/resources/data/hexcasting/recipes/thought_knot.json create mode 100644 Forge/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting/thought_knot.json create mode 100644 Forge/src/generated/resources/data/hexcasting/recipes/thought_knot.json 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 fdab8d4c..6fb213a3 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 @@ -71,6 +71,11 @@ public class HexplatRecipes extends PaucalRecipeProvider { staffRecipe(recipes, HexItems.STAFF_MANGROVE, Items.MANGROVE_PLANKS); staffRecipe(recipes, HexItems.STAFF_EDIFIED, HexBlocks.EDIFIED_PLANKS.asItem()); + ShapelessRecipeBuilder.shapeless(HexItems.THOUGHT_KNOT) + .requires(HexItems.AMETHYST_DUST) + .requires(Items.STRING) + .unlockedBy("has_item", hasItem(HexTags.Items.STAVES)) + .save(recipes); ShapedRecipeBuilder.shaped(HexItems.FOCUS) .define('G', ingredients.glowstoneDust()) .define('L', ingredients.leather()) diff --git a/Common/src/main/resources/assets/hexcasting/lang/en_us.json b/Common/src/main/resources/assets/hexcasting/lang/en_us.json index eb047bbc..1c2e71a0 100644 --- a/Common/src/main/resources/assets/hexcasting/lang/en_us.json +++ b/Common/src/main/resources/assets/hexcasting/lang/en_us.json @@ -752,17 +752,23 @@ "hexcasting.entry.lens": "Scrying Lens", "hexcasting.page.lens.1": "_Media can have peculiar effects on any type of information, in specific circumstances. Coating a glass in a thin film of it can lead to ... elucidating insights.$(br2)By holding a $(l:items/lens)$(item)Scrying Lens/$ in my hand, certain blocks will display additional information when I look at them.", - "hexcasting.page.lens.2": "For example, looking at a piece of $(item)Redstone/$ will display its signal strength. I suspect I will discover other blocks with additional insight as my studies into my art progress.$(br2)In addition, holding it while casting using a $(l:items/staff)$(item)Staff/$ will shrink the spacing between dots, allowing me to draw more on my grid.$(br2)I can also wear it on my head as a strange sort of monocle. This reveals information, but won't shrink my grid. No matter. There must be a way to have both...", + "hexcasting.page.lens.2": "For example, looking at a piece of $(item)Redstone/$ will display its signal strength. I suspect I will discover other blocks with additional insight as my studies into my art progress.$(br2)In addition, holding it while casting using a $(l:items/staff)$(item)Staff/$ will shrink the spacing between dots, allowing me to draw more on my grid.$(br2)I can also wear it on my head as a strange sort of monocle.", "hexcasting.page.lens.crafting.desc": "$(italic)You must learn... to see what you are looking at./$", + "hexcasting.entry.thought_knot": "Thought-Knot", + "hexcasting.page.thought_knot.1": "The forgetful often tie a piece of string about their finger to help them remember something important. I believe this idea might be of use in my art. A specially knotted piece of string should be able to hold a single iota stably, irregardless of my stack.$(br2)I will call my invention a $(item)Thought-Knot/$.", + "hexcasting.page.thought_knot.2": "When I craft it, it stores no iota. Using $(l:patterns/readwrite#hexcasting:write)$(action)Scribe's Gambit/$ while holding a $(item)Thought-Knot/$ in my other hand will remove the top of the stack and save it into the $(item)Thought-Knot/$. Using $(l:patterns/readwrite#hexcasting:read)$(action)Scribe's Reflection/$ will copy whatever iota's in the $(item)Thought-Knot/$ and add it to the stack.$(br2)Once a $(item)Thought-Knot/$ has been written to, the string is indelibly tangled; the iota can be read any number of times, but there is no way to erase or overwrite it. Fortunately, they are not expensive.", + "hexcasting.page.thought_knot.3": "Also, if I store an entity in a $(item)Thought-Knot/$ and try to recall it after the referenced entity has died or otherwise disappeared, the $(l:patterns/readwrite#hexcasting:read)$(action)Scribe's Reflection/$ will add $(l:casting/influences)$(thing)Null/$ to the stack instead.", + "hexcasting.page.thought_knot.crafting.desc": "$(italic)How would you feel if someone saw you wearing a sign that said, \"I am dashing and handsome?\"/$", + "hexcasting.entry.focus": "Focus", - "hexcasting.page.focus.1": "A $(l:items/focus)$(item)Focus/$ can store a single iota.$(br2)When I craft it, it holds the $(l:casting/influences)$(thing)Null/$ influence by default. Using $(l:patterns/readwrite#hexcasting:write)$(action)Scribe's Gambit/$ while holding a $(l:items/focus)$(item)Focus/$ in my other hand will remove the top of the stack and save it into the $(l:items/focus)$(item)Focus/$. Using $(l:patterns/readwrite#hexcasting:read)$(action)Scribe's Reflection/$ will copy whatever iota's in the $(l:items/focus)$(item)Focus/$ and add it to the stack.", - "hexcasting.page.focus.2": "It occurs to me that I could conceivably store a whole list of patterns in a $(l:items/focus)$(item)Focus/$, then recall them and evaluate them with $(l:patterns/meta#hexcasting:eval)$(action)Hermes' Gambit/$. This way I can cast complex spells, or parts of spells, without having to draw them over and over.$(br2)I could use this like a slightly less convenient $(l:items/hexcasting#artifact)$(item)Artifact/$, but I think I could get much better dividends by putting common \"phrases\" in a $(l:items/focus)$(item)Focus/$, like the patterns for figuring out where I'm looking.", - "hexcasting.page.focus.3": "Also, if I store an entity in a $(l:items/focus)$(item)Focus/$ and try to recall it after the referenced entity has died or otherwise disappeared, the $(l:patterns/readwrite#hexcasting:read)$(action)Scribe's Reflection/$ will add $(l:casting/influences)$(thing)Null/$ to the stack instead.$(br2)Finally, it seems if I wish to protect a $(l:items/focus)$(item)focus/$ from accidentally being overwritten, I can seal it with wax by crafting it with a $(item)Honeycomb/$. Attempting to use $(l:patterns/readwrite#hexcasting:write)$(action)Scribe's Gambit/$ on a sealed focus will fail. $(l:patterns/spells/hexcasting#hexcasting:erase)$(action)Erase Item/$ will remove this seal along with the contents.", + "hexcasting.page.focus.1": "A $(item)Focus/$ is like a $(l:items/thought_knot)$(item)Thought-Knot/$, in that iota can be written to or read from it. However, the advantage of a focus is that it is $(italic)reusable/$. If I make a mistake in the iota I write to a $(item)Focus, I can simply cast $(l:patterns/readwrite#hexcasting:write)$(action)Scribe's Gambit/$ again and write over the iota inside.", + "hexcasting.page.focus.2": "If I wish to protect a $(l:items/focus)$(item)focus/$ from accidentally being overwritten, I can seal it with wax by crafting it with a $(item)Honeycomb/$. Attempting to use $(l:patterns/readwrite#hexcasting:write)$(action)Scribe's Gambit/$ on a sealed focus will fail.$(br2)$(l:patterns/spells/hexcasting#hexcasting:erase)$(action)Erase Item/$ will remove this seal along with the contents.", + "hexcasting.page.focus.3": "Indeed, the only advantage of my $(l:items/thought_knot)$(item)Thought-Knot/$s have over $(item)Foci/$ is that $(item)Foci/$ are more expensive to produce. My research indicates that the early practitioners of the art used exclusively $(item)Foci/$, with the $(l:items/thought_knot)$(item)Thought-Knot/$ being an original creation of mine.$(br2)Whoever those ancient people were, they must have been very prosperous.", "hexcasting.page.focus.crafting.desc": "$(italic)Poison apples, poison worms./$", "hexcasting.entry.abacus": "Abacus", - "hexcasting.page.abacus.1": "Although there are $(l:patterns/numbers)$(action)patterns for drawing numbers/$, I find them ... cumbersome, to say the least.$(br2)Fortunately, the old masters of my craft invented an ingenious device called an $(l:items/abacus)$(item)Abacus/$ to provide numbers to my casting. I simply set the number to what I want, then read the value using $(l:patterns/readwrite#hexcasting:read)$(action)Scribe's Reflection/$, just like I would read a $(l:items/focus)$(item)Focus/$.", + "hexcasting.page.abacus.1": "Although there are $(l:patterns/numbers)$(action)patterns for drawing numbers/$, I find them ... cumbersome, to say the least.$(br2)Fortunately, the old masters of my craft invented an ingenious device called an $(l:items/abacus)$(item)Abacus/$ to provide numbers to my casting. I simply set the number to what I want, then read the value using $(l:patterns/readwrite#hexcasting:read)$(action)Scribe's Reflection/$, just like I would read a $(l:items/thought_knot)$(item)Thought-Knot/$ or $(l:items/focus)$(item)Focus/$.", "hexcasting.page.abacus.2": "To operate one, I simply hold it, sneak, and scroll. If in my main hand, the number will increment or decrement by 1, or 10 if I am also holding Control/Command. If in my off hand, the number will increment or decrement by 0.1, or 0.001 if I am also holding Control/Command.$(br2)I can shake the abacus to reset it to zero by sneak-right-clicking.", "hexcasting.page.abacus.crafting.desc": "$(italic)Mathematics? That's for eggheads!/$", diff --git a/Common/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/lens.json b/Common/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/lens.json index 9bdadb99..857a7b54 100644 --- a/Common/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/lens.json +++ b/Common/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/lens.json @@ -3,7 +3,8 @@ "icon": "hexcasting:lens", "category": "hexcasting:items", "advancement": "hexcasting:root", - "sortnum": 0, + "priority": true, + "sortnum": 2, "pages": [ { "type": "patchouli:text", diff --git a/Common/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/thought_knot.json b/Common/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/thought_knot.json new file mode 100644 index 00000000..c9eb1f15 --- /dev/null +++ b/Common/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/thought_knot.json @@ -0,0 +1,27 @@ +{ + "name": "hexcasting.entry.thought_knot", + "icon": "hexcasting:thought_knot", + "category": "hexcasting:items", + "sortnum": 4, + "priority": true, + "advancement": "hexcasting:root", + "pages": [ + { + "type": "patchouli:text", + "text": "hexcasting.page.thought_knot.1" + }, + { + "type": "patchouli:text", + "text": "hexcasting.page.thought_knot.2" + }, + { + "type": "patchouli:text", + "text": "hexcasting.page.thought_knot.3" + }, + { + "type": "patchouli:crafting", + "recipe": "hexcasting:thought_knot", + "text": "hexcasting.page.thought_knot.crafting.desc" + } + ] +} diff --git a/Fabric/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b b/Fabric/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b index e84eed21..b8671655 100644 --- a/Fabric/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b +++ b/Fabric/src/generated/resources/.cache/03e4de26f1265135874f8cdcaebc09d9c08eb42b @@ -1,4 +1,4 @@ -// 1.19.2 2023-02-15T01:14:56.227341815 Tags for minecraft:item +// 1.19.2 2023-02-15T02:11:12.160530576 Tags for minecraft:item 5928bad07d3872bb60f29ef4f3c885c8e1967c20 data/hexcasting/tags/items/phial_base.json fdb48f194d7937ab6b423fa4b90a4d438bf6dd90 data/minecraft/tags/items/wooden_doors.json e5df19a1dc6eadf14cd9b0f0fe45a74330b745e9 data/hexcasting/tags/items/edified_planks.json diff --git a/Fabric/src/generated/resources/.cache/67cce32b1c3cbbcb1f646605f4914e3f196986c2 b/Fabric/src/generated/resources/.cache/67cce32b1c3cbbcb1f646605f4914e3f196986c2 index 64515b52..1b307cfd 100644 --- a/Fabric/src/generated/resources/.cache/67cce32b1c3cbbcb1f646605f4914e3f196986c2 +++ b/Fabric/src/generated/resources/.cache/67cce32b1c3cbbcb1f646605f4914e3f196986c2 @@ -1,4 +1,4 @@ -// 1.19.2 2023-02-15T01:14:56.222862371 LootTables +// 1.19.2 2023-02-15T02:11:12.129277989 LootTables dec1d3592e82f99d9e059d9c771530f103b2bda5 data/hexcasting/loot_tables/blocks/empty_directrix.json 2c42fc5d8c74c98ad15b8bd50f56541fccbef750 data/hexcasting/loot_tables/blocks/edified_tile.json cfb39e2151725fe4f9a7269d9b5de8031ea54a44 data/hexcasting/loot_tables/blocks/directrix_redstone.json diff --git a/Fabric/src/generated/resources/.cache/75bcd4dba6ca7d365462b0ec45e291d1056349c4 b/Fabric/src/generated/resources/.cache/75bcd4dba6ca7d365462b0ec45e291d1056349c4 index e6647fcd..404dc4f5 100644 --- a/Fabric/src/generated/resources/.cache/75bcd4dba6ca7d365462b0ec45e291d1056349c4 +++ b/Fabric/src/generated/resources/.cache/75bcd4dba6ca7d365462b0ec45e291d1056349c4 @@ -1,4 +1,4 @@ -// 1.19.2 2023-02-15T01:14:56.244629488 Tags for minecraft:block +// 1.19.2 2023-02-15T02:11:12.162941713 Tags for minecraft:block 20183cd61968ff6548df2dde1100b6378d68d64b data/minecraft/tags/blocks/wooden_buttons.json 357eddf3cee6f16725bed0701d57b2ca3097d74d data/minecraft/tags/blocks/mineable/shovel.json 5216ba5c57db29b8dee9aebc63a2e3b17c97dc17 data/minecraft/tags/blocks/wooden_trapdoors.json diff --git a/Fabric/src/generated/resources/.cache/844611d4af49e23072b8a888c8e73c6c5d8c0768 b/Fabric/src/generated/resources/.cache/844611d4af49e23072b8a888c8e73c6c5d8c0768 index ba4d8790..d7b57144 100644 --- a/Fabric/src/generated/resources/.cache/844611d4af49e23072b8a888c8e73c6c5d8c0768 +++ b/Fabric/src/generated/resources/.cache/844611d4af49e23072b8a888c8e73c6c5d8c0768 @@ -1,4 +1,4 @@ -// 1.19.2 2023-02-15T01:14:56.245457869 Tags for hexcasting:action +// 1.19.2 2023-02-15T02:11:12.177979068 Tags for hexcasting:action e5afc567ea17f035e4eb1d1d48825100b7f6ad68 data/hexcasting/tags/action/per_world_pattern.json e5afc567ea17f035e4eb1d1d48825100b7f6ad68 data/hexcasting/tags/action/requires_enlightenment.json e5afc567ea17f035e4eb1d1d48825100b7f6ad68 data/hexcasting/tags/action/can_start_enlighten.json diff --git a/Fabric/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/Fabric/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 9d9a65a8..75b2a87e 100644 --- a/Fabric/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/Fabric/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.19.2 2023-02-15T01:14:56.228330969 Recipes +// 1.19.2 2023-02-15T02:11:12.164022928 Recipes 9f75d3e93ecbbbf3ed9a92b2943397e09dcae1a9 data/hexcasting/recipes/dye_colorizer_light_blue.json 04569ccadfd99f203b0485d0c3e877209290f2b3 data/hexcasting/advancements/recipes/hexcasting.creative_tab/dye_colorizer_pink.json 2a9d4a0f3618abf9e9b8699b318a984d2c836913 data/hexcasting/advancements/recipes/brainsweep/brainsweep/directrix_redstone.json @@ -21,6 +21,7 @@ e0609202271e402d8ae58e4f8eaf11dcdda10a9e data/hexcasting/recipes/brainsweep/akas 1b210391768fede639b29ae6fc5adf2b8b4e64c6 data/hexcasting/advancements/recipes/hexcasting.creative_tab/dye_colorizer_brown.json cd22886924e7aaeb62e8f7da0747cc950af9dc32 data/hexcasting/advancements/recipes/hexcasting.creative_tab/pride_colorizer_plural.json 6c54952ecbb6899f3291fe72486e7205e6ab76cc data/hexcasting/recipes/pride_colorizer_intersex.json +2589d3a202f24b2f4f78d90ee3e3ad7961eea023 data/hexcasting/advancements/recipes/hexcasting.creative_tab/thought_knot.json 709232dd093e48895014957f2e4ff5a1a76da583 data/create/recipes/crushing/amethyst_cluster.json ad390fe854110e60aec4c805f7bb5fed45b4e5d1 data/hexcasting/advancements/recipes/hexcasting.creative_tab/amethyst_tiles.json 0ed898da60aa78cd526ff4ae0524359891dbd976 data/hexcasting/advancements/recipes/hexcasting.creative_tab/edified_tile.json @@ -37,6 +38,7 @@ ce0cd4d73792c30dcec2eea306bff44b28cb237f data/hexcasting/recipes/pride_colorizer 4f301e8e812f409be41cfddfa74b1fb7c8034edf data/hexcasting/advancements/recipes/hexcasting.creative_tab/dye_colorizer_purple.json f75c21d35b926a2303d60115a297c387790bbbd9 data/hexcasting/advancements/recipes/hexcasting.creative_tab/edified_trapdoor.json 3b83dd1c1aa1bcc58e6512bca75c3a6a3b7482b3 data/hexcasting/recipes/edified_tile.json +81132fbb6784ed15721aff520964988c1d5be06b data/hexcasting/recipes/thought_knot.json f48c2df6c0981b959c2e1b0bf8ecc4739b2e034f data/hexcasting/advancements/recipes/brainsweep/brainsweep/impetus_look.json b21a84886b937a4c4e72a674f265dccb21411ab9 data/hexcasting/advancements/recipes/hexcasting.creative_tab/focus_rotated.json 0c72527448454438308ba5a4e99452b193fad421 data/hexcasting/recipes/dye_colorizer_gray.json diff --git a/Fabric/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting.creative_tab/thought_knot.json b/Fabric/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting.creative_tab/thought_knot.json new file mode 100644 index 00000000..7d363228 --- /dev/null +++ b/Fabric/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting.creative_tab/thought_knot.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "hexcasting:staves" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "hexcasting:thought_knot" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "hexcasting:thought_knot" + ] + } +} \ No newline at end of file diff --git a/Fabric/src/generated/resources/data/hexcasting/recipes/thought_knot.json b/Fabric/src/generated/resources/data/hexcasting/recipes/thought_knot.json new file mode 100644 index 00000000..13962130 --- /dev/null +++ b/Fabric/src/generated/resources/data/hexcasting/recipes/thought_knot.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "hexcasting:amethyst_dust" + }, + { + "item": "minecraft:string" + } + ], + "result": { + "item": "hexcasting:thought_knot" + } +} \ No newline at end of file diff --git a/Forge/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/Forge/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 275e2cf4..6cbdc084 100644 --- a/Forge/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/Forge/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.19.2 2023-01-22T20:49:42.813938013 Recipes +// 1.19.2 2023-02-15T02:10:16.055363304 Recipes 29056d8bbc023668564ee81f4eb8b2a11411cf4a data/create/recipes/crushing/amethyst_block.json 5bb0b70967a422bfd88c01fa1af64e9b98781fd1 data/create/recipes/crushing/amethyst_cluster.json 229931adf8d62f659de5950d711afd24fb5aa535 data/hexcasting/advancements/recipes/brainsweep/brainsweep/akashic_record.json @@ -90,6 +90,7 @@ f0a77ba758e649d0c16a8e2d9964d18f95a544f4 data/hexcasting/advancements/recipes/he 9c8503715195c4cb2e2d9a1abe4f94df7bb9f4b5 data/hexcasting/advancements/recipes/hexcasting/stonecutting/amethyst_tiles.json 63da3af421dfb38283d750eb3b9761f42e95fb91 data/hexcasting/advancements/recipes/hexcasting/stripped_edified_wood.json e0e49c8a9977fe2b0619179b11a4379b5b19ace9 data/hexcasting/advancements/recipes/hexcasting/sub_sandwich.json +2589d3a202f24b2f4f78d90ee3e3ad7961eea023 data/hexcasting/advancements/recipes/hexcasting/thought_knot.json 993a613fabd0ee1005bde11ebe92f8046351ba9e data/hexcasting/advancements/recipes/hexcasting/trinket.json 4440b41499c9c32e297dc184c39da010ff82ac5e data/hexcasting/advancements/recipes/hexcasting/uuid_colorizer.json dc2a9bf96ca9d04ea6bdeb32249322530b5e1cbf data/hexcasting/advancements/recipes/hexcasting/warped_staff.json @@ -189,6 +190,7 @@ f0852056a692d776bf537c821f3d166c2be88bd8 data/hexcasting/recipes/spruce_staff.js 3608f0ec056f2c5d29a9a89305218497fd2c4383 data/hexcasting/recipes/stonecutting/amethyst_tiles.json 0859373b9e60e80f3c8b0962a3bc94903af43d36 data/hexcasting/recipes/stripped_edified_wood.json 13ca24f9f87a6b34f7717e5c326291079e6db96f data/hexcasting/recipes/sub_sandwich.json +81132fbb6784ed15721aff520964988c1d5be06b data/hexcasting/recipes/thought_knot.json 42ab683499c3b0f7ae594879490a37eb6aff9703 data/hexcasting/recipes/trinket.json ffba0344dfc7f604e8e33a333549f74c53f3e7e6 data/hexcasting/recipes/uuid_colorizer.json 4ffed306e5f640054a6f269ae0e548388f087996 data/hexcasting/recipes/warped_staff.json diff --git a/Forge/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting/thought_knot.json b/Forge/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting/thought_knot.json new file mode 100644 index 00000000..7d363228 --- /dev/null +++ b/Forge/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting/thought_knot.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "hexcasting:staves" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "hexcasting:thought_knot" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "hexcasting:thought_knot" + ] + } +} \ No newline at end of file diff --git a/Forge/src/generated/resources/data/hexcasting/recipes/thought_knot.json b/Forge/src/generated/resources/data/hexcasting/recipes/thought_knot.json new file mode 100644 index 00000000..13962130 --- /dev/null +++ b/Forge/src/generated/resources/data/hexcasting/recipes/thought_knot.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "hexcasting:amethyst_dust" + }, + { + "item": "minecraft:string" + } + ], + "result": { + "item": "hexcasting:thought_knot" + } +} \ No newline at end of file From 88a0234cec7d64ecfc5874252c2c5e0fa733811d Mon Sep 17 00:00:00 2001 From: "petrak@" Date: Wed, 15 Feb 2023 19:14:26 -0600 Subject: [PATCH 04/20] not sure if this is a good look? might go with a BER after all --- .../d2fe5b6fab5fdc7ee7ca336c062752306bdf6128 | 10 +- .../models/block/quenched_allay_0.json | 6 + .../models/block/quenched_allay_1.json | 6 + .../models/block/quenched_allay_2.json | 6 + .../models/block/quenched_allay_3.json | 6 + .../models/item/quenched_allay_0.json | 3 + .../models/item/quenched_allay_1.json | 3 + .../models/item/quenched_allay_2.json | 3 + .../models/item/quenched_allay_3.json | 3 + .../petrak/hexcasting/GaslightingModel.java | 69 ++++ .../hexcasting/client/ClientTickCounter.java | 4 +- .../client/RegisterClientStuff.java | 307 ++---------------- .../client/ScryingLensOverlays.java | 288 ++++++++++++++++ .../common/blocks/BlockQuenchedAllay.java | 11 + .../hexcasting/common/lib/HexBlocks.java | 4 + .../textures/block/quenched_allay.png | Bin 0 -> 191 bytes .../textures/block/quenched_allay_0.png | Bin 0 -> 396 bytes .../textures/block/quenched_allay_1.png | Bin 0 -> 399 bytes .../textures/block/quenched_allay_2.png | Bin 0 -> 411 bytes .../textures/block/quenched_allay_3.png | Bin 0 -> 410 bytes .../fabric/FabricHexClientInitializer.kt | 2 + .../mixin/client/FabricModelManagerMixin.java | 32 ++ .../forge/ForgeHexClientInitializer.java | 12 + .../xplat/HexBlockStatesAndModels.java | 11 +- 24 files changed, 506 insertions(+), 280 deletions(-) create mode 100644 Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_0.json create mode 100644 Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_1.json create mode 100644 Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_2.json create mode 100644 Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_3.json create mode 100644 Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_0.json create mode 100644 Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_1.json create mode 100644 Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_2.json create mode 100644 Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_3.json create mode 100644 Common/src/main/java/at/petrak/hexcasting/GaslightingModel.java create mode 100644 Common/src/main/java/at/petrak/hexcasting/client/ScryingLensOverlays.java create mode 100644 Common/src/main/java/at/petrak/hexcasting/common/blocks/BlockQuenchedAllay.java create mode 100644 Common/src/main/resources/assets/hexcasting/textures/block/quenched_allay.png create mode 100644 Common/src/main/resources/assets/hexcasting/textures/block/quenched_allay_0.png create mode 100644 Common/src/main/resources/assets/hexcasting/textures/block/quenched_allay_1.png create mode 100644 Common/src/main/resources/assets/hexcasting/textures/block/quenched_allay_2.png create mode 100644 Common/src/main/resources/assets/hexcasting/textures/block/quenched_allay_3.png create mode 100644 Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricModelManagerMixin.java diff --git a/Common/src/generated/resources/.cache/d2fe5b6fab5fdc7ee7ca336c062752306bdf6128 b/Common/src/generated/resources/.cache/d2fe5b6fab5fdc7ee7ca336c062752306bdf6128 index 21019dee..5c2e0ed1 100644 --- a/Common/src/generated/resources/.cache/d2fe5b6fab5fdc7ee7ca336c062752306bdf6128 +++ b/Common/src/generated/resources/.cache/d2fe5b6fab5fdc7ee7ca336c062752306bdf6128 @@ -1,4 +1,4 @@ -// 1.19.2 2022-11-05T14:30:43.69127 Block States: hexcasting +// 1.19.2 2023-02-15T18:25:55.007347158 Block States: hexcasting 901e38574bdaa40ea4a0f6e773a88a95d9c03e55 assets/hexcasting/blockstates/akashic_bookshelf.json 32a77ef668198002563d68be35a24fa93c8d454a assets/hexcasting/blockstates/akashic_connector.json 85080ce0a0387583a839e4788517d675a1a35e24 assets/hexcasting/blockstates/akashic_record.json @@ -134,6 +134,10 @@ de2a5fd9b621e5086852f2191c360d9274b9b10c assets/hexcasting/models/block/impetus_ 7ac5cb74f321b061c1e93b859540b508c7dcdaa4 assets/hexcasting/models/block/impetus_storedplayer_lit_south.json 46c29660e3fa78aeaa264268b43017f4b0c0d655 assets/hexcasting/models/block/impetus_storedplayer_lit_up.json 4d22557274958179da4671c43c2f387336a701a2 assets/hexcasting/models/block/impetus_storedplayer_lit_west.json +9af2754cb1e53eeaa85618cf92651b4878cf62b1 assets/hexcasting/models/block/quenched_allay_0.json +de4ff723b4332d4e26bd01f74e0485e28c9a2178 assets/hexcasting/models/block/quenched_allay_1.json +4c29163e07f3a903017e38a9cc102f4b37db20b1 assets/hexcasting/models/block/quenched_allay_2.json +487d34cd8e70b3e468337228b74af5c1b4d14c53 assets/hexcasting/models/block/quenched_allay_3.json e1e7ce0bcc08a53b3e6634f7e5b7a6cf488cf45b assets/hexcasting/models/block/redstone_directrix_powered_dim_down.json fb22e529f1ca638b7e952176694ab1912eb4274b assets/hexcasting/models/block/redstone_directrix_powered_dim_east.json a5a53ec6a3cd54592dcb224245a4515a2b3b72ed assets/hexcasting/models/block/redstone_directrix_powered_dim_north.json @@ -185,6 +189,10 @@ d4a109488c27fc5d60e9054cd1485f1982040ff3 assets/hexcasting/models/item/ancient_s 40e22b81ff5a65154cbb82e2a17a19abbc898e63 assets/hexcasting/models/item/impetus_look.json 485b2fdbe038c1671f7d67747e8d640a2f171266 assets/hexcasting/models/item/impetus_rightclick.json 064caa7c4c05c5f0736fe09745ad42eb4515e767 assets/hexcasting/models/item/impetus_storedplayer.json +bab05b6c9632359d9a2961221d18bf63abccf803 assets/hexcasting/models/item/quenched_allay_0.json +2df419ac393b73acc2c679394d89b38db5af4b04 assets/hexcasting/models/item/quenched_allay_1.json +9e0bcaf7d32799af125ce3487f8a6cdd03bf7c49 assets/hexcasting/models/item/quenched_allay_2.json +da748fddb87f4130b21a30f70f11159f98b0125d assets/hexcasting/models/item/quenched_allay_3.json 769dcfb4a504e4dcd28a43cf603a18c66f57e594 assets/hexcasting/models/item/scroll_paper.json 222e40e5754f5cb5a04321c4ed4cee27748c9224 assets/hexcasting/models/item/scroll_paper_lantern.json 145db42b0d90bdb4fd82f5a7eea229be4c0f9675 assets/hexcasting/models/item/slate_block.json diff --git a/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_0.json b/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_0.json new file mode 100644 index 00000000..6c2a8abe --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "hexcasting:block/quenched_allay_0" + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_1.json b/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_1.json new file mode 100644 index 00000000..441d9105 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "hexcasting:block/quenched_allay_1" + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_2.json b/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_2.json new file mode 100644 index 00000000..a561a358 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "hexcasting:block/quenched_allay_2" + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_3.json b/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_3.json new file mode 100644 index 00000000..a6fe2373 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/block/quenched_allay_3.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "hexcasting:block/quenched_allay_3" + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_0.json b/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_0.json new file mode 100644 index 00000000..b82fee4e --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_0.json @@ -0,0 +1,3 @@ +{ + "parent": "hexcasting:block/quenched_allay_0" +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_1.json b/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_1.json new file mode 100644 index 00000000..f6de1630 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_1.json @@ -0,0 +1,3 @@ +{ + "parent": "hexcasting:block/quenched_allay_1" +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_2.json b/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_2.json new file mode 100644 index 00000000..bdf10592 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_2.json @@ -0,0 +1,3 @@ +{ + "parent": "hexcasting:block/quenched_allay_2" +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_3.json b/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_3.json new file mode 100644 index 00000000..2fa4afd3 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/item/quenched_allay_3.json @@ -0,0 +1,3 @@ +{ + "parent": "hexcasting:block/quenched_allay_3" +} \ No newline at end of file diff --git a/Common/src/main/java/at/petrak/hexcasting/GaslightingModel.java b/Common/src/main/java/at/petrak/hexcasting/GaslightingModel.java new file mode 100644 index 00000000..e3b72b8d --- /dev/null +++ b/Common/src/main/java/at/petrak/hexcasting/GaslightingModel.java @@ -0,0 +1,69 @@ +package at.petrak.hexcasting; + +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.ItemOverrides; +import net.minecraft.client.renderer.block.model.ItemTransforms; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.Direction; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class GaslightingModel implements BakedModel { + private static int GASLIGHTING_AMOUNT = 0; + private static boolean HAS_RENDERED_THIS_FRAME = false; + + private final List variants; + private final BakedModel wrapped; + + public GaslightingModel(List variants) { + this.variants = variants; + this.wrapped = this.variants.get(0); + } + + @Override + public List getQuads(@Nullable BlockState state, @Nullable Direction direction, RandomSource random) { + HAS_RENDERED_THIS_FRAME = true; + + var idx = Math.abs(GASLIGHTING_AMOUNT % this.variants.size()); + return this.variants.get(idx).getQuads(state, direction, random); + } + + public boolean useAmbientOcclusion() { + return this.wrapped.useAmbientOcclusion(); + } + + public boolean isGui3d() { + return this.wrapped.isGui3d(); + } + + public boolean usesBlockLight() { + return this.wrapped.usesBlockLight(); + } + + public boolean isCustomRenderer() { + return this.wrapped.isCustomRenderer(); + } + + public TextureAtlasSprite getParticleIcon() { + return this.wrapped.getParticleIcon(); + } + + public ItemTransforms getTransforms() { + return this.wrapped.getTransforms(); + } + + public ItemOverrides getOverrides() { + return this.wrapped.getOverrides(); + } + + public static void postFrameCheckRendered() { + if (!HAS_RENDERED_THIS_FRAME) { + GASLIGHTING_AMOUNT += 1; + } + HAS_RENDERED_THIS_FRAME = false; + } +} diff --git a/Common/src/main/java/at/petrak/hexcasting/client/ClientTickCounter.java b/Common/src/main/java/at/petrak/hexcasting/client/ClientTickCounter.java index 213b3433..a0728ec3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/client/ClientTickCounter.java +++ b/Common/src/main/java/at/petrak/hexcasting/client/ClientTickCounter.java @@ -1,5 +1,6 @@ package at.petrak.hexcasting.client; +import at.petrak.hexcasting.GaslightingModel; import net.minecraft.client.Minecraft; public class ClientTickCounter { @@ -7,7 +8,7 @@ public class ClientTickCounter { public static float partialTicks = 0.0F; public static float getTotal() { - return (float)ticksInGame + partialTicks; + return (float) ticksInGame + partialTicks; } public static void renderTickStart(float renderTickTime) { @@ -18,6 +19,7 @@ public class ClientTickCounter { if (!Minecraft.getInstance().isPaused()) { ++ticksInGame; partialTicks = 0.0F; + GaslightingModel.postFrameCheckRendered(); } } } diff --git a/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java b/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java index dd17f541..e9e9f3a8 100644 --- a/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java +++ b/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java @@ -1,8 +1,6 @@ package at.petrak.hexcasting.client; -import at.petrak.hexcasting.api.block.circle.BlockAbstractImpetus; -import at.petrak.hexcasting.api.block.circle.BlockEntityAbstractImpetus; -import at.petrak.hexcasting.api.client.ScryingLensOverlayRegistry; +import at.petrak.hexcasting.GaslightingModel; import at.petrak.hexcasting.api.item.IotaHolderItem; import at.petrak.hexcasting.api.item.MediaHolderItem; import at.petrak.hexcasting.api.misc.MediaConstants; @@ -10,6 +8,7 @@ import at.petrak.hexcasting.api.utils.NBTHelper; import at.petrak.hexcasting.client.be.BlockEntityAkashicBookshelfRenderer; import at.petrak.hexcasting.client.be.BlockEntitySlateRenderer; import at.petrak.hexcasting.client.entity.WallScrollRenderer; +import at.petrak.hexcasting.common.blocks.BlockQuenchedAllay; import at.petrak.hexcasting.common.blocks.akashic.BlockAkashicBookshelf; import at.petrak.hexcasting.common.blocks.akashic.BlockEntityAkashicBookshelf; import at.petrak.hexcasting.common.entities.HexEntities; @@ -22,37 +21,31 @@ import at.petrak.hexcasting.common.lib.HexBlocks; import at.petrak.hexcasting.common.lib.HexItems; import at.petrak.hexcasting.common.lib.hex.HexIotaTypes; import at.petrak.hexcasting.xplat.IClientXplatAbstractions; -import com.mojang.datafixers.util.Pair; -import net.minecraft.ChatFormatting; import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.Style; -import net.minecraft.network.chat.TextColor; -import net.minecraft.util.Mth; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.client.resources.model.ModelBakery; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.*; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.properties.ComparatorMode; -import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; -import net.minecraft.world.level.block.state.properties.RailShape; -import net.minecraft.world.level.material.MaterialColor; import org.jetbrains.annotations.NotNull; +import java.util.ArrayList; import java.util.Locale; +import java.util.Map; import java.util.function.BiConsumer; +import java.util.function.Consumer; import java.util.function.Predicate; import java.util.function.ToIntFunction; -import java.util.function.UnaryOperator; + +import static at.petrak.hexcasting.api.HexAPI.modLoc; public class RegisterClientStuff { public static void init() { @@ -126,7 +119,7 @@ public class RegisterClientStuff { // Minecraft.getInstance().getTextureManager().bindForSetup(tex); // } - addScryingLensStuff(); + ScryingLensOverlays.addScryingLensStuff(); } public static void registerColorProviders(BiConsumer itemColorRegistry, @@ -166,152 +159,6 @@ public class RegisterClientStuff { }; } - private static void addScryingLensStuff() { - ScryingLensOverlayRegistry.addPredicateDisplayer( - (state, pos, observer, world, direction) -> state.getBlock() instanceof BlockAbstractImpetus, - (lines, state, pos, observer, world, direction) -> { - if (world.getBlockEntity(pos) instanceof BlockEntityAbstractImpetus beai) { - beai.applyScryingLensOverlay(lines, state, pos, observer, world, direction); - } - }); - - ScryingLensOverlayRegistry.addDisplayer(Blocks.NOTE_BLOCK, - (lines, state, pos, observer, world, direction) -> { - int note = state.getValue(NoteBlock.NOTE); - - float rCol = Math.max(0.0F, Mth.sin((note / 24F + 0.0F) * Mth.TWO_PI) * 0.65F + 0.35F); - float gCol = Math.max(0.0F, Mth.sin((note / 24F + 0.33333334F) * Mth.TWO_PI) * 0.65F + 0.35F); - float bCol = Math.max(0.0F, Mth.sin((note / 24F + 0.6666667F) * Mth.TWO_PI) * 0.65F + 0.35F); - - int noteColor = 0xFF_000000 | Mth.color(rCol, gCol, bCol); - - var instrument = state.getValue(NoteBlock.INSTRUMENT); - - lines.add(new Pair<>( - new ItemStack(Items.MUSIC_DISC_CHIRP), - Component.literal(String.valueOf(instrument.ordinal())) - .withStyle(color(instrumentColor(instrument))))); - lines.add(new Pair<>( - new ItemStack(Items.NOTE_BLOCK), - Component.literal(String.valueOf(note)) - .withStyle(color(noteColor)))); - }); - - ScryingLensOverlayRegistry.addDisplayer(HexBlocks.AKASHIC_BOOKSHELF, - (lines, state, pos, observer, world, direction) -> { - if (world.getBlockEntity(pos) instanceof BlockEntityAkashicBookshelf tile) { - var iotaTag = tile.getIotaTag(); - if (iotaTag != null) { - var display = HexIotaTypes.getDisplay(iotaTag); - lines.add(new Pair<>(new ItemStack(Items.BOOK), display)); - } - } - }); - - ScryingLensOverlayRegistry.addDisplayer(Blocks.COMPARATOR, - (lines, state, pos, observer, world, direction) -> { - int comparatorValue = ScryingLensOverlayRegistry.getComparatorValue(true); - lines.add(new Pair<>( - new ItemStack(Items.REDSTONE), - Component.literal(comparatorValue == -1 ? "" : String.valueOf(comparatorValue)) - .withStyle(redstoneColor(comparatorValue)))); - - boolean compare = state.getValue(ComparatorBlock.MODE) == ComparatorMode.COMPARE; - - lines.add(new Pair<>( - new ItemStack(Items.REDSTONE_TORCH), - Component.literal(compare ? ">=" : "-") - .withStyle(redstoneColor(compare ? 0 : 15)))); - }); - - ScryingLensOverlayRegistry.addDisplayer(Blocks.POWERED_RAIL, - (lines, state, pos, observer, world, direction) -> { - int power = getPoweredRailStrength(world, pos, state); - lines.add(new Pair<>( - new ItemStack(Items.POWERED_RAIL), - Component.literal(String.valueOf(power)) - .withStyle(redstoneColor(power, 9)))); - }); - - ScryingLensOverlayRegistry.addDisplayer(Blocks.REPEATER, - (lines, state, pos, observer, world, direction) -> lines.add(new Pair<>( - new ItemStack(Items.CLOCK), - Component.literal(String.valueOf(state.getValue(RepeaterBlock.DELAY))) - .withStyle(ChatFormatting.YELLOW)))); - - ScryingLensOverlayRegistry.addPredicateDisplayer( - (state, pos, observer, world, direction) -> state.getBlock() instanceof BeehiveBlock, - (lines, state, pos, observer, world, direction) -> { - int count = ScryingLensOverlayRegistry.getBeeValue(); - lines.add(new Pair<>(new ItemStack(Items.BEE_NEST), count == -1 ? Component.empty() : - Component.translatable( - "hexcasting.tooltip.lens.bee" + (count == 1 ? ".single" : ""), - count - ))); - }); - - ScryingLensOverlayRegistry.addPredicateDisplayer( - (state, pos, observer, world, direction) -> state.isSignalSource() && !state.is( - Blocks.COMPARATOR), - (lines, state, pos, observer, world, direction) -> { - int signalStrength = 0; - if (state.getBlock() instanceof RedStoneWireBlock) { - signalStrength = state.getValue(RedStoneWireBlock.POWER); - } else { - for (Direction dir : Direction.values()) { - signalStrength = Math.max(signalStrength, state.getSignal(world, pos, dir)); - } - } - - lines.add(0, new Pair<>( - new ItemStack(Items.REDSTONE), - Component.literal(String.valueOf(signalStrength)) - .withStyle(redstoneColor(signalStrength)))); - }); - - ScryingLensOverlayRegistry.addPredicateDisplayer( - (state, pos, observer, world, direction) -> state.hasAnalogOutputSignal(), - (lines, state, pos, observer, world, direction) -> { - int comparatorValue = ScryingLensOverlayRegistry.getComparatorValue(false); - lines.add( - new Pair<>( - new ItemStack(Items.COMPARATOR), - Component.literal(comparatorValue == -1 ? "" : String.valueOf(comparatorValue)) - .withStyle(redstoneColor(comparatorValue)))); - }); - } - - private static UnaryOperator