initial commit
This commit is contained in:
parent
3c9ee26b06
commit
22186c33b9
1458 changed files with 282792 additions and 0 deletions
29
java/src/game/item/ItemDoublePlant.java
Executable file
29
java/src/game/item/ItemDoublePlant.java
Executable file
|
@ -0,0 +1,29 @@
|
|||
package game.item;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import game.block.Block;
|
||||
import game.block.BlockDoublePlant;
|
||||
import game.block.BlockDoublePlant.EnumPlantType;
|
||||
import game.color.Colorizer;
|
||||
import game.renderer.blockmodel.ModelBlock;
|
||||
|
||||
public class ItemDoublePlant extends ItemMultiTexture
|
||||
{
|
||||
public ItemDoublePlant(Block block, Block block2, Function<ItemStack, String> nameFunction)
|
||||
{
|
||||
super(block, block2, true, nameFunction);
|
||||
}
|
||||
|
||||
public int getColorFromItemStack(ItemStack stack, int renderPass)
|
||||
{
|
||||
BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = BlockDoublePlant.EnumPlantType.byMetadata(stack.getMetadata());
|
||||
return blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN ? super.getColorFromItemStack(stack, renderPass) : Colorizer.getGrassColor(0.5D, 1.0D);
|
||||
}
|
||||
|
||||
public ModelBlock getModel(String name, int meta) {
|
||||
return new ModelBlock(this.getTransform(), "blocks/" + (
|
||||
BlockDoublePlant.EnumPlantType.byMetadata(meta) == EnumPlantType.SUNFLOWER ? "sunflower_front" :
|
||||
BlockDoublePlant.EnumPlantType.byMetadata(meta).getName() + "_top"));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue