diff --git a/src/main/java/biomesoplenty/api/block/BOPBlocks.java b/src/main/java/biomesoplenty/api/block/BOPBlocks.java index adb863d3c..6a032d2a0 100644 --- a/src/main/java/biomesoplenty/api/block/BOPBlocks.java +++ b/src/main/java/biomesoplenty/api/block/BOPBlocks.java @@ -138,6 +138,7 @@ public class BOPBlocks public static Block double_plant; public static Block honey_block; + public static Block jar_block; public static Block honey; public static Fluid honey_fluid; diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPFruit.java b/src/main/java/biomesoplenty/common/block/BlockBOPFruit.java index 183fefbe3..9b9959ae1 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPFruit.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPFruit.java @@ -67,6 +67,7 @@ public class BlockBOPFruit extends BlockBOPDecoration this.setStepSound(Block.soundTypeGrass); this.setBlockBoundsByRadiusAndHeight(0.25F, 0.25F, true); this.setDefaultState( this.blockState.getBaseState().withProperty(VARIANT, FruitType.APPLE) ); + this.setCreativeTab(null); } // map from state to meta and vice verca diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPJar.java b/src/main/java/biomesoplenty/common/block/BlockBOPJar.java new file mode 100644 index 000000000..f93813905 --- /dev/null +++ b/src/main/java/biomesoplenty/common/block/BlockBOPJar.java @@ -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 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 getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + List ret = new ArrayList(); + + //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; + } + +} \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/init/ModBlocks.java b/src/main/java/biomesoplenty/common/init/ModBlocks.java index dadddb0ea..a7f290b3d 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/common/init/ModBlocks.java @@ -221,6 +221,7 @@ public class ModBlocks double_plant = registerBlock( new BlockBOPDoublePlant(), "double_plant" ); honey_block = registerBlock( new BlockBOPHoney(), "honey_block" ); + jar_block = registerBlock( new BlockBOPJar(), "jar_block" ); // fluids diff --git a/src/main/java/biomesoplenty/common/item/ItemJarFilled.java b/src/main/java/biomesoplenty/common/item/ItemJarFilled.java index c7ab3dcb5..10a0c8333 100644 --- a/src/main/java/biomesoplenty/common/item/ItemJarFilled.java +++ b/src/main/java/biomesoplenty/common/item/ItemJarFilled.java @@ -170,7 +170,7 @@ public class ItemJarFilled extends Item double distZ = hitZ - player.posZ; double a = 0.9D; Vec3 releasePoint = new Vec3(player.posX + a * distX, player.posY + (double)player.getEyeHeight() + a * distY, player.posZ + a * distZ); - return this.releasePixie(stack, world, player, releasePoint); + return this.releasePixie(stack, world, player, releasePoint); // TODO: are you supposed to be able to pour out honey? How much should you get? Why don't we just use buckets? case HONEY: case POISON: case TERRARIUM: default: diff --git a/src/main/resources/assets/biomesoplenty/blockstates/jar_block.json b/src/main/resources/assets/biomesoplenty/blockstates/jar_block.json new file mode 100644 index 000000000..7e1e9dd75 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/blockstates/jar_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "biomesoplenty:jar" } + } +} diff --git a/src/main/resources/assets/biomesoplenty/lang/en_US.lang b/src/main/resources/assets/biomesoplenty/lang/en_US.lang index 65a553292..cc4b0c58d 100644 --- a/src/main/resources/assets/biomesoplenty/lang/en_US.lang +++ b/src/main/resources/assets/biomesoplenty/lang/en_US.lang @@ -277,6 +277,7 @@ tile.jacaranda_fence.name=Jacaranda Fence tile.jacaranda_fence_gate.name=Jacaranda Fence Gate tile.jacaranda_wood_slab.name=Jacaranda Wood Slab 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.orange_autumn_leaves.name=Orange Autumn Leaves tile.leaves_0.bamboo_leaves.name=Bamboo Leaves diff --git a/src/main/resources/assets/biomesoplenty/models/block/jar.json b/src/main/resources/assets/biomesoplenty/models/block/jar.json new file mode 100644 index 000000000..95966d3e4 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/jar.json @@ -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 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/biomesoplenty/models/item/jar_block.json b/src/main/resources/assets/biomesoplenty/models/item/jar_block.json new file mode 100644 index 000000000..89780e016 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/jar_block.json @@ -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 ] + } + } +} diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/jar_bottom.png b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_bottom.png new file mode 100644 index 000000000..14853559a Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_bottom.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/jar_bottom_side.png b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_bottom_side.png new file mode 100644 index 000000000..183be373b Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_bottom_side.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/jar_main_bottom.png b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_main_bottom.png new file mode 100644 index 000000000..dd7bcf6e4 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_main_bottom.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/jar_main_side.png b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_main_side.png new file mode 100644 index 000000000..07fdad7bf Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_main_side.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/jar_main_top.png b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_main_top.png new file mode 100644 index 000000000..0f0c51f75 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_main_top.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/jar_opening_side.png b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_opening_side.png new file mode 100644 index 000000000..56228859e Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_opening_side.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/jar_opening_top.png b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_opening_top.png new file mode 100644 index 000000000..cbe1d7470 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_opening_top.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/jar_stopper_side.png b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_stopper_side.png new file mode 100644 index 000000000..a569e9a22 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_stopper_side.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/jar_stopper_top.png b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_stopper_top.png new file mode 100644 index 000000000..c9d74152c Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/jar_stopper_top.png differ