-
Notifications
You must be signed in to change notification settings - Fork 197
Biome-independent structure tables #2129
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
BoySanic
wants to merge
16
commits into
PixelGuys:master
Choose a base branch
from
BoySanic:fix/1805
base: master
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.
+156
−5
Open
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b6150b0
Refactor a bit to start to allow for structure tables outside of biomes
BoySanic ea6b957
Implement biome-independent structure tables, fixes #1805
BoySanic 123d767
Forgot to add the structure_table example...
BoySanic 347c2c7
Merge remote-tracking branch 'upstream' into fix/1805
BoySanic a49226e
Merge remote-tracking branch 'upstream' into fix/1805
BoySanic a070cb1
Formatting
BoySanic 8c9b230
Merge artifacts I missed
BoySanic 60ca1aa
Attempt to fix test failure
BoySanic 891bf44
Fixed memory leak, added migration paths
BoySanic 9d12362
Implement suggestions/changes
BoySanic a9a51be
Implement suggestions
BoySanic c98831f
Make it more idiomatic
BoySanic 52ff7e4
Fix compile issue, fix naming to match naming scheme
BoySanic bbe77df
Remove error on null zon
BoySanic f28973e
Implemented suggestions
BoySanic 8a0c751
Use items slice instead of the list wrapper
BoySanic 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 |
|---|---|---|
|
|
@@ -611,6 +611,7 @@ pub const World = struct { // MARK: World | |
| itemPalette: *assets.Palette = undefined, | ||
| toolPalette: *assets.Palette = undefined, | ||
| biomePalette: *assets.Palette = undefined, | ||
| structureTablePalette: *assets.Palette = undefined, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with the sorting, a palette isn't needed |
||
| itemDrops: ClientItemDropManager = undefined, | ||
| playerBiome: Atomic(*const main.server.terrain.biomes.Biome) = undefined, | ||
|
|
||
|
|
@@ -668,6 +669,7 @@ pub const World = struct { // MARK: World | |
|
|
||
| pub fn finishHandshake(self: *World, zon: ZonElement) !void { | ||
| // TODO: Consider using a per-world allocator. | ||
| self.structureTablePalette = try assets.Palette.init(main.globalAllocator, zon.getChild("structureTablePalette"), null); | ||
| self.blockPalette = try assets.Palette.init(main.globalAllocator, zon.getChild("blockPalette"), "cubyz:air"); | ||
| errdefer self.blockPalette.deinit(); | ||
| self.biomePalette = try assets.Palette.init(main.globalAllocator, zon.getChild("biomePalette"), null); | ||
|
|
@@ -680,7 +682,7 @@ pub const World = struct { // MARK: World | |
|
|
||
| const path = std.fmt.allocPrint(main.stackAllocator.allocator, "{s}/serverAssets", .{main.files.cubyzDirStr()}) catch unreachable; | ||
| defer main.stackAllocator.free(path); | ||
| try assets.loadWorldAssets(path, self.blockPalette, self.itemPalette, self.toolPalette, self.biomePalette); | ||
| try assets.loadWorldAssets(path, self.blockPalette, self.itemPalette, self.toolPalette, self.biomePalette, self.structureTablePalette); | ||
| Player.id = zon.get(u32, "player_id", std.math.maxInt(u32)); | ||
| Player.inventory = Inventory.init(main.globalAllocator, Player.inventorySize, .normal, .{.playerInventory = Player.id}, .{}); | ||
| Player.loadFrom(zon.getChild("player")); | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.