From 42a26a1de26eecf30ac0a353f5159c6285cfb373 Mon Sep 17 00:00:00 2001 From: Julian Krings Date: Thu, 19 Jun 2025 19:43:53 +0200 Subject: [PATCH] fix spawning empty particles and improve message for invalid tile states --- build.gradle.kts | 1 + .../main/java/com/volmit/iris/engine/framework/Engine.java | 6 +++--- .../main/java/com/volmit/iris/engine/object/IrisEntity.java | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4697b9574..776f14ee9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -123,6 +123,7 @@ nmsBindings.forEach { key, value -> systemProperty("disable.watchdog", "") systemProperty("net.kyori.ansi.colorLevel", color) systemProperty("com.mojang.eula.agree", true) + systemProperty("iris.suppressReporting", !errorReporting) } } diff --git a/core/src/main/java/com/volmit/iris/engine/framework/Engine.java b/core/src/main/java/com/volmit/iris/engine/framework/Engine.java index aeae15fc9..20b7f31f1 100644 --- a/core/src/main/java/com/volmit/iris/engine/framework/Engine.java +++ b/core/src/main/java/com/volmit/iris/engine/framework/Engine.java @@ -295,9 +295,9 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat var region = Iris.platform.getRegionScheduler(); chunk.raiseFlag(MantleFlag.TILE, run(semaphore, () -> region.run(c.getWorld(), c.getX(), c.getZ(), () -> { mantle.iterateChunk(c.getX(), c.getZ(), TileWrapper.class, (x, y, z, v) -> { - int betterY = y + getWorld().minHeight(); - if (!TileData.setTileState(c.getBlock(x, betterY, z), v.getData())) - Iris.warn("Failed to set tile entity data at [%d %d %d | %s] for tile %s!", x, betterY, z, c.getBlock(x, betterY, z).getBlockData().getMaterial().getKey(), v.getData().getMaterial().name()); + Block block = c.getBlock(x, y + getWorld().minHeight(), z); + if (!TileData.setTileState(block, v.getData())) + Iris.warn("Failed to set tile entity data at [%d %d %d | %s] for tile %s!", block.getX(), block.getY(), block.getZ(), block.getType().getKey(), v.getData().getMaterial().getKey()); }); }))); chunk.raiseFlag(MantleFlag.CUSTOM, run(semaphore, () -> region.run(c.getWorld(), c.getX(), c.getZ(), () -> { diff --git a/core/src/main/java/com/volmit/iris/engine/object/IrisEntity.java b/core/src/main/java/com/volmit/iris/engine/object/IrisEntity.java index d76adabae..d39f1d270 100644 --- a/core/src/main/java/com/volmit/iris/engine/object/IrisEntity.java +++ b/core/src/main/java/com/volmit/iris/engine/object/IrisEntity.java @@ -359,8 +359,8 @@ public class IrisEntity extends IrisRegistrant { t.incrementAndGet(); if (e.getLocation().getBlock().getType().isSolid() || living.getEyeLocation().getBlock().getType().isSolid()) { Iris.platform.teleportAsync(e, at.add(0, 0.1, 0)); - ItemStack itemCrackData = new ItemStack(living.getEyeLocation().clone().subtract(0, 2, 0).getBlock().getBlockData().getMaterial()); - e.getWorld().spawnParticle(ITEM, living.getEyeLocation(), 6, 0.2, 0.4, 0.2, 0.06f, itemCrackData); + Material material = living.getEyeLocation().subtract(0, 2, 0).getBlock().getType(); + if (!material.isAir()) e.getWorld().spawnParticle(ITEM, living.getEyeLocation(), 6, 0.2, 0.4, 0.2, 0.06f, new ItemStack(material)); if (M.r(0.2)) { e.getWorld().playSound(e.getLocation(), Sound.BLOCK_CHORUS_FLOWER_GROW, 0.8f, 0.1f); }