2016-01-27 00:39:39 +00:00
|
|
|
package WayofTime.bloodmagic.block;
|
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
|
|
|
import WayofTime.bloodmagic.block.base.BlockEnum;
|
|
|
|
import WayofTime.bloodmagic.block.enums.EnumPath;
|
2018-02-15 07:38:57 +00:00
|
|
|
import WayofTime.bloodmagic.incense.IIncensePath;
|
2017-08-16 04:30:48 +00:00
|
|
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
2016-03-18 17:16:38 +00:00
|
|
|
import net.minecraft.block.SoundType;
|
2016-01-27 00:39:39 +00:00
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.block.state.IBlockState;
|
2017-08-15 03:53:42 +00:00
|
|
|
import net.minecraft.client.util.ITooltipFlag;
|
2019-09-05 01:48:54 +00:00
|
|
|
import net.minecraft.entity.Entity;
|
2016-04-17 20:50:23 +00:00
|
|
|
import net.minecraft.item.ItemStack;
|
2016-03-18 17:16:38 +00:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2016-01-27 00:39:39 +00:00
|
|
|
import net.minecraft.world.World;
|
2016-03-18 17:16:38 +00:00
|
|
|
|
2019-09-05 01:48:54 +00:00
|
|
|
import javax.annotation.Nullable;
|
2017-08-16 04:30:48 +00:00
|
|
|
import java.util.List;
|
2016-03-16 22:37:55 +00:00
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
public class BlockPath extends BlockEnum<EnumPath> implements IIncensePath {
|
2016-01-27 00:39:39 +00:00
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
public BlockPath() {
|
2016-10-16 02:02:16 +00:00
|
|
|
super(Material.ROCK, EnumPath.class);
|
2016-01-27 00:39:39 +00:00
|
|
|
|
2019-02-01 03:10:37 +00:00
|
|
|
setTranslationKey(BloodMagic.MODID + ".path.");
|
2017-08-15 03:53:42 +00:00
|
|
|
setCreativeTab(BloodMagic.TAB_BM);
|
2016-01-27 00:39:39 +00:00
|
|
|
setHardness(2.0F);
|
|
|
|
setResistance(5.0F);
|
2016-03-21 19:55:36 +00:00
|
|
|
setSoundType(SoundType.STONE);
|
2016-02-08 08:57:02 +00:00
|
|
|
|
2019-09-05 01:48:54 +00:00
|
|
|
setHarvestLevel("axe", 0, getDefaultState().withProperty(getProperty(), EnumPath.WOOD));
|
|
|
|
setHarvestLevel("axe", 0, getDefaultState().withProperty(getProperty(), EnumPath.WOODTILE));
|
|
|
|
setHarvestLevel("pickaxe", 0, getDefaultState().withProperty(getProperty(), EnumPath.STONE));
|
|
|
|
setHarvestLevel("pickaxe", 0, getDefaultState().withProperty(getProperty(), EnumPath.STONETILE));
|
|
|
|
setHarvestLevel("pickaxe", 0, getDefaultState().withProperty(getProperty(), EnumPath.WORNSTONE));
|
|
|
|
setHarvestLevel("pickaxe", 0, getDefaultState().withProperty(getProperty(), EnumPath.WORNSTONETILE));
|
|
|
|
setHarvestLevel("pickaxe", 3, getDefaultState().withProperty(getProperty(), EnumPath.OBSIDIAN));
|
|
|
|
setHarvestLevel("pickaxe", 3, getDefaultState().withProperty(getProperty(), EnumPath.OBSIDIANTILE));
|
2016-01-27 00:39:39 +00:00
|
|
|
}
|
|
|
|
|
2016-04-17 20:50:23 +00:00
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag tooltipFlag) {
|
2017-01-02 09:18:29 +00:00
|
|
|
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.decoration.safe"));
|
2017-08-15 03:53:42 +00:00
|
|
|
super.addInformation(stack, world, tooltip, tooltipFlag);
|
2016-04-17 20:50:23 +00:00
|
|
|
}
|
|
|
|
|
2019-09-05 01:48:54 +00:00
|
|
|
@Override
|
|
|
|
public Material getMaterial(IBlockState state) {
|
|
|
|
EnumPath path = state.getValue(getProperty());
|
|
|
|
if (path.equals(EnumPath.WOOD) || path.equals(EnumPath.WOODTILE))
|
|
|
|
return Material.WOOD;
|
|
|
|
else
|
|
|
|
return Material.ROCK;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public SoundType getSoundType(IBlockState state, World world, BlockPos pos, @Nullable Entity entity) {
|
|
|
|
EnumPath path = state.getValue(getProperty());
|
|
|
|
if (path.equals(EnumPath.WOOD) || path.equals(EnumPath.WOODTILE))
|
|
|
|
return SoundType.WOOD;
|
|
|
|
else
|
|
|
|
return super.getSoundType();
|
|
|
|
}
|
|
|
|
|
2016-01-27 00:39:39 +00:00
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public int getLevelOfPath(World world, BlockPos pos, IBlockState state) {
|
|
|
|
switch (this.getMetaFromState(state)) {
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
return 2;
|
|
|
|
case 2:
|
|
|
|
case 3:
|
|
|
|
return 4;
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
return 6;
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
return 8;
|
|
|
|
default:
|
|
|
|
return 0;
|
2016-01-27 00:39:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|