From c9788073d9015231681984c412e9652603ad1533 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Thu, 21 Jan 2016 16:26:30 -0500 Subject: [PATCH] Fixed lily pad and duckweed rendering --- .../common/block/BlockBOPLilypad.java | 43 ++++++++++++++++++ .../textures/items/berrybush.png | Bin 15977 -> 662 bytes 2 files changed, 43 insertions(+) diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java b/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java index a5e90e4b9..40febd48a 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLilypad.java @@ -9,6 +9,8 @@ package biomesoplenty.common.block; import biomesoplenty.api.block.IBOPBlock; +import biomesoplenty.common.block.BlockBOPGrass.BOPGrassType; +import biomesoplenty.common.enums.BOPPlants; import biomesoplenty.common.item.ItemBOPLilypad; import net.minecraft.block.BlockLilyPad; import net.minecraft.block.properties.IProperty; @@ -18,6 +20,12 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemBlock; import net.minecraft.util.BlockPos; import net.minecraft.util.IStringSerializable; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.biome.BiomeColorHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class BlockBOPLilypad extends BlockLilyPad implements IBOPBlock { @@ -90,4 +98,39 @@ public class BlockBOPLilypad extends BlockLilyPad implements IBOPBlock return net.minecraftforge.common.EnumPlantType.Water; } + @Override + @SideOnly(Side.CLIENT) + public int getBlockColor() + { + return 0xFFFFFF; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderColor(IBlockState state) + { + switch ((LilypadType) state.getValue(VARIANT)) + { + case DUCKWEED: + return ColorizerGrass.getGrassColor(0.5D, 1.0D); + + default: + return 0xFFFFFF; + } + } + + @Override + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + switch ((LilypadType) worldIn.getBlockState(pos).getValue(VARIANT)) + { + case DUCKWEED: + return BiomeColorHelper.getGrassColorAtPos(worldIn, pos); + + default: + return 0xFFFFFF; + } + } + } \ No newline at end of file diff --git a/src/main/resources/assets/biomesoplenty/textures/items/berrybush.png b/src/main/resources/assets/biomesoplenty/textures/items/berrybush.png index 3394bb773ac3e6e70eea37e12090a59a81c213ed..ff09dc4b411d27eda1a9d52a190d26791fd62e6a 100644 GIT binary patch delta 598 zcmV-c0;&D!e3k`}B$MSkD}Mk9a7bBm000id000id0mpBsWB>pF7<5HgbW?9;ba!EL zWdLwtX>N2bZe?^JG%heMIczh2P5=M__(?=TR5(w4lUq+yQ4oduCha+=r-f=lnwHW- zOA8#iR1*wfNYsRDxTt_pAq1?(c!dx(;w^-CA0z=E`3d|de#fxC*?+W9(lAN0_ny6G z)>^YqBUfYWe@cdaCgtvat8gCpmXNWdl#KjK$(_BV=900iCWE^+r$Lgn?}INrZ{i}=s^p(K zQZ{=mg6qb0srrnL6fT(q+!YRj)oolyTqn+|}aZ+J7Z0_|HFa8kkUnC7Ohv zECE;=lGj24Cj7F;D@@4DFFVS{;MjAI^rB(sTd7;<-?0*5?0pwk`Rr>Fv2<(rM%@xK zqDiMw%)JKSj#*pC@BpSCL>nxnA4Mg?ySTVyUY2@Wlcr=2wP7lsT;O&aRvN86c}fjR*)4R#?zGL5?@ z$&$R5cSw^?r=8V|boch{`@Xx+?!GO_!CbRr_?N0b;hK+&h=iQbBkaT^{X8P_5=q6!jj7C65&uJ z&LztANnH+{Yt5uym+Yc$Dc4tM33WbCtI*D`Gg@7FHVU}=(wb~5R;>-tVDF0F7H=b)pEUFOO*Mf?<*Y5B#Ok->;OeF z!AD8jNRj!1L?IIsZHU2z5?pa#ra|JiH)BG_EV`Bpj3-@vNTY;#J83 zW+ZE%%m&KjrEHvu;TY2@iU#vCMm@BM0%?my^xH&=F)+Np)L>>=zriX5Yz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