-
Notifications
You must be signed in to change notification settings - Fork 12
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
Bedrock support #86
Bedrock support #86
Conversation
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
I'm probably forgetting some things |
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.
Remember the API needs to be the same as the pc implementation
Since everything seems mostly identical to pc, with the exception of import/export functions, so one class seems to make sense if enchantments are the same (minus integer vs string IDs). Are they roughly the same? |
other than the stack ID stuff, yes, they seem to be pretty much the same |
Very different from what I see in the current PR. Base class and extension for pc/bedrock function implementation may make sense, or separate |
What I've noticed is a lot of things could already work with the java code if the same features were there in bedrock's features.json in minecraft-data. The spawn egg mob names for example, the getter would need no modification if the features were in minecraft-data |
Right, you can open a PR to add it to the features |
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.
Remove all the unnecessary stackId defining and ??
operations, including from the tests. The only time it should be specified in the tests is making sure there is equality. and if so it should be set to null
.
What's the status of this? Stale PRs are not good as they will accumulate merge conflicts over time |
sorry, haven't had much time the past few weeks but should have some now... The prismarine-registry PR is pretty much done (just need to do some testing) so there's just this left. I might be able to finish it |
Only anvil left, hopefully anvil usage doesn't differ very much from java to bedrock. |
I think it would be nice to get this in
anvil support is minor |
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.
LGTM, left some comments on the current code. For the anvil handling code, maybe we can do that in a separate PR and leave the Item.anvil methods as undefined for bedrock for now
|
||
#### item.blocksCanPlaceOn | ||
|
||
In adventure mode, the list of block names (as strings) that this Item can be placed on |
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.
I'm thinking this should return a [block name, properties] tuple instead of raw block strings for future proofing. It does seem odd that the matching is just done by block name here. But I'm not sure if we should block on that.
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.
Returning a prismarine-block isn't what I meant. I meant returning properties associated with a block. Like stone[variant=andersite]
--> [["stone", {"variant":"andersite"]]
as opposed to just ["stone"]
.
Since we don't actually have the prop data as a discriminator for these fields, returning undefined as a second param for now makes sense to me for now [["stone"]]
.
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.
ah, ok
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.
Not sure how to type/document it, if it never returns those properties anyway as there isn't a way of getting them, should they be documented to return those properties at all?
Hey, does it work ? Does it break PC? Will it help for bedrock? |
It works as far as I've tested, and I've written bedrock tests for it too. PC tests are also working fine, but I haven't tried PC much outside of that, though I made sure to keep the original functionality intact. As for helping with bedrock, apart from anvil, it implements all methods and properties PC has. |
/makerelease 1.13.0 |
This PR adds Bedrock Edition item support to the Item class.
Todo:
Implement Stack ID in Item classThis should be moved to prismarine-registry laterfeatures.json
for bedrock in minecraft-data, this way testing if the registry is bedrock could be skipped entirely in some cases -> PrismarineJS/minecraft-data#696Items with different namespaces - mostly affects block names in CanPlaceOn and CanDestroythis can be addressed later if there are problemsTemporary solution: setting the same stack ID