Fix bounds error when loading negative block IDs#192
Conversation
|
please include this into main we project - its working great! |
|
This issue is solved for //copy and then //paste but still occurs when saving and loading a schematic and then pasting. |
|
This patch is crucial for any mods, that add additional blocks to vanilla. |
|
Honestly, this should not be pulled into the main WG plugin. You should maintain your own compatible version for Tekkit instead of expecting WG to maintain compatibility for you. |
|
Minecraft 1.3 has added blocks with block id's above 127 (133 I think at this point). So this bug will have to be fixed in order for WorldEdit to work with Minecraft 1.3. @Sleaker: I disagree. Anyone who works on this mod (WorldEdit) obviously understands that modding is an important part of minecraft and bukkit. This 'bug' affects any other mod which adds blocks, not just tekkit. Ofcourse it is only a matter of time before 256 block id's are insufficient. In fact some servers have already gone over this limit. Therefor there are bukkit builds which allow block id's up to 4096 (so-called "4096 Block ID Fix", Forge API already supports it). Ideally WorldEdit should support block ID's up to 4096. |
|
WorldEdit is currently built specifically for Bukkit. Until it's not specifically built for Bukkit this pull request should not be incorporated into the core plugin. In addition, the 'fix' is dealing with Invalid Block IDs to begin with, ones with negative values. I don't see how allowing negative block ID values to begin with is necessary for this plugin to even touch. If/When WorldEdit is built to work with a system that supports higher blockID values negative IDs wont even be used. Which again, means that this pull is completely unnecessary. The issue is that a schematic is being built with invalid block IDs, not that worldedit can't import them. |
|
They arent negative, they are just bigger than 127 (since Mojang now does this too this is totally valid). I'm guessing WorldEdit thinks they are negative because it interprets them as an 8-bit signed integer while in fact it is an unsigned integer. |
|
ahh gotcha, the whole +256 thing is what's throwing me off. Changing the stored types is fine, but worldedit shouldn't include fixes to wrongly saved schematic files. It should just be adjusted to account for blockIDs above 128. |
|
So bukkit does or doesn't support full 4096 block IDs? |
|
well thx sleaker. I think I have to wait until forge 3.3.8 get into tekkit. because stable tekkit is a bit outdated (forge 3.1.3) I did not see any commit of bukkit with 4096ID patch. Maybe it is not in the master branch yet. Personally I think forge + bukkit is the next step to go, not forge xor bukkit. |
|
in reference to Forge supporting it. Bukkit doesn't support non-MC API, I don't see how this is related at all. If MC doesn't support block IDs above 128 yet, then it shouldn't be changed at all. As far as the unsigned int comment, Java doesn't have unsigned integers so this isn't an issue at all. |
|
I've heard of this issue before, but the fix in this pull request is not the correct fix. Bad values are being passed into BaseBlock, so wherever the bad values are coming from should be fixed, not BaseBlock. |
|
If anyone wants a WorldEdit with this change, I've uploaded a build with it here: EDIT: No unofficial builds . Note it still may not properly handle all high block IDs in all situations, but it at least works for me when loading and pasting schematics. |
|
would be also nice to have proper metadata handling, most of RP blocks are being skipped |
|
I hear someone is working on 4096 compatibility for WorldEdit (forgot where I heard it, #minecraftforge or #sk89q? sorry I don't have more information), it may be a better, more comprehensive and correct change to take than this patch. @hqSparx the RedPower problem may be unrelated; I was able to paste IndustrialCraft^2 machines, IIRC (not completely sure, its been several months since I tried).. if the blocks are tubes or microblocks, could be an issue with tile entities not being copied. |
|
This is still a completely valid issue, none the less. |
|
Meanwhile, I'm maintaining this change in my fork on GitHub in case anyone wants it. Cheers. |
|
@md-5 There is no question that this is a valid issue. Spout is not limited to bytes for block id storage, and would eventually suffer from this issue too, as well as singleplayer WE with mods. However, this pull request is not the correct solution. |
|
So lets design a proper intermediate standard and hope we don't land up with more competing standards. |
|
@zml2008 would using an 'int' for the block IDs be a better solution? |
|
I think short is the answer, not int. |
|
@mushroomhostage - he was referring to the +256 hack for mis-saved data. The issue is in other locations that cast to byte. So the solution needs to go find where this is being done, and fix it at those steps. |
|
This has been fixed in a commit yesterday |
Fixes the error when pasting schematics with large block IDs which which wrap around and cause this out of bounds error:
To reproduce:
Without the patch, the above error occurs, and the IC2 machines and cables are missing. With the patch, they're pasted successfully.