-
Notifications
You must be signed in to change notification settings - Fork 24
feat(chunk): chunk obfuscation #159
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
Draft
NopeNotDark
wants to merge
2
commits into
stable
Choose a base branch
from
feat/chunk-obfuscate
base: stable
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.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package oconfig | ||
|
|
||
| type ObfuscationMode string | ||
|
|
||
| const ( | ||
| ObfuscationModeHide ObfuscationMode = "hide" | ||
| ObfuscationModeRandom ObfuscationMode = "random" | ||
| ObfuscationModeLayered ObfuscationMode = "layered" | ||
| ) | ||
|
|
||
| type ChunkObfuscatorOpts struct { | ||
| Enabled bool `json:"enabled" comment:"Whether Oomph should obfuscate underground blocks before sending chunks to players."` | ||
| BlockRadius int `json:"block_radius" comment:"The radius around a block update where hidden blocks are shown."` | ||
| Dimensions ChunkObfuscatorDimensionsOpts `json:"dimensions"` | ||
| } | ||
|
|
||
| type ChunkObfuscatorDimensionsOpts struct { | ||
| Overworld ChunkObfuscatorDimensionOpts `json:"overworld"` | ||
| Nether ChunkObfuscatorDimensionOpts `json:"nether"` | ||
| } | ||
|
|
||
| type ChunkObfuscatorDimensionOpts struct { | ||
| Enabled bool `json:"enabled" comment:"Whether chunk obfuscation is enabled in this dimension."` | ||
| Mode ObfuscationMode `json:"mode" comment:"The obfuscation mode. Allowed values are hide, random, and layered."` | ||
| MaxY int `json:"max_y" comment:"The highest block Y coordinate that Oomph obfuscates."` | ||
| HiddenBlocks []string `json:"hidden_blocks" comment:"Blocks hidden by hide mode and used as decoys by random and layered modes."` | ||
| TerrainBlocks []string `json:"terrain_blocks" comment:"Solid terrain blocks eligible for random and layered obfuscation."` | ||
| ReplacementBlock string `json:"replacement_block" comment:"The block used by hide mode at Y 0 and above."` | ||
| DeepReplacementBlock string `json:"deep_replacement_block" comment:"The block used by hide mode below Y 0."` | ||
| } | ||
|
|
||
| func ChunkObfuscator() ChunkObfuscatorOpts { | ||
| return Global.ChunkObfuscator | ||
| } |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: oomph-ac/oomph
Length of output: 152
🏁 Script executed:
Repository: oomph-ac/oomph
Length of output: 7436
🏁 Script executed:
Repository: oomph-ac/oomph
Length of output: 8179
🏁 Script executed:
Repository: oomph-ac/oomph
Length of output: 18603
🏁 Script executed:
Repository: oomph-ac/oomph
Length of output: 3292
🏁 Script executed:
Repository: oomph-ac/oomph
Length of output: 5745
🏁 Script executed:
Repository: oomph-ac/oomph
Length of output: 944
🏁 Script executed:
Repository: oomph-ac/oomph
Length of output: 50370
🏁 Script executed:
Repository: oomph-ac/oomph
Length of output: 5785
🏁 Script executed:
Repository: oomph-ac/oomph
Length of output: 4963
Remove
minecraft:oak_planksfromTerrainBlocks. All configured identifiers resolve through the pinned registry, so they do not create a startup crash. Random and layered modes treat terrain blocks as obfuscation candidates, so oak planks would be replaced despite being player-placed blocks.🤖 Prompt for AI Agents
Source: Linters/SAST tools