From 41f28506e165337583f19e8278cad5ab5ea1263b Mon Sep 17 00:00:00 2001 From: Cheeserolls Date: Sat, 23 May 2015 19:40:16 +0100 Subject: [PATCH] Add cattail --- .../common/block/BlockBOPDoublePlant.java | 13 +++++++++---- .../common/block/BlockDecoration.java | 8 +++++++- .../common/block/BlockDoubleDecoration.java | 4 ++-- .../blockstates/double_plant.json | 4 +++- .../models/block/eyebulb_lower.json | 6 ++++++ .../models/block/eyebulb_upper.json | 6 ++++++ .../biomesoplenty/models/item/eyebulb.json | 18 ++++++++++++++++++ .../textures/blocks/eyebulb_lower.png | Bin 0 -> 630 bytes .../textures/blocks/eyebulb_upper.png | Bin 0 -> 653 bytes 9 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/assets/biomesoplenty/models/block/eyebulb_lower.json create mode 100644 src/main/resources/assets/biomesoplenty/models/block/eyebulb_upper.json create mode 100644 src/main/resources/assets/biomesoplenty/models/item/eyebulb.json create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/eyebulb_lower.png create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/eyebulb_upper.png diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java index f52541dcd..598087514 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java @@ -38,7 +38,7 @@ public class BlockBOPDoublePlant extends BlockDoubleDecoration implements IShear // add properties (note we inherit HALF from BlockDoubleDecoration) public static enum DoublePlantType implements IStringSerializable { - FLAX, TALL_CATTAIL; + FLAX, TALL_CATTAIL, EYEBULB; @Override public String getName() { @@ -156,12 +156,13 @@ public class BlockBOPDoublePlant extends BlockDoubleDecoration implements IShear @Override public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { + boolean isLower = ((Half) worldIn.getBlockState(pos).getValue(HALF) == Half.LOWER); switch ((DoublePlantType) worldIn.getBlockState(pos).getValue(VARIANT)) { default: - this.setBlockBoundsByRadiusAndHeight(0.4F, 0.8F); + this.setBlockBoundsByRadiusAndHeightWithXZOffset(0.4F, isLower ? 1.0F : 0.8F, pos); break; - } + } } @@ -173,6 +174,7 @@ public class BlockBOPDoublePlant extends BlockDoubleDecoration implements IShear Block groundBlock = groundState.getBlock(); boolean onFertile = (groundBlock == Blocks.dirt || groundBlock == BOPBlocks.dirt || groundBlock == Blocks.mycelium || groundBlock == Blocks.grass); boolean onGrass = (groundBlock == Blocks.grass); + boolean onHellish = (groundBlock == Blocks.netherrack || groundBlock == BOPBlocks.flesh); if (groundBlock instanceof BlockBOPGrass) { switch ((BlockBOPGrass.BOPGrassType) groundState.getValue(BlockBOPGrass.VARIANT)) @@ -181,6 +183,7 @@ public class BlockBOPDoublePlant extends BlockDoubleDecoration implements IShear break; case OVERGROWN_NETHERRACK: onFertile = true; + onHellish = true; break; case LOAMY: case SANDY: case SILTY: case ORIGIN: default: onFertile = true; @@ -193,9 +196,11 @@ public class BlockBOPDoublePlant extends BlockDoubleDecoration implements IShear case TALL_CATTAIL: boolean hasWater = (world.getBlockState(lowerPos.add(-1, -1, 0)).getBlock().getMaterial() == Material.water || world.getBlockState(lowerPos.add(1,-1,0)).getBlock().getMaterial() == Material.water || world.getBlockState(lowerPos.add(0,-1,-1)).getBlock().getMaterial() == Material.water || world.getBlockState(lowerPos.add(0,-1,1)).getBlock().getMaterial() == Material.water); return onGrass && hasWater; + case EYEBULB: + return onHellish; case FLAX: default: return onFertile; - } + } } diff --git a/src/main/java/biomesoplenty/common/block/BlockDecoration.java b/src/main/java/biomesoplenty/common/block/BlockDecoration.java index ccca4e234..fde2427c9 100644 --- a/src/main/java/biomesoplenty/common/block/BlockDecoration.java +++ b/src/main/java/biomesoplenty/common/block/BlockDecoration.java @@ -21,6 +21,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; 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; @@ -55,7 +56,6 @@ public class BlockDecoration extends Block implements IBOPBlock this.setTickRandomly(true); this.setHardness(0.0F); this.setStepSound(Block.soundTypeGrass); - this.setBlockBoundsByRadiusAndHeight(0.3F, 0.6F); this.setDefaultState(this.blockState.getBaseState()); } @@ -169,5 +169,11 @@ public class BlockDecoration extends Block implements IBOPBlock return Block.EnumOffsetType.XZ; } + @Override + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { + this.setBlockBoundsByRadiusAndHeightWithXZOffset(0.3F, 0.6F, pos); + } + + } diff --git a/src/main/java/biomesoplenty/common/block/BlockDoubleDecoration.java b/src/main/java/biomesoplenty/common/block/BlockDoubleDecoration.java index 06c86ba55..d51a4b14c 100644 --- a/src/main/java/biomesoplenty/common/block/BlockDoubleDecoration.java +++ b/src/main/java/biomesoplenty/common/block/BlockDoubleDecoration.java @@ -175,10 +175,10 @@ public class BlockDoubleDecoration extends BlockDecoration { switch ((Half) state.getValue(HALF)) { case LOWER: - super.setBlockBoundsByRadiusAndHeight(this.radius, this.fromTop ? this.height : 1.0F, this.fromTop); + this.setBlockBoundsByRadiusAndHeightWithXZOffset(this.radius, this.fromTop ? this.height : 1.0F, this.fromTop, pos); break; case UPPER: - super.setBlockBoundsByRadiusAndHeight(this.radius, this.fromTop ? 1.0F : this.height, this.fromTop); + this.setBlockBoundsByRadiusAndHeightWithXZOffset(this.radius, this.fromTop ? 1.0F : this.height, this.fromTop, pos); break; } } diff --git a/src/main/resources/assets/biomesoplenty/blockstates/double_plant.json b/src/main/resources/assets/biomesoplenty/blockstates/double_plant.json index 055487112..e40170997 100644 --- a/src/main/resources/assets/biomesoplenty/blockstates/double_plant.json +++ b/src/main/resources/assets/biomesoplenty/blockstates/double_plant.json @@ -3,6 +3,8 @@ "half=upper,variant=flax": { "model": "biomesoplenty:flax_upper" }, "half=lower,variant=flax": { "model": "biomesoplenty:flax_lower" }, "half=upper,variant=tall_cattail": { "model": "biomesoplenty:tall_cattail_upper" }, - "half=lower,variant=tall_cattail": { "model": "biomesoplenty:tall_cattail_lower" } + "half=lower,variant=tall_cattail": { "model": "biomesoplenty:tall_cattail_lower" }, + "half=upper,variant=eyebulb": { "model": "biomesoplenty:eyebulb_upper" }, + "half=lower,variant=eyebulb": { "model": "biomesoplenty:eyebulb_lower" } } } \ No newline at end of file diff --git a/src/main/resources/assets/biomesoplenty/models/block/eyebulb_lower.json b/src/main/resources/assets/biomesoplenty/models/block/eyebulb_lower.json new file mode 100644 index 000000000..f821fd6f1 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/eyebulb_lower.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "biomesoplenty:blocks/eyebulb_lower" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/block/eyebulb_upper.json b/src/main/resources/assets/biomesoplenty/models/block/eyebulb_upper.json new file mode 100644 index 000000000..37d098afe --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/eyebulb_upper.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "biomesoplenty:blocks/eyebulb_upper" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/item/eyebulb.json b/src/main/resources/assets/biomesoplenty/models/item/eyebulb.json new file mode 100644 index 000000000..8585d499c --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/eyebulb.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "biomesoplenty:blocks/eyebulb_upper" + }, + "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/eyebulb_lower.png b/src/main/resources/assets/biomesoplenty/textures/blocks/eyebulb_lower.png new file mode 100644 index 0000000000000000000000000000000000000000..c4255b79f9817fc7b25401d71e35754cb7a763c3 GIT binary patch literal 630 zcmV-+0*U>JP)N2bPDNB8 zb~7$DE-^7j^FlWO00HtzL_t(IPi>RQPE=74hVN6bVV;LTNEj1_ChXj(AUMG@kdTf> zLxQa&$`Ia!c?T>&hMoE>o$mBJ{ob#x)wYR?|DJQI{+jCsl}aTjm&<`9!?)Sl@KCVY z)uor+-P#%*)#u4cz3uPU>)u|KN+sjH8yqyAJ!-XDP_0&jhx2nK;&I)dor!lYmkYj3 zO=)dlK!rlVg2BHzI@0#$rhZ;sMNu6;E-wX$0=CD-^ro**o?)?AG$#anytvT!lat8M zJ*U%YJ0W14n3&LVdwVGQ8w74XpRe20J-X6~$Ucpa3(yDGJ13jX+T9vRy`%?uKNi#b zp&{!5(UD=`XpD}nT}VA1c9}bopS85;NmG+vbad$B$cV`u-Ve{l9>1=yb(lz4Q=CZW zU-k6pU}3?=h+`(<**ec2x5vl2J3TeyM&<6@oc8AD&C&DLR_#nr>%;J{@jx<}j57Ei zh;+EPD5kOgXK4WC5d=M1)eTr0#>V1sLijo}W5(R!__@^979NpZ-2toWjiGr&rm-uX zokk`aI<|CcV?*@Kn&`XDnaO0V%c)e#-i(mi(UT1su)Y8pun)6!0r04t{8UVYH}!ia z0NFo=j0pqo)Jgp;Q{y`O9*_+g+e-S38%M~mOfN8|jHk`bp*YgPj~prZ4I5RT-97L_ Q4FCWD07*qoM6N<$g3!Gu@&Et; literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/eyebulb_upper.png b/src/main/resources/assets/biomesoplenty/textures/blocks/eyebulb_upper.png new file mode 100644 index 0000000000000000000000000000000000000000..feb121fe58bcae535f3b102c23180935bc058fd5 GIT binary patch literal 653 zcmV;80&@L{P)<{98gxZibW?9;ba!ELWdKlNX>N2bPDNB8 zb~7$DE-^7j^FlWO00Id~L_t(IPgRpSPgG$PhQA*{0VM28!M+m+A<$T;i70N3h4v(b zWTK7&N;HJv?;un_*b*`gjB#shjQ?ZyedhH(XYyT{;@t17?^&;t)Ihab%~dKDS1OfE zj*gD%)7+fUd!I}u<8ry2`7{LbqTHUEQX-LX@5aXTxVt-0%XIi;vsqUt6kNGnHVOee zksZU%?5ys$whI2&<)t>)*A+iL7WPysWxnZj`aggV+M1jUM7bwDJ@%4~z^^AKCVQfq zu!Vd+@Aj9L4E<4Or#?(iYo)zilwGY>-R8uE_7)daEEYomPxkp6k839q(f6~nK$Lsf z(V=I3eOCU*nHjBiby@#!hKJ4W2MnNP$MNRqNLL33qGXJ_3k!NbKCY*|y$19<7Sr~| zhJKu%s{sJ!HnAQ8$ohGHK3w0o(^JI`4@E*`4`K|xdjROg;9&5`%4Y_=Z%0N9@XPYD z**uU<83rP==gG_s_!)RT#E|{E?J&H7YF-Zw1#DermCyV8Lz!xRUR-E58r7fcYtvi# z7zn)E+-xi4bh(K;O-*4i6+y{l(s2_2830)+g>nJ%^I(lHga3fO(fgr!FwfhE9vKS3 z7@5nf;6K0?85po?;2}RJe^j>r=-QgNcaMBK!@ZW4;HmQv_s