This commit is contained in:
cyberpwn 2021-08-29 12:43:02 -04:00
parent abc07968e5
commit 49154759c0

View File

@ -342,38 +342,41 @@ public class IrisEntity extends IrisRegistrant {
} }
} }
if (Chunks.hasPlayersNearby(at) && isSpawnEffectRiseOutOfGround() && e instanceof LivingEntity) { Location finalAt1 = at;
Location start = at.clone(); J.s(() -> {
e.setInvulnerable(true); if (isSpawnEffectRiseOutOfGround() && e instanceof LivingEntity && Chunks.hasPlayersNearby(finalAt1)) {
((LivingEntity) e).setAI(false); Location start = finalAt1.clone();
((LivingEntity) e).setCollidable(false); e.setInvulnerable(true);
((LivingEntity) e).setNoDamageTicks(100000); ((LivingEntity) e).setAI(false);
AtomicInteger t = new AtomicInteger(0); ((LivingEntity) e).setCollidable(false);
AtomicInteger v = new AtomicInteger(0); ((LivingEntity) e).setNoDamageTicks(100000);
v.set(J.sr(() -> { AtomicInteger t = new AtomicInteger(0);
if(t.get() > 100) AtomicInteger v = new AtomicInteger(0);
{ v.set(J.sr(() -> {
J.csr(v.get()); if(t.get() > 100)
return; {
} J.csr(v.get());
return;
t.incrementAndGet();
if (e.getLocation().getBlock().getType().isSolid() || ((LivingEntity) e).getEyeLocation().getBlock().getType().isSolid()) {
e.teleport(start.add(new Vector(0, 0.1, 0)));
ItemStack itemCrackData = new ItemStack(((LivingEntity) e).getEyeLocation().clone().subtract(0, 2, 0).getBlock().getBlockData().getMaterial());
e.getWorld().spawnParticle(Particle.ITEM_CRACK, ((LivingEntity) e).getEyeLocation(), 6, 0.2, 0.4, 0.2, 0.06f, itemCrackData);
if (M.r(0.2)) {
e.getWorld().playSound(e.getLocation(), Sound.BLOCK_CHORUS_FLOWER_GROW, 0.8f, 0.1f);
} }
} else {
J.csr(v.get()); t.incrementAndGet();
((LivingEntity) e).setNoDamageTicks(0); if (e.getLocation().getBlock().getType().isSolid() || ((LivingEntity) e).getEyeLocation().getBlock().getType().isSolid()) {
((LivingEntity) e).setCollidable(true); e.teleport(start.add(new Vector(0, 0.1, 0)));
((LivingEntity) e).setAI(true); ItemStack itemCrackData = new ItemStack(((LivingEntity) e).getEyeLocation().clone().subtract(0, 2, 0).getBlock().getBlockData().getMaterial());
e.setInvulnerable(false); e.getWorld().spawnParticle(Particle.ITEM_CRACK, ((LivingEntity) e).getEyeLocation(), 6, 0.2, 0.4, 0.2, 0.06f, itemCrackData);
} if (M.r(0.2)) {
}, 0)); e.getWorld().playSound(e.getLocation(), Sound.BLOCK_CHORUS_FLOWER_GROW, 0.8f, 0.1f);
} }
} else {
J.csr(v.get());
((LivingEntity) e).setNoDamageTicks(0);
((LivingEntity) e).setCollidable(true);
((LivingEntity) e).setAI(true);
e.setInvulnerable(false);
}
}, 0));
}
});
return e; return e;
} }