e90c758a01
Add Lophine-specific configuration support (global and carpet configs) and a temporary config transform step during init. Introduce config-controlled command registrations (function, scoreboard, trigger, tick) and enable tick-rate/command tweaks and an entity raytracing tracker flag. Fix datapack command save/listing behavior. Integrate Leaves update-suppression handling broadly: catch and convert update-suppression exceptions across packet handling, ticking, neighbor updates, block state updates and more; add configurable shulker CCE behavior and redstone upward-update compatibility. Provide an option to reintroduce an InstantNeighborUpdater (instant block updater) and other small compatibility/rebrand adjustments.
53 lines
3.9 KiB
Diff
53 lines
3.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
Date: Tue, 18 Nov 2025 23:26:27 +0800
|
|
Subject: [PATCH] Leaves: Do not reset placed block on exception & Do not
|
|
prevent block entity and entity crash at LevelChunk
|
|
|
|
Co-authored by: MC_XiaoHei <xiaohei.xor7@outlook.com>
|
|
As a part of : Leaves (https://github.com/LeavesMC/Leaves)
|
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
|
|
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
|
|
index 07b84bd0144e133d13e8e033a8998f3cf674f746..9c016e7d93e4c44ddf2df520e5c57d92a0e085b3 100644
|
|
--- a/net/minecraft/world/item/BlockItem.java
|
|
+++ b/net/minecraft/world/item/BlockItem.java
|
|
@@ -69,20 +69,8 @@ public class BlockItem extends Item {
|
|
BlockState placedState = level.getBlockState(pos);
|
|
if (placedState.is(placementState.getBlock())) {
|
|
placedState = this.updateBlockStateFromTag(pos, level, itemStack, placedState);
|
|
- // Paper start - Reset placed block on exception
|
|
- try {
|
|
this.updateCustomBlockEntityTag(pos, level, player, itemStack, placedState);
|
|
updateBlockEntityComponents(level, pos, itemStack);
|
|
- } catch (Exception ex) {
|
|
- ((org.bukkit.craftbukkit.block.CraftBlockState) previousState).revertPlace();
|
|
- if (player instanceof ServerPlayer serverPlayer) {
|
|
- net.minecraft.server.MinecraftServer.LOGGER.warn("Player {} tried placing invalid block", player.getScoreboardName(), ex);
|
|
- serverPlayer.connection.disconnect(net.minecraft.network.chat.Component.literal("Packet processing error"));
|
|
- return InteractionResult.FAIL;
|
|
- }
|
|
- throw ex; // Rethrow exception if not placed by a player
|
|
- }
|
|
- // Paper end - Reset placed block on exception
|
|
placedState.getBlock().setPlacedBy(level, pos, placedState, player, itemStack);
|
|
// CraftBukkit start - special case for handling block placement with water lilies, frog spawn and snow buckets
|
|
if (player != null && (this instanceof PlaceOnWaterBlockItem || this instanceof SolidBucketItem)) {
|
|
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
|
index 241c43170b5020c1521f43d349813586ba1f69a5..316b8d45b0902b1bf01a77307e24fc9a47d1283b 100644
|
|
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
|
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
|
@@ -1017,12 +1017,6 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot
|
|
|
|
profiler.pop();
|
|
} catch (Throwable var5) {
|
|
- // Paper start - Prevent block entity and entity crashes
|
|
- final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", io.papermc.paper.util.MCUtil.getLevelName(LevelChunk.this.getLevel()), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
|
|
- net.minecraft.server.MinecraftServer.LOGGER.error(msg, var5);
|
|
- net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, var5))); // Paper - ServerExceptionEvent
|
|
- LevelChunk.this.removeBlockEntity(this.getPos());
|
|
- // Paper end - Prevent block entity and entity crashes
|
|
}
|
|
}
|
|
}
|