Skip to content
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

Error in Block.fromBlockStateTag() when targeting campfire #82

Closed
Phobos97 opened this issue Mar 23, 2023 · 0 comments
Closed

Error in Block.fromBlockStateTag() when targeting campfire #82

Phobos97 opened this issue Mar 23, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Phobos97
Copy link
Contributor

When "getting" certain blocks from the world an error is thrown in Block.fromBlockStateTag(). This error occurs on multiple blocks like campfire, sculk_shrieker, sculk_sensor and possibly more.

When standing in front of a campfire like this and setting the buildarea with /setbuildarea ~ ~ ~ ~1 ~1 ~1 the following code will throw this error:

javaw_mPBsultHva

from glm import ivec3
from gdpc.editor import Editor


def main():
    editor = Editor(multithreading=False, buffering=False)
    build_area = editor.getBuildArea()
    build_rect = build_area.toRect()
    world_slice = editor.loadWorldSlice(build_rect)

    block = world_slice.getBlock(ivec3(1, build_area.offset.y, 1))

if __name__ == '__main__':
    main()
Traceback (most recent call last):
  File "C:\Users\j-elm\PycharmProjects\GAAI_GDMC\src\bug_report.py", line 14, in <module>
    main()
  File "C:\Users\j-elm\PycharmProjects\GAAI_GDMC\src\bug_report.py", line 11, in main
    block = world_slice.getBlock(ivec3(1, build_area.offset.y, 1))
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\site-packages\gdpc\world_slice.py", line 269, in getBlock
    return self.getBlockGlobal(ivec3(*position) + addY(self._rect.offset))
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\site-packages\gdpc\world_slice.py", line 264, in getBlockGlobal
    return Block.fromBlockStateTag(blockStateTag, blockEntityTag)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\site-packages\gdpc\block.py", line 100, in fromBlockStateTag
    blockEntityTag = deepcopy(blockEntityTag)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 270, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 205, in _deepcopy_list
    append(deepcopy(a, memo))
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 270, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\Users\j-elm\AppData\Local\Programs\Python\Python39\lib\copy.py", line 161, in deepcopy
    rv = reductor(4)
TypeError: cannot pickle '_struct.Struct' object
@avdstaaij avdstaaij added the bug Something isn't working label Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants