From 8241c3cbd13c58f68f74d1082fd6288c73d5c317 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Wed, 29 Jul 2015 22:07:13 -0400 Subject: [PATCH] Added the .jsons for the base runes and added the BlockStates to it. --- .../alchemicalWizardry/ModBlocks.java | 2 +- .../common/block/BlockBloodRune.java | 30 +++++++++++-- .../blockstates/base_rune.json | 44 +++++++++++++++++++ .../blockstates/soul_armour_forge.json | 5 +++ 4 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/assets/alchemicalwizardry/blockstates/base_rune.json create mode 100644 src/main/resources/assets/alchemicalwizardry/blockstates/soul_armour_forge.json diff --git a/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java b/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java index fe8d95a6..eb22bdbc 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java +++ b/src/main/java/WayofTime/alchemicalWizardry/ModBlocks.java @@ -108,7 +108,7 @@ public class ModBlocks public static void init() { blockAltar = (BlockAltar) registerBlock(new BlockAltar(), "altar"); - bloodRune = (BlockBloodRune) registerBlock(new BlockBloodRune(), ItemBloodRuneBlock.class, ModBlocks.bloodRune.getUnlocalizedName()); + bloodRune = (BlockBloodRune) registerBlock(new BlockBloodRune(), ItemBloodRuneBlock.class, "base_rune"); speedRune = (BlockSpeedRune) registerBlock(new BlockSpeedRune(), "speed_rune"); efficiencyRune = (BlockEfficiencyRune) registerBlock(new BlockEfficiencyRune(), "efficiency_rune"); runeOfSacrifice = (BlockRuneOfSacrifice) registerBlock(new BlockRuneOfSacrifice(), "sacrifice_rune"); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodRune.java b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodRune.java index 78edb95f..7bf74a8d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodRune.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/block/BlockBloodRune.java @@ -1,25 +1,49 @@ package WayofTime.alchemicalWizardry.common.block; -import WayofTime.alchemicalWizardry.ModBlocks; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.List; +import WayofTime.alchemicalWizardry.ModBlocks; public class BlockBloodRune extends Block { + public static final PropertyInteger INTEGER = PropertyInteger.create("rune", 0, 5); + public BlockBloodRune() { super(Material.iron); + this.setDefaultState(this.blockState.getBaseState().withProperty(INTEGER, Integer.valueOf(0))); setHardness(2.0F); setResistance(5.0F); } + + @Override + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {INTEGER}); + } + + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(INTEGER, Integer.valueOf(meta)); + } + + @Override + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(INTEGER)).intValue(); + } public int getRuneEffect(int metaData) { diff --git a/src/main/resources/assets/alchemicalwizardry/blockstates/base_rune.json b/src/main/resources/assets/alchemicalwizardry/blockstates/base_rune.json new file mode 100644 index 00000000..75063334 --- /dev/null +++ b/src/main/resources/assets/alchemicalwizardry/blockstates/base_rune.json @@ -0,0 +1,44 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "all": "alchemicalwizardry:blocks/BlankRune" + }, + "model": "cube_all", + "uvlock": true + }, + "variants": { + "rune": { + 0: { + "textures": { + "all": "alchemicalwizardry:blocks/AltarCapacityRune" + } + }, + 1: { + "textures": { + "all": "alchemicalwizardry:blocks/AltarCapacityRune" + } + }, + 2: { + "textures": { + "all": "alchemicalwizardry:blocks/DislocationRune" + } + }, + 3: { + "textures": { + "all": "alchemicalwizardry:blocks/OrbCapacityRune" + } + }, + 4: { + "textures": { + "all": "alchemicalwizardry:blocks/BetterCapacityRune" + } + }, + 5: { + "textures": { + "all": "alchemicalwizardry:blocks/AccelerationRune" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/alchemicalwizardry/blockstates/soul_armour_forge.json b/src/main/resources/assets/alchemicalwizardry/blockstates/soul_armour_forge.json new file mode 100644 index 00000000..e2dcb2d7 --- /dev/null +++ b/src/main/resources/assets/alchemicalwizardry/blockstates/soul_armour_forge.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "alchemicalwizardry:soul_armour_forge" } + } +} \ No newline at end of file