Repository navigation
Support Minecraft 1.26.50 (protocol 2193) - #278
Merged
Merged
Conversation
Since 1.26.50, fences, glass panes, bars and tripwire have connection block states, which the server sets rather than the client working them out. Walls already had theirs, but nothing set them. Two traits now set them when the block or one of its neighbors changes, following vanilla's rules: - Fences connect to fences of their kind (wooden or nether brick), to fence gates in line with them and to full block faces. - Glass panes and bars connect to each other, to walls and to full faces. - Tripwire connects to tripwire and tripwire hooks. - Walls connect to walls, glass panes, bars, fence gates in line with them and to full faces. A side is tall when the block above covers it, and the post rises at ends, corners and junctions, or under a wall post, torch, lantern or standing sign.
A torch standing on a block that is not solid broke off at the first neighbor update, though walls, fences, glass panes and bars have posts it can stand on. Walls now update when a torch is placed on them, so the torch broke off straight away.
The interval save was in the part of the world tick that is skipped while the world has no players, so what players did before the last of them left was not written until someone joined again. Leveldb holds writes in memory until they are flushed, so a crash in the meantime lost them. The interval save now runs whether the world has players or not, and a world is also saved as soon as its last player leaves, along with the default world that holds the players' data.
When a player despawned, its view was cleared by sending an empty chunk for every chunk it had loaded, which on a disconnect sent hundreds of chunks to a client that was already gone. A disconnected player's chunks are now released without sending anything, and chunks still being sent to it are stopped.
Every trait added to a block was recorded in the block's level storage, including the traits its type provides, which are added again whenever the block is loaded. That gave blocks like fences and walls storage with nothing else in it, which was saved and sent to players as block actor data when their chunks loaded. Only traits added to the block itself are recorded now, and the type's traits are removed from storage saved before this when it loads. Blocks with nothing else to store are no longer saved or sent.
The command permission level enum holds the levels' names, which the available commands packet writes. UpdateAbilities and AddPlayer write the level as a byte, though, and a name written as a byte is 0, so every player was sent the lowest command permission level. The client then would not let operators place command blocks. Both packets now write the level's index.
Sneaking was set by the start and stop sneaking actions of player input, so a missed one left the server thinking a sneaking player was not sneaking. Blocks then opened their screens for players who were sneaking to place a block on them. Sneaking now follows the sneaking flag, which the client sends with every input while the player sneaks.
Using a command block, structure block, container, door, trapdoor, fence gate or lever with a block in hand used it and also placed the block in front of it. Using a block now takes the place of placing one, and players sneaking with a block in hand place it instead of using the block, as buttons already did for placing. Buttons are also no longer pressed by players sneaking to place a block on them, and iron doors and trapdoors are no longer opened by hand.
Setting a block's permutation with level storage kept the storage on the block, but the chunk dropped it when the block type changed, so it was not saved or sent. Placing a block copied with its data lost the data this way.
Dimension.executeCommand takes the position to execute the command at, for commands not executed by an entity. Relative positions are relative to it, and @p is the player nearest to it.
Command blocks only ran while always active, every tick, and only as impulse command blocks, as nothing powered them and the other modes had no behaviour. Changing the mode also lost the command. - Command blocks are powered by power sources next to them: pressed buttons and pressure plates, levers that are on, redstone blocks and torches, powered redstone dust and observers. Buttons and levers also power the solid block they are attached to. - Impulse command blocks run once each time they become active, after their tick delay. Repeating command blocks run every tick delay while active, on the first tick if set to. Chain command blocks run after the command block pointing into them. - Conditional command blocks only run if the command block behind them succeeded, and the success and output of each command are stored. - Commands run at the command block, and changing the mode or condition keeps the command block's settings.
Selecting a held slot for a player sent the item of the slot it held before, rather than of the slot being selected.
Picking a block always gave a new item, so picking it again kept giving more of it. Now an item the player already has is selected if it is in the hotbar, or swapped into the held slot if it is not. Otherwise, players in creative mode get the item in the held slot if it is empty, or in the first empty hotbar slot, which is selected. With a full hotbar, the held item moves to an empty inventory slot and the picked item takes its place. Picking a block with its data gave the item the metadata of the block state, which kept it from stacking, and the block's live storage. It now gets a copy of the block's data, without its position, and a (+DATA) lore line, as in vanilla. Blocks without data give their plain item.
Blocks placed from items carrying block data shared the item's tags, kept the position of the block the data was picked from, and never sent the data to players, so a command block placed this way showed an empty command. The data is now copied, moved to the new position and sent to players once the block is placed.
Adding an item stack merged it into a single stack of the same item, and reported it added even when only part of it fit, so the rest was lost: picking up 10 dirt with 60 in the inventory kept only 4. A full stack also never topped up a stack that was not full. Item stacks are now merged into every stack of the same item that has room, and the rest placed in empty slots. What does not fit is left in the item stack, and only an item stack added in full is reported added.
The give command counted an item stack merged into a stack in the inventory as nothing given, so it kept adding one more until that stack was full: giving one dirt to a player who had some gave a stack. It also gave the whole amount to the first target only, and reported the amount it had left to give. Items are now given a full stack at a time, counting what was merged, each target gets the amount, and the message reports it.
Every button stayed pressed for 40 ticks. Wooden buttons now stay pressed for 30 ticks, and stone and polished blackstone buttons for 20. The press and release sounds were also the wrong way round.
Every block with a facing direction faced away from the player, and up or down only when the player looked straight up or down. Buttons placed on the side of a block could face up, and on top of a block, sideways. - Buttons, end rods, lightning rods, item frames and heads face away from the face they are placed on. Ladders, wall signs and wall banners do too, on the sides of blocks. - Hoppers point into the block they are placed against, or down. - Pistons, dispensers, droppers, command blocks, barrels and jigsaw blocks face the player, and up or down when the player looks more up or down than to the side. Other blocks only face to the sides. - Stems are left to face the fruit they grow.
Buttons, ladders and other blocks attached to a block stayed where they were when that block was removed. They now break and drop when the block holding them up is gone: - Buttons, item frames, ladders, wall signs and wall banners, held up by the block they face away from. - Levers, held up by the block their direction names. Levers are now given a direction when placed, as they always hung from a ceiling. - Pressure plates, carpets, standing signs and banners, candles, rails, redstone dust, repeaters, comparators and doors, held up by the block below. Breaking the lower half of a door breaks the upper half. - Lanterns, held up by the block above while hanging, or below. Blocks resting on the block below are also no longer placed in the air, and ladders, wall signs and wall banners are only placed on the sides of blocks. Blocks in chunks that are not loaded are assumed to be there.
Placing a block sent players the block in its default state, then again in the state its traits gave it, so a lever placed on the floor showed hanging from a ceiling for a moment, and a button facing down. Canceled placements showed the block before removing it. Dimension.holdBlockUpdates holds the block updates of a position while a callback runs, and sends the block in its final state once it returns. Placing a block holds them until its traits have placed it. Blocks next to it still update as it is placed.
Formats the lines the v2193 changes added as prettier has them, and orders their imports as the rest of the package does.
Every block type was sent to the client as a block definition, though the client knows the vanilla blocks itself. Only custom blocks and the vanilla blocks defined by data, like the wool and concrete stairs, need one, as the client only knows those from the server, and a definition sent for another vanilla block can replace what the client knows of it. Only those are sent now, as Bedrock Dedicated Server does.
The client sends the sounds its player makes, like the block it mines being hit, for the server to play to everyone around, the player too. Nothing handled them, so players mined in silence. They are now broadcast to the dimension, unless they have no name or are further from the player than they could have made them.
Crafting from the recipe book sends a craft recipe auto action, which nothing handled, so the request failed. It now crafts as a craft from the grid does. A recipe whose result is an item type gave the amount crafted squared, as the stack was made with the amount and then multiplied by it.
Players never had the can climb flag, so the client did not let them climb ladders, vines and scaffolding. Climbing down also built up a fall, which hurt players as they reached the ground. Players now have the flag, and do not fall while in a block they climb.
A picked block went into the held slot if it was empty. It now goes into the first empty hotbar slot, from the left, or the held slot when there is none, which is then selected. An item found in the rest of the inventory moves into that slot the same way. Blocks without an item, like fire, are no longer picked.
Some items place a block of another name, which their item data does not name: signs place the standing sign of their wood, seeds and carrots their crops, redstone its wire, and string its tripwire. The block they placed was air, so the server never placed them, and the client kept a block of its own that made no sound and could not be edited. These items now place their blocks, and those blocks, along with signs on a wall and double slabs, resolve to their items again. Blocks that drop their own item without drop data now drop that item, so wall signs drop signs rather than failing, and double slabs drop two slabs. Dark oak signs placed oak signs, as their blocks are named darkoak.
Blocks are placed, used and broken following the game's own rules: - Doors face the way they should, hinge to pair with a door beside them or against a wall, and open and close both halves together. - Fence gates face the player, swing away from them, and sit lower in walls. Trapdoors, pistons, end rods, stairs, slabs and logs take the state vanilla gives them from the face and the player. - Beds place their head beside their foot in the colour of the item. - Slabs placed onto the open half of the same slab make a double slab, and blocks only take the place of blocks like air and short grass. - Hanging signs hang from a ceiling or stick out of a wall, and hang in a line from the side of another. Clicking a sign edits the side the player sees, and sneaking places what they hold against it. - Levers, doors, trapdoors, fence gates and placed blocks make their own sounds, from the middle of the block. - Blocks that lose what holds them up break a tick later, so lines of them break one block per tick, as in vanilla, rather than all at once. Crops are held up by farmland, and two block plants by their lower half. - When the server uses a block rather than placing against it, the client is shown what is really there, so it keeps no block of its own.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings Serenity up to Minecraft Bedrock 1.26.50 (protocol 2193, which also covers 1.26.51 and 1.26.52), and makes placing, using and breaking blocks behave as they do in vanilla.
This builds on the unmerged
r/26-u4branch, so it includes its commits as well.Changelog
Updated
packages/data/tools/generate.mjsto regenerate it from Dragonfly for later versions.Added
Fixed
/givegives the amount asked for, and item stacks are added to containers in full.WorldEvent.