forked from TAIGA/TAIGA
Final adjustments, 2 additional traits, 1 trait rewritten. Liquids + textures included. German and english translation added.
This commit is contained in:
@@ -4,6 +4,7 @@ import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
@@ -27,6 +28,7 @@ public class TraitHollow extends AbstractTrait {
|
||||
int time = (int) player.getEntityWorld().getWorldTime();
|
||||
if (random.nextFloat() <= 0.2 || (random.nextFloat() <= 0.2 && isNight(time))) {
|
||||
((EntityLiving) target).setNoAI(true);
|
||||
target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
||||
if (target.getMaxHealth() < 200) {
|
||||
target.setHealth(target.getMaxHealth() * (1.8f - random.nextFloat() * 0.4f));
|
||||
}
|
||||
@@ -38,7 +40,7 @@ public class TraitHollow extends AbstractTrait {
|
||||
World w = event.getEntity().getEntityWorld();
|
||||
if (event.getSource().getEntity() instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
||||
if (!w.isRemote && random.nextFloat() <= 0.2 && event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||
if (!w.isRemote && random.nextFloat() <= 0.9 && event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||
event.getDrops().clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user