Readded gem/gem ore blocks

This commit is contained in:
Adubbz 2014-12-12 21:40:36 +11:00
parent 75041a2b3c
commit eed5bf7627
40 changed files with 285 additions and 108 deletions

View File

@ -16,6 +16,8 @@ public class BOPBlocks
public static Block bamboo;
public static Block flower;
public static Block flower2;
public static Block gem;
public static Block gem_ore;
public static Block log;
public static Block log2;
public static Block log3;

View File

@ -0,0 +1,97 @@
/*******************************************************************************
* Copyright 2014, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.block;
import biomesoplenty.api.block.BOPBlock;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.IStringSerializable;
//TODO: Add gem ore drops, make gem item seperate
public class BlockGem extends BOPBlock
{
public static final PropertyEnum VARIANT_PROP = PropertyEnum.create("variant", GemType.class);
public BlockGem()
{
super(Material.rock);
this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT_PROP, GemType.AMETHYST));
for (IBlockState state : presetStates)
{
this.setHarvestLevel("pickaxe", 2, state);
}
this.setHarvestLevel("pickaxe", 3, this.getDefaultState().withProperty(VARIANT_PROP, GemType.AMETHYST));
this.setHardness(5.0F);
this.setResistance(10.0F);
this.setStepSound(Block.soundTypeMetal);
}
@Override
public IBlockState getStateFromMeta(int meta)
{
return this.getDefaultState().withProperty(VARIANT_PROP, GemType.values()[meta]);
}
@Override
public int getMetaFromState(IBlockState state)
{
int meta = ((GemType)state.getValue(VARIANT_PROP)).ordinal();
return meta;
}
@Override
protected BlockState createBlockState()
{
return new BlockState(this, new IProperty[] { VARIANT_PROP });
}
@Override
public IProperty[] getPresetProperties()
{
return new IProperty[] { VARIANT_PROP };
}
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((GemType)state.getValue(VARIANT_PROP)).getName() + (fullName ? "_block" : "");
}
public static enum GemType implements IStringSerializable
{
AMETHYST,
RUBY,
PERIDOT,
TOPAZ,
TANZANITE,
MALACHITE,
SAPPHIRE,
AMBER;
public String getName()
{
return this.name().toLowerCase();
}
@Override
public String toString()
{
return getName();
}
}
}

View File

@ -0,0 +1,69 @@
/*******************************************************************************
* Copyright 2014, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.block;
import static biomesoplenty.common.block.BlockGem.VARIANT_PROP;
import biomesoplenty.api.block.BOPBlock;
import biomesoplenty.common.block.BlockGem.GemType;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
public class BlockGemOre extends BOPBlock
{
public BlockGemOre()
{
super(Material.rock);
this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT_PROP, GemType.AMETHYST));
for (IBlockState state : presetStates)
{
this.setHarvestLevel("pickaxe", 2, state);
}
this.setHardness(3.0F);
this.setResistance(5.0F);
this.setStepSound(Block.soundTypePiston);
}
@Override
public IBlockState getStateFromMeta(int meta)
{
return this.getDefaultState().withProperty(VARIANT_PROP, GemType.values()[meta]);
}
@Override
public int getMetaFromState(IBlockState state)
{
int meta = ((GemType)state.getValue(VARIANT_PROP)).ordinal();
return meta;
}
@Override
protected BlockState createBlockState()
{
return new BlockState(this, new IProperty[] { VARIANT_PROP });
}
@Override
public IProperty[] getPresetProperties()
{
return new IProperty[] { VARIANT_PROP };
}
@Override
public String getStateName(IBlockState state, boolean fullName)
{
return ((GemType)state.getValue(VARIANT_PROP)).getName() + (fullName ? "_ore" : "");
}
}

View File

@ -29,6 +29,8 @@ import biomesoplenty.common.block.BlockBOPMushroom;
import biomesoplenty.common.block.BlockBOPPlanks;
import biomesoplenty.common.block.BlockBOPStone;
import biomesoplenty.common.block.BlockBamboo;
import biomesoplenty.common.block.BlockGem;
import biomesoplenty.common.block.BlockGemOre;
import biomesoplenty.common.item.ItemBlockWithVariants;
import biomesoplenty.common.util.block.BlockStateUtils;
import biomesoplenty.core.BiomesOPlenty;
@ -41,6 +43,8 @@ public class ModBlocks
bamboo = registerBlock(new BlockBamboo(), "bamboo");
flower = registerBlock(new BlockBOPFlower(), "flower");
flower2 = registerBlock(new BlockBOPFlower2(), "flower2");
gem = registerBlock(new BlockGem(), "gem");
gem_ore = registerBlock(new BlockGemOre(), "gem_ore");
log = registerBlock(new BlockBOPLog(), "log");
log2 = registerBlock(new BlockBOPLog2(), "log2");
log3 = registerBlock(new BlockBOPLog3(), "log3");

View File

@ -0,0 +1,12 @@
{
"variants": {
"variant=amethyst": { "model": "biomesoplenty:amethyst_block" },
"variant=ruby": { "model": "biomesoplenty:ruby_block" },
"variant=peridot": { "model": "biomesoplenty:peridot_block" },
"variant=topaz": { "model": "biomesoplenty:topaz_block" },
"variant=tanzanite": { "model": "biomesoplenty:tanzanite_block" },
"variant=malachite": { "model": "biomesoplenty:malachite_block" },
"variant=sapphire": { "model": "biomesoplenty:sapphire_block" },
"variant=amber": { "model": "biomesoplenty:amber_block" }
}
}

View File

@ -0,0 +1,12 @@
{
"variants": {
"variant=amethyst": { "model": "biomesoplenty:amethyst_ore" },
"variant=ruby": { "model": "biomesoplenty:ruby_ore" },
"variant=peridot": { "model": "biomesoplenty:peridot_ore" },
"variant=topaz": { "model": "biomesoplenty:topaz_ore" },
"variant=tanzanite": { "model": "biomesoplenty:tanzanite_ore" },
"variant=malachite": { "model": "biomesoplenty:malachite_ore" },
"variant=sapphire": { "model": "biomesoplenty:sapphire_ore" },
"variant=amber": { "model": "biomesoplenty:amber_ore" }
}
}

View File

@ -1,20 +0,0 @@
{
"variants": {
"variant=amethyst_ore": { "model": "biomesoplenty:amethyst_ore" },
"variant=block_of_amethyst": { "model": "biomesoplenty:block_of_amethyst" },
"variant=ruby_ore": { "model": "biomesoplenty:ruby_ore" },
"variant=block_of_ruby": { "model": "biomesoplenty:block_of_ruby" },
"variant=peridot_ore": { "model": "biomesoplenty:peridot_ore" },
"variant=block_of_peridot": { "model": "biomesoplenty:block_of_peridot" },
"variant=topaz_ore": { "model": "biomesoplenty:topaz_ore" },
"variant=block_of_topaz": { "model": "biomesoplenty:block_of_topaz" },
"variant=tanzanite_ore": { "model": "biomesoplenty:tanzanite_ore" },
"variant=block_of_tanzanite": { "model": "biomesoplenty:block_of_tanzanite" },
"variant=malachite_ore": { "model": "biomesoplenty:malachite_ore" },
"variant=block_of_malachite": { "model": "biomesoplenty:block_of_malachite" },
"variant=sapphire_ore": { "model": "biomesoplenty:sapphire_ore" },
"variant=block_of_sapphire": { "model": "biomesoplenty:block_of_sapphire" },
"variant=amber_ore": { "model": "biomesoplenty:amber_ore" },
"variant=block_of_amber": { "model": "biomesoplenty:block_of_amber" }
}
}

View File

@ -43,22 +43,23 @@ tile.flower2.miners_delight.name=Miner's Delight
tile.flower2.icy_iris.name=Icy Iris
tile.flower2.rose.name=Rose
tile.gems.amethyst_ore.name=Ender Amethyst Ore
tile.gems.block_of_amethyst.name=Block of Amethyst
tile.gems.ruby_ore.name=Ruby Ore
tile.gems.block_of_ruby.name=Block of Ruby
tile.gems.peridot_ore.name=Peridot Ore
tile.gems.block_of_peridot.name=Block of Peridot
tile.gems.topaz_ore.name=Topaz Ore
tile.gems.block_of_topaz.name=Block of Topaz
tile.gems.tanzanite_ore.name=Tanzanite Ore
tile.gems.block_of_tanzanite.name=Block of Tanzanite
tile.gems.malachite_ore.name=Malachite Ore
tile.gems.block_of_malachite.name=Block of Malachite
tile.gems.sapphire_ore.name=Sapphire Ore
tile.gems.block_of_sapphire.name=Block of Sapphire
tile.gems.amber_ore.name=Amber Ore
tile.gems.block_of_amber.name=Block of Amber
tile.gem.amethyst.name=Block of Amethyst
tile.gem.ruby.name=Block of Ruby
tile.gem.peridot.name=Block of Peridot
tile.gem.topaz.name=Block of Topaz
tile.gem.tanzanite.name=Block of Tanzanite
tile.gem.malachite.name=Block of Malachite
tile.gem.sapphire.name=Block of Sapphire
tile.gem.amber.name=Block of Amber
tile.gem_ore.amethyst.name=Ender Amethyst Ore
tile.gem_ore.ruby.name=Ruby Ore
tile.gem_ore.peridot.name=Peridot Ore
tile.gem_ore.topaz.name=Topaz Ore
tile.gem_ore.tanzanite.name=Tanzanite Ore
tile.gem_ore.malachite.name=Malachite Ore
tile.gem_ore.sapphire.name=Sapphire Ore
tile.gem_ore.amber.name=Amber Ore
tile.hive.hive_block.name=Hive Block
tile.hive.honeycomb_block.name=Honeycomb Block

View File

@ -1,6 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/block_of_ruby"
"all": "biomesoplenty:blocks/amber_block"
}
}

View File

@ -1,6 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/block_of_amber"
"all": "biomesoplenty:blocks/amethyst_block"
}
}

View File

@ -1,6 +0,0 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/block_of_amethyst"
}
}

View File

@ -1,6 +0,0 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/block_of_malachite"
}
}

View File

@ -1,6 +0,0 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/block_of_sapphire"
}
}

View File

@ -1,6 +0,0 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/block_of_tanzanite"
}
}

View File

@ -1,6 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/block_of_peridot"
"all": "biomesoplenty:blocks/malachite_block"
}
}

View File

@ -1,6 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/block_of_topaz"
"all": "biomesoplenty:blocks/peridot_block"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/ruby_block"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/sapphire_block"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/tanzanite_block"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "biomesoplenty:blocks/topaz_block"
}
}

View File

@ -1,5 +1,5 @@
{
"parent": "biomesoplenty:block/block_of_ruby",
"parent": "biomesoplenty:block/amber_block",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],

View File

@ -1,5 +1,5 @@
{
"parent": "biomesoplenty:block/block_of_amber",
"parent": "biomesoplenty:block/amethyst_block",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],

View File

@ -1,10 +0,0 @@
{
"parent": "biomesoplenty:block/block_of_amethyst",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

View File

@ -1,10 +0,0 @@
{
"parent": "biomesoplenty:block/block_of_malachite",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

View File

@ -1,10 +0,0 @@
{
"parent": "biomesoplenty:block/block_of_sapphire",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

View File

@ -1,10 +0,0 @@
{
"parent": "biomesoplenty:block/block_of_tanzanite",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

View File

@ -1,5 +1,5 @@
{
"parent": "biomesoplenty:block/block_of_peridot",
"parent": "biomesoplenty:block/malachite_block",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],

View File

@ -1,5 +1,5 @@
{
"parent": "biomesoplenty:block/block_of_topaz",
"parent": "biomesoplenty:block/peridot_block",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],

View File

@ -0,0 +1,10 @@
{
"parent": "biomesoplenty:block/ruby_block",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

View File

@ -0,0 +1,10 @@
{
"parent": "biomesoplenty:block/sapphire_block",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

View File

@ -0,0 +1,10 @@
{
"parent": "biomesoplenty:block/tanzanite_block",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

View File

@ -0,0 +1,10 @@
{
"parent": "biomesoplenty:block/topaz_block",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}