|
9 | 9 | buffer.writeVarInt(0);
|
10 | 10 | } else {
|
11 | 11 | - buffer.writeVarInt(value.getCount());
|
12 |
| -+ buffer.writeVarInt(io.papermc.paper.util.ItemComponentSanitizer.sanitizeCount(io.papermc.paper.util.ItemObfuscationSession.currentSession(), value, value.getCount())); // Paper - potentially sanitize count |
| 12 | ++ buffer.writeVarInt(io.papermc.paper.util.sanitizer.ItemComponentSanitizer.sanitizeCount(io.papermc.paper.util.sanitizer.ItemObfuscationSession.currentSession(), value, value.getCount())); // Paper - potentially sanitize count |
13 | 13 | Item.STREAM_CODEC.encode(buffer, value.getItemHolder());
|
14 | 14 | + // Paper start - adventure; conditionally render translatable components
|
15 | 15 | + boolean prev = net.minecraft.network.chat.ComponentSerialization.DONT_RENDER_TRANSLATABLES.get();
|
16 |
| -+ try (final io.papermc.paper.util.SafeAutoClosable ignored = io.papermc.paper.util.ItemObfuscationSession.withContext(c -> c.itemStack(value))) { // pass the itemstack as context to the obfuscation session |
| 16 | ++ try (final io.papermc.paper.util.SafeAutoClosable ignored = io.papermc.paper.util.sanitizer.ItemObfuscationSession.withContext(c -> c.itemStack(value))) { // pass the itemstack as context to the obfuscation session |
17 | 17 | + net.minecraft.network.chat.ComponentSerialization.DONT_RENDER_TRANSLATABLES.set(true);
|
18 | 18 | streamCodec.encode(buffer, value.components.asPatch());
|
19 | 19 | + } finally {
|
|
125 | 125 | + }
|
126 | 126 | +
|
127 | 127 | + for (org.bukkit.block.BlockState blockstate : blocks) {
|
128 |
| -+ int updateFlag = ((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).getFlag(); |
| 128 | ++ int updateFlags = ((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).getFlags(); |
129 | 129 | + net.minecraft.world.level.block.state.BlockState oldBlock = ((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).getHandle();
|
130 | 130 | + BlockPos newPos = ((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).getPosition();
|
131 | 131 | + net.minecraft.world.level.block.state.BlockState block = serverLevel.getBlockState(newPos);
|
|
134 | 134 | + block.onPlace(serverLevel, newPos, oldBlock, true, context);
|
135 | 135 | + }
|
136 | 136 | +
|
137 |
| -+ serverLevel.notifyAndUpdatePhysics(newPos, null, oldBlock, block, serverLevel.getBlockState(newPos), updateFlag, net.minecraft.world.level.block.Block.UPDATE_LIMIT); // send null chunk as chunk.k() returns false by this point |
| 137 | ++ serverLevel.notifyAndUpdatePhysics(newPos, null, oldBlock, block, serverLevel.getBlockState(newPos), updateFlags, net.minecraft.world.level.block.Block.UPDATE_LIMIT); // send null chunk as chunk.k() returns false by this point |
138 | 138 | + }
|
139 | 139 | +
|
140 | 140 | + if (this.item == Items.WITHER_SKELETON_SKULL) { // Special case skulls to allow wither spawns to be cancelled
|
|
0 commit comments