GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Update to 1.18 by Iaiao · Pull Request #514 · feather-rs/feather Conversation
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @@ -0,0 +1 @@ | |||
| 757 No newline at end of file | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why files instead of using const variables?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Because I wanted to create a "one place for all constants" so we don't forget to update constants (protocol version number in initial_handlers, version string "Feather 1.18.1" in initial_handlers, anvil format number in base/anvil/region, and other constants in different places), but I completely forgot that I could create a constants.rs file.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| mod items; | ||
| mod simplified_block; | ||
|
|
||
| pub fn generate_all() { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would it be too much to ask, if we moved this to a separate PR... since there are some stuff I would like to discuss, for instance moving to on build generated files, using build.rs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think this pr should've been split into many PRs for worlds, dimensions, generators, 1.18, etc., but I was updating it like "old dimension_codec.nbt doesn't work, then I need to implement multidimension and biome loading, the packet doesn't work - rewrite proxy, a packet couldn't be deserialized - fix a bug in hematite-nbt" and so on, and I didn't want to stop if something doesn't work. I'm not sure if this would be compatible with old generators, but I think I can try to move it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to leave generators in this PR because:
Biome enum in generators) and I don't see any solutions other than "write a generator and then delete it" or "it doesn't work, but it'll work when 1.18 is merged" and have CI failing.main doesn't have feather_base::consts, and this pr won't be able to use data_generators::extract_vanilla_data, so we'll need to have duplicate code across 2 PRs and then create another pr to remove it (or forget about it and have 2 different implementations, like we had feather-blocks and libcraft-blocks)Item::Air from their 1.16 data, but main still uses it as a default item, that'll create even more problems.libcraft-blocks with feather-blocks in this PR or in generators PR? Both variants have obvious issues such as merge conflicts in use statements.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ItemNbt::item_stack( | ||
| &item.nbt, | ||
| Item::from_name(item.item.as_str()).unwrap_or(Item::Air), | ||
| Item::from_name(item.item.as_str()).unwrap(), |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This would cause a panic on loading an invalid world?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This would cause a panic on loading an invalid player.dat file. minecraft-data removed Item::Air and other non-item blocks from items.json, and I don't think panicking on invalid world saves is bad. Anyway, it's better than just silently wiping out a player's inventory.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to only implement TryFrom?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| /// to 1.16.5. | ||
| const DATA_VERSION: i32 = 2586; | ||
| /// The data version supported by this code | ||
| const DATA_VERSION: i32 = unwrap_ctx!(parse_i32(include_str!( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why use files, instead of a constants module?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| fn values_per_u64(&self) -> usize { | ||
| 64 / self.bits_per_value | ||
| if self.bits_per_value == 0 { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can bits_per_value be zero?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't know, but bits_per_value is not NonZeroUsize
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| } | ||
|
|
||
| fn init_biomes(game: &mut Game) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can panic.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This can only panic on non-utf8 file names, files not ending with .json, and invalid biome .json files, I think that failing fast on startup is better than making a user think "why doesn't my biome work?" because of a trailing comma.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
non-utf8 thing is just sad but whatever,
invalid biomes should ideally not panic if the biome is never used but also passable,
files not ending with .json immediately stops working on mac. you can rely on the OS to insert a .DS_Store file anywhere you look. also why not have texts or images or any other crap hidden in datapacks, who does it hurt?
P.S, yes, this is my first appearance on feather gh
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You're right, it should ignore .DS_Store, but images or text files shouldn't really exist in biomes/. Also, worldgen/ is not a datapack, though it would be great if we extract the full vanilla datapack when we implement the datapack support, so it's rather a temporary solution.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Feather (or any non-prototype rust code for that matter) should only panic on programming errors, never on I/O errors, which can and will definitely occur in normal usage. init_game already returns anyhow::Result so you don't even have to make big changes through a lot of code to implement proper error handling. Just pass the error up the chain by using ? and letting init_biomes return anyhow::Result<()>. This also applies for init_dimensions and anywhere else (I have not reviewed the PR yet).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nice work, looks good
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| [dev-dependencies] | ||
| approx = "0.3" | ||
| log = "0.4.14" |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Remove path and or minor.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| [dependencies] | ||
| libcraft-core = { path = "../core" } | ||
| once_cell = "1.9.0" |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Remove patch and or minor.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,162 @@ | |||
| // use crate::blocks::{AxisXyz, FacingCardinalAndDown, FacingCubic}; | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
An entire file commented out?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| /* | ||
| /// Returns the vanilla fluid ID for this block in case it is a fluid. | ||
| /// The fluid ID is used in the Tags packet. | ||
| pub fn vanilla_fluid_id(self) -> Option<u16> { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Commented out code.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
feather/feather/blocks/src/lib.rs
Lines 96 to 99 in 57ca709
| /* | |
| /// Returns the vanilla fluid ID for this block in case it is a fluid. | |
| /// The fluid ID is used in the Tags packet. | |
| pub fn vanilla_fluid_id(self) -> Option<u16> { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
What's the difference between world and dimension? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
In vanilla, each world has 3 dimensions: Overworld, Nether and The End. There are plugins that manage multiple worlds on a single spigot server, and they're popular, then why not to add it with built-in support? Also, I thought that the client has support for servers with multiple worlds because the Respawn and JoinGame packets had "world_name" and "dimension_codec" fields, and a note "is world_name resolving the same-dimension issue?", but it turned out that they both mean dimensions. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Can we not just treat each dimension as a separate world, why do we need to group dimensions into worlds? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
If you enter a nether portal it has to know which dimension to send you to for example. How would it know which nether to send you to without grouping into worlds? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
That's a relationship between two dimensions, it doesn't need to be represented as a hierarchy. Any dimension that has a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Any update on this? Also, how does the 1.19 release impact this pull request? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Or, you could follow this guide and split the main commit into a bunch of smaller commits. That way you don't need to manage a dozen or so PRs, but still enable reviewers to do a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Request for changing the goals - to motivate contributors - to make the project thrive Moving generated code into libcraft? Block state ids greater than 256 are converted to 256 in chunk sections that use the global palette
There was an error while loading. Please reload this page.