initial commit

This commit is contained in:
Sen 2025-03-11 00:23:54 +01:00 committed by Sen
parent 3c9ee26b06
commit 22186c33b9
1458 changed files with 282792 additions and 0 deletions

View 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"));
}
}