some minor fixes

This commit is contained in:
2016-07-27 12:01:23 +02:00
parent faa70ed224
commit ccf8c75b37
4 changed files with 5 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Random;
import static com.sosnitzka.taiga.Items.lignite;
@@ -29,6 +30,7 @@ public class BlockLignite extends BasicBlock {
}
@Override
@ParametersAreNonnullByDefault
public int quantityDropped(IBlockState state, int fortune, Random random) {
return MathHelper.getRandomIntegerInRange(random, 1, 3 + fortune);
}

View File

@@ -11,6 +11,7 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Random;
import static com.sosnitzka.taiga.util.Utils.PREFIX_ORE;
@@ -25,13 +26,13 @@ public class BlockTiberium extends BasicBlock {
@Override
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) {
Random rand = world instanceof World ? ((World) world).rand : new Random();
if (random.nextBoolean()) {
return random.nextInt(10) + fortune;
} else return 0;
}
@Override
@ParametersAreNonnullByDefault
public int quantityDropped(IBlockState state, int fortune, Random random) {
return (random.nextInt(3 + fortune) + 1);
}

View File

@@ -40,7 +40,6 @@ public class TraitFragile extends AbstractTrait {
if (r == 1) y += d;
if (r == 2) z += d;
BlockPos nextBlock = new BlockPos(x, y, z);
int tn = (int) world.getWorldTime() + 5;
if (world.getBlockState(nextBlock) == world.getBlockState(pos)) {
Block block = Blocks.STONE;
int ib = random.nextInt(3);

View File

@@ -57,6 +57,7 @@ public class TraitGarishly extends AbstractTrait {
break;
}
assert i != null;
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, i));
}
}