diff --git a/src/generated/resources/assets/naturesaura/blockstates/gold_nether_brick.json b/src/generated/resources/assets/naturesaura/blockstates/gold_nether_brick.json new file mode 100644 index 00000000..43fefbcb --- /dev/null +++ b/src/generated/resources/assets/naturesaura/blockstates/gold_nether_brick.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "naturesaura:block/gold_nether_brick" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/blockstates/nature_altar.json b/src/generated/resources/assets/naturesaura/blockstates/nature_altar.json deleted file mode 100644 index 000aa5ee..00000000 --- a/src/generated/resources/assets/naturesaura/blockstates/nature_altar.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "naturesaura:block/nature_altar" - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/gold_nether_brick.json b/src/generated/resources/assets/naturesaura/models/block/gold_nether_brick.json new file mode 100644 index 00000000..46cb5c07 --- /dev/null +++ b/src/generated/resources/assets/naturesaura/models/block/gold_nether_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "naturesaura:block/gold_nether_brick" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/item/gold_nether_brick.json b/src/generated/resources/assets/naturesaura/models/item/gold_nether_brick.json new file mode 100644 index 00000000..34bd3309 --- /dev/null +++ b/src/generated/resources/assets/naturesaura/models/item/gold_nether_brick.json @@ -0,0 +1,3 @@ +{ + "parent": "naturesaura:block/gold_nether_brick" +} \ No newline at end of file diff --git a/src/generated/resources/data/naturesaura/loot_tables/blocks/gold_nether_brick.json b/src/generated/resources/data/naturesaura/loot_tables/blocks/gold_nether_brick.json new file mode 100644 index 00000000..bdaaa93a --- /dev/null +++ b/src/generated/resources/data/naturesaura/loot_tables/blocks/gold_nether_brick.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "naturesaura:gold_nether_brick" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockNatureAltar.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockNatureAltar.java index f1fcf5ab..a36d258c 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockNatureAltar.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockNatureAltar.java @@ -1,17 +1,23 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.Helper; +import de.ellpeck.naturesaura.api.NaturesAuraAPI; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityNatureAltar; import de.ellpeck.naturesaura.blocks.tiles.render.RenderNatureAltar; import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.reg.ICustomBlockState; import de.ellpeck.naturesaura.reg.ITESRProvider; +import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.state.BooleanProperty; +import net.minecraft.state.StateContainer; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; @@ -25,12 +31,14 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraftforge.common.ToolType; +import javax.annotation.Nullable; import java.util.function.Function; import java.util.function.Supplier; public class BlockNatureAltar extends BlockContainerImpl implements ITESRProvider, ICustomBlockState { private static final VoxelShape SHAPE = VoxelShapes.create(0, 0, 0, 1, 12 / 16F, 1); + public static final BooleanProperty NETHER = BooleanProperty.create("nether"); public BlockNatureAltar() { super("nature_altar", TileEntityNatureAltar::new, ModBlocks.prop(Material.ROCK).hardnessAndResistance(4F).harvestLevel(1).harvestTool(ToolType.PICKAXE)); @@ -58,6 +66,19 @@ public class BlockNatureAltar extends BlockContainerImpl implements ITESRProvide @Override public void generateCustomBlockState(BlockStateGenerator generator) { - generator.simpleBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName()))); + // noop + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + super.fillStateContainer(builder); + builder.add(NETHER); + } + + @Nullable + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + boolean nether = IAuraType.forWorld(context.getWorld()).isSimilar(NaturesAuraAPI.TYPE_NETHER); + return super.getStateForPlacement(context).with(NETHER, nether); } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/ModBlocks.java b/src/main/java/de/ellpeck/naturesaura/blocks/ModBlocks.java index caf9ee6d..b8ca6db5 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/ModBlocks.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/ModBlocks.java @@ -45,6 +45,7 @@ public final class ModBlocks { public static Block ANIMAL_SPAWNER; public static Block AUTO_CRAFTER; public static Block GOLD_BRICK; + public static Block GOLD_NETHER_BRICK; public static Block RF_CONVERTER; public static Block MOSS_GENERATOR; public static Block TIME_CHANGER; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java b/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java index 55a46c98..a4ba5562 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java @@ -15,19 +15,29 @@ import net.minecraft.util.ResourceLocation; public final class Multiblocks { + private static final String[][] ALTAR_PATTERN = new String[][]{ + {" M ", " ", " ", " ", "M M", " ", " ", " ", " M "}, + {" B ", " ", " ", " ", "B B", " ", " ", " ", " B "}, + {" B ", " ", " M M ", " ", "B 0 B", " ", " M M ", " ", " B "}, + {" ", " WBW ", " WBW ", " WWCWCWW ", " BBW WBB ", " WWCWCWW ", " WBW ", " WBW ", " "}}; public static final IMultiblock ALTAR = NaturesAuraAPI.instance().createMultiblock( new ResourceLocation(NaturesAura.MOD_ID, "altar"), - new String[][]{ - {" M ", " ", " ", " ", "M M", " ", " ", " ", " M "}, - {" B ", " ", " ", " ", "B B", " ", " ", " ", " B "}, - {" B ", " ", " M M ", " ", "B 0 B", " ", " M M ", " ", " B "}, - {" ", " WBW ", " WBW ", " WWCWCWW ", " BBW WBB ", " WWCWCWW ", " WBW ", " WBW ", " "}}, + ALTAR_PATTERN, 'C', Blocks.CHISELED_STONE_BRICKS, 'B', Blocks.STONE_BRICKS, 'W', Matcher.tag(Blocks.OAK_PLANKS, BlockTags.PLANKS), 'M', ModBlocks.GOLD_BRICK, '0', ModBlocks.NATURE_ALTAR, ' ', Matcher.wildcard()); + public static final IMultiblock NETHER_ALTAR = NaturesAuraAPI.instance().createMultiblock( + new ResourceLocation(NaturesAura.MOD_ID, "nether_altar"), + ALTAR_PATTERN, + 'C', Blocks.RED_NETHER_BRICKS, + 'B', Blocks.NETHER_BRICKS, + 'W', Blocks.NETHER_WART_BLOCK, + 'M', ModBlocks.GOLD_NETHER_BRICK, + '0', ModBlocks.NATURE_ALTAR, + ' ', Matcher.wildcard()); public static final IMultiblock TREE_RITUAL = NaturesAuraAPI.instance().createMultiblock( new ResourceLocation(NaturesAura.MOD_ID, "tree_ritual"), new String[][]{ diff --git a/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java b/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java index 57a49327..f74b71b5 100644 --- a/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java +++ b/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java @@ -109,7 +109,8 @@ public final class ModRegistry { new BlockGratedChute(), new BlockAnimalSpawner(), new BlockAutoCrafter(), - new BlockImpl("gold_brick", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2F)), + new BlockImpl("gold_brick", ModBlocks.prop(Blocks.STONE_BRICKS)), + new BlockImpl("gold_nether_brick", ModBlocks.prop(Blocks.NETHER_BRICKS)), new BlockMossGenerator(), new BlockTimeChanger(), new BlockGeneratorLimitRemover(), diff --git a/src/main/resources/assets/naturesaura/blockstates/nature_altar.json b/src/main/resources/assets/naturesaura/blockstates/nature_altar.json new file mode 100644 index 00000000..1bd6fdb0 --- /dev/null +++ b/src/main/resources/assets/naturesaura/blockstates/nature_altar.json @@ -0,0 +1,10 @@ +{ + "variants": { + "nether=false": { + "model": "naturesaura:block/nature_altar" + }, + "nether=true": { + "model": "naturesaura:block/nature_altar_nether" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/lang/en_us.json b/src/main/resources/assets/naturesaura/lang/en_us.json index 13f3b561..0a10915d 100644 --- a/src/main/resources/assets/naturesaura/lang/en_us.json +++ b/src/main/resources/assets/naturesaura/lang/en_us.json @@ -41,6 +41,7 @@ "block.naturesaura.animal_spawner": "Altar of Birthing", "block.naturesaura.auto_crafter": "Automatic Constructor", "block.naturesaura.gold_brick": "Golden Stone Bricks", + "block.naturesaura.gold_nether_brick": "Golden Nether Bricks", "block.naturesaura.rf_converter": "Energetic Aura Forge", "block.naturesaura.moss_generator": "Swamp Homi", "block.naturesaura.time_changer": "Shifting Sundial", diff --git a/src/main/resources/assets/naturesaura/models/block/nature_altar_nether.json b/src/main/resources/assets/naturesaura/models/block/nature_altar_nether.json new file mode 100644 index 00000000..e2cfd9e4 --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/block/nature_altar_nether.json @@ -0,0 +1,45 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "texture": "naturesaura:block/nature_altar_nether", + "top": "naturesaura:block/nature_altar_nether_top", + "particle": "#top" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 12, 16], + "faces": { + "down": { + "uv": [0, 0, 16, 16], + "texture": "#top", + "cullface": "down" + }, + "up": { + "uv": [0, 0, 16, 16], + "texture": "#top" + }, + "north": { + "uv": [0, 4, 16, 16], + "texture": "#texture", + "cullface": "north" + }, + "south": { + "uv": [0, 4, 16, 16], + "texture": "#texture", + "cullface": "south" + }, + "west": { + "uv": [0, 4, 16, 16], + "texture": "#texture", + "cullface": "west" + }, + "east": { + "uv": [0, 4, 16, 16], + "texture": "#texture", + "cullface": "east" + } + } + } + ] +} diff --git a/src/main/resources/assets/naturesaura/textures/block/gold_nether_brick.png b/src/main/resources/assets/naturesaura/textures/block/gold_nether_brick.png new file mode 100644 index 00000000..31f34a9d Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/gold_nether_brick.png differ diff --git a/src/main/resources/assets/naturesaura/textures/block/nature_altar_nether.png b/src/main/resources/assets/naturesaura/textures/block/nature_altar_nether.png new file mode 100644 index 00000000..4fbe244a Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/nature_altar_nether.png differ diff --git a/src/main/resources/assets/naturesaura/textures/block/nature_altar_nether_top.png b/src/main/resources/assets/naturesaura/textures/block/nature_altar_nether_top.png new file mode 100644 index 00000000..d8889a68 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/nature_altar_nether_top.png differ