-
Notifications
You must be signed in to change notification settings - Fork 22
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
Custom Portal Item causes error #45
Comments
Hmm that's not quite right. Can you post the code? |
here is the block class
and that's the portal creation code
|
Are you registering the Block correctly? This seems to be an error with the block, not to do with custom portal api. |
The registering is done like with every other block, so this should be correct: But I found some new errors:
I guess I'm just going to use the default block and either hope the feature gets implemented or just mix into your method. |
Ah I think I see the issue now. The initial problem is a syncing issue, the server is telling the client to render a block here. But this block does not exist in the registry so it cannot find it, thus returning -1. This is caused by creating separate instances of the same block. You are creating a new instance when registering the block, and then creating another new instance when passing the block into the the portal construction. Instead you should create a variable with an instance of the block. And pass that variable to both the registry and portal construction. (Sorry if that doesn't make sense, I am on mobile currently) |
That does make sense, but I don't see where I'm doing wrong. I am registering my block into a variable and then pass this to the |
Like so:
|
Ok, that works, but now I have my own block and thus missing textures. Is there a simple way to use your textures and custom color? |
I have created a custom portal block inheriting from CustomPortalBlock. When placing it using the BlockItem of this block and then going through, I get an error. Also the chunk containing the portal behaves weird: it is not rendered / rendered as completely empty, F3 doesn't show any blocks, moving in creative is very jaggy while in survival you drown (because the chunk still contains blocks).
/setblock myCustomBlock
also causes this error. Removing the portal restores normal chunk behaviour.the error
I have also created Nether portal items. They work as intended.
The text was updated successfully, but these errors were encountered: