diff --git a/CHANGELOG.md b/CHANGELOG.md index 57563dd97e..1b8a26df37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - Updated to Minecraft 1.21.1 ([#985](https://github.com/FallingColors/HexMod/pull/985)) @SuperKnux @slava110 - Added Neural Fiber, a new endgame material harvested from villagers using a modified mindflaying process ([#1296](https://github.com/FallingColors/HexMod/pull/1296)) @Robotgiggle @Falkory220 +- Added Neural Mesh, a multipart block which can be attached to Budding Amethyst to make it grow faster ([#1297](https://github.com/FallingColors/HexMod/pull/1297)) @Robotgiggle - Added Grand Caster Robes, a hex-based armor set with a variety of abilities ([#1296](https://github.com/FallingColors/HexMod/pull/1296)) @Robotgiggle @Falkory220 - Provides defense values midway between iron and diamond - Provides the scrying lens effect, increased ambit, and a casting cost discount diff --git a/Common/src/generated/resources/assets/hexcasting/models/item/neural_mesh.json b/Common/src/generated/resources/assets/hexcasting/models/item/neural_mesh.json new file mode 100644 index 0000000000..4f9fe9bf8a --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/item/neural_mesh.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "hexcasting:item/neural_mesh" + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/item/staff/neural.json b/Common/src/generated/resources/assets/hexcasting/models/item/staff/neural.json new file mode 100644 index 0000000000..9d11027240 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/item/staff/neural.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld_rod", + "textures": { + "layer0": "hexcasting:item/staff/neural" + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/assets/hexcasting/models/staff/neural.json b/Common/src/generated/resources/assets/hexcasting/models/staff/neural.json new file mode 100644 index 0000000000..4890c91a60 --- /dev/null +++ b/Common/src/generated/resources/assets/hexcasting/models/staff/neural.json @@ -0,0 +1,16 @@ +{ + "overrides": [ + { + "model": "hexcasting:item/neural_staff", + "predicate": { + "hexcasting:funny_level": 0.0 + } + }, + { + "model": "hexcasting:item/cherry_staff", + "predicate": { + "hexcasting:funny_level": 2.0 + } + } + ] +} \ No newline at end of file diff --git a/Common/src/generated/resources/data/hexcasting/advancement/recipes/redstone/neural_mesh.json b/Common/src/generated/resources/data/hexcasting/advancement/recipes/redstone/neural_mesh.json new file mode 100644 index 0000000000..5a76172263 --- /dev/null +++ b/Common/src/generated/resources/data/hexcasting/advancement/recipes/redstone/neural_mesh.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": "hexcasting:neural_fiber" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "hexcasting:neural_mesh" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "hexcasting:neural_mesh" + ] + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/data/hexcasting/advancement/recipes/tools/staff/neural.json b/Common/src/generated/resources/data/hexcasting/advancement/recipes/tools/staff/neural.json new file mode 100644 index 0000000000..c3502060e1 --- /dev/null +++ b/Common/src/generated/resources/data/hexcasting/advancement/recipes/tools/staff/neural.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": "hexcasting:charged_amethyst" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "hexcasting:staff/neural" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "hexcasting:staff/neural" + ] + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/data/hexcasting/loot_table/blocks/neural_mesh.json b/Common/src/generated/resources/data/hexcasting/loot_table/blocks/neural_mesh.json new file mode 100644 index 0000000000..49ecc8425a --- /dev/null +++ b/Common/src/generated/resources/data/hexcasting/loot_table/blocks/neural_mesh.json @@ -0,0 +1,106 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "add": true, + "count": -1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "down": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "up": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "north": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "south": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "west": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "east": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + } + ], + "name": "hexcasting:neural_mesh" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "hexcasting:blocks/neural_mesh" +} \ No newline at end of file diff --git a/Common/src/generated/resources/data/hexcasting/recipe/neural_mesh.json b/Common/src/generated/resources/data/hexcasting/recipe/neural_mesh.json new file mode 100644 index 0000000000..b1ae10c52c --- /dev/null +++ b/Common/src/generated/resources/data/hexcasting/recipe/neural_mesh.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "redstone", + "key": { + "C": { + "item": "hexcasting:neural_fiber" + }, + "D": { + "item": "hexcasting:neural_fiber" + }, + "I": { + "item": "minecraft:bone_block" + } + }, + "pattern": [ + "DCD", + "CIC", + "DCD" + ], + "result": { + "count": 1, + "id": "hexcasting:neural_mesh" + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/data/hexcasting/recipe/staff/neural.json b/Common/src/generated/resources/data/hexcasting/recipe/staff/neural.json new file mode 100644 index 0000000000..a4288d0288 --- /dev/null +++ b/Common/src/generated/resources/data/hexcasting/recipe/staff/neural.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "key": { + "A": { + "item": "hexcasting:charged_amethyst" + }, + "S": { + "item": "minecraft:stick" + }, + "W": { + "item": "hexcasting:neural_mesh" + } + }, + "pattern": [ + " SA", + " WS", + "S " + ], + "result": { + "count": 1, + "id": "hexcasting:staff/neural" + } +} \ No newline at end of file diff --git a/Common/src/generated/resources/data/hexcasting/tags/item/staves.json b/Common/src/generated/resources/data/hexcasting/tags/item/staves.json index 29f4595c62..c3b2e7c4f8 100644 --- a/Common/src/generated/resources/data/hexcasting/tags/item/staves.json +++ b/Common/src/generated/resources/data/hexcasting/tags/item/staves.json @@ -13,6 +13,7 @@ "hexcasting:staff/cherry", "hexcasting:staff/bamboo", "hexcasting:staff/quenched", - "hexcasting:staff/mindsplice" + "hexcasting:staff/mindsplice", + "hexcasting:staff/neural" ] } \ 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 70b12989bc..c819d3fc3a 100644 --- a/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java +++ b/Common/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java @@ -114,6 +114,7 @@ public static void init() { registerWandOverrides(HexItems.STAFF_EDIFIED.get()); // purposely skip quenched registerWandOverrides(HexItems.STAFF_MINDSPLICE.get()); + registerWandOverrides(HexItems.STAFF_NEURAL.get()); registerGaslight4(HexItems.STAFF_QUENCHED.get()); registerGaslight4(HexBlocks.QUENCHED_ALLAY.get().asItem()); @@ -128,6 +129,7 @@ public static void init() { x.setRenderLayer(HexBlocks.EDIFIED_TRAPDOOR.get(), RenderType.cutout()); x.setRenderLayer(HexBlocks.AKASHIC_BOOKSHELF.get(), RenderType.cutout()); x.setRenderLayer(HexBlocks.SCONCE.get(), RenderType.cutout()); + x.setRenderLayer(HexBlocks.NEURAL_MESH.get(), RenderType.cutout()); x.setRenderLayer(HexBlocks.AMETHYST_EDIFIED_LEAVES.get(), RenderType.cutoutMipped()); x.setRenderLayer(HexBlocks.AVENTURINE_EDIFIED_LEAVES.get(), RenderType.cutoutMipped()); diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/BlockNeuralMesh.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/BlockNeuralMesh.java new file mode 100644 index 0000000000..76e97d16ee --- /dev/null +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/BlockNeuralMesh.java @@ -0,0 +1,72 @@ +package at.petrak.hexcasting.common.blocks; + +import at.petrak.hexcasting.common.lib.HexBlocks; +import at.petrak.hexcasting.common.lib.HexItems; +import com.mojang.serialization.MapCodec; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.RandomSource; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.block.*; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; + +public class BlockNeuralMesh extends MultifaceBlock { + public static final MapCodec CODEC = simpleCodec(BlockNeuralMesh::new); + + public MapCodec codec() { + return CODEC; + } + + public BlockNeuralMesh(BlockBehaviour.Properties arg) { + super(arg); + } + + @Override + public MultifaceSpreader getSpreader() { + throw new UnsupportedOperationException("Neural mesh is not capable of spreading"); + } + + @Override + protected boolean canBeReplaced(BlockState blockState, BlockPlaceContext blockPlaceContext) { + return blockPlaceContext.getItemInHand().is(HexItems.NEURAL_MESH.get()); + } + + @Override + protected void randomTick(BlockState blockState, ServerLevel serverLevel, BlockPos blockPos, RandomSource randomSource) { + for (var dir : availableFaces(blockState)) { + BlockPos targetPos = blockPos.relative(dir); + BlockState targetState = serverLevel.getBlockState(targetPos); + if (targetState.is(Blocks.BUDDING_AMETHYST)) { + targetState.randomTick(serverLevel, targetPos, randomSource); + } + } + } + + @Override + protected BlockState updateShape(BlockState blockState, Direction direction, BlockState blockState2, LevelAccessor levelAccessor, BlockPos blockPos, BlockPos blockPos2) { + if (!hasAnyFace(blockState)) { + return Blocks.AIR.defaultBlockState(); + } else { + if (hasFace(blockState, direction) && !canAttachTo(levelAccessor, direction, blockPos2, blockState2)) { + var resultState = removeFace(blockState, getFaceProperty(direction)); + if (resultState.is(HexBlocks.NEURAL_MESH.get()) && levelAccessor instanceof Level level) { + popResource(level, blockPos, new ItemStack(HexItems.NEURAL_MESH.get())); + } + return resultState; + } + return blockState; + } + } + + // this is private in MultifaceBlock so here's a reimpl + private static BlockState removeFace(BlockState blockState, BooleanProperty booleanProperty) { + BlockState blockState2 = blockState.setValue(booleanProperty, false); + return hasAnyFace(blockState2) ? blockState2 : Blocks.AIR.defaultBlockState(); + } +} diff --git a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java index 4f9fd2f54e..447a8ab55f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/lib/HexBlocks.java @@ -1,10 +1,7 @@ package at.petrak.hexcasting.common.lib; import at.petrak.hexcasting.api.block.circle.BlockAbstractImpetus; -import at.petrak.hexcasting.common.blocks.BlockConjured; -import at.petrak.hexcasting.common.blocks.BlockConjuredLight; -import at.petrak.hexcasting.common.blocks.BlockFlammable; -import at.petrak.hexcasting.common.blocks.BlockQuenchedAllay; +import at.petrak.hexcasting.common.blocks.*; import at.petrak.hexcasting.common.blocks.akashic.BlockAkashicBookshelf; import at.petrak.hexcasting.common.blocks.akashic.BlockAkashicLigature; import at.petrak.hexcasting.common.blocks.akashic.BlockAkashicRecord; @@ -145,10 +142,20 @@ private static BlockBehaviour.Properties quenched() { .isViewBlocking(HexBlocks::never)), new Item.Properties()); - // "no" item because we add it manually + // "no" item because we add them manually in HexItems + // these must be registered before anything that references HexItems to avoid initializer errors public static final Supplier SLATE = blockNoItem("slate", () -> new BlockSlate(slateish() .pushReaction(PushReaction.DESTROY))); + public static final Supplier NEURAL_MESH = blockNoItem("neural_mesh", () -> + new BlockNeuralMesh(BlockBehaviour.Properties.of() + .noCollission() + .randomTicks() + .strength(0.2F) + .sound(SoundType.CANDLE) + .pushReaction(PushReaction.DESTROY) + ) + ); public static final Supplier IMPETUS_EMPTY = blockItem("impetus/empty", () -> new BlockEmptyImpetus(slateish() @@ -197,6 +204,7 @@ private static BlockBehaviour.Properties quenched() { HexItems.props().rarity(Rarity.UNCOMMON) ); + // Decoration?! public static final Supplier QUENCHED_ALLAY_TILES = blockItem("quenched_allay_tiles", () -> new BlockQuenchedAllay(quenched())); public static final Supplier QUENCHED_ALLAY_BRICKS = blockItem("quenched_allay_bricks", () -> new BlockQuenchedAllay(quenched())); 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 f4f21daf35..37045eb505 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 @@ -72,6 +72,7 @@ public static void registerItemsForCreativeTab(ResourceKey tabK public static final Supplier STAFF_QUENCHED = make("staff/quenched", () -> new ItemStaff(unstackable().rarity(Rarity.UNCOMMON))); // mindsplice staffaratus public static final Supplier STAFF_MINDSPLICE = make("staff/mindsplice", () -> new ItemStaff(unstackable().rarity(Rarity.UNCOMMON))); + public static final Supplier STAFF_NEURAL = make("staff/neural", () -> new ItemStaff(unstackable().rarity(Rarity.UNCOMMON))); public static final Supplier SCRYING_LENS = make("lens", () -> new ItemLens( IXplatAbstractions.INSTANCE.addEquipSlotFabric(EquipmentSlot.HEAD) @@ -104,6 +105,12 @@ public static void registerItemsForCreativeTab(ResourceKey tabK public static final Supplier NEURAL_FIBER = make("neural_fiber", () -> new Item(props().rarity(Rarity.UNCOMMON))); + public static final Supplier NEURAL_MESH = make("neural_mesh", () -> + new BlockItem(HexBlocks.NEURAL_MESH.get(), props() + .rarity(Rarity.UNCOMMON) + ) + ); + public static final Supplier ROBES_HOOD = make("robes/hood", () -> new ItemRobes(ArmorItem.Type.HELMET, unstackable() .rarity(Rarity.UNCOMMON) diff --git a/Common/src/main/java/at/petrak/hexcasting/datagen/HexLootTables.java b/Common/src/main/java/at/petrak/hexcasting/datagen/HexLootTables.java index 713b16d052..5df6d75005 100644 --- a/Common/src/main/java/at/petrak/hexcasting/datagen/HexLootTables.java +++ b/Common/src/main/java/at/petrak/hexcasting/datagen/HexLootTables.java @@ -8,6 +8,7 @@ import at.petrak.hexcasting.xplat.IXplatAbstractions; import at.petrak.paucal.api.datagen.PaucalLootTableSubProvider; import net.minecraft.advancements.critereon.*; +import net.minecraft.core.Direction; import net.minecraft.core.HolderLookup; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; @@ -16,7 +17,9 @@ import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.DoorBlock; +import net.minecraft.world.level.block.MultifaceBlock; import net.minecraft.world.level.block.SlabBlock; +import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; import net.minecraft.world.level.block.state.properties.SlabType; import net.minecraft.world.level.storage.loot.LootPool; @@ -85,6 +88,18 @@ protected void makeLootTables(Map blockTables, )); blockTables.put(HexBlocks.EDIFIED_DOOR.get(), LootTable.lootTable().withPool(doorPool)); + var meshEntry = LootItem.lootTableItem(HexBlocks.NEURAL_MESH.get()) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(-1), true)); + for (var dir : Direction.values()) { + meshEntry.apply(SetItemCountFunction.setCount(ConstantValue.exactly(1), true) + .when(new LootItemBlockStatePropertyCondition.Builder(HexBlocks.NEURAL_MESH.get()).setProperties( + StatePropertiesPredicate.Builder.properties().hasProperty(MultifaceBlock.getFaceProperty(dir), true) + )) + ); + } + var meshPool = LootPool.lootPool().setRolls(ConstantValue.exactly(1)).add(meshEntry); + blockTables.put(HexBlocks.NEURAL_MESH.get(), LootTable.lootTable().withPool(meshPool)); + var silkTouchCond = MatchTool.toolMatches( ItemPredicate.Builder.item().withSubPredicate( ItemSubPredicates.ENCHANTMENTS, 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 3162c2ecab..ac7a5a5857 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 @@ -102,6 +102,7 @@ public void buildRecipes(RecipeOutput recipes) { staffRecipe(recipes, HexItems.STAFF_EDIFIED.get(), HexBlocks.EDIFIED_PLANKS.get().asItem()); staffRecipe(recipes, HexItems.STAFF_QUENCHED.get(), HexItems.QUENCHED_SHARD.get()); staffRecipe(recipes, HexItems.STAFF_MINDSPLICE.get(), Ingredient.of(HexTags.Items.MINDFLAYED_CIRCLE_COMPONENTS)); + staffRecipe(recipes, HexItems.STAFF_NEURAL.get(), HexItems.NEURAL_MESH.get()); ShapelessRecipeBuilder.shapeless(RecipeCategory.TOOLS, HexItems.THOUGHT_KNOT.get()) .requires(HexItems.AMETHYST_DUST.get()) @@ -261,6 +262,9 @@ public void buildRecipes(RecipeOutput recipes) { .pattern(" S ") .unlockedBy("has_item", hasItem(Items.AMETHYST_SHARD)).save(recipes); + ring(RecipeCategory.REDSTONE, HexItems.NEURAL_MESH.get(), 1, HexItems.NEURAL_FIBER.get(), Blocks.BONE_BLOCK) + .unlockedBy("has_item", hasItem(HexItems.NEURAL_FIBER.get())).save(recipes); + ShapedRecipeBuilder.shaped(RecipeCategory.COMBAT, HexItems.ROBES_HOOD.get()) .define('F', HexItems.NEURAL_FIBER.get()) .define('B', Items.BONE) diff --git a/Common/src/main/java/at/petrak/hexcasting/datagen/tag/HexItemTagProvider.java b/Common/src/main/java/at/petrak/hexcasting/datagen/tag/HexItemTagProvider.java index 2f97a1209e..48f06f52d4 100644 --- a/Common/src/main/java/at/petrak/hexcasting/datagen/tag/HexItemTagProvider.java +++ b/Common/src/main/java/at/petrak/hexcasting/datagen/tag/HexItemTagProvider.java @@ -40,7 +40,7 @@ protected void addTags(HolderLookup.Provider provider) { HexItems.STAFF_JUNGLE.get(), HexItems.STAFF_ACACIA.get(), HexItems.STAFF_DARK_OAK.get(), HexItems.STAFF_CRIMSON.get(), HexItems.STAFF_WARPED.get(), HexItems.STAFF_MANGROVE.get(), HexItems.STAFF_CHERRY.get(),HexItems.STAFF_BAMBOO.get(), - HexItems.STAFF_QUENCHED.get(), HexItems.STAFF_MINDSPLICE.get()); + HexItems.STAFF_QUENCHED.get(), HexItems.STAFF_MINDSPLICE.get(), HexItems.STAFF_NEURAL.get()); add(tag(HexTags.Items.PHIAL_BASE), Items.GLASS_BOTTLE); diff --git a/Common/src/main/java/at/petrak/hexcasting/mixin/MixinBuddingAmethystBlock.java b/Common/src/main/java/at/petrak/hexcasting/mixin/MixinBuddingAmethystBlock.java new file mode 100644 index 0000000000..2e01fc5656 --- /dev/null +++ b/Common/src/main/java/at/petrak/hexcasting/mixin/MixinBuddingAmethystBlock.java @@ -0,0 +1,48 @@ +package at.petrak.hexcasting.mixin; + +import at.petrak.hexcasting.common.lib.HexBlocks; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.block.BuddingAmethystBlock; +import net.minecraft.world.level.block.state.BlockState; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +@Mixin(BuddingAmethystBlock.class) +public class MixinBuddingAmethystBlock { + // When combined with the extra random ticks provided by the neural mesh blocks themselves, this results + // in an overall speed boost equivalent to each mesh block providing 5 extra random ticks whenever it + // receives a single random tick. We do it this way (rather than actually ticking the budding block five + // times per mesh tick) to avoid sudden jumps in growth progress. + @WrapOperation( + method = "randomTick", + at = @At(value = "INVOKE", target = "Lnet/minecraft/util/RandomSource;nextInt(I)I", ordinal = 0) + ) + private int increaseSuccessChanceWithMesh( + RandomSource instance, int originalArg, Operation original, + BlockState selfState, ServerLevel serverLevel, BlockPos selfPos, RandomSource randomSource + ) { + int meshCount = 0; + for (Direction dir : Direction.values()) { + BlockPos checkPos = selfPos.relative(dir); + if (serverLevel.getBlockState(checkPos).is(HexBlocks.NEURAL_MESH.get())) { + meshCount++; + } + } + if (meshCount == 0) + return original.call(instance, originalArg); + boolean success = switch (meshCount) { + case 1 -> (randomSource.nextDouble() < 0.6); + case 2 -> (randomSource.nextDouble() < 11.0/15.0); + case 3 -> (randomSource.nextDouble() < 0.8); + case 4 -> (randomSource.nextDouble() < 0.84); + case 5 -> (randomSource.nextDouble() < 13.0/15.0); + default -> false; + }; + return success ? 0 : -1; + } +} diff --git a/Common/src/main/java/at/petrak/hexcasting/mixin/MixinLivingEntity.java b/Common/src/main/java/at/petrak/hexcasting/mixin/MixinLivingEntity.java index 38d215f17c..e10238f190 100644 --- a/Common/src/main/java/at/petrak/hexcasting/mixin/MixinLivingEntity.java +++ b/Common/src/main/java/at/petrak/hexcasting/mixin/MixinLivingEntity.java @@ -35,11 +35,11 @@ private void dropCrystallizedLoot(CallbackInfo ci) { } @Inject(method = "increaseAirSupply", at = @At("HEAD"), cancellable = true) - private void forgetToBreathe(int i, CallbackInfoReturnable cir) { + private void forgetToBreathe(int currentAir, CallbackInfoReturnable cir) { var self = (LivingEntity) (Object) this; var inst = self.getEffect(HexMobEffects.DISSOCIATION); if (inst != null && DissociationEffect.shouldPreventBreathing(inst.getDuration(), inst.getAmplifier())) { - cir.setReturnValue(i); + cir.setReturnValue(currentAir); } } } diff --git a/Common/src/main/resources/assets/hexcasting/blockstates/neural_mesh.json b/Common/src/main/resources/assets/hexcasting/blockstates/neural_mesh.json new file mode 100644 index 0000000000..f5b66df718 --- /dev/null +++ b/Common/src/main/resources/assets/hexcasting/blockstates/neural_mesh.json @@ -0,0 +1,140 @@ +{ + "multipart": [ + { + "apply": { + "model": "hexcasting:block/neural_mesh" + }, + "when": { + "north": "true" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh" + }, + "when": { + "down": "false", + "east": "false", + "north": "false", + "south": "false", + "up": "false", + "west": "false" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh", + "y": 90 + }, + "when": { + "east": "true" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh", + "y": 90 + }, + "when": { + "down": "false", + "east": "false", + "north": "false", + "south": "false", + "up": "false", + "west": "false" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh", + "y": 180 + }, + "when": { + "south": "true" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh", + "y": 180 + }, + "when": { + "down": "false", + "east": "false", + "north": "false", + "south": "false", + "up": "false", + "west": "false" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh", + "y": 270 + }, + "when": { + "west": "true" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh", + "y": 270 + }, + "when": { + "down": "false", + "east": "false", + "north": "false", + "south": "false", + "up": "false", + "west": "false" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh", + "x": 270 + }, + "when": { + "up": "true" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh", + "x": 270 + }, + "when": { + "down": "false", + "east": "false", + "north": "false", + "south": "false", + "up": "false", + "west": "false" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh", + "x": 90 + }, + "when": { + "down": "true" + } + }, + { + "apply": { + "model": "hexcasting:block/neural_mesh", + "x": 90 + }, + "when": { + "down": "false", + "east": "false", + "north": "false", + "south": "false", + "up": "false", + "west": "false" + } + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 b/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 index eff6c008f5..75b93de437 100644 --- a/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 +++ b/Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5 @@ -18,6 +18,7 @@ edified: "Edified Staff", quenched: "Quenched Shard Staff", mindsplice: "Mindsplice Staff", + neural: "Neural Staff", }, amethyst_dust: "Amethyst Dust", @@ -63,6 +64,7 @@ jeweler_hammer: "Jeweler's Hammer", sub_sandwich: "Submarine Sandwich", neural_fiber: "Neural Fiber", + neural_mesh: "Neural Mesh", robes: { hood: "Grand Caster Hood", @@ -136,6 +138,8 @@ conjured_light: "Conjured Light", conjured_block: "Conjured Block", + neural_mesh: "Neural Mesh", + directrix: { empty: "Empty Directrix", redstone: "Mason Directrix", @@ -1804,6 +1808,7 @@ "1": "Mind and body-- I can bridge the gap! $(l:greatwork/brainsweeping)$(action)Flay Mind/$ was built to sever but I understand it now, I can TWIST it, force the mind not $(o)out/$ but $(o)in/$, so long as the flesh is made ready to accept it -- $(l:items/potions)Clarity/$ should do the job. The mind can be folded into itself, crystallized in flesh and bone and nerve, until there is only ONE, mind-and-body superimposed in a single hybrid substrate.", "2": "Viscera suffused with micro-fractal splinters of cognition, living and thinking and-- USELESS! Nothing but a mass of meat and _media, in the end.$(br2)But the nerves... the nerves become conduits, skeins of thought reified in shimmering fiber. These I can USE. Free them from the flesh and they are $(o)mine/$.$(br2)I could weave them into myself -- more $(o)space/$ to think in -- no. I am not being rational.", "3": "The process itself is simple: apply $(l:items/potions)Clarity/$ to render the body receptive, cast $(l:greatwork/brainsweeping)$(action)Flay Mind/$ with the $(l:patterns/basics#hexcasting:entity_pos/eye)$(action)subject’s own head/$ as the destination, then dissect to harvest the fiber. Any villager will do, though a more developed mind will provide a higher yield.$(br2)I wonder... does it understand, even excised? Does it feel?", + mesh: "The fibers have a natural affinity for bone. Woven into such a frame, I can affix them to $(thing)Budding Amethyst/$ to provide additional paths for the flow of media, accelerating growth. However, covering too many faces seems to reduce overall production efficiency.", }, caster_robes: { diff --git a/Common/src/main/resources/assets/hexcasting/models/block/neural_mesh.json b/Common/src/main/resources/assets/hexcasting/models/block/neural_mesh.json new file mode 100644 index 0000000000..0d4d773748 --- /dev/null +++ b/Common/src/main/resources/assets/hexcasting/models/block/neural_mesh.json @@ -0,0 +1,38 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "hexcasting:item/neural_mesh", + "neural_mesh": "hexcasting:block/neural_mesh" + }, + "render_type": "cutout", + "elements": [ + { + "from": [ 0, 0, 0.1 ], + "to": [ 16, 16, 0.1 ], + "faces": { + "north": { "uv": [ 8, 0, 0, 8 ], "texture": "#neural_mesh" }, + "south": { "uv": [ 0, 0, 8, 8 ], "texture": "#neural_mesh" } + } + }, + { + "from": [ 0, 0, 0.3 ], + "to": [ 16, 16, 0.3 ], + "faces": { + "north": { "uv": [ 16, 0, 8, 8 ], "texture": "#neural_mesh" }, + "south": { "uv": [ 8, 0, 16, 8 ], "texture": "#neural_mesh" } + } + }, + { + "from": [3, 3, 0], + "to": [13, 13, 1], + "faces": { + "north": {"uv": [1.5, 9.5, 6.5, 14.5], "texture": "#neural_mesh"}, + "south": {"uv": [1.5, 9.5, 6.5, 14.5], "texture": "#neural_mesh"}, + "east": {"uv": [6, 9.5, 6.5, 14.5], "texture": "#neural_mesh"}, + "west": {"uv": [1.5, 9.5, 2, 14.5], "texture": "#neural_mesh"}, + "up": {"uv": [1.5, 9.5, 6.5, 10], "texture": "#neural_mesh"}, + "down": {"uv": [1.5, 14, 6.5, 14.5], "texture": "#neural_mesh"} + } + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/greatwork/fanciful_staves.json b/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/greatwork/fanciful_staves.json index d283b0c651..25d3b0073c 100644 --- a/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/greatwork/fanciful_staves.json +++ b/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/greatwork/fanciful_staves.json @@ -14,6 +14,10 @@ "type": "patchouli:crafting", "recipe": "hexcasting:staff/quenched", "recipe2": "hexcasting:staff/mindsplice" + }, + { + "type": "patchouli:crafting", + "recipe": "hexcasting:staff/neural" } ] } diff --git a/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/greatwork/neural_fiber.json b/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/greatwork/neural_fiber.json index 55eede5e9f..2ea6b1c99d 100644 --- a/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/greatwork/neural_fiber.json +++ b/Common/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/greatwork/neural_fiber.json @@ -19,6 +19,11 @@ "item": "hexcasting:neural_fiber", "text": "hexcasting.page.neural_fiber.3", "link_recipe": true + }, + { + "type": "patchouli:crafting", + "recipe": "hexcasting:neural_mesh", + "text": "hexcasting.page.neural_fiber.mesh" } ] } \ No newline at end of file diff --git a/Common/src/main/resources/assets/hexcasting/textures/block/neural_mesh.png b/Common/src/main/resources/assets/hexcasting/textures/block/neural_mesh.png new file mode 100644 index 0000000000..253dac0c12 Binary files /dev/null and b/Common/src/main/resources/assets/hexcasting/textures/block/neural_mesh.png differ diff --git a/Common/src/main/resources/assets/hexcasting/textures/item/neural_mesh.png b/Common/src/main/resources/assets/hexcasting/textures/item/neural_mesh.png new file mode 100644 index 0000000000..1a3069b70e Binary files /dev/null and b/Common/src/main/resources/assets/hexcasting/textures/item/neural_mesh.png differ diff --git a/Common/src/main/resources/assets/hexcasting/textures/item/staff/neural.png b/Common/src/main/resources/assets/hexcasting/textures/item/staff/neural.png new file mode 100644 index 0000000000..6592f9e493 Binary files /dev/null and b/Common/src/main/resources/assets/hexcasting/textures/item/staff/neural.png differ diff --git a/Common/src/main/resources/hexplat.mixins.json b/Common/src/main/resources/hexplat.mixins.json index 8037e24e39..ca9b69e663 100644 --- a/Common/src/main/resources/hexplat.mixins.json +++ b/Common/src/main/resources/hexplat.mixins.json @@ -5,8 +5,8 @@ "refmap": "hexcasting.mixins.refmap.json", "package": "at.petrak.hexcasting.mixin", "mixins": [ - "MixinLivingEntity", "MixinAbstractVillager", + "MixinBuddingAmethystBlock", "MixinLivingEntity", "MixinMob", "MixinRaider", diff --git a/Fabric/src/generated/resources/data/hexcasting/advancement/recipes/redstone/neural_mesh.json b/Fabric/src/generated/resources/data/hexcasting/advancement/recipes/redstone/neural_mesh.json new file mode 100644 index 0000000000..5a76172263 --- /dev/null +++ b/Fabric/src/generated/resources/data/hexcasting/advancement/recipes/redstone/neural_mesh.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": "hexcasting:neural_fiber" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "hexcasting:neural_mesh" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "hexcasting:neural_mesh" + ] + } +} \ No newline at end of file diff --git a/Fabric/src/generated/resources/data/hexcasting/advancement/recipes/tools/staff/neural.json b/Fabric/src/generated/resources/data/hexcasting/advancement/recipes/tools/staff/neural.json new file mode 100644 index 0000000000..c3502060e1 --- /dev/null +++ b/Fabric/src/generated/resources/data/hexcasting/advancement/recipes/tools/staff/neural.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": "hexcasting:charged_amethyst" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "hexcasting:staff/neural" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "hexcasting:staff/neural" + ] + } +} \ No newline at end of file diff --git a/Fabric/src/generated/resources/data/hexcasting/loot_table/blocks/neural_mesh.json b/Fabric/src/generated/resources/data/hexcasting/loot_table/blocks/neural_mesh.json new file mode 100644 index 0000000000..49ecc8425a --- /dev/null +++ b/Fabric/src/generated/resources/data/hexcasting/loot_table/blocks/neural_mesh.json @@ -0,0 +1,106 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "add": true, + "count": -1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "down": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "up": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "north": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "south": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "west": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "east": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + } + ], + "name": "hexcasting:neural_mesh" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "hexcasting:blocks/neural_mesh" +} \ No newline at end of file diff --git a/Fabric/src/generated/resources/data/hexcasting/recipe/neural_mesh.json b/Fabric/src/generated/resources/data/hexcasting/recipe/neural_mesh.json new file mode 100644 index 0000000000..b1ae10c52c --- /dev/null +++ b/Fabric/src/generated/resources/data/hexcasting/recipe/neural_mesh.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "redstone", + "key": { + "C": { + "item": "hexcasting:neural_fiber" + }, + "D": { + "item": "hexcasting:neural_fiber" + }, + "I": { + "item": "minecraft:bone_block" + } + }, + "pattern": [ + "DCD", + "CIC", + "DCD" + ], + "result": { + "count": 1, + "id": "hexcasting:neural_mesh" + } +} \ No newline at end of file diff --git a/Fabric/src/generated/resources/data/hexcasting/recipe/staff/neural.json b/Fabric/src/generated/resources/data/hexcasting/recipe/staff/neural.json new file mode 100644 index 0000000000..a4288d0288 --- /dev/null +++ b/Fabric/src/generated/resources/data/hexcasting/recipe/staff/neural.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "key": { + "A": { + "item": "hexcasting:charged_amethyst" + }, + "S": { + "item": "minecraft:stick" + }, + "W": { + "item": "hexcasting:neural_mesh" + } + }, + "pattern": [ + " SA", + " WS", + "S " + ], + "result": { + "count": 1, + "id": "hexcasting:staff/neural" + } +} \ No newline at end of file diff --git a/Fabric/src/generated/resources/data/hexcasting/tags/item/staves.json b/Fabric/src/generated/resources/data/hexcasting/tags/item/staves.json index 29f4595c62..c3b2e7c4f8 100644 --- a/Fabric/src/generated/resources/data/hexcasting/tags/item/staves.json +++ b/Fabric/src/generated/resources/data/hexcasting/tags/item/staves.json @@ -13,6 +13,7 @@ "hexcasting:staff/cherry", "hexcasting:staff/bamboo", "hexcasting:staff/quenched", - "hexcasting:staff/mindsplice" + "hexcasting:staff/mindsplice", + "hexcasting:staff/neural" ] } \ No newline at end of file diff --git a/Neoforge/src/generated/resources/assets/hexcasting/models/item/neural_mesh.json b/Neoforge/src/generated/resources/assets/hexcasting/models/item/neural_mesh.json new file mode 100644 index 0000000000..4f9fe9bf8a --- /dev/null +++ b/Neoforge/src/generated/resources/assets/hexcasting/models/item/neural_mesh.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "hexcasting:item/neural_mesh" + } +} \ No newline at end of file diff --git a/Neoforge/src/generated/resources/assets/hexcasting/models/item/staff/neural.json b/Neoforge/src/generated/resources/assets/hexcasting/models/item/staff/neural.json new file mode 100644 index 0000000000..9d11027240 --- /dev/null +++ b/Neoforge/src/generated/resources/assets/hexcasting/models/item/staff/neural.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld_rod", + "textures": { + "layer0": "hexcasting:item/staff/neural" + } +} \ No newline at end of file diff --git a/Neoforge/src/generated/resources/assets/hexcasting/models/staff/neural.json b/Neoforge/src/generated/resources/assets/hexcasting/models/staff/neural.json new file mode 100644 index 0000000000..4890c91a60 --- /dev/null +++ b/Neoforge/src/generated/resources/assets/hexcasting/models/staff/neural.json @@ -0,0 +1,16 @@ +{ + "overrides": [ + { + "model": "hexcasting:item/neural_staff", + "predicate": { + "hexcasting:funny_level": 0.0 + } + }, + { + "model": "hexcasting:item/cherry_staff", + "predicate": { + "hexcasting:funny_level": 2.0 + } + } + ] +} \ No newline at end of file diff --git a/Neoforge/src/generated/resources/data/hexcasting/advancement/recipes/redstone/neural_mesh.json b/Neoforge/src/generated/resources/data/hexcasting/advancement/recipes/redstone/neural_mesh.json new file mode 100644 index 0000000000..5a76172263 --- /dev/null +++ b/Neoforge/src/generated/resources/data/hexcasting/advancement/recipes/redstone/neural_mesh.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": "hexcasting:neural_fiber" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "hexcasting:neural_mesh" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "hexcasting:neural_mesh" + ] + } +} \ No newline at end of file diff --git a/Neoforge/src/generated/resources/data/hexcasting/advancement/recipes/tools/staff/neural.json b/Neoforge/src/generated/resources/data/hexcasting/advancement/recipes/tools/staff/neural.json new file mode 100644 index 0000000000..c3502060e1 --- /dev/null +++ b/Neoforge/src/generated/resources/data/hexcasting/advancement/recipes/tools/staff/neural.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": "hexcasting:charged_amethyst" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "hexcasting:staff/neural" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "hexcasting:staff/neural" + ] + } +} \ No newline at end of file diff --git a/Neoforge/src/generated/resources/data/hexcasting/loot_table/blocks/neural_mesh.json b/Neoforge/src/generated/resources/data/hexcasting/loot_table/blocks/neural_mesh.json new file mode 100644 index 0000000000..49ecc8425a --- /dev/null +++ b/Neoforge/src/generated/resources/data/hexcasting/loot_table/blocks/neural_mesh.json @@ -0,0 +1,106 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "add": true, + "count": -1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "down": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "up": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "north": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "south": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "west": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + }, + { + "add": true, + "conditions": [ + { + "block": "hexcasting:neural_mesh", + "condition": "minecraft:block_state_property", + "properties": { + "east": "true" + } + } + ], + "count": 1.0, + "function": "minecraft:set_count" + } + ], + "name": "hexcasting:neural_mesh" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "hexcasting:blocks/neural_mesh" +} \ No newline at end of file diff --git a/Neoforge/src/generated/resources/data/hexcasting/recipe/neural_mesh.json b/Neoforge/src/generated/resources/data/hexcasting/recipe/neural_mesh.json new file mode 100644 index 0000000000..b1ae10c52c --- /dev/null +++ b/Neoforge/src/generated/resources/data/hexcasting/recipe/neural_mesh.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "redstone", + "key": { + "C": { + "item": "hexcasting:neural_fiber" + }, + "D": { + "item": "hexcasting:neural_fiber" + }, + "I": { + "item": "minecraft:bone_block" + } + }, + "pattern": [ + "DCD", + "CIC", + "DCD" + ], + "result": { + "count": 1, + "id": "hexcasting:neural_mesh" + } +} \ No newline at end of file diff --git a/Neoforge/src/generated/resources/data/hexcasting/recipe/staff/neural.json b/Neoforge/src/generated/resources/data/hexcasting/recipe/staff/neural.json new file mode 100644 index 0000000000..a4288d0288 --- /dev/null +++ b/Neoforge/src/generated/resources/data/hexcasting/recipe/staff/neural.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "key": { + "A": { + "item": "hexcasting:charged_amethyst" + }, + "S": { + "item": "minecraft:stick" + }, + "W": { + "item": "hexcasting:neural_mesh" + } + }, + "pattern": [ + " SA", + " WS", + "S " + ], + "result": { + "count": 1, + "id": "hexcasting:staff/neural" + } +} \ No newline at end of file diff --git a/Neoforge/src/generated/resources/data/hexcasting/tags/item/staves.json b/Neoforge/src/generated/resources/data/hexcasting/tags/item/staves.json index 29f4595c62..c3b2e7c4f8 100644 --- a/Neoforge/src/generated/resources/data/hexcasting/tags/item/staves.json +++ b/Neoforge/src/generated/resources/data/hexcasting/tags/item/staves.json @@ -13,6 +13,7 @@ "hexcasting:staff/cherry", "hexcasting:staff/bamboo", "hexcasting:staff/quenched", - "hexcasting:staff/mindsplice" + "hexcasting:staff/mindsplice", + "hexcasting:staff/neural" ] } \ No newline at end of file diff --git a/Neoforge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexItemModels.java b/Neoforge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexItemModels.java index ab0e8b6a27..607ad63a59 100644 --- a/Neoforge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexItemModels.java +++ b/Neoforge/src/main/java/at/petrak/hexcasting/forge/datagen/xplat/HexItemModels.java @@ -81,6 +81,8 @@ protected void registerModels() { .translation(-2.5f, 0f, -8f) .scale(0.4f); + simpleItem(HexItems.NEURAL_MESH.get()); + buildRobes(HexItems.ROBES_HOOD.get(), "hood", HexItems.ROBES_HOOD.get().numVariants()); buildRobes(HexItems.ROBES_TUNIC.get(), "tunic", HexItems.ROBES_HOOD.get().numVariants()); buildRobes(HexItems.ROBES_LEGS.get(), "legs", HexItems.ROBES_HOOD.get().numVariants()); @@ -104,6 +106,7 @@ protected void registerModels() { buildStaff(HexItems.STAFF_BAMBOO.get(), "bamboo"); buildStaff(HexItems.STAFF_EDIFIED.get(), "edified"); buildStaff(HexItems.STAFF_MINDSPLICE.get(), "mindsplice"); + buildStaff(HexItems.STAFF_NEURAL.get(), "neural"); // again, doesn't like paths with slashes in them, so we do it manually buildFourVariantGaslight("item/staff/quenched", "item/staff/quenched", (name, path) ->