From 5be58608b60e2ec71335751d18c0bdde244ef3f2 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 25 Feb 2020 20:07:26 +0100 Subject: [PATCH] nether altar, part 1 --- .../blockstates/gold_nether_brick.json | 7 +++ .../naturesaura/blockstates/nature_altar.json | 7 --- .../models/block/gold_nether_brick.json | 6 +++ .../models/item/gold_nether_brick.json | 3 ++ .../loot_tables/blocks/gold_nether_brick.json | 19 ++++++++ .../naturesaura/blocks/BlockNatureAltar.java | 23 ++++++++- .../ellpeck/naturesaura/blocks/ModBlocks.java | 1 + .../naturesaura/blocks/multi/Multiblocks.java | 20 ++++++-- .../ellpeck/naturesaura/reg/ModRegistry.java | 3 +- .../naturesaura/blockstates/nature_altar.json | 10 ++++ .../assets/naturesaura/lang/en_us.json | 1 + .../models/block/nature_altar_nether.json | 45 ++++++++++++++++++ .../textures/block/gold_nether_brick.png | Bin 0 -> 676 bytes .../textures/block/nature_altar_nether.png | Bin 0 -> 303 bytes .../block/nature_altar_nether_top.png | Bin 0 -> 401 bytes 15 files changed, 131 insertions(+), 14 deletions(-) create mode 100644 src/generated/resources/assets/naturesaura/blockstates/gold_nether_brick.json delete mode 100644 src/generated/resources/assets/naturesaura/blockstates/nature_altar.json create mode 100644 src/generated/resources/assets/naturesaura/models/block/gold_nether_brick.json create mode 100644 src/generated/resources/assets/naturesaura/models/item/gold_nether_brick.json create mode 100644 src/generated/resources/data/naturesaura/loot_tables/blocks/gold_nether_brick.json create mode 100644 src/main/resources/assets/naturesaura/blockstates/nature_altar.json create mode 100644 src/main/resources/assets/naturesaura/models/block/nature_altar_nether.json create mode 100644 src/main/resources/assets/naturesaura/textures/block/gold_nether_brick.png create mode 100644 src/main/resources/assets/naturesaura/textures/block/nature_altar_nether.png create mode 100644 src/main/resources/assets/naturesaura/textures/block/nature_altar_nether_top.png 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 0000000000000000000000000000000000000000..31f34a9da3ada1f0236aa4ae3eab19f22533dc9f GIT binary patch literal 676 zcmV;V0$crwP)u9jP%2G$=#!&-kRnm9L=ZzM%l*6G>!Q;xh2i6opnx z18E5Vj>cu+u`(OtsaY}^ffocwLk)mvcq)QBq;Ws~S64Je;lW zA8+DcR%U&+JD0J|-ffic9IGg1Dnq;Lv({AUJJHY_5$x$=8OyS0cYQWiO#rs``mvy9 zDuZ0D+nBn+?xD-`Rvz2;+1l&JYTJaEy1~|7AIno&YpSfxC$W7$a^b#3g{&G2)H${> zQx*VD5TGdvyZfgAY^<7S%Fjr|@oYid_jkx`7`E@DDat?Z)|5-0%kj$)Sb<>FHQCzQq2u6(5mJ$Xp|V zVdxxotXPj>&yZ?-ua&w+K}*Mt0HFxk-05Kx#<^Cr#IwaxOzAh|ko-Y7%&8dw0000< KMNUMnLSTZTPc^SY zG}!{jOUx!n)O?lYneWYvJ@A&;rD+4uxQi=*5ER=}Cvowe-nj&m=H?g!L~-n6lez|= z0OqSH06)hI%Q&WXu@9{QI2XkYkVxqPB~ZD&1%9x6oo&HBrq67jRj3nXu(AneF#^&5?`P%*i~2U%Eu5Y ztehOd;Q3y$zYle~9#@r(&A%kIq!LXrXCynvgWr%h>3prQGwFjt# vKp-WKlsKNJF1(%Ob@!&uZNTxolm_4jv>u3=*yu`i00000NkvXXu0mjfNC>kH literal 0 HcmV?d00001