Fluids corrected, going to Item/Ore creating and changing drop rates

This commit is contained in:
Robert Sosnitzka
2016-05-10 18:31:14 +02:00
parent e21acbd999
commit e06255a440
3 changed files with 51 additions and 19 deletions

View File

@@ -1,11 +1,39 @@
package blocks;
import blocks.category.BasicBlockOreGlow;
import main.ZCompression;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.util.Random;
public class BlockTiberiumOre extends BasicBlockOreGlow {
public BlockTiberiumOre() {
super("tiberium_ore", Material.ROCK, 30.0f, 30.0f, 3, 0.66f);
}
@Override
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) {
Random rand = world instanceof World ? ((World) world).rand : new Random();
int r = RANDOM.nextInt(11);
if (r > 7) {
return MathHelper.getRandomIntegerInRange(rand, 0, 10) + fortune;
} else return 0;
}
@Override
public int quantityDropped(IBlockState state, int fortune, Random random) {
return MathHelper.getRandomIntegerInRange(random, 1, MathHelper.getRandomIntegerInRange(random, 1, 3 + fortune));
}
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return ZCompression;
}
}