-
-
Notifications
You must be signed in to change notification settings - Fork 109
Fake block packet handling: cleanup, update, fixes #2759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tal5
wants to merge
24
commits into
DenizenScript:dev
Choose a base branch
from
tal5:fake_blocks_rewriting_fixes
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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.
Fixes several
showfake
-related issues on Discord (1, 2, 3, 4).Changes
PacketHandler
s now throwThrowable
instead ofException
(forMethodHandle
s).FakeBlockHelper
's reflection (MethodHandle
s, direct field name instead of first type in a few places, etc.).FakeBlockHelper
now has aMap<Material, BlockEntityType<?>> MATERIAL_BLOCK_ENTITY_TYPES
, for faking block entities.FakeBlockHelper#copyPacketPaperPatch
.handleMapChunkPacket
now takes in theFakeBlock.FakeBlockMap
, for some faster lookups.handleMapChunkPacket
nowthrows
instead of having everything in atry
.handleMapChunkPacket
, like copying the chunk packet data and block entities list separately - the entire packet is being copied, so the chunk data and block entities within it are already copied.handleMapChunkPacket
now just removes all block entities that are on the same block as a fake block, to be replaced later.handleMapChunkPacket
now keeps track of light data as well, and modifies it for relevant blocks to match surrounding light levels.PALETTEDCONTAINER_CTOR
reflection, as the remapping issue seems to be fixed now.FakeBlockHelper#getEstimatedLightLevel
to estimate a fake block's light level and apply it to the packet's light data.FakeBlocksPacketHandlers
, and cleaned them up a little.processSectionBlocksUpdatePacket
- instead of copying the entire packet, then copying the content arrays, it now copies just the block states array, modifies it, and constructors a new section blocks update packet directly; it also usesMethodHandle
s now.Additions
FakeBlockHelper#getEstimatedLightLevel
- estimates a block's light level by trying to get on block in each direction around the source block, and:15
(max light level).FakeBlockHelper
to help with the light data estimation.