mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
52 lines
1.2 KiB
Java
52 lines
1.2 KiB
Java
package com.hbm.blocks.generic;
|
|
|
|
import com.hbm.blocks.ModBlocks;
|
|
import com.hbm.items.ModItems;
|
|
|
|
import api.hbm.block.IDrillInteraction;
|
|
import api.hbm.block.IMiningDrill;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.world.World;
|
|
|
|
public class BlockBedrockOre extends Block implements IDrillInteraction {
|
|
|
|
public BlockBedrockOre() {
|
|
super(Material.rock);
|
|
}
|
|
|
|
@Override
|
|
public boolean canBreak(World world, int x, int y, int z, int meta, IMiningDrill drill) {
|
|
return drill.getDrillRating() > 70;
|
|
}
|
|
|
|
@Override
|
|
public ItemStack extractResource(World world, int x, int y, int z, int meta, IMiningDrill drill) {
|
|
|
|
if(drill.getDrillRating() > 70)
|
|
return null;
|
|
|
|
Item drop = this.getDrop();
|
|
|
|
if(drop == null)
|
|
return null;
|
|
|
|
return world.rand.nextInt(50) == 0 ? new ItemStack(drop) : null;
|
|
}
|
|
|
|
@Override
|
|
public float getRelativeHardness(World world, int x, int y, int z, int meta, IMiningDrill drill) {
|
|
return 30;
|
|
}
|
|
|
|
private Item getDrop() {
|
|
|
|
if(this == ModBlocks.ore_bedrock_coltan)
|
|
return ModItems.fragment_coltan;
|
|
|
|
return null;
|
|
}
|
|
}
|