diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/user/BukkitServerPlayer.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/user/BukkitServerPlayer.java index c52b0397e..7137b22a5 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/user/BukkitServerPlayer.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/user/BukkitServerPlayer.java @@ -770,6 +770,7 @@ public class BukkitServerPlayer extends Player { // can break now if (this.miningProgress >= 1f) { + boolean breakResult = false; // for simplified adventure break, switch mayBuild temporarily if (isAdventureMode() && Config.simplifyAdventureBreakCheck()) { // check the appearance state @@ -777,20 +778,24 @@ public class BukkitServerPlayer extends Player { // Error might occur so we use try here try { FastNMS.INSTANCE.field$Player$mayBuild(serverPlayer, true); - CoreReflections.method$ServerPlayerGameMode$destroyBlock.invoke(gameMode, blockPos); + breakResult = (boolean) CoreReflections.method$ServerPlayerGameMode$destroyBlock.invoke(gameMode, blockPos); } finally { FastNMS.INSTANCE.field$Player$mayBuild(serverPlayer, false); } } } else { // normal break check - CoreReflections.method$ServerPlayerGameMode$destroyBlock.invoke(gameMode, blockPos); + breakResult = (boolean) CoreReflections.method$ServerPlayerGameMode$destroyBlock.invoke(gameMode, blockPos); } // send break particle + (removed sounds) - sendPacket(FastNMS.INSTANCE.constructor$ClientboundLevelEventPacket(WorldEvents.BLOCK_BREAK_EFFECT, blockPos, customState.customBlockState().registryId(), false), false); - this.lastSuccessfulBreak = currentTick; - this.destroyPos = null; - this.setIsDestroyingBlock(false, false); + if (breakResult) { + sendPacket(FastNMS.INSTANCE.constructor$ClientboundLevelEventPacket(WorldEvents.BLOCK_BREAK_EFFECT, blockPos, customState.customBlockState().registryId(), false), false); + this.lastSuccessfulBreak = currentTick; + this.destroyPos = null; + this.setIsDestroyingBlock(false, false); + } else { + this.setIsDestroyingBlock(true, true); + } } } } diff --git a/common-files/src/main/resources/config.yml b/common-files/src/main/resources/config.yml index 7a0fdfab9..27abf21ff 100644 --- a/common-files/src/main/resources/config.yml +++ b/common-files/src/main/resources/config.yml @@ -96,7 +96,8 @@ resource-pack: # .png texture: enable: true - exclude: [] + exclude: + - pack.png # .json / .mcmeta json: enable: true diff --git a/core/src/main/java/net/momirealms/craftengine/core/pack/AbstractPackManager.java b/core/src/main/java/net/momirealms/craftengine/core/pack/AbstractPackManager.java index 9fe0693b2..a0f6da658 100644 --- a/core/src/main/java/net/momirealms/craftengine/core/pack/AbstractPackManager.java +++ b/core/src/main/java/net/momirealms/craftengine/core/pack/AbstractPackManager.java @@ -965,7 +965,7 @@ public abstract class AbstractPackManager implements PackManager { } } - { + if (Config.optimizeJson()) { this.plugin.logger().info("> Optimizing json files..."); AtomicLong previousBytes = new AtomicLong(0L); AtomicLong afterBytes = new AtomicLong(0L); @@ -1036,7 +1036,7 @@ public abstract class AbstractPackManager implements PackManager { this.plugin.logger().info("□ Before/After/Ratio: " + formatSize(originalSize) + "/" + formatSize(optimizedSize) + "/" + String.format("%.2f%%", compressionRatio)); } - { + if (Config.optimizeTexture()) { this.plugin.logger().info("> Optimizing textures..."); AtomicLong previousBytes = new AtomicLong(0L); AtomicLong afterBytes = new AtomicLong(0L);