mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
28 lines
836 B
Java
28 lines
836 B
Java
package com.hbm.blocks.generic;
|
|
|
|
import api.hbm.item.IDepthRockTool;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.world.World;
|
|
|
|
public class BlockDepth extends Block {
|
|
|
|
public BlockDepth() {
|
|
super(Material.rock);
|
|
this.setBlockUnbreakable();
|
|
this.setResistance(10.0F);
|
|
}
|
|
|
|
@Override
|
|
public float getPlayerRelativeBlockHardness(EntityPlayer player, World world, int x, int y, int z) {
|
|
|
|
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IDepthRockTool) {
|
|
|
|
if(((IDepthRockTool)player.getHeldItem().getItem()).canBreakRock(world, player, player.getHeldItem(), this, x, y, z))
|
|
return (float) (1D / 100D);
|
|
}
|
|
|
|
return super.getPlayerRelativeBlockHardness(player, world, x, y, z);
|
|
}
|
|
} |