Added jar block (Still needs work)

This commit is contained in:
Matt Caughey 2016-01-22 03:41:57 -05:00
parent 97ad030a85
commit ebf9f31d9d
18 changed files with 182 additions and 1 deletions

View file

@ -138,6 +138,7 @@ public class BOPBlocks
public static Block double_plant; public static Block double_plant;
public static Block honey_block; public static Block honey_block;
public static Block jar_block;
public static Block honey; public static Block honey;
public static Fluid honey_fluid; public static Fluid honey_fluid;

View file

@ -67,6 +67,7 @@ public class BlockBOPFruit extends BlockBOPDecoration
this.setStepSound(Block.soundTypeGrass); this.setStepSound(Block.soundTypeGrass);
this.setBlockBoundsByRadiusAndHeight(0.25F, 0.25F, true); this.setBlockBoundsByRadiusAndHeight(0.25F, 0.25F, true);
this.setDefaultState( this.blockState.getBaseState().withProperty(VARIANT, FruitType.APPLE) ); this.setDefaultState( this.blockState.getBaseState().withProperty(VARIANT, FruitType.APPLE) );
this.setCreativeTab(null);
} }
// map from state to meta and vice verca // map from state to meta and vice verca

View file

@ -0,0 +1,95 @@
/*******************************************************************************
* Copyright 2014-2016, 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 java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.block.IBOPBlock;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.block.BlockBOPHalfOtherSlab.SlabType;
import biomesoplenty.common.item.ItemBOPBlock;
import biomesoplenty.common.item.ItemJarFilled;
public class BlockBOPJar extends Block implements IBOPBlock
{
// implement IBOPBlock
@Override
public Class<? extends ItemBlock> getItemClass() { return ItemBOPBlock.class; }
@Override
public int getItemRenderColor(IBlockState state, int tintIndex) { return this.getRenderColor(state); }
@Override
public IProperty[] getPresetProperties() { return new IProperty[] {}; }
@Override
public IProperty[] getNonRenderingProperties() { return null; }
@Override
public String getStateName(IBlockState state) {return "";}
public BlockBOPJar() {
// use rock as default material
this(Material.glass);
}
public BlockBOPJar(Material material)
{
super(material);
// set some defaults
this.setHardness(1.0F);
this.setStepSound(Block.soundTypeGlass);
this.setCreativeTab(null);
}
@Override
public boolean isOpaqueCube()
{
return false;
}
// not full cube
@Override
public boolean isFullCube()
{
return false;
}
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
{
List<ItemStack> ret = new ArrayList<ItemStack>();
//Drop two of the corresponding half slab for this block
ret.add(new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.TERRARIUM.ordinal()));
return ret;
}
@Override
public EnumWorldBlockLayer getBlockLayer()
{
return EnumWorldBlockLayer.CUTOUT;
}
}

View file

@ -221,6 +221,7 @@ public class ModBlocks
double_plant = registerBlock( new BlockBOPDoublePlant(), "double_plant" ); double_plant = registerBlock( new BlockBOPDoublePlant(), "double_plant" );
honey_block = registerBlock( new BlockBOPHoney(), "honey_block" ); honey_block = registerBlock( new BlockBOPHoney(), "honey_block" );
jar_block = registerBlock( new BlockBOPJar(), "jar_block" );
// fluids // fluids

View file

@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "biomesoplenty:jar" }
}
}

View file

@ -277,6 +277,7 @@ tile.jacaranda_fence.name=Jacaranda Fence
tile.jacaranda_fence_gate.name=Jacaranda Fence Gate tile.jacaranda_fence_gate.name=Jacaranda Fence Gate
tile.jacaranda_wood_slab.name=Jacaranda Wood Slab tile.jacaranda_wood_slab.name=Jacaranda Wood Slab
tile.jacaranda_stairs.name=Jacaranda Wood Stairs tile.jacaranda_stairs.name=Jacaranda Wood Stairs
tile.jar_block.name=Terrarium Jar Block
tile.leaves_0.yellow_autumn_leaves.name=Yellow Autumn Leaves tile.leaves_0.yellow_autumn_leaves.name=Yellow Autumn Leaves
tile.leaves_0.orange_autumn_leaves.name=Orange Autumn Leaves tile.leaves_0.orange_autumn_leaves.name=Orange Autumn Leaves
tile.leaves_0.bamboo_leaves.name=Bamboo Leaves tile.leaves_0.bamboo_leaves.name=Bamboo Leaves

View file

@ -0,0 +1,67 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"ambientocclusion": false,
"textures": {
"0": "biomesoplenty:blocks/jar_main_side",
"1": "biomesoplenty:blocks/jar_main_top",
"2": "biomesoplenty:blocks/jar_main_bottom",
"3": "biomesoplenty:blocks/jar_opening_side",
"4": "biomesoplenty:blocks/jar_opening_top",
"5": "biomesoplenty:blocks/jar_bottom_side",
"6": "biomesoplenty:blocks/jar_bottom",
"7": "biomesoplenty:blocks/jar_stopper_side",
"8": "biomesoplenty:blocks/jar_stopper_top"
},
"elements": [
{
"name": "Jar",
"from": [ 4.0, 1.0, 4.0 ],
"to": [ 13.0, 9.0, 13.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 4.0, 7.0, 13.0, 15.0 ] },
"east": { "texture": "#0", "uv": [ 4.0, 7.0, 13.0, 15.0 ] },
"south": { "texture": "#0", "uv": [ 4.0, 7.0, 13.0, 15.0 ] },
"west": { "texture": "#0", "uv": [ 4.0, 7.0, 13.0, 15.0 ] },
"up": { "texture": "#1", "uv": [ 4.0, 4.0, 13.0, 13.0 ] },
"down": { "texture": "#2", "uv": [ 4.0, 4.0, 13.0, 13.0 ] }
}
},
{
"name": "Opening",
"from": [ 5.0, 9.0, 5.0 ],
"to": [ 12.0, 12.0, 12.0 ],
"faces": {
"north": { "texture": "#3", "uv": [ 5.0, 4.0, 12.0, 7.0 ] },
"east": { "texture": "#3", "uv": [ 5.0, 4.0, 12.0, 7.0 ] },
"south": { "texture": "#3", "uv": [ 5.0, 4.0, 12.0, 7.0 ] },
"west": { "texture": "#3", "uv": [ 5.0, 4.0, 12.0, 7.0 ] },
"up": { "texture": "#4", "uv": [ 5.0, 5.0, 12.0, 12.0 ] }
}
},
{
"name": "Bottom",
"from": [ 5.0, 0.0, 5.0 ],
"to": [ 12.0, 1.0, 12.0 ],
"faces": {
"north": { "texture": "#5", "uv": [ 5.0, 16.0, 12.0, 15.0 ] },
"east": { "texture": "#5", "uv": [ 5.0, 16.0, 12.0, 15.0 ] },
"south": { "texture": "#5", "uv": [ 5.0, 16.0, 12.0, 15.0 ] },
"west": { "texture": "#5", "uv": [ 5.0, 16.0, 12.0, 15.0 ] },
"down": { "texture": "#6", "uv": [ 5.0, 5.0, 12.0, 12.0 ] }
}
},
{
"name": "Stopper",
"from": [ 6.0, 10.0, 6.0 ],
"to": [ 11.0, 13.0, 11.0 ],
"faces": {
"north": { "texture": "#7", "uv": [ 6.0, 3.0, 11.0, 6.0 ] },
"east": { "texture": "#7", "uv": [ 6.0, 3.0, 11.0, 6.0 ] },
"south": { "texture": "#7", "uv": [ 6.0, 3.0, 11.0, 6.0 ] },
"west": { "texture": "#7", "uv": [ 6.0, 3.0, 11.0, 6.0 ] },
"up": { "texture": "#8", "uv": [ 6.0, 5.0, 11.0, 10.0 ] },
"down": { "texture": "#8", "uv": [ 6.0, 5.0, 11.0, 10.0 ] }
}
}
]
}

View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B