2015-08-29 14:33:25 +02:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("BlockWildPlant.java") is part of the Actually Additions mod for Minecraft.
|
2015-08-29 14:33:25 +02:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2015-08-29 14:33:25 +02:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2017-01-01 16:23:26 +01:00
|
|
|
* © 2015-2017 Ellpeck
|
2015-08-29 14:33:25 +02:00
|
|
|
*/
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.blocks;
|
2015-06-28 03:12:32 +02:00
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBushBase;
|
2016-03-18 23:47:22 +01:00
|
|
|
import net.minecraft.block.SoundType;
|
2015-06-28 03:12:32 +02:00
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
|
2021-08-22 17:09:06 +02:00
|
|
|
import net.minecraft.block.AbstractBlock.Properties;
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public class BlockWildPlant extends BlockBushBase {
|
2015-06-28 03:12:32 +02:00
|
|
|
|
2021-03-01 20:14:50 +01:00
|
|
|
// public static final TheWildPlants[] ALL_WILD_PLANTS = TheWildPlants.values();
|
|
|
|
// public static final PropertyEnum<TheWildPlants> TYPE = PropertyEnum.create("type", TheWildPlants.class);
|
2015-06-28 03:12:32 +02:00
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
public BlockWildPlant() {
|
2021-08-22 17:09:06 +02:00
|
|
|
super(Properties.of(Material.PLANT).sound(SoundType.GRASS).harvestLevel(0).strength(0, 0));
|
2021-03-01 20:14:50 +01:00
|
|
|
// this.setSoundType(SoundType.PLANT);
|
2015-06-28 03:12:32 +02:00
|
|
|
}
|
|
|
|
|
2021-03-01 20:14:50 +01:00
|
|
|
// TODO: [port] ADD BACK
|
|
|
|
// @Override
|
|
|
|
// public boolean canBlockStay(World world, BlockPos pos, BlockState state) {
|
|
|
|
// BlockPos offset = pos.down();
|
|
|
|
// BlockState offsetState = world.getBlockState(offset);
|
|
|
|
// Block offsetBlock = offsetState.getBlock();
|
|
|
|
// return state.getValue(TYPE) == TheWildPlants.RICE
|
|
|
|
// ? offsetState.getMaterial() == Material.WATER
|
|
|
|
// : offsetBlock.canSustainPlant(offsetState, world, offset, Direction.UP, this);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// public ItemStack getPickBlock(BlockState state, RayTraceResult target, World world, BlockPos pos, PlayerEntity player) {
|
|
|
|
// BlockPlant normal = (BlockPlant) state.getValue(TYPE).getNormalVersion();
|
|
|
|
// return new ItemStack(normal.seedItem);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
|
|
|
// for (int j = 0; j < ALL_WILD_PLANTS.length; j++) {
|
|
|
|
// list.add(new ItemStack(this, 1, j));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, BlockState state, int fortune) {
|
|
|
|
// Block normal = state.getValue(TYPE).getNormalVersion();
|
|
|
|
// normal.getDrops(drops, world, pos, normal.getDefaultState().withProperty(BlockCrops.AGE, 7), fortune);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// public boolean canSilkHarvest(World world, BlockPos pos, BlockState state, PlayerEntity player) {
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// protected ItemBlockBase getItemBlock() {
|
|
|
|
// return new TheItemBlock(this);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// public boolean shouldAddCreative() {
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// public void registerRendering() {
|
|
|
|
// for (int i = 0; i < ALL_WILD_PLANTS.length; i++) {
|
|
|
|
// ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), TYPE.getName() + "=" + ALL_WILD_PLANTS[i].getName());
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// public BlockState getStateFromMeta(int meta) {
|
|
|
|
// return this.getDefaultState().withProperty(TYPE, TheWildPlants.values()[meta]);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// public int getMetaFromState(BlockState state) {
|
|
|
|
// return state.getValue(TYPE).ordinal();
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// protected BlockStateContainer createBlockState() {
|
|
|
|
// return new BlockStateContainer(this, TYPE);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// public EnumRarity getRarity(ItemStack stack) {
|
|
|
|
// return stack.getItemDamage() >= ALL_WILD_PLANTS.length
|
|
|
|
// ? EnumRarity.COMMON
|
|
|
|
// : ALL_WILD_PLANTS[stack.getItemDamage()].getRarity();
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// public static class TheItemBlock extends ItemBlockBase {
|
|
|
|
//
|
|
|
|
// public TheItemBlock(Block block) {
|
|
|
|
// super(block);
|
|
|
|
// this.setHasSubtypes(true);
|
|
|
|
// this.setMaxDamage(0);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// @Override
|
|
|
|
// public String getTranslationKey(ItemStack stack) {
|
|
|
|
// return stack.getItemDamage() >= ALL_WILD_PLANTS.length
|
|
|
|
// ? StringUtil.BUGGED_ITEM_NAME
|
|
|
|
// : this.getTranslationKey() + "_" + ALL_WILD_PLANTS[stack.getItemDamage()].getName();
|
|
|
|
// }
|
|
|
|
// }
|
2015-06-28 03:12:32 +02:00
|
|
|
}
|