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

@@ -20,8 +20,10 @@ public class TraitBlind extends AbstractTrait {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
int time = (int) world.getWorldTime();
if (random.nextFloat() <= 0.05 || (random.nextFloat() <= 0.1 && isNight(time))) {
player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, random.nextInt(400) + 200));
player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, random.nextInt(400) + 200));
if (random.nextBoolean())
player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, random.nextInt(200) + 100));
else
player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, random.nextInt(200) + 100));
}
}
@@ -29,8 +31,10 @@ public class TraitBlind extends AbstractTrait {
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
int time = (int) player.getEntityWorld().getWorldTime();
if (random.nextFloat() <= 0.05 || (random.nextFloat() <= 0.1 && isNight(time))) {
player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, random.nextInt(400) + 200));
player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, random.nextInt(400) + 200));
if (random.nextBoolean())
player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, random.nextInt(400) + 200));
else
player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, random.nextInt(400) + 200));
}
}

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) {

View File

@@ -33,7 +33,7 @@ public class TraitFragile extends AbstractTrait {
sx = x = pos.getX();
sy = y = pos.getY();
sz = z = pos.getZ();
for (int i = random.nextInt(50) + 50; i > 0; i--) {
for (int i = random.nextInt(10) + 9; i > 0; i--) {
int r = random.nextInt(3);
int d = random.nextBoolean() ? 1 : -1;
if (r == 0) x += d;