forked from TAIGA/TAIGA
New Traits + Balancing.
Cascade: Random breaking of blocks around initial block. Fracture: Random breaking of max. 9 blocks in direction. Dark: Heals tool, but gives weak- and darkness. Glimmer: Gives a chance of night vision effect. Analysing: ++More EXP, less drops!
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
package com.sosnitzka.ztic_addon.traits;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.MobEffects;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -29,9 +32,22 @@ public class TraitGlimmer extends AbstractTrait {
|
||||
EntityPlayer e = (EntityPlayer) entity;
|
||||
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(e.getHeldItemMainhand()), identifier)) {
|
||||
e.addPotionEffect(new PotionEffect(MobEffects.GLOWING, 100));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||
if (random.nextFloat() <= 0.02) {
|
||||
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 300));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
|
||||
if (random.nextFloat() <= 0.05) {
|
||||
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 300));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user