Readded the mushrooms

This commit is contained in:
Adubbz 2014-10-14 19:10:06 +11:00
parent 5edaf907b8
commit 9d341a9921
23 changed files with 270 additions and 0 deletions

View File

@ -19,5 +19,6 @@ public class BOPBlocks
public static Block log2;
public static Block log3;
public static Block log4;
public static Block mushroom;
public static Block planks;
}

View File

@ -0,0 +1,106 @@
/*******************************************************************************
* 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 net.minecraft.block.Block;
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.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import biomesoplenty.api.block.BOPPlant;
import biomesoplenty.api.block.IBOPVariant;
public class BlockBOPMushroom extends BOPPlant
{
public static PropertyEnum VARIANT_PROP = PropertyEnum.create("variant", MushroomType.class);
public BlockBOPMushroom()
{
super(VARIANT_PROP);
}
//TODO: Add light for glowshrooms (Requires Forge)
@Override
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
{
Block ground = world.getBlockState(pos.offsetDown()).getBlock();
MushroomType type = (MushroomType)state.getValue(VARIANT_PROP);
switch (type)
{
//TODO: Make the toadstool, glowshroom, flat mushroom require overgrown netherrack
//TODO: Make flat mushroom, shadow shroom require bopgrass
case TOADSTOOL:
return ground == Blocks.grass || ground == Blocks.dirt || ground == Blocks.mycelium || ground == Blocks.grass;
case GLOWSHROOM:
return ground == Blocks.grass || ground == Blocks.dirt || ground == Blocks.mycelium || ground == Blocks.stone || ground == Blocks.netherrack;
case FLAT_MUSHROOM:
return ground == Blocks.grass || ground == Blocks.dirt || ground == Blocks.mycelium;
case SHADOW_SHROOM:
return ground == Blocks.grass || ground == Blocks.dirt || ground == Blocks.mycelium || ground == Blocks.end_stone;
default:
return ground == Blocks.grass || ground == Blocks.dirt || ground == Blocks.mycelium;
}
}
@Override
protected BlockState createBlockState()
{
return new BlockState(this, new IProperty[] { VARIANT_PROP });
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos)
{
this.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, 0.4F, 0.7F);
}
public static enum MushroomType implements IBOPVariant
{
TOADSTOOL,
PORTOBELLO,
BLUE_MILK_CAP,
GLOWSHROOM,
FLAT_MUSHROOM,
SHADOW_SHROOM;
@Override
public String getBaseName()
{
return null;
}
@Override
public String getName()
{
return this.name().toLowerCase();
}
@Override
public String toString()
{
return getName();
}
@Override
public int getDefaultMetadata()
{
return this.ordinal();
}
}
}

View File

@ -24,6 +24,7 @@ import biomesoplenty.common.block.BlockBOPLog;
import biomesoplenty.common.block.BlockBOPLog2;
import biomesoplenty.common.block.BlockBOPLog3;
import biomesoplenty.common.block.BlockBOPLog4;
import biomesoplenty.common.block.BlockBOPMushroom;
import biomesoplenty.common.item.ItemBlockWithVariants;
import biomesoplenty.core.BiomesOPlenty;
@ -38,6 +39,7 @@ public class ModBlocks
log2 = registerBlock(new BlockBOPLog2(), "log2");
log3 = registerBlock(new BlockBOPLog3(), "log3");
log4 = registerBlock(new BlockBOPLog4(), "log4");
mushroom = registerBlock(new BlockBOPMushroom(), "mushroom");
planks = registerBlock(new BOPBlockPlanks(), "planks");
}

View File

@ -0,0 +1,10 @@
{
"variants": {
"variant=toadstool": { "model": "biomesoplenty:toadstool" },
"variant=portobello": { "model": "biomesoplenty:portobello" },
"variant=blue_milk_cap": { "model": "biomesoplenty:blue_milk_cap" },
"variant=glowshroom": { "model": "biomesoplenty:glowshroom" },
"variant=flat_mushroom": { "model": "biomesoplenty:flat_mushroom" },
"variant=shadow_shroom": { "model": "biomesoplenty:shadow_shroom" }
}
}

View File

@ -41,6 +41,13 @@ tile.log3.hell_bark.name=Hell Bark Wood
tile.log3.jacaranda.name=Jacaranda Wood
tile.log4.mahogany.name=Mahogany Wood
tile.mushroom.toadstool.name=Toadstool
tile.mushroom.portobello.name=Portobello
tile.mushroom.blue_milk_cap.name=Blue Milk Cap
tile.mushroom.glowshroom.name=Glowshroom
tile.mushroom.flat_mushroom.name=Flat Mushroom
tile.mushroom.shadow_shroom.name=Shadow Shroom
tile.planks.sacred_oak.name=Sacred Oak Wood Planks
tile.planks.cherry.name=Cherry Wood Planks
tile.planks.dark.name=Dark Wood Planks

View File

@ -0,0 +1,6 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/blue_milk_cap"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/flat_mushroom"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/glowshroom"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/portobello"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/shadow_shroom"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/toadstool"
}
}

View File

@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/blue_milk_cap"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

View File

@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/flat_mushroom"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

View File

@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/glowshroom"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

View File

@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/portobello"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

View File

@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/shadow_shroom"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

View File

@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/toadstool"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B