cuberite / WorldEdit

WorldEdit plugin for Cuberite
https://cuberite.org/
Apache License 2.0
41 stars 18 forks source link

Pyramid command error #134

Open mathiascode opened 7 years ago

mathiascode commented 7 years ago

The //pyramid command doesn't always work. When running //pyramid stone 50 after a server startup, this happens:

[23:18:10] Player Wither_Skeleton is executing command "//pyramid stone 50" in world "flatlands" at world age 8261.
[23:18:10] Write: Requesting datatypes not present in the cBlockArea. Got only 0x00, requested 0x23
[23:18:10] Parameters on the stack
[23:18:10] LUA: Write: Requesting datatypes not present in the cBlockArea. Got only 0x00, requested 0x23
[23:18:10] Stack trace:
[23:18:10]   [C](-1): Write
[23:18:10]   Plugins/WorldEdit Plugin/Commands/Generation.lua(352): (no name)
[23:18:10] Stack trace end
[23:18:10] Error in <attached> calling function <callback>()
mathiascode commented 7 years ago

The issue seems to be that ChunkStay isn't used in the pyramid command.

Seadragon91 commented 7 years ago

It's cBlockArea again, all the Write-calls has to be corrected. In my plugin SkyBlock I had to add the 3 to the function Write to correct it.

mathiascode commented 7 years ago

The problem seems to be that no info is available (0x00), which after a quick change in the code to use ChunkStay seemed to fix the issue.

The recent changes in cBlockArea might have started causing it though, I don't remember.

madmaxoft commented 7 years ago

Finally a case where the new stricter cBlockArea API has found an actual problem with the plugin code :D

@Seadragon91 Please don't use naked number. Ideally, use blockArea:GetDataTypes() as the param; or if you have specific needs, use the named constants cBlockArea.baTypes, cBlockArea.baMetas etc., added together using +.