Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexcasting:item/neural_mesh"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld_rod",
"textures": {
"layer0": "hexcasting:item/staff/neural"
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
]
}
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"hexcasting:staff/cherry",
"hexcasting:staff/bamboo",
"hexcasting:staff/quenched",
"hexcasting:staff/mindsplice"
"hexcasting:staff/mindsplice",
"hexcasting:staff/neural"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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<BlockNeuralMesh> CODEC = simpleCodec(BlockNeuralMesh::new);

public MapCodec<BlockNeuralMesh> 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();
}
}
Loading
Loading