From 9d341a9921ca545e77142fddfedeef6f21d5cdfa Mon Sep 17 00:00:00 2001 From: Adubbz Date: Tue, 14 Oct 2014 19:10:06 +1100 Subject: [PATCH] Readded the mushrooms --- .../biomesoplenty/api/block/BOPBlocks.java | 1 + .../common/block/BlockBOPMushroom.java | 106 ++++++++++++++++++ .../biomesoplenty/common/init/ModBlocks.java | 2 + .../biomesoplenty/blockstates/mushroom.json | 10 ++ .../assets/biomesoplenty/lang/en_US.lang | 7 ++ .../models/block/blue_milk_cap.json | 6 + .../models/block/flat_mushroom.json | 6 + .../models/block/glowshroom.json | 6 + .../models/block/portobello.json | 6 + .../models/block/shadow_shroom.json | 6 + .../biomesoplenty/models/block/toadstool.json | 6 + .../models/item/blue_milk_cap.json | 18 +++ .../models/item/flat_mushroom.json | 18 +++ .../biomesoplenty/models/item/glowshroom.json | 18 +++ .../biomesoplenty/models/item/portobello.json | 18 +++ .../models/item/shadow_shroom.json | 18 +++ .../biomesoplenty/models/item/toadstool.json | 18 +++ .../textures/blocks/blue_milk_cap.png | Bin 0 -> 274 bytes .../textures/blocks/flat_mushroom.png | Bin 0 -> 240 bytes .../textures/blocks/glowshroom.png | Bin 0 -> 272 bytes .../textures/blocks/portobello.png | Bin 0 -> 267 bytes .../textures/blocks/shadow_shroom.png | Bin 0 -> 309 bytes .../textures/blocks/toadstool.png | Bin 0 -> 291 bytes 23 files changed, 270 insertions(+) create mode 100644 src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java create mode 100755 src/main/resources/assets/biomesoplenty/blockstates/mushroom.json create mode 100644 src/main/resources/assets/biomesoplenty/models/block/blue_milk_cap.json create mode 100644 src/main/resources/assets/biomesoplenty/models/block/flat_mushroom.json create mode 100644 src/main/resources/assets/biomesoplenty/models/block/glowshroom.json create mode 100644 src/main/resources/assets/biomesoplenty/models/block/portobello.json create mode 100644 src/main/resources/assets/biomesoplenty/models/block/shadow_shroom.json create mode 100644 src/main/resources/assets/biomesoplenty/models/block/toadstool.json create mode 100644 src/main/resources/assets/biomesoplenty/models/item/blue_milk_cap.json create mode 100644 src/main/resources/assets/biomesoplenty/models/item/flat_mushroom.json create mode 100644 src/main/resources/assets/biomesoplenty/models/item/glowshroom.json create mode 100644 src/main/resources/assets/biomesoplenty/models/item/portobello.json create mode 100644 src/main/resources/assets/biomesoplenty/models/item/shadow_shroom.json create mode 100644 src/main/resources/assets/biomesoplenty/models/item/toadstool.json create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/blue_milk_cap.png create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/flat_mushroom.png create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/glowshroom.png create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/portobello.png create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/shadow_shroom.png create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/toadstool.png diff --git a/src/main/java/biomesoplenty/api/block/BOPBlocks.java b/src/main/java/biomesoplenty/api/block/BOPBlocks.java index f8c9268bb..794c57f29 100644 --- a/src/main/java/biomesoplenty/api/block/BOPBlocks.java +++ b/src/main/java/biomesoplenty/api/block/BOPBlocks.java @@ -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; } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java b/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java new file mode 100644 index 000000000..fd7735bf4 --- /dev/null +++ b/src/main/java/biomesoplenty/common/block/BlockBOPMushroom.java @@ -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(); + } + } +} diff --git a/src/main/java/biomesoplenty/common/init/ModBlocks.java b/src/main/java/biomesoplenty/common/init/ModBlocks.java index bf1c6b6a4..0506125d8 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/common/init/ModBlocks.java @@ -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"); } diff --git a/src/main/resources/assets/biomesoplenty/blockstates/mushroom.json b/src/main/resources/assets/biomesoplenty/blockstates/mushroom.json new file mode 100755 index 000000000..98706a337 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/blockstates/mushroom.json @@ -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" } + } +} diff --git a/src/main/resources/assets/biomesoplenty/lang/en_US.lang b/src/main/resources/assets/biomesoplenty/lang/en_US.lang index f81613a87..7ea99a0f9 100644 --- a/src/main/resources/assets/biomesoplenty/lang/en_US.lang +++ b/src/main/resources/assets/biomesoplenty/lang/en_US.lang @@ -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 diff --git a/src/main/resources/assets/biomesoplenty/models/block/blue_milk_cap.json b/src/main/resources/assets/biomesoplenty/models/block/blue_milk_cap.json new file mode 100644 index 000000000..b8681d17e --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/blue_milk_cap.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "biomesoplenty:blocks/blue_milk_cap" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/block/flat_mushroom.json b/src/main/resources/assets/biomesoplenty/models/block/flat_mushroom.json new file mode 100644 index 000000000..7dca28c0b --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/flat_mushroom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "biomesoplenty:blocks/flat_mushroom" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/block/glowshroom.json b/src/main/resources/assets/biomesoplenty/models/block/glowshroom.json new file mode 100644 index 000000000..76a42f404 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/glowshroom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "biomesoplenty:blocks/glowshroom" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/block/portobello.json b/src/main/resources/assets/biomesoplenty/models/block/portobello.json new file mode 100644 index 000000000..244243401 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/portobello.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "biomesoplenty:blocks/portobello" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/block/shadow_shroom.json b/src/main/resources/assets/biomesoplenty/models/block/shadow_shroom.json new file mode 100644 index 000000000..cf20dd3d9 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/shadow_shroom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "biomesoplenty:blocks/shadow_shroom" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/block/toadstool.json b/src/main/resources/assets/biomesoplenty/models/block/toadstool.json new file mode 100644 index 000000000..e404807ca --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/toadstool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "biomesoplenty:blocks/toadstool" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/item/blue_milk_cap.json b/src/main/resources/assets/biomesoplenty/models/item/blue_milk_cap.json new file mode 100644 index 000000000..3b8e725e3 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/blue_milk_cap.json @@ -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 ] + } + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/item/flat_mushroom.json b/src/main/resources/assets/biomesoplenty/models/item/flat_mushroom.json new file mode 100644 index 000000000..0d980648e --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/flat_mushroom.json @@ -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 ] + } + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/item/glowshroom.json b/src/main/resources/assets/biomesoplenty/models/item/glowshroom.json new file mode 100644 index 000000000..221df8aed --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/glowshroom.json @@ -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 ] + } + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/item/portobello.json b/src/main/resources/assets/biomesoplenty/models/item/portobello.json new file mode 100644 index 000000000..2b7ea2de7 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/portobello.json @@ -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 ] + } + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/item/shadow_shroom.json b/src/main/resources/assets/biomesoplenty/models/item/shadow_shroom.json new file mode 100644 index 000000000..8988c3018 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/shadow_shroom.json @@ -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 ] + } + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/item/toadstool.json b/src/main/resources/assets/biomesoplenty/models/item/toadstool.json new file mode 100644 index 000000000..a67886a50 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/toadstool.json @@ -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 ] + } + } +} diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/blue_milk_cap.png b/src/main/resources/assets/biomesoplenty/textures/blocks/blue_milk_cap.png new file mode 100644 index 0000000000000000000000000000000000000000..1e4a69628cb9535c957ac28817d32fb64e60b727 GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DjSK$uZf!>a)(C{^MbQ4*Y=R#Ki=l*$m0n3-3i=jR%tP-d)Ws%L0m@TF)WP*tC& zi(`m|e{x2VdBTtX|Lt#9Txoci?{IEWcf`?&hHZ@30#y@aF8yU}`5&#mzNx#>U{jR9 zv2+FxW0uLu3_hFZ#Y^8{m>}b!YsDsP!IQv{$(FRi;)JV#se!EoTf+?lUWHu?t)ABh zZ&18rt-zf4D#4_UQ9)`+BO`|c+kqzuvm9qEU{vUR!KScTkWIpXfuZJ6L;Sk~#rZ&& OF?hQAxvX!lvI6;>1s;*b z3=Dh+L6~vJ#O${~L8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3Q$0gN_s>q|Kvg-O zE{-7<{>c)ohxzu@{+_0AjJxdpy_bt f#2FhH|4TAB1RQ@P*}roy&|U^lS3j3^P6!lvI6;>1s;*b z3=DjSK$uZf!>a)(C{^MbQ4*Y=R#Ki=l*$m0n3-3i=jR%tP-d)Ws%L0m@TF)WP*sno zi(`m|f3gH?v!KfVPe1y579Kjnn9{2!-Fsk*>vpz}Z3@{e7ZrRaF&gl`FbSDuz>wK+ z(XMn>!r2r_hD%dSPCnf4-pSX-sPNu#<_w0&!kXo;>#zGT^PE+w)LwS+_5R>FhB1Y& zbg~cKYpP^sS)}#%|Lyh}%|8{y8~3mz370UQP!s6QVc6s?(9p=p@L9j4_MYjo>p*ug Nc)I$ztaD0e0s!J#UCsai literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/portobello.png b/src/main/resources/assets/biomesoplenty/textures/blocks/portobello.png new file mode 100644 index 0000000000000000000000000000000000000000..85f8800f904ab230275b9517ec3625b9d8524220 GIT binary patch literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0figD*u3fvT!JT^vI!{F5h4pT3+USyY7;7jEVZ4Go=S@Rs+-|Nr)fPrE<=r<^=N z!e`zBMgw1Q|MzW=ZEuJFYd`telwo?Bgjxne0JDU0HdEpZi!kPbhn}{)|GPg2|4*LW joVcdRz~=@-B^$%Hg6)R7wT(xCu3+$V^>bP0l+XkKg~?LW literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/shadow_shroom.png b/src/main/resources/assets/biomesoplenty/textures/blocks/shadow_shroom.png new file mode 100644 index 0000000000000000000000000000000000000000..3ac9b213caba52cf5056a16608bc36349887d440 GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=Dh+L6~vJ#O${~L8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3Q$0gN_s>q|Kvf$( zT^vI!{I5_k#v9Y#TDdeE+!j2?v_V!e zx9#`ckHQzkj^5VdUHSO+lBM^rm~L%fT_h}X-1FDc!qD7=84PFY6z=pVzH1M#_%Mmd z=j>be6Iu-HTRuj!%n-=ks4&Oardn9rM^oYCPR^e!r?vV_cXk0C&*16m=d#Wzp$PzU C0eNfy literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/toadstool.png b/src/main/resources/assets/biomesoplenty/textures/blocks/toadstool.png new file mode 100644 index 0000000000000000000000000000000000000000..d35f2d13158baf5dc6d6e9b6aca1455f6a976193 GIT binary patch literal 291 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0figD*u3fvP5Xx;Tbd_%99E$lGAR^H{}Aj7?2N%#CeFgSNo&0vZ1nwXBK4sh-&< zh01bQZ&6;Pwkxe=o#eu7w->Vnfy^k0J=fjN=&;V1-Y3MMXZKrU&+~uwNA{FVVVF{M znL(U;^V(0B0uMc~35#0hD4P&xE5@>(}jKw3{LOpzw^hdnb$DN%tn% egx*S}S9S*;TAWmh(oqDuj=|H_&t;ucLK6U8!D2=L literal 0 HcmV?d00001