123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package me.km.fluids;
- import net.minecraft.block.Block;
- import static net.minecraft.block.BlockColored.COLOR;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.MobEffects;
- import net.minecraft.item.EnumDyeColor;
- import net.minecraft.potion.PotionEffect;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- import net.minecraftforge.fluids.Fluid;
- public class BlockFluidHoney extends BlockFluidBase
- {
- public BlockFluidHoney(Fluid fluid, Material material)
- {
- super(fluid, material);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
- {
- super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn);
- if(entityIn instanceof EntityLivingBase)
- {
- ((EntityLivingBase) entityIn).addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 100, 1));
- }
- }
- @Override
- protected IBlockState getStrongMixingBlock(Block b, Material m)
- {
- if(m == Material.LAVA)
- {
- return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.BROWN);
- }
- return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.YELLOW);
- }
- @Override
- protected IBlockState getWeakMixingBlock(Block b, Material m)
- {
- if(m == Material.LAVA)
- {
- return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.BROWN);
- }
- return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.YELLOW);
- }
-
- @Override
- protected IBlockState getFlownOnMixingBlock(Block b, Material m)
- {
- if(m == Material.LAVA)
- {
- return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.BROWN);
- }
- return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(COLOR, EnumDyeColor.YELLOW);
- }
- }
|