Adjusted tiberium ore, removed vanilla smelting recipes, adjusted three traits (one left), description for materials added

This commit is contained in:
Robert Sosnitzka
2016-07-20 01:41:39 +02:00
parent 74e3baa05c
commit db49a2c74e
7 changed files with 84 additions and 14 deletions

View File

@@ -1,5 +1,7 @@
package com.sosnitzka.taiga.traits;
import com.sosnitzka.taiga.util.TickTask;
import com.sosnitzka.taiga.util.TickTaskHandler;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
@@ -19,14 +21,17 @@ public class TraitCascade extends AbstractTrait {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
float f = random.nextFloat();
float b = 0.99F * calcBonus(tool);
if (!world.isRemote && tool.canHarvestBlock(state) && f <= b) {
double x, y, z, sx, sy, sz;
sx = x = pos.getX();
sy = y = pos.getY();
sz = z = pos.getZ();
for (int i = random.nextInt(ToolHelper.getCurrentDurability(tool)); i > 0; i--) {
for (int i = random.nextInt((int) (ToolHelper.getCurrentDurability(tool) * 1.5f)); i > 0; i--) {
TickTaskHandler.getInstance().addTask(new TickTask(20, new Runnable() {
@Override
public void run() {
}
}));
int r = random.nextInt(3);
int d = random.nextBoolean() ? 1 : -1;
if (r == 0) x += d;
@@ -44,8 +49,11 @@ public class TraitCascade extends AbstractTrait {
y = sy;
z = sz;
}
}
}
}
private float calcBonus(ItemStack tool) {