Dust of Revealing Pt.3 💀

This commit is contained in:
Vatuu 2022-05-16 21:55:47 +02:00
parent a63a6f751f
commit 4c48f812d5
No known key found for this signature in database
GPG Key ID: C6F07B79B2ED9150
2 changed files with 5 additions and 5 deletions

View File

@ -36,12 +36,11 @@ public class BlockSignal {
public BlockSignal(Block block, int ticks) { public BlockSignal(Block block, int ticks) {
active.incrementAndGet(); active.incrementAndGet();
Location tg = block.getLocation().clone().add(0.5, 0, 0.5).clone(); Location tg = block.getLocation().clone().add(0.5, 0, 0.5);
FallingBlock e = block.getWorld().spawnFallingBlock(tg.clone(), block.getBlockData()); FallingBlock e = block.getWorld().spawnFallingBlock(tg, block.getBlockData());
e.setGravity(false); e.setGravity(false);
e.setInvulnerable(true); e.setInvulnerable(true);
e.setGlowing(true); e.setGlowing(true);
e.teleport(tg.clone());
e.setDropItem(false); e.setDropItem(false);
e.setHurtEntities(false); e.setHurtEntities(false);
e.setSilent(true); e.setSilent(true);

View File

@ -49,7 +49,7 @@ public class DustRevealer {
this.hits = hits; this.hits = hits;
J.s(() -> { J.s(() -> {
new BlockSignal(world.getBlockAt(block.getX(), block.getY(), block.getZ()), 7); new BlockSignal(world.getBlockAt(block.getX(), block.getY(), block.getZ()), 10);
if(M.r(0.25)) { if(M.r(0.25)) {
world.playSound(block.toBlock(world).getLocation(), Sound.BLOCK_AMETHYST_BLOCK_CHIME, 1f, RNG.r.f(0.2f, 2f)); world.playSound(block.toBlock(world).getLocation(), Sound.BLOCK_AMETHYST_BLOCK_CHIME, 1f, RNG.r.f(0.2f, 2f));
} }
@ -111,7 +111,8 @@ public class DustRevealer {
} }
private boolean is(BlockPosition a) { private boolean is(BlockPosition a) {
if(isValidTry(a) && engine.getObjectPlacementKey(a.getX(), a.getY(), a.getZ()) != null && engine.getObjectPlacementKey(a.getX(), a.getY(), a.getZ()).equals(key)) { int betterY = a.getY() - world.getMinHeight();
if(isValidTry(a) && engine.getObjectPlacementKey(a.getX(), betterY, a.getZ()) != null && engine.getObjectPlacementKey(a.getX(), betterY, a.getZ()).equals(key)) {
hits.add(a); hits.add(a);
new DustRevealer(engine, world, a, key, hits); new DustRevealer(engine, world, a, key, hits);
return true; return true;