From dac97826f7d0c9b9135c1a08c4d5f16b61494bd1 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 26 Aug 2015 10:58:51 +0200 Subject: Renamed output directory to Server --- Server/.gitignore | 35 + Server/Plugins/.gitignore | 3 + Server/Plugins/APIDump/APIDesc.lua | 3045 +++++++++ Server/Plugins/APIDump/APIDump.deproj | 168 + Server/Plugins/APIDump/Classes/BlockEntities.lua | 322 + Server/Plugins/APIDump/Classes/Geometry.lua | 332 + Server/Plugins/APIDump/Classes/Network.lua | 372 ++ Server/Plugins/APIDump/Classes/Plugins.lua | 207 + Server/Plugins/APIDump/Classes/Projectiles.lua | 174 + Server/Plugins/APIDump/Classes/WebAdmin.lua | 51 + Server/Plugins/APIDump/Hooks/OnBlockSpread.lua | 40 + Server/Plugins/APIDump/Hooks/OnBlockToPickups.lua | 62 + Server/Plugins/APIDump/Hooks/OnChat.lua | 30 + Server/Plugins/APIDump/Hooks/OnChunkAvailable.lua | 27 + Server/Plugins/APIDump/Hooks/OnChunkGenerated.lua | 67 + Server/Plugins/APIDump/Hooks/OnChunkGenerating.lua | 35 + Server/Plugins/APIDump/Hooks/OnChunkUnloaded.lua | 28 + Server/Plugins/APIDump/Hooks/OnChunkUnloading.lua | 30 + .../Plugins/APIDump/Hooks/OnCollectingPickup.lua | 32 + .../Plugins/APIDump/Hooks/OnCraftingNoRecipe.lua | 32 + Server/Plugins/APIDump/Hooks/OnDisconnect.lua | 38 + Server/Plugins/APIDump/Hooks/OnEntityAddEffect.lua | 33 + .../Plugins/APIDump/Hooks/OnEntityChangedWorld.lua | 28 + .../APIDump/Hooks/OnEntityChangingWorld.lua | 29 + Server/Plugins/APIDump/Hooks/OnEntityTeleport.lua | 29 + Server/Plugins/APIDump/Hooks/OnExecuteCommand.lua | 41 + Server/Plugins/APIDump/Hooks/OnExploded.lua | 49 + Server/Plugins/APIDump/Hooks/OnExploding.lua | 50 + Server/Plugins/APIDump/Hooks/OnHandshake.lua | 29 + .../Plugins/APIDump/Hooks/OnHopperPullingItem.lua | 30 + .../Plugins/APIDump/Hooks/OnHopperPushingItem.lua | 30 + Server/Plugins/APIDump/Hooks/OnKilled.lua | 22 + Server/Plugins/APIDump/Hooks/OnKilling.lua | 30 + Server/Plugins/APIDump/Hooks/OnLogin.lua | 31 + Server/Plugins/APIDump/Hooks/OnPlayerAnimation.lua | 28 + .../APIDump/Hooks/OnPlayerBreakingBlock.lua | 36 + .../Plugins/APIDump/Hooks/OnPlayerBrokenBlock.lua | 36 + Server/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua | 27 + Server/Plugins/APIDump/Hooks/OnPlayerEating.lua | 27 + Server/Plugins/APIDump/Hooks/OnPlayerFished.lua | 20 + Server/Plugins/APIDump/Hooks/OnPlayerFishing.lua | 21 + .../APIDump/Hooks/OnPlayerFoodLevelChange.lua | 27 + Server/Plugins/APIDump/Hooks/OnPlayerJoined.lua | 29 + Server/Plugins/APIDump/Hooks/OnPlayerLeftClick.lua | 47 + Server/Plugins/APIDump/Hooks/OnPlayerMoving.lua | 29 + .../Plugins/APIDump/Hooks/OnPlayerPlacedBlock.lua | 40 + .../Plugins/APIDump/Hooks/OnPlayerPlacingBlock.lua | 45 + .../Plugins/APIDump/Hooks/OnPlayerRightClick.lua | 40 + .../APIDump/Hooks/OnPlayerRightClickingEntity.lua | 27 + Server/Plugins/APIDump/Hooks/OnPlayerShooting.lua | 32 + Server/Plugins/APIDump/Hooks/OnPlayerSpawned.lua | 32 + .../Plugins/APIDump/Hooks/OnPlayerTossingItem.lua | 31 + Server/Plugins/APIDump/Hooks/OnPlayerUsedBlock.lua | 46 + Server/Plugins/APIDump/Hooks/OnPlayerUsedItem.lua | 46 + .../Plugins/APIDump/Hooks/OnPlayerUsingBlock.lua | 46 + Server/Plugins/APIDump/Hooks/OnPlayerUsingItem.lua | 47 + Server/Plugins/APIDump/Hooks/OnPluginMessage.lua | 25 + Server/Plugins/APIDump/Hooks/OnPluginsLoaded.lua | 84 + Server/Plugins/APIDump/Hooks/OnPostCrafting.lua | 36 + Server/Plugins/APIDump/Hooks/OnPreCrafting.lua | 37 + .../Plugins/APIDump/Hooks/OnProjectileHitBlock.lua | 29 + .../APIDump/Hooks/OnProjectileHitEntity.lua | 25 + Server/Plugins/APIDump/Hooks/OnServerPing.lua | 53 + Server/Plugins/APIDump/Hooks/OnSpawnedEntity.lua | 31 + Server/Plugins/APIDump/Hooks/OnSpawnedMonster.lua | 30 + Server/Plugins/APIDump/Hooks/OnSpawningEntity.lua | 33 + Server/Plugins/APIDump/Hooks/OnSpawningMonster.lua | 33 + Server/Plugins/APIDump/Hooks/OnTakeDamage.lua | 31 + Server/Plugins/APIDump/Hooks/OnTick.lua | 29 + Server/Plugins/APIDump/Hooks/OnUpdatedSign.lua | 38 + Server/Plugins/APIDump/Hooks/OnUpdatingSign.lua | 58 + Server/Plugins/APIDump/Hooks/OnWeatherChanged.lua | 28 + Server/Plugins/APIDump/Hooks/OnWeatherChanging.lua | 35 + Server/Plugins/APIDump/Hooks/OnWorldStarted.lua | 24 + Server/Plugins/APIDump/Hooks/OnWorldTick.lua | 29 + Server/Plugins/APIDump/InfoFile.html | 246 + Server/Plugins/APIDump/LICENSE-prettify.txt | 191 + Server/Plugins/APIDump/SettingUpDecoda.html | 49 + Server/Plugins/APIDump/SettingUpZeroBrane.html | 46 + Server/Plugins/APIDump/Static/.gitignore | 1 + .../APIDump/Static/decoda_debug_settings.png | Bin 0 -> 6178 bytes Server/Plugins/APIDump/Static/decoda_logo.png | Bin 0 -> 2413 bytes Server/Plugins/APIDump/Static/decoda_workspace.png | Bin 0 -> 70644 bytes Server/Plugins/APIDump/Static/zbs_logo.png | Bin 0 -> 1306 bytes Server/Plugins/APIDump/Static/zbs_workspace.png | Bin 0 -> 72631 bytes Server/Plugins/APIDump/UsingChunkStays.html | 167 + Server/Plugins/APIDump/WebWorldThreads.html | 72 + .../Plugins/APIDump/Writing-a-Cuberite-plugin.html | 255 + Server/Plugins/APIDump/lang-lua.js | 2 + Server/Plugins/APIDump/main.css | 68 + Server/Plugins/APIDump/main_APIDump.lua | 1685 +++++ Server/Plugins/APIDump/prettify.css | 1 + Server/Plugins/APIDump/prettify.js | 30 + Server/Plugins/ChatLog | 1 + Server/Plugins/ChunkWorx | 1 + Server/Plugins/Core | 1 + Server/Plugins/Debuggers/Debuggers.deproj | 6 + Server/Plugins/Debuggers/Debuggers.lua | 2047 ++++++ Server/Plugins/Debuggers/Info.lua | 249 + Server/Plugins/DiamondMover/DiamondMover.lua | 85 + Server/Plugins/DumpInfo/Init.lua | 52 + Server/Plugins/Handy | 1 + Server/Plugins/HookNotify/HookNotify.lua | 65 + Server/Plugins/InfoDump.deproj | 6 + Server/Plugins/InfoDump.lua | 768 +++ Server/Plugins/InfoReg.lua | 198 + Server/Plugins/MagicCarpet | 1 + Server/Plugins/NetworkTest/Info.lua | 148 + Server/Plugins/NetworkTest/NetworkTest.lua | 503 ++ Server/Plugins/NetworkTest/splashes.txt | 357 ++ Server/Plugins/ProtectionAreas | 1 + Server/Plugins/TestLuaRocks/TestLuaRocks.lua | 49 + Server/Plugins/TransAPI | 1 + Server/Prefabs/Villages/AlchemistVillage.cubeset | 3647 +++++++++++ Server/Prefabs/Villages/JapaneseVillage.cubeset | 3467 +++++++++++ Server/Prefabs/Villages/PlainsVillage.cubeset | 6521 ++++++++++++++++++++ .../Prefabs/Villages/SandFlatRoofVillage.cubeset | 1741 ++++++ Server/Prefabs/Villages/SandVillage.cubeset | 2389 +++++++ Server/README.txt | 20 + Server/crafting.txt | 645 ++ Server/delete_windows_service.cmd | 4 + Server/favicon.png | Bin 0 -> 1769 bytes Server/furnace.txt | 130 + Server/hg | 7 + Server/hg.supp | 22 + Server/install_windows_service.cmd | 7 + Server/items.ini | 887 +++ Server/lang/items_de.ini | 603 ++ Server/monsters.ini | 213 + Server/vg | 7 + Server/vg.supp | 0 .../GenerateSelfSignedHTTPSCertUsingOpenssl.cmd | 12 + .../GenerateSelfSignedHTTPSCertUsingOpenssl.sh | 10 + Server/webadmin/files/background.gif | Bin 0 -> 57 bytes Server/webadmin/files/favicon.ico | Bin 0 -> 32038 bytes Server/webadmin/files/guest.html | 18 + Server/webadmin/files/header.png | Bin 0 -> 221 bytes Server/webadmin/files/home.gif | Bin 0 -> 1026 bytes Server/webadmin/files/loading.gif | Bin 0 -> 7364 bytes Server/webadmin/files/log_out.png | Bin 0 -> 995 bytes Server/webadmin/files/login.css | 219 + Server/webadmin/files/login.gif | Bin 0 -> 586 bytes Server/webadmin/files/logo.png | Bin 0 -> 3315 bytes Server/webadmin/files/logo_login.png | Bin 0 -> 18057 bytes Server/webadmin/files/mc-logo.png | Bin 0 -> 66137 bytes Server/webadmin/files/pmfolder.gif | Bin 0 -> 995 bytes Server/webadmin/files/style.css | 427 ++ Server/webadmin/files/sub_pmfolder.gif | Bin 0 -> 1022 bytes Server/webadmin/files/tcat.png | Bin 0 -> 183 bytes Server/webadmin/files/thead.png | Bin 0 -> 132 bytes Server/webadmin/login_template.html | 69 + Server/webadmin/template.html | 140 + Server/webadmin/template.lua | 200 + 153 files changed, 35766 insertions(+) create mode 100644 Server/.gitignore create mode 100644 Server/Plugins/.gitignore create mode 100644 Server/Plugins/APIDump/APIDesc.lua create mode 100644 Server/Plugins/APIDump/APIDump.deproj create mode 100644 Server/Plugins/APIDump/Classes/BlockEntities.lua create mode 100644 Server/Plugins/APIDump/Classes/Geometry.lua create mode 100644 Server/Plugins/APIDump/Classes/Network.lua create mode 100644 Server/Plugins/APIDump/Classes/Plugins.lua create mode 100644 Server/Plugins/APIDump/Classes/Projectiles.lua create mode 100644 Server/Plugins/APIDump/Classes/WebAdmin.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnBlockSpread.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnBlockToPickups.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnChat.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnChunkAvailable.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnChunkGenerated.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnChunkGenerating.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnChunkUnloaded.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnChunkUnloading.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnCollectingPickup.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnCraftingNoRecipe.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnDisconnect.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnEntityAddEffect.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnEntityChangedWorld.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnEntityChangingWorld.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnEntityTeleport.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnExecuteCommand.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnExploded.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnExploding.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnHandshake.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnHopperPullingItem.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnHopperPushingItem.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnKilled.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnKilling.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnLogin.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerAnimation.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerBreakingBlock.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerBrokenBlock.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerEating.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerFished.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerFishing.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerJoined.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerLeftClick.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerMoving.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerPlacedBlock.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerPlacingBlock.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerRightClick.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerRightClickingEntity.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerShooting.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerSpawned.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerUsedBlock.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerUsedItem.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerUsingBlock.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPlayerUsingItem.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPluginMessage.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPluginsLoaded.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPostCrafting.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnPreCrafting.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnProjectileHitEntity.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnServerPing.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnSpawnedEntity.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnSpawnedMonster.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnSpawningEntity.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnSpawningMonster.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnTakeDamage.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnTick.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnUpdatedSign.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnUpdatingSign.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnWeatherChanged.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnWeatherChanging.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnWorldStarted.lua create mode 100644 Server/Plugins/APIDump/Hooks/OnWorldTick.lua create mode 100644 Server/Plugins/APIDump/InfoFile.html create mode 100644 Server/Plugins/APIDump/LICENSE-prettify.txt create mode 100644 Server/Plugins/APIDump/SettingUpDecoda.html create mode 100644 Server/Plugins/APIDump/SettingUpZeroBrane.html create mode 100644 Server/Plugins/APIDump/Static/.gitignore create mode 100644 Server/Plugins/APIDump/Static/decoda_debug_settings.png create mode 100644 Server/Plugins/APIDump/Static/decoda_logo.png create mode 100644 Server/Plugins/APIDump/Static/decoda_workspace.png create mode 100644 Server/Plugins/APIDump/Static/zbs_logo.png create mode 100644 Server/Plugins/APIDump/Static/zbs_workspace.png create mode 100644 Server/Plugins/APIDump/UsingChunkStays.html create mode 100644 Server/Plugins/APIDump/WebWorldThreads.html create mode 100644 Server/Plugins/APIDump/Writing-a-Cuberite-plugin.html create mode 100644 Server/Plugins/APIDump/lang-lua.js create mode 100644 Server/Plugins/APIDump/main.css create mode 100644 Server/Plugins/APIDump/main_APIDump.lua create mode 100644 Server/Plugins/APIDump/prettify.css create mode 100644 Server/Plugins/APIDump/prettify.js create mode 160000 Server/Plugins/ChatLog create mode 160000 Server/Plugins/ChunkWorx create mode 160000 Server/Plugins/Core create mode 100644 Server/Plugins/Debuggers/Debuggers.deproj create mode 100644 Server/Plugins/Debuggers/Debuggers.lua create mode 100644 Server/Plugins/Debuggers/Info.lua create mode 100644 Server/Plugins/DiamondMover/DiamondMover.lua create mode 100644 Server/Plugins/DumpInfo/Init.lua create mode 160000 Server/Plugins/Handy create mode 100644 Server/Plugins/HookNotify/HookNotify.lua create mode 100644 Server/Plugins/InfoDump.deproj create mode 100644 Server/Plugins/InfoDump.lua create mode 100644 Server/Plugins/InfoReg.lua create mode 160000 Server/Plugins/MagicCarpet create mode 100644 Server/Plugins/NetworkTest/Info.lua create mode 100644 Server/Plugins/NetworkTest/NetworkTest.lua create mode 100644 Server/Plugins/NetworkTest/splashes.txt create mode 160000 Server/Plugins/ProtectionAreas create mode 100644 Server/Plugins/TestLuaRocks/TestLuaRocks.lua create mode 160000 Server/Plugins/TransAPI create mode 100644 Server/Prefabs/Villages/AlchemistVillage.cubeset create mode 100644 Server/Prefabs/Villages/JapaneseVillage.cubeset create mode 100644 Server/Prefabs/Villages/PlainsVillage.cubeset create mode 100644 Server/Prefabs/Villages/SandFlatRoofVillage.cubeset create mode 100644 Server/Prefabs/Villages/SandVillage.cubeset create mode 100644 Server/README.txt create mode 100644 Server/crafting.txt create mode 100644 Server/delete_windows_service.cmd create mode 100644 Server/favicon.png create mode 100644 Server/furnace.txt create mode 100755 Server/hg create mode 100644 Server/hg.supp create mode 100644 Server/install_windows_service.cmd create mode 100644 Server/items.ini create mode 100644 Server/lang/items_de.ini create mode 100644 Server/monsters.ini create mode 100755 Server/vg create mode 100644 Server/vg.supp create mode 100644 Server/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd create mode 100755 Server/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh create mode 100644 Server/webadmin/files/background.gif create mode 100644 Server/webadmin/files/favicon.ico create mode 100644 Server/webadmin/files/guest.html create mode 100644 Server/webadmin/files/header.png create mode 100644 Server/webadmin/files/home.gif create mode 100644 Server/webadmin/files/loading.gif create mode 100644 Server/webadmin/files/log_out.png create mode 100644 Server/webadmin/files/login.css create mode 100644 Server/webadmin/files/login.gif create mode 100644 Server/webadmin/files/logo.png create mode 100644 Server/webadmin/files/logo_login.png create mode 100644 Server/webadmin/files/mc-logo.png create mode 100644 Server/webadmin/files/pmfolder.gif create mode 100644 Server/webadmin/files/style.css create mode 100644 Server/webadmin/files/sub_pmfolder.gif create mode 100644 Server/webadmin/files/tcat.png create mode 100644 Server/webadmin/files/thead.png create mode 100644 Server/webadmin/login_template.html create mode 100644 Server/webadmin/template.html create mode 100644 Server/webadmin/template.lua (limited to 'Server') diff --git a/Server/.gitignore b/Server/.gitignore new file mode 100644 index 000000000..161734f86 --- /dev/null +++ b/Server/.gitignore @@ -0,0 +1,35 @@ +*.exe +*.dll +*.exp +*.lib +*.ini +Cuberite +Cuberite_debug +CommLogs/ +GalExports/ +logs +players +world* +API/ +API.txt +API_wiki.txt +*.dat +schematics +*.schematic +*.ilk +*.pdb +memdump* +*.grab +*.cfg +*.sqlite +helgrind.log +valgrind.log +motd.txt +*.deuser +*.dmp +*.xml +mcserver_api.lua + +# Ignore the webadmin certs / privkey, so that no-one commits theirs by accident: +webadmin/httpscert.crt +webadmin/httpskey.pem diff --git a/Server/Plugins/.gitignore b/Server/Plugins/.gitignore new file mode 100644 index 000000000..8553945b5 --- /dev/null +++ b/Server/Plugins/.gitignore @@ -0,0 +1,3 @@ +*.txt +*.md +*/ diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua new file mode 100644 index 000000000..187c72b9e --- /dev/null +++ b/Server/Plugins/APIDump/APIDesc.lua @@ -0,0 +1,3045 @@ +-- APIDesc.lua + +-- Contains the API objects' descriptions + + + + +g_APIDesc = +{ + Classes = + { + --[[ + -- What the APIDump plugin understands / how to document stuff: + ExampleClassName = + { + Desc = "Description, exported as the first paragraph of the class page. Usually enclosed within double brackets." + + Functions = + { + FunctionName = { Params = "Parameter list", Return = "Return values list", Notes = "Notes" ), + OverloadedFunctionName = -- When a function supports multiple parameter variants + { + { Params = "Parameter list 1", Return = "Return values list 1", Notes = "Notes 1" }, + { Params = "Parameter list 2", Return = "Return values list 2", Notes = "Notes 2" }, + } + } , + + Constants = + { + ConstantName = { Notes = "Notes about the constant" }, + } , + + ConstantGroups = + { + GroupName1 = -- GroupName1 is used as the HTML anchor name + { + Include = {"constant1", "constant2", "const_.*"}, -- Constants to include in this group, array of identifiers, accepts wildcards + TextBefore = "This text will be written in front of the constant list", + TextAfter = "This text will be written after the constant list", + ShowInDescendants = false, -- If false, descendant classes won't list these constants + } + }, + + Variables = + { + VariableName = { Type = "string", Notes = "Notes about the variable" }, + } , + + AdditionalInfo = -- Paragraphs to be exported after the function definitions table + { + { + Header = "Header 1", + Contents = "Contents of the additional section 1", + }, + { + Header = "Header 2", + Contents = "Contents of the additional section 2", + } + }, + + Inherits = "ParentClassName", -- Only present if the class inherits from another API class + }, + ]]-- + + cBlockArea = + { + Desc = [[ + This class is used when multiple adjacent blocks are to be manipulated. Because of chunking + and multithreading, manipulating single blocks using {{cWorld|cWorld:SetBlock}}() is a rather + time-consuming operation (locks for exclusive access need to be obtained, chunk lookup is done + for each block), so whenever you need to manipulate multiple adjacent blocks, it's better to wrap + the operation into a cBlockArea access. cBlockArea is capable of reading / writing across chunk + boundaries, has no chunk lookups for get and set operations and is not subject to multithreading + locking (because it is not shared among threads).

+

+ cBlockArea remembers its origin (MinX, MinY, MinZ coords in the Read() call) and therefore supports + absolute as well as relative get / set operations. Despite that, the contents of a cBlockArea can + be written back into the world at any coords.

+

+ cBlockArea can hold any combination of the following datatypes:

+ Read() and Write() functions have parameters that tell the class which datatypes to read / write. + Note that a datatype that has not been read cannot be written (FIXME).

+

+ Typical usage:

+ ]], + Functions = + { + constructor = { Params = "", Return = "cBlockArea", Notes = "Creates a new empty cBlockArea object" }, + Clear = { Params = "", Return = "", Notes = "Clears the object, resets it to zero size" }, + CopyFrom = { Params = "BlockAreaSrc", Return = "", Notes = "Copies contents from BlockAreaSrc into self" }, + CopyTo = { Params = "BlockAreaDst", Return = "", Notes = "Copies contents from self into BlockAreaDst." }, + CountNonAirBlocks = { Params = "", Return = "number", Notes = "Returns the count of blocks that are not air. Returns 0 if blocktypes not available. Block metas are ignored (if present, air with any meta is still considered air)." }, + CountSpecificBlocks = + { + { Params = "BlockType", Return = "number", Notes = "Counts the number of occurences of the specified blocktype contained in the area." }, + { Params = "BlockType, BlockMeta", Return = "number", Notes = "Counts the number of occurrences of the specified blocktype + blockmeta combination contained in the area." }, + }, + Create = { Params = "SizeX, SizeY, SizeZ, [DataTypes]", Return = "", Notes = "Initializes this BlockArea to an empty area of the specified size and origin of {0, 0, 0}. Any previous contents are lost." }, + Crop = { Params = "AddMinX, SubMaxX, AddMinY, SubMaxY, AddMinZ, SubMaxZ", Return = "", Notes = "Crops the specified number of blocks from each border. Modifies the size of this blockarea object." }, + DumpToRawFile = { Params = "FileName", Return = "", Notes = "Dumps the raw data into a file. For debugging purposes only." }, + Expand = { Params = "SubMinX, AddMaxX, SubMinY, AddMaxY, SubMinZ, AddMaxZ", Return = "", Notes = "Expands the specified number of blocks from each border. Modifies the size of this blockarea object. New blocks created with this operation are filled with zeroes." }, + Fill = { Params = "DataTypes, BlockType, [BlockMeta], [BlockLight], [BlockSkyLight]", Return = "", Notes = "Fills the entire block area with the same values, specified. Uses the DataTypes param to determine which content types are modified." }, + FillRelCuboid = + { + { Params = "{{cCuboid|RelCuboid}}, DataTypes, BlockType, [BlockMeta], [BlockLight], [BlockSkyLight]", Return = "", Notes = "Fills the specified cuboid (in relative coords) with the same values (like Fill() )." }, + { Params = "MinRelX, MaxRelX, MinRelY, MaxRelY, MinRelZ, MaxRelZ, DataTypes, BlockType, [BlockMeta], [BlockLight], [BlockSkyLight]", Return = "", Notes = "Fills the specified cuboid with the same values (like Fill() )." }, + }, + GetBlockLight = { Params = "BlockX, BlockY, BlockZ", Return = "NIBBLETYPE", Notes = "Returns the blocklight at the specified absolute coords" }, + GetBlockMeta = { Params = "BlockX, BlockY, BlockZ", Return = "NIBBLETYPE", Notes = "Returns the block meta at the specified absolute coords" }, + GetBlockSkyLight = { Params = "BlockX, BlockY, BlockZ", Return = "NIBBLETYPE", Notes = "Returns the skylight at the specified absolute coords" }, + GetBlockType = { Params = "BlockX, BlockY, BlockZ", Return = "BLOCKTYPE", Notes = "Returns the block type at the specified absolute coords" }, + GetBlockTypeMeta = { Params = "BlockX, BlockY, BlockZ", Return = "BLOCKTYPE, NIBBLETYPE", Notes = "Returns the block type and meta at the specified absolute coords" }, + GetCoordRange = {Params = "", Return = "MaxX, MaxY, MaxZ", Notes = "Returns the maximum relative coords in all 3 axes. See also GetSize()." }, + GetDataTypes = { Params = "", Return = "number", Notes = "Returns the mask of datatypes that the object is currently holding" }, + GetOrigin = { Params = "", Return = "OriginX, OriginY, OriginZ", Notes = "Returns the origin coords of where the area was read from." }, + GetOriginX = { Params = "", Return = "number", Notes = "Returns the origin x-coord" }, + GetOriginY = { Params = "", Return = "number", Notes = "Returns the origin y-coord" }, + GetOriginZ = { Params = "", Return = "number", Notes = "Returns the origin z-coord" }, + GetNonAirCropRelCoords = { Params = "[IgnoreBlockType]", Return = "MinRelX, MinRelY, MinRelZ, MaxRelX, MaxRelY, MaxRelZ", Notes = "Returns the minimum and maximum coords in each direction for the first non-ignored block in each direction. If there are no non-ignored blocks within the area, or blocktypes are not present, the returned values are reverse-ranges (MinX <- m_RangeX, MaxX <- 0 etc.). IgnoreBlockType defaults to air." }, + GetRelBlockLight = { Params = "RelBlockX, RelBlockY, RelBlockZ", Return = "NIBBLETYPE", Notes = "Returns the blocklight at the specified relative coords" }, + GetRelBlockMeta = { Params = "RelBlockX, RelBlockY, RelBlockZ", Return = "NIBBLETYPE", Notes = "Returns the block meta at the specified relative coords" }, + GetRelBlockSkyLight = { Params = "RelBlockX, RelBlockY, RelBlockZ", Return = "NIBBLETYPE", Notes = "Returns the skylight at the specified relative coords" }, + GetRelBlockType = { Params = "RelBlockX, RelBlockY, RelBlockZ", Return = "BLOCKTYPE", Notes = "Returns the block type at the specified relative coords" }, + GetRelBlockTypeMeta = { Params = "RelBlockX, RelBlockY, RelBlockZ", Return = "BLOCKTYPE, NIBBLETYPE", Notes = "Returns the block type and meta at the specified relative coords" }, + GetSize = { Params = "", Return = "SizeX, SizeY, SizeZ", Notes = "Returns the size of the area in all 3 axes. See also GetCoordRange()." }, + GetSizeX = { Params = "", Return = "number", Notes = "Returns the size of the held data in the x-axis" }, + GetSizeY = { Params = "", Return = "number", Notes = "Returns the size of the held data in the y-axis" }, + GetSizeZ = { Params = "", Return = "number", Notes = "Returns the size of the held data in the z-axis" }, + GetVolume = { Params = "", Return = "number", Notes = "Returns the volume of the area - the total number of blocks stored within." }, + GetWEOffset = { Params = "", Return = "{{Vector3i}}", Notes = "Returns the WE offset, a data value sometimes stored in the schematic files. Cuberite doesn't use this value, but provides access to it using this method. The default is {0, 0, 0}."}, + HasBlockLights = { Params = "", Return = "bool", Notes = "Returns true if current datatypes include blocklight" }, + HasBlockMetas = { Params = "", Return = "bool", Notes = "Returns true if current datatypes include block metas" }, + HasBlockSkyLights = { Params = "", Return = "bool", Notes = "Returns true if current datatypes include skylight" }, + HasBlockTypes = { Params = "", Return = "bool", Notes = "Returns true if current datatypes include block types" }, + LoadFromSchematicFile = { Params = "FileName", Return = "", Notes = "Clears current content and loads new content from the specified schematic file. Returns true if successful. Returns false and logs error if unsuccessful, old content is preserved in such a case." }, + LoadFromSchematicString = { Params = "SchematicData", Return = "", Notes = "Clears current content and loads new content from the specified string (assumed to contain .schematic data). Returns true if successful. Returns false and logs error if unsuccessful, old content is preserved in such a case." }, + Merge = + { + { Params = "BlockAreaSrc, {{Vector3i|RelMinCoords}}, Strategy", Return = "", Notes = "Merges BlockAreaSrc into this object at the specified relative coords, using the specified strategy" }, + { Params = "BlockAreaSrc, RelX, RelY, RelZ, Strategy", Return = "", Notes = "Merges BlockAreaSrc into this object at the specified relative coords, using the specified strategy" }, + }, + MirrorXY = { Params = "", Return = "", Notes = "Mirrors this block area around the XY plane. Modifies blocks' metas (if present) to match (i. e. furnaces facing the opposite direction)." }, + MirrorXYNoMeta = { Params = "", Return = "", Notes = "Mirrors this block area around the XY plane. Doesn't modify blocks' metas." }, + MirrorXZ = { Params = "", Return = "", Notes = "Mirrors this block area around the XZ plane. Modifies blocks' metas (if present)" }, + MirrorXZNoMeta = { Params = "", Return = "", Notes = "Mirrors this block area around the XZ plane. Doesn't modify blocks' metas." }, + MirrorYZ = { Params = "", Return = "", Notes = "Mirrors this block area around the YZ plane. Modifies blocks' metas (if present)" }, + MirrorYZNoMeta = { Params = "", Return = "", Notes = "Mirrors this block area around the YZ plane. Doesn't modify blocks' metas." }, + Read = + { + { Params = "World, {{cCuboid|Cuboid}}, DataTypes", Return = "bool", Notes = "Reads the area from World, returns true if successful" }, + { Params = "World, {{Vector3i|Point1}}, {{Vector3i|Point2}}, DataTypes", Return = "bool", Notes = "Reads the area from World, returns true if successful" }, + { Params = "World, X1, X2, Y1, Y2, Z1, Z2, DataTypes", Return = "bool", Notes = "Reads the area from World, returns true if successful" }, + }, + RelLine = + { + { Params = "{{Vector3i|RelPoint1}}, {{Vector3i|RelPoint2}}, DataTypes, BlockType, [BlockMeta], [BlockLight], [BlockSkyLight]", Return = "", Notes = "Draws a line between the two specified points. Sets only datatypes specified by DataTypes (baXXX constants)." }, + { Params = "RelX1, RelY1, RelZ1, RelX2, RelY2, RelZ2, DataTypes, BlockType, [BlockMeta], [BlockLight], [BlockSkyLight]", Return = "", Notes = "Draws a line between the two specified points. Sets only datatypes specified by DataTypes (baXXX constants)." }, + }, + RotateCCW = { Params = "", Return = "", Notes = "Rotates the block area around the Y axis, counter-clockwise (east -> north). Modifies blocks' metas (if present) to match." }, + RotateCCWNoMeta = { Params = "", Return = "", Notes = "Rotates the block area around the Y axis, counter-clockwise (east -> north). Doesn't modify blocks' metas." }, + RotateCW = { Params = "", Return = "", Notes = "Rotates the block area around the Y axis, clockwise (north -> east). Modifies blocks' metas (if present) to match." }, + RotateCWNoMeta = { Params = "", Return = "", Notes = "Rotates the block area around the Y axis, clockwise (north -> east). Doesn't modify blocks' metas." }, + SaveToSchematicFile = { Params = "FileName", Return = "", Notes = "Saves the current contents to a schematic file. Returns true if successful." }, + SaveToSchematicString = { Params = "", Return = "string", Notes = "Saves the current contents to a string (in a .schematic file format). Returns the data if successful, nil if failed." }, + SetBlockLight = { Params = "BlockX, BlockY, BlockZ, BlockLight", Return = "", Notes = "Sets the blocklight at the specified absolute coords" }, + SetBlockMeta = { Params = "BlockX, BlockY, BlockZ, BlockMeta", Return = "", Notes = "Sets the block meta at the specified absolute coords" }, + SetBlockSkyLight = { Params = "BlockX, BlockY, BlockZ, SkyLight", Return = "", Notes = "Sets the skylight at the specified absolute coords" }, + SetBlockType = { Params = "BlockX, BlockY, BlockZ, BlockType", Return = "", Notes = "Sets the block type at the specified absolute coords" }, + SetBlockTypeMeta = { Params = "BlockX, BlockY, BlockZ, BlockType, BlockMeta", Return = "", Notes = "Sets the block type and meta at the specified absolute coords" }, + SetOrigin = + { + { Params = "{{Vector3i|Origin}}", Return = "", Notes = "Resets the origin for the absolute coords. Only affects how absolute coords are translated into relative coords." }, + { Params = "OriginX, OriginY, OriginZ", Return = "", Notes = "Resets the origin for the absolute coords. Only affects how absolute coords are translated into relative coords." }, + }, + SetRelBlockLight = { Params = "RelBlockX, RelBlockY, RelBlockZ, BlockLight", Return = "", Notes = "Sets the blocklight at the specified relative coords" }, + SetRelBlockMeta = { Params = "RelBlockX, RelBlockY, RelBlockZ, BlockMeta", Return = "", Notes = "Sets the block meta at the specified relative coords" }, + SetRelBlockSkyLight = { Params = "RelBlockX, RelBlockY, RelBlockZ, SkyLight", Return = "", Notes = "Sets the skylight at the specified relative coords" }, + SetRelBlockType = { Params = "RelBlockX, RelBlockY, RelBlockZ, BlockType", Return = "", Notes = "Sets the block type at the specified relative coords" }, + SetRelBlockTypeMeta = { Params = "RelBlockX, RelBlockY, RelBlockZ, BlockType, BlockMeta", Return = "", Notes = "Sets the block type and meta at the specified relative coords" }, + SetWEOffset = + { + { Params = "{{Vector3i|Offset}}", Return = "", Notes = "Sets the WE offset, a data value sometimes stored in the schematic files. Mostly used for WorldEdit. Cuberite doesn't use this value, but provides access to it using this method." }, + { Params = "OffsetX, OffsetY, OffsetZ", Return = "", Notes = "Sets the WE offset, a data value sometimes stored in the schematic files. Mostly used for WorldEdit. Cuberite doesn't use this value, but provides access to it using this method." }, + }, + Write = + { + { Params = "World, {{Vector3i|MinPoint}}, DataTypes", Return = "bool", Notes = "Writes the area into World at the specified coords, returns true if successful" }, + { Params = "World, MinX, MinY, MinZ, DataTypes", Return = "bool", Notes = "Writes the area into World at the specified coords, returns true if successful" }, + }, + }, + Constants = + { + baTypes = { Notes = "Operation should work on block types" }, + baMetas = { Notes = "Operations should work on block metas" }, + baLight = { Notes = "Operations should work on block (emissive) light" }, + baSkyLight = { Notes = "Operations should work on skylight" }, + msDifference = { Notes = "Block becomes air if 'self' and src are the same. Otherwise it becomes the src block." }, + msFillAir = { Notes = "'self' is overwritten by Src only where 'self' has air blocks" }, + msImprint = { Notes = "Src overwrites 'self' anywhere where 'self' has non-air blocks" }, + msLake = { Notes = "Special mode for merging lake images" }, + msMask = { Notes = "The blocks that are exactly the same are kept in 'self', all differing blocks are replaced by air"}, + msOverwrite = { Notes = "Src overwrites anything in 'self'" }, + msSimpleCompare = { Notes = "The blocks that are exactly the same are replaced with air, all differing blocks are replaced by stone"}, + msSpongePrint = { Notes = "Similar to msImprint, sponge block doesn't overwrite anything, all other blocks overwrite everything"}, + }, + ConstantGroups = + { + BATypes = + { + Include = "ba.*", + TextBefore = [[ + The following constants are used to signalize the datatype to read or write: + ]], + }, + MergeStrategies = + { + Include = "ms.*", + TextBefore = [[ + The Merge() function can use different strategies to combine the source and destination blocks. + The following constants are used: + ]], + TextAfter = "See below for a detailed explanation of the individual merge strategies.", + }, + }, + AdditionalInfo = + { + { + Header = "Merge strategies", + Contents = + [[ +

The strategy parameter specifies how individual blocks are combined together, using the table below. +

+ + + + + + + + + + + + + + + + + + + + + + +
area blockresult
this Src msOverwrite msFillAir msImprint
air air air air air
A air air A A
air B B B B
A B B A B
A A A A A
+ +

+ So to sum up: +

    +
  1. msOverwrite completely overwrites all blocks with the Src's blocks
  2. +
  3. msFillAir overwrites only those blocks that were air
  4. +
  5. msImprint overwrites with only those blocks that are non-air
  6. +
+

+ +

Special strategies

+

For each strategy, evaluate the table rows from top downwards, the first match wins.

+ +

+ msDifference - changes all the blocks which are the same to air. Otherwise the source block gets placed. +

+ + + + + + + +
area block Notes
* B B The blocks are different so we use block B
B B Air The blocks are the same so we get air.
+ + +

+ msLake - used for merging areas with lava and water lakes, in the appropriate generator. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
area block Notes
self Src result
A sponge A Sponge is the NOP block
* air air Air always gets hollowed out, even under the oceans
water * water Water is never overwritten
lava * lava Lava is never overwritten
* water water Water always overwrites anything
* lava lava Lava always overwrites anything
dirt stone stone Stone overwrites dirt
grass stone stone ... and grass
mycelium stone stone ... and mycelium
A stone A ... but nothing else
A * A Everything else is left as it is
+ +

+ msSpongePrint - used for most prefab-generators to merge the prefabs. Similar to + msImprint, but uses the sponge block as the NOP block instead, so that the prefabs may carve out air + pockets, too. +

+ + + + + + + + + +
area block Notes
self Src result
A sponge A Sponge is the NOP block
* B B Everything else overwrites anything
+ +

+ msMask - the blocks that are the same in the other area are kept, all the + differing blocks are replaced with air. Meta is used in the comparison, too, two blocks of the + same type but different meta are considered different and thus replaced with air. +

+ + + + + + + + + +
area block Notes
self Src result
A A A Same blocks are kept
A non-A air Differing blocks are replaced with air
+ +

+ msDifference - the blocks that are the same in both areas are replaced with air, all the + differing blocks are kept from the first area. Meta is used in the comparison, too, two blocks of the + same type but different meta are considered different. +

+ + + + + + + + + +
area block Notes
self Src result
A A air Same blocks are replaced with air
A non-A A Differing blocks are kept from 'self'
+ +

+ msSimpleCompare - the blocks that are the same in both areas are replaced with air, all the + differing blocks are replaced with stone. Meta is used in the comparison, too, two blocks of the + same type but different meta are considered different. +

+ + + + + + + + + +
area block Notes
self Src result
A A air Same blocks are replaced with air
A non-A stone Differing blocks are replaced with stone
+]], + }, -- Merge strategies + }, -- AdditionalInfo + }, -- cBlockArea + + cBlockInfo = + { + Desc = [[ + This class is used to query and register block properties. + ]], + Functions = + { + CanBeTerraformed = { Params = "Type", Return = "bool", Notes = "(STATIC) Returns true if the block is suitable to be changed by a generator" }, + FullyOccupiesVoxel = { Params = "Type", Return = "bool", Notes = "(STATIC) Returns whether the specified block fully occupies its voxel." }, + Get = { Params = "Type", Return = "{{cBlockInfo}}", Notes = "(STATIC) Returns the {{cBlockInfo}} structure for the specified type." }, + GetLightValue = { Params = "Type", Return = "number", Notes = "(STATIC) Returns how much light the specified block emits on its own." }, + GetPlaceSound = { Params = "Type", Return = "", Notes = "(STATIC) Returns the name of the sound that is played when placing the block." }, + GetSpreadLightFalloff = { Params = "Type", Return = "number", Notes = "(STATIC) Returns how much light the specified block consumes." }, + IsOneHitDig = { Params = "Type", Return = "bool", Notes = "(STATIC) Returns whether the specified block will be destroyed after a single hit." }, + IsPistonBreakable = { Params = "Type", Return = "bool", Notes = "(STATIC) Returns whether a piston can break the specified block." }, + IsSnowable = { Params = "Type", Return = "bool", Notes = "(STATIC) Returns whether the specified block can hold snow atop." }, + IsSolid = { Params = "Type", Return = "bool", Notes = "(STATIC) Returns whether the specified block is solid." }, + IsTransparent = { Params = "Type", Return = "bool", Notes = "(STATIC) Returns whether the specified block is transparent." }, + RequiresSpecialTool = { Params = "Type", Return = "bool", Notes = "(STATIC) Returns whether the specified block requires a special tool to drop." }, + }, + Variables = + { + m_CanBeTerraformed = { Type = "bool", Notes = "Is this block suited to be terraformed?" }, + m_FullyOccupiesVoxel = { Type = "bool", Notes = "Does this block fully occupy its voxel - is it a 'full' block?" }, + m_IsSnowable = { Type = "bool", Notes = "Can this block hold snow atop?" }, + m_IsSolid = { Type = "bool", Notes = "Is this block solid (player cannot walk through)?" }, + m_LightValue = { Type = "number", Notes = "How much light do the blocks emit on their own?" }, + m_OneHitDig = { Type = "bool", Notes = "Is a block destroyed after a single hit?" }, + m_PistonBreakable = { Type = "bool", Notes = "Can a piston break this block?" }, + m_PlaceSound = { Type = "string", Notes = "The name of the sound that is placed when a block is placed." }, + m_RequiresSpecialTool = { Type = "bool", Notes = "Does this block require a tool to drop?" }, + m_SpreadLightFalloff = { Type = "number", Notes = "How much light do the blocks consume?" }, + m_Transparent = { Type = "bool", Notes = "Is a block completely transparent? (light doesn't get decreased(?))" }, + }, + }, -- cBlockInfo + + cChatColor = + { + Desc = [[ + A wrapper class for constants representing colors or effects. + ]], + + Functions = {}, + Constants = + { + Black = { Notes = "" }, + Blue = { Notes = "" }, + Bold = { Notes = "" }, + Color = { Notes = "The first character of the color-code-sequence, �" }, + DarkPurple = { Notes = "" }, + Delimiter = { Notes = "The first character of the color-code-sequence, �" }, + Gold = { Notes = "" }, + Gray = { Notes = "" }, + Green = { Notes = "" }, + Italic = { Notes = "" }, + LightBlue = { Notes = "" }, + LightGray = { Notes = "" }, + LightGreen = { Notes = "" }, + LightPurple = { Notes = "" }, + Navy = { Notes = "" }, + Plain = { Notes = "Resets all formatting to normal" }, + Purple = { Notes = "" }, + Random = { Notes = "Random letters and symbols animate instead of the text" }, + Red = { Notes = "" }, + Rose = { Notes = "" }, + Strikethrough = { Notes = "" }, + Underlined = { Notes = "" }, + White = { Notes = "" }, + Yellow = { Notes = "" }, + }, + }, + + cChunkDesc = + { + Desc = [[ + The cChunkDesc class is a container for chunk data while the chunk is being generated. As such, it is + only used as a parameter for the {{OnChunkGenerating|OnChunkGenerating}} and + {{OnChunkGenerated|OnChunkGenerated}} hooks and cannot be constructed on its own. Plugins can use this + class in both those hooks to manipulate generated chunks. + ]], + + Functions = + { + FillBlocks = { Params = "BlockType, BlockMeta", Return = "", Notes = "Fills the entire chunk with the specified blocks" }, + FillRelCuboid = + { + { Params = "{{cCuboid|RelCuboid}}, BlockType, BlockMeta", Return = "", Notes = "Fills the cuboid, specified in relative coords, by the specified block type and block meta. The cuboid may reach outside of the chunk, only the part intersecting with this chunk is filled." }, + { Params = "MinRelX, MaxRelX, MinRelY, MaxRelY, MinRelZ, MaxRelZ, BlockType, BlockMeta", Return = "", Notes = "Fills the cuboid, specified in relative coords, by the specified block type and block meta. The cuboid may reach outside of the chunk, only the part intersecting with this chunk is filled." }, + }, + FloorRelCuboid = + { + { Params = "{{cCuboid|RelCuboid}}, BlockType, BlockMeta", Return = "", Notes = "Fills those blocks of the cuboid (specified in relative coords) that are considered non-floor (air, water) with the specified block type and meta. Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled." }, + { Params = "MinRelX, MaxRelX, MinRelY, MaxRelY, MinRelZ, MaxRelZ, BlockType, BlockMeta", Return = "", Notes = "Fills those blocks of the cuboid (specified in relative coords) that are considered non-floor (air, water) with the specified block type and meta. Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled." }, + }, + GetBiome = { Params = "RelX, RelZ", Return = "EMCSBiome", Notes = "Returns the biome at the specified relative coords" }, + GetBlockEntity = { Params = "RelX, RelY, RelZ", Return = "{{cBlockEntity}} descendant", Notes = "Returns the block entity for the block at the specified coords. Creates it if it doesn't exist. Returns nil if the block has no block entity capability." }, + GetBlockMeta = { Params = "RelX, RelY, RelZ", Return = "NIBBLETYPE", Notes = "Returns the block meta at the specified relative coords" }, + GetBlockType = { Params = "RelX, RelY, RelZ", Return = "BLOCKTYPE", Notes = "Returns the block type at the specified relative coords" }, + GetBlockTypeMeta = { Params = "RelX, RelY, RelZ", Return = "BLOCKTYPE, NIBBLETYPE", Notes = "Returns the block type and meta at the specified relative coords" }, + GetChunkX = { Params = "", Return = "number", Notes = "Returns the X coord of the chunk contained." }, + GetChunkZ = { Params = "", Return = "number", Notes = "Returns the Z coord of the chunk contained." }, + GetHeight = { Params = "RelX, RelZ", Return = "number", Notes = "Returns the height at the specified relative coords" }, + GetMaxHeight = { Params = "", Return = "number", Notes = "Returns the maximum height contained in the heightmap." }, + GetMinHeight = { Params = "", Return = "number", Notes = "Returns the minimum height value in the heightmap." }, + IsUsingDefaultBiomes = { Params = "", Return = "bool", Notes = "Returns true if the chunk is set to use default biome generator" }, + IsUsingDefaultComposition = { Params = "", Return = "bool", Notes = "Returns true if the chunk is set to use default composition generator" }, + IsUsingDefaultFinish = { Params = "", Return = "bool", Notes = "Returns true if the chunk is set to use default finishers" }, + IsUsingDefaultHeight = { Params = "", Return = "bool", Notes = "Returns true if the chunk is set to use default height generator" }, + IsUsingDefaultStructures = { Params = "", Return = "bool", Notes = "Returns true if the chunk is set to use default structures" }, + RandomFillRelCuboid = + { + { Params = "{{cCuboid|RelCuboid}}, BlockType, BlockMeta, RandomSeed, ChanceOutOf10k", Return = "", Notes = "Fills the specified relative cuboid with block type and meta in random locations. RandomSeed is used for the random number genertion (same seed produces same results); ChanceOutOf10k specifies the density (how many out of every 10000 blocks should be filled). Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled." }, + { Params = "MinRelX, MaxRelX, MinRelY, MaxRelY, MinRelZ, MaxRelZ, BlockType, BlockMeta, RandomSeed, ChanceOutOf10k", Return = "", Notes = "Fills the specified relative cuboid with block type and meta in random locations. RandomSeed is used for the random number genertion (same seed produces same results); ChanceOutOf10k specifies the density (how many out of every 10000 blocks should be filled). Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled." }, + }, + ReadBlockArea = { Params = "{{cBlockArea|BlockArea}}, MinRelX, MaxRelX, MinRelY, MaxRelY, MinRelZ, MaxRelZ", Return = "", Notes = "Reads data from the chunk into the block area object. Block types and metas are processed." }, + ReplaceRelCuboid = + { + { Params = "{{cCuboid|RelCuboid}}, SrcType, SrcMeta, DstType, DstMeta", Return = "", Notes = "Replaces all SrcType+SrcMeta blocks in the cuboid (specified in relative coords) with DstType+DstMeta blocks. Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled." }, + { Params = "MinRelX, MaxRelX, MinRelY, MaxRelY, MinRelZ, MaxRelZ, SrcType, SrcMeta, DstType, DstMeta", Return = "", Notes = "Replaces all SrcType+SrcMeta blocks in the cuboid (specified in relative coords) with DstType+DstMeta blocks. Cuboid may reach outside the chunk, only the part intersecting with this chunk is filled." }, + }, + SetBiome = { Params = "RelX, RelZ, EMCSBiome", Return = "", Notes = "Sets the biome at the specified relative coords" }, + SetBlockMeta = { Params = "RelX, RelY, RelZ, BlockMeta", Return = "", Notes = "Sets the block meta at the specified relative coords" }, + SetBlockType = { Params = "RelX, RelY, RelZ, BlockType", Return = "", Notes = "Sets the block type at the specified relative coords" }, + SetBlockTypeMeta = { Params = "RelX, RelY, RelZ, BlockType, BlockMeta", Return = "", Notes = "Sets the block type and meta at the specified relative coords" }, + SetHeight = { Params = "RelX, RelZ, Height", Return = "", Notes = "Sets the height at the specified relative coords" }, + SetUseDefaultBiomes = { Params = "bool", Return = "", Notes = "Sets the chunk to use default biome generator or not" }, + SetUseDefaultComposition = { Params = "bool", Return = "", Notes = "Sets the chunk to use default composition generator or not" }, + SetUseDefaultFinish = { Params = "bool", Return = "", Notes = "Sets the chunk to use default finishers or not" }, + SetUseDefaultHeight = { Params = "bool", Return = "", Notes = "Sets the chunk to use default height generator or not" }, + SetUseDefaultStructures = { Params = "bool", Return = "", Notes = "Sets the chunk to use default structures or not" }, + UpdateHeightmap = { Params = "", Return = "", Notes = "Updates the heightmap to match current contents. The plugins should do that if they modify the contents and don't modify the heightmap accordingly; Cuberite expects (and checks in Debug mode) that the heightmap matches the contents when the cChunkDesc is returned from a plugin." }, + WriteBlockArea = { Params = "{{cBlockArea|BlockArea}}, MinRelX, MinRelY, MinRelZ", Return = "", Notes = "Writes data from the block area into the chunk" }, + }, + AdditionalInfo = + { + { + Header = "Manipulating block entities", + Contents = [[ + To manipulate block entities while the chunk is generated, first use SetBlockTypeMeta() to set + the correct block type and meta at the position. Then use the GetBlockEntity() to create and + return the correct block entity instance. Finally, use {{tolua}}.cast() to cast to the proper + type.

+ Note that you don't need to check if a block entity has previously existed at the place, because + GetBlockEntity() will automatically re-create the correct type for you.

+

+ The following code is taken from the Debuggers plugin, it creates a sign at each chunk's [0, 0] + coords, with the text being the chunk coords: +

+function OnChunkGenerated(a_World, a_ChunkX, a_ChunkZ, a_ChunkDesc)
+	-- Get the topmost block coord:
+	local Height = a_ChunkDesc:GetHeight(0, 0);
+
+	-- Create a sign there:
+	a_ChunkDesc:SetBlockTypeMeta(0, Height + 1, 0, E_BLOCK_SIGN_POST, 0);
+	local BlockEntity = a_ChunkDesc:GetBlockEntity(0, Height + 1, 0);
+	if (BlockEntity ~= nil) then
+		LOG("Setting sign lines...");
+		local SignEntity = tolua.cast(BlockEntity, "cSignEntity");
+		SignEntity:SetLines("Chunk:", tonumber(a_ChunkX) .. ", " .. tonumber(a_ChunkZ), "", "(Debuggers)");
+	end
+
+	-- Update the heightmap:
+	a_ChunkDesc:SetHeight(0, 0, Height + 1);
+end
+
+ ]], + }, + }, -- AdditionalInfo + }, -- cChunkDesc + + cClientHandle = + { + Desc = [[ + A cClientHandle represents the technical aspect of a connected player - their game client + connection. Internally, it handles all the incoming and outgoing packets, the chunks that are to be + sent to the client, ping times etc. + ]], + + Functions = + { + GenerateOfflineUUID = { Params = "Username", Return = "string", Notes = "(STATIC) Generates an UUID based on the player name provided. This is used for the offline (non-auth) mode, when there's no UUID source. Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same. Returns a 32-char UUID (no dashes)." }, + GetClientBrand = { Params = "", Return = "string", Notes = "Returns the brand that the client has sent in their MC|Brand plugin message." }, + GetIPString = { Params = "", Return = "string", Notes = "Returns the IP address of the connection, as a string. Only the address part is returned, without the port number." }, + GetLocale = { Params = "", Return = "Locale", Notes = "Returns the locale string that the client sends as part of the protocol handshake. Can be used to provide localized strings." }, + GetPing = { Params = "", Return = "number", Notes = "Returns the ping time, in ms" }, + GetPlayer = { Params = "", Return = "{{cPlayer|cPlayer}}", Notes = "Returns the player object connected to this client. Note that this may be nil, for example if the player object is not yet spawned." }, + GetProtocolVersion = { Params = "", Return = "number", Notes = "Returns the protocol version number of the protocol that the client is talking. Returns zero if the protocol version is not (yet) known." }, + GetUniqueID = { Params = "", Return = "number", Notes = "Returns the UniqueID of the client used to identify the client in the server" }, + GetUUID = { Params = "", Return = "string", Notes = "Returns the authentication-based UUID of the client. This UUID should be used to identify the player when persisting any player-related data. Returns a 32-char UUID (no dashes)" }, + GetUsername = { Params = "", Return = "string", Notes = "Returns the username that the client has provided" }, + GetViewDistance = { Params = "", Return = "number", Notes = "Returns the viewdistance (number of chunks loaded for the player in each direction)" }, + GetRequestedViewDistance = { Params = "", Return = "number", Notes = "Returns the view distance that the player request, not the used view distance." }, + HasPluginChannel = { Params = "ChannelName", Return = "bool", Notes = "Returns true if the client has registered to receive messages on the specified plugin channel." }, + IsUUIDOnline = { Params = "UUID", Return = "bool", Notes = "(STATIC) Returns true if the UUID is generated by online auth, false if it is an offline-generated UUID. We use Version-3 UUIDs for offline UUIDs, online UUIDs are Version-4, thus we can tell them apart. Accepts both 32-char and 36-char UUIDs (with and without dashes). If the string given is not a valid UUID, returns false."}, + Kick = { Params = "Reason", Return = "", Notes = "Kicks the user with the specified reason" }, + SendPluginMessage = { Params = "Channel, Message", Return = "", Notes = "Sends the plugin message on the specified channel." }, + SetClientBrand = { Params = "ClientBrand", Return = "", Notes = "Sets the value of the client's brand. Normally this value is received from the client by a MC|Brand plugin message, this function lets plugins overwrite the value." }, + SetLocale = { Params = "Locale", Return = "", Notes = "Sets the locale that Cuberite keeps on record. Initially the locale is initialized in protocol handshake, this function allows plugins to override the stored value (but only server-side and only until the user disconnects)." }, + SetUsername = { Params = "Name", Return = "", Notes = "Sets the username" }, + SetViewDistance = { Params = "ViewDistance", Return = "", Notes = "Sets the viewdistance (number of chunks loaded for the player in each direction)" }, + SendBlockChange = { Params = "BlockX, BlockY, BlockZ, BlockType, BlockMeta", Return = "", Notes = "Sends a BlockChange packet to the client. This can be used to create fake blocks only for that player." }, + SendEntityAnimation = { Params = "{{cEntity|Entity}}, AnimationNumber", Return = "", Notes = "Sends the specified animation of the specified entity to the client. The AnimationNumber is protocol-specific." }, + SendSoundEffect = { Params = "SoundName, X, Y, Z, Volume, Pitch", Return = "", Notes = "Sends a sound effect request to the client. The sound is played at the specified coords, with the specified volume (a float, 1.0 is full volume, can be more) and pitch (0-255, 63 is 100%)" }, + SendTimeUpdate = { Params = "WorldAge, TimeOfDay, DoDaylightCycle", Return = "", Notes = "Sends the specified time update to the client. WorldAge is the total age of the world, in ticks. TimeOfDay is the current day's time, in ticks (0 - 24000). DoDaylightCycle is a bool that specifies whether the client should automatically move the sun (true) or keep it in the same place (false)." }, + }, + Constants = + { + MAX_VIEW_DISTANCE = { Notes = "The maximum value of the view distance" }, + MIN_VIEW_DISTANCE = { Notes = "The minimum value of the view distance" }, + }, + }, -- cClientHandle + + cCompositeChat = + { + Desc = [[ + Encapsulates a chat message that can contain various formatting, URLs, commands executed on click + and commands suggested on click. The chat message can be sent by the regular chat-sending functions, + {{cPlayer}}:SendMessage(), {{cWorld}}:BroadcastChat() and {{cRoot}}:BroadcastChat().

+

+ Note that most of the functions in this class are so-called chaining modifiers - they modify the + object and then return the object itself, so that they can be chained one after another. See the + Chaining example below for details.

+

+ Each part of the composite chat message takes a "Style" parameter, this is a string that describes + the formatting. It uses the following strings, concatenated together: + + + + + + + + +
StringStyle
bBold text
iItalic text
uUnderlined text
sStrikethrough text
oObfuscated text
@Xcolor X (X is 0 - 9 or a - f, same as dye meta
+ The following picture, taken from MineCraft Wiki, illustrates the color codes:

+ + ]], + Functions = + { + constructor = + { + { Params = "", Return = "", Notes = "Creates an empty chat message" }, + { Params = "Text", Return = "", Notes = "Creates a chat message containing the specified text, parsed by the ParseText() function. This allows easy migration from old chat messages." }, + }, + AddRunCommandPart = { Params = "Text, Command, [Style]", Return = "self", Notes = "Adds a text which, when clicked, runs the specified command. Chaining." }, + AddShowAchievementPart = { Params = "PlayerName, AchievementName, [Style]", Return = "", Notes = "Adds a text that represents the 'Achievement get' message." }, + AddSuggestCommandPart = { Params = "Text, Command, [Style]", Return = "self", Notes = "Adds a text which, when clicked, puts the specified command into the player's chat input area. Chaining." }, + AddTextPart = { Params = "Text, [Style]", Return = "self", Notes = "Adds a regular text. Chaining." }, + AddUrlPart = { Params = "Text, Url, [Style]", Return = "self", Notes = "Adds a text which, when clicked, opens up a browser at the specified URL. Chaining." }, + Clear = { Params = "", Return = "", Notes = "Removes all parts from this object" }, + CreateJsonString = { Params = "[AddPrefixes]", Return = "string", Notes = "Returns the entire object serialized into JSON, as it would be sent to a client. AddPrefixes specifies whether the chat prefixes should be prepended to the message, true by default." }, + ExtractText = { Params = "", Return = "string", Notes = "Returns the text from the parts that comprises the human-readable data. Used for older protocols that don't support composite chat and for console-logging." }, + GetAdditionalMessageTypeData = { Params = "", Return = "string", Notes = "Returns the AdditionalData associated with the message, such as the sender's name for mtPrivateMessage" }, + GetMessageType = { Params = "", Return = "MessageType", Notes = "Returns the MessageType (mtXXX constant) that is associated with this message. When sent to a player, the message will be formatted according to this message type and the player's settings (adding \"[INFO]\" prefix etc.)" }, + ParseText = { Params = "Text", Return = "self", Notes = "Adds text, while recognizing http and https URLs and old-style formatting codes (\"@2\"). Chaining." }, + SetMessageType = { Params = "MessageType, AdditionalData", Return = "self", Notes = "Sets the MessageType (mtXXX constant) that is associated with this message. Also sets the additional data (string) associated with the message, which is specific for the message type - such as the sender's name for mtPrivateMessage. When sent to a player, the message will be formatted according to this message type and the player's settings (adding \"[INFO]\" prefix etc.). Chaining." }, + UnderlineUrls = { Params = "", Return = "self", Notes = "Makes all URL parts contained in the message underlined. Doesn't affect parts added in the future. Chaining." }, + }, + + AdditionalInfo = + { + { + Header = "Chaining example", + Contents = [[ + Sending a chat message that is composed of multiple different parts has been made easy thanks to + chaining. Consider the following example that shows how a message containing all kinds of parts + is sent (adapted from the Debuggers plugin): +
+function OnPlayerJoined(a_Player)
+	-- Send an example composite chat message to the player:
+	a_Player:SendMessage(cCompositeChat()
+		:AddTextPart("Hello, ")
+		:AddUrlPart(a_Player:GetName(), "http://www.mc-server.org", "u@2")  -- Colored underlined link
+		:AddSuggestCommandPart(", and welcome.", "/help", "u")       -- Underlined suggest-command
+		:AddRunCommandPart(" SetDay", "/time set 0")                 -- Regular text that will execute command when clicked
+		:SetMessageType(mtJoin)                                      -- It is a join-message
+	)
+end
+ ]], + }, + }, -- AdditionalInfo + }, -- cCompositeChat + + cCraftingGrid = + { + Desc = [[ + cCraftingGrid represents the player's crafting grid. It is used in + {{OnCraftingNoRecipe|OnCraftingNoRecipe}}, {{OnPostCrafting|OnPostCrafting}} and + {{OnPreCrafting|OnPreCrafting}} hooks. Plugins may use it to inspect the items the player placed + on their crafting grid.

+

+ Also, an object of this type is used in {{cCraftingRecipe}}'s ConsumeIngredients() function for + specifying the exact number of ingredients to consume in that recipe; plugins may use this to + apply the crafting recipe.

+ ]], + + Functions = + { + constructor = { Params = "Width, Height", Return = "cCraftingGrid", Notes = "Creates a new CraftingGrid object. This new crafting grid is not related to any player, but may be needed for {{cCraftingRecipe}}'s ConsumeIngredients function." }, + Clear = { Params = "", Return = "", Notes = "Clears the entire grid" }, + ConsumeGrid = { Params = "{{cCraftingGrid|CraftingGrid}}", Return = "", Notes = "Consumes items specified in CraftingGrid from the current contents. Used internally by {{cCraftingRecipe}}'s ConsumeIngredients() function, but available to plugins, too." }, + Dump = { Params = "", Return = "", Notes = "DEBUG build: Dumps the contents of the grid to the log. RELEASE build: no action" }, + GetHeight = { Params = "", Return = "number", Notes = "Returns the height of the grid" }, + GetItem = { Params = "x, y", Return = "{{cItem|cItem}}", Notes = "Returns the item at the specified coords" }, + GetWidth = { Params = "", Return = "number", Notes = "Returns the width of the grid" }, + SetItem = + { + { Params = "x, y, {{cItem|cItem}}", Return = "", Notes = "Sets the item at the specified coords" }, + { Params = "x, y, ItemType, ItemCount, ItemDamage", Return = "", Notes = "Sets the item at the specified coords" }, + }, + }, + }, -- cCraftingGrid + + cCraftingRecipe = + { + Desc = [[ + This class is used to represent a crafting recipe, either a built-in one, or one created dynamically in a plugin. It is used only as a parameter for {{OnCraftingNoRecipe|OnCraftingNoRecipe}}, {{OnPostCrafting|OnPostCrafting}} and {{OnPreCrafting|OnPreCrafting}} hooks. Plugins may use it to inspect or modify a crafting recipe that a player views in their crafting window, either at a crafting table or the survival inventory screen. +

+

Internally, the class contains a {{cCraftingGrid}} for the ingredients and a {{cItem}} for the result. +]], + Functions = + { + Clear = { Params = "", Return = "", Notes = "Clears the entire recipe, both ingredients and results" }, + ConsumeIngredients = { Params = "CraftingGrid", Return = "", Notes = "Consumes ingredients specified in the given {{cCraftingGrid|cCraftingGrid}} class" }, + Dump = { Params = "", Return = "", Notes = "DEBUG build: dumps ingredients and result into server log. RELEASE build: no action" }, + GetIngredient = { Params = "x, y", Return = "{{cItem|cItem}}", Notes = "Returns the ingredient stored in the recipe at the specified coords" }, + GetIngredientsHeight = { Params = "", Return = "number", Notes = "Returns the height of the ingredients' grid" }, + GetIngredientsWidth = { Params = "", Return = "number", Notes = "Returns the width of the ingredients' grid" }, + GetResult = { Params = "", Return = "{{cItem|cItem}}", Notes = "Returns the result of the recipe" }, + SetIngredient = + { + { Params = "x, y, {{cItem|cItem}}", Return = "", Notes = "Sets the ingredient at the specified coords" }, + { Params = "x, y, ItemType, ItemCount, ItemDamage", Return = "", Notes = "Sets the ingredient at the specified coords" }, + }, + SetResult = + { + { Params = "{{cItem|cItem}}", Return = "", Notes = "Sets the result item" }, + { Params = "ItemType, ItemCount, ItemDamage", Return = "", Notes = "Sets the result item" }, + }, + }, + }, -- cCraftingRecipe + + cCryptoHash = + { + Desc = + [[ + Provides functions for generating cryptographic hashes.

+

+ Note that all functions in this class are static, so they should be called in the dot convention: +

+local Hash = cCryptoHash.sha1HexString("DataToHash")
+

+

Each cryptographic hash has two variants, one returns the hash as a raw binary string, the other returns the hash as a hex-encoded string twice as long as the binary string. + ]], + + Functions = + { + md5 = { Params = "Data", Return = "string", Notes = "(STATIC) Calculates the md5 hash of the data, returns it as a raw (binary) string of 16 characters." }, + md5HexString = { Params = "Data", Return = "string", Notes = "(STATIC) Calculates the md5 hash of the data, returns it as a hex-encoded string of 32 characters." }, + sha1 = { Params = "Data", Return = "string", Notes = "(STATIC) Calculates the sha1 hash of the data, returns it as a raw (binary) string of 20 characters." }, + sha1HexString = { Params = "Data", Return = "string", Notes = "(STATIC) Calculates the sha1 hash of the data, returns it as a hex-encoded string of 40 characters." }, + }, + }, -- cCryptoHash + + cEnchantments = + { + Desc = [[ + This class is the storage for enchantments for a single {{cItem|cItem}} object, through its + m_Enchantments member variable. Although it is possible to create a standalone object of this class, + it is not yet used in any API directly.

+

+ Enchantments can be initialized either programmatically by calling the individual functions + (SetLevel()), or by using a string description of the enchantment combination. This string + description is in the form "id=lvl;id=lvl;...;id=lvl;", where id is either a numerical ID of the + enchantment, or its textual representation from the table below, and lvl is the desired enchantment + level. The class can also create its string description from its current contents; however that + string description will only have the numerical IDs.

+

+ See the {{cItem}} class for usage examples. + ]], + Functions = + { + constructor = + { + { Params = "", Return = "cEnchantments", Notes = "Creates a new empty cEnchantments object" }, + { Params = "StringSpec", Return = "cEnchantments", Notes = "Creates a new cEnchantments object filled with enchantments based on the string description" }, + }, + operator_eq = { Params = "OtherEnchantments", Return = "bool", Notes = "Returns true if this enchantments object has the same enchantments as OtherEnchantments." }, + AddFromString = { Params = "StringSpec", Return = "", Notes = "Adds the enchantments in the string description into the object. If a specified enchantment already existed, it is overwritten." }, + Clear = { Params = "", Return = "", Notes = "Removes all enchantments" }, + GetLevel = { Params = "EnchantmentNumID", Return = "number", Notes = "Returns the level of the specified enchantment stored in this object; 0 if not stored" }, + IsEmpty = { Params = "", Return = "bool", Notes = "Returns true if the object stores no enchantments" }, + SetLevel = { Params = "EnchantmentNumID, Level", Return = "", Notes = "Sets the level for the specified enchantment, adding it if not stored before or removing it if level < = 0" }, + StringToEnchantmentID = { Params = "EnchantmentTextID", Return = "number", Notes = "(static) Returns the enchantment numerical ID, -1 if not understood. Case insensitive. Also understands plain numbers." }, + ToString = { Params = "", Return = "string", Notes = "Returns the string description of all the enchantments stored in this object, in numerical-ID form" }, + }, + Constants = + { + -- Only list these enchantment IDs, as they don't really need any kind of documentation: + enchAquaAffinity = { Notes = "" }, + enchBaneOfArthropods = { Notes = "" }, + enchBlastProtection = { Notes = "" }, + enchEfficiency = { Notes = "" }, + enchFeatherFalling = { Notes = "" }, + enchFireAspect = { Notes = "" }, + enchFireProtection = { Notes = "" }, + enchFlame = { Notes = "" }, + enchFortune = { Notes = "" }, + enchInfinity = { Notes = "" }, + enchKnockback = { Notes = "" }, + enchLooting = { Notes = "" }, + enchLuckOfTheSea = { Notes = "" }, + enchLure = { Notes = "" }, + enchPower = { Notes = "" }, + enchProjectileProtection = { Notes = "" }, + enchProtection = { Notes = "" }, + enchPunch = { Notes = "" }, + enchRespiration = { Notes = "" }, + enchSharpness = { Notes = "" }, + enchSilkTouch = { Notes = "" }, + enchSmite = { Notes = "" }, + enchThorns = { Notes = "" }, + enchUnbreaking = { Notes = "" }, + }, + }, + + cEntity = + { + Desc = [[ + A cEntity object represents an object in the world, it has a position and orientation. cEntity is an + abstract class, and can not be instantiated directly, instead, all entities are implemented as + subclasses. The cEntity class works as the common interface for the operations that all (most) + entities support.

+

+ All cEntity objects have an Entity Type so it can be determined what kind of entity it is + efficiently. Entities also have a class inheritance awareness, they know their class name, + their parent class' name and can decide if there is a class within their inheritance chain. + Since these functions operate on strings, they are slightly slower than checking the entity type + directly, on the other hand, they are more specific directly. To check if the entity is a spider, + you need to call IsMob(), then cast the object to {{cMonster}} and finally compare + {{cMonster}}:GetMonsterType() to mtSpider. GetClass(), on the other hand, returns "cSpider" + directly.

+

+ Note that you should not store a cEntity object between two hooks' calls, because Cuberite may + despawn / remove that entity in between the calls. If you need to refer to an entity later, use its + UniqueID and {{cWorld|cWorld}}'s entity manipulation functions DoWithEntityByID(), ForEachEntity() + or ForEachEntityInChunk() to access the entity again.

+ ]], + Functions = + { + AddPosition = + { + { Params = "OffsetX, OffsetY, OffsetZ", Return = "", Notes = "Moves the entity by the specified amount in each axis direction" }, + { Params = "{{Vector3d|Offset}}", Return = "", Notes = "Moves the entity by the specified amount in each direction" }, + }, + AddPosX = { Params = "OffsetX", Return = "", Notes = "Moves the entity by the specified amount in the X axis direction" }, + AddPosY = { Params = "OffsetY", Return = "", Notes = "Moves the entity by the specified amount in the Y axis direction" }, + AddPosZ = { Params = "OffsetZ", Return = "", Notes = "Moves the entity by the specified amount in the Z axis direction" }, + AddSpeed = + { + { Params = "AddX, AddY, AddZ", Return = "", Notes = "Adds the specified amount of speed in each axis direction." }, + { Params = "{{Vector3d|Add}}", Return = "", Notes = "Adds the specified amount of speed in each axis direction." }, + }, + AddSpeedX = { Params = "AddX", Return = "", Notes = "Adds the specified amount of speed in the X axis direction." }, + AddSpeedY = { Params = "AddY", Return = "", Notes = "Adds the specified amount of speed in the Y axis direction." }, + AddSpeedZ = { Params = "AddZ", Return = "", Notes = "Adds the specified amount of speed in the Z axis direction." }, + ArmorCoversAgainst = { Params = "{{cEntity|AttackerEntity}}, DamageType, RawDamage", Return = "number", Notes = "Returns the points out of a_RawDamage that the currently equipped armor would cover." }, + Destroy = { Params = "", Return = "", Notes = "Schedules the entity to be destroyed" }, + GetAirLevel = { Params = "", Return = "number", Notes = "Returns the air level (number of ticks of air left). Note, this function is only updated with mobs or players." }, + GetArmorCoverAgainst = { Params = "AttackerEntity, DamageType, RawDamage", Return = "number", Notes = "Returns the number of hitpoints out of RawDamage that the currently equipped armor would cover. See {{TakeDamageInfo}} for more information on attack damage." }, + GetChunkX = { Params = "", Return = "number", Notes = "Returns the X-coord of the chunk in which the entity is placed" }, + GetChunkZ = { Params = "", Return = "number", Notes = "Returns the Z-coord of the chunk in which the entity is placed" }, + GetClass = { Params = "", Return = "string", Notes = "Returns the classname of the entity, such as \"cSpider\" or \"cPickup\"" }, + GetClassStatic = { Params = "", Return = "string", Notes = "Returns the entity classname that this class implements. Each descendant overrides this function. Is static" }, + GetEntityType = { Params = "", Return = "{{cEntity#EntityType|EntityType}}", Notes = "Returns the type of the entity, one of the {{cEntity#EntityType|etXXX}} constants. Note that to check specific entity type, you should use one of the IsXXX functions instead of comparing the value returned by this call." }, + GetEquippedBoots = { Params = "", Return = "{{cItem}}", Notes = "Returns the boots that the entity has equipped. Returns an empty cItem if no boots equipped or not applicable." }, + GetEquippedChestplate = { Params = "", Return = "{{cItem}}", Notes = "Returns the chestplate that the entity has equipped. Returns an empty cItem if no chestplate equipped or not applicable." }, + GetEquippedHelmet = { Params = "", Return = "{{cItem}}", Notes = "Returns the helmet that the entity has equipped. Returns an empty cItem if no helmet equipped or not applicable." }, + GetEquippedLeggings = { Params = "", Return = "{{cItem}}", Notes = "Returns the leggings that the entity has equipped. Returns an empty cItem if no leggings equipped or not applicable." }, + GetEquippedWeapon = { Params = "", Return = "{{cItem}}", Notes = "Returns the weapon that the entity has equipped. Returns an empty cItem if no weapon equipped or not applicable." }, + GetGravity = { Params = "", Return = "number", Notes = "Returns the number that is used as the gravity for physics simulation. 1G (9.78) by default." }, + GetHeadYaw = { Params = "", Return = "number", Notes = "Returns the pitch of the entity's head (FIXME: Rename to GetHeadPitch() )." }, + GetHealth = { Params = "", Return = "number", Notes = "Returns the current health of the entity." }, + GetHeight = { Params = "", Return = "number", Notes = "Returns the height (Y size) of the entity" }, + GetInvulnerableTicks = { Params = "", Return = "number", Notes = "Returns the number of ticks that this entity will be invulnerable for. This is used for after-hit recovery - the entities are invulnerable for half a second after being hit." }, + GetKnockbackAmountAgainst = { Params = "ReceiverEntity", Return = "number", Notes = "Returns the amount of knockback that the currently equipped items would cause when attacking the ReceiverEntity." }, + GetLookVector = { Params = "", Return = "{{Vector3f}}", Notes = "Returns the vector that defines the direction in which the entity is looking" }, + GetMass = { Params = "", Return = "number", Notes = "Returns the mass of the entity. Currently unused." }, + GetMaxHealth = { Params = "", Return = "number", Notes = "Returns the maximum number of hitpoints this entity is allowed to have." }, + GetParentClass = { Params = "", Return = "string", Notes = "Returns the name of the direct parent class for this entity" }, + GetPitch = { Params = "", Return = "number", Notes = "Returns the pitch (nose-down rotation) of the entity. Measured in degrees, normal values range from -90 to +90. +90 means looking down, 0 means looking straight ahead, -90 means looking up." }, + GetPosition = { Params = "", Return = "{{Vector3d}}", Notes = "Returns the entity's pivot position as a 3D vector" }, + GetPosX = { Params = "", Return = "number", Notes = "Returns the X-coord of the entity's pivot" }, + GetPosY = { Params = "", Return = "number", Notes = "Returns the Y-coord of the entity's pivot" }, + GetPosZ = { Params = "", Return = "number", Notes = "Returns the Z-coord of the entity's pivot" }, + GetRawDamageAgainst = { Params = "ReceiverEntity", Return = "number", Notes = "Returns the raw damage that this entity's equipment would cause when attacking the ReceiverEntity. This includes this entity's weapon {{cEnchantments|enchantments}}, but excludes the receiver's armor or potion effects. See {{TakeDamageInfo}} for more information on attack damage." }, + GetRoll = { Params = "", Return = "number", Notes = "Returns the roll (sideways rotation) of the entity. Currently unused." }, + GetRot = { Params = "", Return = "{{Vector3f}}", Notes = "(OBSOLETE) Returns the entire rotation vector (Yaw, Pitch, Roll)" }, + GetSpeed = { Params = "", Return = "{{Vector3d}}", Notes = "Returns the complete speed vector of the entity" }, + GetSpeedX = { Params = "", Return = "number", Notes = "Returns the X-part of the speed vector" }, + GetSpeedY = { Params = "", Return = "number", Notes = "Returns the Y-part of the speed vector" }, + GetSpeedZ = { Params = "", Return = "number", Notes = "Returns the Z-part of the speed vector" }, + GetTicksAlive = { Params = "", Return = "number", Notes = "Returns the number of ticks that this entity has been alive for." }, + GetUniqueID = { Params = "", Return = "number", Notes = "Returns the ID that uniquely identifies the entity within the running server. Note that this ID is not persisted to the data files." }, + GetWidth = { Params = "", Return = "number", Notes = "Returns the width (X and Z size) of the entity." }, + GetWorld = { Params = "", Return = "{{cWorld}}", Notes = "Returns the world where the entity resides" }, + GetYaw = { Params = "", Return = "number", Notes = "Returns the yaw (direction) of the entity. Measured in degrees, values range from -180 to +180. 0 means ZP, 90 means XM, -180 means ZM, -90 means XP." }, + HandleSpeedFromAttachee = { Params = "ForwardAmount, SidewaysAmount", Return = "", Notes = "Updates the entity's speed based on the attachee exerting the specified force forward and sideways. Used for entities being driven by other entities attached to them - usually players driving minecarts and boats." }, + Heal = { Params = "Hitpoints", Return = "", Notes = "Heals the specified number of hitpoints. Hitpoints is expected to be a positive number." }, + IsA = { Params = "ClassName", Return = "bool", Notes = "Returns true if the entity class is a descendant of the specified class name, or the specified class itself" }, + IsBoat = { Params = "", Return = "bool", Notes = "Returns true if the entity is a {{cBoat|boat}}." }, + IsCrouched = { Params = "", Return = "bool", Notes = "Returns true if the entity is crouched. Always false for entities that don't support crouching." }, + IsDestroyed = { Params = "", Return = "bool", Notes = "Returns true if the entity has been destroyed and is awaiting removal from the internal structures." }, + IsEnderCrystal = { Params = "", Return = "bool", Notes = "Returns true if the entity is an ender crystal." }, + IsExpOrb = { Params = "", Return = "bool", Notes = "Returns true if the entity represents an experience orb" }, + IsFallingBlock = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cFallingBlock}} entity." }, + IsFireproof = { Params = "", Return = "bool", Notes = "Returns true if the entity takes no damage from being on fire." }, + IsFloater = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a fishing rod floater" }, + IsInvisible = { Params = "", Return = "bool", Notes = "Returns true if the entity is invisible" }, + IsItemFrame = { Params = "", Return = "bool", Notes = "Returns true if the entity is an item frame." }, + IsMinecart = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cMinecart|minecart}}" }, + IsMob = { Params = "", Return = "bool", Notes = "Returns true if the entity represents any {{cMonster|mob}}." }, + IsOnFire = { Params = "", Return = "bool", Notes = "Returns true if the entity is on fire" }, + IsOnGround = { Params = "", Return = "bool", Notes = "Returns true if the entity is on ground (not falling, not jumping, not flying)" }, + IsPainting = { Params = "", Return = "bool", Notes = "Returns if this entity is a painting." }, + IsPawn = { Params = "", Return = "bool", Notes = "Returns true if the entity is a {{cPawn}} descendant." }, + IsPickup = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cPickup|pickup}}." }, + IsPlayer = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cPlayer|player}}" }, + IsProjectile = { Params = "", Return = "bool", Notes = "Returns true if the entity is a {{cProjectileEntity}} descendant." }, + IsRclking = { Params = "", Return = "bool", Notes = "Currently unimplemented" }, + IsRiding = { Params = "", Return = "bool", Notes = "Returns true if the entity is attached to (riding) another entity." }, + IsSprinting = { Params = "", Return = "bool", Notes = "Returns true if the entity is sprinting. Entities that cannot sprint return always false" }, + IsSubmerged = { Params = "", Return = "bool", Notes = "Returns true if the mob or player is submerged in water (head is in a water block). Note, this function is only updated with mobs or players." }, + IsSwimming = { Params = "", Return = "bool", Notes = "Returns true if the mob or player is swimming in water (feet are in a water block). Note, this function is only updated with mobs or players." }, + IsTNT = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cTNTEntity|TNT entity}}" }, + Killed = { Params = "{{cEntity|Victim}}", Return = "", Notes = "This entity has killed another entity (the Victim). For players, adds the scoreboard statistics about the kill." }, + KilledBy = { Notes = "FIXME: Remove this from API" }, + MoveToWorld = + { + { Params = "{{cWorld|World}}, [ShouldSendRespawn]", Return = "bool", Notes = "Removes the entity from this world and starts moving it to the specified world. Note that to avoid deadlocks, the move is asynchronous - the entity is moved into a queue and will be moved from that queue into the destination world at some (unpredictable) time in the future. ShouldSendRespawn is used only for players, it specifies whether the player should be sent a Repawn packet upon leaving the world (The client handles respawns only between different dimensions)." }, + { Params = "WorldName, [ShouldSendRespawn]", Return = "bool", Notes = "Removes the entity from this world and starts moving it to the specified world. Note that to avoid deadlocks, the move is asynchronous - the entity is moved into a queue and will be moved from that queue into the destination world at some (unpredictable) time in the future. ShouldSendRespawn is used only for players, it specifies whether the player should be sent a Repawn packet upon leaving the world (The client handles respawns only between different dimensions)." }, + }, + SetGravity = { Params = "Gravity", Return = "", Notes = "Sets the number that is used as the gravity for physics simulation. 1G (9.78) by default." }, + SetHeadYaw = { Params = "HeadPitch", Return = "", Notes = "Sets the head pitch (FIXME: Rename to SetHeadPitch() )." }, + SetHealth = { Params = "Hitpoints", Return = "", Notes = "Sets the entity's health to the specified amount of hitpoints. Doesn't broadcast any hurt animation. Doesn't kill the entity if health drops below zero. Use the TakeDamage() function instead for taking damage." }, + SetHeight = { Params = "", Return = "", Notes = "FIXME: Remove this from API" }, + SetInvulnerableTicks = { Params = "NumTicks", Return = "", Notes = "Sets the amount of ticks for which the entity will not receive any damage from other entities." }, + SetIsFireproof = { Params = "IsFireproof", Return = "", Notes = "Sets whether the entity receives damage from being on fire." }, + SetMass = { Params = "Mass", Return = "", Notes = "Sets the mass of the entity. Currently unused." }, + SetMaxHealth = { Params = "MaxHitpoints", Return = "", Notes = "Sets the maximum hitpoints of the entity. If current health is above MaxHitpoints, it is capped to MaxHitpoints." }, + SetPitch = { Params = "number", Return = "", Notes = "Sets the pitch (nose-down rotation) of the entity" }, + SetPitchFromSpeed = { Params = "", Return = "", Notes = "Sets the entity pitch to match its speed (entity looking forwards as it moves)" }, + SetPosition = + { + { Params = "PosX, PosY, PosZ", Return = "", Notes = "Sets all three coords of the entity's pivot" }, + { Params = "{{Vector3d|Vector3d}}", Return = "", Notes = "Sets all three coords of the entity's pivot" }, + }, + SetPosX = { Params = "number", Return = "", Notes = "Sets the X-coord of the entity's pivot" }, + SetPosY = { Params = "number", Return = "", Notes = "Sets the Y-coord of the entity's pivot" }, + SetPosZ = { Params = "number", Return = "", Notes = "Sets the Z-coord of the entity's pivot" }, + SetRoll = { Params = "number", Return = "", Notes = "Sets the roll (sideways rotation) of the entity. Currently unused." }, + SetRot = { Params = "{{Vector3f|Rotation}}", Return = "", Notes = "Sets the entire rotation vector (Yaw, Pitch, Roll)" }, + SetYawFromSpeed = { Params = "", Return = "", Notes = "Sets the entity's yaw to match its current speed (entity looking forwards as it moves)." }, + SetSpeed = + { + { Params = "SpeedX, SpeedY, SpeedZ", Return = "", Notes = "Sets the current speed of the entity" }, + { Params = "{{Vector3d|Speed}}", Return = "", Notes = "Sets the current speed of the entity" }, + }, + SetSpeedX = { Params = "SpeedX", Return = "", Notes = "Sets the X component of the entity speed" }, + SetSpeedY = { Params = "SpeedY", Return = "", Notes = "Sets the Y component of the entity speed" }, + SetSpeedZ = { Params = "SpeedZ", Return = "", Notes = "Sets the Z component of the entity speed" }, + SetWidth = { Params = "", Return = "", Notes = "FIXME: Remove this from API" }, + SetYaw = { Params = "number", Return = "", Notes = "Sets the yaw (direction) of the entity." }, + StartBurning = { Params = "NumTicks", Return = "", Notes = "Sets the entity on fire for the specified number of ticks. If entity is on fire already, makes it burn for either NumTicks or the number of ticks left from the previous fire, whichever is larger." }, + SteerVehicle = { Params = "ForwardAmount, SidewaysAmount", Return = "", Notes = "Applies the specified steering to the vehicle this entity is attached to. Ignored if not attached to any entity." }, + StopBurning = { Params = "", Return = "", Notes = "Extinguishes the entity fire, cancels all fire timers." }, + TakeDamage = + { + { Params = "AttackerEntity", Return = "", Notes = "Causes this entity to take damage that AttackerEntity would inflict. Includes their weapon and this entity's armor." }, + { Params = "DamageType, AttackerEntity, RawDamage, KnockbackAmount", Return = "", Notes = "Causes this entity to take damage of the specified type, from the specified attacker (may be nil). The final damage is calculated from RawDamage using the currently equipped armor." }, + { Params = "DamageType, ArrackerEntity, RawDamage, FinalDamage, KnockbackAmount", Return = "", Notes = "Causes this entity to take damage of the specified type, from the specified attacker (may be nil). The values are wrapped into a {{TakeDamageInfo}} structure and applied directly." }, + }, + TeleportToCoords = { Params = "PosX, PosY, PosZ", Return = "", Notes = "Teleports the entity to the specified coords. Asks plugins if the teleport is allowed." }, + TeleportToEntity = { Params = "DestEntity", Return = "", Notes = "Teleports this entity to the specified destination entity. Asks plugins if the teleport is allowed." }, + }, + Constants = + { + etBoat = { Notes = "The entity is a {{cBoat}}" }, + etEnderCrystal = { Notes = "" }, + etEntity = { Notes = "No further specialization available" }, + etExpOrb = { Notes = "The entity is a {{cExpOrb}}" }, + etFallingBlock = { Notes = "The entity is a {{cFallingBlock}}" }, + etFloater = { Notes = "The entity is a fishing rod floater" }, + etItemFrame = { Notes = "" }, + etMinecart = { Notes = "The entity is a {{cMinecart}} descendant" }, + etMob = { Notes = "The entity is a {{cMonster}} descendant" }, + etMonster = { Notes = "The entity is a {{cMonster}} descendant" }, + etPainting = { Notes = "The entity is a {{cPainting}}" }, + etPickup = { Notes = "The entity is a {{cPickup}}" }, + etPlayer = { Notes = "The entity is a {{cPlayer}}" }, + etProjectile = { Notes = "The entity is a {{cProjectileEntity}} descendant" }, + etTNT = { Notes = "The entity is a {{cTNTEntity}}" }, + }, + ConstantGroups = + { + EntityType = + { + Include = "et.*", + TextBefore = "The following constants are used to distinguish between different entity types:", + }, + }, + }, + + cFile = + { + Desc = [[ + Provides helper functions for manipulating and querying the filesystem. Most functions are static, + so they should be called directly on the cFile class itself: +
+cFile:Delete("/usr/bin/virus.exe");
+

+ ]], + Functions = + { + ChangeFileExt = { Params = "FileName, NewExt", Return = "string", Notes = "(STATIC) Returns FileName with its extension changed to NewExt. NewExt may begin with a dot, but needn't, the result is the same in both cases (the first dot, if present, is ignored). FileName may contain path elements, extension is recognized as the last dot after the last path separator in the string." }, + Copy = { Params = "SrcFileName, DstFileName", Return = "bool", Notes = "(STATIC) Copies a single file to a new destination. Returns true if successful. Fails if the destination already exists." }, + CreateFolder = { Params = "FolderName", Return = "bool", Notes = "(STATIC) Creates a new folder. Returns true if successful." }, + Delete = { Params = "FileName", Return = "bool", Notes = "(STATIC) Deletes the specified file. Returns true if successful." }, + Exists = { Params = "FileName", Return = "bool", Notes = "(STATIC) Returns true if the specified file exists." }, + GetExecutableExt = { Params = "", Return = "string", Notes = "(STATIC) Returns the customary executable extension (including the dot) used by the current platform (\".exe\" on Windows, empty string on Linux). " }, + GetFolderContents = { Params = "FolderName", Return = "array table of strings", Notes = "(STATIC) Returns the contents of the specified folder, as an array table of strings. Each filesystem object is listed. Use the IsFile() and IsFolder() functions to determine the object type." }, + GetLastModificationTime = { Params = "Path", Return = "number", Notes = "(STATIC) Returns the last modification time (in current timezone) of the specified file or folder. Returns zero if file not found / not accessible. The returned value is in the same units as values returned by os.time()." }, + GetPathSeparator = { Params = "", Return = "string", Notes = "(STATIC) Returns the primary path separator used by the current platform. Returns \"\\\" on Windows and \"/\" on Linux. Note that the platform or CRT may support additional path separators, those are not reported." }, + GetSize = { Params = "FileName", Return = "number", Notes = "(STATIC) Returns the size of the file, or -1 on failure." }, + IsFile = { Params = "Path", Return = "bool", Notes = "(STATIC) Returns true if the specified path points to an existing file." }, + IsFolder = { Params = "Path", Return = "bool", Notes = "(STATIC) Returns true if the specified path points to an existing folder." }, + ReadWholeFile = { Params = "FileName", Return = "string", Notes = "(STATIC) Returns the entire contents of the specified file. Returns an empty string if the file cannot be opened." }, + Rename = { Params = "OrigPath, NewPath", Return = "bool", Notes = "(STATIC) Renames a file or a folder. Returns true if successful. Undefined result if NewPath already exists." }, + }, + }, -- cFile + + cFloater = + { + Desc = [[ + When a player uses his/her fishing rod it creates a floater entity. This class manages it. + ]], + Functions = + { + CanPickup = { Params = "", Return = "bool", Notes = "Returns true if the floater gives an item when the player right clicks." }, + GetAttachedMobID = { Params = "", Return = "EntityID", Notes = "A floater can get attached to an mob. When it is and this functions gets called it returns the mob ID. If it isn't attached to a mob it returns -1" }, + GetOwnerID = { Params = "", Return = "EntityID", Notes = "Returns the EntityID of the player who owns the floater." }, + }, + Inherits = "cEntity", + }, + + cIniFile = + { + Desc = [[ + This class implements a simple name-value storage represented on disk by an INI file. These files + are suitable for low-volume high-latency human-readable information storage, such as for + configuration. Cuberite itself uses INI files for settings and options.

+

+ The INI files follow this basic structure: +

+; Header comment line
+[KeyName0]
+; Key comment line 0
+ValueName0=Value0
+ValueName1=Value1
+
+[KeyName1]
+; Key comment line 0
+; Key comment line 1
+ValueName0=SomeOtherValue
+
+ The cIniFile object stores all the objects in numbered arrays and provides access to the information + either based on names (KeyName, ValueName) or zero-based indices.

+

+ The objects of this class are created empty. You need to either load a file using ReadFile(), or + insert values by hand. Then you can store the object's contents to a disk file using WriteFile(), or + just forget everything by destroying the object. Note that the file operations are quite slow.

+

+ For storing high-volume low-latency data, use the {{sqlite3}} class. For storing + hierarchically-structured data, use the XML format, using the LuaExpat parser in the {{lxp}} class. + ]], + Functions = + { + constructor = { Params = "", Return = "cIniFile", Notes = "Creates a new empty cIniFile object." }, + AddHeaderComment = { Params = "Comment", Return = "", Notes = "Adds a comment to be stored in the file header." }, + AddKeyComment = + { + { Params = "KeyID, Comment", Return = "", Notes = "Adds a comment to be stored in the file under the specified key" }, + { Params = "KeyName, Comment", Return = "", Notes = "Adds a comment to be stored in the file under the specified key" }, + }, + AddKeyName = { Params = "KeyName", Returns = "number", Notes = "Adds a new key of the specified name. Returns the KeyID of the new key." }, + AddValue = { Params = "KeyName, ValueName, Value", Return = "", Notes = "Adds a new value of the specified name to the specified key. If another value of the same name exists in the key, both are kept (nonstandard INI file)" }, + AddValueB = { Params = "KeyName, ValueName, Value", Return = "", Notes = "Adds a new bool value of the specified name to the specified key. If another value of the same name exists in the key, both are kept (nonstandard INI file)" }, + AddValueF = { Params = "KeyName, ValueName, Value", Return = "", Notes = "Adds a new float value of the specified name to the specified key. If another value of the same name exists in the key, both are kept (nonstandard INI file)" }, + AddValueI = { Params = "KeyName, ValueName, Value", Return = "", Notes = "Adds a new integer value of the specified name to the specified key. If another value of the same name exists in the key, both are kept (nonstandard INI file)" }, + CaseInsensitive = { Params = "", Return = "", Notes = "Sets key names' and value names' comparisons to case insensitive (default)." }, + CaseSensitive = { Params = "", Return = "", Notes = "Sets key names and value names comparisons to case sensitive." }, + Clear = { Params = "", Return = "", Notes = "Removes all the in-memory data. Note that , like all the other operations, this doesn't affect any file data." }, + DeleteHeaderComment = { Params = "CommentID", Return = "bool" , Notes = "Deletes the specified header comment. Returns true if successful."}, + DeleteHeaderComments = { Params = "", Return = "", Notes = "Deletes all headers comments." }, + DeleteKey = { Params = "KeyName", Return = "bool", Notes = "Deletes the specified key, and all values in that key. Returns true if successful." }, + DeleteKeyComment = + { + { Params = "KeyID, CommentID", Return = "bool", Notes = "Deletes the specified key comment. Returns true if successful." }, + { Params = "KeyName, CommentID", Return = "bool", Notes = "Deletes the specified key comment. Returns true if successful." }, + }, + DeleteKeyComments = + { + { Params = "KeyID", Return = "bool", Notes = "Deletes all comments for the specified key. Returns true if successful." }, + { Params = "KeyName", Return = "bool", Notes = "Deletes all comments for the specified key. Returns true if successful." }, + }, + DeleteValue = { Params = "KeyName, ValueName", Return = "bool", Notes = "Deletes the specified value. Returns true if successful." }, + DeleteValueByID = { Params = "KeyID, ValueID", Return = "bool", Notes = "Deletes the specified value. Returns true if successful." }, + FindKey = { Params = "KeyName", Return = "number", Notes = "Returns the KeyID for the specified key name, or the noID constant if the key doesn't exist." }, + FindValue = { Params = "KeyID, ValueName", Return = "numebr", Notes = "Returns the ValueID for the specified value name, or the noID constant if the specified key doesn't contain a value of that name." }, + GetHeaderComment = { Params = "CommentID", Return = "string", Notes = "Returns the specified header comment, or an empty string if such comment doesn't exist" }, + GetKeyComment = + { + { Params = "KeyID, CommentID", Return = "string", Notes = "Returns the specified key comment, or an empty string if such a comment doesn't exist" }, + { Params = "KeyName, CommentID", Return = "string", Notes = "Returns the specified key comment, or an empty string if such a comment doesn't exist" }, + }, + GetKeyName = { Params = "KeyID", Return = "string", Notes = "Returns the key name for the specified key ID. Inverse for FindKey()." }, + GetNumHeaderComments = { Params = "", Return = "number", Notes = "Retuns the number of header comments." }, + GetNumKeyComments = + { + { Params = "KeyID", Return = "number", Notes = "Returns the number of comments under the specified key" }, + { Params = "KeyName", Return = "number", Notes = "Returns the number of comments under the specified key" }, + }, + GetNumKeys = { Params = "", Return = "number", Notes = "Returns the total number of keys. This is the range for the KeyID (0 .. GetNumKeys() - 1)" }, + GetNumValues = + { + { Params = "KeyID", Return = "number", Notes = "Returns the number of values stored under the specified key." }, + { Params = "KeyName", Return = "number", Notes = "Returns the number of values stored under the specified key." }, + }, + GetValue = + { + { Params = "KeyName, ValueName", Return = "string", Notes = "Returns the value of the specified name under the specified key. Returns an empty string if the value doesn't exist." }, + { Params = "KeyID, ValueID", Return = "string", Notes = "Returns the value of the specified name under the specified key. Returns an empty string if the value doesn't exist." }, + }, + GetValueB = { Params = "KeyName, ValueName", Return = "bool", Notes = "Returns the value of the specified name under the specified key, as a bool. Returns false if the value doesn't exist." }, + GetValueF = { Params = "KeyName, ValueName", Return = "number", Notes = "Returns the value of the specified name under the specified key, as a floating-point number. Returns zero if the value doesn't exist." }, + GetValueI = { Params = "KeyName, ValueName", Return = "number", Notes = "Returns the value of the specified name under the specified key, as an integer. Returns zero if the value doesn't exist." }, + GetValueName = + { + { Params = "KeyID, ValueID", Return = "string", Notes = "Returns the name of the specified value Inverse for FindValue()." }, + { Params = "KeyName, ValueID", Return = "string", Notes = "Returns the name of the specified value Inverse for FindValue()." }, + }, + GetValueSet = { Params = "KeyName, ValueName, Default", Return = "string", Notes = "Returns the value of the specified name under the specified key. If the value doesn't exist, creates it with the specified default." }, + GetValueSetB = { Params = "KeyName, ValueName, Default", Return = "bool", Notes = "Returns the value of the specified name under the specified key, as a bool. If the value doesn't exist, creates it with the specified default." }, + GetValueSetF = { Params = "KeyName, ValueName, Default", Return = "number", Notes = "Returns the value of the specified name under the specified key, as a floating-point number. If the value doesn't exist, creates it with the specified default." }, + GetValueSetI = { Params = "KeyName, ValueName, Default", Return = "number", Notes = "Returns the value of the specified name under the specified key, as an integer. If the value doesn't exist, creates it with the specified default." }, + HasValue = { Params = "KeyName, ValueName", Return = "bool", Notes = "Returns true if the specified value is present." }, + ReadFile = { Params = "FileName, [AllowExampleFallback]", Return = "bool", Notes = "Reads the values from the specified file. Previous in-memory contents are lost. If the file cannot be opened, and AllowExample is true, another file, \"filename.example.ini\", is loaded and then saved as \"filename.ini\". Returns true if successful, false if not." }, + SetValue = + { + { Params = "KeyID, ValueID, NewValue", Return = "bool", Notes = "Overwrites the specified value with a new value. If the specified value doesn't exist, returns false (doesn't add)." }, + { Params = "KeyName, ValueName, NewValue, [CreateIfNotExists]", Return = "bool", Notes = "Overwrites the specified value with a new value. If CreateIfNotExists is true (default) and the value doesn't exist, it is first created. Returns true if the value was successfully set, false if not (didn't exists, CreateIfNotExists false)." }, + }, + SetValueB = { Params = "KeyName, ValueName, NewValueBool, [CreateIfNotExists]", Return = "bool", Notes = "Overwrites the specified value with a new bool value. If CreateIfNotExists is true (default) and the value doesn't exist, it is first created. Returns true if the value was successfully set, false if not (didn't exists, CreateIfNotExists false)." }, + SetValueF = { Params = "KeyName, ValueName, NewValueFloat, [CreateIfNotExists]", Return = "bool", Notes = "Overwrites the specified value with a new floating-point number value. If CreateIfNotExists is true (default) and the value doesn't exist, it is first created. Returns true if the value was successfully set, false if not (didn't exists, CreateIfNotExists false)." }, + SetValueI = { Params = "KeyName, ValueName, NewValueInt, [CreateIfNotExists]", Return = "bool", Notes = "Overwrites the specified value with a new integer value. If CreateIfNotExists is true (default) and the value doesn't exist, it is first created. Returns true if the value was successfully set, false if not (didn't exists, CreateIfNotExists false)." }, + WriteFile = { Params = "FileName", Return = "bool", Notes = "Writes the current in-memory data into the specified file. Returns true if successful, false if not." }, + }, + Constants = + { + noID = { Notes = "" }, + }, + AdditionalInfo = + { + { + Header = "Code example: Reading a simple value", + Contents = [[ + cIniFile is very easy to use. For example, you can find out what port the server is supposed to + use according to settings.ini by using this little snippet: +

+local IniFile = cIniFile();
+if (IniFile:ReadFile("settings.ini")) then
+	ServerPort = IniFile:GetValueI("Server", "Port");
+end
+
+ ]], + }, + { + Header = "Code example: Enumerating all objects in a file", + Contents = [[ + To enumerate all keys in a file, you need to query the total number of keys, using GetNumKeys(), + and then query each key's name using GetKeyName(). Similarly, to enumerate all values under a + key, you need to query the total number of values using GetNumValues() and then query each + value's name using GetValueName().

+

+ The following code logs all keynames and their valuenames into the server log: +

+local IniFile = cIniFile();
+IniFile:ReadFile("somefile.ini")
+local NumKeys = IniFile:GetNumKeys();
+for k = 0, NumKeys do
+	local NumValues = IniFile:GetNumValues(k);
+	LOG("key \"" .. IniFile:GetKeyName(k) .. "\" has " .. NumValues .. " values:");
+	for v = 0, NumValues do
+		LOG("  value \"" .. IniFile:GetValueName(k, v) .. "\".");
+	end
+end
+
+ ]], + }, + }, -- AdditionalInfo + }, -- cIniFile + + cInventory = + { + Desc = [[This object is used to store the items that a {{cPlayer|cPlayer}} has. It also keeps track of what item the player has currently selected in their hotbar. +Internally, the class uses three {{cItemGrid|cItemGrid}} objects to store the contents: +
  • Armor
  • +
  • Inventory
  • +
  • Hotbar
  • +These ItemGrids are available in the API and can be manipulated by the plugins, too.

    +

    + When using the raw slot access functions, such as GetSlot() and SetSlot(), the slots are numbered + consecutively, each ItemGrid has its offset and count. To future-proff your plugins, use the named + constants instead of hard-coded numbers. + ]], + Functions = + { + AddItem = { Params = "{{cItem|cItem}}, [AllowNewStacks]", Return = "number", Notes = "Adds an item to the storage; if AllowNewStacks is true (default), will also create new stacks in empty slots. Returns the number of items added" }, + AddItems = { Params = "{{cItems|cItems}}, [AllowNewStacks]", Return = "number", Notes = "Same as AddItem, but for several items at once" }, + ChangeSlotCount = { Params = "SlotNum, AddToCount", Return = "number", Notes = "Adds AddToCount to the count of items in the specified slot. If the slot was empty, ignores the call. Returns the new count in the slot, or -1 if invalid SlotNum" }, + Clear = { Params = "", Return = "", Notes = "Empties all slots" }, + CopyToItems = { Params = "{{cItems|cItems}}", Return = "", Notes = "Copies all non-empty slots into the cItems object provided; original cItems contents are preserved" }, + DamageEquippedItem = { Params = "[DamageAmount]", Return = "bool", Notes = "Adds the specified damage (1 by default) to the currently equipped it" }, + DamageItem = { Params = "SlotNum, [DamageAmount]", Return = "bool", Notes = "Adds the specified damage (1 by default) to the specified item, returns true if the item reached its max damage and should be destroyed" }, + GetArmorGrid = { Params = "", Return = "{{cItemGrid|cItemGrid}}", Notes = "Returns the ItemGrid representing the armor grid (1 x 4 slots)" }, + GetArmorSlot = { Params = "ArmorSlotNum", Return = "{{cItem|cItem}}", Notes = "Returns the specified armor slot contents. Note that the returned item is read-only" }, + GetEquippedBoots = { Params = "", Return = "{{cItem|cItem}}", Notes = "Returns the item in the \"boots\" slot of the armor grid. Note that the returned item is read-only" }, + GetEquippedChestplate = { Params = "", Return = "{{cItem|cItem}}", Notes = "Returns the item in the \"chestplate\" slot of the armor grid. Note that the returned item is read-only" }, + GetEquippedHelmet = { Params = "", Return = "{{cItem|cItem}}", Notes = "Returns the item in the \"helmet\" slot of the armor grid. Note that the returned item is read-only" }, + GetEquippedItem = { Params = "", Return = "{{cItem|cItem}}", Notes = "Returns the currently selected item from the hotbar. Note that the returned item is read-only" }, + GetEquippedLeggings = { Params = "", Return = "{{cItem|cItem}}", Notes = "Returns the item in the \"leggings\" slot of the armor grid. Note that the returned item is read-only" }, + GetEquippedSlotNum = { Params = "", Return = "number", Notes = "Returns the hotbar slot number for the currently selected item" }, + GetHotbarGrid = { Params = "", Return = "{{cItemGrid|cItemGrid}}", Notes = "Returns the ItemGrid representing the hotbar grid (9 x 1 slots)" }, + GetHotbarSlot = { Params = "HotBarSlotNum", Return = "{{cItem|cItem}}", Notes = "Returns the specified hotbar slot contents. Note that the returned item is read-only" }, + GetInventoryGrid = { Params = "", Return = "{{cItemGrid|cItemGrid}}", Notes = "Returns the ItemGrid representing the main inventory (9 x 3 slots)" }, + GetInventorySlot = { Params = "InventorySlotNum", Return = "{{cItem|cItem}}", Notes = "Returns the specified main inventory slot contents. Note that the returned item is read-only" }, + GetOwner = { Params = "", Return = "{{cPlayer|cPlayer}}", Notes = "Returns the player whose inventory this object represents" }, + GetSlot = { Params = "SlotNum", Return = "{{cItem|cItem}}", Notes = "Returns the contents of the specified slot. Note that the returned item is read-only" }, + HasItems = { Params = "{{cItem|cItem}}", Return = "bool", Notes = "Returns true if there are at least as many items of the specified type as in the parameter" }, + HowManyCanFit = { Params = "{{cItem|cItem}}", Return = "number", Notes = "Returns the number of the specified items that can fit in the storage, including empty slots" }, + HowManyItems = { Params = "{{cItem|cItem}}", Return = "number", Notes = "Returns the number of the specified items that are currently stored" }, + RemoveItem = { Params = "{{cItem}}", Return = "number", Notes = "Removes the specified item from the inventory, as many as possible, up to the item's m_ItemCount. Returns the number of items that were removed." }, + RemoveOneEquippedItem = { Params = "", Return = "", Notes = "Removes one item from the hotbar's currently selected slot" }, + SetArmorSlot = { Params = "ArmorSlotNum, {{cItem|cItem}}", Return = "", Notes = "Sets the specified armor slot contents" }, + SetEquippedSlotNum = { Params = "EquippedSlotNum", Return = "", Notes = "Sets the currently selected hotbar slot number" }, + SetHotbarSlot = { Params = "HotbarSlotNum, {{cItem|cItem}}", Return = "", Notes = "Sets the specified hotbar slot contents" }, + SetInventorySlot = { Params = "InventorySlotNum, {{cItem|cItem}}", Return = "", Notes = "Sets the specified main inventory slot contents" }, + SetSlot = { Params = "SlotNum, {{cItem|cItem}}", Return = "", Notes = "Sets the specified slot contents" }, + }, + Constants = + { + invArmorCount = { Notes = "Number of slots in the Armor part" }, + invArmorOffset = { Notes = "Starting slot number of the Armor part" }, + invInventoryCount = { Notes = "Number of slots in the main inventory part" }, + invInventoryOffset = { Notes = "Starting slot number of the main inventory part" }, + invHotbarCount = { Notes = "Number of slots in the Hotbar part" }, + invHotbarOffset = { Notes = "Starting slot number of the Hotbar part" }, + invNumSlots = { Notes = "Total number of slots in a cInventory" }, + }, + ConstantGroups = + { + SlotIndices = + { + Include = "inv.*", + TextBefore = [[ + Rather than hardcoding numbers, use the following constants for slot indices and counts: + ]], + }, + }, + }, -- cInventory + + cItem = + { + Desc = [[ + cItem is what defines an item or stack of items in the game, it contains the item ID, damage, + quantity and enchantments. Each slot in a {{cInventory}} class or a {{cItemGrid}} class is a cItem + and each {{cPickup}} contains a cItem. The enchantments are contained in a separate + {{cEnchantments}} class and are accessible through the m_Enchantments variable.

    +

    + To test if a cItem object represents an empty item, do not compare the item type nor the item count, + but rather use the IsEmpty() function.

    +

    + To translate from a cItem to its string representation, use the {{Globals#functions|global function}} + ItemToString(), ItemTypeToString() or ItemToFullString(). To translate from a string to a cItem, + use the StringToItem() global function. + ]], + + Functions = + { + constructor = + { + { Params = "", Return = "cItem", Notes = "Creates a new empty cItem object" }, + { Params = "ItemType, Count, Damage, EnchantmentString, CustomName, Lore", Return = "cItem", Notes = "Creates a new cItem object of the specified type, count (1 by default), damage (0 by default), enchantments (non-enchanted by default), CustomName (empty by default) and Lore (string, empty by default)" }, + { Params = "cItem", Return = "cItem", Notes = "Creates an exact copy of the cItem object in the parameter" }, + } , + AddCount = { Params = "AmountToAdd", Return = "cItem", Notes = "Adds the specified amount to the item count. Returns self (useful for chaining)." }, + Clear = { Params = "", Return = "", Notes = "Resets the instance to an empty item" }, + CopyOne = { Params = "", Return = "cItem", Notes = "Creates a copy of this object, with its count set to 1" }, + DamageItem = { Params = "[Amount]", Return = "bool", Notes = "Adds the specified damage. Returns true when damage reaches max value and the item should be destroyed (but doesn't destroy the item)" }, + Empty = { Params = "", Return = "", Notes = "Resets the instance to an empty item" }, + GetMaxDamage = { Params = "", Return = "number", Notes = "Returns the maximum value for damage that this item can get before breaking; zero if damage is not accounted for for this item type" }, + GetMaxStackSize = { Params = "", Return = "number", Notes = "Returns the maximum stack size for this item." }, + IsDamageable = { Params = "", Return = "bool", Notes = "Returns true if this item does account for its damage" }, + IsEmpty = { Params = "", Return = "bool", Notes = "Returns true if this object represents an empty item (zero count or invalid ID)" }, + IsEqual = { Params = "cItem", Return = "bool", Notes = "Returns true if the item in the parameter is the same as the one stored in the object (type, damage, lore, name and enchantments)" }, + IsFullStack = { Params = "", Return = "bool", Notes = "Returns true if the item is stacked up to its maximum stacking" }, + IsSameType = { Params = "cItem", Return = "bool", Notes = "Returns true if the item in the parameter is of the same ItemType as the one stored in the object. This is true even if the two items have different enchantments" }, + IsBothNameAndLoreEmpty = { Params = "", Return = "bool", Notes = "Returns if both the custom name and lore are not set." }, + IsCustomNameEmpty = { Params = "", Return = "bool", Notes = "Returns if the custom name of the cItem is empty." }, + IsLoreEmpty = { Params = "", Return = "", Notes = "Returns if the lore of the cItem is empty." }, + GetEnchantability = { Params = "", Return = "number", Notes = "Returns the enchantability of the item. When the item hasn't a enchantability, it will returns 0" }, + EnchantByXPLevels = { Params = "NumXPLevels", Return = "bool", Notes = "Enchants the item using the specified number of XP levels. Returns true if item enchanted, false if not." }, + IsEnchantable = { Params = "ItemType, WithBook", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is enchantable. If WithBook is true, the function is used in the anvil inventory with book enchantments. So it checks the \"only book enchantments\" too. Example: You can only enchant a hoe with a book." }, + }, + Variables = + { + m_Enchantments = { Type = "{{cEnchantments}}", Notes = "The enchantments that this item has" }, + m_ItemCount = { Type = "number", Notes = "Number of items in this stack" }, + m_ItemDamage = { Type = "number", Notes = "The damage of the item. Zero means no damage. Maximum damage can be queried with GetMaxDamage()" }, + m_ItemType = { Type = "number", Notes = "The item type. One of E_ITEM_ or E_BLOCK_ constants" }, + m_CustomName = { Type = "string", Notes = "The custom name for an item." }, + m_Lore = { Type = "string", Notes = "The lore for an item. Line breaks are represented by the ` character." }, + m_RepairCost = { Type = "number", Notes = "The repair cost of the item. The anvil need this value" }, + m_Enchantments = { Type = "{{cEnchantments|cEnchantments}}}", Notes = "The enchantments of the item." }, + }, + AdditionalInfo = + { + { + Header = "Usage notes", + Contents = [[ + Note that the object contained in a cItem class is quite complex and quite often new Minecraft + versions add more stuff. Therefore it is recommended to copy cItem objects using the + copy-constructor ("local copy = cItem(original);"), this is the only way that guarantees that + the object will be copied at full, even with future versions of Cuberite. + ]], + }, + { + Header = "Example code", + Contents = [[ + The following code shows how to create items in several different ways (adapted from the Debuggers plugin): +

    +-- empty item:
    +local Item1 = cItem();
    +
    +-- enchanted sword, enchantment given as numeric string (bad style; see Item5):
    +local Item2 = cItem(E_ITEM_DIAMOND_SWORD, 1, 0, "1=1");
    +
    +-- 1 undamaged shovel, no enchantment:
    +local Item3 = cItem(E_ITEM_DIAMOND_SHOVEL);
    +
    +-- Add the Unbreaking enchantment. Note that Vanilla's levelcap isn't enforced:
    +Item3.m_Enchantments:SetLevel(cEnchantments.enchUnbreaking, 4);
    +
    +-- 1 undamaged pickaxe, no enchantment:
    +local Item4 = cItem(E_ITEM_DIAMOND_PICKAXE);
    +
    +-- Add multiple enchantments:
    +Item4.m_Enchantments:SetLevel(cEnchantments.enchUnbreaking, 5);
    +Item4.m_Enchantments:SetLevel(cEnchantments.enchEfficiency, 3);
    +
    +-- enchanted chestplate, enchantment given as textual stringdesc (good style)
    +local Item5 = cItem(E_ITEM_DIAMOND_CHESTPLATE, 1, 0, "thorns=1;unbreaking=3");
    +
    +]], + }, + }, + }, -- cItem + + cObjective = + { + Desc = [[ + This class represents a single scoreboard objective. + ]], + Functions = + { + AddScore = { Params = "string, number", Return = "Score", Notes = "Adds a value to the score of the specified player and returns the new value." }, + GetDisplayName = { Params = "", Return = "string", Notes = "Returns the display name of the objective. This name will be shown to the connected players." }, + GetName = { Params = "", Return = "string", Notes = "Returns the internal name of the objective." }, + GetScore = { Params = "string", Return = "Score", Notes = "Returns the score of the specified player." }, + GetType = { Params = "", Return = "eType", Notes = "Returns the type of the objective. (i.e what is being tracked)" }, + Reset = { Params = "", Return = "", Notes = "Resets the scores of the tracked players." }, + ResetScore = { Params = "string", Return = "", Notes = "Reset the score of the specified player." }, + SetDisplayName = { Params = "string", Return = "", Notes = "Sets the display name of the objective." }, + SetScore = { Params = "string, Score", Return = "", Notes = "Sets the score of the specified player." }, + SubScore = { Params = "string, number", Return = "Score", Notes = "Subtracts a value from the score of the specified player and returns the new value." }, + }, + Constants = + { + otAchievement = { Notes = "" }, + otDeathCount = { Notes = "" }, + otDummy = { Notes = "" }, + otHealth = { Notes = "" }, + otPlayerKillCount = { Notes = "" }, + otStat = { Notes = "" }, + otStatBlockMine = { Notes = "" }, + otStatEntityKill = { Notes = "" }, + otStatEntityKilledBy = { Notes = "" }, + otStatItemBreak = { Notes = "" }, + otStatItemCraft = { Notes = "" }, + otStatItemUse = { Notes = "" }, + otTotalKillCount = { Notes = "" }, + }, + }, -- cObjective + + cPainting = + { + Desc = "This class represents a painting in the world. These paintings are special and different from Vanilla in that they can be critical-hit.", + Functions = + { + GetDirection = { Params = "", Return = "number", Notes = "Returns the direction the painting faces. Directions: ZP - 0, ZM - 2, XM - 1, XP - 3. Note that these are not the BLOCK_FACE constants." }, + GetName = { Params = "", Return = "string", Notes = "Returns the name of the painting" }, + }, + + }, -- cPainting + + cItemGrid = + { + Desc = [[This class represents a 2D array of items. It is used as the underlying storage and API for all cases that use a grid of items: +
  • {{cChestEntity|Chest}} contents
  • +
  • (TODO) Chest minecart contents
  • +
  • {{cDispenserEntity|Dispenser}} contents
  • +
  • {{cDropperEntity|Dropper}} contents
  • +
  • {{cFurnaceEntity|Furnace}} contents (?)
  • +
  • {{cHopperEntity|Hopper}} contents
  • +
  • (TODO) Hopper minecart contents
  • +
  • {{cPlayer|Player}} Inventory areas
  • +
  • (TODO) Trapped chest contents
  • +

    +

    The items contained in this object are accessed either by a pair of XY coords, or a slot number (x + Width * y). There are functions available for converting between the two formats. +]], + Functions = + { + AddItem = { Params = "{{cItem|cItem}}, [AllowNewStacks]", Return = "number", Notes = "Adds an item to the storage; if AllowNewStacks is true (default), will also create new stacks in empty slots. Returns the number of items added" }, + AddItems = { Params = "{{cItems|cItems}}, [AllowNewStacks]", Return = "number", Notes = "Same as AddItem, but for several items at once" }, + ChangeSlotCount = + { + { Params = "SlotNum, AddToCount", Return = "number", Notes = "Adds AddToCount to the count of items in the specified slot. If the slot was empty, ignores the call. Returns the new count in the slot, or -1 if invalid SlotNum" }, + { Params = "X, Y, AddToCount", Return = "number", Notes = "Adds AddToCount to the count of items in the specified slot. If the slot was empty, ignores the call. Returns the new count in the slot, or -1 if invalid slot coords" }, + }, + Clear = { Params = "", Return = "", Notes = "Empties all slots" }, + CopyToItems = { Params = "{{cItems|cItems}}", Return = "", Notes = "Copies all non-empty slots into the cItems object provided; original cItems contents are preserved" }, + DamageItem = + { + { Params = "SlotNum, [DamageAmount]", Return = "bool", Notes = "Adds the specified damage (1 by default) to the specified item, returns true if the item reached its max damage and should be destroyed" }, + { Params = "X, Y, [DamageAmount]", Return = "bool", Notes = "Adds the specified damage (1 by default) to the specified item, returns true if the item reached its max damage and should be destroyed" }, + }, + EmptySlot = + { + { Params = "SlotNum", Return = "", Notes = "Destroys the item in the specified slot" }, + { Params = "X, Y", Return = "", Notes = "Destroys the item in the specified slot" }, + }, + GetFirstEmptySlot = { Params = "", Return = "number", Notes = "Returns the SlotNumber of the first empty slot, -1 if all slots are full" }, + GetFirstUsedSlot = { Params = "", Return = "number", Notes = "Returns the SlotNumber of the first non-empty slot, -1 if all slots are empty" }, + GetHeight = { Params = "", Return = "number", Notes = "Returns the Y dimension of the grid" }, + GetLastEmptySlot = { Params = "", Return = "number", Notes = "Returns the SlotNumber of the last empty slot, -1 if all slots are full" }, + GetLastUsedSlot = { Params = "", Return = "number", Notes = "Returns the SlotNumber of the last non-empty slot, -1 if all slots are empty" }, + GetNextEmptySlot = { Params = "StartFrom", Return = "number", Notes = "Returns the SlotNumber of the first empty slot following StartFrom, -1 if all the following slots are full" }, + GetNextUsedSlot = { Params = "StartFrom", Return = "number", Notes = "Returns the SlotNumber of the first non-empty slot following StartFrom, -1 if all the following slots are full" }, + GetNumSlots = { Params = "", Return = "number", Notes = "Returns the total number of slots in the grid (Width * Height)" }, + GetSlot = + { + { Params = "SlotNumber", Return = "{{cItem|cItem}}", Notes = "Returns the item in the specified slot. Note that the item is read-only" }, + { Params = "X, Y", Return = "{{cItem|cItem}}", Notes = "Returns the item in the specified slot. Note that the item is read-only" }, + }, + GetSlotCoords = { Params = "SlotNum", Return = "number, number", Notes = "Returns the X and Y coords for the specified SlotNumber. Returns \"-1, -1\" on invalid SlotNumber" }, + GetSlotNum = { Params = "X, Y", Return = "number", Notes = "Returns the SlotNumber for the specified slot coords. Returns -1 on invalid coords" }, + GetWidth = { Params = "", Return = "number", Notes = "Returns the X dimension of the grid" }, + HasItems = { Params = "{{cItem|cItem}}", Return = "bool", Notes = "Returns true if there are at least as many items of the specified type as in the parameter" }, + HowManyCanFit = { Params = "{{cItem|cItem}}", Return = "number", Notes = "Returns the number of the specified items that can fit in the storage, including empty slots" }, + HowManyItems = { Params = "{{cItem|cItem}}", Return = "number", Notes = "Returns the number of the specified items that are currently stored" }, + IsSlotEmpty = + { + { Params = "SlotNum", Return = "bool", Notes = "Returns true if the specified slot is empty, or an invalid slot is specified" }, + { Params = "X, Y", Return = "bool", Notes = "Returns true if the specified slot is empty, or an invalid slot is specified" }, + }, + RemoveItem = { Params = "{{cItem}}", Return = "number", Notes = "Removes the specified item from the grid, as many as possible, up to the item's m_ItemCount. Returns the number of items that were removed." }, + RemoveOneItem = + { + { Params = "SlotNum", Return = "{{cItem|cItem}}", Notes = "Removes one item from the stack in the specified slot and returns it as a single cItem. Empty slots are skipped and an empty item is returned" }, + { Params = "X, Y", Return = "{{cItem|cItem}}", Notes = "Removes one item from the stack in the specified slot and returns it as a single cItem. Empty slots are skipped and an empty item is returned" }, + }, + SetSlot = + { + { Params = "SlotNum, {{cItem|cItem}}", Return = "", Notes = "Sets the specified slot to the specified item" }, + { Params = "X, Y, {{cItem|cItem}}", Return = "", Notes = "Sets the specified slot to the specified item" }, + }, + }, + AdditionalInfo = + { + { + Header = "Code example: Add items to player inventory", + Contents = [[ + The following code tries to add 32 sticks to a player's main inventory: +

    +local Items = cItem(E_ITEM_STICK, 32);
    +local PlayerMainInventory = Player:GetInventorySlots();  -- PlayerMainInventory is of type cItemGrid
    +local NumAdded = PlayerMainInventory:AddItem(Items);
    +if (NumAdded == Items.m_ItemCount) then
    +  -- All the sticks did fit
    +  LOG("Added 32 sticks");
    +else
    +  -- Some (or all) of the sticks didn't fit
    +  LOG("Tried to add 32 sticks, but only " .. NumAdded .. " could fit");
    +end
    +
    + ]], + }, + { + Header = "Code example: Damage an item", + Contents = [[ + The following code damages the helmet in the player's armor and destroys it if it reaches max damage: +
    +local PlayerArmor = Player:GetArmorSlots();  -- PlayerArmor is of type cItemGrid
    +if (PlayerArmor:DamageItem(0)) then  -- Helmet is at SlotNum 0
    +  -- The helmet has reached max damage, destroy it:
    +  PlayerArmor:EmptySlot(0);
    +end
    +
    + ]], + }, + }, -- AdditionalInfo + }, -- cItemGrid + + cItems = + { + Desc = [[ + This class represents a numbered collection (array) of {{cItem}} objects. The array indices start at + zero, each consecutive item gets a consecutive index. This class is used for spawning multiple + pickups or for mass manipulating an inventory. + ]], + Functions = + { + constructor = { Params = "", Return = "cItems", Notes = "Creates a new cItems object" }, + Add = + { + { Params = "{{cItem|cItem}}", Return = "", Notes = "Adds a new item to the end of the collection" }, + { Params = "ItemType, ItemCount, ItemDamage", Return = "", Notes = "Adds a new item to the end of the collection" }, + }, + Clear = { Params = "", Return = "", Notes = "Removes all items from the collection" }, + Delete = { Params = "Index", Return = "", Notes = "Deletes item at the specified index" }, + Get = { Params = "Index", Return = "{{cItem|cItem}}", Notes = "Returns the item at the specified index" }, + Set = + { + { Params = "Index, {{cItem|cItem}}", Return = "", Notes = "Sets the item at the specified index to the specified item" }, + { Params = "Index, ItemType, ItemCount, ItemDamage", Return = "", Notes = "Sets the item at the specified index to the specified item" }, + }, + Size = { Params = "", Return = "number", Notes = "Returns the number of items in the collection" }, + }, + }, -- cItems + + cLuaWindow = + { + Desc = [[This class is used by plugins wishing to display a custom window to the player, unrelated to block entities or entities near the player. The window can be of any type and have any contents that the plugin defines. Callbacks for when the player modifies the window contents and when the player closes the window can be set. +

    +

    This class inherits from the {{cWindow|cWindow}} class, so all cWindow's functions and constants can be used, in addition to the cLuaWindow-specific functions listed below. +

    +

    The contents of this window are represented by a {{cWindow|cWindow}}:GetSlot() etc. or {{cPlayer|cPlayer}}:GetInventory() to access the player inventory. +

    +

    When creating a new cLuaWindow object, you need to specify both the window type and the contents' width and height. Note that Cuberite accepts any combination of these, but opening a window for a player may crash their client if the contents' dimensions don't match the client's expectations. +

    +

    To open the window for a player, call {{cPlayer|cPlayer}}:OpenWindow(). Multiple players can open window of the same cLuaWindow object. All players see the same items in the window's contents (like chest, unlike crafting table). +]], + Functions = + { + constructor = { Params = "WindowType, ContentsWidth, ContentsHeight, Title", Return = "", Notes = "Creates a new object of this class" }, + GetContents = { Params = "", Return = "{{cItemGrid|cItemGrid}}", Notes = "Returns the cItemGrid object representing the internal storage in this window" }, + SetOnClosing = { Params = "OnClosingCallback", Return = "", Notes = "Sets the function that the window will call when it is about to be closed by a player" }, + SetOnSlotChanged = { Params = "OnSlotChangedCallback", Return = "", Notes = "Sets the function that the window will call when a slot is changed by a player" }, + }, + AdditionalInfo = + { + { + Header = "Callbacks", + Contents = [[ + The object calls the following functions at the appropriate time: + ]], + }, + { + Header = "OnClosing Callback", + Contents = [[ + This callback, settable via the SetOnClosing() function, will be called when the player tries to close the window, or the window is closed for any other reason (such as a player disconnecting).

    +
    +function OnWindowClosing(a_Window, a_Player, a_CanRefuse)
    +
    +

    + The a_Window parameter is the cLuaWindow object representing the window, a_Player is the player for whom the window is about to close. a_CanRefuse specifies whether the callback can refuse the closing. If the callback returns true and a_CanRefuse is true, the window is not closed (internally, the server sends a new OpenWindow packet to the client). + ]], + }, + { + Header = "OnSlotChanged Callback", + Contents = [[ + This callback, settable via the SetOnSlotChanged() function, will be called whenever the contents of any slot in the window's contents (i. e. NOT in the player inventory!) changes.

    +
    +function OnWindowSlotChanged(a_Window, a_SlotNum)
    +
    +

    The a_Window parameter is the cLuaWindow object representing the window, a_SlotNum is the slot number. There is no reference to a {{cPlayer}}, because the slot change needn't originate from the player action. To get or set the slot, you'll need to retrieve a cPlayer object, for example by calling {{cWorld|cWorld}}:DoWithPlayer(). +

    +

    Any returned values are ignored. + ]], + }, + { + Header = "Example", + Contents = [[ + This example is taken from the Debuggers plugin, used to test the API functionality. It opens a window and refuse to close it 3 times. It also logs slot changes to the server console. +

    +-- Callback that refuses to close the window twice, then allows:
    +local Attempt = 1;
    +local OnClosing = function(Window, Player, CanRefuse)
    +	Player:SendMessage("Window closing attempt #" .. Attempt .. "; CanRefuse = " .. tostring(CanRefuse));
    +	Attempt = Attempt + 1;
    +	return CanRefuse and (Attempt <= 3);  -- refuse twice, then allow, unless CanRefuse is set to true
    +end
    +
    +-- Log the slot changes:
    +local OnSlotChanged = function(Window, SlotNum)
    +	LOG("Window \"" .. Window:GetWindowTitle() .. "\" slot " .. SlotNum .. " changed.");
    +end
    +
    +-- Set window contents:
    +-- a_Player is a cPlayer object received from the outside of this code fragment
    +local Window = cLuaWindow(cWindow.Hopper, 3, 3, "TestWnd");
    +Window:SetSlot(a_Player, 0, cItem(E_ITEM_DIAMOND, 64));
    +Window:SetOnClosing(OnClosing);
    +Window:SetOnSlotChanged(OnSlotChanged);
    +
    +-- Open the window:
    +a_Player:OpenWindow(Window);
    +
    + ]], + }, + }, -- AdditionalInfo + Inherits = "cWindow", + }, -- cLuaWindow + + cMap = + { + Desc = [[ + This class encapsulates a single in-game colored map.

    +

    + The contents (i.e. pixel data) of a cMap are dynamically updated by each + tracked {{cPlayer}} instance. Furthermore, a cMap maintains and periodically + updates a list of map decorators, which are objects drawn on the map that + can freely move (e.g. Player and item frame pointers). + ]], + Functions = + { + EraseData = { Params = "", Return = "", Notes = "Erases all pixel data." }, + GetCenterX = { Params = "", Return = "number", Notes = "Returns the X coord of the map's center." }, + GetCenterZ = { Params = "", Return = "number", Notes = "Returns the Y coord of the map's center." }, + GetDimension = { Params = "", Return = "eDimension", Notes = "Returns the dimension of the associated world." }, + GetHeight = { Params = "", Return = "number", Notes = "Returns the height of the map." }, + GetID = { Params = "", Return = "number", Notes = "Returns the numerical ID of the map. (The item damage value)" }, + GetName = { Params = "", Return = "string", Notes = "Returns the name of the map." }, + GetNumPixels = { Params = "", Return = "number", Notes = "Returns the number of pixels in this map." }, + GetPixel = { Params = "PixelX, PixelZ", Return = "ColorID", Notes = "Returns the color of the specified pixel." }, + GetPixelWidth = { Params = "", Return = "number", Notes = "Returns the width of a single pixel in blocks." }, + GetScale = { Params = "", Return = "number", Notes = "Returns the scale of the map. Range: [0,4]" }, + GetWidth = { Params = "", Return = "number", Notes = "Returns the width of the map." }, + GetWorld = { Params = "", Return = "cWorld", Notes = "Returns the associated world." }, + Resize = { Params = "Width, Height", Return = "", Notes = "Resizes the map. WARNING: This will erase the pixel data." }, + SetPixel = { Params = "PixelX, PixelZ, ColorID", Return = "bool", Notes = "Sets the color of the specified pixel. Returns false on error (Out of range)." }, + SetPosition = { Params = "CenterX, CenterZ", Return = "", Notes = "Relocates the map. The pixel data will not be modified." }, + SetScale = { Params = "number", Return = "", Notes = "Rescales the map. The pixel data will not be modified." }, + }, + Constants = + { + E_BASE_COLOR_BLUE = { Notes = "" }, + E_BASE_COLOR_BROWN = { Notes = "" }, + E_BASE_COLOR_DARK_BROWN = { Notes = "" }, + E_BASE_COLOR_DARK_GRAY = { Notes = "" }, + E_BASE_COLOR_DARK_GREEN = { Notes = "" }, + E_BASE_COLOR_GRAY_1 = { Notes = "" }, + E_BASE_COLOR_GRAY_2 = { Notes = "" }, + E_BASE_COLOR_LIGHT_BROWN = { Notes = "" }, + E_BASE_COLOR_LIGHT_GRAY = { Notes = "" }, + E_BASE_COLOR_LIGHT_GREEN = { Notes = "" }, + E_BASE_COLOR_PALE_BLUE = { Notes = "" }, + E_BASE_COLOR_RED = { Notes = "" }, + E_BASE_COLOR_TRANSPARENT = { Notes = "" }, + E_BASE_COLOR_WHITE = { Notes = "" }, + }, + }, -- cMap + + cMapManager = + { + Desc = [[ + This class is associated with a single {{cWorld}} instance and manages a list of maps. + ]], + Functions = + { + DoWithMap = { Params = "ID, CallbackFunction", Return = "bool", Notes = "If a map with the specified ID exists, calls the CallbackFunction for that map. The CallbackFunction has the following signature:

    function Callback({{cMap|Map}})
    Returns true if the map was found and the callback called, false if map not found." }, + GetNumMaps = { Params = "", Return = "number", Notes = "Returns the number of registered maps." }, + }, + + }, -- cMapManager + + cMojangAPI = + { + Desc = [[ + Provides interface to various API functions that Mojang provides through their servers. Note that + some of these calls will wait for a response from the network, and so shouldn't be used while the + server is fully running (or at least when there are players connected) to avoid percepted lag.

    +

    + All the functions are static, call them using the cMojangAPI:Function() convention.

    +

    + Mojang uses two formats for UUIDs, short and dashed. Cuberite works with short UUIDs internally, but + will convert to dashed UUIDs where needed - in the protocol login for example. The MakeUUIDShort() + and MakeUUIDDashed() functions are provided for plugins to use for conversion between the two + formats.

    +

    + This class will cache values returned by the API service. The cache will hold the values for 7 days + by default, after that, they will no longer be available. This is in order to not let the server get + banned from using the API service, since they are rate-limited to 600 queries per 10 minutes. The + cache contents also gets updated whenever a player successfully joins, since that makes the server + contact the API service, too, and retrieve the relevant data.

    + ]], + Functions = + { + AddPlayerNameToUUIDMapping = { Params = "PlayerName, UUID", Return = "", Notes = "(STATIC) Adds the specified PlayerName-to-UUID mapping into the cache, with current timestamp. Accepts both short or dashed UUIDs. " }, + GetPlayerNameFromUUID = { Params = "UUID, [UseOnlyCached]", Return = "PlayerName", Notes = "(STATIC) Returns the playername that corresponds to the given UUID, or an empty string on error. If UseOnlyCached is false (the default), queries the Mojang servers if the UUID is not in the cache. The UUID can be either short or dashed.
    WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." }, + GetUUIDFromPlayerName = { Params = "PlayerName, [UseOnlyCached]", Return = "UUID", Notes = "(STATIC) Returns the (short) UUID that corresponds to the given playername, or an empty string on error. If UseOnlyCached is false (the default), queries the Mojang servers if the playername is not in the cache.
    WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." }, + GetUUIDsFromPlayerNames = { Params = "PlayerNames, [UseOnlyCached]", Return = "table", Notes = "(STATIC) Returns a table that contains the map, 'PlayerName' -> '(short) UUID', for all valid playernames in the input array-table. PlayerNames not recognized will not be set in the returned map. If UseOnlyCached is false (the default), queries the Mojang servers for the results that are not in the cache.
    WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." }, + MakeUUIDDashed = { Params = "UUID", Return = "DashedUUID", Notes = "(STATIC) Converts the UUID to a dashed format (\"01234567-8901-2345-6789-012345678901\"). Accepts both dashed or short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." }, + MakeUUIDShort = { Params = "UUID", Return = "ShortUUID", Notes = "(STATIC) Converts the UUID to a short format (without dashes, \"01234567890123456789012345678901\"). Accepts both dashed or short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." }, + }, + + }, + + cMonster = + { + Desc = [[ + This class is the base class for all computer-controlled mobs in the game.

    +

    + To spawn a mob in a world, use the {{cWorld}}:SpawnMob() function. + ]], + Functions = + { + HasCustomName = { Params = "", Return = "bool", Notes = "Returns true if the monster has a custom name." }, + GetCustomName = { Params = "", Return = "string", Notes = "Gets the custom name of the monster. If no custom name is set, the function returns an empty string." }, + SetCustomName = { Params = "string", Return = "", Notes = "Sets the custom name of the monster. You see the name over the monster. If you want to disable the custom name, simply set an empty string." }, + IsCustomNameAlwaysVisible = { Params = "", Return = "bool", Notes = "Is the custom name of this monster always visible? If not, you only see the name when you sight the mob." }, + SetCustomNameAlwaysVisible = { Params = "bool", Return = "", Notes = "Sets the custom name visiblity of this monster. If it's false, you only see the name when you sight the mob. If it's true, you always see the custom name." }, + FamilyFromType = { Params = "{{Globals#MobType|MobType}}", Return = "{{cMonster#MobFamily|MobFamily}}", Notes = "(STATIC) Returns the mob family ({{cMonster#MobFamily|mfXXX}} constants) based on the mob type ({{Globals#MobType|mtXXX}} constants)" }, + GetMobFamily = { Params = "", Return = "{{cMonster#MobFamily|MobFamily}}", Notes = "Returns this mob's family ({{cMonster#MobFamily|mfXXX}} constant)" }, + GetMobType = { Params = "", Return = "{{Globals#MobType|MobType}}", Notes = "Returns the type of this mob ({{Globals#MobType|mtXXX}} constant)" }, + GetSpawnDelay = { Params = "{{cMonster#MobFamily|MobFamily}}", Return = "number", Notes = "(STATIC) Returns the spawn delay - the number of game ticks between spawn attempts - for the specified mob family." }, + MobTypeToString = { Params = "{{Globals#MobType|MobType}}", Return = "string", Notes = "(STATIC) Returns the string representing the given mob type ({{Globals#MobType|mtXXX}} constant), or empty string if unknown type." }, + MobTypeToVanillaName = { Params = "{{Globals#MobType|MobType}}", Return = "string", Notes = "(STATIC) Returns the vanilla name of the given mob type, or empty string if unknown type." }, + MoveToPosition = { Params = "Position", Return = "", Notes = "Moves mob to the specified position" }, + StringToMobType = { Params = "string", Return = "{{Globals#MobType|MobType}}", Notes = "(STATIC) Returns the mob type ({{Globals#MobType|mtXXX}} constant) parsed from the string type (\"creeper\"), or mtInvalidType if unrecognized." }, + GetRelativeWalkSpeed = { Params = "", Return = "number", Notes = "Returns the relative walk speed of this mob. Standard is 1.0" }, + SetRelativeWalkSpeed = { Params = "number", Return = "", Notes = "Sets the relative walk speed of this mob. Standard is 1.0" }, + SetAge = { Params = "number", Return = "", Notes = "Sets the age of the monster" }, + GetAge = { Params = "", Return = "number", Notes = "Returns the age of the monster" }, + IsBaby = { Params = "", Return = "bool", Notes = "Returns true if the monster is a baby" }, + }, + Constants = + { + mfAmbient = { Notes = "Family: ambient (bat)" }, + mfHostile = { Notes = "Family: hostile (blaze, cavespider, creeper, enderdragon, enderman, ghast, giant, magmacube, silverfish, skeleton, slime, spider, witch, wither, zombie, zombiepigman)" }, + mfMaxplusone = { Notes = "The maximum family value, plus one. Returned when monster family not recognized." }, + mfPassive = { Notes = "Family: passive (chicken, cow, horse, irongolem, mooshroom, ocelot, pig, sheep, snowgolem, villager, wolf)" }, + mfWater = { Notes = "Family: water (squid)" }, + mtBat = { Notes = "" }, + mtBlaze = { Notes = "" }, + mtCaveSpider = { Notes = "" }, + mtChicken = { Notes = "" }, + mtCow = { Notes = "" }, + mtCreeper = { Notes = "" }, + mtEnderDragon = { Notes = "" }, + mtEnderman = { Notes = "" }, + mtGhast = { Notes = "" }, + mtGiant = { Notes = "" }, + mtHorse = { Notes = "" }, + mtInvalidType = { Notes = "Invalid monster type. Returned when monster type not recognized" }, + mtIronGolem = { Notes = "" }, + mtMagmaCube = { Notes = "" }, + mtMooshroom = { Notes = "" }, + mtOcelot = { Notes = "" }, + mtPig = { Notes = "" }, + mtSheep = { Notes = "" }, + mtSilverfish = { Notes = "" }, + mtSkeleton = { Notes = "" }, + mtSlime = { Notes = "" }, + mtSnowGolem = { Notes = "" }, + mtSpider = { Notes = "" }, + mtSquid = { Notes = "" }, + mtVillager = { Notes = "" }, + mtWitch = { Notes = "" }, + mtWither = { Notes = "" }, + mtWolf = { Notes = "" }, + mtZombie = { Notes = "" }, + mtZombiePigman = { Notes = "" }, + }, + ConstantGroups = + { + MobFamily = + { + Include = "mf.*", + TextBefore = [[ + Mobs are divided into families. The following constants are used for individual family types: + ]], + }, + }, + Inherits = "cPawn", + }, -- cMonster + + cPawn = + { + Desc = [[cPawn is a controllable pawn object, controlled by either AI or a player. cPawn inherits all functions and members of {{cEntity}} +]], + Functions = + { + TeleportToEntity = { Return = "" }, + TeleportTo = { Return = "" }, + Heal = { Return = "" }, + TakeDamage = { Return = "" }, + KilledBy = { Return = "" }, + GetHealth = { Return = "number" }, + AddEntityEffect = { Params = "EffectType, {{cEntityEffect}}", Return = "", Notes = "Applies an entity effect" }, + RemoveEntityEffect = { Params = "EffectType", Return = "", Notes = "Removes a currently applied entity effect" }, + ClearEntityEffects = { Return = "", Notes = "Removes all currently applied entity effects" }, + }, + Inherits = "cEntity", + }, -- cPawn + + cPickup = + { + Desc = [[ + This class represents a pickup entity (an item that the player or mobs can pick up). It is also + commonly known as "drops". With this class you could create your own "drop" or modify those + created automatically. + ]], + Functions = + { + CollectedBy = { Params = "{{cPlayer}}", Return = "bool", Notes = "Tries to make the player collect the pickup. Returns true if the pickup was collected, at least partially." }, + GetAge = { Params = "", Return = "number", Notes = "Returns the number of ticks that the pickup has existed." }, + GetItem = { Params = "", Return = "{{cItem|cItem}}", Notes = "Returns the item represented by this pickup" }, + IsCollected = { Params = "", Return = "bool", Notes = "Returns true if this pickup has already been collected (is waiting to be destroyed)" }, + IsPlayerCreated = { Params = "", Return = "bool", Notes = "Returns true if the pickup was created by a player" }, + SetAge = { Params = "AgeTicks", Return = "", Notes = "Sets the pickup's age, in ticks." }, + }, + Inherits = "cEntity", + }, -- cPickup + + cPlayer = + { + Desc = [[ + This class describes a player in the server. cPlayer inherits all functions and members of + {{cPawn|cPawn}}. It handles all the aspects of the gameplay, such as hunger, sprinting, inventory + etc. + ]], + Functions = + { + AddFoodExhaustion = { Params = "Exhaustion", Return = "", Notes = "Adds the specified number to the food exhaustion. Only positive numbers expected." }, + CalcLevelFromXp = { Params = "XPAmount", Return = "number", Notes = "(STATIC) Returns the level which is reached with the specified amount of XP. Inverse of XpForLevel()." }, + CanFly = { Return = "bool", Notes = "Returns if the player is able to fly." }, + CloseWindow = { Params = "[CanRefuse]", Return = "", Notes = "Closes the currently open UI window. If CanRefuse is true (default), the window may refuse the closing." }, + CloseWindowIfID = { Params = "WindowID, [CanRefuse]", Return = "", Notes = "Closes the currently open UI window if its ID matches the given ID. If CanRefuse is true (default), the window may refuse the closing." }, + DeltaExperience = { Params = "DeltaXP", Return = "", Notes = "Adds or removes XP from the current XP amount. Won't allow XP to go negative. Returns the new experience, -1 on error (XP overflow)." }, + Feed = { Params = "AddFood, AddSaturation", Return = "bool", Notes = "Tries to add the specified amounts to food level and food saturation level (only positive amounts expected). Returns true if player was hungry and the food was consumed, false if too satiated." }, + FoodPoison = { Params = "NumTicks", Return = "", Notes = "Starts the food poisoning for the specified amount of ticks; if already foodpoisoned, sets FoodPoisonedTicksRemaining to the larger of the two" }, + ForceSetSpeed = { Params = "{{Vector3d|Direction}}", Notes = "Forces the player to move to the given direction." }, + GetClientHandle = { Params = "", Return = "{{cClientHandle}}", Notes = "Returns the client handle representing the player's connection. May be nil (AI players)." }, + GetColor = { Return = "string", Notes = "Returns the full color code to be used for this player's messages (based on their rank). Prefix player messages with this code." }, + GetCurrentXp = { Params = "", Return = "number", Notes = "Returns the current amount of XP" }, + GetCustomName = { Params = "", Return = "string", Notes = "Returns the custom name of this player. If the player hasn't a custom name, it will return an empty string." }, + GetEffectiveGameMode = { Params = "", Return = "{{Globals#GameMode|GameMode}}", Notes = "(OBSOLETE) Returns the current resolved game mode of the player. If the player is set to inherit the world's gamemode, returns that instead. See also GetGameMode() and IsGameModeXXX() functions. Note that this function is the same as GetGameMode(), use that function instead." }, + GetEquippedItem = { Params = "", Return = "{{cItem}}", Notes = "Returns the item that the player is currently holding; empty item if holding nothing." }, + GetEyeHeight = { Return = "number", Notes = "Returns the height of the player's eyes, in absolute coords" }, + GetEyePosition = { Return = "{{Vector3d|EyePositionVector}}", Notes = "Returns the position of the player's eyes, as a {{Vector3d}}" }, + GetFloaterID = { Params = "", Return = "number", Notes = "Returns the Entity ID of the fishing hook floater that belongs to the player. Returns -1 if no floater is associated with the player. FIXME: Undefined behavior when the player has used multiple fishing rods simultanously." }, + GetFlyingMaxSpeed = { Params = "", Return = "number", Notes = "Returns the maximum flying speed, relative to the default game flying speed. Defaults to 1, but plugins may modify it for faster or slower flying." }, + GetFoodExhaustionLevel = { Params = "", Return = "number", Notes = "Returns the food exhaustion level" }, + GetFoodLevel = { Params = "", Return = "number", Notes = "Returns the food level (number of half-drumsticks on-screen)" }, + GetFoodPoisonedTicksRemaining = { Params = "", Return = "", Notes = "Returns the number of ticks left for the food posoning effect" }, + GetFoodSaturationLevel = { Params = "", Return = "number", Notes = "Returns the food saturation (overcharge of the food level, is depleted before food level)" }, + GetFoodTickTimer = { Params = "", Return = "", Notes = "Returns the number of ticks past the last food-based heal or damage action; when this timer reaches 80, a new heal / damage is applied." }, + GetGameMode = { Return = "{{Globals#GameMode|GameMode}}", Notes = "Returns the player's gamemode. The player may have their gamemode unassigned, in which case they inherit the gamemode from the current {{cWorld|world}}.
    NOTE: Instead of comparing the value returned by this function to the gmXXX constants, use the IsGameModeXXX() functions. These functions handle the gamemode inheritance automatically."}, + GetIP = { Return = "string", Notes = "Returns the IP address of the player, if available. Returns an empty string if there's no IP to report."}, + GetInventory = { Return = "{{cInventory|Inventory}}", Notes = "Returns the player's inventory"}, + GetLastBedPos = { Params = "", Return = "{{Vector3i}}", Notes = "Returns the position of the last bed the player has slept in, or the world's spawn if no such position was recorded." }, + GetMaxSpeed = { Params = "", Return = "number", Notes = "Returns the player's current maximum speed, relative to the game default speed. Takes into account the sprinting / flying status." }, + GetName = { Return = "string", Notes = "Returns the player's name" }, + GetNormalMaxSpeed = { Params = "", Return = "number", Notes = "Returns the player's maximum walking speed, relative to the game default speed. Defaults to 1, but plugins may modify it for faster or slower walking." }, + GetPermissions = { Params = "", Return = "array-table of strings", Notes = "Returns the list of all permissions that the player has assigned to them through their rank." }, + GetPlayerListName = { Return = "string", Notes = "Returns the name that is used in the playerlist." }, + GetResolvedPermissions = { Return = "array-table of string", Notes = "Returns all the player's permissions, as a table. The permissions are stored in the array part of the table, beginning with index 1." }, + GetSprintingMaxSpeed = { Params = "", Return = "number", Notes = "Returns the player's maximum sprinting speed, relative to the game default speed. Defaults to 1.3, but plugins may modify it for faster or slower sprinting." }, + GetStance = { Return = "number", Notes = "Returns the player's stance (Y-pos of player's eyes)" }, + GetTeam = { Params = "", Return = "{{cTeam}}", Notes = "Returns the team that the player belongs to, or nil if none." }, + GetThrowSpeed = { Params = "SpeedCoeff", Return = "{{Vector3d}}", Notes = "Returns the speed vector for an object thrown with the specified speed coeff. Basically returns the normalized look vector multiplied by the coeff, with a slight random variation." }, + GetThrowStartPos = { Params = "", Return = "{{Vector3d}}", Notes = "Returns the position where the projectiles should start when thrown by this player." }, + GetUUID = { Params = "", Return = "string", Notes = "Returns the (short) UUID that the player is using. Could be empty string for players that don't have a Mojang account assigned to them (in the future, bots for example)." }, + GetWindow = { Params = "", Return = "{{cWindow}}", Notes = "Returns the currently open UI window. If the player doesn't have any UI window open, returns the inventory window." }, + GetXpLevel = { Params = "", Return = "number", Notes = "Returns the current XP level (based on current XP amount)." }, + GetXpLifetimeTotal = { Params = "", Return = "number", Notes = "Returns the amount of XP that has been accumulated throughout the player's lifetime." }, + GetXpPercentage = { Params = "", Return = "number", Notes = "Returns the percentage of the experience bar - the amount of XP towards the next XP level. Between 0 and 1." }, + HasCustomName = { Params = "", Return = "bool", Notes = "Returns true if the player has a custom name." }, + HasPermission = { Params = "PermissionString", Return = "bool", Notes = "Returns true if the player has the specified permission" }, + Heal = { Params = "HitPoints", Return = "", Notes = "Heals the player by the specified amount of HPs. Only positive amounts are expected. Sends a health update to the client." }, + IsEating = { Params = "", Return = "bool", Notes = "Returns true if the player is currently eating the item in their hand." }, + IsFishing = { Params = "", Return = "bool", Notes = "Returns true if the player is currently fishing" }, + IsFlying = { Return = "bool", Notes = "Returns true if the player is flying." }, + IsGameModeAdventure = { Params = "", Return = "bool", Notes = "Returns true if the player is in the gmAdventure gamemode, or has their gamemode unset and the world is a gmAdventure world." }, + IsGameModeCreative = { Params = "", Return = "bool", Notes = "Returns true if the player is in the gmCreative gamemode, or has their gamemode unset and the world is a gmCreative world." }, + IsGameModeSpectator = { Params = "", Return = "bool", Notes = "Returns true if the player is in the gmSpectator gamemode, or has their gamemode unset and the world is a gmSpectator world." }, + IsGameModeSurvival = { Params = "", Return = "bool", Notes = "Returns true if the player is in the gmSurvival gamemode, or has their gamemode unset and the world is a gmSurvival world." }, + IsInBed = { Params = "", Return = "bool", Notes = "Returns true if the player is currently lying in a bed." }, + IsSatiated = { Params = "", Return = "bool", Notes = "Returns true if the player is satiated (cannot eat)." }, + IsVisible = { Params = "", Return = "bool", Notes = "Returns true if the player is visible to other players" }, + LoadRank = { Params = "", Return = "", Notes = "Reloads the player's rank, message visuals and permissions from the {{cRankManager}}, based on the player's current rank." }, + MoveTo = { Params = "{{Vector3d|NewPosition}}", Return = "Tries to move the player into the specified position." }, + MoveToWorld = { Params = "WorldName", Return = "bool", Return = "Moves the player to the specified world. Returns true if successful." }, + OpenWindow = { Params = "{{cWindow|Window}}", Return = "", Notes = "Opens the specified UI window for the player." }, + PermissionMatches = { Params = "Permission, Template", Return = "bool", Notes = "(STATIC) Returns true if the specified permission matches the specified template. The template may contain wildcards." }, + PlaceBlock = { Params = "BlockX, BlockY, BlockZ, BlockType, BlockMeta", Return = "bool", Notes = "Places a block while impersonating the player. The {{OnPlayerPlacingBlock|HOOK_PLAYER_PLACING_BLOCK}} hook is called before the placement, and if it succeeds, the block is placed and the {{OnPlayerPlacedBlock|HOOK_PLAYER_PLACED_BLOCK}} hook is called. Returns true iff the block is successfully placed. Assumes that the block is in a currently loaded chunk." }, + Respawn = { Params = "", Return = "", Notes = "Restores the health, extinguishes fire, makes visible and sends the Respawn packet." }, + SendBlocksAround = { Params = "BlockX, BlockY, BlockZ, [Range]", Return = "", Notes = "Sends all the world's blocks in Range from the specified coords to the player, as a BlockChange packet. Range defaults to 1 (only one block sent)." }, + SendMessage = { Params = "Message", Return = "", Notes = "Sends the specified message to the player." }, + SendMessageFailure = { Params = "Message", Return = "", Notes = "Prepends Rose [INFO] / colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. For a command that failed to run because of insufficient permissions, etc." }, + SendMessageFatal = { Params = "Message", Return = "", Notes = "Prepends Red [FATAL] / colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. For something serious, such as a plugin crash, etc." }, + SendMessageInfo = { Params = "Message", Return = "", Notes = "Prepends Yellow [INFO] / colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. Informational message, such as command usage, etc." }, + SendMessagePrivateMsg = { Params = "Message, SenderName", Return = "", Notes = "Prepends Light Blue [MSG: *SenderName*] / prepends SenderName and colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. For private messaging." }, + SendMessageSuccess = { Params = "Message", Return = "", Notes = "Prepends Green [INFO] / colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. Success notification." }, + SendMessageWarning = { Params = "Message, Sender", Return = "", Notes = "Prepends Rose [WARN] / colours entire text (depending on ShouldUseChatPrefixes()) and sends message to player. Denotes that something concerning, such as plugin reload, is about to happen." }, + SendAboveActionBarMessage = { Params = "Message", Return = "", Notes = "Sends the specified message to the player (shows above action bar, doesn't show for < 1.8 clients)." }, + SendSystemMessage = { Params = "Message", Return = "", Notes = "Sends the specified message to the player (doesn't show for < 1.8 clients)." }, + SendRotation = { Params = "YawDegrees, PitchDegrees", Return = "", Notes = "Sends the specified rotation to the player, forcing them to look that way" }, + SetBedPos = { Params = "{{Vector3i|Position}}", Return = "", Notes = "Sets the internal representation of the last bed position the player has slept in. The player will respawn at this position if they die." }, + SetCanFly = { Params = "CanFly", Notes = "Sets if the player can fly or not." }, + SetCrouch = { Params = "IsCrouched", Return = "", Notes = "Sets the crouch state, broadcasts the change to other players." }, + SetCurrentExperience = { Params = "XPAmount", Return = "", Notes = "Sets the current amount of experience (and indirectly, the XP level)." }, + SetCustomName = { Params = "string", Return = "", Notes = "Sets the custom name of this player. If you want to disable the custom name, simply set an empty string. The custom name will be used in the tab-list, in the player nametag and in the tab-completion." }, + SetFlying = { Params = "IsFlying", Notes = "Sets if the player is flying or not." }, + SetFlyingMaxSpeed = { Params = "FlyingMaxSpeed", Return = "", Notes = "Sets the flying maximum speed, relative to the game default speed. The default value is 1. Sends the updated speed to the client." }, + SetFoodExhaustionLevel = { Params = "ExhaustionLevel", Return = "", Notes = "Sets the food exhaustion to the specified level." }, + SetFoodLevel = { Params = "FoodLevel", Return = "", Notes = "Sets the food level (number of half-drumsticks on-screen)" }, + SetFoodPoisonedTicksRemaining = { Params = "FoodPoisonedTicksRemaining", Return = "", Notes = "Sets the number of ticks remaining for food poisoning. Doesn't send foodpoisoning effect to the client, use FoodPoison() for that." }, + SetFoodSaturationLevel = { Params = "FoodSaturationLevel", Return = "", Notes = "Sets the food saturation (overcharge of the food level)." }, + SetFoodTickTimer = { Params = "FoodTickTimer", Return = "", Notes = "Sets the number of ticks past the last food-based heal or damage action; when this timer reaches 80, a new heal / damage is applied." }, + SetGameMode = { Params = "{{Globals#GameMode|NewGameMode}}", Return = "", Notes = "Sets the gamemode for the player. The new gamemode overrides the world's default gamemode, unless it is set to gmInherit." }, + SetIsFishing = { Params = "IsFishing, [FloaterEntityID]", Return = "", Notes = "Sets the 'IsFishing' flag for the player. The floater entity ID is expected for the true variant, it can be omitted when IsFishing is false. FIXME: Undefined behavior when multiple fishing rods are used simultanously" }, + SetName = { Params = "Name", Return = "", Notes = "Sets the player name. This rename will NOT be visible to any players already in the server who are close enough to see this player." }, + SetNormalMaxSpeed = { Params = "NormalMaxSpeed", Return = "", Notes = "Sets the normal (walking) maximum speed, relative to the game default speed. The default value is 1. Sends the updated speed to the client, if appropriate." }, + SetSprint = { Params = "IsSprinting", Return = "", Notes = "Sets whether the player is sprinting or not." }, + SetSprintingMaxSpeed = { Params = "SprintingMaxSpeed", Return = "", Notes = "Sets the sprinting maximum speed, relative to the game default speed. The default value is 1.3. Sends the updated speed to the client, if appropriate." }, + SetTeam = { Params = "{{cTeam|Team}}", Return = "", Notes = "Moves the player to the specified team." }, + SetVisible = { Params = "IsVisible", Return = "", Notes = "Sets the player visibility to other players" }, + TossEquippedItem = { Params = "[Amount]", Return = "", Notes = "Tosses the item that the player has selected in their hotbar. Amount defaults to 1." }, + TossHeldItem = { Params = "[Amount]", Return = "", Notes = "Tosses the item held by the cursor, then the player is in a UI window. Amount defaults to 1." }, + TossPickup = { Params = "{{cItem|Item}}", Return = "", Notes = "Tosses a pickup newly created from the specified item." }, + XpForLevel = { Params = "XPLevel", Return = "number", Notes = "(STATIC) Returns the total amount of XP needed for the specified XP level. Inverse of CalcLevelFromXp()." }, + }, + Constants = + { + EATING_TICKS = { Notes = "Number of ticks required for consuming an item." }, + MAX_FOOD_LEVEL = { Notes = "The maximum food level value. When the food level is at this value, the player cannot eat." }, + MAX_HEALTH = { Notes = "The maximum health value" }, + }, + Inherits = "cPawn", + }, -- cPlayer + + cRankManager = + { + Desc = [[ + Manages the players' permissions. The players are assigned a single rank, which contains groups of + permissions. The functions in this class query or modify these.

    +

    + All the functions are static, call them using the cRankManager:Function() convention.

    +

    + The players are identified by their UUID, to support player renaming.

    +

    + The rank also contains specific "mesage visuals" - bits that are used for formatting messages from the + players. There's a message prefix, which is put in front of every message the player sends, and the + message suffix that is appended to each message. There's also a PlayerNameColorCode, which holds the + color that is used for the player's name in the messages.

    +

    + Each rank can contain any number of permission groups. These groups allow for an easier setup of the + permissions - you can share groups among ranks, so the usual approach is to group similar permissions + together and add that group to any rank that should use those permissions.

    +

    + Permissions are added to individual groups. Each group can support unlimited permissions. Note that + adding a permission to a group will make the permission available to all the ranks that contain that + permission group.

    +

    + One rank is reserved as the Default rank. All players that don't have an explicit rank assigned to them + will behave as if assigned to this rank. The default rank can be changed to any other rank at any time. + Note that the default rank cannot be removed from the RankManager - RemoveRank() will change the default + rank to the replacement rank, if specified, and fail if no replacement rank is specified. Renaming the + default rank using RenameRank() will change the default rank to the new name. + ]], + Functions = + { + AddGroup = { Params = "GroupName", Return = "", Notes = "Adds the group of the specified name. Logs a warning and does nothing if the group already exists." }, + AddGroupToRank = { Params = "GroupName, RankName", Return = "bool", Notes = "Adds the specified group to the specified rank. Returns true on success, false on failure - if the group name or the rank name is not found." }, + AddPermissionToGroup = { Params = "Permission, GroupName", Return = "bool", Notes = "Adds the specified permission to the specified group. Returns true on success, false on failure - if the group name is not found." }, + AddRank = { Params = "RankName, MsgPrefix, MsgSuffix, MsgNameColorCode", Return = "", Notes = "Adds a new rank of the specified name and with the specified message visuals. Logs an info message and does nothing if the rank already exists." }, + ClearPlayerRanks = { Params = "", Return = "", Notes = "Removes all player ranks from the database. Note that this doesn't change the cPlayer instances for the already connected players, you need to update all the instances manually." }, + GetAllGroups = { Params = "", Return = "array-table of groups' names", Notes = "Returns an array-table containing the names of all the groups that are known to the manager." }, + GetAllPermissions = { Params = "", Return = "array-table of permissions", Notes = "Returns an array-table containing all the permissions that are known to the manager." }, + GetAllPlayerUUIDs = { Params = "", Return = "array-table of uuids", Notes = "Returns the short uuids of all players stored in the rank DB, sorted by the players' names (case insensitive)." }, + GetAllRanks = { Params = "", Return = "array-table of ranks' names", Notes = "Returns an array-table containing the names of all the ranks that are known to the manager." }, + GetDefaultRank = { Params = "", Return = "string", Notes = "Returns the name of the default rank. " }, + GetGroupPermissions = { Params = "GroupName", Return = "array-table of permissions", Notes = "Returns an array-table containing the permissions that the specified group contains." }, + GetPlayerGroups = { Params = "PlayerUUID", Return = "array-table of groups' names", Notes = "Returns an array-table of the names of the groups that are assigned to the specified player through their rank. Returns an empty table if the player is not known or has no rank or groups assigned to them." }, + GetPlayerMsgVisuals = { Params = "PlayerUUID", Return = "MsgPrefix, MsgSuffix, MsgNameColorCode", Notes = "Returns the message visuals assigned to the player. If the player is not explicitly assigned a rank, the default rank's visuals are returned. If there is an error, no value is returned at all." }, + GetPlayerPermissions = { Params = "PlayerUUID", Return = "array-table of permissions", Notes = "Returns the permissions that the specified player is assigned through their rank. Returns the default rank's permissions if the player has no explicit rank assigned to them. Returns an empty array on error." }, + GetPlayerRankName = { Params = "PlayerUUID", Return = "RankName", Notes = "Returns the name of the rank that is assigned to the specified player. An empty string (NOT the default rank) is returned if the player has no rank assigned to them." }, + GetPlayerName = { Params = "PlayerUUID", Return = "PlayerName", Notes = "Returns the last name that the specified player has, for a player in the ranks database. An empty string is returned if the player isn't in the database." }, + GetRankGroups = { Params = "RankName", Return = "array-table of groups' names", Notes = "Returns an array-table of the names of all the groups that are assigned to the specified rank. Returns an empty table if there is no such rank." }, + GetRankPermissions = { Params = "RankName", Return = "array-table of permissions", Notes = "Returns an array-table of all the permissions that are assigned to the specified rank through its groups. Returns an empty table if there is no such rank." }, + GetRankVisuals = { Params = "RankName", Return = "MsgPrefix, MsgSuffix, MsgNameColorCode", Notes = "Returns the message visuals for the specified rank. Returns no value if the specified rank does not exist." }, + GroupExists = { Params = "GroupName", Return = "bool", Notes = "Returns true iff the specified group exists." }, + IsGroupInRank = { Params = "GroupName, RankName", Return = "bool", Notes = "Returns true iff the specified group is assigned to the specified rank." }, + IsPermissionInGroup = { Params = "Permission, GroupName", Return = "bool", Notes = "Returns true iff the specified permission is assigned to the specified group." }, + IsPlayerRankSet = { Params = "PlayerUUID", Return = "bool", Notes = "Returns true iff the specified player has a rank assigned to them." }, + RankExists = { Params = "RankName", Return = "bool", Notes = "Returns true iff the specified rank exists." }, + RemoveGroup = { Params = "GroupName", Return = "", Notes = "Removes the specified group completely. The group will be removed from all the ranks using it and then erased from the manager. Logs an info message and does nothing if the group doesn't exist." }, + RemoveGroupFromRank = { Params = "GroupName, RankName", Return = "", Notes = "Removes the specified group from the specified rank. The group will still exist, even if it isn't assigned to any rank. Logs an info message and does nothing if the group or rank doesn't exist." }, + RemovePermissionFromGroup = { Params = "Permission, GroupName", Return = "", Notes = "Removes the specified permission from the specified group. Logs an info message and does nothing if the group doesn't exist." }, + RemovePlayerRank = { Params = "PlayerUUID", Return = "", Notes = "Removes the player's rank; the player's left without a rank. Note that this doesn't change the {{cPlayer}} instances for the already connected players, you need to update all the instances manually. No action if the player has no rank assigned to them already." }, + RemoveRank = { Params = "RankName, [ReplacementRankName]", Return = "", Notes = "Removes the specified rank. If ReplacementRankName is given, the players that have RankName will get their rank set to ReplacementRankName. If it isn't given, or is an invalid rank, the players will be removed from the manager, their ranks will be unset completely. Logs an info message and does nothing if the rank is not found." }, + RenameGroup = { Params = "OldName, NewName", Return = "", Notes = "Renames the specified group. Logs an info message and does nothing if the group is not found or the new name is already used." }, + RenameRank = { Params = "OldName, NewName", Return = "", Notes = "Renames the specified rank. Logs an info message and does nothing if the rank is not found or the new name is already used." }, + SetDefaultRank = { Params = "RankName", Return = "bool", Notes = "Sets the specified rank as the default rank. Returns true on success, false on failure (rank doesn't exist)." }, + SetPlayerRank = { Params = "PlayerUUID, PlayerName, RankName", Return = "", Notes = "Updates the rank for the specified player. The player name is provided for reference, the UUID is used for identification. Logs a warning and does nothing if the rank is not found." }, + SetRankVisuals = { Params = "RankName, MsgPrefix, MsgSuffix, MsgNameColorCode", Return = "", Notes = "Updates the rank's message visuals. Logs an info message and does nothing if rank not found." }, + }, + }, -- cRankManager + + cRoot = + { + Desc = [[ + This class represents the root of Cuberite's object hierarchy. There is always only one cRoot + object. It manages and allows querying all the other objects, such as {{cServer}}, + {{cPluginManager}}, individual {{cWorld|worlds}} etc.

    +

    + To get the singleton instance of this object, you call the cRoot:Get() function. Then you can call + the individual functions on this object. Note that some of the functions are static and don't need + the instance, they are to be called directly on the cRoot class, such as cRoot:GetPhysicalRAMUsage() + ]], + Functions = + { + BroadcastChat = + { + { Params = "MessageText, MessageType", Return = "", Notes = "Broadcasts a message to all players, with its message type set to MessageType (default: mtCustom)." }, + { Params = "{{cCompositeChat|CompositeChat}}", Return = "", Notes = "Broadcasts a {{cCompositeChat|composite chat message}} to all players." }, + }, + BroadcastChatDeath = { Params = "MessageText", Return = "", Notes = "Broadcasts the specified message to all players, with its message type set to mtDeath. Use for when a player has died." }, + BroadcastChatFailure = { Params = "MessageText", Return = "", Notes = "Broadcasts the specified message to all players, with its message type set to mtFailure. Use for a command that failed to run because of insufficient permissions, etc." }, + BroadcastChatFatal = { Params = "MessageText", Return = "", Notes = "Broadcasts the specified message to all players, with its message type set to mtFatal. Use for a plugin that crashed, or similar." }, + BroadcastChatInfo = { Params = "MessageText", Return = "", Notes = "Broadcasts the specified message to all players, with its message type set to mtInfo. Use for informational messages, such as command usage." }, + BroadcastChatJoin = { Params = "MessageText", Return = "", Notes = "Broadcasts the specified message to all players, with its message type set to mtJoin. Use for players joining the server." }, + BroadcastChatLeave = { Params = "MessageText", Return = "", Notes = "Broadcasts the specified message to all players, with its message type set to mtLeave. Use for players leaving the server." }, + BroadcastChatSuccess = { Params = "MessageText", Return = "", Notes = "Broadcasts the specified message to all players, with its message type set to mtSuccess. Use for success messages." }, + BroadcastChatWarning = { Params = "MessageText", Return = "", Notes = "Broadcasts the specified message to all players, with its message type set to mtWarning. Use for concerning events, such as plugin reload etc." }, + CreateAndInitializeWorld = { Params = "WorldName", Return = "{{cWorld|cWorld}}", Notes = "Creates a new world and initializes it. If there is a world whith the same name it returns nil.

    NOTE: This function is currently unsafe, do not use!" }, + FindAndDoWithPlayer = { Params = "PlayerName, CallbackFunction", Return = "bool", Notes = "Calls the given callback function for the player with the name best matching the name string provided.
    This function is case-insensitive and will match partial names.
    Returns false if player not found or there is ambiguity, true otherwise. The CallbackFunction has the following signature:

    function Callback({{cPlayer|Player}})
    " }, + DoWithPlayerByUUID = { Params = "PlayerUUID, CallbackFunction", Return = "bool", Notes = "If there is the player with the uuid, calls the CallbackFunction with the {{cPlayer}} parameter representing the player. The CallbackFunction has the following signature:
    function Callback({{cPlayer|Player}})
    The function returns false if the player was not found, or whatever bool value the callback returned if the player was found." }, + ForEachPlayer = { Params = "CallbackFunction", Return = "", Notes = "Calls the given callback function for each player. The callback function has the following signature:
    function Callback({{cPlayer|cPlayer}})
    " }, + ForEachWorld = { Params = "CallbackFunction", Return = "", Notes = "Calls the given callback function for each world. The callback function has the following signature:
    function Callback({{cWorld|cWorld}})
    " }, + Get = { Params = "", Return = "Root object", Notes = "(STATIC) This function returns the cRoot object." }, + GetBuildCommitID = { Params = "", Return = "string", Notes = "(STATIC) For official builds (Travis CI / Jenkins) it returns the exact commit hash used for the build. For unofficial local builds, returns the approximate commit hash (since the true one cannot be determined), formatted as \"approx: <CommitHash>\"." }, + GetBuildDateTime = { Params = "", Return = "string", Notes = "(STATIC) For official builds (Travic CI / Jenkins) it returns the date and time of the build. For unofficial local builds, returns the approximate datetime of the commit (since the true one cannot be determined), formatted as \"approx: <DateTime-iso8601>\"." }, + GetBuildID = { Params = "", Return = "string", Notes = "(STATIC) For official builds (Travis CI / Jenkins) it returns the unique ID of the build, as recognized by the build system. For unofficial local builds, returns the string \"Unknown\"." }, + GetBuildSeriesName = { Params = "", Return = "string", Notes = "(STATIC) For official builds (Travis CI / Jenkins) it returns the series name of the build (for example \"Cuberite Windows x64 Master\"). For unofficial local builds, returns the string \"local build\"." }, + GetCraftingRecipes = { Params = "", Return = "{{cCraftingRecipe|cCraftingRecipe}}", Notes = "Returns the CraftingRecipes object" }, + GetDefaultWorld = { Params = "", Return = "{{cWorld|cWorld}}", Notes = "Returns the world object from the default world." }, + GetFurnaceFuelBurnTime = { Params = "{{cItem|Fuel}}", Return = "number", Notes = "(STATIC) Returns the number of ticks for how long the item would fuel a furnace. Returns zero if not a fuel." }, + GetFurnaceRecipe = { Params = "{{cItem|InItem}}", Return = "{{cItem|OutItem}}, NumTicks, {{cItem|InItem}}", Notes = "(STATIC) Returns the furnace recipe for smelting the specified input. If a recipe is found, returns the smelted result, the number of ticks required for the smelting operation, and the input consumed (note that Cuberite supports smelting M items into N items and different smelting rates). If no recipe is found, returns no value." }, + GetPhysicalRAMUsage = { Params = "", Return = "number", Notes = "Returns the amount of physical RAM that the entire Cuberite process is using, in KiB. Negative if the OS doesn't support this query." }, + GetPluginManager = { Params = "", Return = "{{cPluginManager|cPluginManager}}", Notes = "Returns the cPluginManager object." }, + GetPrimaryServerVersion = { Params = "", Return = "number", Notes = "Returns the servers primary server version." }, + GetProtocolVersionTextFromInt = { Params = "Protocol Version", Return = "string", Notes = "Returns the Minecraft version from the given Protocol. If there is no version found, it returns 'Unknown protocol(Parameter)'" }, + GetServer = { Params = "", Return = "{{cServer|cServer}}", Notes = "Returns the cServer object." }, + GetServerUpTime = { Params = "", Return = "number", Notes = "Returns the uptime of the server in seconds." }, + GetTotalChunkCount = { Params = "", Return = "number", Notes = "Returns the amount of loaded chunks." }, + GetVirtualRAMUsage = { Params = "", Return = "number", Notes = "Returns the amount of virtual RAM that the entire Cuberite process is using, in KiB. Negative if the OS doesn't support this query." }, + GetWebAdmin = { Params = "", Return = "{{cWebAdmin|cWebAdmin}}", Notes = "Returns the cWebAdmin object." }, + GetWorld = { Params = "WorldName", Return = "{{cWorld|cWorld}}", Notes = "Returns the cWorld object of the given world. It returns nil if there is no world with the given name." }, + QueueExecuteConsoleCommand = { Params = "Message", Return = "", Notes = "Queues a console command for execution through the cServer class. The command will be executed in the tick thread. The command's output will be sent to console." }, + SaveAllChunks = { Params = "", Return = "", Notes = "Saves all the chunks in all the worlds. Note that the saving is queued on each world's tick thread and this functions returns before the chunks are actually saved." }, + SetPrimaryServerVersion = { Params = "Protocol Version", Return = "", Notes = "Sets the servers PrimaryServerVersion to the given protocol number." } + }, + AdditionalInfo = + { + { + Header = "Querying a furnace recipe", + Contents = [[ + To find the furnace recipe for an item, use the following code (adapted from the Debuggers plugin's /fr command): +
    +local HeldItem = a_Player:GetEquippedItem();
    +local Out, NumTicks, In = cRoot:GetFurnaceRecipe(HeldItem);  -- Note STATIC call - no need for a Get()
    +if (Out ~= nil) then
    +	-- There is a recipe, list it:
    +	a_Player:SendMessage(
    +		"Furnace turns " .. ItemToFullString(In) ..
    +		" to " .. ItemToFullString(Out) ..
    +		" in " .. NumTicks .. " ticks (" ..
    +		tostring(NumTicks / 20) .. " seconds)."
    +	);
    +else
    +	-- No recipe found
    +	a_Player:SendMessage("There is no furnace recipe that would smelt " .. ItemToString(HeldItem));
    +end
    +
    + ]], + }, + }, + }, -- cRoot + + cScoreboard = + { + Desc = [[ + This class manages the objectives and teams of a single world. + ]], + Functions = + { + AddPlayerScore = { Params = "Name, Type, Value", Return = "", Notes = "Adds a value to all player scores of the specified objective type." }, + ForEachObjective = { Params = "CallBackFunction", Return = "bool", Notes = "Calls the specified callback for each objective in the scoreboard. Returns true if all objectives have been processed (including when there are zero objectives), or false if the callback function has aborted the enumeration by returning true. The callback function has the following signature:
    function Callback({{cObjective|Objective}})
    The callback should return false or no value to continue with the next objective, or true to abort the enumeration." }, + ForEachTeam = { Params = "CallBackFunction", Return = "bool", Notes = "Calls the specified callback for each team in the scoreboard. Returns true if all teams have been processed (including when there are zero teams), or false if the callback function has aborted the enumeration by returning true. The callback function has the following signature:
    function Callback({{cObjective|Objective}})
    The callback should return false or no value to continue with the next team, or true to abort the enumeration." }, + GetNumObjectives = { Params = "", Return = "number", Notes = "Returns the nuber of registered objectives." }, + GetNumTeams = { Params = "", Return = "number", Notes = "Returns the number of registered teams." }, + GetObjective = { Params = "string", Return = "{{cObjective}}", Notes = "Returns the objective with the specified name." }, + GetObjectiveIn = { Params = "DisplaySlot", Return = "{{cObjective}}", Notes = "Returns the objective in the specified display slot. Can be nil." }, + GetTeam = { Params = "string", Return = "{{cTeam}}", Notes = "Returns the team with the specified name." }, + RegisterObjective = { Params = "Name, DisplayName, Type", Return = "{{cObjective}}", Notes = "Registers a new scoreboard objective. Returns the {{cObjective}} instance, nil on error." }, + RegisterTeam = { Params = "Name, DisplayName, Prefix, Suffix", Return = "{{cTeam}}", Notes = "Registers a new team. Returns the {{cTeam}} instance, nil on error." }, + RemoveObjective = { Params = "string", Return = "bool", Notes = "Removes the objective with the specified name. Returns true if operation was successful." }, + RemoveTeam = { Params = "string", Return = "bool", Notes = "Removes the team with the specified name. Returns true if operation was successful." }, + SetDisplay = { Params = "Name, DisplaySlot", Return = "", Notes = "Updates the currently displayed objective." }, + }, + Constants = + { + dsCount = { Notes = "" }, + dsList = { Notes = "" }, + dsName = { Notes = "" }, + dsSidebar = { Notes = "" }, + }, + }, -- cScoreboard + + cServer = + { + Desc = [[ + This class manages all the client connections internally. In the API layer, it allows to get and set + the general properties of the server, such as the description and max players.

    +

    + It used to support broadcasting chat messages to all players, this functionality has been moved to + {{cRoot}}:BroadcastChat(). + ]], + Functions = + { + GetDescription = { Return = "string", Notes = "Returns the server description set in the settings.ini." }, + GetMaxPlayers = { Return = "number", Notes = "Returns the max amount of players who can join the server." }, + GetNumPlayers = { Return = "number", Notes = "Returns the amount of players online." }, + GetServerID = { Return = "string", Notes = "Returns the ID of the server?" }, + IsHardcore = { Params = "", Return = "bool", Notes = "Returns true if the server is hardcore (players get banned on death)." }, + SetMaxPlayers = { Params = "number", Notes = "Sets the max amount of players who can join." }, + ShouldAuthenticate = { Params = "", Return = "bool", Notes = "Returns true iff the server is set to authenticate players (\"online mode\")." }, + }, + }, -- cServer + + cStringCompression = + { + Desc = [[ + Provides functions to compress or decompress string +

    + All functions in this class are static, so they should be called in the dot convention: +

    +local CompressedString = cStringCompression.CompressStringGZIP("DataToCompress")
    +
    + ]], + + Functions = + { + CompressStringGZIP = {Params = "string", Return = "string", Notes = "Compress a string using GZIP"}, + CompressStringZLIB = {Params = "string, factor", Return = "string", Notes = "Compresses a string using ZLIB. Factor 0 is no compression and factor 9 is maximum compression"}, + InflateString = {Params = "string", Return = "string", Notes = "Uncompresses a string using Inflate"}, + UncompressStringGZIP = {Params = "string", Return = "string", Notes = "Uncompress a string using GZIP"}, + UncompressStringZLIB = {Params = "string, uncompressed length", Return = "string", Notes = "Uncompresses a string using ZLIB"}, + }, + }, + + cTeam = + { + Desc = [[ + This class manages a single player team. + ]], + Functions = + { + AddPlayer = { Params = "string", Returns = "bool", Notes = "Adds a player to this team. Returns true if the operation was successful." }, + AllowsFriendlyFire = { Params = "", Return = "bool", Notes = "Returns whether team friendly fire is allowed." }, + CanSeeFriendlyInvisible = { Params = "", Return = "bool", Notes = "Returns whether players can see invisible teammates." }, + HasPlayer = { Params = "string", Returns = "bool", Notes = "Returns whether the specified player is a member of this team." }, + GetDisplayName = { Params = "", Return = "string", Notes = "Returns the display name of the team." }, + GetName = { Params = "", Return = "string", Notes = "Returns the internal name of the team." }, + GetNumPlayers = { Params = "", Return = "number", Notes = "Returns the number of registered players." }, + GetPrefix = { Params = "", Return = "string", Notes = "Returns the prefix prepended to the names of the members of this team." }, + RemovePlayer = { Params = "string", Returns = "bool", Notes = "Removes the player with the specified name from this team. Returns true if the operation was successful." }, + Reset = { Params = "", Returns = "", Notes = "Removes all players from this team." }, + GetSuffix = { Params = "", Return = "string", Notes = "Returns the suffix appended to the names of the members of this team." }, + SetCanSeeFriendlyInvisible = { Params = "bool", Return = "", Notes = "Set whether players can see invisible teammates." }, + SetDisplayName = { Params = "string", Return = "", Notes = "Sets the display name of this team. (i.e. what will be shown to the players)" }, + SetFriendlyFire = { Params = "bool", Return = "", Notes = "Sets whether team friendly fire is allowed." }, + SetPrefix = { Params = "string", Return = "", Notes = "Sets the prefix prepended to the names of the members of this team." }, + SetSuffix = { Params = "string", Return = "", Notes = "Sets the suffix appended to the names of the members of this team." }, + }, + }, -- cTeam + + cTNTEntity = + { + Desc = "This class manages a TNT entity.", + Functions = + { + Explode = { Return = "", Notes = "Explode the tnt." }, + GetFuseTicks = { Return = "number", Notes = "Returns the fuse ticks until the tnt will explode." }, + SetFuseTicks = { Return = "number", Notes = "Set the fuse ticks until the tnt will explode." }, + }, + Inherits = "cEntity", + }, + + cWebPlugin = + { + Desc = "", + Functions = {}, + }, -- cWebPlugin + + cWindow = + { + Desc = [[ + This class is the common ancestor for all window classes used by Cuberite. It is inherited by the + {{cLuaWindow|cLuaWindow}} class that plugins use for opening custom windows. It is planned to be + used for window-related hooks in the future. It implements the basic functionality of any + window.

    +

    + Note that one cWindow object can be used for multiple players at the same time, and therefore the + slot contents are player-specific (e. g. crafting grid, or player inventory). Thus the GetSlot() and + SetSlot() functions need to have the {{cPlayer|cPlayer}} parameter that specifies the player for + whom the contents are to be queried.

    +

    + Windows also have numeric properties, these are used to set the progressbars for furnaces or the XP + costs for enchantment tables. + ]], + Functions = + { + GetSlot = { Params = "{{cPlayer|Player}}, SlotNumber", Return = "{{cItem}}", Notes = "Returns the item at the specified slot for the specified player. Returns nil and logs to server console on error." }, + GetWindowID = { Params = "", Return = "number", Notes = "Returns the ID of the window, as used by the network protocol" }, + GetWindowTitle = { Params = "", Return = "string", Notes = "Returns the window title that will be displayed to the player" }, + GetWindowType = { Params = "", Return = "number", Notes = "Returns the type of the window, one of the constants in the table above" }, + IsSlotInPlayerHotbar = { Params = "SlotNum", Return = "bool", Notes = "Returns true if the specified slot number is in the player hotbar" }, + IsSlotInPlayerInventory = { Params = "SlotNum", Return = "bool", Notes = "Returns true if the specified slot number is in the player's main inventory or in the hotbar. Note that this returns false for armor slots!" }, + IsSlotInPlayerMainInventory = { Params = "SlotNum", Return = "bool", Notes = "Returns true if the specified slot number is in the player's main inventory" }, + SetProperty = { Params = "PropertyID, PropartyValue, {{cPlayer|Player}}", Return = "", Notes = "Sends the UpdateWindowProperty (0x69) packet to the specified player; or to all players who are viewing this window if Player is not specified or nil." }, + SetSlot = { Params = "{{cPlayer|Player}}, SlotNum, {{cItem|cItem}}", Return = "", Notes = "Sets the contents of the specified slot for the specified player. Ignored if the slot number is invalid" }, + SetWindowTitle = { Params = "string", Return = "", Notes = "Sets the window title that will be displayed to the player" }, + }, + Constants = + { + wtInventory = { Notes = "An inventory window" }, + wtChest = { Notes = "A {{cChestEntity|chest}} or doublechest window" }, + wtWorkbench = { Notes = "A workbench (crafting table) window" }, + wtFurnace = { Notes = "A {{cFurnaceEntity|furnace}} window" }, + wtDropSpenser = { Notes = "A {{cDropperEntity|dropper}} or a {{cDispenserEntity|dispenser}} window" }, + wtEnchantment = { Notes = "An enchantment table window" }, + wtBrewery = { Notes = "A brewing stand window" }, + wtNPCTrade = { Notes = "A villager trade window" }, + wtBeacon = { Notes = "A beacon window" }, + wtAnvil = { Notes = "An anvil window" }, + wtHopper = { Notes = "A {{cHopperEntity|hopper}} window" }, + wtAnimalChest = { Notes = "A horse or donkey window" }, + }, + }, -- cWindow + + cWorld = + { + Desc = [[ + cWorld is the game world. It is the hub of all the information managed by individual classes, + providing convenient access to them. Cuberite supports multiple worlds in any combination of + world types. You can have two overworlds, three nethers etc. To enumerate all world the server + provides, use the {{cRoot}}:ForEachWorld() function.

    +

    + The world data is held in individual chunks. Each chunk consists of 16 (x) * 16 (z) * 256 (y) + blocks, each block is specified by its block type (8-bit) and block metadata (4-bit). + Additionally, each block has two light values calculated - skylight (how much daylight it receives) + and blocklight (how much light from light-emissive blocks it receives), both 4-bit.

    +

    + Each world runs several separate threads used for various housekeeping purposes, the most important + of those is the Tick thread. This thread updates the game logic 20 times per second, and it is + the thread where all the gameplay actions are evaluated. Liquid physics, entity interactions, + player ovement etc., all are applied in this thread.

    +

    + Additional threads include the generation thread (generates new chunks as needed, storage thread + (saves and loads chunk from the disk), lighting thread (updates block light values) and the + chunksender thread (compresses chunks to send to the clients).

    +

    + The world provides access to all its {{cPlayer|players}}, {{cEntity|entities}} and {{cBlockEntity|block + entities}}. Because of multithreading issues, individual objects cannot be retrieved for indefinite + handling, but rather must be modified in callbacks, within which they are guaranteed to stay valid.

    +

    + Physics for individual blocks are handled by the simulators. These will fire in each tick for all + blocks that have been scheduled for simulator update ("simulator wakeup"). The simulators include + liquid physics, falling blocks, fire spreading and extinguishing and redstone.

    +

    + Game time is also handled by the world. It provides the time-of-day and the total world age. + ]], + + Functions = + { + AreCommandBlocksEnabled = { Params = "", Return = "bool", Notes = "Returns whether command blocks are enabled on the (entire) server" }, + BroadcastBlockAction = { Params = "BlockX, BlockY, BlockZ, ActionByte1, ActionByte2, BlockType, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Broadcasts the BlockAction packet to all clients who have the appropriate chunk loaded (except ExcludeClient). The contents of the packet are specified by the parameters for the call, the blocktype needn't match the actual block that is present in the world data at the specified location." }, + BroadcastChat = { Params = "Message, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Sends the Message to all players in this world, except the optional ExcludeClient. No formatting is done by the server." }, + BroadcastChatDeath = { Params = "Message, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Prepends Gray [DEATH] / colours entire text (depending on ShouldUseChatPrefixes()) and broadcasts message. For when a player dies." }, + BroadcastChatFailure = { Params = "Message, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Prepends Rose [INFO] / colours entire text (depending on ShouldUseChatPrefixes()) and broadcasts message. For a command that failed to run because of insufficient permissions, etc." }, + BroadcastChatFatal = { Params = "Message, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Prepends Red [FATAL] / colours entire text (depending on ShouldUseChatPrefixes()) and broadcasts message. For a plugin that crashed, or similar." }, + BroadcastChatInfo = { Params = "Message, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Prepends Yellow [INFO] / colours entire text (depending on ShouldUseChatPrefixes()) and broadcasts message. For informational messages, such as command usage." }, + BroadcastChatSuccess = { Params = "Message, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Prepends Green [INFO] / colours entire text (depending on ShouldUseChatPrefixes()) and broadcasts message. For success messages." }, + BroadcastChatWarning = { Params = "Message, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Prepends Rose [WARN] / colours entire text (depending on ShouldUseChatPrefixes()) and broadcasts message. For concerning events, such as plugin reload etc." }, + BroadcastEntityAnimation = { Params = "{{cEntity|TargetEntity}}, Animation, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Sends an animation of an entity to all clienthandles (except ExcludeClient if given)" }, + BroadcastParticleEffect = { Params = "ParticleName, X, Y, Z, OffSetX, OffSetY, OffSetZ, ParticleData, ParticleAmmount, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Spawns the specified particles to all players in the world exept the optional ExeptClient. A list of available particles by thinkofdeath can be found {{https://gist.github.com/thinkofdeath/5110835|Here}}" }, + BroadcastSoundEffect = { Params = "SoundName, X, Y, Z, Volume, Pitch, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Sends the specified sound effect to all players in this world, except the optional ExceptClient" }, + BroadcastSoundParticleEffect = { Params = "EffectID, X, Y, Z, EffectData, [{{cClientHandle|ExcludeClient}}]", Return = "", Notes = "Sends the specified effect to all players in this world, except the optional ExceptClient" }, + CastThunderbolt = { Params = "X, Y, Z", Return = "", Notes = "Creates a thunderbolt at the specified coords" }, + ChangeWeather = { Params = "", Return = "", Notes = "Forces the weather to change in the next game tick. Weather is changed according to the normal rules: wSunny <-> wRain <-> wStorm" }, + ChunkStay = { Params = "ChunkCoordTable, OnChunkAvailable, OnAllChunksAvailable", Return = "", Notes = "Queues the specified chunks to be loaded or generated and calls the specified callbacks once they are loaded. ChunkCoordTable is an arra-table of chunk coords, each coord being a table of 2 numbers: { {Chunk1x, Chunk1z}, {Chunk2x, Chunk2z}, ...}. When any of those chunks are made available (including being available at the start of this call), the OnChunkAvailable() callback is called. When all the chunks are available, the OnAllChunksAvailable() callback is called. The function signatures are:

    function OnChunkAvailable(ChunkX, ChunkZ)\nfunction OnAllChunksAvailable()
    All return values from the callbacks are ignored." }, + CreateProjectile = { Params = "X, Y, Z, {{cProjectileEntity|ProjectileKind}}, {{cEntity|Creator}}, {{cItem|Originating Item}}, [{{Vector3d|Speed}}]", Return = "", Notes = "Creates a new projectile of the specified kind at the specified coords. The projectile's creator is set to Creator (may be nil). The item that created the projectile entity, commonly the {{cPlayer|player}}'s currently equipped item, is used at present for fireworks to correctly set their entity metadata. It is not used for any other projectile. Optional speed indicates the initial speed for the projectile." }, + DigBlock = { Params = "X, Y, Z", Return = "", Notes = "Replaces the specified block with air, without dropping the usual pickups for the block. Wakes up the simulators for the block and its neighbors." }, + DoExplosionAt = { Params = "Force, X, Y, Z, CanCauseFire, Source, SourceData", Return = "", Notes = "Creates an explosion of the specified relative force in the specified position. If CanCauseFire is set, the explosion will set blocks on fire, too. The Source parameter specifies the source of the explosion, one of the esXXX constants. The SourceData parameter is specific to each source type, usually it provides more info about the source." }, + DoWithBlockEntityAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a block entity at the specified coords, calls the CallbackFunction with the {{cBlockEntity}} parameter representing the block entity. The CallbackFunction has the following signature:
    function Callback({{cBlockEntity|BlockEntity}})
    The function returns false if there is no block entity, or if there is, it returns the bool value that the callback has returned. Use {{tolua}}.cast() to cast the Callback's BlockEntity parameter to the correct {{cBlockEntity}} descendant." }, + DoWithBeaconAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a beacon at the specified coords, calls the CallbackFunction with the {{cBeaconEntity}} parameter representing the beacon. The CallbackFunction has the following signature:
    function Callback({{cBeaconEntity|BeaconEntity}})
    The function returns false if there is no beacon, or if there is, it returns the bool value that the callback has returned." }, + DoWithChestAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a chest at the specified coords, calls the CallbackFunction with the {{cChestEntity}} parameter representing the chest. The CallbackFunction has the following signature:
    function Callback({{cChestEntity|ChestEntity}})
    The function returns false if there is no chest, or if there is, it returns the bool value that the callback has returned." }, + DoWithCommandBlockAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a command block at the specified coords, calls the CallbackFunction with the {{cCommandBlockEntity}} parameter representing the command block. The CallbackFunction has the following signature:
    function Callback({{cCommandBlockEntity|CommandBlockEntity}})
    The function returns false if there is no command block, or if there is, it returns the bool value that the callback has returned." }, + DoWithDispenserAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a dispenser at the specified coords, calls the CallbackFunction with the {{cDispenserEntity}} parameter representing the dispenser. The CallbackFunction has the following signature:
    function Callback({{cDispenserEntity|DispenserEntity}})
    The function returns false if there is no dispenser, or if there is, it returns the bool value that the callback has returned." }, + DoWithDropSpenserAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a dropper or a dispenser at the specified coords, calls the CallbackFunction with the {{cDropSpenserEntity}} parameter representing the dropper or dispenser. The CallbackFunction has the following signature:
    function Callback({{cDropSpenserEntity|DropSpenserEntity}})
    Note that this can be used to access both dispensers and droppers in a similar way. The function returns false if there is neither dispenser nor dropper, or if there is, it returns the bool value that the callback has returned." }, + DoWithDropperAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a dropper at the specified coords, calls the CallbackFunction with the {{cDropperEntity}} parameter representing the dropper. The CallbackFunction has the following signature:
    function Callback({{cDropperEntity|DropperEntity}})
    The function returns false if there is no dropper, or if there is, it returns the bool value that the callback has returned." }, + DoWithEntityByID = { Params = "EntityID, CallbackFunction", Return = "bool", Notes = "If an entity with the specified ID exists, calls the callback with the {{cEntity}} parameter representing the entity. The CallbackFunction has the following signature:
    function Callback({{cEntity|Entity}})
    The function returns false if the entity was not found, and it returns the same bool value that the callback has returned if the entity was found." }, + DoWithFlowerPotAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a flower pot at the specified coords, calls the CallbackFunction with the {{cFlowerPotEntity}} parameter representing the flower pot. The CallbackFunction has the following signature:
    function Callback({{cFlowerPotEntity|FlowerPotEntity}})
    The function returns false if there is no flower pot, or if there is, it returns the bool value that the callback has returned." }, + DoWithFurnaceAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a furnace at the specified coords, calls the CallbackFunction with the {{cFurnaceEntity}} parameter representing the furnace. The CallbackFunction has the following signature:
    function Callback({{cFurnaceEntity|FurnaceEntity}})
    The function returns false if there is no furnace, or if there is, it returns the bool value that the callback has returned." }, + DoWithMobHeadAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a mob head at the specified coords, calls the CallbackFunction with the {{cMobHeadEntity}} parameter representing the furnace. The CallbackFunction has the following signature:
    function Callback({{cMobHeadEntity|MobHeadEntity}})
    The function returns false if there is no mob head, or if there is, it returns the bool value that the callback has returned." }, + DoWithNoteBlockAt = { Params = "BlockX, BlockY, BlockZ, CallbackFunction", Return = "bool", Notes = "If there is a note block at the specified coords, calls the CallbackFunction with the {{cNoteEntity}} parameter representing the note block. The CallbackFunction has the following signature:
    function Callback({{cNoteEntity|NoteEntity}})
    The function returns false if there is no note block, or if there is, it returns the bool value that the callback has returned." }, + DoWithPlayer = { Params = "PlayerName, CallbackFunction", Return = "bool", Notes = "If there is a player of the specified name (exact match), calls the CallbackFunction with the {{cPlayer}} parameter representing the player. The CallbackFunction has the following signature:
    function Callback({{cPlayer|Player}})
    The function returns false if the player was not found, or whatever bool value the callback returned if the player was found." }, + DoWithPlayerByUUID = { Params = "PlayerUUID, CallbackFunction", Return = "bool", Notes = "If there is the player with the uuid, calls the CallbackFunction with the {{cPlayer}} parameter representing the player. The CallbackFunction has the following signature:
    function Callback({{cPlayer|Player}})
    The function returns false if the player was not found, or whatever bool value the callback returned if the player was found." }, + FastSetBlock = + { + { Params = "BlockX, BlockY, BlockZ, BlockType, BlockMeta", Return = "", Notes = "Sets the block at the specified coords, without waking up the simulators or replacing the block entities for the previous block type. Do not use if the block being replaced has a block entity tied to it!" }, + { Params = "{{Vector3i|BlockCoords}}, BlockType, BlockMeta", Return = "", Notes = "Sets the block at the specified coords, without waking up the simulators or replacing the block entities for the previous block type. Do not use if the block being replaced has a block entity tied to it!" }, + }, + FindAndDoWithPlayer = { Params = "PlayerName, CallbackFunction", Return = "bool", Notes = "Calls the given callback function for the player with the name best matching the name string provided.
    This function is case-insensitive and will match partial names.
    Returns false if player not found or there is ambiguity, true otherwise. The CallbackFunction has the following signature:
    function Callback({{cPlayer|Player}})
    " }, + ForEachBlockEntityInChunk = { Params = "ChunkX, ChunkZ, CallbackFunction", Return = "bool", Notes = "Calls the specified callback for each block entity in the chunk. Returns true if all block entities in the chunk have been processed (including when there are zero block entities), or false if the callback has aborted the enumeration by returning true. The CallbackFunction has the following signature:
    function Callback({{cBlockEntity|BlockEntity}})
    The callback should return false or no value to continue with the next block entity, or true to abort the enumeration. Use {{tolua}}.cast() to cast the Callback's BlockEntity parameter to the correct {{cBlockEntity}} descendant." }, + ForEachChestInChunk = { Params = "ChunkX, ChunkZ, CallbackFunction", Return = "bool", Notes = "Calls the specified callback for each chest in the chunk. Returns true if all chests in the chunk have been processed (including when there are zero chests), or false if the callback has aborted the enumeration by returning true. The CallbackFunction has the following signature:
    function Callback({{cChestEntity|ChestEntity}})
    The callback should return false or no value to continue with the next chest, or true to abort the enumeration." }, + ForEachEntity = { Params = "CallbackFunction", Return = "bool", Notes = "Calls the specified callback for each entity in the loaded world. Returns true if all the entities have been processed (including when there are zero entities), or false if the callback function has aborted the enumeration by returning true. The callback function has the following signature:
    function Callback({{cEntity|Entity}})
    The callback should return false or no value to continue with the next entity, or true to abort the enumeration." }, + ForEachEntityInBox = { Params = "{{cBoundingBox|Box}}, CallbackFunction", Return = "bool", Notes = "Calls the specified callback for each entity in the specified bounding box. Returns true if all the entities have been processed (including when there are zero entities), or false if the callback function has aborted the enumeration by returning true. If any chunk within the bounding box is not valid, it is silently skipped without any notification. The callback function has the following signature:
    function Callback({{cEntity|Entity}})
    The callback should return false or no value to continue with the next entity, or true to abort the enumeration." }, + ForEachEntityInChunk = { Params = "ChunkX, ChunkZ, CallbackFunction", Return = "bool", Notes = "Calls the specified callback for each entity in the specified chunk. Returns true if all the entities have been processed (including when there are zero entities), or false if the chunk is not loaded or the callback function has aborted the enumeration by returning true. The callback function has the following signature:
    function Callback({{cEntity|Entity}})
    The callback should return false or no value to continue with the next entity, or true to abort the enumeration." }, + ForEachFurnaceInChunk = { Params = "ChunkX, ChunkZ, CallbackFunction", Return = "bool", Notes = "Calls the specified callback for each furnace in the chunk. Returns true if all furnaces in the chunk have been processed (including when there are zero furnaces), or false if the callback has aborted the enumeration by returning true. The CallbackFunction has the following signature:
    function Callback({{cFurnaceEntity|FurnaceEntity}})
    The callback should return false or no value to continue with the next furnace, or true to abort the enumeration." }, + ForEachPlayer = { Params = "CallbackFunction", Return = "bool", Notes = "Calls the specified callback for each player in the loaded world. Returns true if all the players have been processed (including when there are zero players), or false if the callback function has aborted the enumeration by returning true. The callback function has the following signature:
    function Callback({{cPlayer|Player}})
    The callback should return false or no value to continue with the next player, or true to abort the enumeration." }, + GenerateChunk = { Params = "ChunkX, ChunkZ", Return = "", Notes = "Queues the specified chunk in the chunk generator. Ignored if the chunk is already generated (use RegenerateChunk() to force chunk re-generation)." }, + GetBiomeAt = { Params = "BlockX, BlockZ", Return = "eBiome", Notes = "Returns the biome at the specified coords. Reads the biome from the chunk, if it is loaded, otherwise it uses the chunk generator to provide the biome value." }, + GetBlock = + { + { Params = "BlockX, BlockY, BlockZ", Return = "BLOCKTYPE", Notes = "Returns the block type of the block at the specified coords, or 0 if the appropriate chunk is not loaded." }, + { Params = "{{Vector3i|BlockCoords}}", Return = "BLOCKTYPE", Notes = "Returns the block type of the block at the specified coords, or 0 if the appropriate chunk is not loaded." }, + }, + GetBlockBlockLight = { Params = "BlockX, BlockY, BlockZ", Return = "number", Notes = "Returns the amount of block light at the specified coords, or 0 if the appropriate chunk is not loaded." }, + GetBlockInfo = { Params = "BlockX, BlockY, BlockZ", Return = "BlockValid, BlockType, BlockMeta, BlockSkyLight, BlockBlockLight", Notes = "Returns the complete block info for the block at the specified coords. The first value specifies if the block is in a valid loaded chunk, the other values are valid only if BlockValid is true." }, + GetBlockMeta = + { + { Params = "BlockX, BlockY, BlockZ", Return = "number", Notes = "Returns the block metadata of the block at the specified coords, or 0 if the appropriate chunk is not loaded." }, + { Params = "{{Vector3i|BlockCoords}}", Return = "number", Notes = "Returns the block metadata of the block at the specified coords, or 0 if the appropriate chunk is not loaded." }, + }, + GetBlockSkyLight = { Params = "BlockX, BlockY, BlockZ", Return = "number", Notes = "Returns the block skylight of the block at the specified coords, or 0 if the appropriate chunk is not loaded." }, + GetBlockTypeMeta = { Params = "BlockX, BlockY, BlockZ", Return = "BlockValid, BlockType, BlockMeta", Notes = "Returns the block type and metadata for the block at the specified coords. The first value specifies if the block is in a valid loaded chunk, the other values are valid only if BlockValid is true." }, + GetDefaultWeatherInterval = { Params = "eWeather", Return = "", Notes = "Returns the default weather interval for the specific weather type. Returns -1 for any unknown weather." }, + GetDimension = { Params = "", Return = "eDimension", Notes = "Returns the dimension of the world - dimOverworld, dimNether or dimEnd." }, + GetGameMode = { Params = "", Return = "eGameMode", Notes = "Returns the gamemode of the world - gmSurvival, gmCreative or gmAdventure." }, + GetGeneratorQueueLength = { Params = "", Return = "number", Notes = "Returns the number of chunks that are queued in the chunk generator." }, + GetHeight = { Params = "BlockX, BlockZ", Return = "number", Notes = "Returns the maximum height of the particula block column in the world. If the chunk is not loaded, it waits for it to load / generate. WARNING: Do not use, Use TryGetHeight() instead for a non-waiting version, otherwise you run the risk of a deadlock!" }, + GetIniFileName = { Params = "", Return = "string", Notes = "Returns the name of the world.ini file that the world uses to store the information." }, + GetLightingQueueLength = { Params = "", Return = "number", Notes = "Returns the number of chunks in the lighting thread's queue." }, + GetLinkedEndWorldName = { Params = "", Return = "string", Notes = "Returns the name of the end world this world is linked to." }, + GetLinkedNetherWorldName = { Params = "", Return = "string", Notes = "Returns the name of the Netherworld linked to this world." }, + GetLinkedOverworldName = { Params = "", Return = "string", Notes = "Returns the name of the world this world is linked to." }, + GetMapManager = { Params = "", Return = "{{cMapManager}}", Notes = "Returns the {{cMapManager|MapManager}} object used by this world." }, + GetMaxCactusHeight = { Params = "", Return = "number", Notes = "Returns the configured maximum height to which cacti will grow naturally." }, + GetMaxNetherPortalHeight = { Params = "", Return = "number", Notes = "Returns the maximum height for a nether portal" }, + GetMaxNetherPortalWidth = { Params = "", Return = "number", Notes = "Returns the maximum width for a nether portal" }, + GetMaxSugarcaneHeight = { Params = "", Return = "number", Notes = "Returns the configured maximum height to which sugarcane will grow naturally." }, + GetMaxViewDistance = { Params = "", Return = "number", Notes = "Returns the maximum viewdistance that players can see in this world. The view distance is the amount of chunks around the player that the player can see." }, + GetMinNetherPortalHeight = { Params = "", Return = "number", Notes = "Returns the minimum height for a nether portal" }, + GetMinNetherPortalWidth = { Params = "", Return = "number", Notes = "Returns the minimum width for a nether portal" }, + GetName = { Params = "", Return = "string", Notes = "Returns the name of the world, as specified in the settings.ini file." }, + GetNumChunks = { Params = "", Return = "number", Notes = "Returns the number of chunks currently loaded." }, + GetScoreBoard = { Params = "", Return = "{{cScoreBoard}}", Notes = "Returns the {{cScoreBoard|ScoreBoard}} object used by this world. " }, + GetSignLines = { Params = "BlockX, BlockY, BlockZ", Return = "IsValid, [Line1, Line2, Line3, Line4]", Notes = "Returns true and the lines of a sign at the specified coords, or false if there is no sign at the coords." }, + GetSpawnX = { Params = "", Return = "number", Notes = "Returns the X coord of the default spawn" }, + GetSpawnY = { Params = "", Return = "number", Notes = "Returns the Y coord of the default spawn" }, + GetSpawnZ = { Params = "", Return = "number", Notes = "Returns the Z coord of the default spawn" }, + GetStorageLoadQueueLength = { Params = "", Return = "number", Notes = "Returns the number of chunks queued up for loading" }, + GetStorageSaveQueueLength = { Params = "", Return = "number", Notes = "Returns the number of chunks queued up for saving" }, + GetTicksUntilWeatherChange = { Params = "", Return = "number", Notes = "Returns the number of ticks that will pass before the weather is changed" }, + GetTimeOfDay = { Params = "", Return = "number", Notes = "Returns the number of ticks that have passed from the sunrise, 0 .. 24000." }, + GetTNTShrapnelLevel = { Params = "", Return = "{{Globals#ShrapnelLevel|ShrapnelLevel}}", Notes = "Returns the shrapnel level, representing the block types that are propelled outwards following an explosion. Based on this value and a random picker, blocks are selectively converted to physics entities (FallingSand) and flung outwards." }, + GetWeather = { Params = "", Return = "eWeather", Notes = "Returns the current weather in the world (wSunny, wRain, wStorm). To check for weather, use IsWeatherXXX() functions instead." }, + GetWorldAge = { Params = "", Return = "number", Notes = "Returns the total age of the world, in ticks. The age always grows, cannot be set by plugins and is unrelated to TimeOfDay." }, + GrowCactus = { Params = "BlockX, BlockY, BlockZ, NumBlocksToGrow", Return = "", Notes = "Grows a cactus block at the specified coords, by up to the specified number of blocks. Adheres to the world's maximum cactus growth (GetMaxCactusHeight())." }, + GrowMelonPumpkin = { Params = "BlockX, BlockY, BlockZ, StemType", Return = "", Notes = "Grows a melon or pumpkin, based on the stem type specified (assumed to be in the coords provided). Checks for normal melon / pumpkin growth conditions - stem not having another produce next to it and suitable ground below." }, + GrowRipePlant = { Params = "BlockX, BlockY, BlockZ, IsByBonemeal", Return = "bool", Notes = "Grows the plant at the specified coords. If IsByBonemeal is true, checks first if the specified plant type is bonemealable in the settings. Returns true if the plant was grown, false if not." }, + GrowSugarcane = { Params = "BlockX, BlockY, BlockZ, NumBlocksToGrow", Return = "", Notes = "Grows a sugarcane block at the specified coords, by up to the specified number of blocks. Adheres to the world's maximum sugarcane growth (GetMaxSugarcaneHeight())." }, + GrowTree = { Params = "BlockX, BlockY, BlockZ", Return = "", Notes = "Grows a tree based at the specified coords. If there is a sapling there, grows the tree based on that sapling, otherwise chooses a tree image based on the biome." }, + GrowTreeByBiome = { Params = "BlockX, BlockY, BlockZ", Return = "", Notes = "Grows a tree based at the specified coords. The tree type is picked from types available for the biome at those coords." }, + GrowTreeFromSapling = { Params = "BlockX, BlockY, BlockZ, SaplingMeta", Return = "", Notes = "Grows a tree based at the specified coords. The tree type is determined from the sapling meta (the sapling itself needn't be present)." }, + IsBlockDirectlyWatered = { Params = "BlockX, BlockY, BlockZ", Return = "bool", Notes = "Returns true if the specified block has a water block right next to it (on the X/Z axes)" }, + IsDaylightCycleEnabled = { Params = "", Return = "bool", Notes = "Returns true if the daylight cycle is enabled." }, + IsDeepSnowEnabled = { Params = "", Return = "bool", Notes = "Returns whether the configuration has DeepSnow enabled." }, + IsGameModeAdventure = { Params = "", Return = "bool", Notes = "Returns true if the current gamemode is gmAdventure." }, + IsGameModeCreative = { Params = "", Return = "bool", Notes = "Returns true if the current gamemode is gmCreative." }, + IsGameModeSpectator = { Params = "", Return = "bool", Notes = "Returns true if the current gamemode is gmSpectator." }, + IsGameModeSurvival = { Params = "", Return = "bool", Notes = "Returns true if the current gamemode is gmSurvival." }, + IsPVPEnabled = { Params = "", Return = "bool", Notes = "Returns whether PVP is enabled in the world settings." }, + IsTrapdoorOpen = { Params = "BlockX, BlockY, BlockZ", Return = "bool", Notes = "Returns false if there is no trapdoor there or if the block isn't a trapdoor or if the chunk wasn't loaded. Returns true if trapdoor is open." }, + IsWeatherRain = { Params = "", Return = "bool", Notes = "Returns true if the current world is raining." }, + IsWeatherRainAt = { Params = "BlockX, BlockZ", Return = "bool", Notes = "Returns true if the specified location is raining (takes into account biomes)." }, + IsWeatherStorm = { Params = "", Return = "bool", Notes = "Returns true if the current world is stormy." }, + IsWeatherStormAt = { Params = "BlockX, BlockZ", Return = "bool", Notes = "Returns true if the specified location is stormy (takes into account biomes)." }, + IsWeatherSunny = { Params = "", Return = "bool", Notes = "Returns true if the current weather is sunny." }, + IsWeatherSunnyAt = { Params = "BlockX, BlockZ", Return = "bool", Notes = "Returns true if the current weather is sunny at the specified location (takes into account biomes)." }, + IsWeatherWet = { Params = "", Return = "bool", Notes = "Returns true if the current world has any precipitation (rain or storm)." }, + IsWeatherWetAt = { Params = "BlockX, BlockZ", Return = "bool", Notes = "Returns true if the specified location has any precipitation (rain or storm) (takes into account biomes)." }, + PrepareChunk = { Params = "ChunkX, ChunkZ, [Callback]", Return = "", Notes = "Queues the chunk for preparing - making sure that it's generated and lit. It is legal to call with no callback. The callback function has the following signature:
    function Callback(ChunkX, ChunkZ)
    " }, + QueueBlockForTick = { Params = "BlockX, BlockY, BlockZ, TicksToWait", Return = "", Notes = "Queues the specified block to be ticked after the specified number of gameticks." }, + QueueSaveAllChunks = { Params = "", Return = "", Notes = "Queues all chunks to be saved in the world storage thread" }, + QueueSetBlock = { Params = "BlockX, BlockY, BlockZ, BlockType, BlockMeta, TickDelay", Return = "", Notes = "Queues the block to be set to the specified blocktype and meta after the specified amount of game ticks. Uses SetBlock() for the actual setting, so simulators are woken up and block entities are handled correctly." }, + QueueTask = { Params = "TaskFunction", Return = "", Notes = "Queues the specified function to be executed in the tick thread. This is the primary means of interaction with a cWorld from the WebAdmin page handlers (see {{WebWorldThreads}}). The function signature is
    function()
    All return values from the function are ignored. Note that this function is actually called *after* the QueueTask() function returns. Note that it is unsafe to store references to Cuberite objects, such as entities, across from the caller to the task handler function; store the EntityID instead." }, + QueueUnloadUnusedChunks = { Params = "", Return = "", Notes = "Queues a cTask that unloads chunks that are no longer needed and are saved." }, + RegenerateChunk = { Params = "ChunkX, ChunkZ", Return = "", Notes = "Queues the specified chunk to be re-generated, overwriting the current data. To queue a chunk for generating only if it doesn't exist, use the GenerateChunk() instead." }, + ScheduleTask = { Params = "DelayTicks, TaskFunction", Return = "", Notes = "Queues the specified function to be executed in the world's tick thread after a the specified number of ticks. This enables operations to be queued for execution in the future. The function signature is
    function({{cWorld|World}})
    All return values from the function are ignored. Note that it is unsafe to store references to Cuberite objects, such as entities, across from the caller to the task handler function; store the EntityID instead." }, + SendBlockTo = { Params = "BlockX, BlockY, BlockZ, {{cPlayer|Player}}", Return = "", Notes = "Sends the block at the specified coords to the specified player's client, as an UpdateBlock packet." }, + SetAreaBiome = { + { Params = "MinX, MaxX, MinZ, MaxZ, EMCSBiome", Return = "bool", Notes = "Sets the biome in the rectangular area specified. Returns true if successful, false if any of the chunks were unloaded." }, + { Params = "{{cCuboid|Cuboid}}, EMCSBiome", Return = "bool", Notes = "Sets the biome in the cuboid specified. Returns true if successful, false if any of the chunks were unloaded. The cuboid needn't be sorted." }, + }, + SetBiomeAt = { Params = "BlockX, BlockZ, EMCSBiome", Return = "bool", Notes = "Sets the biome at the specified block coords. Returns true if successful, false otherwise." }, + SetBlock = { Params = "BlockX, BlockY, BlockZ, BlockType, BlockMeta", Return = "", Notes = "Sets the block at the specified coords, replaces the block entities for the previous block type, creates a new block entity for the new block, if appropriate, and wakes up the simulators. This is the preferred way to set blocks, as opposed to FastSetBlock(), which is only to be used under special circumstances." }, + SetBlockMeta = + { + { Params = "BlockX, BlockY, BlockZ, BlockMeta", Return = "", Notes = "Sets the meta for the block at the specified coords." }, + { Params = "{{Vector3i|BlockCoords}}, BlockMeta", Return = "", Notes = "Sets the meta for the block at the specified coords." }, + }, + SetChunkAlwaysTicked = { Params = "ChunkX, ChunkZ, IsAlwaysTicked", Return = "", Notes = "Sets the chunk to always be ticked even when it doesn't contain any clients. IsAlwaysTicked set to true turns forced ticking on, set to false turns it off. Every call with 'true' should be paired with a later call with 'false', otherwise the ticking won't stop. Multiple actions can request ticking independently, the ticking will continue until the last call with 'false'. Note that when the chunk unloads, it loses the value of this flag." }, + SetNextBlockTick = { Params = "BlockX, BlockY, BlockZ", Return = "", Notes = "Sets the blockticking to start at the specified block in the next tick." }, + SetCommandBlockCommand = { Params = "BlockX, BlockY, BlockZ, Command", Return = "bool", Notes = "Sets the command to be executed in a command block at the specified coordinates. Returns if command was changed." }, + SetCommandBlocksEnabled = { Params = "IsEnabled (bool)", Return = "", Notes = "Sets whether command blocks should be enabled on the (entire) server." }, + SetDaylightCycleEnabled = { Params = "bool", Return = "", Notes = "Starts or stops the daylight cycle." }, + SetLinkedEndWorldName = { Params = "string", Return = "", Notes = "Sets the name of the world that the end portal should link to." }, + SetLinkedNetherWorldName = { Params = "string", Return = "", Notes = "Sets the name of the world that the nether portal should link to." }, + SetLinkedOverworldName = { Params = "string", Return = "", Notes = "Sets the name of the world that the nether portal should link to?" }, + SetMaxViewDistance = { Params = "number", Return = "", Notes = "Sets the maximum viewdistance of the players in the world." }, + SetMaxNetherPortalHeight = { Params = "number", Return = "", Notes = "Sets the maximum height for a nether portal" }, + SetMaxNetherPortalWidth = { Params = "number", Return = "", Notes = "Sets the maximum width for a nether portal" }, + SetMinNetherPortalHeight = { Params = "number", Return = "", Notes = "Sets the minimum height for a nether portal" }, + SetMinNetherPortalWidth = { Params = "number", Return = "", Notes = "Sets the minimum width for a nether portal" }, + SetShouldUseChatPrefixes = { Params = "", Return = "ShouldUse (bool)", Notes = "Sets whether coloured chat prefixes such as [INFO] is used with the SendMessageXXX() or BroadcastChatXXX(), or simply the entire message is coloured in the respective colour." }, + SetSignLines = { Params = "X, Y, Z, Line1, Line2, Line3, Line4, [{{cPlayer|Player}}]", Return = "", Notes = "Sets the sign text at the specified coords. The sign-updating hooks are called for the change. The Player parameter is used to indicate the player from whom the change has come, it may be nil." }, + SetTicksUntilWeatherChange = { Params = "NumTicks", Return = "", Notes = "Sets the number of ticks after which the weather will be changed." }, + SetTimeOfDay = { Params = "TimeOfDayTicks", Return = "", Notes = "Sets the time of day, expressed as number of ticks past sunrise, in the range 0 .. 24000." }, + SetTNTShrapnelLevel = { Params = "{{Globals#ShrapnelLevel|ShrapnelLevel}}", Return = "", Notes = "Sets the Shrampel level of the world." }, + SetTrapdoorOpen = { Params = "BlockX, BlockY, BlockZ, bool", Return = "", Notes = "Opens or closes a trapdoor at the specific coordinates." }, + SetWeather = { Params = "Weather", Return = "", Notes = "Sets the current weather (wSunny, wRain, wStorm) and resets the TicksUntilWeatherChange to the default value for the new weather. The normal weather-changing hooks are called for the change." }, + ShouldBroadcastAchievementMessages = { Params = "", Return = "bool", Notes = "Returns true if the server should broadcast achievement messages in this world." }, + ShouldBroadcastDeathMessages = { Params = "", Return = "bool", Notes = "Returns true if the server should broadcast death messages in this world." }, + ShouldUseChatPrefixes = { Params = "", Return = "bool", Notes = "Returns whether coloured chat prefixes are prepended to chat messages or the entire message is simply coloured." }, + ShouldLavaSpawnFire = { Params = "", Return = "bool", Notes = "Returns true if the world is configured to spawn fires near lava (world.ini: [Physics].ShouldLavaSpawnFire value)" }, + SpawnItemPickups = + { + { Params = "{{cItems|Pickups}}, X, Y, Z, FlyAwaySpeed", Return = "", Notes = "Spawns the specified pickups at the position specified. The FlyAway speed is used to initialize the random speed in which the pickups fly away from the spawn position." }, + { Params = "{{cItems|Pickups}}, X, Y, Z, SpeedX, SpeedY, SpeedZ", Return = "", Notes = "Spawns the specified pickups at the position specified. All the pickups fly away from the spawn position using the specified speed." }, + }, + SpawnMinecart = { Params = "X, Y, Z, MinecartType, Item, BlockHeight", Return = "number", Notes = "Spawns a minecart at the specific coordinates. MinecartType is the item type of the minecart. If the minecart is an empty minecart then the given item is the block inside the minecart, and blockheight is the distance of the block and the minecart." }, + SpawnMob = { Params = "X, Y, Z, {{cMonster|MonsterType}}, [Baby]", Return = "EntityID", Notes = "Spawns the specified type of mob at the specified coords. If the Baby parameter is true, the mob will be a baby. Returns the EntityID of the creates entity, or -1 on failure. " }, + SpawnFallingBlock = { Params = "X, Y, Z, BlockType, BlockMeta", Return = "EntityID", Notes = "Spawns an {{cFallingBlock|Falling Block}} entity at the specified coords with the given block type/meta" }, + SpawnExperienceOrb = { Params = "X, Y, Z, Reward", Return = "EntityID", Notes = "Spawns an {{cExpOrb|experience orb}} at the specified coords, with the given reward" }, + SpawnPrimedTNT = { Params = "X, Y, Z, FuseTicks, InitialVelocityCoeff", Return = "", Notes = "Spawns a {{cTNTEntity|primed TNT entity}} at the specified coords, with the given fuse ticks. The entity gets a random speed multiplied by the InitialVelocityCoeff, 1 being the default value." }, + TryGetHeight = { Params = "BlockX, BlockZ", Return = "IsValid, Height", Notes = "Returns true and height of the highest non-air block if the chunk is loaded, or false otherwise." }, + UpdateSign = { Params = "X, Y, Z, Line1, Line2, Line3, Line4, [{{cPlayer|Player}}]", Return = "", Notes = "(DEPRECATED) Please use SetSignLines()." }, + UseBlockEntity = { Params = "{{cPlayer|Player}}, BlockX, BlockY, BlockZ", Return = "", Notes = "Makes the specified Player use the block entity at the specified coords (open chest UI, etc.) If the cords are in an unloaded chunk or there's no block entity, ignores the call." }, + VillagersShouldHarvestCrops = { Params = "", Return = "", Notes = "Returns true if villagers can harvest crops." }, + WakeUpSimulators = { Params = "BlockX, BlockY, BlockZ", Return = "", Notes = "Wakes up the simulators for the specified block." }, + WakeUpSimulatorsInArea = { Params = "MinBlockX, MaxBlockX, MinBlockY, MaxBlockY, MinBlockZ, MaxBlockZ", Return = "", Notes = "Wakes up the simulators for all the blocks in the specified area (edges inclusive)." }, + }, + AdditionalInfo = + { + { + Header = "Using callbacks", + Contents = [[ + To avoid problems with stale objects, the cWorld class will not let plugins get a direct pointer + to an {{cEntity|entity}}, {{cBlockEntity|block entity}} or a {{cPlayer|player}}. Such an object + could be modified or even destroyed by another thread while the plugin holds it, so it would be + rather unsafe.

    +

    + Instead, the cWorld provides access to these objects using callbacks. The plugin provides a + function that is called and receives the object as a parameter; cWorld guarantees that while + the callback is executing, the object will stay valid. If a plugin needs to "remember" the + object outside of the callback, it needs to store the entity ID, blockentity coords or player + name.

    +

    + The following code examples show how to use the callbacks

    +

    + This code teleports player Player to another player named ToName in the same world: +

    +-- Player is a cPlayer object
    +-- ToName is a string
    +-- World is a cWorld object
    +World:ForEachPlayer(
    +	function (a_OtherPlayer)
    +	if (a_OtherPlayer:GetName() == ToName) then
    +		Player:TeleportToEntity(a_OtherPlayer);
    +	end
    +);
    +

    +

    + This code fills each furnace in the chunk with 64 coals: +

    +-- Player is a cPlayer object
    +-- World is a cWorld object
    +World:ForEachFurnaceInChunk(Player:GetChunkX(), Player:GetChunkZ(),
    +	function (a_Furnace)
    +		a_Furnace:SetFuelSlot(cItem(E_ITEM_COAL, 64));
    +	end
    +);
    +

    +

    + This code teleports all spiders up by 100 blocks: +

    +-- World is a cWorld object
    +World:ForEachEntity(
    +	function (a_Entity)
    +		if not(a_Entity:IsMob()) then
    +			return;
    +		end
    +
    +		-- Get the cMonster out of cEntity, now that we know the entity represents one.
    +		local Monster = tolua.cast(a_Entity, "cMonster");
    +		if (Monster:GetMobType() == mtSpider) then
    +			Monster:TeleportToCoords(Monster:GetPosX(), Monster:GetPosY() + 100, Monster:GetPosZ());
    +		end
    +	end
    +);
    +

    + ]], + }, + }, -- AdditionalInfo + }, -- cWorld + + ItemCategory = + { + Desc = [[ + This class contains static functions for determining item categories. All of the functions are + called directly on the class table, unlike most other object, which require an instance first. + ]], + Functions = + { + IsArmor = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of an armor." }, + IsAxe = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of an axe." }, + IsBoots = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of boots." }, + IsChestPlate = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a chestplate." }, + IsHelmet = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a helmet." }, + IsHoe = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a hoe." }, + IsLeggings = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a leggings." }, + IsPickaxe = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a pickaxe." }, + IsShovel = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a shovel." }, + IsSword = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a sword." }, + IsTool = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a tool (axe, hoe, pickaxe, shovel or FIXME: sword)" }, + }, + AdditionalInfo = + { + { + Header = "Code example", + Contents = [[ + The following code snippet checks if the player holds a shovel. +
    +-- a_Player is a {{cPlayer}} object, possibly received as a hook param
    +local HeldItem = a_Player:GetEquippedItem()
    +if (ItemCategory.IsShovel(HeldItem.m_ItemType)) then
    +	-- It's a shovel
    +end
    +
    + ]], + } + }, + }, -- ItemCategory + + lxp = + { + Desc = [[ + This class provides an interface to the XML parser, + {{http://matthewwild.co.uk/projects/luaexpat/|LuaExpat}}. It provides a SAX interface with an + incremental XML parser.

    +

    + With an event-based API like SAX the XML document can be fed to the parser in chunks, and the + parsing begins as soon as the parser receives the first document chunk. LuaExpat reports parsing + events (such as the start and end of elements) directly to the application through callbacks. The + parsing of huge documents can benefit from this piecemeal operation.

    +

    + See the online + {{http://matthewwild.co.uk/projects/luaexpat/manual.html#parser|LuaExpat documentation}} for details + on how to work with this parser. The code examples below should provide some basic help, too. + ]], + Functions = + { + new = {Params = "CallbacksTable, [SeparatorChar]", Return = "XMLParser object", Notes = "Creates a new XML parser object, with the specified callbacks table and optional separator character."}, + }, + Constants = + { + _COPYRIGHT = { Notes = "" }, + _DESCRIPTION = { Notes = "" }, + _VERSION = { Notes = "" }, + }, + AdditionalInfo = + { + { + Header = "Parser callbacks", + Contents = [[ + The callbacks table passed to the new() function specifies the Lua functions that the parser + calls upon various events. The following table lists the most common functions used, for a + complete list see the online + {{http://matthewwild.co.uk/projects/luaexpat/manual.html#parser|LuaExpat documentation}}.

    + + + + + +
    Function nameParametersNotes
    CharacterDataParser, stringCalled when the parser recognizes a raw string inside the element
    EndElementParser, ElementNameCalled when the parser detects the ending of an XML element
    StartElementParser, ElementName, AttributesTableCalled when the parser detects the start of an XML element. The AttributesTable is a Lua table containing all the element's attributes, both in the array section (in the order received) and in the dictionary section.
    + ]], + }, + { + Header = "XMLParser object", + Contents = [[ + The XMLParser object returned by lxp.new provides the functions needed to parse the XML. The + following list provides the most commonly used ones, for a complete list see the online + {{http://matthewwild.co.uk/projects/luaexpat/manual.html#parser|LuaExpat documentation}}. + + ]], + }, + { + Header = "Code example", + Contents = [[ + The following code reads an entire XML file and outputs its logical structure into the console: +
    +local Depth = 0;
    +
    +-- Define the callbacks:
    +local Callbacks = {
    +	CharacterData = function(a_Parser, a_String)
    +		LOG(string.rep(" ", Depth) .. "* " .. a_String);
    +	end
    +
    +	EndElement = function(a_Parser, a_ElementName)
    +		Depth = Depth - 1;
    +		LOG(string.rep(" ", Depth) .. "- " .. a_ElementName);
    +	end
    +
    +	StartElement = function(a_Parser, a_ElementName, a_Attribs)
    +		LOG(string.rep(" ", Depth) .. "+ " .. a_ElementName);
    +		Depth = Depth + 1;
    +	end
    +}
    +
    +-- Create the parser:
    +local Parser = lxp.new(Callbacks);
    +
    +-- Parse the XML file:
    +local f = io.open("file.xml", "rb");
    +while (true) do
    +	local block = f:read(128 * 1024);  -- Use a 128KiB buffer for reading
    +	if (block == nil) then
    +		-- End of file
    +		break;
    +	end
    +	Parser:parse(block);
    +end
    +
    +-- Signalize to the parser that no more data is coming
    +Parser:parse();
    +
    +-- Close the parser:
    +Parser:close();
    +
    + ]], + }, + }, -- AdditionalInfo + }, -- lxp + + sqlite3 = + { + Desc = [[ + ]], + + Functions = + { + complete = { Params = "string", Return = "bool", Notes = "Returns true if the string sql comprises one or more complete SQL statements and false otherwise." }, + open = { Params = "FileName", Return = "DBClass", Notes = [[ + Opens (or creates if it does not exist) an SQLite database with name filename and returns its + handle as userdata (the returned object should be used for all further method calls in connection + with this specific database, see + {{http://lua.sqlite.org/index.cgi/doc/tip/doc/lsqlite3.wiki#database_methods|Database methods}}). + Example: +
    +-- open the database:
    +myDB = sqlite3.open('MyDatabaseFile.sqlite3')
    +
    +-- do some database calls...
    +
    +-- Close the database:
    +myDB:close()
    +
    + ]], }, + open_memory = { Return = "DBClass", Notes = "Opens an SQLite database in memory and returns its handle as userdata. In case of an error, the function returns nil, an error code and an error message. (In-memory databases are volatile as they are never stored on disk.)" }, + version = { Return = "string", Notes = "Returns a string with SQLite version information, in the form 'x.y[.z]'." }, + }, + }, + + TakeDamageInfo = + { + Desc = [[ + This class contains the amount of damage, and the entity that caused the damage. It is used in the + {{OnTakeDamage|HOOK_TAKE_DAMAGE}} hook and in the {{cEntity}}'s TakeDamage() function. + ]], + Variables = + { + Attacker = { Type = "{{cEntity}}", Notes = "The entity who is attacking. Only valid if dtAttack." }, + DamageType = { Type = "eDamageType", Notes = "Source of the damage. One of the dtXXX constants." }, + FinalDamage = { Type = "number", Notes = " The final amount of damage that will be applied to the Receiver. It is the RawDamage minus any Receiver's armor-protection " }, + Knockback = { Type = "{{Vector3d}}", Notes = "Vector specifying the amount and direction of knockback that will be applied to the Receiver " }, + RawDamage = { Type = "number", Notes = "Amount of damage that the attack produces on the Receiver, including the Attacker's equipped weapon, but excluding the Receiver's armor." }, + }, + AdditionalInfo = + { + { + Header = "", + Contents = [[ + The TDI is passed as the second parameter in the HOOK_TAKE_DAMAGE hook, and can be used to + modify the damage before it is applied to the receiver: +
    +function OnTakeDamage(Receiver, TDI)
    +	LOG("Damage: Raw ".. TDI.RawDamage .. ", Final:" .. TDI.FinalDamage);
    +
    +	-- If the attacker is a spider, make it deal 999 points of damage (insta-death spiders):
    +	if ((TDI.Attacker ~= nil) and TDI.Attacker:IsA("cSpider")) then
    +		TDI.FinalDamage = 999;
    +	end
    +end
    +
    + ]], + }, + }, -- AdditionalInfo + }, -- TakeDamageInfo + + tolua = + { + Desc = [[ + This class represents the tolua bridge between the Lua API and Cuberite. It supports some low + level operations and queries on the objects. See also the tolua++'s documentation at + {{http://www.codenix.com/~tolua/tolua++.html#utilities}}. Normally you shouldn't use any of these + functions except for type() + ]], + Functions = + { + cast = { Params = "Object, TypeStr", Return = "Object", Notes = "Casts the object to the specified type.
    Note: This is a potentially unsafe operation and it could crash the server. There is normally no need to use this function at all, so don't use it unless you know exactly what you're doing." }, + getpeer = { Params = "", Return = "", Notes = "" }, + inherit = { Params = "", Return = "", Notes = "" }, + releaseownership = { Params = "", Return = "", Notes = "" }, + setpeer = { Params = "", Return = "", Notes = "" }, + takeownership = { Params = "", Return = "", Notes = "" }, + type = { Params = "Object", Return = "TypeStr", Notes = "Returns a string representing the type of the object. This works similar to Lua's built-in type() function, but recognizes the underlying C++ classes, too." }, + }, + }, -- tolua + + Globals = + { + Desc = [[ + These functions are available directly, without a class instance. Any plugin can call them at any + time. + ]], + Functions = + { + AddFaceDirection = {Params = "BlockX, BlockY, BlockZ, BlockFace, [IsInverse]", Return = "BlockX, BlockY, BlockZ", Notes = "Returns the coords of a block adjacent to the specified block through the specified {{Globals#BlockFaces|face}}"}, + BlockFaceToString = {Params = "{{Globals#BlockFaces|eBlockFace}}", Return = "string", Notes = "Returns the string representation of the {{Globals#BlockFaces|eBlockFace}} constant. Uses the axis-direction-based names, such as BLOCK_FACE_XP." }, + BlockStringToType = {Params = "BlockTypeString", Return = "BLOCKTYPE", Notes = "Returns the block type parsed from the given string"}, + Clamp = {Params = "Number, Min, Max", Return = "number", Notes = "Clamp the number to the specified range."}, + ClickActionToString = {Params = "{{Globals#ClickAction|ClickAction}}", Return = "string", Notes = "Returns a string description of the ClickAction enumerated value"}, + DamageTypeToString = {Params = "{{Globals#DamageType|DamageType}}", Return = "string", Notes = "Converts the {{Globals#DamageType|DamageType}} enumerated value to a string representation "}, + EscapeString = {Params = "string", Return = "string", Notes = "Returns a copy of the string with all quotes and backslashes escaped by a backslash"}, + GetChar = {Params = "String, Pos", Return = "string", Notes = "Returns one character from the string, specified by position "}, + GetIniItemSet = { Params = "IniFile, SectionName, KeyName, DefaultValue", Return = "{{cItem}}", Notes = "Returns the item that has been read from the specified INI file value. If the value is not present in the INI file, the DefaultValue is stored in the file and parsed as the result. Returns empty item if the value cannot be parsed. " }, + GetTime = {Return = "number", Notes = "Returns the current OS time, as a unix time stamp (number of seconds since Jan 1, 1970)"}, + IsBiomeNoDownfall = {Params = "Biome", Return = "bool", Notes = "Returns true if the biome is 'dry', that is, there is no precipitation during rains and storms." }, + IsValidBlock = {Params = "BlockType", Return = "bool", Notes = "Returns true if BlockType is a known block type"}, + IsValidItem = {Params = "ItemType", Return = "bool", Notes = "Returns true if ItemType is a known item type"}, + ItemToFullString = {Params = "{{cItem|cItem}}", Return = "string", Notes = "Returns the string representation of the item, in the format 'ItemTypeText:ItemDamage * Count'"}, + ItemToString = {Params = "{{cItem|cItem}}", Return = "string", Notes = "Returns the string representation of the item type"}, + ItemTypeToString = {Params = "ItemType", Return = "string", Notes = "Returns the string representation of ItemType "}, + LOG = + { + {Params = "string", Notes = "Logs a text into the server console using 'normal' severity (gray text)"}, + {Params = "{{cCompositeChat|CompositeChat}}", Notes = "Logs the {{cCompositeChat}}'s human-readable text into the server console. The severity is converted from the CompositeChat's MessageType."}, + }, + LOGERROR = + { + {Params = "string", Notes = "Logs a text into the server console using 'error' severity (black text on red background)"}, + {Params = "{{cCompositeChat|CompositeChat}}", Notes = "Logs the {{cCompositeChat}}'s human-readable text into the server console using 'error' severity (black text on red background)"}, + }, + LOGINFO = + { + {Params = "string", Notes = "Logs a text into the server console using 'info' severity (yellow text)"}, + {Params = "{{cCompositeChat|CompositeChat}}", Notes = "Logs the {{cCompositeChat}}'s human-readable text into the server console using 'info' severity (yellow text)"}, + }, + LOGWARN = + { + {Params = "string", Notes = "Logs a text into the server console using 'warning' severity (red text); OBSOLETE, use LOGWARNING() instead"}, + {Params = "{{cCompositeChat|CompositeChat}}", Notes = "Logs the {{cCompositeChat}}'s human-readable text into the server console using 'warning' severity (red text); OBSOLETE, use LOGWARNING() instead"}, + }, + LOGWARNING = + { + {Params = "string", Notes = "Logs a text into the server console using 'warning' severity (red text)"}, + {Params = "{{cCompositeChat|CompositeChat}}", Notes = "Logs the {{cCompositeChat}}'s human-readable text into the server console using 'warning' severity (red text)"}, + }, + MirrorBlockFaceY = { Params = "{{Globals#BlockFaces|eBlockFace}}", Return = "{{Globals#BlockFaces|eBlockFace}}", Notes = "Returns the {{Globals#BlockFaces|eBlockFace}} that corresponds to the given {{Globals#BlockFaces|eBlockFace}} after mirroring it around the Y axis (or rotating 180 degrees around it)." }, + NoCaseCompare = {Params = "string, string", Return = "number", Notes = "Case-insensitive string comparison; returns 0 if the strings are the same"}, + NormalizeAngleDegrees = { Params = "AngleDegrees", Return = "AngleDegrees", Notes = "Returns the angle, wrapped into the [-180, +180) range." }, + ReplaceString = {Params = "full-string, to-be-replaced-string, to-replace-string", Return = "string", Notes = "Replaces *each* occurence of to-be-replaced-string in full-string with to-replace-string"}, + RotateBlockFaceCCW = { Params = "{{Globals#BlockFaces|eBlockFace}}", Return = "{{Globals#BlockFaces|eBlockFace}}", Notes = "Returns the {{Globals#BlockFaces|eBlockFace}} that corresponds to the given {{Globals#BlockFaces|eBlockFace}} after rotating it around the Y axis 90 degrees counter-clockwise." }, + RotateBlockFaceCW = { Params = "{{Globals#BlockFaces|eBlockFace}}", Return = "{{Globals#BlockFaces|eBlockFace}}", Notes = "Returns the {{Globals#BlockFaces|eBlockFace}} that corresponds to the given {{Globals#BlockFaces|eBlockFace}} after rotating it around the Y axis 90 degrees clockwise." }, + StringSplit = {Params = "string, SeperatorsString", Return = "array table of strings", Notes = "Seperates string into multiple by splitting every time any of the characters in SeperatorsString is encountered."}, + StringSplitAndTrim = {Params = "string, SeperatorsString", Return = "array table of strings", Notes = "Seperates string into multiple by splitting every time any of the characters in SeperatorsString is encountered. Each of the separate strings is trimmed (whitespace removed from the beginning and end of the string)"}, + StringSplitWithQuotes = {Params = "string, SeperatorsString", Return = "array table of strings", Notes = "Seperates string into multiple by splitting every time any of the characters in SeperatorsString is encountered. Whitespace wrapped with single or double quotes will be ignored"}, + StringToBiome = {Params = "string", Return = "{{Globals#BiomeTypes|BiomeType}}", Notes = "Converts a string representation to a {{Globals#BiomeTypes|BiomeType}} enumerated value"}, + StringToDamageType = {Params = "string", Return = "{{Globals#DamageType|DamageType}}", Notes = "Converts a string representation to a {{Globals#DamageType|DamageType}} enumerated value."}, + StringToDimension = {Params = "string", Return = "{{Globals#WorldDimension|Dimension}}", Notes = "Converts a string representation to a {{Globals#WorldDimension|Dimension}} enumerated value"}, + StringToItem = {Params = "string, {{cItem|cItem}}", Return = "bool", Notes = "Parses the given string and sets the item; returns true if successful"}, + StringToMobType = {Params = "string", Return = "{{Globals#MobType|MobType}}", Notes = "DEPRECATED! Please use cMonster:StringToMobType(). Converts a string representation to a {{Globals#MobType|MobType}} enumerated value"}, + StripColorCodes = {Params = "string", Return = "string", Notes = "Removes all control codes used by MC for colors and styles"}, + TrimString = {Params = "string", Return = "string", Notes = "Trims whitespace at both ends of the string"}, + md5 = {Params = "string", Return = "string", Notes = "OBSOLETE, use the {{cCryptoHash}} functions instead.
    Converts a string to a raw binary md5 hash."}, + }, + ConstantGroups = + { + BlockTypes = + { + Include = "^E_BLOCK_.*", + TextBefore = [[ + These constants are used for block types. They correspond directly with MineCraft's data values + for blocks. + ]], + }, + ItemTypes = + { + Include = "^E_ITEM_.*", + TextBefore = [[ + These constants are used for item types. They correspond directly with MineCraft's data values + for items. + ]], + }, + MetaValues = + { + Include = "^E_META_.*", + }, + BiomeTypes = + { + Include = "^bi.*", + TextBefore = [[ + These constants represent the biomes that the server understands. Note that there is a global + StringToBiome() function that can convert a string into one of these constants. + ]], + }, + BlockFaces = + { + Include = "^BLOCK_FACE_.*", + TextBefore = [[ + These constants are used to describe individual faces of the block. They are used when the + client is interacting with a block in the {{OnPlayerBreakingBlock|HOOK_PLAYER_BREAKING_BLOCK}}, + {{OnPlayerBrokenBlock|HOOK_PLAYER_BROKEN_BLOCK}}, {{OnPlayerLeftClick|HOOK_PLAYER_LEFT_CLICK}}, + {{OnPlayerPlacedBlock|HOOK_PLAYER_PLACED_BLOCK}}, {{OnPlayerPlacingBlock|HOOK_PLAYER_PLACING_BLOCK}}, + {{OnPlayerRightClick|HOOK_PLAYER_RIGHT_CLICK}}, {{OnPlayerUsedBlock|HOOK_PLAYER_USED_BLOCK}}, + {{OnPlayerUsedItem|HOOK_PLAYER_USED_ITEM}}, {{OnPlayerUsingBlock|HOOK_PLAYER_USING_BLOCK}}, + and {{OnPlayerUsingItem|HOOK_PLAYER_USING_ITEM}} hooks, or when the {{cLineBlockTracer}} hits a + block, etc. + ]], + }, + ClickAction = + { + Include = "^ca.*", + TextBefore = [[ + These constants are used to signalize various interactions that the user can do with the + {{cWindow|UI windows}}. The server translates the protocol events into these constants. Note + that there is a global ClickActionToString() function that can translate these constants into + their textual representation. + ]], + }, + WorldDimension = + { + Include = "^dim.*", + TextBefore = [[ + These constants represent dimension of a world. In Cuberite, the dimension is only reflected in + the world's overall tint - overworld gets sky-like colors and dark shades, the nether gets + reddish haze and the end gets dark haze. World generator is not directly affected by the + dimension, same as fluid simulators; those only default to the expected values if not set + specifically otherwise in the world.ini file. + ]], + }, + DamageType = + { + Include = "^dt.*", + TextBefore = [[ + These constants are used for specifying the cause of damage to entities. They are used in the + {{TakeDamageInfo}} structure, as well as in {{cEntity}}'s damage-related API functions. + ]], + }, + GameMode = + { + Include = { "^gm.*", "^eGameMode_.*" }, + TextBefore = [[ + The following constants are used for the gamemode - survival, creative or adventure. Use the + gmXXX constants, the eGameMode_ constants are deprecated and will be removed from the API. + ]], + }, + MobType = + { + Include = { "^mt.*" }, + TextBefore = [[ + The following constants are used for distinguishing between the individual mob types: + ]], + }, + Weather = + { + Include = { "^eWeather_.*", "wSunny", "wRain", "wStorm", "wThunderstorm" }, + TextBefore = [[ + These constants represent the weather in the world. Note that unlike vanilla, Cuberite allows + different weathers even in non-overworld {{Globals#WorldDimension|dimensions}}. + ]], + }, + ExplosionSource = + { + Include = "^es.*", + TextBefore = [[ + These constants are used to differentiate the various sources of explosions. They are used in + the {{OnExploded|HOOK_EXPLODED}} hook, {{OnExploding|HOOK_EXPLODING}} hook and in the + {{cWorld}}:DoExplosionAt() function. These constants also dictate the type of the additional + data provided with the explosions, such as the exploding {{cCreeper|creeper}} entity or the + {{Vector3i|coords}} of the exploding bed. + ]], + }, + SpreadSource = + { + Include = "^ss.*", + TextBefore = [[ + These constants are used to differentiate the various sources of spreads, such as grass growing. + They are used in the {{OnBlockSpread|HOOK_BLOCK_SPREAD}} hook. + ]], + }, + ShrapnelLevel = + { + Include = "^sl.*", + TextBefore = [[ + The following constants define the block types that are propelled outwards after an explosion. + ]], + }, + }, + }, -- Globals + }, + + + IgnoreClasses = + { + "^coroutine$", + "^debug$", + "^io$", + "^math$", + "^package$", + "^os$", + "^string$", + "^table$", + "^g_Stats$", + "^g_TrackedPages$", + }, + + IgnoreFunctions = + { + "Globals.assert", + "Globals.collectgarbage", + "Globals.xpcall", + "Globals.decoda_output", -- When running under Decoda, this function gets added to the global namespace + "sqlite3.__newindex", + "%a+%.__%a+", -- AnyClass.__Anything + "%a+%.%.collector", -- AnyClass..collector + "%a+%.new", -- AnyClass.new + "%a+%.new_local", -- AnyClass.new_local + "%a+%.delete", -- AnyClass.delete + + -- Functions global in the APIDump plugin: + "CreateAPITables", + "DumpAPIHtml", + "DumpAPITxt", + "Initialize", + "LinkifyString", + "ListMissingPages", + "ListUndocumentedObjects", + "ListUnexportedObjects", + "LoadAPIFiles", + "ReadDescriptions", + "ReadHooks", + "WriteHtmlClass", + "WriteHtmlHook", + "WriteStats", + }, + + IgnoreConstants = + { + "cChestEntity.__cBlockEntityWindowOwner__", + "cDropSpenserEntity.__cBlockEntityWindowOwner__", + "cFurnaceEntity.__cBlockEntityWindowOwner__", + "cHopperEntity.__cBlockEntityWindowOwner__", + "cLuaWindow.__cItemGrid__cListener__", + }, + + IgnoreVariables = + { + "__.*__", -- tolua exports multiple inheritance this way + } , + + ExtraPages = + { + -- No sorting is provided for these, they will be output in the same order as defined here + { FileName = "Writing-a-Cuberite-plugin.html", Title = "Writing a Cuberite plugin" }, + { FileName = "InfoFile.html", Title = "Using the Info.lua file" }, + { FileName = "SettingUpDecoda.html", Title = "Setting up the Decoda Lua IDE" }, + { FileName = "SettingUpZeroBrane.html", Title = "Setting up the ZeroBrane Studio Lua IDE" }, + { FileName = "UsingChunkStays.html", Title = "Using ChunkStays" }, + { FileName = "WebWorldThreads.html", Title = "Webserver vs World threads" }, + } +} ; diff --git a/Server/Plugins/APIDump/APIDump.deproj b/Server/Plugins/APIDump/APIDump.deproj new file mode 100644 index 000000000..0e6fcd325 --- /dev/null +++ b/Server/Plugins/APIDump/APIDump.deproj @@ -0,0 +1,168 @@ + + + + APIDesc.lua + + + Classes\BlockEntities.lua + + + Classes\Geometry.lua + + + Hooks\OnBlockToPickups.lua + + + Hooks\OnChat.lua + + + Hooks\OnChunkAvailable.lua + + + Hooks\OnChunkGenerated.lua + + + Hooks\OnChunkGenerating.lua + + + Hooks\OnChunkUnloaded.lua + + + Hooks\OnChunkUnloading.lua + + + Hooks\OnCollectingPickup.lua + + + Hooks\OnCraftingNoRecipe.lua + + + Hooks\OnDisconnect.lua + + + Hooks\OnExecuteCommand.lua + + + Hooks\OnExploded.lua + + + Hooks\OnExploding.lua + + + Hooks\OnHandshake.lua + + + Hooks\OnHopperPullingItem.lua + + + Hooks\OnHopperPushingItem.lua + + + Hooks\OnKilling.lua + + + Hooks\OnLogin.lua + + + Hooks\OnPlayerAnimation.lua + + + Hooks\OnPlayerBreakingBlock.lua + + + Hooks\OnPlayerBrokenBlock.lua + + + Hooks\OnPlayerEating.lua + + + Hooks\OnPlayerJoined.lua + + + Hooks\OnPlayerLeftClick.lua + + + Hooks\OnPlayerMoving.lua + + + Hooks\OnPlayerPlacedBlock.lua + + + Hooks\OnPlayerPlacingBlock.lua + + + Hooks\OnPlayerRightClick.lua + + + Hooks\OnPlayerRightClickingEntity.lua + + + Hooks\OnPlayerShooting.lua + + + Hooks\OnPlayerSpawned.lua + + + Hooks\OnPlayerTossingItem.lua + + + Hooks\OnPlayerUsedBlock.lua + + + Hooks\OnPlayerUsedItem.lua + + + Hooks\OnPlayerUsingBlock.lua + + + Hooks\OnPlayerUsingItem.lua + + + Hooks\OnPluginMessage.lua + + + Hooks\OnPostCrafting.lua + + + Hooks\OnPreCrafting.lua + + + Hooks\OnSpawnedEntity.lua + + + Hooks\OnSpawnedMonster.lua + + + Hooks\OnSpawningEntity.lua + + + Hooks\OnSpawningMonster.lua + + + Hooks\OnTakeDamage.lua + + + Hooks\OnTick.lua + + + Hooks\OnUpdatedSign.lua + + + Hooks\OnUpdatingSign.lua + + + Hooks\OnWeatherChanged.lua + + + Hooks\OnWeatherChanging.lua + + + Hooks\OnWorldTick.lua + + + Classes\Projectiles.lua + + + main_APIDump.lua + + diff --git a/Server/Plugins/APIDump/Classes/BlockEntities.lua b/Server/Plugins/APIDump/Classes/BlockEntities.lua new file mode 100644 index 000000000..daa658654 --- /dev/null +++ b/Server/Plugins/APIDump/Classes/BlockEntities.lua @@ -0,0 +1,322 @@ +return +{ + cBlockEntity = + { + Desc = [[ + Block entities are simply blocks in the world that have persistent data, such as the text for a sign + or contents of a chest. All block entities are also saved in the chunk data of the chunk they reside in. + The cBlockEntity class acts as a common ancestor for all the individual block entities. + ]], + + Functions = + { + GetBlockType = { Params = "", Return = "BLOCKTYPE", Notes = "Returns the blocktype which is represented by this blockentity. This is the primary means of type-identification" }, + GetChunkX = { Params = "", Return = "number", Notes = "Returns the chunk X-coord of the block entity's chunk" }, + GetChunkZ = { Params = "", Return = "number", Notes = "Returns the chunk Z-coord of the block entity's chunk" }, + GetPosX = { Params = "", Return = "number", Notes = "Returns the block X-coord of the block entity's block" }, + GetPosY = { Params = "", Return = "number", Notes = "Returns the block Y-coord of the block entity's block" }, + GetPosZ = { Params = "", Return = "number", Notes = "Returns the block Z-coord of the block entity's block" }, + GetRelX = { Params = "", Return = "number", Notes = "Returns the relative X coord of the block entity's block within the chunk" }, + GetRelZ = { Params = "", Return = "number", Notes = "Returns the relative Z coord of the block entity's block within the chunk" }, + GetWorld = { Params = "", Return = "{{cWorld|cWorld}}", Notes = "Returns the world to which the block entity belongs" }, + }, + }, + + cBlockEntityWithItems = + { + Desc = [[ + This class is a common ancestor for all {{cBlockEntity|block entities}} that provide item storage. + Internally, the object has a {{cItemGrid|cItemGrid}} object for storing the items; this ItemGrid is + accessible through the API. The storage is a grid of items, items in it can be addressed either by a slot + number, or by XY coords within the grid. If a UI window is opened for this block entity, the item storage + is monitored for changes and the changes are immediately sent to clients of the UI window. + ]], + + Inherits = "cBlockEntity", + + Functions = + { + GetContents = { Params = "", Return = "{{cItemGrid|cItemGrid}}", Notes = "Returns the cItemGrid object representing the items stored within this block entity" }, + GetSlot = + { + { Params = "SlotNum", Return = "{{cItem|cItem}}", Notes = "Returns the cItem for the specified slot number. Returns nil for invalid slot numbers" }, + { Params = "X, Y", Return = "{{cItem|cItem}}", Notes = "Returns the cItem for the specified slot coords. Returns nil for invalid slot coords" }, + }, + SetSlot = + { + { Params = "SlotNum, {{cItem|cItem}}", Return = "", Notes = "Sets the cItem for the specified slot number. Ignored if invalid slot number" }, + { Params = "X, Y, {{cItem|cItem}}", Return = "", Notes = "Sets the cItem for the specified slot coords. Ignored if invalid slot coords" }, + }, + }, + }, + + cBeaconEntity = + { + Desc = [[ + A beacon entity is a {{cBlockEntityWithItems|cBlockEntityWithItems}} descendant that represents a beacon + in the world. + ]], + + Inherits = "cBlockEntityWithItems", + + Functions = + { + IsActive = { Params = "", Return = "bool", Notes = "Is the beacon active?" }, + GetBeaconLevel = { Params = "", Return = "number", Notes = "Returns the beacon level. (0 - 4)" }, + GetPrimaryEffect = { Params = "", Return = "EffectType", Notes = "Returns the primary effect." }, + GetSecondaryEffect = { Params = "", Return = "EffectType", Notes = "Returns the secondary effect." }, + SetPrimaryEffect = { Params = "EffectType", Return = "bool", Notes = "Select the primary effect. Returns false when the effect is invalid." }, + SetSecondaryEffect = { Params = "EffectType", Return = "bool", Notes = "Select the secondary effect. Returns false when the effect is invalid." }, + CalculatePyramidLevel = { Params = "", Return = "number", Notes = "Calculate the amount of layers the pyramid below the beacon has." }, + IsBeaconBlocked = { Params = "", Return = "bool", Notes = "Is the beacon blocked by non-transparent blocks that are higher than the beacon?" }, + UpdateBeacon = { Params = "", Return = "", Notes = "Update the beacon." }, + GiveEffects = { Params = "", Return = "", Notes = "Give the near-players the effects." }, + IsMineralBlock = { Params = "BLOCKTYPE", Return = "bool", Notes = "Returns true if the block is a diamond block, a golden block, an iron block or an emerald block." }, + IsValidEffect = { Params = "EffectType", Return = "bool", Notes = "Returns true if the effect can be used." }, + }, + }, + + cChestEntity = + { + Desc = [[ + A chest entity is a {{cBlockEntityWithItems|cBlockEntityWithItems}} descendant that represents a chest + in the world. Note that doublechests consist of two separate cChestEntity objects, they do not collaborate + in any way.

    +

    + To manipulate a chest already in the game, you need to use {{cWorld}}'s callback mechanism with + either DoWithChestAt() or ForEachChestInChunk() function. See the code example below + ]], + + Inherits = "cBlockEntityWithItems", + + Constants = + { + ContentsHeight = { Notes = "Height of the contents' {{cItemGrid|ItemGrid}}, as required by the parent class, {{cBlockEntityWithItems}}" }, + ContentsWidth = { Notes = "Width of the contents' {{cItemGrid|ItemGrid}}, as required by the parent class, {{cBlockEntityWithItems}}" }, + }, + AdditionalInfo = + { + { + Header = "Code example", + Contents = [[ + The following example code sets the top-left item of each chest in the same chunk as Player to + 64 * diamond: +

    +-- Player is a {{cPlayer}} object instance
    +local World = Player:GetWorld();
    +World:ForEachChestInChunk(Player:GetChunkX(), Player:GetChunkZ(),
    +	function (ChestEntity)
    +		ChestEntity:SetSlot(0, 0, cItem(E_ITEM_DIAMOND, 64));
    +	end
    +);
    +
    + ]], + }, + }, -- AdditionalInfo + }, + + cDispenserEntity = + { + Desc = [[ + This class represents a dispenser block entity in the world. Most of this block entity's + functionality is implemented in the {{cDropSpenserEntity|cDropSpenserEntity}} class that represents + the behavior common with a {{cDropperEntity|dropper}} entity. + ]], + Inherits = "cDropSpenserEntity", + }, + + cDropperEntity = + { + Desc = [[ + This class represents a dropper block entity in the world. Most of this block entity's functionality + is implemented in the {{cDropSpenserEntity|cDropSpenserEntity}} class that represents the behavior + common with the {{cDispenserEntity|dispenser}} entity.

    +

    + An object of this class can be created from scratch when generating chunks ({{OnChunkGenerated|OnChunkGenerated}} and {{OnChunkGenerating|OnChunkGenerating}} hooks). + ]], + Inherits = "cDropSpenserEntity", + }, -- cDropperEntity + + cDropSpenserEntity = + { + Desc = [[ + This is a class that implements behavior common to both {{cDispenserEntity|dispensers}} and {{cDropperEntity|droppers}}. + ]], + Functions = + { + Activate = { Params = "", Return = "", Notes = "Sets the block entity to dropspense an item in the next tick" }, + AddDropSpenserDir = { Params = "BlockX, BlockY, BlockZ, BlockMeta", Return = "BlockX, BlockY, BlockZ", Notes = "Adjusts the block coords to where the dropspenser items materialize" }, + SetRedstonePower = { Params = "IsPowered", Return = "", Notes = "Sets the redstone status of the dropspenser. If the redstone power goes from off to on, the dropspenser will be activated" }, + }, + Constants = + { + ContentsWidth = { Notes = "Width (X) of the {{cItemGrid}} representing the contents" }, + ContentsHeight = { Notes = "Height (Y) of the {{cItemGrid}} representing the contents" }, + }, + Inherits = "cBlockEntityWithItems"; + }, -- cDropSpenserEntity + + cFurnaceEntity = + { + Desc = [[ + This class represents a furnace block entity in the world.

    +

    + See also {{cRoot}}'s GetFurnaceRecipe() and GetFurnaceFuelBurnTime() functions + ]], + Functions = + { + GetCookTimeLeft = { Params = "", Return = "number", Notes = "Returns the time until the current item finishes cooking, in ticks" }, + GetFuelBurnTimeLeft = { Params = "", Return = "number", Notes = "Returns the time until the current fuel is depleted, in ticks" }, + GetFuelSlot = { Params = "", Return = "{{cItem|cItem}}", Notes = "Returns the item in the fuel slot" }, + GetInputSlot = { Params = "", Return = "{{cItem|cItem}}", Notes = "Returns the item in the input slot" }, + GetOutputSlot = { Params = "", Return = "{{cItem|cItem}}", Notes = "Returns the item in the output slot" }, + GetTimeCooked = { Params = "", Return = "number", Notes = "Returns the time that the current item has been cooking, in ticks" }, + HasFuelTimeLeft = { Params = "", Return = "bool", Notes = "Returns true if there's time before the current fuel is depleted" }, + SetFuelSlot = { Params = "{{cItem|cItem}}", Return = "", Notes = "Sets the item in the fuel slot" }, + SetInputSlot = { Params = "{{cItem|cItem}}", Return = "", Notes = "Sets the item in the input slot" }, + SetOutputSlot = { Params = "{{cItem|cItem}}", Return = "", Notes = "Sets the item in the output slot" }, + }, + Constants = + { + fsInput = { Notes = "Index of the input slot" }, + fsFuel = { Notes = "Index of the fuel slot" }, + fsOutput = { Notes = "Index of the output slot" }, + ContentsWidth = { Notes = "Width (X) of the {{cItemGrid|cItemGrid}} representing the contents" }, + ContentsHeight = { Notes = "Height (Y) of the {{cItemGrid|cItemGrid}} representing the contents" }, + }, + ConstantGroups = + { + SlotIndices = + { + Include = "fs.*", + TextBefore = "When using the GetSlot() or SetSlot() function, use these constants for slot index:", + }, + }, + Inherits = "cBlockEntityWithItems" + }, -- cFurnaceEntity + + cHopperEntity = + { + Desc = [[ + This class represents a hopper block entity in the world. + ]], + Functions = + { + GetOutputBlockPos = { Params = "BlockMeta", Return = "bool, BlockX, BlockY, BlockZ", Notes = "Returns whether the hopper is attached, and if so, the block coords of the block receiving the output items, based on the given meta." }, + }, + Constants = + { + ContentsHeight = { Notes = "Height (Y) of the internal {{cItemGrid}} representing the hopper contents." }, + ContentsWidth = { Notes = "Width (X) of the internal {{cItemGrid}} representing the hopper contents." }, + TICKS_PER_TRANSFER = { Notes = "Number of ticks between when the hopper transfers items." }, + }, + Inherits = "cBlockEntityWithItems", + }, -- cHopperEntity + + cJukeboxEntity = + { + Desc = [[ + This class represents a jukebox in the world. It can play the records, either when the + {{cPlayer|player}} uses the record on the jukebox, or when a plugin instructs it to play. + ]], + Inherits = "cBlockEntity", + Functions = + { + EjectRecord = { Params = "", Return = "bool", Notes = "Ejects the current record as a {{cPickup|pickup}}. No action if there's no current record. To remove record without generating the pickup, use SetRecord(0). Returns true if pickup ejected." }, + GetRecord = { Params = "", Return = "number", Notes = "Returns the record currently present. Zero for no record, E_ITEM_*_DISC for records." }, + IsPlayingRecord = { Params = "", Return = "bool", Notes = "Returns true if the jukebox is playing a record." }, + IsRecordItem = { Params = "ItemType", Return = "bool", Notes = "Returns true if the specified item is a record that can be played." }, + PlayRecord = { Params = "RecordItemType", Return = "bool", Notes = "Plays the specified Record. Return false if the parameter isn't a playable Record (E_ITEM_XXX_DISC). If there is a record already playing, ejects it first." }, + SetRecord = { Params = "number", Return = "", Notes = "Sets the currently present record. Use zero for no record, or E_ITEM_*_DISC for records." }, + }, + }, -- cJukeboxEntity + + cMobHeadEntity = + { + Desc = [[ + This class represents a mob head block entity in the world. + ]], + Inherits = "cBlockEntity", + Functions = + { + SetType = { Params = "eMobHeadType", Return = "", Notes = "Set the type of the mob head" }, + SetRotation = { Params = "eMobHeadRotation", Return = "", Notes = "Sets the rotation of the mob head" }, + SetOwner = { Params = "string", Return = "", Notes = "Set the player name for mob heads with player type" }, + GetType = { Params = "", Return = "eMobHeadType", Notes = "Returns the type of the mob head" }, + GetRotation = { Params = "", Return = "eMobHeadRotation", Notes = "Returns the rotation of the mob head" }, + GetOwner = { Params = "", Return = "string", Notes = "Returns the player name of the mob head" }, + }, + }, -- cMobHeadEntity + + cMobSpawnerEntity = + { + Desc = [[ + This class represents a mob spawner block entity in the world. + ]], + Inherits = "cBlockEntity", + Functions = + { + UpdateActiveState = { Params = "", Return = "", Notes = "Upate the active flag from the mob spawner. This function will called every 5 seconds from the Tick() function." }, + ResetTimer = { Params = "", Return = "", Notes = "Sets the spawn delay to a new random value." }, + SpawnEntity = { Params = "", Return = "", Notes = "Spawns the entity. This function automaticly change the spawn delay!" }, + GetEntity = { Params = "", Return = "{{Globals#MobType|MobType}}", Notes = "Returns the entity type that will be spawn by this mob spawner." }, + SetEntity = { Params = "{{Globals#MobType|MobType}}", Return = "", Notes = "Sets the entity type who will be spawn by this mob spawner." }, + GetSpawnDelay = { Params = "", Return = "number", Notes = "Returns the spawn delay. This is the tick delay that is needed to spawn new monsters." }, + SetSpawnDelay = { Params = "number", Return = "", Notes = "Sets the spawn delay." }, + GetNearbyPlayersNum = { Params = "", Return = "number", Notes = "Returns the amount of the nearby players in a 16-block radius." }, + GetNearbyMonsterNum = { Params = "", Return = "number", Notes = "Returns the amount of this monster type in a 8-block radius (Y: 4-block radius)." }, + }, + }, -- cMobSpawnerEntity + + cNoteEntity = + { + Desc = [[ + This class represents a note block entity in the world. It takes care of the note block's pitch, + and also can play the sound, either when the {{cPlayer|player}} right-clicks it, redstone activates + it, or upon a plugin's request.

    +

    + The pitch is stored as an integer between 0 and 24. + ]], + Functions = + { + GetPitch = { Params = "", Return = "number", Notes = "Returns the current pitch set for the block" }, + IncrementPitch = { Params = "", Return = "", Notes = "Adds 1 to the current pitch. Wraps around to 0 when the pitch cannot go any higher." }, + MakeSound = { Params = "", Return = "", Notes = "Plays the sound for all {{cClientHandle|clients}} near this block." }, + SetPitch = { Params = "Pitch", Return = "", Notes = "Sets a new pitch for the block." }, + }, + Inherits = "cBlockEntity", + }, -- cNoteEntity + + cSignEntity = + { + Desc = [[ + A sign entity represents a sign in the world. This class is only used when generating chunks, so + that the plugins may generate signs within new chunks. See the code example in {{cChunkDesc}}. + ]], + Functions = + { + GetLine = { Params = "LineIndex", Return = "string", Notes = "Returns the specified line. LineIndex is expected between 0 and 3. Returns empty string and logs to server console when LineIndex is invalid." }, + SetLine = { Params = "LineIndex, LineText", Return = "", Notes = "Sets the specified line. LineIndex is expected between 0 and 3. Logs to server console when LineIndex is invalid." }, + SetLines = { Params = "Line1, Line2, Line3, Line4", Return = "", Notes = "Sets all the sign's lines at once." }, + }, + Inherits = "cBlockEntity"; + }, -- cSignEntity + + cFlowerPotEntity = + { + Desc = [[ + This class represents a flower pot entity in the world. + ]], + Functions = + { + IsItemInPot = { Params = "", Return = "bool", Notes = "Is a flower in the pot?" }, + GetItem = { Params = "", Return = "{{cItem|Item}}", Notes = "Returns the item in the flower pot." }, + SetItem = { Params = "{{cItem|Item}}", Return = "", Notes = "Set the item in the flower pot" }, + }, + Inherits = "cBlockEntity"; + }, -- cFlowerPotEntity +} + + + + diff --git a/Server/Plugins/APIDump/Classes/Geometry.lua b/Server/Plugins/APIDump/Classes/Geometry.lua new file mode 100644 index 000000000..36bd222a6 --- /dev/null +++ b/Server/Plugins/APIDump/Classes/Geometry.lua @@ -0,0 +1,332 @@ + +-- Geometry.lua + +-- Defines the documentation for geometry-related classes: +-- cBoundingBox, cCuboid, cLineBlockTracer, cTracer, Vector3X + + + + +return +{ + cBoundingBox = + { + Desc = [[ + Represents two sets of coordinates, minimum and maximum for each direction; thus defining an + axis-aligned cuboid with floating-point boundaries. It supports operations changing the size and + position of the box, as well as querying whether a point or another BoundingBox is inside the box.

    +

    + All the points within the coordinate limits (inclusive the edges) are considered "inside" the box. + However, for intersection purposes, if the intersection is "sharp" in any coord (min1 == max2, i. e. + zero volume), the boxes are considered non-intersecting.

    + ]], + Functions = + { + constructor = + { + { Params = "MinX, MaxX, MinY, MaxY, MinZ, MaxZ", Return = "cBoundingBox", Notes = "Creates a new bounding box with the specified edges" }, + { Params = "{{Vector3d|Min}}, {{Vector3d|Max}}", Return = "cBoundingBox", Notes = "Creates a new bounding box with the coords specified as two vectors" }, + { Params = "{{Vector3d|Pos}}, Radius, Height", Return = "cBoundingBox", Notes = "Creates a new bounding box from the position given and radius (X/Z) and height. Radius is added from X/Z to calculate the maximum coords and subtracted from X/Z to get the minimum; minimum Y is set to Pos.y and maxumim Y to Pos.y plus Height. This corresponds with how {{cEntity|entities}} are represented in Minecraft." }, + { Params = "OtherBoundingBox", Return = "cBoundingBox", Notes = "Creates a new copy of the given bounding box. Same result can be achieved by using a simple assignment." }, + }, + CalcLineIntersection = { Params = "{{Vector3d|LineStart}}, {{Vector3d|LinePt2}}", Return = "DoesIntersect, LineCoeff, Face", Notes = "Calculates the intersection of a ray (half-line), given by two of its points, with the bounding box. Returns false if the line doesn't intersect the bounding box, or true, together with coefficient of the intersection (how much of the difference between the two ray points is needed to reach the intersection), and the face of the box which is intersected.
    TODO: Lua binding for this function is wrong atm." }, + DoesIntersect = { Params = "OtherBoundingBox", Return = "bool", Notes = "Returns true if the two bounding boxes have an intersection of nonzero volume." }, + Expand = { Params = "ExpandX, ExpandY, ExpandZ", Return = "", Notes = "Expands this bounding box by the specified amount in each direction (so the box becomes larger by 2 * Expand in each axis)." }, + IsInside = + { + { Params = "{{Vector3d|Point}}", Return = "bool", Notes = "Returns true if the specified point is inside (including on the edge) of the box." }, + { Params = "PointX, PointY, PointZ", Return = "bool", Notes = "Returns true if the specified point is inside (including on the edge) of the box." }, + { Params = "OtherBoundingBox", Return = "bool", Notes = "Returns true if OtherBoundingBox is inside of this box." }, + { Params = "{{Vector3d|OtherBoxMin}}, {{Vector3d|OtherBoxMax}}", Return = "bool", Notes = "Returns true if the other bounding box, specified by its 2 corners, is inside of this box." }, + }, + Move = + { + { Params = "OffsetX, OffsetY, OffsetZ", Return = "", Notes = "Moves the bounding box by the specified offset in each axis" }, + { Params = "{{Vector3d|Offset}}", Return = "", Notes = "Moves the bounding box by the specified offset in each axis" }, + }, + Union = { Params = "OtherBoundingBox", Return = "cBoundingBox", Notes = "Returns the smallest bounding box that contains both OtherBoundingBox and this bounding box. Note that unlike the strict geometrical meaning of \"union\", this operation actually returns a cBoundingBox." }, + }, + }, -- cBoundingBox + + + cCuboid = + { + Desc = [[ + cCuboid offers some native support for integral-boundary cuboids. A cuboid internally consists of + two {{Vector3i}}-s. By default the cuboid doesn't make any assumptions about the defining points, + but for most of the operations in the cCuboid class, the p1 member variable is expected to be the + minima and the p2 variable the maxima. The Sort() function guarantees this condition.

    +

    + The Cuboid considers both its edges inclusive.

    + ]], + Functions = + { + constructor = + { + { Params = "", Return = "cCuboid", Notes = "Creates a new Cuboid object with all-zero coords" }, + { Params = "OtherCuboid", Return = "cCuboid", Notes = "Creates a new Cuboid object as a copy of OtherCuboid" }, + { Params = "{{Vector3i|Point1}}, {{Vector3i|Point2}}", Return = "cCuboid", Notes = "Creates a new Cuboid object with the specified points as its corners." }, + { Params = "X, Y, Z", Return = "cCuboid", Notes = "Creates a new Cuboid object with the specified point as both its corners (the cuboid has a size of 1 in each direction)." }, + { Params = "X1, Y1, Z1, X2, Y2, Z2", Return = "cCuboid", Notes = "Creates a new Cuboid object with the specified points as its corners." }, + }, + Assign = + { + { Params = "SrcCuboid", Return = "", Notes = "Copies all the coords from the src cuboid to this cuboid. Sort-state is ignored." }, + { Params = "X1, Y1, Z1, X2, Y2, Z2", Return = "", Notes = "Assigns all the coords to the specified values. Sort-state is ignored." }, + }, + ClampX = { Params = "MinX, MaxX", Return = "", Notes = "Clamps both X coords into the range provided. Sortedness-agnostic." }, + ClampY = { Params = "MinY, MaxY", Return = "", Notes = "Clamps both Y coords into the range provided. Sortedness-agnostic." }, + ClampZ = { Params = "MinZ, MaxZ", Return = "", Notes = "Clamps both Z coords into the range provided. Sortedness-agnostic." }, + DifX = { Params = "", Return = "number", Notes = "Returns the difference between the two X coords (X-size minus 1). Assumes sorted." }, + DifY = { Params = "", Return = "number", Notes = "Returns the difference between the two Y coords (Y-size minus 1). Assumes sorted." }, + DifZ = { Params = "", Return = "number", Notes = "Returns the difference between the two Z coords (Z-size minus 1). Assumes sorted." }, + DoesIntersect = { Params = "OtherCuboid", Return = "bool", Notes = "Returns true if this cuboid has at least one voxel in common with OtherCuboid. Note that edges are considered inclusive. Assumes both sorted." }, + Engulf = { Params = "{{Vector3i|Point}}", Return = "", Notes = "If needed, expands the cuboid to include the specified point. Doesn't shrink. Assumes sorted. " }, + Expand = { Params = "SubMinX, AddMaxX, SubMinY, AddMaxY, SubMinZ, AddMaxZ", Return = "", Notes = "Expands the cuboid by the specified amount in each direction. Works on unsorted cuboids as well. NOTE: this function doesn't check for underflows." }, + GetVolume = { Params = "", Return = "number", Notes = "Returns the volume of the cuboid, in blocks. Note that the volume considers both coords inclusive. Works on unsorted cuboids, too." }, + IsCompletelyInside = { Params = "OuterCuboid", Return = "bool", Notes = "Returns true if this cuboid is completely inside (in all directions) in OuterCuboid. Assumes both sorted." }, + IsInside = + { + { Params = "X, Y, Z", Return = "bool", Notes = "Returns true if the specified point (integral coords) is inside this cuboid. Assumes sorted." }, + { Params = "{{Vector3i|Point}}", Return = "bool", Notes = "Returns true if the specified point (integral coords) is inside this cuboid. Assumes sorted." }, + { Params = "{{Vector3d|Point}}", Return = "bool", Notes = "Returns true if the specified point (floating-point coords) is inside this cuboid. Assumes sorted." }, + }, + IsSorted = { Params = "", Return = "bool", Notes = "Returns true if this cuboid is sorted" }, + Move = { Params = "OffsetX, OffsetY, OffsetZ", Return = "", Notes = "Adds the specified offsets to each respective coord, effectively moving the Cuboid. Sort-state is ignored and preserved." }, + Sort = { Params = "", Return = "" , Notes = "Sorts the internal representation so that p1 contains the lesser coords and p2 contains the greater coords." }, + }, + Variables = + { + p1 = { Type = "{{Vector3i}}", Notes = "The first corner. Usually the lesser of the two coords in each set" }, + p2 = { Type = "{{Vector3i}}", Notes = "The second corner. Usually the larger of the two coords in each set" }, + }, + }, -- cCuboid + + + cLineBlockTracer = + { + Desc = [[This class provides an easy-to-use interface for tracing lines through individual +blocks in the world. It will call the provided callbacks according to what events it encounters along the +way.

    +

    +For the Lua API, there's only one static function exported that takes all the parameters necessary to do +the tracing. The Callbacks parameter is a table containing all the functions that will be called upon the +various events. See below for further information. + ]], + Functions = + { + Trace = { Params = "{{cWorld}}, Callbacks, StartX, StartY, StartZ, EndX, EndY, EndZ", Return = "bool", Notes = "(STATIC) Performs the trace on the specified line. Returns true if the entire trace was processed (no callback returned true)" }, + }, + + AdditionalInfo = + { + { + Header = "Callbacks", + Contents = [[ +The Callbacks in the Trace() function is a table that contains named functions. Cuberite will call +individual functions from that table for the events that occur on the line - hitting a block, going out of +valid world data etc. The following table lists all the available callbacks. If the callback function is +not defined, Cuberite skips it. Each function can return a bool value, if it returns true, the tracing is +aborted and Trace() returns false.

    +

    + + + + + + + + + + + + + +
    NameParametersNotes
    OnNextBlockBlockX, BlockY, BlockZ, BlockType, BlockMeta, EntryFaceCalled when the ray hits a new valid block. The block type and meta is given. EntryFace is one of the + BLOCK_FACE_ constants indicating which "side" of the block got hit by the ray.
    OnNextBlockNoDataBlockX, BlockY, BlockZ, EntryFaceCalled when the ray hits a new block, but the block is in an unloaded chunk - no valid data is + available. Only the coords and the entry face are given.
    OnOutOfWorldX, Y, ZCalled when the ray goes outside of the world (Y-wise); the coords specify the exact exit point. Note + that for other paths than lines (considered for future implementations) the path may leave the world and + go back in again later, in such a case this callback is followed by OnIntoWorld() and further + OnNextBlock() calls.
    OnIntoWorldX, Y, ZCalled when the ray enters the world (Y-wise); the coords specify the exact entry point.
    OnNoMoreHits Called when the path is sure not to hit any more blocks. This is the final callback, no more + callbacks are called after this function. Unlike the other callbacks, this function doesn't have a return + value.
    OnNoChunk Called when the ray enters a chunk that is not loaded. This usually means that the tracing is aborted. + Unlike the other callbacks, this function doesn't have a return value.
    + ]], + }, + { + Header = "Example", + Contents = [[ +

    The following example is taken from the Debuggers plugin. It is a command handler function for the +"/spidey" command that creates a line of cobweb blocks from the player's eyes up to 50 blocks away in +the direction they're looking, but only through the air. +

    +function HandleSpideyCmd(a_Split, a_Player)
    +	local World = a_Player:GetWorld();
    +
    +	local Callbacks = {
    +		OnNextBlock = function(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta)
    +			if (a_BlockType ~= E_BLOCK_AIR) then
    +				-- abort the trace
    +				return true;
    +			end
    +			World:SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_COBWEB, 0);
    +		end
    +	};
    +
    +	local EyePos = a_Player:GetEyePosition();
    +	local LookVector = a_Player:GetLookVector();
    +	LookVector:Normalize();  -- Make the vector 1 m long
    +
    +	-- Start cca 2 blocks away from the eyes
    +	local Start = EyePos + LookVector + LookVector;
    +	local End = EyePos + LookVector * 50;
    +
    +	cLineBlockTracer.Trace(World, Callbacks, Start.x, Start.y, Start.z, End.x, End.y, End.z);
    +
    +	return true;
    +end
    +
    +

    + ]], + }, + }, -- AdditionalInfo + }, -- cLineBlockTracer + + + cTracer = + { + Desc = [[ + A cTracer object is used to trace lines in the world. One thing you can use the cTracer for, is + tracing what block a player is looking at, but you can do more with it if you want.

    +

    + The cTracer is still a work in progress.

    +

    + See also the {{cLineBlockTracer}} class for an alternative approach using callbacks. + ]], + Functions = + { + }, + }, -- cTracer + + + Vector3d = + { + Desc = [[ + A Vector3d object uses double precision floating point values to describe a point in 3D space.

    +

    + See also {{Vector3f}} for single-precision floating point 3D coords and {{Vector3i}} for integer + 3D coords. + ]], + Functions = + { + constructor = + { + { Params = "{{Vector3f}}", Return = "Vector3d", Notes = "Creates a new Vector3d object by copying the coords from the given Vector3f." }, + { Params = "", Return = "Vector3d", Notes = "Creates a new Vector3d object with all its coords set to 0." }, + { Params = "X, Y, Z", Return = "Vector3d", Notes = "Creates a new Vector3d object with its coords set to the specified values." }, + }, + operator_div = { Params = "number", Return = "Vector3d", Notes = "Returns a new Vector3d with each coord divided by the specified number." }, + operator_mul = { Params = "number", Return = "Vector3d", Notes = "Returns a new Vector3d with each coord multiplied." }, + operator_sub = { Params = "Vector3d", Return = "Vector3d", Notes = "Returns a new Vector3d containing the difference between this object and the specified vector." }, + operator_plus = {Params = "Vector3d", Return = "Vector3d", Notes = "Returns a new Vector3d containing the sum of this vector and the specified vector" }, + Cross = { Params = "Vector3d", Return = "Vector3d", Notes = "Returns a new Vector3d that is a {{http://en.wikipedia.org/wiki/Cross_product|cross product}} of this vector and the specified vector." }, + Dot = { Params = "Vector3d", Return = "number", Notes = "Returns the dot product of this vector and the specified vector." }, + Equals = { Params = "Vector3d", Return = "bool", Notes = "Returns true if this vector is exactly equal to the specified vector." }, + Length = { Params = "", Return = "number", Notes = "Returns the (euclidean) length of the vector." }, + LineCoeffToXYPlane = { Params = "Vector3d, Z", Return = "number", Notes = "Returns the coefficient for the line from the specified vector through this vector to reach the specified Z coord. The result satisfies the following equation: (this + Result * (Param - this)).z = Z. Returns the NO_INTERSECTION constant if there's no intersection." }, + LineCoeffToXZPlane = { Params = "Vector3d, Y", Return = "number", Notes = "Returns the coefficient for the line from the specified vector through this vector to reach the specified Y coord. The result satisfies the following equation: (this + Result * (Param - this)).y = Y. Returns the NO_INTERSECTION constant if there's no intersection." }, + LineCoeffToYZPlane = { Params = "Vector3d, X", Return = "number", Notes = "Returns the coefficient for the line from the specified vector through this vector to reach the specified X coord. The result satisfies the following equation: (this + Result * (Param - this)).x = X. Returns the NO_INTERSECTION constant if there's no intersection." }, + Normalize = { Params = "", Return = "", Notes = "Changes this vector so that it keeps current direction but is exactly 1 unit long. FIXME: Fails for a zero vector." }, + NormalizeCopy = { Params = "", Return = "Vector3d", Notes = "Returns a new vector that has the same directino as this but is exactly 1 unit long. FIXME: Fails for a zero vector." }, + Set = { Params = "X, Y, Z", Return = "", Notes = "Sets all the coords in this object." }, + SqrLength = { Params = "", Return = "number", Notes = "Returns the (euclidean) length of this vector, squared. This operation is slightly less computationally expensive than Length(), while it conserves some properties of Length(), such as comparison. " }, + }, + Constants = + { + EPS = { Notes = "The max difference between two coords for which the coords are assumed equal (in LineCoeffToXYPlane() et al)." }, + NO_INTERSECTION = { Notes = "Special return value for the LineCoeffToXYPlane() et al meaning that there's no intersectino with the plane." }, + }, + Variables = + { + x = { Type = "number", Notes = "The X coord of the vector." }, + y = { Type = "number", Notes = "The Y coord of the vector." }, + z = { Type = "number", Notes = "The Z coord of the vector." }, + }, + }, -- Vector3d + + Vector3f = + { + Desc = [[ + A Vector3f object uses floating point values to describe a point in space.

    +

    + See also {{Vector3d}} for double-precision floating point 3D coords and {{Vector3i}} for integer + 3D coords. + ]], + Functions = + { + constructor = + { + { Params = "", Return = "Vector3f", Notes = "Creates a new Vector3f object with zero coords" }, + { Params = "x, y, z", Return = "Vector3f", Notes = "Creates a new Vector3f object with the specified coords" }, + { Params = "Vector3f", Return = "Vector3f", Notes = "Creates a new Vector3f object as a copy of the specified vector" }, + { Params = "{{Vector3d}}", Return = "Vector3f", Notes = "Creates a new Vector3f object as a copy of the specified {{Vector3d}}" }, + { Params = "{{Vector3i}}", Return = "Vector3f", Notes = "Creates a new Vector3f object as a copy of the specified {{Vector3i}}" }, + }, + operator_mul = + { + { Params = "number", Return = "Vector3f", Notes = "Returns a new Vector3f object that has each of its coords multiplied by the specified number" }, + { Params = "Vector3f", Return = "Vector3f", Notes = "Returns a new Vector3f object that has each of its coords multiplied by the respective coord of the specified vector." }, + }, + operator_plus = { Params = "Vector3f", Return = "Vector3f", Notes = "Returns a new Vector3f object that holds the vector sum of this vector and the specified vector." }, + operator_sub = { Params = "Vector3f", Return = "Vector3f", Notes = "Returns a new Vector3f object that holds the vector differrence between this vector and the specified vector." }, + Cross = { Params = "Vector3f", Return = "Vector3f", Notes = "Returns a new Vector3f object that holds the cross product of this vector and the specified vector." }, + Dot = { Params = "Vector3f", Return = "number", Notes = "Returns the dot product of this vector and the specified vector." }, + Equals = { Params = "Vector3f", Return = "bool", Notes = "Returns true if the specified vector is exactly equal to this vector." }, + Length = { Params = "", Return = "number", Notes = "Returns the (euclidean) length of this vector" }, + Normalize = { Params = "", Return = "", Notes = "Normalizes this vector (makes it 1 unit long while keeping the direction). FIXME: Fails for zero vectors." }, + NormalizeCopy = { Params = "", Return = "Vector3f", Notes = "Returns a copy of this vector that is normalized (1 unit long while keeping the same direction). FIXME: Fails for zero vectors." }, + Set = { Params = "x, y, z", Return = "", Notes = "Sets all the coords of the vector at once." }, + SqrLength = { Params = "", Return = "number", Notes = "Returns the (euclidean) length of this vector, squared. This operation is slightly less computationally expensive than Length(), while it conserves some properties of Length(), such as comparison." }, + }, + Variables = + { + x = { Type = "number", Notes = "The X coord of the vector." }, + y = { Type = "number", Notes = "The Y coord of the vector." }, + z = { Type = "number", Notes = "The Z coord of the vector." }, + }, + }, -- Vector3f + + Vector3i = + { + Desc = [[ + A Vector3i object uses integer values to describe a point in space.

    +

    + See also {{Vector3d}} for double-precision floating point 3D coords and {{Vector3f}} for + single-precision floating point 3D coords. + ]], + Functions = + { + constructor = + { + { Params = "", Return = "Vector3i", Notes = "Creates a new Vector3i object with zero coords." }, + { Params = "x, y, z", Return = "Vector3i", Notes = "Creates a new Vector3i object with the specified coords." }, + { Params = "{{Vector3d}}", Return = "Vector3i", Notes = "Creates a new Vector3i object with coords copied and floor()-ed from the specified {{Vector3d}}." }, + }, + Equals = { Params = "Vector3i", Return = "bool", Notes = "Returns true if this vector is exactly the same as the specified vector." }, + Length = { Params = "", Return = "number", Notes = "Returns the (euclidean) length of this vector." }, + Move = { Params = "X, Y, Z", Return = "", Notes = "Moves the vector by the specified amount in each axis direction." }, + Set = { Params = "x, y, z", Return = "", Notes = "Sets all the coords of the vector at once" }, + SqrLength = { Params = "", Return = "number", Notes = "Returns the (euclidean) length of this vector, squared. This operation is slightly less computationally expensive than Length(), while it conserves some properties of Length(), such as comparison." }, + }, + Variables = + { + x = { Type = "number", Notes = "The X coord of the vector." }, + y = { Type = "number", Notes = "The Y coord of the vector." }, + z = { Type = "number", Notes = "The Z coord of the vector." }, + }, + }, -- Vector3i +} + + + + diff --git a/Server/Plugins/APIDump/Classes/Network.lua b/Server/Plugins/APIDump/Classes/Network.lua new file mode 100644 index 000000000..c7626562d --- /dev/null +++ b/Server/Plugins/APIDump/Classes/Network.lua @@ -0,0 +1,372 @@ + +-- Network.lua + +-- Defines the documentation for the cNetwork-related classes + + + + + +return +{ + cNetwork = + { + Desc = + [[ + This is the namespace for high-level network-related operations. Allows plugins to make TCP + connections to the outside world using a callback-based API.

    +

    + All functions in this namespace are static, they should be called on the cNetwork class itself: +

    +local Server = cNetwork:Listen(1024, ListenCallbacks);
    +

    + ]], + AdditionalInfo = + { + { + Header = "Using callbacks", + Contents = + [[ + The entire Networking API is callback-based. Whenever an event happens on the network object, a + specific plugin-provided function is called. The callbacks are stored in tables which are passed + to the API functions, each table contains multiple callbacks for the various situations.

    +

    + There are four different callback variants used: LinkCallbacks, LookupCallbacks, ListenCallbacks + and UDPCallbacks. Each is used in the situation appropriate by its name - LinkCallbacks are used + for handling the traffic on a single network link (plus additionally creation of such link when + connecting as a client), LookupCallbacks are used when doing DNS and reverse-DNS lookups, + ListenCallbacks are used for handling incoming connections as a server and UDPCallbacks are used + for incoming UDP datagrams.

    +

    + LinkCallbacks have the following structure:
    +

    +local LinkCallbacks =
    +{
    +	OnConnected = function ({{cTCPLink|a_TCPLink}})
    +		-- The specified {{cTCPLink|link}} has succeeded in connecting to the remote server.
    +		-- Only called if the link is being connected as a client (using cNetwork:Connect() )
    +		-- Not used for incoming server links
    +		-- All returned values are ignored
    +	end,
    +	
    +	OnError = function ({{cTCPLink|a_TCPLink}}, a_ErrorCode, a_ErrorMsg)
    +		-- The specified error has occured on the {{cTCPLink|link}}
    +		-- No other callback will be called for this link from now on
    +		-- For a client link being connected, this reports a connection error (destination unreachable etc.)
    +		-- It is an Undefined Behavior to send data to a_TCPLink in or after this callback
    +		-- All returned values are ignored
    +	end,
    +	
    +	OnReceivedData = function ({{cTCPLink|a_TCPLink}}, a_Data)
    +		-- Data has been received on the {{cTCPLink|link}}
    +		-- Will get called whenever there's new data on the {{cTCPLink|link}}
    +		-- a_Data contains the raw received data, as a string
    +		-- All returned values are ignored
    +	end,
    +	
    +	OnRemoteClosed = function ({{cTCPLink|a_TCPLink}})
    +		-- The remote peer has closed the {{cTCPLink|link}}
    +		-- The link is already closed, any data sent to it now will be lost
    +		-- No other callback will be called for this link from now on
    +		-- All returned values are ignored
    +	end,
    +}
    +

    +

    + LookupCallbacks have the following structure:
    +

    +local LookupCallbacks =
    +{
    +	OnError = function (a_Query, a_ErrorCode, a_ErrorMsg)
    +		-- The specified error has occured while doing the lookup
    +		-- a_Query is the hostname or IP being looked up
    +		-- No other callback will be called for this lookup from now on
    +		-- All returned values are ignored
    +	end,
    +
    +	OnFinished = function (a_Query)
    +		-- There are no more DNS records for this query
    +		-- a_Query is the hostname or IP being looked up
    +		-- No other callback will be called for this lookup from now on
    +		-- All returned values are ignored
    +	end,
    +
    +	OnNameResolved = function (a_Hostname, a_IP)
    +		-- A DNS record has been found, the specified hostname resolves to the IP
    +		-- Called for both Hostname -> IP and IP -> Hostname lookups
    +		-- May be called multiple times if a hostname resolves to multiple IPs
    +		-- All returned values are ignored
    +	end,
    +}
    +

    +

    + ListenCallbacks have the following structure:
    +

    +local ListenCallbacks =
    +{
    +	OnAccepted = function ({{cTCPLink|a_TCPLink}})
    +		-- A new connection has been accepted and a {{cTCPLink|Link}} for it created
    +		-- It is safe to send data to the link now
    +		-- All returned values are ignored
    +	end,
    +	
    +	OnError = function (a_ErrorCode, a_ErrorMsg)
    +		-- The specified error has occured while trying to listen
    +		-- No other callback will be called for this server handle from now on
    +		-- This callback is called before the cNetwork:Listen() call returns
    +		-- All returned values are ignored
    +	end,
    +
    +	OnIncomingConnection = function (a_RemoteIP, a_RemotePort, a_LocalPort)
    +		-- A new connection is being accepted, from the specified remote peer
    +		-- This function needs to return either nil to drop the connection,
    +		-- or valid LinkCallbacks to use for the new connection's {{cTCPLink|TCPLink}} object
    +		return SomeLinkCallbacks
    +	end,
    +}
    +

    +

    + UDPCallbacks have the following structure:
    +

    +local UDPCallbacks =
    +{
    +	OnError = function (a_ErrorCode, a_ErrorMsg)
    +		-- The specified error has occured when trying to listen for incoming UDP datagrams
    +		-- No other callback will be called for this endpoint from now on
    +		-- This callback is called before the cNetwork:CreateUDPEndpoint() call returns
    +		-- All returned values are ignored
    +	end,
    +
    +	OnReceivedData = function ({{cUDPEndpoint|a_UDPEndpoint}}, a_Data, a_RemotePeer, a_RemotePort)
    +		-- A datagram has been received on the {{cUDPEndpoint|endpoint}} from the specified remote peer
    +		-- a_Data contains the raw received data, as a string
    +		-- All returned values are ignored
    +	end,
    +}
    +
    + ]], + }, + + { + Header = "Example client connection", + Contents = + [[ + The following example, adapted from the NetworkTest plugin, shows a simple example of a client + connection using the cNetwork API. It connects to www.google.com on port 80 (http) and sends a http + request for the front page. It dumps the received data to the console.

    +

    + First, the callbacks are defined in a table. The OnConnected() callback takes care of sending the http + request once the socket is connected. The OnReceivedData() callback sends all data to the console. The + OnError() callback logs any errors. Then, the connection is initiated using the cNetwork::Connect() API + function.

    +

    +

    +-- Define the callbacks to use for the client connection:
    +local ConnectCallbacks =
    +{
    +	OnConnected = function (a_Link)
    +		-- Connection succeeded, send the http request:
    +		a_Link:Send("GET / HTTP/1.0\r\nHost: www.google.com\r\n\r\n")
    +	end,
    +	
    +	OnError = function (a_Link, a_ErrorCode, a_ErrorMsg)
    +		-- Log the error to console:
    +		LOG("An error has occurred while talking to google.com: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")")
    +	end,
    +	
    +	OnReceivedData = function (a_Link, a_Data)
    +		-- Log the received data to console:
    +		LOG("Incoming http data:\r\n" .. a_Data)
    +	end,
    +	
    +	OnRemoteClosed = function (a_Link)
    +		-- Log the event into the console:
    +		LOG("Connection to www.google.com closed")
    +	end,
    +}
    +
    +-- Connect:
    +if not(cNetwork:Connect("www.google.com", 80, ConnectCallbacks)) then
    +	-- Highly unlikely, but better check for errors
    +	LOG("Cannot queue connection to www.google.com")
    +end
    +-- Note that the connection is being made on the background,
    +-- there's no guarantee that it's already connected at this point in code
    +
    + ]], + }, + + { + Header = "Example server implementation", + Contents = + [[ + The following example, adapted from the NetworkTest plugin, shows a simple example of creating a + server listening on a TCP port using the cNetwork API. The server listens on port 9876 and for + each incoming connection it sends a welcome message and then echoes back whatever the client has + sent ("echo server").

    +

    + First, the callbacks for the listening server are defined. The most important of those is the + OnIncomingConnection() callback that must return the LinkCallbacks that will be used for the new + connection. In our simple scenario each connection uses the same callbacks, so a predefined + callbacks table is returned; it is, however, possible to define different callbacks for each + connection. This allows the callbacks to be "personalised", for example by the remote IP or the + time of connection. The OnAccepted() and OnError() callbacks only log that they occurred, there's + no processing needed for them.

    +

    + Finally, the cNetwork:Listen() API function is used to create the listening server. The status of + the server is checked and if it is successfully listening, it is stored in a global variable, so + that Lua doesn't garbage-collect it until we actually want the server closed.

    +

    +

    +-- Define the callbacks used for the incoming connections:
    +local EchoLinkCallbacks =
    +{
    +	OnConnected = function (a_Link)
    +		-- This will not be called for a server connection, ever
    +		assert(false, "Unexpected Connect callback call")
    +	end,
    +	
    +	OnError = function (a_Link, a_ErrorCode, a_ErrorMsg)
    +		-- Log the error to console:
    +		local RemoteName = "'" .. a_Link:GetRemoteIP() .. ":" .. a_Link:GetRemotePort() .. "'"
    +		LOG("An error has occurred while talking to " .. RemoteName .. ": " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")")
    +	end,
    +	
    +	OnReceivedData = function (a_Link, a_Data)
    +		-- Send the received data back to the remote peer
    +		a_Link:Send(Data)
    +	end,
    +	
    +	OnRemoteClosed = function (a_Link)
    +		-- Log the event into the console:
    +		local RemoteName = "'" .. a_Link:GetRemoteIP() .. ":" .. a_Link:GetRemotePort() .. "'"
    +		LOG("Connection to '" .. RemoteName .. "' closed")
    +	end,
    +}
    +
    +-- Define the callbacks used by the server:
    +local ListenCallbacks =
    +{
    +	OnAccepted = function (a_Link)
    +		-- No processing needed, just log that this happened:
    +		LOG("OnAccepted callback called")
    +	end,
    +	
    +	OnError = function (a_ErrorCode, a_ErrorMsg)
    +		-- An error has occured while listening for incoming connections, log it:
    +		LOG("Cannot listen, error " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")"
    +	end,
    +
    +	OnIncomingConnection = function (a_RemoteIP, a_RemotePort, a_LocalPort)
    +		-- A new connection is being accepted, give it the EchoCallbacks
    +		return EchoLinkCallbacks
    +	end,
    +}
    +
    +-- Start the server:
    +local Server = cNetwork:Listen(9876, ListenCallbacks)
    +if not(Server:IsListening()) then
    +	-- The error has been already printed in the OnError() callbacks
    +	-- Just bail out
    +	return;
    +end
    +
    +-- Store the server globally, so that it stays open:
    +g_Server = Server
    +
    +...
    +
    +-- Elsewhere in the code, when terminating:
    +-- Close the server and let it be garbage-collected:
    +g_Server:Close()
    +g_Server = nil
    +
    + ]], + }, + }, -- AdditionalInfo + + Functions = + { + Connect = { Params = "Host, Port, LinkCallbacks", Return = "bool", Notes = "(STATIC) Begins establishing a (client) TCP connection to the specified host. Uses the LinkCallbacks table to report progress, success, errors and incoming data. Returns false if it fails immediately (bad port value, bad hostname format), true otherwise. Host can be either an IP address or a hostname." }, + CreateUDPEndpoint = { Params = "Port, UDPCallbacks", Return = "{{cUDPEndpoint|UDPEndpoint}}", Notes = "(STATIC) Creates a UDP endpoint that listens for incoming datagrams on the specified port, and can be used to send or broadcast datagrams. Uses the UDPCallbacks to report incoming datagrams or errors. If the endpoint cannot be created, the OnError callback is called with the error details and the returned endpoint will report IsOpen() == false. The plugin needs to store the returned endpoint object for as long as it needs the UDP port open; if the endpoint is garbage-collected by Lua, the socket will be closed and no more incoming data will be reported.
    If the Port is zero, the OS chooses an available UDP port for the endpoint; use {{cUDPEndpoint}}:GetPort() to query the port number in such case." }, + EnumLocalIPAddresses = { Params = "", Return = "array-table of strings", Notes = "(STATIC) Returns all local IP addresses for network interfaces currently available on the machine." }, + HostnameToIP = { Params = "Host, LookupCallbacks", Return = "bool", Notes = "(STATIC) Begins a DNS lookup to find the IP address(es) for the specified host. Uses the LookupCallbacks table to report progress, success or errors. Returns false if it fails immediately (bad hostname format), true if the lookup started successfully. Host can be either a hostname or an IP address." }, + IPToHostname = { Params = "Address, LookupCallbacks", Return = "bool", Notes = "(STATIC) Begins a reverse-DNS lookup to find out the hostname for the specified IP address. Uses the LookupCallbacks table to report progress, success or errors. Returns false if it fails immediately (bad address format), true if the lookup started successfully." }, + Listen = { Params = "Port, ListenCallbacks", Return = "{{cServerHandle|ServerHandle}}", Notes = "(STATIC) Starts listening on the specified port. Uses the ListenCallbacks to report incoming connections or errors. Returns a {{cServerHandle}} object representing the server. If the listen operation failed, the OnError callback is called with the error details and the returned server handle will report IsListening() == false. The plugin needs to store the server handle object for as long as it needs the server running, if the server handle is garbage-collected by Lua, the listening socket will be closed and all current connections dropped." }, + }, + }, -- cNetwork + + cServerHandle = + { + Desc = + [[ + This class provides an interface for TCP sockets listening for a connection. In order to listen, the + plugin needs to use the {{cNetwork}}:Listen() function to create the listening socket.

    +

    + Note that when Lua garbage-collects this class, the listening socket is closed. Therefore the plugin + should keep it referenced in a global variable for as long as it wants the server running. + ]], + + Functions = + { + Close = { Params = "", Return = "", Notes = "Closes the listening socket. No more connections will be accepted, and all current connections will be closed." }, + IsListening = { Params = "", Return = "bool", Notes = "Returns true if the socket is listening." }, + }, + }, -- cServerHandle + + cTCPLink = + { + Desc = + [[ + This class wraps a single TCP connection, that has been established. Plugins can create these by + calling {{cNetwork}}:Connect() to connect to a remote server, or by listening using + {{cNetwork}}:Listen() and accepting incoming connections. The links are callback-based - when an event + such as incoming data or remote disconnect happens on the link, a specific callback is called. See the + additional information in {{cNetwork}} documentation for details.

    +

    + The link can also optionally perform TLS encryption. Plugins can use the StartTLSClient() function to + start the TLS handshake as the client side. Since that call, the OnReceivedData() callback is + overridden internally so that the data is first routed through the TLS decryptor, and the plugin's + callback is only called for the decrypted data, once it starts arriving. The Send function changes its + behavior so that the data written by the plugin is first encrypted and only then sent over the + network. Note that calling Send() before the TLS handshake finishes is supported, but the data is + queued internally and only sent once the TLS handshake is completed. + ]], + + Functions = + { + Close = { Params = "", Return = "", Notes = "Closes the link forcefully (TCP RST). There's no guarantee that the last sent data is even being delivered. See also the Shutdown() method." }, + GetLocalIP = { Params = "", Return = "string", Notes = "Returns the IP address of the local endpoint of the TCP connection." }, + GetLocalPort = { Params = "", Return = "number", Notes = "Returns the port of the local endpoint of the TCP connection." }, + GetRemoteIP = { Params = "", Return = "string", Notes = "Returns the IP address of the remote endpoint of the TCP connection." }, + GetRemotePort = { Params = "", Return = "number", Notes = "Returns the port of the remote endpoint of the TCP connection." }, + Send = { Params = "Data", Return = "", Notes = "Sends the data (raw string) to the remote peer. The data is sent asynchronously and there is no report on the success of the send operation, other than the connection being closed or reset by the underlying OS." }, + Shutdown = { Params = "", Return = "", Notes = "Shuts the socket down for sending data. Notifies the remote peer that there will be no more data coming from us (TCP FIN). The data that is in flight will still be delivered. The underlying socket will be closed when the remote end shuts down as well, or after a timeout." }, + StartTLSClient = { Params = "OwnCert, OwnPrivateKey, OwnPrivateKeyPassword", Return = "", Notes = "Starts a TLS handshake on the link, as a client side of the TLS. The Own___ parameters specify the client certificate and its corresponding private key and password; all three parameters are optional and no client certificate is presented to the remote peer if they are not used or all empty. Once the TLS handshake is started by this call, all incoming data is first decrypted before being sent to the OnReceivedData callback, and all outgoing data is queued until the TLS handshake completes, and then sent encrypted over the link." }, + StartTLSServer = { Params = "Certificate, PrivateKey, PrivateKeyPassword, StartTLSData", Return = "", Notes = "Starts a TLS handshake on the link, as a server side of the TLS. The plugin needs to specify the server certificate and its corresponding private key and password. The StartTLSData can contain data that the link has already reported as received but it should be used as part of the TLS handshake. Once the TLS handshake is started by this call, all incoming data is first decrypted before being sent to the OnReceivedData callback, and all outgoing data is queued until the TLS handshake completes, and then sent encrypted over the link." }, + }, + }, -- cTCPLink + + cUDPEndpoint = + { + Desc = + [[ + Represents a UDP socket that is listening for incoming datagrams on a UDP port and can send or broadcast datagrams to other peers on the network. Plugins can create an instance of the endpoint by calling {{cNetwork}}:CreateUDPEndpoint(). The endpoints are callback-based - when a datagram is read from the network, the OnRececeivedData() callback is called with details about the datagram. See the additional information in {{cNetwork}} documentation for details.

    +

    + Note that when Lua garbage-collects this class, the listening socket is closed. Therefore the plugin should keep this object referenced in a global variable for as long as it wants the endpoint open. + ]], + + Functions = + { + Close = { Params = "", Return = "", Notes = "Closes the UDP endpoint. No more datagrams will be reported through the callbacks, the UDP port will be closed." }, + EnableBroadcasts = { Params = "", Return = "", Notes = "Some OSes need this call before they allow UDP broadcasts on an endpoint." }, + GetPort = { Params = "", Return = "number", Notes = "Returns the local port number of the UDP endpoint listening for incoming datagrams. Especially useful if the UDP endpoint was created with auto-assign port (0)." }, + IsOpen = { Params = "", Return = "bool", Notes = "Returns true if the UDP endpoint is listening for incoming datagrams." }, + Send = { Params = "RawData, RemoteHost, RemotePort", Return = "bool", Notes = "Sends the specified raw data (string) to the specified remote host. The RemoteHost can be either a hostname or an IP address; if it is a hostname, the endpoint will queue a DNS lookup first, if it is an IP address, the send operation is executed immediately. Returns true if there was no immediate error, false on any failure. Note that the return value needn't represent whether the packet was actually sent, only if it was successfully queued." }, + }, + }, -- cUDPEndpoint +} + + + + diff --git a/Server/Plugins/APIDump/Classes/Plugins.lua b/Server/Plugins/APIDump/Classes/Plugins.lua new file mode 100644 index 000000000..0d0aae04f --- /dev/null +++ b/Server/Plugins/APIDump/Classes/Plugins.lua @@ -0,0 +1,207 @@ +return +{ + cPlugin = + { + Desc = [[cPlugin describes a Lua plugin. This page is dedicated to new-style plugins and contain their functions. Each plugin has its own Plugin object. +]], + Functions = + { + GetDirectory = { Return = "string", Notes = "OBSOLETE, use GetFolderName() instead!" }, + GetFolderName = { Params = "", Return = "string", Notes = "Returns the name of the folder where the plugin's files are. (APIDump)" }, + GetLoadError = { Params = "", Return = "string", Notes = "If the plugin failed to load, returns the error message for the failure." }, + GetLocalDirectory = { Notes = "OBSOLETE, use GetLocalFolder instead." }, + GetLocalFolder = { Return = "string", Notes = "Returns the path where the plugin's files are. (Plugins/APIDump)" }, + GetName = { Return = "string", Notes = "Returns the name of the plugin." }, + GetStatus = { Params = "", Return = "{{cPluginManager#PluginStatus|PluginStatus}}", Notes = "Returns the status of the plugin (loaded, disabled, unloaded, error, not found)" }, + GetVersion = { Return = "number", Notes = "Returns the version of the plugin." }, + IsLoaded = { Params = "", Return = "", Notes = "" }, + SetName = { Params = "string", Notes = "Sets the name of the Plugin." }, + SetVersion = { Params = "number", Notes = "Sets the version of the plugin." }, + }, + }, -- cPlugin + + cPluginLua = + { + Desc = "", + Functions = + { + AddWebTab = { Params = "", Return = "", Notes = "Adds a new webadmin tab" }, + }, + Inherits = "cPlugin", + }, -- cPluginLua + + cPluginManager = + { + Desc = [[ + This class is used for generic plugin-related functionality. The plugin manager has a list of all + plugins, can enable or disable plugins, manages hooks and in-game console commands.

    +

    + Plugins can be identified by either the PluginFolder or PluginName. Note that these two can differ, + refer to the forum for detailed discussion. +

    + There is one instance of cPluginManager in Cuberite, to get it, call either + {{cRoot|cRoot}}:Get():GetPluginManager() or cPluginManager:Get() function.

    +

    + Note that some functions are "static", that means that they are called using a dot operator instead + of the colon operator. For example: +

    +cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage);
    +

    + ]], + Functions = + { + AddHook = + { + { Params = "{{cPluginManager#Hooks|HookType}}, [HookFunction]", Return = "", Notes = "(STATIC) Informs the plugin manager that it should call the specified function when the specified hook event occurs. If a function is not specified, a default global function name is looked up, based on the hook type" }, + { Params = "{{cPlugin|Plugin}}, {{cPluginManager#Hooks|HookType}}, [HookFunction]", Return = "", Notes = "(STATIC, DEPRECATED) Informs the plugin manager that it should call the specified function when the specified hook event occurs. If a function is not specified, a default function name is looked up, based on the hook type. NOTE: This format is deprecated and the server outputs a warning if it is used!" }, + }, + BindCommand = + { + { Params = "Command, Permission, Callback, HelpString", Return = "[bool]", Notes = "(STATIC) Binds an in-game command with the specified callback function, permission and help string. By common convention, providing an empty string for HelpString will hide the command from the /help display. Returns true if successful, logs to console and returns no value on error. The callback uses the following signature:
    function(Split, {{cPlayer|Player}})
    The Split parameter contains an array-table of the words that the player has sent, Player is the {{cPlayer}} object representing the player who sent the command. If the callback returns true, the command is assumed to have executed successfully; in all other cases the server sends a warning to the player that the command is unknown (this is so that subcommands can be implemented)." }, + { Params = "Command, Permission, Callback, HelpString", Return = "[bool]", Notes = "Binds an in-game command with the specified callback function, permission and help string. By common convention, providing an empty string for HelpString will hide the command from the /help display. Returns true if successful, logs to console and returns no value on error. The callback uses the following signature:
    function(Split, {{cPlayer|Player}})
    The Split parameter contains an array-table of the words that the player has sent, Player is the {{cPlayer}} object representing the player who sent the command. If the callback returns true, the command is assumed to have executed successfully; in all other cases the server sends a warning to the player that the command is unknown (this is so that subcommands can be implemented)." }, + }, + BindConsoleCommand = + { + { Params = "Command, Callback, HelpString", Return = "[bool]", Notes = "(STATIC) Binds a console command with the specified callback function and help string. By common convention, providing an empty string for HelpString will hide the command from the \"help\" console command. Returns true if successful, logs to console and returns no value on error. The callback uses the following signature:
    function(Split)
    The Split parameter contains an array-table of the words that the admin has typed. If the callback returns true, the command is assumed to have executed successfully; in all other cases the server issues a warning to the console that the command is unknown (this is so that subcommands can be implemented)." }, + { Params = "Command, Callback, HelpString", Return = "[bool]", Notes = "Binds a console command with the specified callback function and help string. By common convention, providing an empty string for HelpString will hide the command from the \"help\" console command. Returns true if successful, logs to console and returns no value on error. The callback uses the following signature:
    function(Split)
    The Split parameter contains an array-table of the words that the admin has typed. If the callback returns true, the command is assumed to have executed successfully; in all other cases the server issues a warning to the console that the command is unknown (this is so that subcommands can be implemented)." }, + }, + CallPlugin = { Params = "PluginName, FunctionName, [FunctionArgs...]", Return = "[FunctionRets]", Notes = "(STATIC) Calls the specified function in the specified plugin, passing all the given arguments to it. If it succeeds, it returns all the values returned by that function. If it fails, returns no value at all. Note that only strings, numbers, bools, nils and classes can be used for parameters and return values; tables and functions cannot be copied across plugins." }, + DoWithPlugin = { Params = "PluginName, CallbackFn", Return = "bool", Notes = "(STATIC) Calls the CallbackFn for the specified plugin, if found. A plugin can be found even if it is currently unloaded, disabled or errored, the callback should check the plugin status. If the plugin is not found, this function returns false, otherwise it returns the bool value that the callback has returned. The CallbackFn has the following signature:
    function ({{cPlugin|Plugin}})
    " }, + ExecuteCommand = { Params = "{{cPlayer|Player}}, CommandStr", Return = "{{cPluginManager#CommandResult|CommandResult}}", Notes = "Executes the command as if given by the specified Player. Checks permissions." }, + ExecuteConsoleCommand = { Params = "CommandStr", Return = "bool, string", Notes = "Executes the console command as if given by the admin on the console. If the command is successfully executed, returns true and the text that would be output to the console normally. On error it returns false and an error message." }, + FindPlugins = { Params = "", Return = "", Notes = "OBSOLETE, use RefreshPluginList() instead"}, + ForceExecuteCommand = { Params = "{{cPlayer|Player}}, CommandStr", Return = "{{cPluginManager#CommandResult|CommandResult}}", Notes = "Same as ExecuteCommand, but doesn't check permissions" }, + ForEachCommand = { Params = "CallbackFn", Return = "bool", Notes = "Calls the CallbackFn function for each command that has been bound using BindCommand(). The CallbackFn has the following signature:
    function(Command, Permission, HelpString)
    If the callback returns true, the enumeration is aborted and this API function returns false; if it returns false or no value, the enumeration continues with the next command, and the API function returns true." }, + ForEachConsoleCommand = { Params = "CallbackFn", Return = "bool", Notes = "Calls the CallbackFn function for each command that has been bound using BindConsoleCommand(). The CallbackFn has the following signature:
    function (Command, HelpString)
    If the callback returns true, the enumeration is aborted and this API function returns false; if it returns false or no value, the enumeration continues with the next command, and the API function returns true." }, + ForEachPlugin = { Params = "CallbackFn", Return = "bool", Notes = "(STATIC) Calls the CallbackFn function for each plugin that is currently discovered by Cuberite (including disabled, unloaded and errrored plugins). The CallbackFn has the following signature:
    function ({{cPlugin|Plugin}})
    If the callback returns true, the enumeration is aborted and this API function returns false; if it returns false or no value, the enumeration continues with the next command, and the API function returns true." }, + Get = { Params = "", Return = "cPluginManager", Notes = "(STATIC) Returns the single instance of the plugin manager" }, + GetAllPlugins = { Params = "", Return = "table", Notes = "Returns a table (dictionary) of all plugins, [name => value], where value is a valid {{cPlugin}} if the plugin is loaded, or the bool value false if the plugin is not loaded." }, + GetCommandPermission = { Params = "Command", Return = "Permission", Notes = "Returns the permission needed for executing the specified command" }, + GetCurrentPlugin = { Params = "", Return = "{{cPlugin}}", Notes = "Returns the {{cPlugin}} object for the calling plugin. This is the same object that the Initialize function receives as the argument." }, + GetNumLoadedPlugins = { Params = "", Return = "number", Notes = "Returns the number of loaded plugins (psLoaded only)" }, + GetNumPlugins = { Params = "", Return = "number", Notes = "Returns the number of plugins, including the disabled, errored, unloaded and not-found ones" }, + GetPlugin = { Params = "PluginName", Return = "{{cPlugin}}", Notes = "(DEPRECATED, UNSAFE) Returns a plugin handle of the specified plugin, or nil if such plugin is not loaded. Note thatdue to multithreading the handle is not guaranteed to be safe for use when stored - a single-plugin reload may have been triggered in the mean time for the requested plugin." }, + GetPluginsPath = { Params = "", Return = "string", Notes = "Returns the path where the individual plugin folders are located. Doesn't include the path separator at the end of the returned string." }, + IsCommandBound = { Params = "Command", Return = "bool", Notes = "Returns true if in-game Command is already bound (by any plugin)" }, + IsConsoleCommandBound = { Params = "Command", Return = "bool", Notes = "Returns true if console Command is already bound (by any plugin)" }, + IsPluginLoaded = { Params = "PluginName", Return = "", Notes = "Returns true if the specified plugin is loaded." }, + LoadPlugin = { Params = "PluginFolder", Return = "", Notes = "(DEPRECATED) Loads a plugin from the specified folder. NOTE: Loading plugins may be an unsafe operation and may result in a deadlock or a crash. This API is deprecated and might be removed." }, + LogStackTrace = { Params = "", Return = "", Notes = "(STATIC) Logs a current stack trace of the Lua engine to the server console log. Same format as is used when the plugin fails." }, + RefreshPluginList = { Params = "", Return = "", Notes = "Refreshes the list of plugins to include all folders inside the Plugins folder (potentially new disabled plugins)" }, + ReloadPlugins = { Params = "", Return = "", Notes = "Reloads all active plugins" }, + UnloadPlugin = { Params = "PluginName", Return = "", Notes = "Queues the specified plugin to be unloaded. To avoid deadlocks, the unloading happens in the main tick thread asynchronously." }, + }, + ConstantGroups= + { + CommandResult = + { + Include = "^cr.*", + TextBefore = [[ + Results that the (Force)ExecuteCommand return. This gives information if the command is executed or not and the reason. + ]], + }, + }, + Constants = + { + crBlocked = { Notes = "When a plugin stopped the command using the OnExecuteCommand hook" }, + crError = { Notes = "When the command handler for the given command results in an error" }, + crExecuted = { Notes = "When the command is successfully executed." }, + crNoPermission = { Notes = "When the player doesn't have permission to execute the given command." }, + crUnknownCommand = { Notes = "When the given command doesn't exist." }, + HOOK_BLOCK_SPREAD = { Notes = "Called when a block spreads based on world conditions" }, + HOOK_BLOCK_TO_PICKUPS = { Notes = "Called when a block has been dug and is being converted to pickups. The server has provided the default pickups and the plugins may modify them." }, + HOOK_CHAT = { Notes = "Called when a client sends a chat message that is not a command. The plugin may modify the chat message" }, + HOOK_CHUNK_AVAILABLE = { Notes = "Called when a chunk is loaded or generated and becomes available in the {{cWorld|world}}." }, + HOOK_CHUNK_GENERATED = { Notes = "Called after a chunk is generated. A plugin may do last modifications on the generated chunk before it is handed of to the {{cWorld|world}}." }, + HOOK_CHUNK_GENERATING = { Notes = "Called before a chunk is generated. A plugin may override some parts of the generation algorithm." }, + HOOK_CHUNK_UNLOADED = { Notes = "Called after a chunk has been unloaded from a {{cWorld|world}}." }, + HOOK_CHUNK_UNLOADING = { Notes = "Called before a chunk is unloaded from a {{cWorld|world}}. The chunk has already been saved." }, + HOOK_COLLECTING_PICKUP = { Notes = "Called when a player is about to collect a pickup." }, + HOOK_CRAFTING_NO_RECIPE = { Notes = "Called when a player has items in the crafting slots and the server cannot locate any recipe. Plugin may provide a recipe." }, + HOOK_DISCONNECT = { Notes = "Called after the player has disconnected." }, + HOOK_ENTITY_ADD_EFFECT = { Notes = "Called when an effect is being added to an {{cEntity|entity}}. Plugin may refuse the effect." }, + HOOK_ENTITY_TELEPORT = { Notes = "Called when an {{cEntity|entity}} is being teleported. Plugin may refuse the teleportation." }, + HOOK_EXECUTE_COMMAND = { Notes = "Called when a client sends a chat message that is recognized as a command, before handing that command to the regular command handler. A plugin may stop the command from being handled. This hook is called even when the player doesn't have permissions for the command." }, + HOOK_EXPLODED = { Notes = "Called after an explosion has been processed in a {{cWorld|world}}." }, + HOOK_EXPLODING = { Notes = "Called before an explosion is processed in a {{cWorld|world}}. A plugin may alter the explosion parameters or cancel the explosion altogether." }, + HOOK_HANDSHAKE = { Notes = "Called when a Handshake packet is received from a client." }, + HOOK_HOPPER_PULLING_ITEM = { Notes = "Called when a hopper is pulling an item from the container above it." }, + HOOK_HOPPER_PUSHING_ITEM = { Notes = "Called when a hopper is pushing an item into the container it is aimed at." }, + HOOK_KILLING = { Notes = "Called when an entity has just been killed. A plugin may resurrect the entity by setting its health to above zero." }, + HOOK_LOGIN = { Notes = "Called when a Login packet is sent to the client, before the client is queued for authentication." }, + HOOK_PLAYER_ANIMATION = { Notes = "Called when a client send the Animation packet." }, + HOOK_PLAYER_BREAKING_BLOCK = { Notes = "Called when a player is about to break a block. A plugin may cancel the event." }, + HOOK_PLAYER_BROKEN_BLOCK = { Notes = "Called after a player has broken a block." }, + HOOK_PLAYER_DESTROYED = { Notes = "Called when the {{cPlayer}} object is destroyed - a player has disconnected." }, + HOOK_PLAYER_EATING = { Notes = "Called when the player starts eating a held item. Plugins may abort the eating." }, + HOOK_PLAYER_FISHED = { Notes = "Called when the player reels the fishing rod back in, after the server decides the player's fishing reward." }, + HOOK_PLAYER_FISHING = { Notes = "Called when the player reels the fishing rod back in, plugins may alter the fishing reward." }, + HOOK_PLAYER_FOOD_LEVEL_CHANGE = { Notes = "Called when the player's food level is changing. Plugins may refuse the change." }, + HOOK_PLAYER_JOINED = { Notes = "Called when the player entity has been created. It has not yet been fully initialized." }, + HOOK_PLAYER_LEFT_CLICK = { Notes = "Called when the client sends the LeftClick packet." }, + HOOK_PLAYER_MOVING = { Notes = "Called when the player has moved and the movement is now being applied." }, + HOOK_PLAYER_PLACED_BLOCK = { Notes = "Called when the player has just placed a block" }, + HOOK_PLAYER_PLACING_BLOCK = { Notes = "Called when the player is about to place a block. A plugin may cancel the event." }, + HOOK_PLAYER_RIGHT_CLICK = { Notes = "Called when the client sends the RightClick packet." }, + HOOK_PLAYER_RIGHT_CLICKING_ENTITY = { Notes = "Called when the client sends the UseEntity packet." }, + HOOK_PLAYER_SHOOTING = { Notes = "Called when the player releases the mouse button to fire their bow." }, + HOOK_PLAYER_SPAWNED = { Notes = "Called after the player entity has been created. The entity is fully initialized and is spawning in the {{cWorld|world}}." }, + HOOK_PLAYER_TOSSING_ITEM = { Notes = "Called when the player is tossing the held item (keypress Q)" }, + HOOK_PLAYER_USED_BLOCK = { Notes = "Called after the player has right-clicked a block" }, + HOOK_PLAYER_USED_ITEM = { Notes = "Called after the player has right-clicked with a usable item in their hand." }, + HOOK_PLAYER_USING_BLOCK = { Notes = "Called when the player is about to use (right-click) a block" }, + HOOK_PLAYER_USING_ITEM = { Notes = "Called when the player is about to right-click with a usable item in their hand." }, + HOOK_PLUGINS_LOADED = { Notes = "Called after all plugins have loaded." }, + HOOK_PLUGIN_MESSAGE = { Notes = "Called when a PluginMessage packet is received from a client." }, + HOOK_POST_CRAFTING = { Notes = "Called after a valid recipe has been chosen for the current contents of the crafting grid. Plugins may modify the recipe." }, + HOOK_PRE_CRAFTING = { Notes = "Called before a recipe is searched for the current contents of the crafting grid. Plugins may provide a recipe and cancel the built-in search." }, + HOOK_PROJECTILE_HIT_BLOCK = { Notes = "Called when a {{cProjectileEntity|projectile}} hits a block." }, + HOOK_PROJECTILE_HIT_ENTITY = { Notes = "Called when a {{cProjectileEntity|projectile}} hits an {{cEntity|entity}}." }, + HOOK_SERVER_PING = { Notes = "Called when a client pings the server from the server list. Plugins may change the favicon, server description, players online and maximum players values." }, + HOOK_SPAWNED_ENTITY = { Notes = "Called after an entity is spawned in a {{cWorld|world}}. The entity is already part of the world." }, + HOOK_SPAWNED_MONSTER = { Notes = "Called after a mob is spawned in a {{cWorld|world}}. The mob is already part of the world." }, + HOOK_SPAWNING_ENTITY = { Notes = "Called just before an entity is spawned in a {{cWorld|world}}." }, + HOOK_SPAWNING_MONSTER = { Notes = "Called just before a mob is spawned in a {{cWorld|world}}." }, + HOOK_TAKE_DAMAGE = { Notes = "Called when an entity is taking any kind of damage. Plugins may modify the damage value, effects, source or cancel the damage." }, + HOOK_TICK = { Notes = "Called when the main server thread ticks - 20 times a second." }, + HOOK_UPDATED_SIGN = { Notes = "Called after a {{cSignEntity|sign}} text has been updated, either by a player or by any external means." }, + HOOK_UPDATING_SIGN = { Notes = "Called before a {{cSignEntity|sign}} text is updated, either by a player or by any external means." }, + HOOK_WEATHER_CHANGED = { Notes = "Called after the weather has changed." }, + HOOK_WEATHER_CHANGING = { Notes = "Called just before the weather changes" }, + HOOK_WORLD_STARTED = { Notes = "Called when a world has been started." }, + HOOK_WORLD_TICK = { Notes = "Called in each world's tick thread when the game logic is about to tick (20 times a second)." }, + + psDisabled = { Notes = "The plugin is not enabled in settings.ini" }, + psError = { Notes = "The plugin is enabled in settings.ini, but it has run into an error while loading. Use {{cPlugin}}:GetLoadError() to identify the error." }, + psLoaded = { Notes = "The plugin is enabled and loaded." }, + psNotFound = { Notes = "The plugin has been loaded, but is no longer present on disk." }, + psUnloaded = { Notes = "The plugin is enabled in settings.ini, but it has been unloaded (by a command)." }, + }, -- constants + + ConstantGroups = + { + Hooks = + { + Include = {"HOOK_.*"}, + TextBefore = [[ + These constants identify individual hooks. To register the plugin to receive notifications on hooks, use the + cPluginManager:AddHook() function. For detailed description of each hook, see the + hooks reference.]], + }, + PluginStatus = + { + Include = {"ps.*"}, + TextBefore = [[ + These constants are used to report status of individual plugins. Use {{cPlugin}}:GetStatus() to query the + status of a plugin; use cPluginManager::ForEachPlugin() to iterate over plugins.]], + }, + CommandResult = + { + Include = {"cr.*"}, + TextBefore = [[ + These constants are returned by the ExecuteCommand() function to identify the exact outcome of the + operation.]], + }, + }, + }, -- cPluginManager +} diff --git a/Server/Plugins/APIDump/Classes/Projectiles.lua b/Server/Plugins/APIDump/Classes/Projectiles.lua new file mode 100644 index 000000000..748f58b71 --- /dev/null +++ b/Server/Plugins/APIDump/Classes/Projectiles.lua @@ -0,0 +1,174 @@ +return +{ + cArrowEntity = + { + Desc = [[ + Represents the arrow when it is shot from the bow. A subclass of the {{cProjectileEntity}}. + ]], + Functions = + { + CanPickup = { Params = "{{cPlayer|Player}}", Return = "bool", Notes = "Returns true if the specified player can pick the arrow when it's on the ground" }, + GetDamageCoeff = { Params = "", Return = "number", Notes = "Returns the damage coefficient stored within the arrow. The damage dealt by this arrow is multiplied by this coeff" }, + GetPickupState = { Params = "", Return = "PickupState", Notes = "Returns the pickup state (one of the psXXX constants, above)" }, + IsCritical = { Params = "", Return = "bool", Notes = "Returns true if the arrow should deal critical damage. Based on the bow charge when the arrow was shot." }, + SetDamageCoeff = { Params = "number", Return = "", Notes = "Sets the damage coefficient. The damage dealt by this arrow is multiplied by this coeff" }, + SetIsCritical = { Params = "bool", Return = "", Notes = "Sets the IsCritical flag on the arrow. Critical arrow deal additional damage" }, + SetPickupState = { Params = "PickupState", Return = "", Notes = "Sets the pickup state (one of the psXXX constants, above)" }, + }, + Constants = + { + psInCreative = { Notes = "The arrow can be picked up only by players in creative gamemode" }, + psInSurvivalOrCreative = { Notes = "The arrow can be picked up by players in survival or creative gamemode" }, + psNoPickup = { Notes = "The arrow cannot be picked up at all" }, + }, + ConstantGroups = + { + PickupState = + { + Include = "ps.*", + TextBefore = [[ + The following constants are used to signalize whether the arrow, once it lands, can be picked by + players: + ]], + }, + }, + Inherits = "cProjectileEntity", + }, -- cArrowEntity + + cExpBottleEntity = + { + Desc = [[ + Represents a thrown ExpBottle. A subclass of the {{cProjectileEntity}}. + ]], + Functions = + { + }, + Inherits = "cProjectileEntity", + }, -- cExpBottleEntity + + cFireChargeEntity = + { + Desc = [[ + Represents a fire charge that has been shot by a Blaze or a {{cDispenserEntity|Dispenser}}. A subclass + of the {{cProjectileEntity}}. + ]], + Functions = {}, + Inherits = "cProjectileEntity", + }, -- cFireChargeEntity + + cFireworkEntity = + { + Desc = [[ + Represents a firework rocket. + ]], + Functions = + { + GetItem = { Params = "", Return = "{{cItem}}", Notes = "Returns the item that has been used to create the firework rocket. The item's m_FireworkItem member contains all the firework-related data." }, + GetTicksToExplosion = { Params = "", Return = "number", Notes = "Returns the number of ticks left until the firework explodes." }, + SetItem = { Params = "{{cItem}}", Return = "", Notes = "Sets a new item to be used for the firework." }, + SetTicksToExplosion = { Params = "NumTicks", Return = "", Notes = "Sets the number of ticks left until the firework explodes." }, + }, + + Inherits = "cProjectileEntity", + }, -- cFireworkEntity + + cFloater = + { + Desc = "", + Functions = {}, + Inherits = "cProjectileEntity", + }, -- cFloater + + cGhastFireballEntity = + { + Desc = "", + Functions = {}, + Inherits = "cProjectileEntity", + }, -- cGhastFireballEntity + + cProjectileEntity = + { + Desc = "", + Functions = + { + GetCreator = { Params = "", Return = "{{cEntity}} descendant", Notes = "Returns the entity who created this projectile. May return nil." }, + GetMCAClassName = { Params = "", Return = "string", Notes = "Returns the string that identifies the projectile type (class name) in MCA files" }, + GetProjectileKind = { Params = "", Return = "ProjectileKind", Notes = "Returns the kind of this projectile (pkXXX constant)" }, + IsInGround = { Params = "", Return = "bool", Notes = "Returns true if this projectile has hit the ground." }, + }, + Constants = + { + pkArrow = { Notes = "The projectile is an {{cArrowEntity|arrow}}" }, + pkEgg = { Notes = "The projectile is a {{cThrownEggEntity|thrown egg}}" }, + pkEnderPearl = { Notes = "The projectile is a {{cThrownEnderPearlEntity|thrown enderpearl}}" }, + pkExpBottle = { Notes = "The projectile is a {{cExpBottleEntity|thrown exp bottle}}" }, + pkFireCharge = { Notes = "The projectile is a {{cFireChargeEntity|fire charge}}" }, + pkFirework = { Notes = "The projectile is a (flying) {{cFireworkEntity|firework}}" }, + pkFishingFloat = { Notes = "The projectile is a {{cFloater|fishing float}}" }, + pkGhastFireball = { Notes = "The projectile is a {{cGhastFireballEntity|ghast fireball}}" }, + pkSnowball = { Notes = "The projectile is a {{cThrownSnowballEntity|thrown snowball}}" }, + pkSplashPotion = { Notes = "The projectile is a {{cSplashPotionEntity|thrown splash potion}}" }, + pkWitherSkull = { Notes = "The projectile is a {{cWitherSkullEntity|wither skull}}" }, + }, + ConstantGroups = + { + ProjectileKind = + { + Include = "pk.*", + TextBefore = "The following constants are used to distinguish between the different projectile kinds:", + }, + }, + Inherits = "cEntity", + }, -- cProjectileEntity + + cSplashPotionEntity = + { + Desc = [[ + Represents a thrown splash potion. + ]], + Functions = + { + GetEntityEffect = { Params = "", Return = "{{cEntityEffect}}", Notes = "Returns the entity effect in this potion" }, + GetEntityEffectType = { Params = "", Return = "{{cEntityEffect|Entity effect type}}", Notes = "Returns the effect type of this potion" }, + GetPotionColor = { Params = "", Return = "number", Notes = "Returns the color index of the particles emitted by this potion" }, + SetEntityEffect = { Params = "{{cEntityEffect}}", Return = "", Notes = "Sets the entity effect for this potion" }, + SetEntityEffectType = { Params = "{{cEntityEffect|Entity effect type}}", Return = "", Notes = "Sets the effect type of this potion" }, + SetPotionColor = { Params = "number", Return = "", Notes = "Sets the color index of the particles for this potion" }, + }, + Inherits = "cProjectileEntity", + }, -- cSplashPotionEntity + + cThrownEggEntity = + { + Desc = [[ + Represents a thrown egg. + ]], + Functions = {}, + Inherits = "cProjectileEntity", + }, -- cThrownEggEntity + + cThrownEnderPearlEntity = + { + Desc = "Represents a thrown ender pearl.", + Functions = {}, + Inherits = "cProjectileEntity", + }, -- cThrownEnderPearlEntity + + cThrownSnowballEntity = + { + Desc = "Represents a thrown snowball.", + Functions = {}, + Inherits = "cProjectileEntity", + }, -- cThrownSnowballEntity + + cWitherSkullEntity = + { + Desc = "Represents a wither skull being shot.", + Functions = {}, + Inherits = "cProjectileEntity", + }, -- cWitherSkullEntity +} + + + + diff --git a/Server/Plugins/APIDump/Classes/WebAdmin.lua b/Server/Plugins/APIDump/Classes/WebAdmin.lua new file mode 100644 index 000000000..808335aea --- /dev/null +++ b/Server/Plugins/APIDump/Classes/WebAdmin.lua @@ -0,0 +1,51 @@ +return +{ + cWebAdmin = + { + Desc = "", + Functions = + { + GetHTMLEscapedString = { Params = "string", Return = "string", Notes = "(STATIC) Gets the HTML-escaped representation of a requested string. This is useful for user input and game data that is not guaranteed to be escaped already." }, + }, + }, -- cWebAdmin + + + HTTPFormData = + { + Desc = "This class stores data for one form element for a {{HTTPRequest|HTTP request}}.", + Variables = + { + Name = { Type = "string", Notes = "Name of the form element" }, + Type = { Type = "string", Notes = "Type of the data (usually empty)" }, + Value = { Type = "string", Notes = "Value of the form element. Contains the raw data as sent by the browser." }, + }, + }, -- HTTPFormData + + + HTTPRequest = + { + Desc = [[ + This class encapsulates all the data that is sent to the WebAdmin through one HTTP request. Plugins + receive this class as a parameter to the function handling the web requests, as registered in the + {{cPluginLua}}:AddWebPage(). + ]], + Constants = + { + FormData = { Notes = "Array-table of {{HTTPFormData}}, contains the values of individual form elements submitted by the client" }, + Params = { Notes = "Map-table of parameters given to the request in the URL (?param=value); if a form uses GET method, this is the same as FormData. For each parameter given as \"param=value\", there is an entry in the table with \"param\" as its key and \"value\" as its value." }, + PostParams = { Notes = "Map-table of data posted through a FORM - either a GET or POST method. Logically the same as FormData, but in a map-table format (for each parameter given as \"param=value\", there is an entry in the table with \"param\" as its key and \"value\" as its value)." }, + }, + + Variables = + { + Method = { Type = "string", Notes = "The HTTP method used to make the request. Usually GET or POST." }, + Path = { Type = "string", Notes = "The Path part of the URL (excluding the parameters)" }, + URL = { Type = "string", Notes = "The entire URL used for the request." }, + Username = { Type = "string", Notes = "Name of the logged-in user." }, + }, + }, -- HTTPRequest +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnBlockSpread.lua b/Server/Plugins/APIDump/Hooks/OnBlockSpread.lua new file mode 100644 index 000000000..7da796d4d --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnBlockSpread.lua @@ -0,0 +1,40 @@ +return +{ + HOOK_BLOCK_SPREAD = + { + CalledWhen = "Called when a block spreads based on world conditions", + DefaultFnName = "OnBlockSpread", -- also used as pagename + Desc = [[ + This hook is called when a block spreads.

    +

    + The spread carries with it the type of its source - whether it's a block spreads. + It also carries the identification of the actual source. The exact type of the identification + depends on the source kind: + + + + + + + +
    SourceNotes
    ssFireSpreadFire spreading
    ssGrassSpreadGrass spreading
    ssMushroomSpreadMushroom spreading
    ssMycelSpreadMycel spreading
    ssVineSpreadVine spreading

    + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the block resides" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" }, + { Name = "Source", Type = "eSpreadSource", Notes = "Source of the spread. See the table above." }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called, and finally + Cuberite will process the spread. If the function + returns true, no other callback is called for this event and the spread will not occur. + ]], + }, -- HOOK_BLOCK_SPREAD +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnBlockToPickups.lua b/Server/Plugins/APIDump/Hooks/OnBlockToPickups.lua new file mode 100644 index 000000000..d404da073 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnBlockToPickups.lua @@ -0,0 +1,62 @@ +return +{ + HOOK_BLOCK_TO_PICKUPS = + { + CalledWhen = "A block is about to be dug ({{cPlayer|player}}, {{cEntity|entity}} or natural reason), plugins may override what pickups that will produce.", + DefaultFnName = "OnBlockToPickups", -- also used as pagename + Desc = [[ + This callback gets called whenever a block is about to be dug. This includes {{cPlayer|players}} + digging blocks, entities causing blocks to disappear ({{cTNTEntity|TNT}}, Endermen) and natural + causes (water washing away a block). Plugins may override the amount and kinds of pickups this + action produces. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the block resides" }, + { Name = "Digger", Type = "{{cEntity}} descendant", Notes = "The entity causing the digging. May be a {{cPlayer}}, {{cTNTEntity}} or even nil (natural causes)" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" }, + { Name = "BlockType", Type = "BLOCKTYPE", Notes = "Block type of the block" }, + { Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "Block meta of the block" }, + { Name = "Pickups", Type = "{{cItems}}", Notes = "Items that will be spawned as pickups" }, + }, + Returns = [[ + If the function returns false or no value, the next callback in the hook chain will be called. If + the function returns true, no other callbacks in the chain will be called.

    +

    + Either way, the server will then spawn pickups specified in the Pickups parameter, so to disable + pickups, you need to Clear the object first, then return true. + ]], + CodeExamples = + { + { + Title = "Modify pickups", + Desc = "This example callback function makes tall grass drop diamonds when digged by natural causes (washed away by water).", + Code = [[ +function OnBlockToPickups(a_World, a_Digger, a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_Pickups) + if (a_Digger ~= nil) then + -- Not a natural cause + return false; + end + if (a_BlockType ~= E_BLOCK_TALL_GRASS) then + -- Not a tall grass being washed away + return false; + end + + -- Remove all pickups suggested by Cuberite: + a_Pickups:Clear(); + + -- Drop a diamond: + a_Pickups:Add(cItem(E_ITEM_DIAMOND)); + return true; +end; + ]], + }, + } , -- CodeExamples + }, -- HOOK_BLOCK_TO_PICKUPS +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnChat.lua b/Server/Plugins/APIDump/Hooks/OnChat.lua new file mode 100644 index 000000000..a15d09cc7 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnChat.lua @@ -0,0 +1,30 @@ +return +{ + HOOK_CHAT = + { + CalledWhen = "Player sends a chat message", + DefaultFnName = "OnChat", -- also used as pagename + Desc = [[ + A plugin may implement an OnChat() function and register it as a Hook to process chat messages from + the players. The function is then called for every in-game message sent from any player. Note that + registered in-game commands are not sent through this hook. Use the + {{OnExecuteCommand|HOOK_EXECUTE_COMMAND}} to intercept registered in-game commands. + ]], + Params = { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who sent the message" }, + { Name = "Message", Type = "string", Notes = "The message" }, + }, + Returns = [[ + The plugin may return 2 values. The first is a boolean specifying whether the hook handling is to be + stopped or not. If it is false, the message is broadcast to all players in the world. If it is true, + no message is broadcast and no further action is taken.

    +

    + The second value is specifies the message to broadcast. This way, plugins may modify the message. If + the second value is not provided, the original message is used. + ]], + }, -- HOOK_CHAT +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnChunkAvailable.lua b/Server/Plugins/APIDump/Hooks/OnChunkAvailable.lua new file mode 100644 index 000000000..61c191c57 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnChunkAvailable.lua @@ -0,0 +1,27 @@ +return +{ + HOOK_CHUNK_AVAILABLE = + { + CalledWhen = "A chunk has just been added to world, either generated or loaded. ", + DefaultFnName = "OnChunkAvailable", -- also used as pagename + Desc = [[ + This hook is called after a chunk is either generated or loaded from the disk. The chunk is + already available for manipulation using the {{cWorld}} API. This is a notification-only callback, + there is no behavior that plugins could override. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world to which the chunk belongs" }, + { Name = "ChunkX", Type = "number", Notes = "X-coord of the chunk" }, + { Name = "ChunkZ", Type = "number", Notes = "Z-coord of the chunk" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event. + ]], + }, -- HOOK_CHUNK_AVAILABLE +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnChunkGenerated.lua b/Server/Plugins/APIDump/Hooks/OnChunkGenerated.lua new file mode 100644 index 000000000..64bfdad5c --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnChunkGenerated.lua @@ -0,0 +1,67 @@ +return +{ + HOOK_CHUNK_GENERATED = + { + CalledWhen = "After a chunk was generated. Notification only.", + DefaultFnName = "OnChunkGenerated", -- also used as pagename + Desc = [[ + This hook is called when world generator finished its work on a chunk. The chunk data has already + been generated and is about to be stored in the {{cWorld|world}}. A plugin may provide some + last-minute finishing touches to the generated data. Note that the chunk is not yet stored in the + world, so regular {{cWorld}} block API will not work! Instead, use the {{cChunkDesc}} object + received as the parameter.

    +

    + See also the {{OnChunkGenerating|HOOK_CHUNK_GENERATING}} hook. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world to which the chunk will be added" }, + { Name = "ChunkX", Type = "number", Notes = "X-coord of the chunk" }, + { Name = "ChunkZ", Type = "number", Notes = "Z-coord of the chunk" }, + { Name = "ChunkDesc", Type = "{{cChunkDesc}}", Notes = "Generated chunk data. Plugins may still modify the chunk data contained." }, + }, + Returns = [[ + If the plugin returns false or no value, Cuberite will call other plugins' callbacks for this event. + If a plugin returns true, no other callback is called for this event.

    +

    + In either case, Cuberite will then store the data from ChunkDesc as the chunk's contents in the world. + ]], + CodeExamples = + { + { + Title = "Generate emerald ore", + Desc = "This example callback function generates one block of emerald ore in each chunk, under the condition that the randomly chosen location is in an ExtremeHills biome.", + Code = [[ +function OnChunkGenerated(a_World, a_ChunkX, a_ChunkZ, a_ChunkDesc) + -- Generate a psaudorandom value that is always the same for the same X/Z pair, but is otherwise random enough: + -- This is actually similar to how Cuberite does its noise functions + local PseudoRandom = (a_ChunkX * 57 + a_ChunkZ) * 57 + 19785486 + PseudoRandom = PseudoRandom * 8192 + PseudoRandom; + PseudoRandom = ((PseudoRandom * (PseudoRandom * PseudoRandom * 15731 + 789221) + 1376312589) % 0x7fffffff; + PseudoRandom = PseudoRandom / 7; + + -- Based on the PseudoRandom value, choose a location for the ore: + local OreX = PseudoRandom % 16; + local OreY = 2 + ((PseudoRandom / 16) % 20); + local OreZ = (PseudoRandom / 320) % 16; + + -- Check if the location is in ExtremeHills: + if (a_ChunkDesc:GetBiome(OreX, OreZ) ~= biExtremeHills) then + return false; + end + + -- Only replace allowed blocks with the ore: + local CurrBlock = a_ChunDesc:GetBlockType(OreX, OreY, OreZ); + if ( + (CurrBlock == E_BLOCK_STONE) or + (CurrBlock == E_BLOCK_DIRT) or + (CurrBlock == E_BLOCK_GRAVEL) + ) then + a_ChunkDesc:SetBlockTypeMeta(OreX, OreY, OreZ, E_BLOCK_EMERALD_ORE, 0); + end +end; + ]], + }, + } , -- CodeExamples + }, -- HOOK_CHUNK_GENERATED +} \ No newline at end of file diff --git a/Server/Plugins/APIDump/Hooks/OnChunkGenerating.lua b/Server/Plugins/APIDump/Hooks/OnChunkGenerating.lua new file mode 100644 index 000000000..0db0e2727 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnChunkGenerating.lua @@ -0,0 +1,35 @@ +return +{ + HOOK_CHUNK_GENERATING = + { + CalledWhen = "A chunk is about to be generated. Plugin can override the built-in generator.", + DefaultFnName = "OnChunkGenerating", -- also used as pagename + Desc = [[ + This hook is called before the world generator starts generating a chunk. The plugin may provide + some or all parts of the generation, by-passing the built-in generator. The function is given access + to the {{cChunkDesc|ChunkDesc}} object representing the contents of the chunk. It may override parts + of the built-in generator by using the object's SetUseDefaultXXX(false) functions. After all + the callbacks for a chunk have been processed, the server will generate the chunk based on the + {{cChunkDesc|ChunkDesc}} description - those parts that are set for generating (by default + everything) are generated, the rest are read from the ChunkDesc object.

    +

    + See also the {{OnChunkGenerated|HOOK_CHUNK_GENERATED}} hook. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world to which the chunk will be added" }, + { Name = "ChunkX", Type = "number", Notes = "X-coord of the chunk" }, + { Name = "ChunkZ", Type = "number", Notes = "Z-coord of the chunk" }, + { Name = "ChunkDesc", Type = "{{cChunkDesc}}", Notes = "Generated chunk data." }, + }, + Returns = [[ + If this function returns true, the server will not call any other plugin with the same chunk. If + this function returns false, the server will call the rest of the plugins with the same chunk, + possibly overwriting the ChunkDesc's contents. + ]], + }, -- HOOK_CHUNK_GENERATING +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnChunkUnloaded.lua b/Server/Plugins/APIDump/Hooks/OnChunkUnloaded.lua new file mode 100644 index 000000000..a67d5d461 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnChunkUnloaded.lua @@ -0,0 +1,28 @@ +return +{ + HOOK_CHUNK_UNLOADED = + { + CalledWhen = "A chunk has been unloaded from the memory.", + DefaultFnName = "OnChunkUnloaded", -- also used as pagename + Desc = [[ + This hook is called when a chunk is unloaded from the memory. Though technically still in memory, + the plugin should behave as if the chunk was already not present. In particular, {{cWorld}} block + API should not be used in the area of the specified chunk. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world from which the chunk is unloading" }, + { Name = "ChunkX", Type = "number", Notes = "X-coord of the chunk" }, + { Name = "ChunkZ", Type = "number", Notes = "Z-coord of the chunk" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event. There is no behavior that plugins could + override. + ]], + }, -- HOOK_CHUNK_UNLOADED +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnChunkUnloading.lua b/Server/Plugins/APIDump/Hooks/OnChunkUnloading.lua new file mode 100644 index 000000000..98e0a71fd --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnChunkUnloading.lua @@ -0,0 +1,30 @@ +return +{ + HOOK_CHUNK_UNLOADING = + { + CalledWhen = " A chunk is about to be unloaded from the memory. Plugins may refuse the unload.", + DefaultFnName = "OnChunkUnloading", -- also used as pagename + Desc = [[ + Cuberite calls this function when a chunk is about to be unloaded from the memory. A plugin may + force Cuberite to keep the chunk in memory by returning true.

    +

    + FIXME: The return value should be used only for event propagation stopping, not for the actual + decision whether to unload. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world from which the chunk is unloading" }, + { Name = "ChunkX", Type = "number", Notes = "X-coord of the chunk" }, + { Name = "ChunkZ", Type = "number", Notes = "Z-coord of the chunk" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called and finally Cuberite + unloads the chunk. If the function returns true, no other callback is called for this event and the + chunk is left in the memory. + ]], + }, -- HOOK_CHUNK_UNLOADING +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnCollectingPickup.lua b/Server/Plugins/APIDump/Hooks/OnCollectingPickup.lua new file mode 100644 index 000000000..2a451da92 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnCollectingPickup.lua @@ -0,0 +1,32 @@ +return +{ + HOOK_COLLECTING_PICKUP = + { + CalledWhen = "Player is about to collect a pickup. Plugin can refuse / override behavior. ", + DefaultFnName = "OnCollectingPickup", -- also used as pagename + Desc = [[ + This hook is called when a player is about to collect a pickup. Plugins may refuse the action.

    +

    + Pickup collection happens within the world tick, so if the collecting is refused, it will be tried + again in the next world tick, as long as the player is within reach of the pickup.

    +

    + FIXME: There is no OnCollectedPickup() callback.

    +

    + FIXME: This callback is called even if the pickup doesn't fit into the player's inventory.

    + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who's collecting the pickup" }, + { Name = "Pickup", Type = "{{cPickup}}", Notes = "The pickup being collected" }, + }, + Returns = [[ + If the function returns false or no value, Cuberite calls other plugins' callbacks and finally the + pickup is collected. If the function returns true, no other plugins are called for this event and + the pickup is not collected. + ]], + }, -- HOOK_COLLECTING_PICKUP +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnCraftingNoRecipe.lua b/Server/Plugins/APIDump/Hooks/OnCraftingNoRecipe.lua new file mode 100644 index 000000000..7cd86b8b8 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnCraftingNoRecipe.lua @@ -0,0 +1,32 @@ +return +{ + HOOK_CRAFTING_NO_RECIPE = + { + CalledWhen = " No built-in crafting recipe is found. Plugin may provide a recipe.", + DefaultFnName = "OnCraftingNoRecipe", -- also used as pagename + Desc = [[ + This callback is called when a player places items in their {{cCraftingGrid|crafting grid}} and + Cuberite cannot find a built-in {{cCraftingRecipe|recipe}} for the combination. Plugins may provide + a recipe for the ingredients given. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player whose crafting is reported in this hook" }, + { Name = "Grid", Type = "{{cCraftingGrid}}", Notes = "Contents of the player's crafting grid" }, + { Name = "Recipe", Type = "{{cCraftingRecipe}}", Notes = "The recipe that will be used (can be filled by plugins)" }, + }, + Returns = [[ + If the function returns false or no value, no recipe will be used. If the function returns true, no + other plugin will have their callback called for this event and Cuberite will use the crafting + recipe in Recipe.

    +

    + FIXME: To allow plugins give suggestions and overwrite other plugins' suggestions, we should change + the behavior with returning false, so that the recipe will still be used, but fill the recipe with + empty values by default. + ]], + }, -- HOOK_CRAFTING_NO_RECIPE +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnDisconnect.lua b/Server/Plugins/APIDump/Hooks/OnDisconnect.lua new file mode 100644 index 000000000..ae872a3ad --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnDisconnect.lua @@ -0,0 +1,38 @@ +return +{ + HOOK_DISCONNECT = + { + CalledWhen = [[ + A client has disconnected, either by explicitly sending the disconnect packet (in older protocols) or + their connection was terminated + ]], + DefaultFnName = "OnDisconnect", -- also used as pagename + Desc = [[ + This hook is called when a client has disconnected from the server, for whatever reason. It is also + called when the client sends the Disconnect packet (only in pre-1.7 protocols). This hook is not called + for server ping connections.

    +

    + Note that the hook is called even for connections to players who failed to auth. In such a case there's + no {{cPlayer}} object associated with the client.

    +

    + See also the {{OnHandshake|HOOK_HANDSHAKE}} hook which is called when the client connects (and presents + a handshake message, so that they are not just status-pinging). If you need to store a per-player + object, use the {{OnPlayerJoined|HOOK_PLAYER_JOINED}} and {{OnPlayerDestroyed|HOOK_PLAYER_DESTROYED}} + hooks instead, those are guaranteed to have the {{cPlayer}} object associated. + ]], + Params = + { + { Name = "Client", Type = "{{cClientHandle}}", Notes = "The client who has disconnected" }, + { Name = "Reason", Type = "string", Notes = "The reason that the client has sent in the disconnect packet" }, + }, + Returns = [[ + If the function returns false or no value, Cuberite calls other plugins' callbacks for this event. + If the function returns true, no other plugins are called for this event. In either case, + the client is disconnected. + ]], + }, -- HOOK_DISCONNECT +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnEntityAddEffect.lua b/Server/Plugins/APIDump/Hooks/OnEntityAddEffect.lua new file mode 100644 index 000000000..155abc41b --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnEntityAddEffect.lua @@ -0,0 +1,33 @@ +return +{ + HOOK_ENTITY_ADD_EFFECT = + { + CalledWhen = "An entity effect is about to get added to an entity.", + DefaultFnName = "OnEntityAddEffect", -- also used as pagename + Desc = [[ + This hook is called whenever an entity effect is about to be added to an entity. The plugin may + disallow the addition by returning true.

    +

    Note that this hook only fires for adding the effect, but not for the actual effect application. See + also the {{OnEntityRemoveEffect|HOOK_ENTITY_REMOVE_EFFECT}} for notification about effects expiring / + removing, and {{OnEntityApplyEffect|HOOK_ENTITY_APPLY_EFFECT}} for the actual effect application to the + entity. + ]], + Params = + { + { Name = "Entity", Type = "{{cEntity}}", Notes = "The entity to which the effect is about to be added" }, + { Name = "EffectType", Type = "number", Notes = "The type of the effect to be added. One of the effXXX constants." }, + { Name = "EffectDuration", Type = "number", Notes = "The duration of the effect to be added, in ticks." }, + { Name = "EffectIntensity", Type = "number", Notes = "The intensity (level) of the effect to be added. " }, + { Name = "DistanceModifier", Type = "number", Notes = "The modifier for the effect intensity, based on distance. Used mainly for splash potions." }, + }, + Returns = [[ + If the plugin returns true, the effect will not be added and none of the remaining hook handlers will + be called. If the plugin returns false, Cuberite calls all the remaining hook handlers and finally + the effect is added to the entity. + ]], + }, -- HOOK_EXECUTE_COMMAND +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnEntityChangedWorld.lua b/Server/Plugins/APIDump/Hooks/OnEntityChangedWorld.lua new file mode 100644 index 000000000..6675fdbe0 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnEntityChangedWorld.lua @@ -0,0 +1,28 @@ +return +{ + HOOK_ENTITY_CHANGED_WORLD = + { + CalledWhen = "After a entity has changed the world.", + DefaultFnName = "OnEntityChangedWorld", -- also used as pagename + Desc = [[ + This hook is called after the server has moved the {{cEntity|entity}} to the given world. This is an information-only + callback, the entity is already in the new world.

    + See also the {{OnEntityChangingWorld|HOOK_ENTITY_CHANGING_WORLD}} hook for a similar hook called before the + entity is moved to the new world. + ]], + Params = + { + { Name = "Entity", Type = "{{cEntity}}", Notes = "The entity that has changed the world" }, + { Name = "World", Type = "{{cWorld}}", Notes = "The world from which the entity has come" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event. + ]], + }, -- HOOK_ENTITY_CHANGED_WORLD +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnEntityChangingWorld.lua b/Server/Plugins/APIDump/Hooks/OnEntityChangingWorld.lua new file mode 100644 index 000000000..521f829c7 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnEntityChangingWorld.lua @@ -0,0 +1,29 @@ +return +{ + HOOK_ENTITY_CHANGING_WORLD = + { + CalledWhen = "Before a entity is changing the world.", + DefaultFnName = "OnEntityChangingWorld", -- also used as pagename + Desc = [[ + This hook is called before the server moves the {{cEntity|entity}} to the given world. Plugins may + refuse the changing of the entity to the new world.

    + See also the {{OnEntityChangedWorld|HOOK_ENTITY_CHANGED_WORLD}} hook for a similar hook is called after the + entity has been moved to the world. + ]], + Params = + { + { Name = "Entity", Type = "{{cEntity}}", Notes = "The entity that wants to change the world" }, + { Name = "World", Type = "{{cWorld}}", Notes = "The world to which the entity wants to change" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event and the change of the entity to the world is + cancelled. + ]], + }, -- HOOK_ENTITY_CHANGING_WORLD +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnEntityTeleport.lua b/Server/Plugins/APIDump/Hooks/OnEntityTeleport.lua new file mode 100644 index 000000000..cdeb0947f --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnEntityTeleport.lua @@ -0,0 +1,29 @@ +return +{ + HOOK_ENTITY_TELEPORT = + { + CalledWhen = "Any entity teleports. Plugin may refuse teleport.", + DefaultFnName = "OnEntityTeleport", -- also used as pagename + Desc = [[ + This function is called in each server tick for each {{cEntity|Entity}} that has + teleported. Plugins may refuse the teleport. + ]], + Params = + { + { Name = "Entity", Type = "{{cEntity}}", Notes = "The entity who has teleported. New position is set in the object after successfull teleport" }, + { Name = "OldPosition", Type = "{{Vector3d}}", Notes = "The old position." }, + { Name = "NewPosition", Type = "{{Vector3d}}", Notes = "The new position." }, + }, + Returns = [[ + If the function returns true, teleport is prohibited.

    +

    + If the function returns false or no value, other plugins' callbacks are called and finally the new + position is permanently stored in the cEntity object.

    + ]], + }, -- HOOK_ENTITY_TELEPORT +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnExecuteCommand.lua b/Server/Plugins/APIDump/Hooks/OnExecuteCommand.lua new file mode 100644 index 000000000..4aa31bbd6 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnExecuteCommand.lua @@ -0,0 +1,41 @@ +return +{ + HOOK_EXECUTE_COMMAND = + { + CalledWhen = [[ + A player executes an in-game command, or the admin issues a console command. Note that built-in + console commands are exempt to this hook - they are always performed and the hook is not called. + ]], + DefaultFnName = "OnExecuteCommand", -- also used as pagename + Desc = [[ + A plugin may implement a callback for this hook to intercept both in-game commands executed by the + players and console commands executed by the server admin. The function is called for every in-game + command sent from any player and for those server console commands that are not built in in the + server.

    +

    + If the command is in-game, the first parameter to the hook function is the {{cPlayer|player}} who's + executing the command. If the command comes from the server console, the first parameter is nil.

    +

    + The server calls this hook even for unregistered (unknown) console commands. It also calls the hook + for unknown in-game commands, as long as they begin with a slash ('/'). If a plugin needs to intercept + in-game chat messages not beginning with a slash, it should use the {{OnChat|HOOK_CHAT}} hook. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "For in-game commands, the player who has sent the message. For console commands, nil" }, + { Name = "CommandSplit", Type = "array-table of strings", Notes = "The command and its parameters, broken into a table by spaces" }, + { Name = "EntireCommand", Type = "string", Notes = "The entire command as a single string" }, + }, + Returns = [[ + If the plugin returns false, Cuberite calls all the remaining hook handlers and finally the command + will be executed. If the plugin returns true, the none of the remaining hook handlers will be called. + In this case the plugin can return a second value, specifying whether what the command result should + be set to, one of the {{cPluginManager#CommandResult|CommandResult}} constants. If not + provided, the value defaults to crBlocked. + ]], + }, -- HOOK_EXECUTE_COMMAND +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnExploded.lua b/Server/Plugins/APIDump/Hooks/OnExploded.lua new file mode 100644 index 000000000..6a01542ab --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnExploded.lua @@ -0,0 +1,49 @@ +return +{ + HOOK_EXPLODED = + { + CalledWhen = "An explosion has happened", + DefaultFnName = "OnExploded", -- also used as pagename + Desc = [[ + This hook is called after an explosion has been processed in a world.

    +

    + See also {{OnExploding|HOOK_EXPLODING}} for a similar hook called before the explosion.

    +

    + The explosion carries with it the type of its source - whether it's a creeper exploding, or TNT, + etc. It also carries the identification of the actual source. The exact type of the identification + depends on the source kind: + + + + + + + + + + + + +
    SourceSourceData TypeNotes
    esPrimedTNT{{cTNTEntity}}An exploding primed TNT entity
    esCreeper{{cCreeper}}An exploding creeper or charged creeper
    esBed{{Vector3i}}A bed exploding in the Nether or in the End. The bed coords are given.
    esEnderCrystal{{Vector3i}}An ender crystal exploding upon hit. The block coords are given.
    esGhastFireball{{cGhastFireballEntity}}A ghast fireball hitting ground or an {{cEntity|entity}}.
    esWitherSkullBlackTBDA black wither skull hitting ground or an {{cEntity|entity}}.
    esWitherSkullBlueTBDA blue wither skull hitting ground or an {{cEntity|entity}}.
    esWitherBirthTBDA wither boss being created
    esOtherTBDAny other previously unspecified type.
    esPluginobjectAn explosion created by a plugin. The plugin may specify any kind of data.

    + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world where the explosion happened" }, + { Name = "ExplosionSize", Type = "number", Notes = "The relative explosion size" }, + { Name = "CanCauseFire", Type = "bool", Notes = "True if the explosion has turned random air blocks to fire (such as a ghast fireball)" }, + { Name = "X", Type = "number", Notes = "X-coord of the explosion center" }, + { Name = "Y", Type = "number", Notes = "Y-coord of the explosion center" }, + { Name = "Z", Type = "number", Notes = "Z-coord of the explosion center" }, + { Name = "Source", Type = "eExplosionSource", Notes = "Source of the explosion. See the table above." }, + { Name = "SourceData", Type = "varies", Notes = "Additional data for the source. The exact type varies by the source. See the table above." }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event. There is no overridable behaviour. + ]], + }, -- HOOK_EXPLODED +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnExploding.lua b/Server/Plugins/APIDump/Hooks/OnExploding.lua new file mode 100644 index 000000000..e21b41be0 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnExploding.lua @@ -0,0 +1,50 @@ +return +{ + HOOK_EXPLODING = + { + CalledWhen = "An explosion is about to be processed", + DefaultFnName = "OnExploding", -- also used as pagename + Desc = [[ + This hook is called before an explosion has been processed in a world.

    +

    + See also {{OnExploded|HOOK_EXPLODED}} for a similar hook called after the explosion.

    +

    + The explosion carries with it the type of its source - whether it's a creeper exploding, or TNT, + etc. It also carries the identification of the actual source. The exact type of the identification + depends on the source kind: + + + + + + + + + + + + +
    SourceSourceData TypeNotes
    esPrimedTNT{{cTNTEntity}}An exploding primed TNT entity
    esCreeper{{cCreeper}}An exploding creeper or charged creeper
    esBed{{Vector3i}}A bed exploding in the Nether or in the End. The bed coords are given.
    esEnderCrystal{{Vector3i}}An ender crystal exploding upon hit. The block coords are given.
    esGhastFireball{{cGhastFireballEntity}}A ghast fireball hitting ground or an {{cEntity|entity}}.
    esWitherSkullBlackTBDA black wither skull hitting ground or an {{cEntity|entity}}.
    esWitherSkullBlueTBDA blue wither skull hitting ground or an {{cEntity|entity}}.
    esWitherBirthTBDA wither boss being created
    esOtherTBDAny other previously unspecified type.
    esPluginobjectAn explosion created by a plugin. The plugin may specify any kind of data.

    + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world where the explosion happens" }, + { Name = "ExplosionSize", Type = "number", Notes = "The relative explosion size" }, + { Name = "CanCauseFire", Type = "bool", Notes = "True if the explosion will turn random air blocks to fire (such as a ghast fireball)" }, + { Name = "X", Type = "number", Notes = "X-coord of the explosion center" }, + { Name = "Y", Type = "number", Notes = "Y-coord of the explosion center" }, + { Name = "Z", Type = "number", Notes = "Z-coord of the explosion center" }, + { Name = "Source", Type = "eExplosionSource", Notes = "Source of the explosion. See the table above." }, + { Name = "SourceData", Type = "varies", Notes = "Additional data for the source. The exact type varies by the source. See the table above." }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called, and finally + Cuberite will process the explosion - destroy blocks and push + hurt entities. If the function + returns true, no other callback is called for this event and the explosion will not occur. + ]], + }, -- HOOK_EXPLODING +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnHandshake.lua b/Server/Plugins/APIDump/Hooks/OnHandshake.lua new file mode 100644 index 000000000..6183cc506 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnHandshake.lua @@ -0,0 +1,29 @@ +return +{ + HOOK_HANDSHAKE = + { + CalledWhen = "A client is connecting.", + DefaultFnName = "OnHandshake", -- also used as pagename + Desc = [[ + This hook is called when a client sends the Handshake packet. At this stage, only the client IP and + (unverified) username are known. Plugins may refuse access to the server based on this + information.

    +

    + Note that the username is not authenticated - the authentication takes place only after this hook is + processed. + ]], + Params = + { + { Name = "Client", Type = "{{cClientHandle}}", Notes = "The client handle representing the connection. Note that there's no {{cPlayer}} object for this client yet." }, + { Name = "UserName", Type = "string", Notes = "The username presented in the packet. Note that this username is unverified." }, + }, + Returns = [[ + If the function returns false, the user is let in to the server. If the function returns true, no + other plugin's callback is called, the user is kicked and the connection is closed. + ]], + }, -- HOOK_HANDSHAKE +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnHopperPullingItem.lua b/Server/Plugins/APIDump/Hooks/OnHopperPullingItem.lua new file mode 100644 index 000000000..b268a76be --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnHopperPullingItem.lua @@ -0,0 +1,30 @@ +return +{ + HOOK_HOPPER_PULLING_ITEM = + { + CalledWhen = "A hopper is pulling an item from another block entity.", + DefaultFnName = "OnHopperPullingItem", -- also used as pagename + Desc = [[ + This callback is called whenever a {{cHopperEntity|hopper}} transfers an {{cItem|item}} from another + block entity into its own internal storage. A plugin may decide to disallow the move by returning + true. Note that in such a case, the hook may be called again for the same hopper, with different + slot numbers. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "World where the hopper resides" }, + { Name = "Hopper", Type = "{{cHopperEntity}}", Notes = "The hopper that is pulling the item" }, + { Name = "DstSlot", Type = "number", Notes = "The destination slot in the hopper's {{cItemGrid|internal storage}}" }, + { Name = "SrcBlockEntity", Type = "{{cBlockEntityWithItems}}", Notes = "The block entity that is losing the item" }, + { Name = "SrcSlot", Type = "number", Notes = "Slot in SrcBlockEntity from which the item will be pulled" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event and the hopper will not pull the item. + ]], + }, -- HOOK_HOPPER_PULLING_ITEM +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnHopperPushingItem.lua b/Server/Plugins/APIDump/Hooks/OnHopperPushingItem.lua new file mode 100644 index 000000000..bd5702518 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnHopperPushingItem.lua @@ -0,0 +1,30 @@ +return +{ + HOOK_HOPPER_PUSHING_ITEM = + { + CalledWhen = "A hopper is pushing an item into another block entity. ", + DefaultFnName = "OnHopperPushingItem", -- also used as pagename + Desc = [[ + This hook is called whenever a {{cHopperEntity|hopper}} transfers an {{cItem|item}} from its own + internal storage into another block entity. A plugin may decide to disallow the move by returning + true. Note that in such a case, the hook may be called again for the same hopper and block, with + different slot numbers. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "World where the hopper resides" }, + { Name = "Hopper", Type = "{{cHopperEntity}}", Notes = "The hopper that is pushing the item" }, + { Name = "SrcSlot", Type = "number", Notes = "Slot in the hopper that will lose the item" }, + { Name = "DstBlockEntity", Type = "{{cBlockEntityWithItems}}", Notes = " The block entity that will receive the item" }, + { Name = "DstSlot", Type = "number", Notes = " Slot in DstBlockEntity's internal storage where the item will be stored" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event and the hopper will not push the item. + ]], + }, -- HOOK_HOPPER_PUSHING_ITEM +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnKilled.lua b/Server/Plugins/APIDump/Hooks/OnKilled.lua new file mode 100644 index 000000000..9289b8f35 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnKilled.lua @@ -0,0 +1,22 @@ +return +{ + HOOK_KILLED = + { + CalledWhen = "A player or a mob died.", + DefaultFnName = "OnKilled", + Desc = [[ + This hook is called whenever player or a mob dies. It can be used to change the death message. + ]], + Params = + { + { Name = "Victim", Type = "{{cEntity}}", Notes = "The player or mob that died" }, + { Name = "TDI", Type = "{{TakeDamageInfo}}", Notes = "Informations about the death" }, + { Name = "DeathMessage", Type = "string", Notes = "The default death message. An empty string if the victim is not a player" }, + }, + Returns = [[ + The function may return two values. The first value is a boolean specifying whether other plugins should be called. If it is true, the other plugins won't get notified of the death. If it is false, the other plugins will get notified.

    +

    The second value is a string containing the death message. If the victim is a player, this death message is broadcasted instead of the default death message. If it is empty, no death message is broadcasted. If it is nil, the message is left unchanged. If the victim is not a player, the death message is never broadcasted.

    +

    In either case, the victim is dead. + ]], + }, -- HOOK_KILLED +} diff --git a/Server/Plugins/APIDump/Hooks/OnKilling.lua b/Server/Plugins/APIDump/Hooks/OnKilling.lua new file mode 100644 index 000000000..6bfd75fb6 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnKilling.lua @@ -0,0 +1,30 @@ +return +{ + HOOK_KILLING = + { + CalledWhen = "A player or a mob is dying.", + DefaultFnName = "OnKilling", -- also used as pagename + Desc = [[ + This hook is called whenever a {{cPawn|pawn}}'s (a player's or a mob's) health reaches zero. This + means that the pawn is about to be killed, unless a plugin "revives" them by setting their health + back to a positive value. + ]], + Params = + { + { Name = "Victim", Type = "{{cPawn}}", Notes = "The player or mob that is about to be killed" }, + { Name = "Killer", Type = "{{cEntity}}", Notes = "The entity that has caused the victim to lose the last point of health. May be nil for environment damage" }, + { Name = "TDI", Type = "{{TakeDamageInfo}}", Notes = "The damage type, cause and effects." }, + }, + Returns = [[ + If the function returns false or no value, Cuberite calls other plugins with this event. If the + function returns true, no other plugin is called for this event.

    +

    + In either case, the victim's health is then re-checked and if it is greater than zero, the victim is + "revived" with that health amount. If the health is less or equal to zero, the victim is killed. + ]], + }, -- HOOK_KILLING +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnLogin.lua b/Server/Plugins/APIDump/Hooks/OnLogin.lua new file mode 100644 index 000000000..f71c3ade4 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnLogin.lua @@ -0,0 +1,31 @@ +return +{ + HOOK_LOGIN = + { + CalledWhen = "Right before player authentication. If auth is disabled, right after the player sends their name.", + DefaultFnName = "OnLogin", -- also used as pagename + Desc = [[ + This hook is called whenever a client logs in. It is called right before the client's name is sent + to be authenticated. Plugins may refuse the client from accessing the server. Note that when this + callback is called, the {{cPlayer}} object for this client doesn't exist yet - the client has no + representation in any world. To process new players when their world is known, use a later callback, + such as {{OnPlayerJoined|HOOK_PLAYER_JOINED}} or {{OnPlayerSpawned|HOOK_PLAYER_SPAWNED}}. + ]], + Params = + { + { Name = "Client", Type = "{{cClientHandle}}", Notes = "The client handle representing the connection" }, + { Name = "ProtocolVersion", Type = "number", Notes = "Versio of the protocol that the client is talking" }, + { Name = "UserName", Type = "string", Notes = "The name that the client has presented for authentication. This name will be given to the {{cPlayer}} object when it is created for this client." }, + }, + Returns = [[ + If the function returns true, no other plugins are called for this event and the client is kicked. + If the function returns false or no value, Cuberite calls other plugins' callbacks and finally + sends an authentication request for the client's username to the auth server. If the auth server + is disabled in the server settings, the player object is immediately created. + ]], + }, -- HOOK_LOGIN +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerAnimation.lua b/Server/Plugins/APIDump/Hooks/OnPlayerAnimation.lua new file mode 100644 index 000000000..baf99834e --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerAnimation.lua @@ -0,0 +1,28 @@ +return +{ + HOOK_PLAYER_ANIMATION = + { + CalledWhen = "A client has sent an Animation packet (0x12)", + DefaultFnName = "OnPlayerAnimation", -- also used as pagename + Desc = [[ + This hook is called when the server receives an Animation packet (0x12) from the client.

    +

    + For the list of animations that are sent by the client, see the + Protocol wiki. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player from whom the packet was received" }, + { Name = "Animation", Type = "number", Notes = "The kind of animation" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. Afterwards, the + server broadcasts the animation packet to all nearby clients. If the function returns true, no other + callback is called for this event and the packet is not broadcasted. + ]], + }, -- HOOK_PLAYER_ANIMATION +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerBreakingBlock.lua b/Server/Plugins/APIDump/Hooks/OnPlayerBreakingBlock.lua new file mode 100644 index 000000000..18f19f247 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerBreakingBlock.lua @@ -0,0 +1,36 @@ +return +{ + HOOK_PLAYER_BREAKING_BLOCK = + { + CalledWhen = "Just before a player breaks a block. Plugin may override / refuse. ", + DefaultFnName = "OnPlayerBreakingBlock", -- also used as pagename + Desc = [[ + This hook is called when a {{cPlayer|player}} breaks a block, before the block is actually broken in + the {{cWorld|World}}. Plugins may refuse the breaking.

    +

    + See also the {{OnPlayerBrokenBlock|HOOK_PLAYER_BROKEN_BLOCK}} hook for a similar hook called after + the block is broken. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who is digging the block" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" }, + { Name = "BlockFace", Type = "number", Notes = "Face of the block upon which the player is acting. One of the BLOCK_FACE_ constants" }, + { Name = "BlockType", Type = "BLOCKTYPE", Notes = "The block type of the block being broken" }, + { Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "The block meta of the block being broken " }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called, and then the block + is broken. If the function returns true, no other plugin's callback is called and the block breaking + is cancelled. The server re-sends the block back to the player to replace it (the player's client + already thinks the block was broken). + ]], + }, -- HOOK_PLAYER_BREAKING_BLOCK +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerBrokenBlock.lua b/Server/Plugins/APIDump/Hooks/OnPlayerBrokenBlock.lua new file mode 100644 index 000000000..e718c5d97 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerBrokenBlock.lua @@ -0,0 +1,36 @@ +return +{ + HOOK_PLAYER_BROKEN_BLOCK = + { + CalledWhen = "After a player has broken a block. Notification only.", + DefaultFnName = "OnPlayerBrokenBlock", -- also used as pagename + Desc = [[ + This function is called after a {{cPlayer|player}} breaks a block. The block is already removed + from the {{cWorld|world}} and {{cPickup|pickups}} have been spawned. To get the world in which the + block has been dug, use the {{cPlayer}}:GetWorld() function.

    +

    + See also the {{OnPlayerBreakingBlock|HOOK_PLAYER_BREAKING_BLOCK}} hook for a similar hook called + before the block is broken. To intercept the creation of pickups, see the + {{OnBlockToPickups|HOOK_BLOCK_TO_PICKUPS}} hook. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who broke the block" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" }, + { Name = "BlockFace", Type = "number", Notes = "Face of the block upon which the player interacted. One of the BLOCK_FACE_ constants" }, + { Name = "BlockType", Type = "BLOCKTYPE", Notes = "The block type of the block" }, + { Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "The block meta of the block" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event. + ]], + }, -- HOOK_PLAYER_BROKEN_BLOCK +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua b/Server/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua new file mode 100644 index 000000000..dc033197a --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerDestroyed.lua @@ -0,0 +1,27 @@ +return +{ + HOOK_PLAYER_DESTROYED = + { + CalledWhen = "A player object is about to be destroyed.", + DefaultFnName = "OnPlayerDestroyed", -- also used as pagename + Desc = [[ + This function is called before a {{cPlayer|player}} is about to be destroyed. + The player has disconnected for whatever reason and is no longer in the server. + If a plugin returns true, a leave message is not broadcast, and vice versa. + However, whatever the return value, the player object is removed from memory. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The destroyed player" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called and a leave message is broadcast. + If the function returns true, no other callbacks are called for this event and no leave message appears. Either way the player is removed internally. + ]], + }, -- HOOK_PLAYER_DESTROYED +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerEating.lua b/Server/Plugins/APIDump/Hooks/OnPlayerEating.lua new file mode 100644 index 000000000..e77d02a96 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerEating.lua @@ -0,0 +1,27 @@ +return +{ + HOOK_PLAYER_EATING = + { + CalledWhen = "When the player starts eating", + DefaultFnName = "OnPlayerEating", -- also used as pagename + Desc = [[ + This hook gets called when the {{cPlayer|player}} starts eating, after the server checks that the + player can indeed eat (is not satiated and is holding food). Plugins may still refuse the eating by + returning true. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who started eating" }, + }, + Returns = [[ + If the function returns false or no value, the server calls the next plugin handler, and finally + lets the player eat. If the function returns true, the server doesn't call any more callbacks for + this event and aborts the eating. A "disallow" packet is sent to the client. + ]], + }, -- HOOK_PLAYER_EATING +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerFished.lua b/Server/Plugins/APIDump/Hooks/OnPlayerFished.lua new file mode 100644 index 000000000..4e093f4ae --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerFished.lua @@ -0,0 +1,20 @@ +return +{ + HOOK_PLAYER_FISHED = + { + CalledWhen = "A player gets a reward from fishing.", + DefaultFnName = "OnPlayerFished", -- also used as pagename + Desc = [[ + This hook gets called after a player reels in the fishing rod. This is a notification-only hook, the reward has already been decided. If a plugin needs to modify the reward, use the {{OnPlayerFishing|HOOK_PLAYER_FISHING}} hook. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who pulled the fish in." }, + { Name = "Reward", Type = "{{cItems}}", Notes = "The reward the player gets. It can be a fish, treasure and junk." }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function returns true, no other + callback is called for this event. + ]], + }, -- HOOK_PLAYER_FISHED +}; diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerFishing.lua b/Server/Plugins/APIDump/Hooks/OnPlayerFishing.lua new file mode 100644 index 000000000..c5aaecd92 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerFishing.lua @@ -0,0 +1,21 @@ +return +{ + HOOK_PLAYER_FISHING = + { + CalledWhen = "A player is about to get a reward from fishing.", + DefaultFnName = "OnPlayerFishing", -- also used as pagename + Desc = [[ + This hook gets called when a player right clicks with a fishing rod while the floater is under water. The reward is already descided, but the plugin may change it. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who pulled the fish in." }, + { Name = "Reward", Type = "{{cItems}}", Notes = "The reward the player gets. It can be a fish, treasure and junk." }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. Afterwards, the + server gives the player his reward. If the function returns true, no other + callback is called for this event and the player doesn't get his reward. + ]], + }, -- HOOK_PLAYER_FISHING +}; diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua b/Server/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua new file mode 100644 index 000000000..53637d5f1 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua @@ -0,0 +1,27 @@ +return +{ + HOOK_PLAYER_FOOD_LEVEL_CHANGE = + { + CalledWhen = "Called before the player food level changed. Plugin may override", + DefaultFnName = "OnPlayerFoodLevelChange", -- also used as pagename + Desc = [[ + This hook is called before the food level changes. + The food level is not changed yet, plugins may choose + to refuse the change. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who changes the food level." }, + { Name = "NewFoodLevel", Type = "number", Notes = "The new food level." }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. Afterwards, the + server changes the food level of the player. If the function returns true, no + other callback is called for this event and the player's food level doesn't change. + ]], + }, -- HOOK_PLAYER_FOOD_LEVEL_CHANGE +}; + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerJoined.lua b/Server/Plugins/APIDump/Hooks/OnPlayerJoined.lua new file mode 100644 index 000000000..dcd16ed00 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerJoined.lua @@ -0,0 +1,29 @@ +return +{ + HOOK_PLAYER_JOINED = + { + CalledWhen = "After Login and before Spawned, before being added to world. ", + DefaultFnName = "OnPlayerJoined", -- also used as pagename + Desc = [[ + This hook is called whenever a {{cPlayer|player}} has completely logged in. If authentication is + enabled, this function is called after their name has been authenticated. It is called after + {{OnLogin|HOOK_LOGIN}} and before {{OnPlayerSpawned|HOOK_PLAYER_SPAWNED}}, right after the player's + entity is created, but not added to the world yet. The player is not yet visible to other players. + Returning true will block a join message from being broadcast, but otherwise, the player is still allowed to join. + Plugins wishing to refuse player's entry should kick the player using the {{cPlayer}}:Kick() function. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who has joined the game" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called and a join message is broadcast. If the function + returns true, no other callbacks are called for this event and a join message is not sent. Either way the player is let in. + ]], + }, -- HOOK_PLAYER_JOINED +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerLeftClick.lua b/Server/Plugins/APIDump/Hooks/OnPlayerLeftClick.lua new file mode 100644 index 000000000..3d4c07950 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerLeftClick.lua @@ -0,0 +1,47 @@ +return +{ + HOOK_PLAYER_LEFT_CLICK = + { + CalledWhen = "A left-click packet is received from the client. Plugin may override / refuse.", + DefaultFnName = "OnPlayerLeftClick", -- also used as pagename + Desc = [[ + This hook is called when Cuberite receives a left-click packet from the {{cClientHandle|client}}. It + is called before any processing whatsoever is performed on the packet, meaning that hacked / + malicious clients may be trigerring this event very often and with unchecked parameters. Therefore + plugin authors are advised to use extreme caution with this callback.

    +

    + Plugins may refuse the default processing for the packet, causing Cuberite to behave as if the + packet has never arrived. This may, however, create inconsistencies in the client - the client may + think that they broke a block, while the server didn't process the breaking, etc. For this reason, + if a plugin refuses the processing, Cuberite sends the block specified in the packet back to the + client (as if placed anew), if the status code specified a block-break action. For other actions, + plugins must rectify the situation on their own.

    +

    + The client sends the left-click packet for several other occasions, such as dropping the held item + (Q keypress) or shooting an arrow. This is reflected in the Status code. Consult the + protocol documentation for details on the actions. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player whose client sent the packet" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" }, + { Name = "BlockFace", Type = "number", Notes = "Face of the block upon which the player interacted. One of the BLOCK_FACE_ constants" }, + { Name = "Action", Type = "number", Notes = "Action to be performed on the block (\"status\" in the protocol docs)" }, + }, + Returns = [[ + If the function returns false or no value, Cuberite calls other plugins' callbacks and finally sends + the packet for further processing.

    +

    + If the function returns true, no other plugins are called, processing is halted. If the action was a + block dig, Cuberite sends the block specified in the coords back to the client. The packet is + dropped. + ]], + }, -- HOOK_PLAYER_LEFT_CLICK +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerMoving.lua b/Server/Plugins/APIDump/Hooks/OnPlayerMoving.lua new file mode 100644 index 000000000..4385bf94d --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerMoving.lua @@ -0,0 +1,29 @@ +return +{ + HOOK_PLAYER_MOVING = + { + CalledWhen = "Player tried to move in the tick being currently processed. Plugin may refuse movement.", + DefaultFnName = "OnPlayerMoving", -- also used as pagename + Desc = [[ + This function is called in each server tick for each {{cPlayer|player}} that has sent any of the + player-move packets. Plugins may refuse the movement. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who has moved. The object already has the new position stored in it." }, + { Name = "OldPosition", Type = "{{Vector3d}}", Notes = "The old position." }, + { Name = "NewPosition", Type = "{{Vector3d}}", Notes = "The new position." }, + }, + Returns = [[ + If the function returns true, movement is prohibited.

    +

    + If the function returns false or no value, other plugins' callbacks are called and finally the new + position is permanently stored in the cPlayer object.

    + ]], + }, -- HOOK_PLAYER_MOVING +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerPlacedBlock.lua b/Server/Plugins/APIDump/Hooks/OnPlayerPlacedBlock.lua new file mode 100644 index 000000000..74d4c19e3 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerPlacedBlock.lua @@ -0,0 +1,40 @@ +return +{ + HOOK_PLAYER_PLACED_BLOCK = + { + CalledWhen = "After a player has placed a block. Notification only.", + DefaultFnName = "OnPlayerPlacedBlock", -- also used as pagename + Desc = [[ + This hook is called after a {{cPlayer|player}} has placed a block in the {{cWorld|world}}. The block + is already added to the world and the corresponding item removed from player's + {{cInventory|inventory}}.

    +

    + Use the {{cPlayer}}:GetWorld() function to get the world to which the block belongs.

    +

    + See also the {{OnPlayerPlacingBlock|HOOK_PLAYER_PLACING_BLOCK}} hook for a similar hook called + before the placement.

    +

    + If the client action results in multiple blocks being placed (such as a bed or a door), each separate + block is reported through this hook. All the blocks are already present in the world before the first + instance of this hook is called. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who placed the block" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" }, + { Name = "BlockType", Type = "BLOCKTYPE", Notes = "The block type of the block" }, + { Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "The block meta of the block" }, + }, + Returns = [[ + If this function returns false or no value, Cuberite calls other plugins with the same event. If + this function returns true, no other plugin is called for this event. + ]], + }, -- HOOK_PLAYER_PLACED_BLOCK +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerPlacingBlock.lua b/Server/Plugins/APIDump/Hooks/OnPlayerPlacingBlock.lua new file mode 100644 index 000000000..b78acc327 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerPlacingBlock.lua @@ -0,0 +1,45 @@ +return +{ + HOOK_PLAYER_PLACING_BLOCK = + { + CalledWhen = "Just before a player places a block. Plugin may override / refuse.", + DefaultFnName = "OnPlayerPlacingBlock", -- also used as pagename + Desc = [[ + This hook is called just before a {{cPlayer|player}} places a block in the {{cWorld|world}}. The + block is not yet placed, plugins may choose to override the default behavior or refuse the placement + at all.

    +

    + Note that the client already expects that the block has been placed. For that reason, if a plugin + refuses the placement, Cuberite sends the old block at the provided coords to the client.

    +

    + Use the {{cPlayer}}:GetWorld() function to get the world to which the block belongs.

    +

    + See also the {{OnPlayerPlacedBlock|HOOK_PLAYER_PLACED_BLOCK}} hook for a similar hook called after + the placement.

    +

    + If the client action results in multiple blocks being placed (such as a bed or a door), each separate + block is reported through this hook and only if all of them succeed, all the blocks are placed. If + any one of the calls are refused by the plugin, all the blocks are refused and reverted on the client. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who is placing the block" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" }, + { Name = "BlockType", Type = "BLOCKTYPE", Notes = "The block type of the block" }, + { Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "The block meta of the block" }, + }, + Returns = [[ + If this function returns false or no value, Cuberite calls other plugins with the same event and + finally places the block and removes the corresponding item from player's inventory. If this + function returns true, no other plugin is called for this event, Cuberite sends the old block at + the specified coords to the client and drops the packet. + ]], + }, -- HOOK_PLAYER_PLACING_BLOCK +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerRightClick.lua b/Server/Plugins/APIDump/Hooks/OnPlayerRightClick.lua new file mode 100644 index 000000000..e1b95197d --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerRightClick.lua @@ -0,0 +1,40 @@ +return +{ + HOOK_PLAYER_RIGHT_CLICK = + { + CalledWhen = "A right-click packet is received from the client. Plugin may override / refuse.", + DefaultFnName = "OnPlayerRightClick", -- also used as pagename + Desc = [[ + This hook is called when Cuberite receives a right-click packet from the {{cClientHandle|client}}. It + is called before any processing whatsoever is performed on the packet, meaning that hacked / + malicious clients may be trigerring this event very often and with unchecked parameters. Therefore + plugin authors are advised to use extreme caution with this callback.

    +

    + Plugins may refuse the default processing for the packet, causing Cuberite to behave as if the + packet has never arrived. This may, however, create inconsistencies in the client - the client may + think that they placed a block, while the server didn't process the placing, etc. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player whose client sent the packet" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" }, + { Name = "BlockFace", Type = "number", Notes = "Face of the block upon which the player interacted. One of the BLOCK_FACE_ constants" }, + { Name = "CursorX", Type = "number", Notes = "X-coord of the mouse crosshair on the block" }, + { Name = "CursorY", Type = "number", Notes = "Y-coord of the mouse crosshair on the block" }, + { Name = "CursorZ", Type = "number", Notes = "Z-coord of the mouse crosshair on the block" }, + }, + Returns = [[ + If the function returns false or no value, Cuberite calls other plugins' callbacks and finally sends + the packet for further processing.

    +

    + If the function returns true, no other plugins are called, processing is halted. + ]], + }, -- HOOK_PLAYER_RIGHT_CLICK +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerRightClickingEntity.lua b/Server/Plugins/APIDump/Hooks/OnPlayerRightClickingEntity.lua new file mode 100644 index 000000000..b271cf058 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerRightClickingEntity.lua @@ -0,0 +1,27 @@ +return +{ + HOOK_PLAYER_RIGHT_CLICKING_ENTITY = + { + CalledWhen = "A player has right-clicked an entity. Plugins may override / refuse.", + DefaultFnName = "OnPlayerRightClickingEntity", -- also used as pagename + Desc = [[ + This hook is called when the {{cPlayer|player}} right-clicks an {{cEntity|entity}}. Plugins may + override the default behavior or even cancel the default processing. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who has right-clicked the entity" }, + { Name = "Entity", Type = "{{cEntity}} descendant", Notes = "The entity that has been right-clicked" }, + }, + Returns = [[ + If the functino returns false or no value, Cuberite calls other plugins' callbacks and finally does + the default processing for the right-click. If the function returns true, no other callbacks are + called and the default processing is skipped. + ]], + }, -- HOOK_PLAYER_RIGHT_CLICKING_ENTITY +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerShooting.lua b/Server/Plugins/APIDump/Hooks/OnPlayerShooting.lua new file mode 100644 index 000000000..7315ede7a --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerShooting.lua @@ -0,0 +1,32 @@ +return +{ + HOOK_PLAYER_SHOOTING = + { + CalledWhen = "When the player releases the bow, shooting an arrow (other projectiles: unknown)", + DefaultFnName = "OnPlayerShooting", -- also used as pagename + Desc = [[ + This hook is called when the {{cPlayer|player}} shoots their bow. It is called for the actual + release of the {{cArrowEntity|arrow}}. FIXME: It is currently unknown whether other + {{cProjectileEntity|projectiles}} (snowballs, eggs) trigger this hook.

    +

    + To get the player's position and direction, use the {{cPlayer}}:GetEyePosition() and + cPlayer:GetLookVector() functions. Note that for shooting a bow, the position for the arrow creation + is not at the eye pos, some adjustments are required. FIXME: Export the {{cPlayer}} function for + this adjustment. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player shooting" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called, and finally + Cuberite creates the projectile. If the functino returns true, no other callback is called and no + projectile is created. + ]], + }, -- HOOK_PLAYER_SHOOTING +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerSpawned.lua b/Server/Plugins/APIDump/Hooks/OnPlayerSpawned.lua new file mode 100644 index 000000000..190909ee5 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerSpawned.lua @@ -0,0 +1,32 @@ +return +{ + HOOK_PLAYER_SPAWNED = + { + CalledWhen = "After a player (re)spawns in the world to which they belong to.", + DefaultFnName = "OnPlayerSpawned", -- also used as pagename + Desc = [[ + This hook is called after a {{cPlayer|player}} has spawned in the world. It is called after + {{OnLogin|HOOK_LOGIN}} and {{OnPlayerJoined|HOOK_PLAYER_JOINED}}, after the player name has been + authenticated, the initial worldtime, inventory and health have been sent to the player and the + player spawn packet has been broadcast to all players near enough to the player spawn place. This is + a notification-only event, plugins wishing to refuse player's entry should kick the player using the + {{cPlayer}}:Kick() function.

    +

    + This hook is also called when the player respawns after death (and a respawn packet is received from + the client, meaning the player has already clicked the Respawn button). + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who has (re)spawned" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called. If the function + returns true, no other callbacks are called for this event. There is no overridable behavior. + ]], + }, -- HOOK_PLAYER_SPAWNED +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua b/Server/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua new file mode 100644 index 000000000..880404bf8 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerTossingItem.lua @@ -0,0 +1,31 @@ +return +{ + HOOK_PLAYER_TOSSING_ITEM = + { + CalledWhen = "A player is tossing an item. Plugin may override / refuse.", + DefaultFnName = "OnPlayerTossingItem", -- also used as pagename + Desc = [[ + This hook is called when a {{cPlayer|player}} has tossed an item. The + {{cPickup|pickup}} has not been spawned yet. Plugins may disallow the tossing, but in that case they + need to clean up - the player's client already thinks the item has been tossed so the + {{cInventory|inventory}} needs to be re-sent to the player.

    +

    + To get the item that is about to be tossed, call the {{cPlayer}}:GetEquippedItem() function. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player tossing an item" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called and finally Cuberite + creates the pickup for the item and tosses it, using {{cPlayer}}:TossHeldItem, {{cPlayer}}:TossEquippedItem, + or {{cPlayer}}:TossPickup. If the function returns true, no other callbacks are called for this event + and Cuberite doesn't toss the item. + ]], + }, -- HOOK_PLAYER_TOSSING_ITEM +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerUsedBlock.lua b/Server/Plugins/APIDump/Hooks/OnPlayerUsedBlock.lua new file mode 100644 index 000000000..babd70fcc --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerUsedBlock.lua @@ -0,0 +1,46 @@ +return +{ + HOOK_PLAYER_USED_BLOCK = + { + CalledWhen = "A player has just used a block (chest, furnace...). Notification only.", + DefaultFnName = "OnPlayerUsedBlock", -- also used as pagename + Desc = [[ + This hook is called after a {{cPlayer|player}} has right-clicked a block that can be used, such as a + {{cChestEntity|chest}} or a lever. It is called after Cuberite processes the usage (sends the UI + handling packets / toggles redstone). Note that for UI-related blocks, the player is most likely + still using the UI. This is a notification-only event.

    +

    + Note that the block coords given in this callback are for the (solid) block that is being clicked, + not the air block between it and the player.

    +

    + To get the world at which the right-click occurred, use the {{cPlayer}}:GetWorld() function.

    +

    + See also the {{OnPlayerUsingBlock|HOOK_PLAYER_USING_BLOCK}} for a similar hook called before the + use, the {{OnPlayerUsingItem|HOOK_PLAYER_USING_ITEM}} and {{OnPlayerUsedItem|HOOK_PLAYER_USED_ITEM}} + for similar hooks called when a player interacts with any block with a usable item in hand, such as + a bucket. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who used the block" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the clicked block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the clicked block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the clicked block" }, + { Name = "BlockFace", Type = "number", Notes = "Face of clicked block which has been clicked. One of the BLOCK_FACE_ constants" }, + { Name = "CursorX", Type = "number", Notes = "X-coord of the cursor crosshair on the block being clicked" }, + { Name = "CursorY", Type = "number", Notes = "Y-coord of the cursor crosshair on the block being clicked" }, + { Name = "CursorZ", Type = "number", Notes = "Z-coord of the cursor crosshair on the block being clicked" }, + { Name = "BlockType", Type = "number", Notes = "Block type of the clicked block" }, + { Name = "BlockMeta", Type = "number", Notes = "Block meta of the clicked block" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called. If the function + returns true, no other callbacks are called for this event. + ]], + }, -- HOOK_PLAYER_USED_BLOCK +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerUsedItem.lua b/Server/Plugins/APIDump/Hooks/OnPlayerUsedItem.lua new file mode 100644 index 000000000..6089928e2 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerUsedItem.lua @@ -0,0 +1,46 @@ +return +{ + HOOK_PLAYER_USED_ITEM = + { + CalledWhen = "A player has used an item in hand (bucket...)", + DefaultFnName = "OnPlayerUsedItem", -- also used as pagename + Desc = [[ + This hook is called after a {{cPlayer|player}} has right-clicked a block with an {{cItem|item}} that + can be used (is not placeable, is not food and clicked block is not use-able), such as a bucket or a + hoe. It is called after Cuberite processes the usage (places fluid / turns dirt to farmland). + This is an information-only hook, there is no way to cancel the event anymore.

    +

    + Note that the block coords given in this callback are for the (solid) block that is being clicked, + not the air block between it and the player.

    +

    + To get the world at which the right-click occurred, use the {{cPlayer}}:GetWorld() function. To get + the item that the player is using, use the {{cPlayer}}:GetEquippedItem() function.

    +

    + See also the {{OnPlayerUsingItem|HOOK_PLAYER_USING_ITEM}} for a similar hook called before the use, + the {{OnPlayerUsingBlock|HOOK_PLAYER_USING_BLOCK}} and {{OnPlayerUsedBlock|HOOK_PLAYER_USED_BLOCK}} + for similar hooks called when a player interacts with a block, such as a chest. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who used the item" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the clicked block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the clicked block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the clicked block" }, + { Name = "BlockFace", Type = "number", Notes = "Face of clicked block which has been clicked. One of the BLOCK_FACE_ constants" }, + { Name = "CursorX", Type = "number", Notes = "X-coord of the cursor crosshair on the block being clicked" }, + { Name = "CursorY", Type = "number", Notes = "Y-coord of the cursor crosshair on the block being clicked" }, + { Name = "CursorZ", Type = "number", Notes = "Z-coord of the cursor crosshair on the block being clicked" }, + { Name = "BlockType", Type = "number", Notes = "Block type of the clicked block" }, + { Name = "BlockMeta", Type = "number", Notes = "Block meta of the clicked block" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called. If the function + returns true, no other callbacks are called for this event. + ]], + }, -- HOOK_PLAYER_USED_ITEM +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerUsingBlock.lua b/Server/Plugins/APIDump/Hooks/OnPlayerUsingBlock.lua new file mode 100644 index 000000000..b4ecb5ca1 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerUsingBlock.lua @@ -0,0 +1,46 @@ +return +{ + HOOK_PLAYER_USING_BLOCK = + { + CalledWhen = "Just before a player uses a block (chest, furnace...). Plugin may override / refuse.", + DefaultFnName = "OnPlayerUsingBlock", -- also used as pagename + Desc = [[ + This hook is called when a {{cPlayer|player}} has right-clicked a block that can be used, such as a + {{cChestEntity|chest}} or a lever. It is called before Cuberite processes the usage (sends the UI + handling packets / toggles redstone). Plugins may refuse the interaction by returning true.

    +

    + Note that the block coords given in this callback are for the (solid) block that is being clicked, + not the air block between it and the player.

    +

    + To get the world at which the right-click occurred, use the {{cPlayer}}:GetWorld() function.

    +

    + See also the {{OnPlayerUsedBlock|HOOK_PLAYER_USED_BLOCK}} for a similar hook called after the use, the + {{OnPlayerUsingItem|HOOK_PLAYER_USING_ITEM}} and {{OnPlayerUsedItem|HOOK_PLAYER_USED_ITEM}} for + similar hooks called when a player interacts with any block with a usable item in hand, such as a + bucket. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who is using the block" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the clicked block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the clicked block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the clicked block" }, + { Name = "BlockFace", Type = "number", Notes = "Face of clicked block which has been clicked. One of the BLOCK_FACE_ constants" }, + { Name = "CursorX", Type = "number", Notes = "X-coord of the cursor crosshair on the block being clicked" }, + { Name = "CursorY", Type = "number", Notes = "Y-coord of the cursor crosshair on the block being clicked" }, + { Name = "CursorZ", Type = "number", Notes = "Z-coord of the cursor crosshair on the block being clicked" }, + { Name = "BlockType", Type = "number", Notes = "Block type of the clicked block" }, + { Name = "BlockMeta", Type = "number", Notes = "Block meta of the clicked block" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called and then Cuberite + processes the interaction. If the function returns true, no other callbacks are called for this + event and the interaction is silently dropped. + ]], + }, -- HOOK_PLAYER_USING_BLOCK +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPlayerUsingItem.lua b/Server/Plugins/APIDump/Hooks/OnPlayerUsingItem.lua new file mode 100644 index 000000000..9b2949f93 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPlayerUsingItem.lua @@ -0,0 +1,47 @@ +return +{ + HOOK_PLAYER_USING_ITEM = + { + CalledWhen = "Just before a player uses an item in hand (bucket...). Plugin may override / refuse.", + DefaultFnName = "OnPlayerUsingItem", -- also used as pagename + Desc = [[ + This hook is called when a {{cPlayer|player}} has right-clicked a block with an {{cItem|item}} that + can be used (is not placeable, is not food and clicked block is not use-able), such as a bucket or a + hoe. It is called before Cuberite processes the usage (places fluid / turns dirt to farmland). + Plugins may refuse the interaction by returning true.

    +

    + Note that the block coords given in this callback are for the (solid) block that is being clicked, + not the air block between it and the player.

    +

    + To get the world at which the right-click occurred, use the {{cPlayer}}:GetWorld() function. To get + the item that the player is using, use the {{cPlayer}}:GetEquippedItem() function.

    +

    + See also the {{OnPlayerUsedItem|HOOK_PLAYER_USED_ITEM}} for a similar hook called after the use, the + {{OnPlayerUsingBlock|HOOK_PLAYER_USING_BLOCK}} and {{OnPlayerUsedBlock|HOOK_PLAYER_USED_BLOCK}} for + similar hooks called when a player interacts with a block, such as a chest. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who is using the item" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the clicked block" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the clicked block" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the clicked block" }, + { Name = "BlockFace", Type = "number", Notes = "Face of clicked block which has been clicked. One of the BLOCK_FACE_ constants" }, + { Name = "CursorX", Type = "number", Notes = "X-coord of the cursor crosshair on the block being clicked" }, + { Name = "CursorY", Type = "number", Notes = "Y-coord of the cursor crosshair on the block being clicked" }, + { Name = "CursorZ", Type = "number", Notes = "Z-coord of the cursor crosshair on the block being clicked" }, + { Name = "BlockType", Type = "number", Notes = "Block type of the clicked block" }, + { Name = "BlockMeta", Type = "number", Notes = "Block meta of the clicked block" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called and then Cuberite + processes the interaction. If the function returns true, no other callbacks are called for this + event and the interaction is silently dropped. + ]], + }, -- HOOK_PLAYER_USING_ITEM +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPluginMessage.lua b/Server/Plugins/APIDump/Hooks/OnPluginMessage.lua new file mode 100644 index 000000000..743d3bb5e --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPluginMessage.lua @@ -0,0 +1,25 @@ +return +{ + HOOK_PLUGIN_MESSAGE = + { + CalledWhen = "The server receives a plugin message from a client", + DefaultFnName = "OnPluginMessage", -- also used as pagename + Desc = [[ + A plugin may implement an OnPluginMessage() function and register it as a Hook to process plugin messages + from the players. The function is then called for every plugin message sent from any player. + ]], + Params = { + { Name = "Client", Type = "{{cClientHandle}}", Notes = "The client who sent the plugin message" }, + { Name = "Channel", Type = "string", Notes = "The channel on which the message was sent" }, + { Name = "Message", Type = "string", Notes = "The message's payload" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called. If the function + returns true, no other callbacks are called for this event. + ]], + }, -- HOOK_CHAT +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPluginsLoaded.lua b/Server/Plugins/APIDump/Hooks/OnPluginsLoaded.lua new file mode 100644 index 000000000..2c8a5a2c9 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPluginsLoaded.lua @@ -0,0 +1,84 @@ +return +{ + HOOK_PLUGINS_LOADED = + { + CalledWhen = "All the enabled plugins have been loaded", + DefaultFnName = "OnPluginsLoaded", -- also used as pagename + Desc = [[ + This callback gets called when the server finishes loading and initializing plugins. This is the + perfect occasion for a plugin to query other plugins through {{cPluginManager}}:GetPlugin() and + possibly start communicating with them using the {{cPlugin}}:Call() function. + ]], + Params = {}, + Returns = [[ + The return value is ignored, all registered callbacks are called. + ]], + CodeExamples = + { + { + Title = "CoreMessaging", + Desc = [[ + This example shows how to implement the CoreMessaging functionality - messages to players will be + sent through the Core plugin, formatted by that plugin. As a fallback for when the Core plugin is + not present, the messages are sent directly by this code, unformatted. + ]], + Code = [[ +-- These are the fallback functions used when the Core is not present: +local function SendMessageFallback(a_Player, a_Message) + a_Player:SendMessage(a_Message); +end + +local function SendMessageSuccessFallback(a_Player, a_Message) + a_Player:SendMessage(a_Message); +end + +local function SendMessageFailureFallback(a_Player, a_Message) + a_Player:SendMessage(a_Message); +end + +-- These three "variables" will hold the actual functions to call. +-- By default they are initialized to the Fallback variants, +-- but will be redirected to Core when all plugins load +SendMessage = SendMessageFallback; +SendMessageSuccess = SendMessageSuccessFallback; +SendMessageFailure = SendMessageFailureFallback; + +-- The callback tries to connect to the Core +-- If successful, overwrites the three functions with Core ones +local function OnPluginsLoaded() + local CorePlugin = cPluginManager:Get():GetPlugin("Core"); + if (CorePlugin == nil) then + -- The Core is not loaded, keep the Fallback functions + return; + end + + -- Overwrite the three functions with Core functionality: + SendMessage = function(a_Player, a_Message) + CorePlugin:Call("SendMessage", a_Player, a_Message); + end + SendMessageSuccess = function(a_Player, a_Message) + CorePlugin:Call("SendMessageSuccess", a_Player, a_Message); + end + SendMessageFailure = function(a_Player, a_Message) + CorePlugin:Call("SendMessageFailure", a_Player, a_Message); + end +end + +-- Global scope, register the callback: +cPluginManager.AddHook(cPluginManager.HOOK_PLUGINS_LOADED, CoreMessagingPluginsLoaded); + + +-- Usage, anywhere else in the plugin: +SendMessageFailure( + a_Player, + "Cannot teleport to player, the destination player " .. PlayerName .. " was not found" +); + ]], + }, + } , -- CodeExamples + }, -- HOOK_PLUGINS_LOADED +} + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPostCrafting.lua b/Server/Plugins/APIDump/Hooks/OnPostCrafting.lua new file mode 100644 index 000000000..0dc9d4c73 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPostCrafting.lua @@ -0,0 +1,36 @@ +return +{ + HOOK_POST_CRAFTING = + { + CalledWhen = "After the built-in recipes are checked and a recipe was found.", + DefaultFnName = "OnPostCrafting", -- also used as pagename + Desc = [[ + This hook is called when a {{cPlayer|player}} changes contents of their + {{cCraftingGrid|crafting grid}}, after the recipe has been established by Cuberite. Plugins may use + this to modify the resulting recipe or provide an alternate recipe.

    +

    + If a plugin implements custom recipes, it should do so using the {{OnPreCrafting|HOOK_PRE_CRAFTING}} + hook, because that will save the server from going through the built-in recipes. The + HOOK_POST_CRAFTING hook is intended as a notification, with a chance to tweak the result.

    +

    + Note that this hook is not called if a built-in recipe is not found; + {{OnCraftingNoRecipe|HOOK_CRAFTING_NO_RECIPE}} is called instead in such a case. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who has changed their crafting grid contents" }, + { Name = "Grid", Type = "{{cCraftingGrid}}", Notes = "The new crafting grid contents" }, + { Name = "Recipe", Type = "{{cCraftingRecipe}}", Notes = "The recipe that Cuberite has decided to use (can be tweaked by plugins)" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called. If the function + returns true, no other callbacks are called for this event. In either case, Cuberite uses the value + of Recipe as the recipe to be presented to the player. + ]], + }, -- HOOK_POST_CRAFTING +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnPreCrafting.lua b/Server/Plugins/APIDump/Hooks/OnPreCrafting.lua new file mode 100644 index 000000000..8f24fc881 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnPreCrafting.lua @@ -0,0 +1,37 @@ +return +{ + HOOK_PRE_CRAFTING = + { + CalledWhen = "Before the built-in recipes are checked.", + DefaultFnName = "OnPreCrafting", -- also used as pagename + Desc = [[ + This hook is called when a {{cPlayer|player}} changes contents of their + {{cCraftingGrid|crafting grid}}, before the built-in recipes are searched for a match by Cuberite. + Plugins may use this hook to provide a custom recipe.

    +

    + If you intend to tweak built-in recipes, use the {{OnPostCrafting|HOOK_POST_CRAFTING}} hook, because + that will be called once the built-in recipe is matched.

    +

    + Also note a third hook, {{OnCraftingNoRecipe|HOOK_CRAFTING_NO_RECIPE}}, that is called when Cuberite + cannot find any built-in recipe for the given ingredients. + ]], + Params = + { + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who has changed their crafting grid contents" }, + { Name = "Grid", Type = "{{cCraftingGrid}}", Notes = "The new crafting grid contents" }, + { Name = "Recipe", Type = "{{cCraftingRecipe}}", Notes = "The recipe that Cuberite will use. Modify this object to change the recipe" }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called and then Cuberite + searches the built-in recipes. The Recipe output parameter is ignored in this case.

    +

    + If the function returns true, no other callbacks are called for this event and Cuberite uses the + recipe stored in the Recipe output parameter. + ]], + }, -- HOOK_PRE_CRAFTING +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua b/Server/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua new file mode 100644 index 000000000..72cf85821 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua @@ -0,0 +1,29 @@ +return +{ + HOOK_PROJECTILE_HIT_BLOCK = + { + CalledWhen = "A projectile hits a solid block.", + DefaultFnName = "OnProjectileHitBlock", -- also used as pagename + Desc = [[ + This hook is called when a {{cProjectileEntity|projectile}} hits a solid block.. + ]], + Params = + { + { Name = "ProjectileEntity", Type = "{{cProjectileEntity}}", Notes = "The projectile that hit an entity." }, + { Name = "BlockX", Type = "number", Notes = "The X-coord where the projectile hit." }, + { Name = "BlockY", Type = "number", Notes = "The Y-coord where the projectile hit." }, + { Name = "BlockZ", Type = "number", Notes = "The Z-coord where the projectile hit." }, + { Name = "BlockFace", Type = "number", Notes = "The side of the block where the projectile hit." }, + { Name = "BlockHitPos", Type = "Vector3d", Notes = "The exact position where the projectile hit." }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event and the projectile flies through block.. + ]], + }, -- HOOK_PROJECTILE_HIT_BLOCK +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnProjectileHitEntity.lua b/Server/Plugins/APIDump/Hooks/OnProjectileHitEntity.lua new file mode 100644 index 000000000..dd949fb46 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnProjectileHitEntity.lua @@ -0,0 +1,25 @@ +return +{ + HOOK_PROJECTILE_HIT_ENTITY = + { + CalledWhen = "A projectile hits another entity.", + DefaultFnName = "OnProjectileHitEntity", -- also used as pagename + Desc = [[ + This hook is called when a {{cProjectileEntity|projectile}} hits another entity. + ]], + Params = + { + { Name = "ProjectileEntity", Type = "{{cProjectileEntity}}", Notes = "The projectile that hit an entity." }, + { Name = "Entity", Type = "{{cEntity}}", Notes = "The entity wich was hit." }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event and the projectile flies through the entity. + ]], + }, -- HOOK_PROJECTILE_HIT_ENTITY +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnServerPing.lua b/Server/Plugins/APIDump/Hooks/OnServerPing.lua new file mode 100644 index 000000000..430465786 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnServerPing.lua @@ -0,0 +1,53 @@ +return +{ + HOOK_SERVER_PING = + { + CalledWhen = "Client pings the server from the server list.", + DefaultFnName = "OnServerPing", -- also used as pagename + Desc = [[ + A plugin may implement an OnServerPing() function and register it as a Hook to process pings from + clients in the server server list. It can change the logged in players and player capacity, as well + as the server description and the favicon, that are displayed to the client in the server list.

    +

    + The client handle already has its protocol version assigned to it, so the plugin can check that; however, + there's no username associated with the client yet, and no player object. + ]], + Params = { + { Name = "ClientHandle", Type = "{{cClientHandle}}", Notes = "The client handle that pinged the server" }, + { Name = "ServerDescription", Type = "string", Notes = "The server description" }, + { Name = "OnlinePlayersCount", Type = "number", Notes = "The number of players currently on the server" }, + { Name = "MaxPlayersCount", Type = "number", Notes = "The current player cap for the server" }, + { Name = "Favicon", Type = "string", Notes = "The base64 encoded favicon to be displayed in the server list for compatible clients" }, + }, + Returns = [[ + The plugin can return whether to continue processing of the hook with other plugins, the server description to + be displayed to the client, the currently online players, the player cap and the base64/png favicon data, in that order. + ]], + CodeExamples = { + { + Title = "Change information returned to the player", + Desc = "Tells the client that the server description is 'test', there are one more players online than there actually are, and that the player cap is zero. It also changes the favicon data.", + Code = [[ +function OnServerPing(ClientHandle, ServerDescription, OnlinePlayers, MaxPlayers, Favicon) + -- Change Server Description + ServerDescription = "Test" + + -- Change online / max players + OnlinePlayers = OnlinePlayers + 1 + MaxPlayers = 0 + + -- Change favicon + if cFile:IsFile("my-favicon.png") then + local FaviconData = cFile:ReadWholeFile("my-favicon.png") + if (FaviconData ~= "") and (FaviconData ~= nil) then + Favicon = Base64Encode(FaviconData) + end + end + + return false, ServerDescription, OnlinePlayers, MaxPlayers, Favicon +end + ]], + }, + }, + }, -- HOOK_SERVER_PING +} diff --git a/Server/Plugins/APIDump/Hooks/OnSpawnedEntity.lua b/Server/Plugins/APIDump/Hooks/OnSpawnedEntity.lua new file mode 100644 index 000000000..037a90f1c --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnSpawnedEntity.lua @@ -0,0 +1,31 @@ +return +{ + HOOK_SPAWNED_ENTITY = + { + CalledWhen = "After an entity is spawned in the world.", + DefaultFnName = "OnSpawnedEntity", -- also used as pagename + Desc = [[ + This hook is called after the server spawns an {{cEntity|entity}}. This is an information-only + callback, the entity is already spawned by the time it is called. If the entity spawned is a + {{cMonster|monster}}, the {{OnSpawnedMonster|HOOK_SPAWNED_MONSTER}} hook is called before this + hook.

    +

    + See also the {{OnSpawningEntity|HOOK_SPAWNING_ENTITY}} hook for a similar hook called before the + entity is spawned. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the entity has spawned" }, + { Name = "Entity", Type = "{{cEntity}} descentant", Notes = "The entity that has spawned" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event. + ]], + }, -- HOOK_SPAWNED_ENTITY +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnSpawnedMonster.lua b/Server/Plugins/APIDump/Hooks/OnSpawnedMonster.lua new file mode 100644 index 000000000..c319a77ea --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnSpawnedMonster.lua @@ -0,0 +1,30 @@ +return +{ + HOOK_SPAWNED_MONSTER = + { + CalledWhen = "After a monster is spawned in the world", + DefaultFnName = "OnSpawnedMonster", -- also used as pagename + Desc = [[ + This hook is called after the server spawns a {{cMonster|monster}}. This is an information-only + callback, the monster is already spawned by the time it is called. After this hook is called, the + {{OnSpawnedEntity|HOOK_SPAWNED_ENTITY}} is called for the monster entity.

    +

    + See also the {{OnSpawningMonster|HOOK_SPAWNING_MONSTER}} hook for a similar hook called before the + monster is spawned. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the monster has spawned" }, + { Name = "Monster", Type = "{{cMonster}} descendant", Notes = "The monster that has spawned" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event. + ]], + }, -- HOOK_SPAWNED_MONSTER +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnSpawningEntity.lua b/Server/Plugins/APIDump/Hooks/OnSpawningEntity.lua new file mode 100644 index 000000000..e2bd1c940 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnSpawningEntity.lua @@ -0,0 +1,33 @@ +return +{ + HOOK_SPAWNING_ENTITY = + { + CalledWhen = "Before an entity is spawned in the world.", + DefaultFnName = "OnSpawningEntity", -- also used as pagename + Desc = [[ + This hook is called before the server spawns an {{cEntity|entity}}. The plugin can either modify the + entity before it is spawned, or disable the spawning altogether. You can't disable the spawning if the + entity is a player. If the entity spawning is a monster, the {{OnSpawningMonster|HOOK_SPAWNING_MONSTER}} + hook is called before this hook.

    +

    + See also the {{OnSpawnedEntity|HOOK_SPAWNED_ENTITY}} hook for a similar hook called after the + entity is spawned. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the entity will spawn" }, + { Name = "Entity", Type = "{{cEntity}} descentant", Notes = "The entity that will spawn" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. Finally, the server + spawns the entity with whatever parameters have been set on the {{cEntity}} object by the callbacks. + If the function returns true, no other callback is called for this event and the entity is not + spawned. + ]], + }, -- HOOK_SPAWNING_ENTITY +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnSpawningMonster.lua b/Server/Plugins/APIDump/Hooks/OnSpawningMonster.lua new file mode 100644 index 000000000..4c0519e27 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnSpawningMonster.lua @@ -0,0 +1,33 @@ +return +{ + HOOK_SPAWNING_MONSTER = + { + CalledWhen = "Before a monster is spawned in the world.", + DefaultFnName = "OnSpawningMonster", -- also used as pagename + Desc = [[ + This hook is called before the server spawns a {{cMonster|monster}}. The plugins may modify the + monster's parameters in the {{cMonster}} class, or disallow the spawning altogether. This hook is + called before the {{OnSpawningEntity|HOOK_SPAWNING_ENTITY}} is called for the monster entity.

    +

    + See also the {{OnSpawnedMonster|HOOK_SPAWNED_MONSTER}} hook for a similar hook called after the + monster is spawned. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the entity will spawn" }, + { Name = "Monster", Type = "{{cMonster}} descentant", Notes = "The monster that will spawn" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. Finally, the server + spawns the monster with whatever parameters the plugins set in the cMonster parameter.

    +

    + If the function returns true, no other callback is called for this event and the monster won't + spawn. + ]], + }, -- HOOK_SPAWNING_MONSTER +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnTakeDamage.lua b/Server/Plugins/APIDump/Hooks/OnTakeDamage.lua new file mode 100644 index 000000000..608126f2b --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnTakeDamage.lua @@ -0,0 +1,31 @@ +return +{ + HOOK_TAKE_DAMAGE = + { + CalledWhen = "An {{cEntity|entity}} is taking any kind of damage", + DefaultFnName = "OnTakeDamage", -- also used as pagename + Desc = [[ + This hook is called when any {{cEntity}} descendant, such as a {{cPlayer|player}} or a + {{cMonster|mob}}, takes any kind of damage. The plugins may modify the amount of damage or effects + with this hook by editting the {{TakeDamageInfo}} object passed.

    +

    + This hook is called after the final damage is calculated, including all the possible weapon + {{cEnchantments|enchantments}}, armor protection and potion effects. + ]], + Params = + { + { Name = "Receiver", Type = "{{cEntity}} descendant", Notes = "The entity taking damage" }, + { Name = "TDI", Type = "{{TakeDamageInfo}}", Notes = "The damage type, cause and effects. Plugins may modify this object to alter the final damage applied." }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called and then the server + applies the final values from the TDI object to Receiver. If the function returns true, no other + callbacks are called, and no damage nor effects are applied. + ]], + }, -- HOOK_TAKE_DAMAGE +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnTick.lua b/Server/Plugins/APIDump/Hooks/OnTick.lua new file mode 100644 index 000000000..d8c329253 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnTick.lua @@ -0,0 +1,29 @@ +return +{ + HOOK_TICK = + { + CalledWhen = "Every server tick (approximately 20 times per second)", + DefaultFnName = "OnTick", -- also used as pagename + Desc = [[ + This hook is called every game tick (50 msec, or 20 times a second). If the server is overloaded, + the interval is larger, which is indicated by the TimeDelta parameter.

    +

    + This hook is called in the context of the server-tick thread, that is, the thread that takes care of + {{cClientHandle|client connections}} before they're assigned to {{cPlayer|player entities}}, and + processing console commands. + ]], + Params = + { + { Name = "TimeDelta", Type = "number", Notes = "The number of milliseconds elapsed since the last server tick. Will not be less than 50 msec." }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called. If the function + returns true, no other callbacks are called. There is no overridable behavior. + ]], + }, -- HOOK_TICK +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnUpdatedSign.lua b/Server/Plugins/APIDump/Hooks/OnUpdatedSign.lua new file mode 100644 index 000000000..937e6b981 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnUpdatedSign.lua @@ -0,0 +1,38 @@ +return +{ + HOOK_UPDATED_SIGN = + { + CalledWhen = "After the sign text is updated. Notification only.", + DefaultFnName = "OnUpdatedSign", -- also used as pagename + Desc = [[ + This hook is called after a sign has had its text updated. The text is already updated at this + point.

    +

    The update may have been caused either by a {{cPlayer|player}} directly updating the sign, or by + a plugin changing the sign text using the API.

    +

    + See also the {{OnUpdatingSign|HOOK_UPDATING_SIGN}} hook for a similar hook called before the update, + with a chance to modify the text. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the sign resides" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the sign" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the sign" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the sign" }, + { Name = "Line1", Type = "string", Notes = "1st line of the new text" }, + { Name = "Line2", Type = "string", Notes = "2nd line of the new text" }, + { Name = "Line3", Type = "string", Notes = "3rd line of the new text" }, + { Name = "Line4", Type = "string", Notes = "4th line of the new text" }, + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who is changing the text. May be nil for non-player updates." } + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called. If the function + returns true, no other callbacks are called. There is no overridable behavior. + ]], + }, -- HOOK_UPDATED_SIGN +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnUpdatingSign.lua b/Server/Plugins/APIDump/Hooks/OnUpdatingSign.lua new file mode 100644 index 000000000..d74458182 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnUpdatingSign.lua @@ -0,0 +1,58 @@ +return +{ + HOOK_UPDATING_SIGN = + { + CalledWhen = "Before the sign text is updated. Plugin may modify the text / refuse.", + DefaultFnName = "OnUpdatingSign", -- also used as pagename + Desc = [[ + This hook is called when a sign text is about to be updated, either as a result of player's + manipulation or any other event, such as a plugin setting the sign text. Plugins may modify the text + or refuse the update altogether.

    +

    + See also the {{OnUpdatedSign|HOOK_UPDATED_SIGN}} hook for a similar hook called after the update. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the sign resides" }, + { Name = "BlockX", Type = "number", Notes = "X-coord of the sign" }, + { Name = "BlockY", Type = "number", Notes = "Y-coord of the sign" }, + { Name = "BlockZ", Type = "number", Notes = "Z-coord of the sign" }, + { Name = "Line1", Type = "string", Notes = "1st line of the new text" }, + { Name = "Line2", Type = "string", Notes = "2nd line of the new text" }, + { Name = "Line3", Type = "string", Notes = "3rd line of the new text" }, + { Name = "Line4", Type = "string", Notes = "4th line of the new text" }, + { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who is changing the text. May be nil for non-player updates." } + }, + Returns = [[ + The function may return up to five values. If the function returns true as the first value, no other + callbacks are called for this event and the sign is not updated. If the function returns no value or + false as its first value, other plugins' callbacks are called.

    +

    + The other up to four values returned are used to update the sign text, line by line, respectively. + Note that other plugins may again update the texts (if the first value returned is false). + ]], + CodeExamples = + { + { + Title = "Add player signature", + Desc = "The following example appends a player signature to the last line, if the sign is updated by a player:", + Code = [[ +function OnUpdatingSign(World, BlockX, BlockY, BlockZ, Line1, Line2, Line3, Line4, Player) + if (Player == nil) then + -- Not changed by a player + return false; + end + + -- Sign with playername, allow other plugins to interfere: + return false, Line1, Line2, Line3, Line4 .. Player:GetName(); +end + ]], + } + } , + }, -- HOOK_UPDATING_SIGN +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnWeatherChanged.lua b/Server/Plugins/APIDump/Hooks/OnWeatherChanged.lua new file mode 100644 index 000000000..2a3bbe92b --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnWeatherChanged.lua @@ -0,0 +1,28 @@ +return +{ + HOOK_WEATHER_CHANGED = + { + CalledWhen = "The weather has changed", + DefaultFnName = "OnWeatherChanged", -- also used as pagename + Desc = [[ + This hook is called after the weather has changed in a {{cWorld|world}}. The new weather has already + been sent to the clients.

    +

    + See also the {{OnWeatherChanging|HOOK_WEATHER_CHANGING}} hook for a similar hook called before the + change. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "World for which the weather has changed" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event. There is no overridable behavior. + ]], + }, -- HOOK_WEATHER_CHANGED +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnWeatherChanging.lua b/Server/Plugins/APIDump/Hooks/OnWeatherChanging.lua new file mode 100644 index 000000000..bb809af11 --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnWeatherChanging.lua @@ -0,0 +1,35 @@ +return +{ + HOOK_WEATHER_CHANGING = + { + CalledWhen = "The weather is about to change", + DefaultFnName = "OnWeatherChanging", -- also used as pagename + Desc = [[ + This hook is called when the current weather has expired and a new weather is selected. Plugins may + override the new weather being set.

    +

    + The new weather setting is sent to the clients only after this hook has been processed.

    +

    + See also the {{OnWeatherChanged|HOOK_WEATHER_CHANGED}} hook for a similar hook called after the + change. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "World for which the weather is changing" }, + { Name = "Weather", Type = "number", Notes = "The newly selected weather. One of wSunny, wRain, wStorm" }, + }, + Returns = [[ + The hook handler can return up to two values. If the first value is false or not present, the server + calls other plugins' callbacks and finally sets the weather. If it is true, the server doesn't call any + more callbacks for this hook. The second value returned is used as the new weather. If no value is + given, the weather from the parameters is used as the weather. Returning false as the first value and a + specific weather constant as the second value makes the server call the rest of the hook handlers with + the new weather value. + ]], + }, -- HOOK_WEATHER_CHANGING +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnWorldStarted.lua b/Server/Plugins/APIDump/Hooks/OnWorldStarted.lua new file mode 100644 index 000000000..61e3de86e --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnWorldStarted.lua @@ -0,0 +1,24 @@ +return +{ + HOOK_WORLD_STARTED = + { + CalledWhen = "A {{cWorld|world}} is initialized", + DefaultFnName = "OnWorldStarted", -- also used as pagename + Desc = [[ + This hook is called whenever a {{cWorld|world}} is initialized. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "World that is started" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event. There is no overridable behavior. + ]], + }, -- HOOK_WORLD_STARTED +} + + + + + diff --git a/Server/Plugins/APIDump/Hooks/OnWorldTick.lua b/Server/Plugins/APIDump/Hooks/OnWorldTick.lua new file mode 100644 index 000000000..657716d9e --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnWorldTick.lua @@ -0,0 +1,29 @@ +return +{ + HOOK_WORLD_TICK = + { + CalledWhen = "Every world tick (about 20 times per second), separately for each world", + DefaultFnName = "OnWorldTick", -- also used as pagename + Desc = [[ + This hook is called for each {{cWorld|world}} every tick (50 msec, or 20 times a second). If the + world is overloaded, the interval is larger, which is indicated by the TimeDelta parameter.

    +

    + This hook is called in the world's tick thread context and thus has access to all world data + guaranteed without blocking. + ]], + Params = + { + { Name = "World", Type = "{{cWorld}}", Notes = "World that is ticking" }, + { Name = "TimeDelta", Type = "number", Notes = "The number of milliseconds since the previous game tick. Will not be less than 50 msec" }, + }, + Returns = [[ + If the function returns false or no value, the next plugin's callback is called. If the function + returns true, no other callback is called for this event. There is no overridable behavior. + ]], + }, -- HOOK_WORLD_TICK +} + + + + + diff --git a/Server/Plugins/APIDump/InfoFile.html b/Server/Plugins/APIDump/InfoFile.html new file mode 100644 index 000000000..99910f5ae --- /dev/null +++ b/Server/Plugins/APIDump/InfoFile.html @@ -0,0 +1,246 @@ + + + + Cuberite - Info.lua file + + + + + + + +

    +

    Info.lua file

    +

    Contents

    + + + +
    +

    Introduction

    + +

    For a long time Cuberite plugins were plagued by poor documentation. The plugins worked, people who wrote them knew how to use them, but for anyone new to the plugin it was a terrible ordeal learning how to use it. Most of the times, the plugin authors only wrote what commands the plugin supported, sometimes not even that. Then, there was a call to action to put an end to this, to make documenting the plugins easy and at the same time centralized. Thus, the Info.lua file was born.

    + +

    Most plugins have some parts that are the same across all the plugins. These are commands, console commands and their permissions. If a plugin implemented a command, it would practically copy & paste the same code over and over again. So it makes sense to extract only unique information, centralize it and automate all the parts around it. This was another reason for the Info.lua file - it is a central hub of commands, console commands and their permissions.

    + +

    Last, but not least, we want to make a plugin repository on the web in the future, a repository that would store plugins, their descriptions, comments. It makes sense that the centralized information can be parsed by the repository automatically, so that advanced things, such as searching for a plugin based on a command, or determining whether two plugins collide command-wise, are possible.

    + +

    After this file format has been devised, a tool has been written that allows for an easy generation of the documentation for the plugin in various formats. It outputs the documentation in a format that is perfect for pasting into the forum. It generates documentation in a Markup format to use in README.md on GitHub and similar sites. The clever thing is that you don't need to keep all those formats in sync manually - you edit the Info.lua file and this tool will re-generate the documentation for you.

    + +

    So to sum up, the Info.lua file contains the plugins' commands, console commands, their permissions and possibly the overall plugin documentation, in a structured manner that can be parsed by a program, yet is human readable and editable.

    + + +
    +

    The overall structure

    + +

    The file consist of a declaration of a single Lua table, g_PluginInfo. This table contains all the information, structured, as its members. Each member can be a structure by itself. The entire file is a valid Lua source file, so any tool that syntax-checks Lua source can syntax-check this file. The file is somewhat forward- and backward- compatible, in the sense that it can be extended in any way without breaking.

    +

    Here's a skeleton of the file:

    +
    +g_PluginInfo =
    +{
    +	Name = "Example Plugin",
    +	Date = "2014-06-12",
    +	Description = "This is an example plugin that shows how to use the Info.lua file",
    +	
    +	-- The following members will be documented in greater detail later:
    +	AdditionalInfo = {},
    +	Commands = {},
    +	ConsoleCommands = {},
    +	Permissions = {},
    +}
    +
    +

    As you can see, the structure is pretty straightforward. Note that the order of the elements inside the table is not important (Lua property).

    + +

    The first few elements are for book-keeping. They declare the plugin's name, the date in ISO-format, representing the version of the plugin, and the description. The idea is that the description sums up what the plugin is all about, within some two or three sentences.

    + + +
    +

    AdditionalInfo table

    + +

    This table is used for more detailed description of the plugin. If there is any non-trivial setup process, dependencies, describe them here. This is where the description should get detailed. Don't worry about using several paragraphs of text here, if it makes the plugin easier to understand.

    + +

    The table should have the following layout:

    +
    +AdditionalInfo =
    +{
    +	{
    +		Title = "Chapter 1",
    +		Contents = "Describe one big aspect of the plugin here",
    +	},
    +	{
    +		Title = "Chapter 2",
    +		Contents = "Describe another big topic",
    +	},
    +}
    +
    +

    The idea here is that the tool that is used to generate the documentation from the Info.lua file will create a linkified table of contents and then each of the information elements' contents. This information should be all that is needed to successfully configure, run and manage the plugin.

    + + +
    +

    Commands table

    + +

    The commands table lists all the commands that the plugin implements, together with their handler functions, required permissions, help strings and further information. The table supports recursion, which allows plugins to create multi-word commands easily (such as "//schematic load" and "//schematic save"), each having its own separate handler.

    + +

    The table uses structure similar to the following:

    +
    +Commands =
    +{
    +	["/cmd1"] =
    +	{
    +		HelpString = "Performs the first action",
    +		Permission = "firstplugin.cmds.1",
    +		Alias = "/c1",
    +		Handler = HandleCmd1,
    +		ParameterCombinations =
    +		{
    +			{
    +				Params = "x y z",
    +				Help = "Performs the first action at the specified coordinates",
    +			},
    +			{
    +				Params = "-p",
    +				Help = "Performs the first action at the player's coordinates",
    +			}
    +		},
    +	},
    +	["/cmd2"] =
    +	{
    +		Alias = {"/c2", "//c2" },
    +		Subcommands =
    +		{
    +			sub1 =  -- This declares a "/cmd2 sub1" command
    +			{
    +				HelpString = "Performs the second action's first subcommand",
    +				Permission = "firstplugin.cmds.2.1",
    +				Alias = "1",
    +				Handler = HandleCmd2Sub1,
    +				ParameterCombinations =
    +				{
    +					{
    +						Params = "x y z",
    +						Help = "Performs the second action's first subcommand at the specified coordinates",
    +					},
    +					{
    +						Params = "-p",
    +						Help = "Performs the second action's first subcommand at the player's coordinates",
    +					}
    +				},
    +			},
    +			sub2 =  -- Declares a "/cmd2 sub2" command
    +			{
    +				HelpString = "Performs the second action's second subcommand",
    +				Permission = "firstplugin.cmds.2.2",
    +				Handler = HandleCmd2Sub2,
    +			},
    +		},
    +	},
    +}
    +
    + +

    Although it may seem overwhelming at first, there is a "method to this madness". Each element of the Commands table defines one command. Most commands start with a slash, so the special Lua syntax for table elements with non-standard names needs to be applied (["/cmd1"] =). The command can either specify subcommands, or a handler function (specifying both is UndefinedBehavior). Subcommands uses the same structure as the entire Commands table, recursively.

    + +

    The permission element specifies that the command is only available with the specified permission. Note that the permission for subcommand's parent isn't checked when the subcommand is called. This means that specifying the permission for a command that has subcommands has no effect whatsoever, but is discouraged because we may add processing for that in the future.

    + +

    The ParameterCombinations table is used only for generating the documentation, it lists the various combinations of parameters that the command supports. It's worth specifying even if the command supports only one combination, because that combination will get documented this way.

    + +

    The Alias member specifies any possible aliases for the command. Each alias is registered separately and if there is a subcommand table, it is applied to all aliases, just as one would expect. You can specify either a single string as the value (if there's only one alias), or a table of strings for multiple aliases. Commands with no aliases do not need to specify this member at all.

    + + +
    +

    ConsoleCommands table

    + +

    This table serves a purpose similar to that of the Commands table, only these commands are provided for the server console. Therefore, there are no permissions specified for these commands. Since most console commands don't use a leading slash, the command names don't need the special syntax. Also, the handler function doesn't receive the Player parameter.

    + +

    Here's an example of a ConsoleCommands table:

    +
    +ConsoleCommands =
    +{
    +	concmd =
    +	{
    +		HelpString = "Performs the console action",
    +		Subcommands =
    +		{
    +			sub1 =
    +			{
    +				HelpString = "Performs the console action's first subcommand",
    +				Handler = HandleConCmdSub1,
    +				ParameterCombinations =
    +				{
    +					{
    +						Params = "x y z",
    +						Help = "Performs the console action's first subcommand at the specified coordinates",
    +					},
    +				},
    +			},
    +			sub2 =
    +			{
    +				HelpString = "Performs the console action's second subcommand",
    +				Handler = HandleConCmdSub2,
    +			},
    +		},
    +	},
    +}
    +
    + + +
    +

    Permissions table

    + +

    The purpose of this table is to document permissions that the plugin uses. The documentation generator automatically collects the permissions specified in the Command table; the Permissions table adds a description for these permissions and may declare other permissions that aren't specifically included in the Command table.

    + +
    +Permissions =
    +{
    +	["firstplugin.cmd.1.1"] =
    +	{
    +		Description = "Allows the players to build high towers using the first action.",
    +		RecommendedGroups = "players",
    +	},
    +	["firstplugin.cmd.2.1"] =
    +	{
    +		Description = "Allows the players to kill entities using the second action. Note that this may be misused to kill other players, too.",
    +		RecommendedGroups = "admins, mods",
    +	},
    +}
    +
    + +

    The RecommendedGroup element lists, in plain English, the intended groups for which the permission should be enabled on a typical server. Plugin authors are advised to create reasonable defaults, prefering security to openness, so that admins using these settings blindly don't expose their servers to malicious users.

    + + +
    +

    Using the file in code

    + +

    Just writing the Info.lua file and saving it to the plugin folder is not enough for it to actually be used. Your plugin needs to include the following boilerplate code, preferably in its Initialize() function:

    +
    +-- Use the InfoReg shared library to process the Info.lua file:
    +dofile(cPluginManager:GetPluginsPath() .. "/InfoReg.lua")
    +RegisterPluginInfoCommands()
    +RegisterPluginInfoConsoleCommands()
    +
    + +

    Of course, if your plugin doesn't have any console commands, it doesn't need to call the RegisterPluginInfoConsoleCommands() function, and similarly if it doesn't have any in-game commands, it doesn't need to call the RegisterPluginInfoCommands() function.

    + + +
    +

    Examples

    + +

    There are several plugins that already implement this approach. You can visit them for inspiration and to see what the generated documentation looks like:

    + + + +
    + + diff --git a/Server/Plugins/APIDump/LICENSE-prettify.txt b/Server/Plugins/APIDump/LICENSE-prettify.txt new file mode 100644 index 000000000..b7f86df20 --- /dev/null +++ b/Server/Plugins/APIDump/LICENSE-prettify.txt @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2011 Mike Samuel et al + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Server/Plugins/APIDump/SettingUpDecoda.html b/Server/Plugins/APIDump/SettingUpDecoda.html new file mode 100644 index 000000000..8a74f0240 --- /dev/null +++ b/Server/Plugins/APIDump/SettingUpDecoda.html @@ -0,0 +1,49 @@ + + + + + Cuberite - Setting up Decoda + + + + + + + +
    +

    Setting up the Decoda IDE

    +

    + This article will explain how to set up Decoda, an IDE for writing Lua code, so that you can develop Cuberite plugins with the comfort of an IDE.

    + +

    About Decoda

    + +

    To quickly introduce Decoda, it is an IDE for writing Lua code. It has the basic features expected of an IDE - you can group files into project, you can edit multiple files in a tabbed editor, the code is syntax-highlighted. Code completion, symbol browsing, and more. It also features a Lua debugger that allows you to debug your Lua code within any application that embeds the Lua runtime or uses Lua as a dynamic-link library (DLL). Although it is written using the multiplatform WxWidgets toolkit, it hasn't yet been ported to any platform other than 32-bit Windows. This unfortunately means that Linux users will not be able to use it. It can be used on 64-bit Windows, but the debugger only works for 32-bit programs.

    +

    Here's a screenshot of a default Decoda window with the debugger stepping through the code (scaled down):
    +

    +

    As you can see, you can set breakpoints in the code, inspect variables' values, view both the Lua and native (C++) call-stacks. Decoda also breaks program execution when a faulty Lua script is executed, providing a detailed error message and pointing you directly to the faulting code. It is even possible to attach a C++ debugger to a process that is being debugged by Decoda, this way you can trap both C++ and Lua errors.

    +

    Decoda is open-source, the sources are on GitHub: https://github.com/unknownworlds/decoda. You can download a compiled binary from the creators' site, http://unknownworlds.com/decoda/. + +

    Project management

    +

    To begin using Decoda, you need to create a project, or load an existing one. Decoda projects have a .deproj extension, and are simply a list of Lua files that are to be opened. You can create a project through menu Project -> New Project. Save your project first, so that Decoda knows what relative paths to use for the files. Then either add existing Lua files or create new one, through menu Project -> Add Add New File / Add Existing File.

    +

    Next you need to set up the executable that Decoda will run when debugging your files. Select menu Project -> Settings. A new dialog will open:
    +

    +

    In the debugging section, fill in the full path to Cuberite.exe, or click the triple-dot button to browse for the file. Note that the Working directory will be automatically filled in for you with the folder where the executable is (until the last backslash). This is how it's supposed to work, don't change it; if it for some reason doesn't update, copy and paste the folder name from the Command edit box. All done, you can close this dialog now.

    + +

    Debugging

    +

    You are now ready to debug your code. Before doing that, though, don't forget to save your project file. If you haven't done so already, enable your plugin in the settings.ini file. If you want the program to break at a certain line, it is best to set the breakpoint before starting the program. Set the cursor on the line and hit F9 (or use menu Debug -> Toggle Breakpoint) to toggle a breakpoint on that line. Finally, hit F5, or select menu Debug -> Start to launch Cuberite under the debugger. The Cuberite window comes up and loads your plugin. If Decoda displays the Project Settings dialog instead, you haven't set up the executable to run, see the Project management section for instructions.

    +

    At this point you will see that Decoda starts adding new items to your project. All the files for all plugins are added temporarily. Don't worry, they are only temporary, they will be removed again once the debugging session finishes. You can tell the temporary files from the regular files by their icon, it's faded out. Decoda handles all the files that Cuberite loads, so you can actually debug any of those faded files, too.

    +

    If there's an error in the code, the Decoda window will flash and a dialog box will come up, describing the error and taking you to the line where it occured. Note that the execution is paused in the thread executing the plugin, so until you select Debug -> Continue from the menu (F5), Cuberite won't be fully running. You can fix the error and issue a "reload" command in Cuberite console to reload the plugin code anew (Cuberite doesn't detect changes in plugin code automatically).

    +

    If the execution hits a breakpoint, the Decoda window will flash and a yellow arrow is displayed next to the line. You can step through the code using F10 and F11, just like in MSVS. You can also use the Watch window to inspect variable values, or simply hover your mouse over a variable to display its value in the tooltip.

    + +

    Limitations

    +

    So far everything seems wonderful. Unfortunately, it doesn't always go as easy. There are several limits to what Decoda can do:

    + +
    + + diff --git a/Server/Plugins/APIDump/SettingUpZeroBrane.html b/Server/Plugins/APIDump/SettingUpZeroBrane.html new file mode 100644 index 000000000..d2f5bb483 --- /dev/null +++ b/Server/Plugins/APIDump/SettingUpZeroBrane.html @@ -0,0 +1,46 @@ + + + + + Cuberite - Setting up ZeroBrane Studio + + + + + + + +
    +

    Setting up the ZeroBrane Studio IDE

    +

    + This article will explain how to set up ZeroBrane Studio, an IDE for writing Lua code, so that you can develop Cuberite plugins with the comfort of an IDE.

    + +

    About ZeroBrane Studio

    + +

    To quickly introduce ZeroBrane Studio, it is an IDE for writing Lua code. It has the basic features expected of an IDE - it allows you to manage groups of files as a project, you can edit multiple files in a tabbed editor, the code is syntax-highlighted. Code completion, symbol browsing, and more. It also features a Lua debugger that allows you to debug your Lua code within any application that uses Lua and can load Lua packages. It is written using the multiplatform WxWidgets toolkit, and runs on multiple platforms, including Windows, Linux and MacOS.

    +

    Here's a screenshot of a default ZBS window with the debugger stepping through the code (scaled down):
    +

    +

    As you can see, you can set breakpoints in the code, inspect variables' values, view the Lua call-stacks.

    +

    ZBS is open-source, the sources are on GitHub: https://github.com/pkulchenko/ZeroBraneStudio. The project's homepage is at http://studio.zerobrane.com/. + +

    First-time setup

    +

    Since ZBS is a universal Lua IDE, you need to first set it up so that it is ready for Cuberite plugin development. For that, you need to download one file, mcserver.lua from the ZBS's plugin repository. Place that file in the "packages" folder inside your ZBS's folder. Note that there are other useful plugins in the repository and you may want to have a look there later on to further customize your ZBS. To install them, simply save them into the same folder.

    +

    Next you should install the code-completion support specific for Cuberite. You should repeat this step from time to time, because the API evolves in time so new functions and classes are added to it quite often. You should have an APIDump plugin in your Cuberite installation. Enable the APIDump plugin in the server settings, it's very cheap to keep it enabled and it doesn't cost any performance during normal gameplay. To generate the code-completion support file, enter the api command into the server console. This will create a new file, "mcserver_api.lua", next to the Cuberite executable. Move that file into the "api/lua" subfolder inside your ZBS's folder.

    +

    After you download the mcserver.lua file and install the completion support, you need to restart ZBS in order for the plugin to load. If there are no errors, you should see two new items in the Project -> Lua Interpreter submenu: "Cuberite - debug mode" and "Cuberite - release mode". The only difference between the two is which filename they use to launch Cuberite - mcserver_debug(.exe) for the debug option and "mcserver(.exe)" for the release option. If you built your own Cuberite executable and you built it in debug mode, you should select the debug mode option. In all other cases, including if you downloaded the already-compiled Cuberite executable from the internet, you should select the release mode option.

    +

    For a first time user, it might be a bit overwhelming that there are no GUI settings in the ZBS, yet the IDE is very configurable. There are two files that you edit in order to change settings, either system-wide (all users of the computer share those settings) or user-wide (the settings are only for a specific user of the computer). Those files are regular Lua sources and you can quickly locate them and edit them from within the IDE itself, select Edit -> Preferences -> Settings: XYZ from the menu, with XYZ being either System or User.

    +

    There is a documentation on most of the settings on ZBS's webpage, have a look at http://studio.zerobrane.com/documentation.html, especially the Preferences section. Personally I recommend setting editor.usetabs to true and possibly adjusting the editor.tabwidth, turn off the editor.smartindent feature and for debugging the option debugger.alloweditting should be set to true unless you feel like punishing yourself.

    + +

    Project management

    +

    ZBS works with projects, it considers all files and subfolder in a specific folder to be a project. There's no need for a special project file nor for adding individual files to the workspace, all files are added automatically. To open a Cuberite plugin as the project, click the triple-dot button in the Project pane, or select Project -> Project directory -> Choose... from the menu. Browse and select the Cuberite plugin's folder. ZBS will load all the files in the plugin's folder and you can start editting code.

    +

    Note that although ZBS allows you to work with subfolders in your plugins (and you should, especially with larger plugins), the current Cuberite ZBS plugin will not be able to start debugging unless you have a file open in the editor that is at the root level of the Cuberite plugin's folder.

    + +

    Debugging

    +

    You are now ready to debug your code. Before doing that, though, don't forget to save your project files. If you haven't done so already, enable your plugin in the settings.ini file. If you want the program to break at a certain line, it is best to set the breakpoint before starting the program. Set the cursor on the line and hit F9 (or use menu Project -> Toggle Breakpoint) to toggle a breakpoint on that line. Finally, hit F5, or select menu Project -> Start Debugging to launch Cuberite under the debugger. The Cuberite window comes up and loads your plugin. If the window doesn't come up, inspect the Output pane in ZBS, there are usually two reasons for failure:

    +

    Once running, if the execution hits a breakpoint, the ZBS window will come up and a green arrow is displayed next to the breakpoint line. You can step through the code using F10 (Step Into) and Shift+F10 (Step Over). You can also use the Watch window to inspect variable values, or simply hover your mouse over a variable to display its value in the tooltip. Use the Remote console pane to execute commands directly *inside* the Cuberite's plugin context.

    +

    You can also use the Project -> Break menu item to break into the debugger as soon as possible. You can also set breakpoints while the Cuberite plugin is running. Note that due to the way in which the debugger is implemented, Cuberite may execute some more Lua code before the break / breakpoint comes into effect. If Cuberite is not executing any Lua code in your plugin, it will not break until the plugin code kicks in again. This may result in missed breakpoints and delays before the Break command becomes effective. Therefore it's best to set breakpoints before running the program, or while the program is waiting in another breakpoint.

    +
    + + diff --git a/Server/Plugins/APIDump/Static/.gitignore b/Server/Plugins/APIDump/Static/.gitignore new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/Server/Plugins/APIDump/Static/.gitignore @@ -0,0 +1 @@ + diff --git a/Server/Plugins/APIDump/Static/decoda_debug_settings.png b/Server/Plugins/APIDump/Static/decoda_debug_settings.png new file mode 100644 index 000000000..462d517b4 Binary files /dev/null and b/Server/Plugins/APIDump/Static/decoda_debug_settings.png differ diff --git a/Server/Plugins/APIDump/Static/decoda_logo.png b/Server/Plugins/APIDump/Static/decoda_logo.png new file mode 100644 index 000000000..fb446b62c Binary files /dev/null and b/Server/Plugins/APIDump/Static/decoda_logo.png differ diff --git a/Server/Plugins/APIDump/Static/decoda_workspace.png b/Server/Plugins/APIDump/Static/decoda_workspace.png new file mode 100644 index 000000000..7e626dae9 Binary files /dev/null and b/Server/Plugins/APIDump/Static/decoda_workspace.png differ diff --git a/Server/Plugins/APIDump/Static/zbs_logo.png b/Server/Plugins/APIDump/Static/zbs_logo.png new file mode 100644 index 000000000..c8d6d6278 Binary files /dev/null and b/Server/Plugins/APIDump/Static/zbs_logo.png differ diff --git a/Server/Plugins/APIDump/Static/zbs_workspace.png b/Server/Plugins/APIDump/Static/zbs_workspace.png new file mode 100644 index 000000000..9ce17e35a Binary files /dev/null and b/Server/Plugins/APIDump/Static/zbs_workspace.png differ diff --git a/Server/Plugins/APIDump/UsingChunkStays.html b/Server/Plugins/APIDump/UsingChunkStays.html new file mode 100644 index 000000000..a7cb5302a --- /dev/null +++ b/Server/Plugins/APIDump/UsingChunkStays.html @@ -0,0 +1,167 @@ + + + + Cuberite - Using ChunkStays + + + + + + + +
    +

    Using ChunkStays

    +

    + A plugin may need to manipulate data in arbitrary chunks, and it needs a way to make the server + guarantee that the chunks are available in memory.

    + +

    The problem

    +

    + Usually when plugins want to manipulate larger areas of world data, they need to make sure that the + server has the appropriate chunks loaded in the memory. When the data being manipulated can be further + away from the connected players, or the data is being manipulated from a console handler, there is a + real chance that the chunks are not loaded.

    +

    + This gets even more important when using the cBlockArea class for reading + and writing. Those functions will fail when any of the required chunks aren't valid. This means that + either the block area has incomplete data (Read() failed) or incomplete data has been written to the + world (Write() failed). Recovery from this is near impossible - you can't simply read or write again + later, because the world may have changed in the meantime.

    + +

    The solution

    +

    + The naive solution would be to monitor chunk loads and unloads, and postpone the operations until all + the chunks are available. This would be quite ineffective and also very soon it would become very + difficult to maintain, if there were multiple code paths requiring this handling.

    +

    + An alternate approach has been implemented, accessible through a single (somewhat hidden) function + call: cWorld:ChunkStay(). All that this call basically does is, it tells the + server "Load these chunks for me, and call this callback function once you have them all." And the + server does exactly that - it remembers the callback and asks the world loader / generator to provide + the chunks. Once the chunks become available, it calls the callback function for the plugin.

    +

    + There are a few gotcha-s, though. If the code that was requesting the read or write had access to some + of the volatile objects, such as cPlayer or + cEntity objects, those cannot be accessed by the callback anymore, because + they may have become invalid in the meantime - the player may have disconnected, the entity may have + despawned. So the callback must use the longer way to access such objects, such as calling + cWorld:DoWithEntityByID() or + cWorld:DoWithPlayer().

    + +

    The example

    +

    + As a simple example, consider a theoretical plugin that allows a player to save the immediate + surroundings of the spawn into a schematic file. The player issues a command to initiate the save, and + the plugin reads a 50 x 50 x 50 block area around the spawn into a cBlockArea and saves it on the disk + as "_spawn.schematic". When it's done with the saving, it wants to send a message to the + player to let them know the command has succeeded.

    +

    + The first attempt shows the naive approach. It simply reads the block area and saves it, then sends the + message. I'll repeat once more, this code is the wrong way to do it!

    +
    +function HandleCommandSaveSpawn(a_Split, a_Player)
    +	-- Get the coords for the spawn:
    +	local SpawnX = a_Player:GetWorld():GetSpawnX()
    +	local SpawnY = a_Player:GetWorld():GetSpawnY()
    +	local SpawnZ = a_Player:GetWorld():GetSpawnZ()
    +	local Bounds = cCuboid(SpawnX - 25, SpawnY - 25, SpawnZ - 25, SpawnX + 25, SpawnY + 25, SpawnZ + 25)
    +	Bounds:ClampY(0, 255)
    +	
    +	-- Read the area around spawn into a cBlockArea, save to file:
    +	local Area = cBlockArea()
    +	local FileName = a_Player:GetName() .. "_spawn.schematic"
    +	Area:Read(a_Player:GetWorld(), Bounds, cBlockArea.baTypes + cBlockArea.baMetas)
    +	Area:SaveToSchematicFile(FileName)
    +	
    +	-- Notify the player:
    +	a_Player:SendMessage(cCompositeChat("The spawn has been saved", mtInfo))
    +	return true
    +end
    +
    +

    + Now if the player goes exploring far and uses the command to save their spawn, the chunks aren't + loaded, so the BlockArea reading fails, the BlockArea contains bad data. Note that the plugin fails to + do any error checking and if the area isn't read from the world, it happily saves the incomplete data + and says "hey, everything's right", althought it has just trashed any previous backup of the spawn + schematic with nonsense data.

    +
    +

    + The following script uses the ChunkStay method to alleviate chunk-related problems. This is the + right way of doing it:

    +
    +function HandleCommandSaveSpawn(a_Split, a_Player)
    +	-- Get the coords for the spawn:
    +	local SpawnX = a_Player:GetWorld():GetSpawnX()
    +	local SpawnY = a_Player:GetWorld():GetSpawnY()
    +	local SpawnZ = a_Player:GetWorld():GetSpawnZ()
    +	local Bounds = cCuboid(SpawnX - 25, SpawnY - 25, SpawnZ - 25, SpawnX + 25, SpawnY + 25, SpawnZ + 25)
    +	Bounds:ClampY(0, 255)
    +	
    +	-- Get a list of chunks that we need loaded:
    +	local MinChunkX = math.floor((SpawnX - 25) / 16)
    +	local MaxChunkX = math.ceil ((SpawnX + 25) / 16)
    +	local MinChunkZ = math.floor((SpawnZ - 25) / 16)
    +	local MaxChunkZ = math.ceil ((SpawnZ + 25) / 16)
    +	local Chunks = {}
    +	for x = MinChunkX, MaxChunkX do
    +		for z = MinChunkZ, MaxChunkZ do
    +			table.insert(Chunks, {x, z})
    +		end
    +	end  -- for x
    +	
    +	-- Store the player's name and world to use in the callback, because the a_Player object may no longer be valid:
    +	local PlayerName = a_Player:GetName()
    +	local World = a_Player:GetWorld()
    +	
    +	-- This is the callback that is executed once all the chunks are loaded:
    +	local OnAllChunksAvailable = function()
    +		-- Read the area around spawn into a cBlockArea, save to file:
    +		local Area = cBlockArea()
    +		local FileName = PlayerName .. "_spawn.schematic"
    +		if (Area:Read(World, Bounds, cBlockArea.baTypes + cBlockArea.baMetas)) then
    +			Area:SaveToSchematicFile(FileName)
    +			Msg = cCompositeChat("The spawn has been saved", mtInfo)
    +		else
    +			Msg = cCompositeChat("Cannot save the spawn", mtFailure)
    +		end
    +		
    +		-- Notify the player:
    +		-- Note that we cannot use a_Player here, because it may no longer be valid (if the player disconnected before the command completes)
    +		World:DoWithPlayer(PlayerName,
    +			function (a_CBPlayer)
    +				a_CBPlayer:SendMessage(Msg)
    +			end
    +		)
    +	end
    +	
    +	-- Ask the server to load our chunks and notify us once it's done:
    +	World:ChunkStay(Chunks, nil, OnAllChunksAvailable)
    +	
    +	-- Note that code here may get executed before the callback is called!
    +	-- The ChunkStay says "once you have the chunks", not "wait until you have the chunks"
    +	-- So you can't notify the player here, because the saving needn't have occurred yet.
    +	
    +	return true
    +end
    +
    +

    + Note that this code does its error checking of the Area:Read() function, and it will not overwrite the + previous file unless it actually has the correct data. If you're wondering how the reading could fail + when we've got the chunks loaded, there's still the issue of free RAM - if the memory for the area + cannot be allocated, it cannot be read even with all the chunks present. So we still do need that + check.

    + +

    The conclusion

    +

    + Although it makes the code a little bit longer and is a bit more difficult to grasp at first, the + ChunkStay is a useful technique to add to your repertoire. It is to be used whenever you need access to + chunks that may potentially be inaccessible, and you really need the data.

    +

    Possibly the biggest hurdle in using the ChunkStay is the fact that it does its work in the + background, thus invalidating all cPlayer and cEntity objects your function may hold, so you need to + re-acquire them from their IDs and names. This is the penalty for using multi-threaded code.

    + +
    + + diff --git a/Server/Plugins/APIDump/WebWorldThreads.html b/Server/Plugins/APIDump/WebWorldThreads.html new file mode 100644 index 000000000..b6c5c34ca --- /dev/null +++ b/Server/Plugins/APIDump/WebWorldThreads.html @@ -0,0 +1,72 @@ + + + + Cuberite - Webserver vs World threads + + + + + + + +
    +

    Webserver vs World threads

    +

    + This article will explain the threading issues that arise between the webserver and world threads are of concern to plugin authors.

    +

    + Generally, plugins that provide webadmin pages should be quite careful about their interactions. Most operations on Cuberite objects requires synchronization, that Cuberite provides automatically and transparently to plugins - when a block is written, the chunkmap is locked, or when an entity is being manipulated, the entity list is locked. Each plugin also has a mutex lock, so that only one thread at a time may be executing plugin code.

    +

    + This locking can be a source of deadlocks for plugins that are not written carefully.

    + +

    Example scenario

    +

    Consider the following example. A plugin provides a webadmin page that allows the admin to kick players off the server. When the admin presses the "Kick" button, the plugin calls cWorld:DoWithPlayer() with a callback to kick the player. Everything seems to be working fine now.

    +

    + A new feature is developed in the plugin, now the plugin adds a new in-game command so that the admins can kick players while they're playing the game. The plugin registers a command callback with cPluginManager.AddCommand(). Now there are problems bound to happen.

    +

    + Suppose that two admins are in, one is using the webadmin and the other is in-game. Both try to kick a player at the same time. The webadmin locks the plugin, so that it can execute the plugin code, but right at this moment the OS switches threads. The world thread locks the world so that it can access the list of in-game commands, receives the in-game command, it tries to lock the plugin. The plugin is already locked, so the world thread is put on hold. After a while, the webadmin thread is woken up again and continues processing. It tries to lock the world so that it can traverse the playerlist, but the lock is already held by the world thread. Now both threads are holding one lock each and trying to grab the other lock, and are therefore deadlocked.

    + +

    How to avoid the deadlock

    +

    + There are two main ways to avoid such a deadlock. The first approach is using tasks: Everytime you need to execute a task inside a world, instead of executing it, queue it, using cWorld:QueueTask(). This handy utility can will call the given function inside the world's TickThread, thus eliminating the deadlock, because now there's only one thread. However, this approach will not let you get data back. You cannot query the player list, or the entities, or anything - because when the task runs, the webadmin page has already been served to the browser.

    +

    + To accommodate this, you'll need to use the second approach - preparing and caching data in the tick thread, possibly using callbacks. This means that the plugin will have global variables that will store the data, and update those variables when the data changes; then the webserver thread will only read those variables, instead of calling the world functions. For example, if a webpage was to display the list of currently connected players, the plugin should maintain a global variable, g_WorldPlayers, which would be a table of worlds, each item being a list of currently connected players. The webadmin handler would read this variable and create the page from it; the plugin would use HOOK_PLAYER_JOINED and HOOK_DISCONNECT to update the variable.

    + +

    What to avoid

    +

    + Now that we know what the danger is and how to avoid it, how do we know if our code is susceptible?

    +

    + The general rule of thumb is to avoid calling any functions that read or write lists of things in the webserver thread. This means most ForEach() and DoWith() functions. Only cRoot:ForEachWorld() is safe - because the list of worlds is not expected to change, so it is not guarded by a mutex. Getting and setting world's blocks is, naturally, unsafe, as is calling other plugins, or creating entities.

    + +

    Example

    + The Core has the facility to kick players using the web interface. It used the following code for the kicking (inside the webadmin handler): +
    +local KickPlayerName = Request.Params["players-kick"]
    +local FoundPlayerCallback = function(Player)
    +	if (Player:GetName() == KickPlayerName) then
    +	Player:GetClientHandle():Kick("You were kicked from the game!")
    +	end
    +end
    +cRoot:Get():FindAndDoWithPlayer(KickPlayerName, FoundPlayerCallback)
    +
    +The cRoot:FindAndDoWithPlayer() is unsafe and could have caused a deadlock. The new solution is queue a task; but since we don't know in which world the player is, we need to queue the task to all worlds: +
    +cRoot:Get():ForEachWorld(    -- For each world...
    +	function(World)
    +	World:QueueTask(         -- ... queue a task...
    +		function(a_World)
    +		a_World:DoWithPlayer(KickPlayerName,  -- ... to walk the playerlist...
    +			function (a_Player)
    +			a_Player:GetClientHandle():Kick("You were kicked from the game!")  -- ... and kick the player
    +			end
    +		)
    +		end
    +	)
    +	end
    +)
    +
    + +
    + + \ No newline at end of file diff --git a/Server/Plugins/APIDump/Writing-a-Cuberite-plugin.html b/Server/Plugins/APIDump/Writing-a-Cuberite-plugin.html new file mode 100644 index 000000000..2b6af0d82 --- /dev/null +++ b/Server/Plugins/APIDump/Writing-a-Cuberite-plugin.html @@ -0,0 +1,255 @@ + + + + + Cuberite Plugin Tutorial + + + + + + + +
    +

    Writing a Cuberite plugin

    +

    + This article will explain how to write a basic plugin. It details basic requirements + for a plugin, explains how to register a hook and bind a command, and gives plugin + standards details. +

    +

    + Let us begin. In order to begin development, we must firstly obtain a compiled copy + of Cuberite, and make sure that the Core plugin is within the Plugins folder, and activated. + Core handles much of the Cuberite end-user experience and gameplay will be very bland without it. +

    +

    Creating the basic template

    +

    + Plugins are written in Lua. Therefore, create a new Lua file. You can create as many files as you wish, with + any filename - Cuberite bungs them all together at runtime, however, let us create a file called main.lua for now. + Format it like so: +

    +
    +PLUGIN = nil
    +
    +function Initialize(Plugin)
    +	Plugin:SetName("NewPlugin")
    +	Plugin:SetVersion(1)
    +
    +	-- Hooks
    +
    +	PLUGIN = Plugin -- NOTE: only needed if you want OnDisable() to use GetName() or something like that
    +
    +	-- Command Bindings
    +
    +	LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
    +	return true
    +end
    +
    +function OnDisable()
    +	LOG(PLUGIN:GetName() .. " is shutting down...")
    +end
    +			
    +

    + Now for an explanation of the basics. +

    + Be sure to return true for this function, else Cuberite thinks you plugin had failed to initialise and prints a stacktrace with an error message. +

    + +

    Registering hooks

    +

    + Hooks are things that Cuberite calls when an internal event occurs. For example, a hook is fired when a player places a block, moves, + logs on, eats, and many other things. For a full list, see the API documentation. +

    +

    + A hook can be either informative or overridable. In any case, returning false will not trigger a response, but returning true will cancel + the hook and prevent it from being propagated further to other plugins. An overridable hook simply means that there is visible behaviour + to a hook's cancellation, such as a chest being prevented from being opened. There are some exceptions to this where only changing the value the + hook passes has an effect, and not the actual return value, an example being the HOOK_KILLING hook. See the API docs for details. +

    +

    + To register a hook, insert the following code template into the "-- Hooks" area in the previous code example. +

    +
    +cPluginManager.AddHook(cPluginManager.HOOK_NAME_HERE, FunctionNameToBeCalled)
    +			
    +

    + What does this code do? +

    + What about the third parameter, you ask? Well, it is the name of the function that Cuberite calls when the hook fires. It is in this + function that you should handle or cancel the hook. +

    +

    + So in total, this is a working representation of what we have so far covered. +

    +
    +function Initialize(Plugin)
    +	Plugin:SetName("DerpyPlugin")
    +	Plugin:SetVersion(1)
    +
    +	cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_MOVING, OnPlayerMoving)
    +
    +	LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
    +	return true
    +end
    +
    +function OnPlayerMoving(Player) -- See API docs for parameters of all hooks
    +	return true -- Prohibit player movement, see docs for whether a hook is cancellable
    +end
    +			
    +

    + So, that code stops the player from moving. Not particularly helpful, but yes :P. Note that ALL documentation is available + on the main API docs page, so if ever in doubt, go there. +

    +

    Binding a command

    +

    Format

    +

    + So now we know how to hook into Cuberite, how do we bind a command, such as /explode, for a player to type? That is more complicated. + We firstly add this template to the "-- Command bindings" section of the initial example: +

    +
    +-- ADD THIS IF COMMAND DOES NOT REQUIRE A PARAMETER (/explode)
    +cPluginManager.BindCommand("/commandname", "permissionnode", FunctionToCall, " - Description of command")
    +
    +-- ADD THIS IF COMMAND DOES REQUIRE A PARAMETER (/explode Notch)
    +cPluginManager.BindCommand("/commandname", "permissionnode", FunctionToCall, " ~ Description of command and parameter(s)")
    +			
    +

    + What does it do, and why are there two? +

    + The command name is pretty self explanatory. The permission node is basically just a string that the player's group needs to have, so you can have anything in there, + though we recommend a style such as "derpyplugin.explode". The function to call is like the ones with Hooks, but with some fixed parameters which we will come on to later, + and the description is a description of the command which is shown when "/help" is typed. +

    +

    + So why are there two? Standards. A plugin that accepts a parameter MUST use a format for the description of " ~ Description of command and parms" + whereas a command that doesn't accept parameters MUST use " - Description of command" instead. Be sure to put a space before the tildes or dashes. + Additionally, try to keep the description brief and on one line on the client. +

    +

    Parameters

    +

    + What parameters are in the function Cuberite calls when the command is executed? A 'Split' array and a 'Player' object. +

    +

    The Split Array

    +

    + The Split array is an array of all text submitted to the server, including the actual command. Cuberite automatically splits the text into the array, + so plugin authors do not need to worry about that. An example of a Split array passed for the command, "/derp zubby explode" would be:

    +    /derp (Split[1])
    +    zubby (Split[2])
    +    explode (Split[3])
    +
    +    The total amount of parameters passed were: 3 (#Split) +

    +

    The Player Object and sending them messages

    +

    + The Player object is basically a pointer to the player that has executed the command. You can do things with them, but most common is sending + a message. Again, see the API documentation for fuller details. But, you ask, how do we send a message to the client? +

    +

    + There are dedicated functions used for sending a player formatted messages. By format, I refer to coloured prefixes/coloured text (depending on configuration) + that clearly categorise what type of message a player is being sent. For example, an informational message has a yellow coloured [INFO] prefix, and a warning message + has a rose coloured [WARNING] prefix. A few of the most used functions are listed here, but see the API docs for more details. Look in the cRoot, cWorld, and cPlayer sections + for functions that broadcast to the entire server, the whole world, and a single player, respectively. +

    +
    +-- Format: §yellow[INFO] §white%text% (yellow [INFO], white text following it)
    +-- Use: Informational message, such as instructions for usage of a command
    +Player:SendMessageInfo("Usage: /explode [player]")
    +
    +-- Format: §green[INFO] §white%text% (green [INFO] etc.)
    +-- Use: Success message, like when a command executes successfully
    +Player:SendMessageSuccess("Notch was blown up!")
    +
    +-- Format: §rose[INFO] §white%text% (rose coloured [INFO] etc.)
    +-- Use: Failure message, like when a command was entered correctly but failed to run, such as when the destination player wasn't found in a /tp command
    +Player:SendMessageFailure("Player Salted was not found")
    +			
    +

    + Those are the basics. If you want to output text to the player for a reason other than the three listed above, and you want to colour the text, simply concatenate + "cChatColor.*colorhere*" with your desired text, concatenate being "..". See the API docs for more details of all colours, as well as details on logging to console with + LOG("Text"). +

    +

    Final example and conclusion

    +

    + So, a working example that checks the validity of a command, and blows up a player, and also refuses pickup collection to players with >100ms ping. +

    +
    +function Initialize(Plugin)
    +	Plugin:SetName("DerpyPluginThatBlowsPeopleUp")
    +	Plugin:SetVersion(9001)
    +
    +	cPluginManager.BindCommand("/explode", "derpyplugin.explode", Explode, " ~ Explode a player");
    +
    +	cPluginManager:AddHook(cPluginManager.HOOK_COLLECTING_PICKUP, OnCollectingPickup)
    +
    +	LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
    +	return true
    +end
    +
    +function Explode(Split, Player)
    +	if (#Split ~= 2) then
    +		-- There was more or less than one argument (excluding the "/explode" bit)
    +		-- Send the proper usage to the player and exit
    +		Player:SendMessage("Usage: /explode [playername]")
    +		return true
    +	end
    +
    +	-- Create a callback ExplodePlayer with parameter Explodee, which Cuberite calls for every player on the server
    +	local HasExploded = false
    +	local ExplodePlayer = function(Explodee)
    +		-- If the player we are currently at is the one we specified as the parameter
    +		if (Explodee:GetName() == Split[2]) then
    +			-- Create an explosion at the same position as they are; see API docs for further details of this function
    +			Player:GetWorld():DoExplosionAt(Explodee:GetPosX(), Explodee:GetPosY(), Explodee:GetPosZ(), false, esPlugin)
    +			Player:SendMessageSuccess(Split[2] .. " was successfully exploded")
    +			HasExploded = true;
    +			return true -- Signalize to Cuberite that we do not need to call this callback for any more players
    +		end
    +	end
    +
    +	-- Tell Cuberite to loop through all players and call the callback above with the Player object it has found
    +	cRoot:Get():FindAndDoWithPlayer(Split[2], ExplodePlayer)
    +
    +	if not(HasExploded) then
    +		-- We have not broken out so far, therefore, the player must not exist, send failure
    +		Player:SendMessageFailure(Split[2] .. " was not found")
    +	end
    +
    +	return true
    +end
    +
    +function OnCollectingPickup(Player, Pickup) -- Again, see the API docs for parameters of all hooks. In this case, it is a Player and Pickup object
    +	if (Player:GetClientHandle():GetPing() > 100) then -- Get ping of player, in milliseconds
    +		return true -- Discriminate against high latency - you don't get drops :D
    +	else
    +		return false -- You do get the drops! Yay~
    +	end
    +end
    +			
    +

    + Make sure to read the comments for a description of what everything does. Also be sure to return true for all command handlers, unless you want Cuberite to print out an "Unknown command" message + when the command gets executed :P. Make sure to follow standards - use CoreMessaging.lua functions for messaging, dashes for no parameter commands and tildes for vice versa, + and finally, the API documentation is your friend! +

    +

    + Happy coding ;) +

    + + +
    + + diff --git a/Server/Plugins/APIDump/lang-lua.js b/Server/Plugins/APIDump/lang-lua.js new file mode 100644 index 000000000..7e44cca0a --- /dev/null +++ b/Server/Plugins/APIDump/lang-lua.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], +["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); diff --git a/Server/Plugins/APIDump/main.css b/Server/Plugins/APIDump/main.css new file mode 100644 index 000000000..e5685caab --- /dev/null +++ b/Server/Plugins/APIDump/main.css @@ -0,0 +1,68 @@ +html +{ + background-color: #C0C0C0; +} + +table +{ + background-color: #fff; + border-spacing: 0px; + border-collapse: collapse; + border-color: gray; +} + +tr +{ + display: table-row; + vertical-align: inherit; + border-color: inherit; +} + +td, th +{ + display: table-cell; + vertical-align: inherit; + padding: 3px; + border: 1px solid #ccc; +} + +pre +{ + border: 1px solid #ccc; + background-color: #eee; + -moz-tab-size: 2; + -o-tab-size: 2; + -webkit-tab-size: 2; + -ms-tab-size: 2; + tab-size: 2; +} + +body +{ + min-width: 400px; + max-width: 1200px; + width: 95%; + margin: 10px auto; + background-color: white; + border: 4px #FF8C00 solid; + border-radius: 20px; + font-family: Calibri, Trebuchet MS; +} + +header +{ + text-align: center; + font-family: Segoe UI Light, Helvetica; +} + +footer +{ + text-align: center; + font-family: Segoe UI Light, Helvetica; +} + +#content, #timestamp +{ + padding: 0px 25px 25px 25px; +} + diff --git a/Server/Plugins/APIDump/main_APIDump.lua b/Server/Plugins/APIDump/main_APIDump.lua new file mode 100644 index 000000000..4892d477d --- /dev/null +++ b/Server/Plugins/APIDump/main_APIDump.lua @@ -0,0 +1,1685 @@ +-- main.lua + +-- Implements the plugin entrypoint (in this case the entire plugin) + + + + + +-- Global variables: +local g_Plugin = nil +local g_PluginFolder = "" +local g_Stats = {} +local g_TrackedPages = {} + + + + + + +local function LoadAPIFiles(a_Folder, a_DstTable) + assert(type(a_Folder) == "string") + assert(type(a_DstTable) == "table") + + local Folder = g_PluginFolder .. a_Folder; + for _, fnam in ipairs(cFile:GetFolderContents(Folder)) do + local FileName = Folder .. fnam; + -- We only want .lua files from the folder: + if (cFile:IsFile(FileName) and fnam:match(".*%.lua$")) then + local TablesFn, Err = loadfile(FileName); + if (type(TablesFn) ~= "function") then + LOGWARNING("Cannot load API descriptions from " .. FileName .. ", Lua error '" .. Err .. "'."); + else + local Tables = TablesFn(); + if (type(Tables) ~= "table") then + LOGWARNING("Cannot load API descriptions from " .. FileName .. ", returned object is not a table (" .. type(Tables) .. ")."); + break + end + for k, cls in pairs(Tables) do + a_DstTable[k] = cls; + end + end -- if (TablesFn) + end -- if (is lua file) + end -- for fnam - Folder[] +end + + + + + +local function CreateAPITables() + --[[ + We want an API table of the following shape: + local API = { + { + Name = "cCuboid", + Functions = { + {Name = "Sort"}, + {Name = "IsInside"} + }, + Constants = { + }, + Variables = { + }, + Descendants = {}, -- Will be filled by ReadDescriptions(), array of class APIs (references to other member in the tree) + }, + { + Name = "cBlockArea", + Functions = { + {Name = "Clear"}, + {Name = "CopyFrom"}, + ... + }, + Constants = { + {Name = "baTypes", Value = 0}, + {Name = "baMetas", Value = 1}, + ... + }, + Variables = { + }, + ... + }, + + cCuboid = {} -- Each array item also has the map item by its name + }; + local Globals = { + Functions = { + ... + }, + Constants = { + ... + } + }; + --]] + + local Globals = {Functions = {}, Constants = {}, Variables = {}, Descendants = {}}; + local API = {}; + + local function Add(a_APIContainer, a_ObjName, a_ObjValue) + if (type(a_ObjValue) == "function") then + table.insert(a_APIContainer.Functions, {Name = a_ObjName}); + elseif ( + (type(a_ObjValue) == "number") or + (type(a_ObjValue) == "string") + ) then + table.insert(a_APIContainer.Constants, {Name = a_ObjName, Value = a_ObjValue}); + end + end + + local function ParseClass(a_ClassName, a_ClassObj) + local res = {Name = a_ClassName, Functions = {}, Constants = {}, Variables = {}, Descendants = {}}; + -- Add functions and constants: + for i, v in pairs(a_ClassObj) do + Add(res, i, v); + end + + -- Member variables: + local SetField = a_ClassObj[".set"] or {}; + if ((a_ClassObj[".get"] ~= nil) and (type(a_ClassObj[".get"]) == "table")) then + for k in pairs(a_ClassObj[".get"]) do + if (SetField[k] == nil) then + -- It is a read-only variable, add it as a constant: + table.insert(res.Constants, {Name = k, Value = ""}); + else + -- It is a read-write variable, add it as a variable: + table.insert(res.Variables, { Name = k }); + end + end + end + return res; + end + + for i, v in pairs(_G) do + if ( + (v ~= _G) and -- don't want the global namespace + (v ~= _G.packages) and -- don't want any packages + (v ~= _G[".get"]) and + (v ~= g_APIDesc) + ) then + if (type(v) == "table") then + local cls = ParseClass(i, v) + table.insert(API, cls); + API[cls.Name] = cls + else + Add(Globals, i, v); + end + end + end + + return API, Globals; +end + + + + + +--- Returns the timestamp in HTML format +-- The timestamp will be inserted to all generated HTML files +local function GetHtmlTimestamp() + return string.format("
    Generated on %s, Build ID %s, Commit %s
    ", + os.date("%Y-%m-%d %H:%M:%S"), + cRoot:GetBuildID(), cRoot:GetBuildCommitID() + ) +end + + + + + +local function WriteArticles(f) + f:write([[ +

    Articles

    +

    The following articles provide various extra information on plugin development

    +
    "); +end + + + + + +-- Make a link out of anything with the special linkifying syntax {{link|title}} +local function LinkifyString(a_String, a_Referrer) + assert(a_Referrer ~= nil); + assert(a_Referrer ~= ""); + + --- Adds a page to the list of tracked pages (to be checked for existence at the end) + local function AddTrackedPage(a_PageName) + local Pg = (g_TrackedPages[a_PageName] or {}); + table.insert(Pg, a_Referrer); + g_TrackedPages[a_PageName] = Pg; + end + + --- Creates the HTML for the specified link and title + local function CreateLink(Link, Title) + if (Link:sub(1, 7) == "http://") then + -- The link is a full absolute URL, do not modify, do not track: + return "" .. Title .. ""; + end + local idxHash = Link:find("#"); + if (idxHash ~= nil) then + -- The link contains an anchor: + if (idxHash == 1) then + -- Anchor in the current page, no need to track: + return "" .. Title .. ""; + end + -- Anchor in another page: + local PageName = Link:sub(1, idxHash - 1); + AddTrackedPage(PageName); + return "" .. Title .. ""; + end + -- Link without anchor: + AddTrackedPage(Link); + return "" .. Title .. ""; + end + + -- Linkify the strings using the CreateLink() function: + local txt = a_String:gsub("{{([^|}]*)|([^}]*)}}", CreateLink) -- {{link|title}} + txt = txt:gsub("{{([^|}]*)}}", -- {{LinkAndTitle}} + function(LinkAndTitle) + local idxHash = LinkAndTitle:find("#"); + if (idxHash ~= nil) then + -- The LinkAndTitle contains a hash, remove the hashed part from the title: + return CreateLink(LinkAndTitle, LinkAndTitle:sub(1, idxHash - 1)); + end + return CreateLink(LinkAndTitle, LinkAndTitle); + end + ); + return txt; +end + + + + + +local function WriteHtmlHook(a_Hook, a_HookNav) + local fnam = "API/" .. a_Hook.DefaultFnName .. ".html"; + local f, error = io.open(fnam, "w"); + if (f == nil) then + LOG("Cannot write \"" .. fnam .. "\": \"" .. error .. "\"."); + return; + end + local HookName = a_Hook.DefaultFnName; + + f:write([[ + + Cuberite API - ]], HookName, [[ Hook + + + + + + +
    +
    +

    ]], a_Hook.Name, [[

    +
    +
    +
    + Index:
    + Articles
    + Classes
    + Hooks
    +
    + Quick navigation:
    + ]]); + f:write(a_HookNav); + f:write([[ +

    + ]]); + f:write(LinkifyString(a_Hook.Desc, HookName)); + f:write("

    \n

    Callback function

    \n

    The default name for the callback function is "); + f:write(a_Hook.DefaultFnName, ". It has the following signature:\n"); + f:write("

    function ", HookName, "(");
    +	if (a_Hook.Params == nil) then
    +		a_Hook.Params = {};
    +	end
    +	for i, param in ipairs(a_Hook.Params) do
    +		if (i > 1) then
    +			f:write(", ");
    +		end
    +		f:write(param.Name);
    +	end
    +	f:write(")
    \n

    Parameters:

    \n\n"); + for _, param in ipairs(a_Hook.Params) do + f:write("\n"); + end + f:write("
    NameTypeNotes
    ", param.Name, "", LinkifyString(param.Type, HookName), "", LinkifyString(param.Notes, HookName), "
    \n

    " .. LinkifyString(a_Hook.Returns or "", HookName) .. "

    \n\n"); + f:write([[

    Code examples

    Registering the callback

    ]]); + f:write("
    \n");
    +	f:write([[cPluginManager:AddHook(cPluginManager.]] .. a_Hook.Name .. ", My" .. a_Hook.DefaultFnName .. [[);]]);
    +	f:write("
    \n\n"); + local Examples = a_Hook.CodeExamples or {}; + for _, example in ipairs(Examples) do + f:write("

    ", (example.Title or "missing Title"), "

    \n"); + f:write("

    ", (example.Desc or "missing Desc"), "

    \n"); + f:write("
    ", (example.Code or "missing Code"), "\n
    \n\n"); + end + f:write([[
    ]]) + f:write(GetHtmlTimestamp()) + f:write([[]]) + f:close(); +end + + + + + +local function WriteHooks(f, a_Hooks, a_UndocumentedHooks, a_HookNav) + f:write([[ +

    Hooks

    +

    + A plugin can register to be called whenever an "interesting event" occurs. It does so by calling + cPluginManager's AddHook() function and implementing a callback + function to handle the event.

    +

    + A plugin can decide whether it will let the event pass through to the rest of the plugins, or hide it + from them. This is determined by the return value from the hook callback function. If the function + returns false or no value, the event is propagated further. If the function returns true, the processing + is stopped, no other plugin receives the notification (and possibly Cuberite disables the default + behavior for the event). See each hook's details to see the exact behavior.

    + + + + + + ]]); + for _, hook in ipairs(a_Hooks) do + if (hook.DefaultFnName == nil) then + -- The hook is not documented yet + f:write(" \n \n \n \n"); + table.insert(a_UndocumentedHooks, hook.Name); + else + f:write(" \n \n \n \n"); + WriteHtmlHook(hook, a_HookNav); + end + end + f:write([[ +
    Hook nameCalled when
    " .. hook.Name .. "(No documentation yet)
    " .. hook.Name .. "" .. LinkifyString(hook.CalledWhen, hook.Name) .. "
    +
    + ]]); +end + + + + + +local function ReadDescriptions(a_API) + -- Returns true if the class of the specified name is to be ignored + local function IsClassIgnored(a_ClsName) + if (g_APIDesc.IgnoreClasses == nil) then + return false; + end + for _, name in ipairs(g_APIDesc.IgnoreClasses) do + if (a_ClsName:match(name)) then + return true; + end + end + return false; + end + + -- Returns true if the function is to be ignored + local function IsFunctionIgnored(a_ClassName, a_FnName) + if (g_APIDesc.IgnoreFunctions == nil) then + return false; + end + if (((g_APIDesc.Classes[a_ClassName] or {}).Functions or {})[a_FnName] ~= nil) then + -- The function is documented, don't ignore + return false; + end + local FnName = a_ClassName .. "." .. a_FnName; + for _, name in ipairs(g_APIDesc.IgnoreFunctions) do + if (FnName:match(name)) then + return true; + end + end + return false; + end + + -- Returns true if the constant (specified by its fully qualified name) is to be ignored + local function IsConstantIgnored(a_CnName) + if (g_APIDesc.IgnoreConstants == nil) then + return false; + end; + for _, name in ipairs(g_APIDesc.IgnoreConstants) do + if (a_CnName:match(name)) then + return true; + end + end + return false; + end + + -- Returns true if the member variable (specified by its fully qualified name) is to be ignored + local function IsVariableIgnored(a_VarName) + if (g_APIDesc.IgnoreVariables == nil) then + return false; + end; + for _, name in ipairs(g_APIDesc.IgnoreVariables) do + if (a_VarName:match(name)) then + return true; + end + end + return false; + end + + -- Remove ignored classes from a_API: + local APICopy = {}; + for _, cls in ipairs(a_API) do + if not(IsClassIgnored(cls.Name)) then + table.insert(APICopy, cls); + end + end + for i = 1, #a_API do + a_API[i] = APICopy[i]; + end; + + -- Process the documentation for each class: + for _, cls in ipairs(a_API) do + -- Initialize default values for each class: + cls.ConstantGroups = {}; + cls.NumConstantsInGroups = 0; + cls.NumConstantsInGroupsForDescendants = 0; + + -- Rename special functions: + for _, fn in ipairs(cls.Functions) do + if (fn.Name == ".call") then + fn.DocID = "constructor"; + fn.Name = "() (constructor)"; + elseif (fn.Name == ".add") then + fn.DocID = "operator_plus"; + fn.Name = "operator +"; + elseif (fn.Name == ".div") then + fn.DocID = "operator_div"; + fn.Name = "operator /"; + elseif (fn.Name == ".mul") then + fn.DocID = "operator_mul"; + fn.Name = "operator *"; + elseif (fn.Name == ".sub") then + fn.DocID = "operator_sub"; + fn.Name = "operator -"; + elseif (fn.Name == ".eq") then + fn.DocID = "operator_eq"; + fn.Name = "operator =="; + end + end + + local APIDesc = g_APIDesc.Classes[cls.Name]; + if (APIDesc ~= nil) then + APIDesc.IsExported = true; + cls.Desc = APIDesc.Desc; + cls.AdditionalInfo = APIDesc.AdditionalInfo; + + -- Process inheritance: + if (APIDesc.Inherits ~= nil) then + for _, icls in ipairs(a_API) do + if (icls.Name == APIDesc.Inherits) then + table.insert(icls.Descendants, cls); + cls.Inherits = icls; + end + end + end + + cls.UndocumentedFunctions = {}; -- This will contain names of all the functions that are not documented + cls.UndocumentedConstants = {}; -- This will contain names of all the constants that are not documented + cls.UndocumentedVariables = {}; -- This will contain names of all the variables that are not documented + + local DoxyFunctions = {}; -- This will contain all the API functions together with their documentation + + local function AddFunction(a_Name, a_Params, a_Return, a_Notes) + table.insert(DoxyFunctions, {Name = a_Name, Params = a_Params, Return = a_Return, Notes = a_Notes}); + end + + if (APIDesc.Functions ~= nil) then + -- Assign function descriptions: + for _, func in ipairs(cls.Functions) do + local FnName = func.DocID or func.Name; + local FnDesc = APIDesc.Functions[FnName]; + if (FnDesc == nil) then + -- No description for this API function + AddFunction(func.Name); + if not(IsFunctionIgnored(cls.Name, FnName)) then + table.insert(cls.UndocumentedFunctions, FnName); + end + else + -- Description is available + if (FnDesc[1] == nil) then + -- Single function definition + AddFunction(func.Name, FnDesc.Params, FnDesc.Return, FnDesc.Notes); + else + -- Multiple function overloads + for _, desc in ipairs(FnDesc) do + AddFunction(func.Name, desc.Params, desc.Return, desc.Notes); + end -- for k, desc - FnDesc[] + end + FnDesc.IsExported = true; + end + end -- for j, func + + -- Replace functions with their described and overload-expanded versions: + cls.Functions = DoxyFunctions; + else -- if (APIDesc.Functions ~= nil) + for _, func in ipairs(cls.Functions) do + local FnName = func.DocID or func.Name; + if not(IsFunctionIgnored(cls.Name, FnName)) then + table.insert(cls.UndocumentedFunctions, FnName); + end + end + end -- if (APIDesc.Functions ~= nil) + + if (APIDesc.Constants ~= nil) then + -- Assign constant descriptions: + for _, cons in ipairs(cls.Constants) do + local CnDesc = APIDesc.Constants[cons.Name]; + if (CnDesc == nil) then + -- Not documented + if not(IsConstantIgnored(cls.Name .. "." .. cons.Name)) then + table.insert(cls.UndocumentedConstants, cons.Name); + end + else + cons.Notes = CnDesc.Notes; + CnDesc.IsExported = true; + end + end -- for j, cons + else -- if (APIDesc.Constants ~= nil) + for _, cons in ipairs(cls.Constants) do + if not(IsConstantIgnored(cls.Name .. "." .. cons.Name)) then + table.insert(cls.UndocumentedConstants, cons.Name); + end + end + end -- else if (APIDesc.Constants ~= nil) + + -- Assign member variables' descriptions: + if (APIDesc.Variables ~= nil) then + for _, var in ipairs(cls.Variables) do + local VarDesc = APIDesc.Variables[var.Name]; + if (VarDesc == nil) then + -- Not documented + if not(IsVariableIgnored(cls.Name .. "." .. var.Name)) then + table.insert(cls.UndocumentedVariables, var.Name); + end + else + -- Copy all documentation: + for k, v in pairs(VarDesc) do + var[k] = v + end + end + end -- for j, var + else -- if (APIDesc.Variables ~= nil) + for _, var in ipairs(cls.Variables) do + if not(IsVariableIgnored(cls.Name .. "." .. var.Name)) then + table.insert(cls.UndocumentedVariables, var.Name); + end + end + end -- else if (APIDesc.Variables ~= nil) + + if (APIDesc.ConstantGroups ~= nil) then + -- Create links between the constants and the groups: + local NumInGroups = 0; + local NumInDescendantGroups = 0; + for j, group in pairs(APIDesc.ConstantGroups) do + group.Name = j; + group.Constants = {}; + if (type(group.Include) == "string") then + group.Include = { group.Include }; + end + local NumInGroup = 0; + for _, incl in ipairs(group.Include or {}) do + for _, cons in ipairs(cls.Constants) do + if ((cons.Group == nil) and cons.Name:match(incl)) then + cons.Group = group; + table.insert(group.Constants, cons); + NumInGroup = NumInGroup + 1; + end + end -- for cidx - cls.Constants[] + end -- for idx - group.Include[] + NumInGroups = NumInGroups + NumInGroup; + if (group.ShowInDescendants) then + NumInDescendantGroups = NumInDescendantGroups + NumInGroup; + end + + -- Sort the constants: + table.sort(group.Constants, + function(c1, c2) + return (c1.Name < c2.Name); + end + ); + end -- for j - APIDesc.ConstantGroups[] + cls.ConstantGroups = APIDesc.ConstantGroups; + cls.NumConstantsInGroups = NumInGroups; + cls.NumConstantsInGroupsForDescendants = NumInDescendantGroups; + + -- Remove grouped constants from the normal list: + local NewConstants = {}; + for _, cons in ipairs(cls.Constants) do + if (cons.Group == nil) then + table.insert(NewConstants, cons); + end + end + cls.Constants = NewConstants; + end -- if (ConstantGroups ~= nil) + + else -- if (APIDesc ~= nil) + + -- Class is not documented at all, add all its members to Undocumented lists: + cls.UndocumentedFunctions = {}; + cls.UndocumentedConstants = {}; + cls.UndocumentedVariables = {}; + cls.Variables = cls.Variables or {}; + g_Stats.NumUndocumentedClasses = g_Stats.NumUndocumentedClasses + 1; + for _, func in ipairs(cls.Functions) do + local FnName = func.DocID or func.Name; + if not(IsFunctionIgnored(cls.Name, FnName)) then + table.insert(cls.UndocumentedFunctions, FnName); + end + end -- for j, func - cls.Functions[] + for _, cons in ipairs(cls.Constants) do + if not(IsConstantIgnored(cls.Name .. "." .. cons.Name)) then + table.insert(cls.UndocumentedConstants, cons.Name); + end + end -- for j, cons - cls.Constants[] + for _, var in ipairs(cls.Variables) do + if not(IsConstantIgnored(cls.Name .. "." .. var.Name)) then + table.insert(cls.UndocumentedVariables, var.Name); + end + end -- for j, var - cls.Variables[] + end -- else if (APIDesc ~= nil) + + -- Remove ignored functions: + local NewFunctions = {}; + for _, fn in ipairs(cls.Functions) do + if (not(IsFunctionIgnored(cls.Name, fn.Name))) then + table.insert(NewFunctions, fn); + end + end -- for j, fn + cls.Functions = NewFunctions; + + -- Sort the functions (they may have been renamed): + table.sort(cls.Functions, + function(f1, f2) + if (f1.Name == f2.Name) then + -- Same name, either comparing the same function to itself, or two overloads, in which case compare the params + if ((f1.Params == nil) or (f2.Params == nil)) then + return 0; + end + return (f1.Params < f2.Params); + end + return (f1.Name < f2.Name); + end + ); + + -- Remove ignored constants: + local NewConstants = {}; + for _, cn in ipairs(cls.Constants) do + if (not(IsFunctionIgnored(cls.Name, cn.Name))) then + table.insert(NewConstants, cn); + end + end -- for j, cn + cls.Constants = NewConstants; + + -- Sort the constants: + table.sort(cls.Constants, + function(c1, c2) + return (c1.Name < c2.Name); + end + ); + + -- Remove ignored member variables: + local NewVariables = {}; + for _, var in ipairs(cls.Variables) do + if (not(IsVariableIgnored(cls.Name .. "." .. var.Name))) then + table.insert(NewVariables, var); + end + end -- for j, var + cls.Variables = NewVariables; + + -- Sort the member variables: + table.sort(cls.Variables, + function(v1, v2) + return (v1.Name < v2.Name); + end + ); + end -- for i, cls + + -- Sort the descendants lists: + for _, cls in ipairs(a_API) do + table.sort(cls.Descendants, + function(c1, c2) + return (c1.Name < c2.Name); + end + ); + end -- for i, cls +end + + + + + +local function ReadHooks(a_Hooks) + --[[ + a_Hooks = { + { Name = "HOOK_1"}, + { Name = "HOOK_2"}, + ... + }; + We want to add hook descriptions to each hook in this array + --]] + for _, hook in ipairs(a_Hooks) do + local HookDesc = g_APIDesc.Hooks[hook.Name]; + if (HookDesc ~= nil) then + for key, val in pairs(HookDesc) do + hook[key] = val; + end + end + end -- for i, hook - a_Hooks[] + g_Stats.NumTotalHooks = #a_Hooks; +end + + + + + +local function WriteHtmlClass(a_ClassAPI, a_ClassMenu) + local cf, err = io.open("API/" .. a_ClassAPI.Name .. ".html", "w"); + if (cf == nil) then + LOGINFO("Cannot write HTML API for class " .. a_ClassAPI.Name .. ": " .. err) + return; + end + + -- Writes a table containing all functions in the specified list, with an optional "inherited from" header when a_InheritedName is valid + local function WriteFunctions(a_Functions, a_InheritedName) + if (#a_Functions == 0) then + return; + end + + if (a_InheritedName ~= nil) then + cf:write("

    Functions inherited from ", a_InheritedName, "

    \n"); + end + cf:write("\n\n"); + for _, func in ipairs(a_Functions) do + cf:write("\n"); + cf:write("\n"); + cf:write("\n"); + cf:write("\n"); + end + cf:write("
    NameParametersReturn valueNotes
    ", func.Name, "", LinkifyString(func.Params or "", (a_InheritedName or a_ClassAPI.Name)), "", LinkifyString(func.Return or "", (a_InheritedName or a_ClassAPI.Name)), "", LinkifyString(func.Notes or "(undocumented)", (a_InheritedName or a_ClassAPI.Name)), "
    \n"); + end + + local function WriteConstantTable(a_Constants, a_Source) + cf:write("\n\n"); + for _, cons in ipairs(a_Constants) do + cf:write("\n"); + cf:write("\n"); + cf:write("\n"); + end + cf:write("
    NameValueNotes
    ", cons.Name, "", cons.Value, "", LinkifyString(cons.Notes or "", a_Source), "
    \n\n"); + end + + local function WriteConstants(a_Constants, a_ConstantGroups, a_NumConstantGroups, a_InheritedName) + if ((#a_Constants == 0) and (a_NumConstantGroups == 0)) then + return; + end + + local Source = a_ClassAPI.Name + if (a_InheritedName ~= nil) then + cf:write("

    Constants inherited from ", a_InheritedName, "

    \n"); + Source = a_InheritedName; + end + + if (#a_Constants > 0) then + WriteConstantTable(a_Constants, Source); + end + + for _, group in pairs(a_ConstantGroups) do + if ((a_InheritedName == nil) or group.ShowInDescendants) then + cf:write("

    "); + cf:write(LinkifyString(group.TextBefore or "", Source)); + WriteConstantTable(group.Constants, a_InheritedName or a_ClassAPI.Name); + cf:write(LinkifyString(group.TextAfter or "", Source), "

    "); + end + end + end + + local function WriteVariables(a_Variables, a_InheritedName) + if (#a_Variables == 0) then + return; + end + + if (a_InheritedName ~= nil) then + cf:write("

    Member variables inherited from ", a_InheritedName, "

    \n"); + end + + cf:write("\n"); + for _, var in ipairs(a_Variables) do + cf:write("\n"); + cf:write("\n"); + cf:write("\n \n"); + end + cf:write("
    NameTypeNotes
    ", var.Name, "", LinkifyString(var.Type or "(undocumented)", a_InheritedName or a_ClassAPI.Name), "", LinkifyString(var.Notes or "", a_InheritedName or a_ClassAPI.Name), "
    \n\n"); + end + + local function WriteDescendants(a_Descendants) + if (#a_Descendants == 0) then + return; + end + cf:write("\n"); + end + + local ClassName = a_ClassAPI.Name; + + -- Build an array of inherited classes chain: + local InheritanceChain = {}; + local CurrInheritance = a_ClassAPI.Inherits; + while (CurrInheritance ~= nil) do + table.insert(InheritanceChain, CurrInheritance); + CurrInheritance = CurrInheritance.Inherits; + end + + cf:write([[ + + Cuberite API - ]], a_ClassAPI.Name, [[ Class + + + + + + +
    +
    +

    ]], a_ClassAPI.Name, [[

    +
    +
    +
    + Index:
    + Articles
    + Classes
    + Hooks
    +
    + Quick navigation:
    + ]]); + cf:write(a_ClassMenu); + cf:write([[ +

    Contents

    +

      + ]]); + + local HasInheritance = ((#a_ClassAPI.Descendants > 0) or (a_ClassAPI.Inherits ~= nil)); + + local HasConstants = (#a_ClassAPI.Constants > 0) or (a_ClassAPI.NumConstantsInGroups > 0); + local HasFunctions = (#a_ClassAPI.Functions > 0); + local HasVariables = (#a_ClassAPI.Variables > 0); + for _, cls in ipairs(InheritanceChain) do + HasConstants = HasConstants or (#cls.Constants > 0) or (cls.NumConstantsInGroupsForDescendants > 0); + HasFunctions = HasFunctions or (#cls.Functions > 0); + HasVariables = HasVariables or (#cls.Variables > 0); + end + + -- Write the table of contents: + if (HasInheritance) then + cf:write("
    • Inheritance
    • \n"); + end + if (HasConstants) then + cf:write("
    • Constants
    • \n"); + end + if (HasVariables) then + cf:write("
    • Member variables
    • \n"); + end + if (HasFunctions) then + cf:write("
    • Functions
    • \n"); + end + if (a_ClassAPI.AdditionalInfo ~= nil) then + for i, additional in ipairs(a_ClassAPI.AdditionalInfo) do + cf:write("
    • ", (additional.Header or "(No header)"), "
    • \n"); + end + end + cf:write("

    \n"); + + -- Write the class description: + cf:write("

    ", ClassName, " class

    \n"); + if (a_ClassAPI.Desc ~= nil) then + cf:write("

    "); + cf:write(LinkifyString(a_ClassAPI.Desc, ClassName)); + cf:write("

    \n\n"); + end; + + -- Write the inheritance, if available: + if (HasInheritance) then + cf:write("

    Inheritance

    \n"); + if (#InheritanceChain > 0) then + cf:write("

    This class inherits from the following parent classes:

      \n"); + for _, cls in ipairs(InheritanceChain) do + cf:write("
    • ", cls.Name, "
    • \n"); + end + cf:write("

    \n"); + end + if (#a_ClassAPI.Descendants > 0) then + cf:write("

    This class has the following descendants:\n"); + WriteDescendants(a_ClassAPI.Descendants); + cf:write("

    \n\n"); + end + end + + -- Write the constants: + if (HasConstants) then + cf:write("

    Constants

    \n"); + WriteConstants(a_ClassAPI.Constants, a_ClassAPI.ConstantGroups, a_ClassAPI.NumConstantsInGroups, nil); + g_Stats.NumTotalConstants = g_Stats.NumTotalConstants + #a_ClassAPI.Constants + (a_ClassAPI.NumConstantsInGroups or 0); + for _, cls in ipairs(InheritanceChain) do + WriteConstants(cls.Constants, cls.ConstantGroups, cls.NumConstantsInGroupsForDescendants, cls.Name); + end; + end; + + -- Write the member variables: + if (HasVariables) then + cf:write("

    Member variables

    \n"); + WriteVariables(a_ClassAPI.Variables, nil); + g_Stats.NumTotalVariables = g_Stats.NumTotalVariables + #a_ClassAPI.Variables; + for _, cls in ipairs(InheritanceChain) do + WriteVariables(cls.Variables, cls.Name); + end; + end + + -- Write the functions, including the inherited ones: + if (HasFunctions) then + cf:write("

    Functions

    \n"); + WriteFunctions(a_ClassAPI.Functions, nil); + g_Stats.NumTotalFunctions = g_Stats.NumTotalFunctions + #a_ClassAPI.Functions; + for _, cls in ipairs(InheritanceChain) do + WriteFunctions(cls.Functions, cls.Name); + end + end + + -- Write the additional infos: + if (a_ClassAPI.AdditionalInfo ~= nil) then + for i, additional in ipairs(a_ClassAPI.AdditionalInfo) do + cf:write("

    ", additional.Header, "

    \n"); + cf:write(LinkifyString(additional.Contents, ClassName)); + end + end + + cf:write([[
    ]]) + cf:write(GetHtmlTimestamp()) + cf:write([[]]) + cf:close() +end + + + + + +local function WriteClasses(f, a_API, a_ClassMenu) + f:write([[ +

    Class index

    +

    The following classes are available in the Cuberite Lua scripting language: +

    +
    + ]]); +end + + + + + +--- Writes a list of undocumented objects into a file +local function ListUndocumentedObjects(API, UndocumentedHooks) + local f = io.open("API/_undocumented.lua", "w"); + if (f ~= nil) then + f:write("\n-- This is the list of undocumented API objects, automatically generated by APIDump\n\n"); + f:write("g_APIDesc =\n{\n\tClasses =\n\t{\n"); + for _, cls in ipairs(API) do + local HasFunctions = ((cls.UndocumentedFunctions ~= nil) and (#cls.UndocumentedFunctions > 0)); + local HasConstants = ((cls.UndocumentedConstants ~= nil) and (#cls.UndocumentedConstants > 0)); + local HasVariables = ((cls.UndocumentedVariables ~= nil) and (#cls.UndocumentedVariables > 0)); + g_Stats.NumUndocumentedFunctions = g_Stats.NumUndocumentedFunctions + #cls.UndocumentedFunctions; + g_Stats.NumUndocumentedConstants = g_Stats.NumUndocumentedConstants + #cls.UndocumentedConstants; + g_Stats.NumUndocumentedVariables = g_Stats.NumUndocumentedVariables + #cls.UndocumentedVariables; + if (HasFunctions or HasConstants or HasVariables) then + f:write("\t\t" .. cls.Name .. " =\n\t\t{\n"); + if ((cls.Desc == nil) or (cls.Desc == "")) then + f:write("\t\t\tDesc = \"\"\n"); + end + end + + if (HasFunctions) then + f:write("\t\t\tFunctions =\n\t\t\t{\n"); + table.sort(cls.UndocumentedFunctions); + for _, fn in ipairs(cls.UndocumentedFunctions) do + f:write("\t\t\t\t" .. fn .. " = { Params = \"\", Return = \"\", Notes = \"\" },\n"); + end -- for j, fn - cls.UndocumentedFunctions[] + f:write("\t\t\t},\n\n"); + end + + if (HasConstants) then + f:write("\t\t\tConstants =\n\t\t\t{\n"); + table.sort(cls.UndocumentedConstants); + for _, cn in ipairs(cls.UndocumentedConstants) do + f:write("\t\t\t\t" .. cn .. " = { Notes = \"\" },\n"); + end -- for j, fn - cls.UndocumentedConstants[] + f:write("\t\t\t},\n\n"); + end + + if (HasVariables) then + f:write("\t\t\tVariables =\n\t\t\t{\n"); + table.sort(cls.UndocumentedVariables); + for _, vn in ipairs(cls.UndocumentedVariables) do + f:write("\t\t\t\t" .. vn .. " = { Type = \"\", Notes = \"\" },\n"); + end -- for j, fn - cls.UndocumentedVariables[] + f:write("\t\t\t},\n\n"); + end + + if (HasFunctions or HasConstants or HasVariables) then + f:write("\t\t},\n\n"); + end + end -- for i, cls - API[] + f:write("\t},\n"); + + if (#UndocumentedHooks > 0) then + f:write("\n\tHooks =\n\t{\n"); + for i, hook in ipairs(UndocumentedHooks) do + if (i > 1) then + f:write("\n"); + end + f:write("\t\t" .. hook .. " =\n\t\t{\n"); + f:write("\t\t\tCalledWhen = \"\",\n"); + f:write("\t\t\tDefaultFnName = \"On\", -- also used as pagename\n"); + f:write("\t\t\tDesc = [[\n\t\t\t\t\n\t\t\t]],\n"); + f:write("\t\t\tParams =\n\t\t\t{\n"); + f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n"); + f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n"); + f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n"); + f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n"); + f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n"); + f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n"); + f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n"); + f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n"); + f:write("\t\t\t},\n"); + f:write("\t\t\tReturns = [[\n\t\t\t\t\n\t\t\t]],\n"); + f:write("\t\t}, -- " .. hook .. "\n"); + end + f:write("\t},\n"); + end + f:write("}\n\n\n\n"); + f:close(); + end + g_Stats.NumUndocumentedHooks = #UndocumentedHooks; +end + + + + + +--- Lists the API objects that are documented but not available in the API: +local function ListUnexportedObjects() + f = io.open("API/_unexported-documented.txt", "w"); + if (f ~= nil) then + for clsname, cls in pairs(g_APIDesc.Classes) do + if not(cls.IsExported) then + -- The whole class is not exported + f:write("class\t" .. clsname .. "\n"); + else + if (cls.Functions ~= nil) then + for fnname, fnapi in pairs(cls.Functions) do + if not(fnapi.IsExported) then + f:write("func\t" .. clsname .. "." .. fnname .. "\n"); + end + end -- for j, fn - cls.Functions[] + end + if (cls.Constants ~= nil) then + for cnname, cnapi in pairs(cls.Constants) do + if not(cnapi.IsExported) then + f:write("const\t" .. clsname .. "." .. cnname .. "\n"); + end + end -- for j, fn - cls.Functions[] + end + end + end -- for i, cls - g_APIDesc.Classes[] + f:close(); + end +end + + + + + +local function ListMissingPages() + local MissingPages = {}; + local NumLinks = 0; + for PageName, Referrers in pairs(g_TrackedPages) do + NumLinks = NumLinks + 1; + if not(cFile:Exists("API/" .. PageName .. ".html")) then + table.insert(MissingPages, {Name = PageName, Refs = Referrers} ); + end + end; + g_Stats.NumTrackedLinks = NumLinks; + g_TrackedPages = {}; + + if (#MissingPages == 0) then + -- No missing pages, congratulations! + return; + end + + -- Sort the pages by name: + table.sort(MissingPages, + function (Page1, Page2) + return (Page1.Name < Page2.Name); + end + ); + + -- Output the pages: + local f, err = io.open("API/_missingPages.txt", "w"); + if (f == nil) then + LOGWARNING("Cannot open _missingPages.txt for writing: '" .. err .. "'. There are " .. #MissingPages .. " pages missing."); + return; + end + for _, pg in ipairs(MissingPages) do + f:write(pg.Name .. ":\n"); + -- Sort and output the referrers: + table.sort(pg.Refs); + f:write("\t" .. table.concat(pg.Refs, "\n\t")); + f:write("\n\n"); + end + f:close(); + g_Stats.NumInvalidLinks = #MissingPages; +end + + + + + +--- Writes the documentation statistics (in g_Stats) into the given HTML file +local function WriteStats(f) + local function ExportMeter(a_Percent) + local Color; + if (a_Percent > 99) then + Color = "green"; + elseif (a_Percent > 50) then + Color = "orange"; + else + Color = "red"; + end + + local meter = { + "\n", + "
    \n", + "
    \n", + string.format("%.2f", a_Percent), + " %", + }; + return table.concat(meter, ""); + end + + f:write([[ +

    Documentation statistics

    + + ]]); + f:write("\n"); + + f:write("\n"); + + f:write("\n"); + + f:write("\n"); + + f:write("\n"); + + f:write([[ +
    ObjectTotalDocumentedUndocumentedDocumented %
    Classes", g_Stats.NumTotalClasses); + f:write("", g_Stats.NumTotalClasses - g_Stats.NumUndocumentedClasses); + f:write("", g_Stats.NumUndocumentedClasses); + f:write("", ExportMeter(100 * (g_Stats.NumTotalClasses - g_Stats.NumUndocumentedClasses) / g_Stats.NumTotalClasses)); + f:write("
    Functions", g_Stats.NumTotalFunctions); + f:write("", g_Stats.NumTotalFunctions - g_Stats.NumUndocumentedFunctions); + f:write("", g_Stats.NumUndocumentedFunctions); + f:write("", ExportMeter(100 * (g_Stats.NumTotalFunctions - g_Stats.NumUndocumentedFunctions) / g_Stats.NumTotalFunctions)); + f:write("
    Member variables", g_Stats.NumTotalVariables); + f:write("", g_Stats.NumTotalVariables - g_Stats.NumUndocumentedVariables); + f:write("", g_Stats.NumUndocumentedVariables); + f:write("", ExportMeter(100 * (g_Stats.NumTotalVariables - g_Stats.NumUndocumentedVariables) / g_Stats.NumTotalVariables)); + f:write("
    Constants", g_Stats.NumTotalConstants); + f:write("", g_Stats.NumTotalConstants - g_Stats.NumUndocumentedConstants); + f:write("", g_Stats.NumUndocumentedConstants); + f:write("", ExportMeter(100 * (g_Stats.NumTotalConstants - g_Stats.NumUndocumentedConstants) / g_Stats.NumTotalConstants)); + f:write("
    Hooks", g_Stats.NumTotalHooks); + f:write("", g_Stats.NumTotalHooks - g_Stats.NumUndocumentedHooks); + f:write("", g_Stats.NumUndocumentedHooks); + f:write("", ExportMeter(100 * (g_Stats.NumTotalHooks - g_Stats.NumUndocumentedHooks) / g_Stats.NumTotalHooks)); + f:write("
    +

    There are ]], g_Stats.NumTrackedLinks, " internal links, ", g_Stats.NumInvalidLinks, " of them are invalid.

    " + ); +end + + + + + +local function DumpAPIHtml(a_API) + LOG("Dumping all available functions and constants to API subfolder..."); + + -- Create the output folder + if not(cFile:IsFolder("API")) then + cFile:CreateFolder("API"); + end + + LOG("Copying static files.."); + cFile:CreateFolder("API/Static"); + local localFolder = g_Plugin:GetLocalFolder(); + for _, fnam in ipairs(cFile:GetFolderContents(localFolder .. "/Static")) do + cFile:Delete("API/Static/" .. fnam); + cFile:Copy(localFolder .. "/Static/" .. fnam, "API/Static/" .. fnam); + end + + -- Extract hook constants: + local Hooks = {}; + local UndocumentedHooks = {}; + for name, obj in pairs(cPluginManager) do + if ( + (type(obj) == "number") and + name:match("HOOK_.*") and + (name ~= "HOOK_MAX") and + (name ~= "HOOK_NUM_HOOKS") + ) then + table.insert(Hooks, { Name = name }); + end + end + table.sort(Hooks, + function(Hook1, Hook2) + return (Hook1.Name < Hook2.Name); + end + ); + ReadHooks(Hooks); + + -- Create a "class index" file, write each class as a link to that file, + -- then dump class contents into class-specific file + LOG("Writing HTML files..."); + local f, err = io.open("API/index.html", "w"); + if (f == nil) then + LOGINFO("Cannot output HTML API: " .. err); + return; + end + + -- Create a class navigation menu that will be inserted into each class file for faster navigation (#403) + local ClassMenuTab = {}; + for _, cls in ipairs(a_API) do + table.insert(ClassMenuTab, ""); + table.insert(ClassMenuTab, cls.Name); + table.insert(ClassMenuTab, "
    "); + end + local ClassMenu = table.concat(ClassMenuTab, ""); + + -- Create a hook navigation menu that will be inserted into each hook file for faster navigation(#403) + local HookNavTab = {}; + for _, hook in ipairs(Hooks) do + table.insert(HookNavTab, ""); + table.insert(HookNavTab, (hook.Name:gsub("^HOOK_", ""))); -- remove the "HOOK_" part of the name + table.insert(HookNavTab, "
    "); + end + local HookNav = table.concat(HookNavTab, ""); + + -- Write the HTML file: + f:write([[ + + + Cuberite API - Index + + + +
    +
    +

    Cuberite API - Index

    +
    +
    +

    The API reference is divided into the following sections:

    + +
    + ]]); + + WriteArticles(f); + WriteClasses(f, a_API, ClassMenu); + WriteHooks(f, Hooks, UndocumentedHooks, HookNav); + + -- Copy the static files to the output folder: + local StaticFiles = + { + "main.css", + "prettify.js", + "prettify.css", + "lang-lua.js", + }; + for _, fnam in ipairs(StaticFiles) do + cFile:Delete("API/" .. fnam); + cFile:Copy(g_Plugin:GetLocalFolder() .. "/" .. fnam, "API/" .. fnam); + end + + -- List the documentation problems: + LOG("Listing leftovers..."); + ListUndocumentedObjects(a_API, UndocumentedHooks); + ListUnexportedObjects(); + ListMissingPages(); + + WriteStats(f); + + f:write([[
    ]]) + f:write(GetHtmlTimestamp()) + f:write([[]]) + f:close() + + LOG("API subfolder written"); +end + + + + + +--- Returns the string with extra tabs and CR/LFs removed +local function CleanUpDescription(a_Desc) + -- Get rid of indent and newlines, normalize whitespace: + local res = a_Desc:gsub("[\n\t]", "") + res = a_Desc:gsub("%s%s+", " ") + + -- Replace paragraph marks with newlines: + res = res:gsub("

    ", "\n") + res = res:gsub("

    ", "") + + -- Replace list items with dashes: + res = res:gsub("", "") + res = res:gsub("
  • ", "\n - ") + res = res:gsub("
  • ", "") + + return res +end + + + + + +--- Writes a list of methods into the specified file in ZBS format +local function WriteZBSMethods(f, a_Methods) + for _, func in ipairs(a_Methods or {}) do + f:write("\t\t\t[\"", func.Name, "\"] =\n") + f:write("\t\t\t{\n") + f:write("\t\t\t\ttype = \"method\",\n") + if ((func.Notes ~= nil) and (func.Notes ~= "")) then + f:write("\t\t\t\tdescription = [[", CleanUpDescription(func.Notes or ""), " ]],\n") + end + f:write("\t\t\t},\n") + end +end + + + + + +--- Writes a list of constants into the specified file in ZBS format +local function WriteZBSConstants(f, a_Constants) + for _, cons in ipairs(a_Constants or {}) do + f:write("\t\t\t[\"", cons.Name, "\"] =\n") + f:write("\t\t\t{\n") + f:write("\t\t\t\ttype = \"value\",\n") + if ((cons.Desc ~= nil) and (cons.Desc ~= "")) then + f:write("\t\t\t\tdescription = [[", CleanUpDescription(cons.Desc or ""), " ]],\n") + end + f:write("\t\t\t},\n") + end +end + + + + + +--- Writes one Cuberite class definition into the specified file in ZBS format +local function WriteZBSClass(f, a_Class) + assert(type(a_Class) == "table") + + -- Write class header: + f:write("\t", a_Class.Name, " =\n\t{\n") + f:write("\t\ttype = \"class\",\n") + f:write("\t\tdescription = [[", CleanUpDescription(a_Class.Desc or ""), " ]],\n") + f:write("\t\tchilds =\n") + f:write("\t\t{\n") + + -- Export methods and constants: + WriteZBSMethods(f, a_Class.Functions) + WriteZBSConstants(f, a_Class.Constants) + + -- Finish the class definition: + f:write("\t\t},\n") + f:write("\t},\n\n") +end + + + + + +--- Dumps the entire API table into a file in the ZBS format +local function DumpAPIZBS(a_API) + LOG("Dumping ZBS API description...") + local f, err = io.open("mcserver_api.lua", "w") + if (f == nil) then + LOG("Cannot open mcserver_lua.lua for writing, ZBS API will not be dumped. " .. err) + return + end + + -- Write the file header: + f:write("-- This is a Cuberite API file automatically generated by the APIDump plugin\n") + f:write("-- Note that any manual changes will be overwritten by the next dump\n\n") + f:write("return {\n") + + -- Export each class except Globals, store those aside: + local Globals + for _, cls in ipairs(a_API) do + if (cls.Name ~= "Globals") then + WriteZBSClass(f, cls) + else + Globals = cls + end + end + + -- Export the globals: + if (Globals) then + WriteZBSMethods(f, Globals.Functions) + WriteZBSConstants(f, Globals.Constants) + end + + -- Finish the file: + f:write("}\n") + f:close() + LOG("ZBS API dumped...") +end + + + + + +--- Returns true if a_Descendant is declared to be a (possibly indirect) descendant of a_Base +local function IsDeclaredDescendant(a_DescendantName, a_BaseName, a_API) + -- Check params: + assert(type(a_DescendantName) == "string") + assert(type(a_BaseName) == "string") + assert(type(a_API) == "table") + if not(a_API[a_BaseName]) then + return false + end + assert(type(a_API[a_BaseName]) == "table", "Not a class name: " .. a_BaseName) + assert(type(a_API[a_BaseName].Descendants) == "table") + + -- Check direct inheritance: + for _, desc in ipairs(a_API[a_BaseName].Descendants) do + if (desc.Name == a_DescendantName) then + return true + end + end -- for desc - a_BaseName's descendants + + -- Check indirect inheritance: + for _, desc in ipairs(a_API[a_BaseName].Descendants) do + if (IsDeclaredDescendant(a_DescendantName, desc.Name, a_API)) then + return true + end + end -- for desc - a_BaseName's descendants + + return false +end + + + + + +--- Checks the specified class' inheritance +-- Reports any problems as new items in the a_Report table +local function CheckClassInheritance(a_Class, a_API, a_Report) + -- Check params: + assert(type(a_Class) == "table") + assert(type(a_API) == "table") + assert(type(a_Report) == "table") + + -- Check that the declared descendants are really descendants: + local registry = debug.getregistry() + for _, desc in ipairs(a_Class.Descendants or {}) do + local isParent = false + local parents = registry["tolua_super"][_G[desc.Name]] + if not(parents[a_Class.Name]) then + table.insert(a_Report, desc.Name .. " is not a descendant of " .. a_Class.Name) + end + end -- for desc - a_Class.Descendants[] + + -- Check that all inheritance is listed for the class: + local parents = registry["tolua_super"][_G[a_Class.Name]] -- map of "classname" -> true for each class that a_Class inherits + for clsName, isParent in pairs(parents or {}) do + if ((clsName ~= "") and not(clsName:match("const .*"))) then + if not(IsDeclaredDescendant(a_Class.Name, clsName, a_API)) then + table.insert(a_Report, a_Class.Name .. " inherits from " .. clsName .. " but this isn't documented") + end + end + end +end + + + + + +--- Checks each class's declared inheritance versus the actual inheritance +local function CheckAPIDescendants(a_API) + -- Check each class: + local report = {} + for _, cls in ipairs(a_API) do + if (cls.Name ~= "Globals") then + CheckClassInheritance(cls, a_API, report) + end + end + + -- If there's anything to report, output it to a file: + if (report[1] ~= nil) then + LOG("There are inheritance errors in the API description:") + for _, msg in ipairs(report) do + LOG(" " .. msg) + end + + local f, err = io.open("API/_inheritance_errors.txt", "w") + if (f == nil) then + LOG("Cannot report inheritance problems to a file: " .. tostring(err)) + return + end + f:write(table.concat(report, "\n")) + f:close() + end +end + + + + + +local function DumpApi() + LOG("Dumping the API...") + + -- Load the API descriptions from the Classes and Hooks subfolders: + -- This needs to be done each time the command is invoked because the export modifies the tables' contents + dofile(g_PluginFolder .. "/APIDesc.lua") + if (g_APIDesc.Classes == nil) then + g_APIDesc.Classes = {}; + end + if (g_APIDesc.Hooks == nil) then + g_APIDesc.Hooks = {}; + end + LoadAPIFiles("/Classes/", g_APIDesc.Classes); + LoadAPIFiles("/Hooks/", g_APIDesc.Hooks); + + -- Reset the stats: + g_TrackedPages = {}; -- List of tracked pages, to be checked later whether they exist. Each item is an array of referring pagenames. + g_Stats = -- Statistics about the documentation + { + NumTotalClasses = 0, + NumUndocumentedClasses = 0, + NumTotalFunctions = 0, + NumUndocumentedFunctions = 0, + NumTotalConstants = 0, + NumUndocumentedConstants = 0, + NumTotalVariables = 0, + NumUndocumentedVariables = 0, + NumTotalHooks = 0, + NumUndocumentedHooks = 0, + NumTrackedLinks = 0, + NumInvalidLinks = 0, + } + + -- Create the API tables: + local API, Globals = CreateAPITables(); + + -- Sort the classes by name: + table.sort(API, + function (c1, c2) + return (string.lower(c1.Name) < string.lower(c2.Name)); + end + ); + g_Stats.NumTotalClasses = #API; + + -- Add Globals into the API: + Globals.Name = "Globals"; + table.insert(API, Globals); + + -- Read in the descriptions: + LOG("Reading descriptions..."); + ReadDescriptions(API); + + -- Check that the API lists the inheritance properly, report any problems to a file: + CheckAPIDescendants(API) + + -- Dump all available API objects in HTML format into a subfolder: + DumpAPIHtml(API); + + -- Dump all available API objects in format used by ZeroBraneStudio API descriptions: + DumpAPIZBS(API) + + LOG("APIDump finished"); + return true +end + + + + + +local function HandleWebAdminDump(a_Request) + if (a_Request.PostParams["Dump"] ~= nil) then + DumpApi() + end + return + [[ +

    Pressing the button will generate the API dump on the server. Note that this can take some time.

    +
    + ]] +end + + + + + +local function HandleCmdApi(a_Split) + DumpApi() + return true +end + + + + + +local function HandleCmdApiShow(a_Split, a_EntireCmd) + os.execute("API" .. cFile:GetPathSeparator() .. "index.html") + return true, "Launching the browser to show the API docs..." +end + + + + + +function Initialize(Plugin) + g_Plugin = Plugin; + g_PluginFolder = Plugin:GetLocalFolder(); + + LOG("Initialising " .. Plugin:GetName() .. " v." .. Plugin:GetVersion()) + + -- Bind a console command to dump the API: + cPluginManager:BindConsoleCommand("api", HandleCmdApi, "Dumps the Lua API docs into the API/ subfolder") + cPluginManager:BindConsoleCommand("apishow", HandleCmdApiShow, "Runs the default browser to show the API docs") + + -- Add a WebAdmin tab that has a Dump button + g_Plugin:AddWebTab("APIDump", HandleWebAdminDump) + + return true +end diff --git a/Server/Plugins/APIDump/prettify.css b/Server/Plugins/APIDump/prettify.css new file mode 100644 index 000000000..d44b3a228 --- /dev/null +++ b/Server/Plugins/APIDump/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/Server/Plugins/APIDump/prettify.js b/Server/Plugins/APIDump/prettify.js new file mode 100644 index 000000000..7b990496d --- /dev/null +++ b/Server/Plugins/APIDump/prettify.js @@ -0,0 +1,30 @@ +!function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= +b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;ah[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", +/^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ +s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, +q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= +c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], +O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, +V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", +/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], +["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), +["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, +hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); +p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
    "+a+"
    ";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); +return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i + + + Debuggers.lua + + diff --git a/Server/Plugins/Debuggers/Debuggers.lua b/Server/Plugins/Debuggers/Debuggers.lua new file mode 100644 index 000000000..bd0b94a06 --- /dev/null +++ b/Server/Plugins/Debuggers/Debuggers.lua @@ -0,0 +1,2047 @@ + +-- Global variables +g_DropSpensersToActivate = {}; -- A list of dispensers and droppers (as {World, X, Y Z} quadruplets) that are to be activated every tick +g_HungerReportTick = 10; +g_ShowFoodStats = false; -- When true, each player's food stats are sent to them every 10 ticks + + + + + + +function Initialize(a_Plugin) + --[[ + -- Test multiple hook handlers: + cPluginManager.AddHook(cPluginManager.HOOK_TICK, OnTick1); + cPluginManager.AddHook(cPluginManager.HOOK_TICK, OnTick2); + --]] + + local PM = cPluginManager; + PM:AddHook(cPluginManager.HOOK_PLAYER_USING_BLOCK, OnPlayerUsingBlock); + PM:AddHook(cPluginManager.HOOK_PLAYER_USING_ITEM, OnPlayerUsingItem); + PM:AddHook(cPluginManager.HOOK_TAKE_DAMAGE, OnTakeDamage); + PM:AddHook(cPluginManager.HOOK_TICK, OnTick); + PM:AddHook(cPluginManager.HOOK_CHAT, OnChat); + PM:AddHook(cPluginManager.HOOK_PLAYER_RIGHT_CLICKING_ENTITY, OnPlayerRightClickingEntity); + PM:AddHook(cPluginManager.HOOK_WORLD_TICK, OnWorldTick); + PM:AddHook(cPluginManager.HOOK_PLUGINS_LOADED, OnPluginsLoaded); + PM:AddHook(cPluginManager.HOOK_PLAYER_JOINED, OnPlayerJoined); + PM:AddHook(cPluginManager.HOOK_PROJECTILE_HIT_BLOCK, OnProjectileHitBlock); + PM:AddHook(cPluginManager.HOOK_CHUNK_UNLOADING, OnChunkUnloading); + PM:AddHook(cPluginManager.HOOK_WORLD_STARTED, OnWorldStarted); + PM:AddHook(cPluginManager.HOOK_PROJECTILE_HIT_BLOCK, OnProjectileHitBlock); + + -- _X: Disabled WECUI manipulation: + -- PM:AddHook(cPluginManager.HOOK_PLUGIN_MESSAGE, OnPluginMessage); + -- _X: Disabled so that the normal operation doesn't interfere with anything + -- PM:AddHook(cPluginManager.HOOK_CHUNK_GENERATED, OnChunkGenerated); + + -- Load the InfoReg shared library: + dofile(cPluginManager:GetPluginsPath() .. "/InfoReg.lua") + + -- Bind all the commands: + RegisterPluginInfoCommands(); + + -- Bind all the console commands: + RegisterPluginInfoConsoleCommands(); + + a_Plugin:AddWebTab("Debuggers", HandleRequest_Debuggers) + a_Plugin:AddWebTab("StressTest", HandleRequest_StressTest) + + -- Enable the following line for BlockArea / Generator interface testing: + -- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED); + + -- TestBlockAreas() + -- TestSQLiteBindings() + -- TestExpatBindings() + TestPluginCalls() + + TestBlockAreasString() + TestStringBase64() + -- TestUUIDFromName() + -- TestRankMgr() + TestFileExt() + TestFileLastMod() + TestPluginInterface() + + local LastSelfMod = cFile:GetLastModificationTime(a_Plugin:GetLocalFolder() .. "/Debuggers.lua") + LOG("Debuggers.lua last modified on " .. os.date("%Y-%m-%dT%H:%M:%S", LastSelfMod)) + + --[[ + -- Test cCompositeChat usage in console-logging: + LOGINFO(cCompositeChat("This is a simple message with some @2 color formatting @4 and http://links.to .") + :AddSuggestCommandPart("(Suggested command)", "cmd") + :AddRunCommandPart("(Run command)", "cmd") + :SetMessageType(mtInfo) + ) + --]] + + -- Test the crash in #1889: + cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_RIGHT_CLICKING_ENTITY, + function (a_CBPlayer, a_CBEntity) + a_CBPlayer:GetWorld():DoWithEntityByID( -- This will crash the server in #1889 + a_CBEntity:GetUniqueID(), + function(Entity) + LOG("RightClicking an entity, crash #1889 fixed. Entity is a " .. tolua.type(Entity)) + end + ) + end + ) + + return true +end; + + + + + +function TestPluginInterface() + cPluginManager:DoWithPlugin("Core", + function (a_CBPlugin) + if (a_CBPlugin:GetStatus() == cPluginManager.psLoaded) then + LOG("Core plugin was found, version " .. a_CBPlugin:GetVersion()) + else + LOG("Core plugin is not loaded") + end + end + ) + + cPluginManager:ForEachPlugin( + function (a_CBPlugin) + LOG("Plugin in " .. a_CBPlugin:GetFolderName() .. " has an API name of " .. a_CBPlugin:GetName() .. " and status " .. a_CBPlugin:GetStatus()) + end + ) +end + + + + +function TestFileExt() + assert(cFile:ChangeFileExt("fileless_dir/", "new") == "fileless_dir/") + assert(cFile:ChangeFileExt("fileless_dir/", ".new") == "fileless_dir/") + assert(cFile:ChangeFileExt("pathless_file.ext", "new") == "pathless_file.new") + assert(cFile:ChangeFileExt("pathless_file.ext", ".new") == "pathless_file.new") + assert(cFile:ChangeFileExt("path/to/file.ext", "new") == "path/to/file.new") + assert(cFile:ChangeFileExt("path/to/file.ext", ".new") == "path/to/file.new") + assert(cFile:ChangeFileExt("path/to.dir/file", "new") == "path/to.dir/file.new") + assert(cFile:ChangeFileExt("path/to.dir/file", ".new") == "path/to.dir/file.new") + assert(cFile:ChangeFileExt("path/to.dir/file.ext", "new") == "path/to.dir/file.new") + assert(cFile:ChangeFileExt("path/to.dir/file.ext", ".new") == "path/to.dir/file.new") + assert(cFile:ChangeFileExt("path/to.dir/file.longext", "new") == "path/to.dir/file.new") + assert(cFile:ChangeFileExt("path/to.dir/file.longext", ".new") == "path/to.dir/file.new") + assert(cFile:ChangeFileExt("path/to.dir/file.", "new") == "path/to.dir/file.new") + assert(cFile:ChangeFileExt("path/to.dir/file.", ".new") == "path/to.dir/file.new") +end + + + + + +function TestFileLastMod() + local f = assert(io.open("test.txt", "w")) + f:write("test") + f:close() + local filetime = cFile:GetLastModificationTime("test.txt") + local ostime = os.time() + LOG("file time: " .. filetime .. ", OS time: " .. ostime .. ", difference: " .. ostime - filetime) +end + + + + + +function TestPluginCalls() + -- In order to test the inter-plugin communication, we're going to call Core's ReturnColorFromChar() function + -- It is a rather simple function that doesn't need any tables as its params and returns a value, too + -- Note the signature: function ReturnColorFromChar( Split, char ) ... return cChatColog.Gray ... end + -- The Split parameter should be a table, but it is not used in that function anyway, + -- so we can get away with passing nil to it. + + LOG("Debuggers: Calling NoSuchPlugin.FnName()...") + cPluginManager:CallPlugin("NoSuchPlugin", "FnName", "SomeParam") + LOG("Debuggers: Calling Core.NoSuchFunction()...") + cPluginManager:CallPlugin("Core", "NoSuchFunction", "SomeParam") + LOG("Debuggers: Calling Core.ReturnColorFromChar(..., \"8\")...") + local Gray = cPluginManager:CallPlugin("Core", "ReturnColorFromChar", "split", "8") + if (Gray ~= cChatColor.Gray) then + LOGWARNING("Debuggers: Call failed, exp " .. cChatColor.Gray .. ", got " .. (Gray or "")) + else + LOG("Debuggers: Call succeeded") + end + LOG("Debuggers: Inter-plugin calls done.") +end + + + + + +function TestBlockAreas() + LOG("Testing block areas..."); + + -- Debug block area merging: + local BA1 = cBlockArea(); + local BA2 = cBlockArea(); + if (BA1:LoadFromSchematicFile("schematics/test.schematic")) then + if (BA2:LoadFromSchematicFile("schematics/fountain.schematic")) then + BA2:SetRelBlockType(0, 0, 0, E_BLOCK_LAPIS_BLOCK); + BA2:SetRelBlockType(1, 0, 0, E_BLOCK_LAPIS_BLOCK); + BA2:SetRelBlockType(2, 0, 0, E_BLOCK_LAPIS_BLOCK); + BA1:Merge(BA2, 1, 10, 1, cBlockArea.msImprint); + BA1:SaveToSchematicFile("schematics/merge.schematic"); + end + else + BA1:Create(16, 16, 16); + end + + -- Debug block area cuboid filling: + BA1:FillRelCuboid(2, 9, 2, 8, 2, 8, cBlockArea.baTypes, E_BLOCK_GOLD_BLOCK); + BA1:RelLine(2, 2, 2, 9, 8, 8, cBlockArea.baTypes or cBlockArea.baMetas, E_BLOCK_SAPLING, E_META_SAPLING_BIRCH); + BA1:SaveToSchematicFile("schematics/fillrel.schematic"); + + -- Debug block area mirroring: + if (BA1:LoadFromSchematicFile("schematics/lt.schematic")) then + BA1:MirrorXYNoMeta(); + BA1:SaveToSchematicFile("schematics/lt_XY.schematic"); + BA1:MirrorXYNoMeta(); + BA1:SaveToSchematicFile("schematics/lt_XY2.schematic"); + + BA1:MirrorXZNoMeta(); + BA1:SaveToSchematicFile("schematics/lt_XZ.schematic"); + BA1:MirrorXZNoMeta(); + BA1:SaveToSchematicFile("schematics/lt_XZ2.schematic"); + + BA1:MirrorYZNoMeta(); + BA1:SaveToSchematicFile("schematics/lt_YZ.schematic"); + BA1:MirrorYZNoMeta(); + BA1:SaveToSchematicFile("schematics/lt_YZ2.schematic"); + end + + -- Debug block area rotation: + if (BA1:LoadFromSchematicFile("schematics/rot.schematic")) then + BA1:RotateCWNoMeta(); + BA1:SaveToSchematicFile("schematics/rot1.schematic"); + BA1:RotateCWNoMeta(); + BA1:SaveToSchematicFile("schematics/rot2.schematic"); + BA1:RotateCWNoMeta(); + BA1:SaveToSchematicFile("schematics/rot3.schematic"); + BA1:RotateCWNoMeta(); + BA1:SaveToSchematicFile("schematics/rot4.schematic"); + end + + -- Debug block area rotation: + if (BA1:LoadFromSchematicFile("schematics/rotm.schematic")) then + BA1:RotateCCW(); + BA1:SaveToSchematicFile("schematics/rotm1.schematic"); + BA1:RotateCCW(); + BA1:SaveToSchematicFile("schematics/rotm2.schematic"); + BA1:RotateCCW(); + BA1:SaveToSchematicFile("schematics/rotm3.schematic"); + BA1:RotateCCW(); + BA1:SaveToSchematicFile("schematics/rotm4.schematic"); + end + + -- Debug block area mirroring: + if (BA1:LoadFromSchematicFile("schematics/ltm.schematic")) then + BA1:MirrorXY(); + BA1:SaveToSchematicFile("schematics/ltm_XY.schematic"); + BA1:MirrorXY(); + BA1:SaveToSchematicFile("schematics/ltm_XY2.schematic"); + + BA1:MirrorXZ(); + BA1:SaveToSchematicFile("schematics/ltm_XZ.schematic"); + BA1:MirrorXZ(); + BA1:SaveToSchematicFile("schematics/ltm_XZ2.schematic"); + + BA1:MirrorYZ(); + BA1:SaveToSchematicFile("schematics/ltm_YZ.schematic"); + BA1:MirrorYZ(); + BA1:SaveToSchematicFile("schematics/ltm_YZ2.schematic"); + end + + LOG("Block areas test ended"); +end + + + + + + +function TestBlockAreasString() + -- Write one area to string, then to file: + local BA1 = cBlockArea() + BA1:Create(5, 5, 5, cBlockArea.baTypes + cBlockArea.baMetas) + BA1:Fill(cBlockArea.baTypes, E_BLOCK_DIAMOND_BLOCK) + BA1:FillRelCuboid(1, 3, 1, 3, 1, 3, cBlockArea.baTypes, E_BLOCK_GOLD_BLOCK) + local Data = BA1:SaveToSchematicString() + if ((type(Data) ~= "string") or (Data == "")) then + LOG("Cannot save schematic to string") + return + end + cFile:CreateFolder("schematics") + local f = io.open("schematics/StringTest.schematic", "wb") + f:write(Data) + f:close() + + -- Load a second area from that file: + local BA2 = cBlockArea() + if not(BA2:LoadFromSchematicFile("schematics/StringTest.schematic")) then + LOG("Cannot read schematic from string test file") + return + end + BA2:Clear() + + -- Load another area from a string in that file: + f = io.open("schematics/StringTest.schematic", "rb") + Data = f:read("*all") + if not(BA2:LoadFromSchematicString(Data)) then + LOG("Cannot load schematic from string") + end +end + + + + + +function TestStringBase64() + -- Create a binary string: + local s = "" + for i = 0, 255 do + s = s .. string.char(i) + end + + -- Roundtrip through Base64: + local Base64 = Base64Encode(s) + local UnBase64 = Base64Decode(Base64) + + assert(UnBase64 == s) +end + + + + + +function TestUUIDFromName() + LOG("Testing UUID-from-Name resolution...") + + -- Test by querying a few existing names, along with a non-existent one: + local PlayerNames = + { + "xoft", + "aloe_vera", + "nonexistent_player", + } + -- WARNING: Blocking operation! DO NOT USE IN TICK THREAD! + local UUIDs = cMojangAPI:GetUUIDsFromPlayerNames(PlayerNames) + + -- Log the results: + for _, name in ipairs(PlayerNames) do + local UUID = UUIDs[name] + if (UUID == nil) then + LOG(" UUID(" .. name .. ") not found.") + else + LOG(" UUID(" .. name .. ") = \"" .. UUID .. "\"") + end + end + + -- Test once more with the same players, valid-only. This should go directly from cache, so fast. + LOG("Testing again with the same valid players...") + local ValidPlayerNames = + { + "xoft", + "aloe_vera", + } + UUIDs = cMojangAPI:GetUUIDsFromPlayerNames(ValidPlayerNames); + + -- Log the results: + for _, name in ipairs(ValidPlayerNames) do + local UUID = UUIDs[name] + if (UUID == nil) then + LOG(" UUID(" .. name .. ") not found.") + else + LOG(" UUID(" .. name .. ") = \"" .. UUID .. "\"") + end + end + + -- Test yet again, cache-only: + LOG("Testing once more, cache only...") + local PlayerNames3 = + { + "xoft", + "aloe_vera", + "notch", -- Valid player name, but not cached (most likely :) + } + UUIDs = cMojangAPI:GetUUIDsFromPlayerNames(PlayerNames3, true) + + -- Log the results: + for _, name in ipairs(PlayerNames3) do + local UUID = UUIDs[name] + if (UUID == nil) then + LOG(" UUID(" .. name .. ") not found.") + else + LOG(" UUID(" .. name .. ") = \"" .. UUID .. "\"") + end + end + + LOG("UUID-from-Name resolution tests finished.") + + LOG("Performing a Name-from-UUID test...") + -- local NameToTest = "aloe_vera" + local NameToTest = "xoft" + local Name = cMojangAPI:GetPlayerNameFromUUID(UUIDs[NameToTest]) + LOG("Name(" .. UUIDs[NameToTest] .. ") = '" .. Name .. "', expected '" .. NameToTest .. "'.") + LOG("Name-from-UUID test finished.") +end + + + + + +function TestRankMgr() + LOG("Testing the rank manager") + cRankManager:AddRank("LuaRank") + cRankManager:AddGroup("LuaTestGroup") + cRankManager:AddGroupToRank("LuaTestGroup", "LuaRank") + cRankManager:AddPermissionToGroup("luaperm", "LuaTestGroup") +end + + + + + +function TestSQLiteBindings() + LOG("Testing SQLite bindings..."); + + -- Debug SQLite binding + local TestDB, ErrCode, ErrMsg = sqlite3.open("test.sqlite"); + if (TestDB ~= nil) then + local function ShowRow(UserData, NumCols, Values, Names) + assert(UserData == 'UserData'); + LOG("New row"); + for i = 1, NumCols do + LOG(" " .. Names[i] .. " = " .. Values[i]); + end + return 0; + end + local sql = [=[ + CREATE TABLE numbers(num1,num2,str); + INSERT INTO numbers VALUES(1, 11, "ABC"); + INSERT INTO numbers VALUES(2, 22, "DEF"); + INSERT INTO numbers VALUES(3, 33, "UVW"); + INSERT INTO numbers VALUES(4, 44, "XYZ"); + SELECT * FROM numbers; + ]=] + local Res = TestDB:exec(sql, ShowRow, 'UserData'); + if (Res ~= sqlite3.OK) then + LOG("TestDB:exec() failed: " .. Res .. " (" .. TestDB:errmsg() .. ")"); + end; + TestDB:close(); + else + -- This happens if for example SQLite cannot open the file (eg. a folder with the same name exists) + LOG("SQLite3 failed to open DB! (" .. ErrCode .. ", " .. ErrMsg ..")"); + end + + LOG("SQLite bindings test ended"); +end + + + + + +function TestExpatBindings() + LOG("Testing Expat bindings..."); + + -- Debug LuaExpat bindings: + local count = 0 + callbacks = { + StartElement = function (parser, name) + LOG("+ " .. string.rep(" ", count) .. name); + count = count + 1; + end, + EndElement = function (parser, name) + count = count - 1; + LOG("- " .. string.rep(" ", count) .. name); + end + } + + local p = lxp.new(callbacks); + p:parse("\nnext line\nanother line"); + p:parse("text\n"); + p:parse("\n"); + p:parse("more text"); + p:parse(""); + p:parse("\n"); + p:parse(); -- finishes the document + p:close(); -- closes the parser + + LOG("Expat bindings test ended"); +end + + + + + +function OnUsingBlazeRod(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ) + -- Magic rod of query: show block types and metas for both neighbors of the pointed face + local Valid, Type, Meta = Player:GetWorld():GetBlockTypeMeta(BlockX, BlockY, BlockZ); + + if (Type == E_BLOCK_AIR) then + Player:SendMessage(cChatColor.LightGray .. "Block {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}: air:" .. Meta); + else + local TempItem = cItem(Type, 1, Meta); + Player:SendMessage(cChatColor.LightGray .. "Block {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}: " .. ItemToFullString(TempItem) .. " (" .. Type .. ":" .. Meta .. ")"); + end + + local X, Y, Z = AddFaceDirection(BlockX, BlockY, BlockZ, BlockFace); + Valid, Type, Meta = Player:GetWorld():GetBlockTypeMeta(X, Y, Z); + if (Type == E_BLOCK_AIR) then + Player:SendMessage(cChatColor.LightGray .. "Block {" .. X .. ", " .. Y .. ", " .. Z .. "}: air:" .. Meta); + else + local TempItem = cItem(Type, 1, Meta); + Player:SendMessage(cChatColor.LightGray .. "Block {" .. X .. ", " .. Y .. ", " .. Z .. "}: " .. ItemToFullString(TempItem) .. " (" .. Type .. ":" .. Meta .. ")"); + end + return false; +end + + + + + +function OnUsingDiamond(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ) + -- Rclk with a diamond to test block area cropping and expanding + local Area = cBlockArea(); + Area:Read(Player:GetWorld(), + BlockX - 19, BlockX + 19, + BlockY - 7, BlockY + 7, + BlockZ - 19, BlockZ + 19 + ); + + LOG("Size before cropping: " .. Area:GetSizeX() .. " x " .. Area:GetSizeY() .. " x " .. Area:GetSizeZ()); + Area:DumpToRawFile("crop0.dat"); + + Area:Crop(2, 3, 0, 0, 0, 0); + LOG("Size after cropping 1: " .. Area:GetSizeX() .. " x " .. Area:GetSizeY() .. " x " .. Area:GetSizeZ()); + Area:DumpToRawFile("crop1.dat"); + + Area:Crop(2, 3, 0, 0, 0, 0); + LOG("Size after cropping 2: " .. Area:GetSizeX() .. " x " .. Area:GetSizeY() .. " x " .. Area:GetSizeZ()); + Area:DumpToRawFile("crop2.dat"); + + Area:Expand(2, 3, 0, 0, 0, 0); + LOG("Size after expanding 1: " .. Area:GetSizeX() .. " x " .. Area:GetSizeY() .. " x " .. Area:GetSizeZ()); + Area:DumpToRawFile("expand1.dat"); + + Area:Expand(3, 2, 1, 1, 0, 0); + LOG("Size after expanding 2: " .. Area:GetSizeX() .. " x " .. Area:GetSizeY() .. " x " .. Area:GetSizeZ()); + Area:DumpToRawFile("expand2.dat"); + + Area:Crop(0, 0, 0, 0, 3, 2); + LOG("Size after cropping 3: " .. Area:GetSizeX() .. " x " .. Area:GetSizeY() .. " x " .. Area:GetSizeZ()); + Area:DumpToRawFile("crop3.dat"); + + Area:Crop(0, 0, 3, 2, 0, 0); + LOG("Size after cropping 4: " .. Area:GetSizeX() .. " x " .. Area:GetSizeY() .. " x " .. Area:GetSizeZ()); + Area:DumpToRawFile("crop4.dat"); + + LOG("Crop test done"); + Player:SendMessage("Crop / expand test done."); + return false; +end + + + + + +function OnUsingEyeOfEnder(Player, BlockX, BlockY, BlockZ) + -- Rclk with an eye of ender places a predefined schematic at the cursor + local Area = cBlockArea(); + if not(Area:LoadFromSchematicFile("schematics/test.schematic")) then + LOG("Loading failed"); + return false; + end + LOG("Schematic loaded, placing now."); + Area:Write(Player:GetWorld(), BlockX, BlockY, BlockZ); + LOG("Done."); + return false; +end + + + + + +function OnUsingEnderPearl(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ) + -- Rclk with an ender pearl saves a predefined area around the cursor into a .schematic file. Also tests area copying + local Area = cBlockArea(); + if not(Area:Read(Player:GetWorld(), + BlockX - 8, BlockX + 8, BlockY - 8, BlockY + 8, BlockZ - 8, BlockZ + 8) + ) then + LOG("LUA: Area couldn't be read"); + return false; + end + LOG("LUA: Area read, copying now."); + local Area2 = cBlockArea(); + Area2:CopyFrom(Area); + LOG("LUA: Copied, now saving."); + if not(Area2:SaveToSchematicFile("schematics/test.schematic")) then + LOG("LUA: Cannot save schematic file."); + return false; + end + LOG("LUA: Done."); + return false; +end + + + + + +function OnUsingRedstoneTorch(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ) + -- Redstone torch activates a rapid dispenser / dropper discharge (at every tick): + local BlockType = Player:GetWorld():GetBlock(BlockX, BlockY, BlockZ); + if (BlockType == E_BLOCK_DISPENSER) then + table.insert(g_DropSpensersToActivate, {World = Player:GetWorld(), x = BlockX, y = BlockY, z = BlockZ}); + Player:SendMessage("Dispenser at {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "} discharging"); + return true; + elseif (BlockType == E_BLOCK_DROPPER) then + table.insert(g_DropSpensersToActivate, {World = Player:GetWorld(), x = BlockX, y = BlockY, z = BlockZ}); + Player:SendMessage("Dropper at {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "} discharging"); + return true; + else + Player:SendMessage("Neither a dispenser nor a dropper at {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}: " .. BlockType); + end + return false; +end + + + + + +function OnPlayerUsingItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ) + + -- dont check if the direction is in the air + if (BlockFace == BLOCK_FACE_NONE) then + return false + end + + local HeldItem = Player:GetEquippedItem(); + local HeldItemType = HeldItem.m_ItemType; + + if (HeldItemType == E_ITEM_STICK) then + -- Magic sTick of ticking: set the pointed block for ticking at the next tick + Player:SendMessage(cChatColor.LightGray .. "Setting next block tick to {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}") + Player:GetWorld():SetNextBlockTick(BlockX, BlockY, BlockZ); + return true + elseif (HeldItemType == E_ITEM_BLAZE_ROD) then + return OnUsingBlazeRod(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ); + elseif (HeldItemType == E_ITEM_DIAMOND) then + return OnUsingDiamond(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ); + elseif (HeldItemType == E_ITEM_EYE_OF_ENDER) then + return OnUsingEyeOfEnder(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ); + elseif (HeldItemType == E_ITEM_ENDER_PEARL) then + return OnUsingEnderPearl(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ); + end + return false; +end + + + + + +function OnPlayerUsingBlock(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ, BlockType, BlockMeta) + -- dont check if the direction is in the air + if (BlockFace == BLOCK_FACE_NONE) then + return false + end + + local HeldItem = Player:GetEquippedItem(); + local HeldItemType = HeldItem.m_ItemType; + + if (HeldItemType == E_BLOCK_REDSTONE_TORCH_ON) then + return OnUsingRedstoneTorch(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ); + end +end + + + + + +function OnTakeDamage(Receiver, TDI) + -- Receiver is cPawn + -- TDI is TakeDamageInfo + + -- LOG(Receiver:GetClass() .. " was dealt " .. DamageTypeToString(TDI.DamageType) .. " damage: Raw " .. TDI.RawDamage .. ", Final " .. TDI.FinalDamage .. " (" .. (TDI.RawDamage - TDI.FinalDamage) .. " covered by armor)"); + return false; +end + + + + + +function OnTick1() + -- For testing multiple hook handlers per plugin + LOGINFO("Tick1"); +end + + + + + +function OnTick2() + -- For testing multiple hook handlers per plugin + LOGINFO("Tick2"); +end + + + + + +--- When set to a positive number, the following OnTick() will perform GC and decrease until 0 again +GCOnTick = 0; + + + + + +function OnTick() + -- Activate all dropspensers in the g_DropSpensersToActivate list: + local ActivateDrSp = function(DropSpenser) + if (DropSpenser:GetContents():GetFirstUsedSlot() == -1) then + return true; + end + DropSpenser:Activate(); + return false; + end + -- Walk the list backwards, because we're removing some items + local idx = #g_DropSpensersToActivate; + for i = idx, 1, -1 do + local DrSp = g_DropSpensersToActivate[i]; + if not(DrSp.World:DoWithDropSpenserAt(DrSp.x, DrSp.y, DrSp.z, ActivateDrSp)) then + table.remove(g_DropSpensersToActivate, i); + end + end + + + -- If GCOnTick > 0, do a garbage-collect and decrease by one + if (GCOnTick > 0) then + collectgarbage(); + GCOnTick = GCOnTick - 1; + end + + return false; +end + + + + + +function OnWorldTick(a_World, a_Dt) + -- Report food stats, if switched on: + local Tick = a_World:GetWorldAge(); + if (not(g_ShowFoodStats) or (math.mod(Tick, 10) ~= 0)) then + return false; + end + a_World:ForEachPlayer( + function(a_Player) + a_Player:SendMessage( + tostring(Tick / 10) .. + " > FS: fl " .. a_Player:GetFoodLevel() .. + "; sat " .. a_Player:GetFoodSaturationLevel() .. + "; exh " .. a_Player:GetFoodExhaustionLevel() + ); + end + ); +end + + + + + +function OnChat(a_Player, a_Message) + return false, "blabla " .. a_Message; +end + + + + + +function OnPlayerRightClickingEntity(a_Player, a_Entity) + LOG("Player " .. a_Player:GetName() .. " right-clicking entity ID " .. a_Entity:GetUniqueID() .. ", a " .. a_Entity:GetClass()); + return false; +end + + + + + +function OnPluginsLoaded() + LOG("All plugins loaded"); +end + + + + + +function OnChunkGenerated(a_World, a_ChunkX, a_ChunkZ, a_ChunkDesc) + -- Get the topmost block coord: + local Height = a_ChunkDesc:GetHeight(0, 0); + + -- Create a sign there: + a_ChunkDesc:SetBlockTypeMeta(0, Height + 1, 0, E_BLOCK_SIGN_POST, 0); + local BlockEntity = a_ChunkDesc:GetBlockEntity(0, Height + 1, 0); + if (BlockEntity ~= nil) then + local SignEntity = tolua.cast(BlockEntity, "cSignEntity"); + SignEntity:SetLines("Chunk:", tonumber(a_ChunkX) .. ", " .. tonumber(a_ChunkZ), "", "(Debuggers)"); + end + + -- Update the heightmap: + a_ChunkDesc:SetHeight(0, 0, Height + 1); +end + + + + + +-- Function "round" copied from http://lua-users.org/wiki/SimpleRound +function round(num, idp) + local mult = 10^(idp or 0) + if num >= 0 then return math.floor(num * mult + 0.5) / mult + else return math.ceil(num * mult - 0.5) / mult end +end + + + + + +function HandleNickCmd(Split, Player) + if (Split[2] == nil) then + Player:SendMessage("Usage: /nick [CustomName]"); + return true; + end + + Player:SetCustomName(Split[2]); + Player:SendMessageSuccess("Custom name setted to " .. Player:GetCustomName() .. "!") + return true +end + + + + + +function HandleListEntitiesCmd(Split, Player) + local NumEntities = 0; + + local ListEntity = function(Entity) + if (Entity:IsDestroyed()) then + -- The entity has already been destroyed, don't list it + return false; + end; + local cls = Entity:GetClass(); + Player:SendMessage(" " .. Entity:GetUniqueID() .. ": " .. cls .. " {" .. round(Entity:GetPosX(), 2) .. ", " .. round(Entity:GetPosY(), 2) .. ", " .. round(Entity:GetPosZ(), 2) .."}"); + if (cls == "cPickup") then + local Pickup = Entity; + tolua.cast(Pickup, "cPickup"); + Player:SendMessage(" Age: " .. Pickup:GetAge() .. ", IsCollected: " .. tostring(Pickup:IsCollected())); + end + NumEntities = NumEntities + 1; + end + + Player:SendMessage("Listing all entities..."); + Player:GetWorld():ForEachEntity(ListEntity); + Player:SendMessage("List finished, " .. NumEntities .. " entities listed"); + return true; +end + + + + + +function HandleKillEntitiesCmd(Split, Player) + local NumEntities = 0; + + local KillEntity = function(Entity) + -- kill everything except for players: + if (Entity:GetEntityType() ~= cEntity.etPlayer) then + Entity:Destroy(); + NumEntities = NumEntities + 1; + end; + end + + Player:SendMessage("Killing all entities..."); + Player:GetWorld():ForEachEntity(KillEntity); + Player:SendMessage("Killed " .. NumEntities .. " entities."); + return true; +end + + + + + +function HandleWoolCmd(Split, Player) + local Wool = cItem(E_BLOCK_WOOL, 1, E_META_WOOL_BLUE); + Player:GetInventory():SetArmorSlot(0, Wool); + Player:GetInventory():SetArmorSlot(1, Wool); + Player:GetInventory():SetArmorSlot(2, Wool); + Player:GetInventory():SetArmorSlot(3, Wool); + Player:SendMessage("You have been bluewooled :)"); + return true; +end + + + + + +function HandleTestWndCmd(a_Split, a_Player) + local WindowType = cWindow.wtHopper; + local WindowSizeX = 5; + local WindowSizeY = 1; + if (#a_Split == 4) then + WindowType = tonumber(a_Split[2]); + WindowSizeX = tonumber(a_Split[3]); + WindowSizeY = tonumber(a_Split[4]); + elseif (#a_Split ~= 1) then + a_Player:SendMessage("Usage: /testwnd [WindowType WindowSizeX WindowSizeY]"); + return true; + end + + -- Test out the OnClosing callback's ability to refuse to close the window + local attempt = 1; + local OnClosing = function(Window, Player, CanRefuse) + Player:SendMessage("Window closing attempt #" .. attempt .. "; CanRefuse = " .. tostring(CanRefuse)); + attempt = attempt + 1; + return CanRefuse and (attempt <= 3); -- refuse twice, then allow, unless CanRefuse is set to true + end + + -- Log the slot changes + local OnSlotChanged = function(Window, SlotNum) + LOG("Window \"" .. Window:GetWindowTitle() .. "\" slot " .. SlotNum .. " changed."); + end + + local Window = cLuaWindow(WindowType, WindowSizeX, WindowSizeY, "TestWnd"); + local Item2 = cItem(E_ITEM_DIAMOND_SWORD, 1, 0, "1=1"); + local Item3 = cItem(E_ITEM_DIAMOND_SHOVEL); + Item3.m_Enchantments:SetLevel(cEnchantments.enchUnbreaking, 4); + local Item4 = cItem(Item3); -- Copy + Item4.m_Enchantments:SetLevel(cEnchantments.enchEfficiency, 3); -- Add enchantment + Item4.m_Enchantments:SetLevel(cEnchantments.enchUnbreaking, 5); -- Overwrite existing level + local Item5 = cItem(E_ITEM_DIAMOND_CHESTPLATE, 1, 0, "thorns=1;unbreaking=3"); + Window:SetSlot(a_Player, 0, cItem(E_ITEM_DIAMOND, 64)); + Window:SetSlot(a_Player, 1, Item2); + Window:SetSlot(a_Player, 2, Item3); + Window:SetSlot(a_Player, 3, Item4); + Window:SetSlot(a_Player, 4, Item5); + Window:SetOnClosing(OnClosing); + Window:SetOnSlotChanged(OnSlotChanged); + + a_Player:OpenWindow(Window); + + -- To make sure that the object has the correct life-management in Lua, + -- let's garbage-collect in the following few ticks + GCOnTick = 10; + + return true; +end + + + + + +function HandleGCCmd(a_Split, a_Player) + collectgarbage(); + return true; +end + + + + + + +function HandleFastCmd(a_Split, a_Player) + if (a_Player:GetNormalMaxSpeed() <= 0.11) then + -- The player has normal speed, set double speed: + a_Player:SetNormalMaxSpeed(0.2); + a_Player:SendMessage("You are now fast"); + else + -- The player has fast speed, set normal speed: + a_Player:SetNormalMaxSpeed(0.1); + a_Player:SendMessage("Back to normal speed"); + end + return true; +end + + + + + +function HandleDashCmd(a_Split, a_Player) + if (a_Player:GetSprintingMaxSpeed() <= 0.14) then + -- The player has normal sprinting speed, set double Sprintingspeed: + a_Player:SetSprintingMaxSpeed(0.4); + a_Player:SendMessage("You can now sprint very fast"); + else + -- The player has fast sprinting speed, set normal sprinting speed: + a_Player:SetSprintingMaxSpeed(0.13); + a_Player:SendMessage("Back to normal sprinting"); + end + return true; +end; + + + + + +function HandleHungerCmd(a_Split, a_Player) + a_Player:SendMessage("FoodLevel: " .. a_Player:GetFoodLevel()); + a_Player:SendMessage("FoodSaturationLevel: " .. a_Player:GetFoodSaturationLevel()); + a_Player:SendMessage("FoodTickTimer: " .. a_Player:GetFoodTickTimer()); + a_Player:SendMessage("FoodExhaustionLevel: " .. a_Player:GetFoodExhaustionLevel()); + a_Player:SendMessage("FoodPoisonedTicksRemaining: " .. a_Player:GetFoodPoisonedTicksRemaining()); + return true; +end + + + + + +function HandlePoisonCmd(a_Split, a_Player) + a_Player:FoodPoison(15 * 20); + return true; +end + + + + + +function HandleStarveCmd(a_Split, a_Player) + a_Player:SetFoodLevel(0); + a_Player:SendMessage("You are now starving"); + return true; +end + + + + + +function HandleFoodLevelCmd(a_Split, a_Player) + if (#a_Split ~= 2) then + a_Player:SendMessage("Missing an argument: the food level to set"); + return true; + end + + a_Player:SetFoodLevel(tonumber(a_Split[2])); + a_Player:SetFoodSaturationLevel(5); + a_Player:SetFoodExhaustionLevel(0); + a_Player:SendMessage( + "Food level set to " .. a_Player:GetFoodLevel() .. + ", saturation reset to " .. a_Player:GetFoodSaturationLevel() .. + " and exhaustion reset to " .. a_Player:GetFoodExhaustionLevel() + ); + return true; +end + + + + + +function HandleSpideyCmd(a_Split, a_Player) + -- Place a line of cobwebs from the player's eyes until non-air block, in the line-of-sight of the player + local World = a_Player:GetWorld(); + + local Callbacks = { + OnNextBlock = function(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta) + if (a_BlockType ~= E_BLOCK_AIR) then + -- abort the trace + return true; + end + World:SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_COBWEB, 0); + end + }; + + local EyePos = a_Player:GetEyePosition(); + local LookVector = a_Player:GetLookVector(); + LookVector:Normalize(); + + -- Start cca 2 blocks away from the eyes + local Start = EyePos + LookVector + LookVector; + local End = EyePos + LookVector * 50; + + cLineBlockTracer.Trace(World, Callbacks, Start.x, Start.y, Start.z, End.x, End.y, End.z); + + return true; +end + + + + + +function HandleEnchCmd(a_Split, a_Player) + local Wnd = cLuaWindow(cWindow.wtEnchantment, 1, 1, "Ench"); + a_Player:OpenWindow(Wnd); + Wnd:SetProperty(0, 10); + Wnd:SetProperty(1, 15); + Wnd:SetProperty(2, 25); + return true; +end + + + + + +function HandleFoodStatsCmd(a_Split, a_Player) + g_ShowFoodStats = not(g_ShowFoodStats); + return true; +end + + + + + +function HandleArrowCmd(a_Split, a_Player) + local World = a_Player:GetWorld(); + local Pos = a_Player:GetEyePosition(); + local Speed = a_Player:GetLookVector(); + Speed:Normalize(); + Pos = Pos + Speed; + + World:CreateProjectile(Pos.x, Pos.y, Pos.z, cProjectileEntity.pkArrow, a_Player, Speed * 10); + return true; +end + + + + + +function HandleFireballCmd(a_Split, a_Player) + local World = a_Player:GetWorld(); + local Pos = a_Player:GetEyePosition(); + local Speed = a_Player:GetLookVector(); + Speed:Normalize(); + Pos = Pos + Speed * 2; + + World:CreateProjectile(Pos.x, Pos.y, Pos.z, cProjectileEntity.pkGhastFireball, a_Player, Speed * 10); + return true; +end + + + + +function HandleAddExperience(a_Split, a_Player) + a_Player:DeltaExperience(200); + + return true; +end + + + + + +function HandleRemoveXp(a_Split, a_Player) + a_Player:SetCurrentExperience(0); + + return true; +end + + + + + +function HandleFill(a_Split, a_Player) + local World = a_Player:GetWorld(); + local ChunkX = a_Player:GetChunkX(); + local ChunkZ = a_Player:GetChunkZ(); + World:ForEachBlockEntityInChunk(ChunkX, ChunkZ, + function(a_BlockEntity) + local BlockType = a_BlockEntity:GetBlockType(); + if ( + (BlockType == E_BLOCK_CHEST) or + (BlockType == E_BLOCK_DISPENSER) or + (BlockType == E_BLOCK_DROPPER) or + (BlockType == E_BLOCK_FURNACE) or + (BlockType == E_BLOCK_HOPPER) + ) then + -- This block entity has items (inherits from cBlockEntityWithItems), fill it: + -- Note that we're not touching lit furnaces, don't wanna mess them up + local EntityWithItems = tolua.cast(a_BlockEntity, "cBlockEntityWithItems"); + local ItemGrid = EntityWithItems:GetContents(); + local NumSlots = ItemGrid:GetNumSlots(); + local ItemToSet = cItem(E_ITEM_GOLD_NUGGET); + for i = 0, NumSlots - 1 do + if (ItemGrid:GetSlot(i):IsEmpty()) then + ItemGrid:SetSlot(i, ItemToSet); + end + end + end + end + ); + return true; +end + + + + + +function HandleFurnaceRecipe(a_Split, a_Player) + local HeldItem = a_Player:GetEquippedItem(); + local Out, NumTicks, In = cRoot:GetFurnaceRecipe(HeldItem); + if (Out ~= nil) then + a_Player:SendMessage( + "Furnace turns " .. ItemToFullString(In) .. + " to " .. ItemToFullString(Out) .. + " in " .. NumTicks .. " ticks (" .. + tostring(NumTicks / 20) .. " seconds)." + ); + else + a_Player:SendMessage("There is no furnace recipe that would smelt " .. ItemToString(HeldItem)); + end + return true; +end + + + + + +function HandleFurnaceFuel(a_Split, a_Player) + local HeldItem = a_Player:GetEquippedItem(); + local NumTicks = cRoot:GetFurnaceFuelBurnTime(HeldItem); + if (NumTicks > 0) then + a_Player:SendMessage( + ItemToFullString(HeldItem) .. " would power a furnace for " .. NumTicks .. + " ticks (" .. tostring(NumTicks / 20) .. " seconds)." + ); + else + a_Player:SendMessage(ItemToString(HeldItem) .. " will not power furnaces."); + end + return true; +end + + + + + +function HandleSched(a_Split, a_Player) + local World = a_Player:GetWorld() + + -- Schedule a broadcast of a countdown message: + for i = 1, 10 do + World:ScheduleTask(i * 20, + function(a_World) + a_World:BroadcastChat("Countdown: " .. 11 - i) + end + ) + end + + -- Schedule a broadcast of the final message and a note to the originating player + -- Note that we CANNOT use the a_Player in the callback - what if the player disconnected? + -- Therefore we store the player's EntityID + local PlayerID = a_Player:GetUniqueID() + World:ScheduleTask(220, + function(a_World) + a_World:BroadcastChat("Countdown: BOOM") + a_World:DoWithEntityByID(PlayerID, + function(a_Entity) + if (a_Entity:IsPlayer()) then + -- Although unlikely, it is possible that this player is not the originating player + -- However, I leave this as an excercise to you to fix this "bug" + local Player = tolua.cast(a_Entity, "cPlayer") + Player:SendMessage("Countdown finished") + end + end + ) + end + ) + + return true +end + + + + + +function HandleRMItem(a_Split, a_Player) + -- Check params: + if (a_Split[2] == nil) then + a_Player:SendMessage("Usage: /rmitem [Count]") + return true + end + + -- Parse the item type: + local Item = cItem() + if (not StringToItem(a_Split[2], Item)) then + a_Player:SendMessageFailure(a_Split[2] .. " isn't a valid item") + return true + end + + -- Parse the optional item count + if (a_Split[3] ~= nil) then + local Count = tonumber(a_Split[3]) + if (Count == nil) then + a_Player:SendMessageFailure(a_Split[3] .. " isn't a valid number") + return true + end + + Item.m_ItemCount = Count + end + + -- Remove the item: + local NumRemovedItems = a_Player:GetInventory():RemoveItem(Item) + a_Player:SendMessageSuccess("Removed " .. NumRemovedItems .. " Items!") + return true +end + + + + + +function HandleRequest_Debuggers(a_Request) + local FolderContents = cFile:GetFolderContents("./"); + return "

    The following objects have been returned by cFile:GetFolderContents():

    • " .. table.concat(FolderContents, "
    • ") .. "

    "; +end + + + + + +local g_Counter = 0 +local g_JavaScript = +[[ + +]] + +function HandleRequest_StressTest(a_Request) + if (a_Request.PostParams["counter"]) then + g_Counter = g_Counter + 1 + return tostring(g_Counter) + end + return g_JavaScript .. "

    The counter below should be reloading as fast as possible

    0
    " +end + + + + + +function OnPluginMessage(a_Client, a_Channel, a_Message) + LOGINFO("Received a plugin message from client " .. a_Client:GetUsername() .. ": channel '" .. a_Channel .. "', message '" .. a_Message .. "'"); + + if (a_Channel == "REGISTER") then + if (a_Message:find("WECUI")) then + -- The client has WorldEditCUI mod installed, test the comm by sending a few WECUI messages: + --[[ + WECUI messages have the following generic format: + | + If shape is p (cuboid selection), the params are sent individually for each corner click and have the following format: + |||| + point-index is 0 or 1 (lclk / rclk) + volume is the 3D volume of the current cuboid selected (all three coords' deltas multiplied), including the edge blocks; -1 if N/A + --]] + -- Select a 51 * 51 * 51 block cuboid: + a_Client:SendPluginMessage("WECUI", "p|0|50|50|50|-1"); + a_Client:SendPluginMessage("WECUI", "p|1|100|100|100|132651"); -- 132651 = 51 * 51 * 51 + end + end +end + + + + + +function HandleChunkStay(a_Split, a_Player) + -- As an example of using ChunkStay, this call will load 3x3 chunks around the specified chunk coords, + -- then build an obsidian pillar in the middle of each one. + -- Once complete, the player will be teleported to the middle pillar + + if (#a_Split ~= 3) then + a_Player:SendMessageInfo("Usage: /cs ") + return true + end + + local ChunkX = tonumber(a_Split[2]) + local ChunkZ = tonumber(a_Split[3]) + if ((ChunkX == nil) or (ChunkZ == nil)) then + a_Player:SendMessageFailure("Invalid chunk coords.") + return true + end + + local World = a_Player:GetWorld() + local PlayerID = a_Player:GetUniqueID() + a_Player:SendMessageInfo("Loading chunks, stand by..."); + + -- Set the wanted chunks: + local Chunks = {} + for z = -1, 1 do for x = -1, 1 do + table.insert(Chunks, {ChunkX + x, ChunkZ + z}) + end end + + -- The function that is called when all chunks are available + -- Will perform the actual action with all those chunks + -- Note that the player needs to be referenced using their EntityID - in case they disconnect before the chunks load + local OnAllChunksAvailable = function() + LOGINFO("ChunkStay all chunks now available") + -- Build something on the neighboring chunks, to verify: + for z = -1, 1 do for x = -1, 1 do + local BlockX = (ChunkX + x) * 16 + 8 + local BlockZ = (ChunkZ + z) * 16 + 8 + for y = 20, 80 do + World:SetBlock(BlockX, y, BlockZ, E_BLOCK_OBSIDIAN, 0) + end + end end + + -- Teleport the player there for visual inspection: + World:DoWithEntityByID(PlayerID, + function (a_CallbackPlayer) + a_CallbackPlayer:TeleportToCoords(ChunkX * 16 + 8, 85, ChunkZ * 16 + 8) + a_CallbackPlayer:SendMessageSuccess("ChunkStay fully available") + end + ) + end + + -- This function will be called for each chunk that is made available + -- Note that the player needs to be referenced using their EntityID - in case they disconnect before the chunks load + local OnChunkAvailable = function(a_ChunkX, a_ChunkZ) + LOGINFO("ChunkStay now has chunk [" .. a_ChunkX .. ", " .. a_ChunkZ .. "]") + World:DoWithEntityByID(PlayerID, + function (a_CallbackPlayer) + a_CallbackPlayer:SendMessageInfo("ChunkStay now has chunk [" .. a_ChunkX .. ", " .. a_ChunkZ .. "]") + end + ) + end + + -- Process the ChunkStay: + World:ChunkStay(Chunks, OnChunkAvailable, OnAllChunksAvailable) + return true +end + + + + + +function HandleCompo(a_Split, a_Player) + -- Send one composite message to self: + local msg = cCompositeChat() + msg:AddTextPart("Hello! ", "b@e") -- bold yellow + msg:AddUrlPart("MCServer", "http://mc-server.org") + msg:AddTextPart(" rules! ") + msg:AddRunCommandPart("Set morning", "/time set 0") + a_Player:SendMessage(msg) + + -- Broadcast another one to the world: + local msg2 = cCompositeChat() + msg2:AddSuggestCommandPart(a_Player:GetName(), "/tell " .. a_Player:GetName() .. " ") + msg2:AddTextPart(" knows how to use cCompositeChat!"); + a_Player:GetWorld():BroadcastChat(msg2) + + return true +end + + + + + +function HandleSetBiome(a_Split, a_Player) + local Biome = biJungle + local Size = 20 + local SplitSize = #a_Split + if (SplitSize > 3) then + a_Player:SendMessage("Too many parameters. Usage: " .. a_Split[1] .. " ") + return true + end + + if (SplitSize >= 2) then + Biome = StringToBiome(a_Split[2]) + if (Biome == biInvalidBiome) then + a_Player:SendMessage("Unknown biome: '" .. a_Split[2] .. "'. Command ignored.") + return true + end + end + if (SplitSize >= 3) then + Size = tostring(a_Split[3]) + if (Size == nil) then + a_Player:SendMessage("Unknown size: '" .. a_Split[3] .. "'. Command ignored.") + return true + end + end + + local BlockX = math.floor(a_Player:GetPosX()) + local BlockZ = math.floor(a_Player:GetPosZ()) + a_Player:GetWorld():SetAreaBiome(BlockX - Size, BlockX + Size, BlockZ - Size, BlockZ + Size, Biome) + a_Player:SendMessage( + "Blocks {" .. (BlockX - Size) .. ", " .. (BlockZ - Size) .. + "} - {" .. (BlockX + Size) .. ", " .. (BlockZ + Size) .. + "} set to biome #" .. tostring(Biome) .. "." + ) + return true +end + + + + + +function HandleWESel(a_Split, a_Player) + -- Check if the selection is a cuboid: + local IsCuboid = cPluginManager:CallPlugin("WorldEdit", "IsPlayerSelectionCuboid") + if (IsCuboid == nil) then + a_Player:SendMessage(cCompositeChat():SetMessageType(mtFailure):AddTextPart("Cannot adjust selection, WorldEdit is not loaded")) + return true + elseif (IsCuboid == false) then + a_Player:SendMessage(cCompositeChat():SetMessageType(mtFailure):AddTextPart("Cannot adjust selection, the selection is not a cuboid")) + return true + end + + -- Get the selection: + local SelCuboid = cCuboid() + local IsSuccess = cPluginManager:CallPlugin("WorldEdit", "GetPlayerCuboidSelection", a_Player, SelCuboid) + if not(IsSuccess) then + a_Player:SendMessage(cCompositeChat():SetMessageType(mtFailure):AddTextPart("Cannot adjust selection, WorldEdit reported failure while getting current selection")) + return true + end + + -- Adjust the selection: + local NumBlocks = tonumber(a_Split[2] or "1") or 1 + SelCuboid:Expand(NumBlocks, NumBlocks, 0, 0, NumBlocks, NumBlocks) + + -- Set the selection: + IsSuccess = cPluginManager:CallPlugin("WorldEdit", "SetPlayerCuboidSelection", a_Player, SelCuboid) + if not(IsSuccess) then + a_Player:SendMessage(cCompositeChat():SetMessageType(mtFailure):AddTextPart("Cannot adjust selection, WorldEdit reported failure while setting new selection")) + return true + end + a_Player:SendMessage(cCompositeChat():SetMessageType(mtInformation):AddTextPart("Successfully adjusted the selection by " .. NumBlocks .. " block(s)")) + return true +end + + + + + +function OnPlayerJoined(a_Player) + -- Test composite chat chaining: + a_Player:SendMessage(cCompositeChat() + :AddTextPart("Hello, ") + :AddUrlPart(a_Player:GetName(), "http://www.mc-server.org", "u@2") + :AddSuggestCommandPart(", and welcome.", "/help", "u") + :AddRunCommandPart(" SetDay", "/time set 0") + ) +end + + + + + +function OnProjectileHitBlock(a_Projectile, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_BlockHitPos) + -- Test projectile hooks by setting the blocks they hit on fire: + local BlockX, BlockY, BlockZ = AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace) + local World = a_Projectile:GetWorld() + + World:SetBlock(BlockX, BlockY, BlockZ, E_BLOCK_FIRE, 0) +end + + + + + +function OnChunkUnloading(a_World, a_ChunkX, a_ChunkZ) + -- Do not let chunk [0, 0] unload, so that it continues ticking [cWorld:SetChunkAlwaysTicked() test] + if ((a_ChunkX == 0) and (a_ChunkZ == 0)) then + return true + end +end + + + + + +function OnWorldStarted(a_World) + -- Make the chunk [0, 0] in every world keep ticking [cWorld:SetChunkAlwaysTicked() test] + a_World:ChunkStay({{0, 0}}, nil, + function() + -- The chunk is loaded, make it always tick: + a_World:SetChunkAlwaysTicked(0, 0, true) + end + ) +end + + + + + +function OnProjectileHitBlock(a_ProjectileEntity, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_BlockHitPos) + -- This simple test is for testing issue #1326 - simply declaring this hook would crash the server upon call + LOG("Projectile hit block") + LOG(" Projectile EntityID: " .. a_ProjectileEntity:GetUniqueID()) + LOG(" Block: {" .. a_BlockX .. ", " .. a_BlockY .. ", " .. a_BlockZ .. "}, face " .. a_BlockFace) + LOG(" HitPos: {" .. a_BlockHitPos.x .. ", " .. a_BlockHitPos.y .. ", " .. a_BlockHitPos.z .. "}") +end + + + + + +local PossibleItems = +{ + cItem(E_ITEM_DIAMOND), + cItem(E_ITEM_GOLD), + cItem(E_ITEM_IRON), + cItem(E_ITEM_DYE, 1, E_META_DYE_BLUE), -- Lapis lazuli + cItem(E_ITEM_COAL), +} + + + + + +function HandlePickups(a_Split, a_Player) + local PlayerX = a_Player:GetPosX() + local PlayerY = a_Player:GetPosY() + local PlayerZ = a_Player:GetPosZ() + local World = a_Player:GetWorld() + local Range = 12 + for x = 0, Range do for z = 0, Range do + local px = PlayerX + x - Range / 2 + local pz = PlayerZ + z - Range / 2 + local Items = cItems() + Items:Add(PossibleItems[math.random(#PossibleItems)]) + World:SpawnItemPickups(Items, px, PlayerY, pz, 0) + end end -- for z, for x + return true +end + + + + +function HandlePoof(a_Split, a_Player) + local PlayerPos = Vector3d(a_Player:GetPosition()) -- Create a copy of the position + PlayerPos.y = PlayerPos.y - 1 + local Box = cBoundingBox(PlayerPos, 4, 2) + local NumEntities = 0 + a_Player:GetWorld():ForEachEntityInBox(Box, + function (a_Entity) + if not(a_Entity:IsPlayer()) then + local AddSpeed = a_Entity:GetPosition() - PlayerPos -- Speed away from the player + a_Entity:AddSpeed(AddSpeed * 32 / (AddSpeed:SqrLength() + 1)) -- The further away, the less speed to add + NumEntities = NumEntities + 1 + end + end + ) + a_Player:SendMessage("Poof! (" .. NumEntities .. " entities)") + return true +end + + + + + +-- List of hashing functions to test: +local HashFunctions = +{ + {"md5", md5 }, + {"cCryptoHash.md5", cCryptoHash.md5 }, + {"cCryptoHash.md5HexString", cCryptoHash.md5HexString }, + {"cCryptoHash.sha1", cCryptoHash.sha1 }, + {"cCryptoHash.sha1HexString", cCryptoHash.sha1HexString }, +} + +-- List of strings to try hashing: +local HashExamples = +{ + "", + "\0", + "test", +} + +function HandleConsoleHash(a_Split) + for _, str in ipairs(HashExamples) do + LOG("Hashing string \"" .. str .. "\":") + for _, hash in ipairs(HashFunctions) do + if not(hash[2]) then + LOG("Hash function " .. hash[1] .. " doesn't exist in the API!") + else + LOG(hash[1] .. "() = " .. hash[2](str)) + end + end -- for hash - HashFunctions[] + end -- for str - HashExamples[] + return true +end + + + + + +--- Monitors the state of the "inh" entity-spawning hook +-- if false, the hook is installed before the "inh" command processing +local isInhHookInstalled = false + +function HandleConsoleInh(a_Split, a_FullCmd) + -- Check the param: + local kindStr = a_Split[2] or "pkArrow" + local kind = cProjectileEntity[kindStr] + if (kind == nil) then + return true, "There's no projectile kind '" .. kindStr .. "'." + end + + -- Get the world to test in: + local world = cRoot:Get():GetDefaultWorld() + if (world == nil) then + return true, "Cannot test inheritance, no default world" + end + + -- Install the hook, if needed: + if not(isInhHookInstalled) then + cPluginManager:AddHook(cPluginManager.HOOK_SPAWNING_ENTITY, + function (a_CBWorld, a_CBEntity) + LOG("New entity is spawning:") + LOG(" Lua type: '" .. type(a_CBEntity) .. "'") + LOG(" ToLua type: '" .. tolua.type(a_CBEntity) .. "'") + LOG(" GetEntityType(): '" .. a_CBEntity:GetEntityType() .. "'") + LOG(" GetClass(): '" .. a_CBEntity:GetClass() .. "'") + end + ) + isInhHookInstalled = true + end + + -- Create the projectile: + LOG("Creating a " .. kindStr .. " projectile in world " .. world:GetName() .. "...") + local msg + world:ChunkStay({{0, 0}}, + nil, + function () + -- Create a projectile at {8, 100, 8}: + local entityID = world:CreateProjectile(8, 100, 8, kind, nil, nil) + if (entityID < 0) then + msg = "Cannot test inheritance, projectile creation failed." + return + end + LOG("Entity created, ID #" .. entityID) + + -- Call a function on the newly created entity: + local hasExecutedCallback = false + world:DoWithEntityByID( + entityID, + function (a_CBEntity) + LOG("Projectile created and found using the DoWithEntityByID() callback") + LOG("Lua type: '" .. type(a_CBEntity) .. "'") + LOG("ToLua type: '" .. tolua.type(a_CBEntity) .. "'") + LOG("GetEntityType(): '" .. a_CBEntity:GetEntityType() .. "'") + LOG("GetClass(): '" .. a_CBEntity:GetClass() .. "'") + hasExecutedCallback = true + end + ) + if not(hasExecutedCallback) then + msg = "The callback failed to execute" + return + end + + msg = "Inheritance test finished" + end + ) + + return true, msg +end + + + + + +function HandleConsoleLoadChunk(a_Split) + -- Check params: + local numParams = #a_Split + if (numParams ~= 3) and (numParams ~= 4) then + return true, "Usage: " .. a_Split[1] .. " []" + end + + -- Get the chunk coords: + local chunkX = tonumber(a_Split[2]) + if (chunkX == nil) then + return true, "Not a number: '" .. a_Split[2] .. "'" + end + local chunkZ = tonumber(a_Split[3]) + if (chunkZ == nil) then + return true, "Not a number: '" .. a_Split[3] .. "'" + end + + -- Get the world: + local world + if (a_Split[4] == nil) then + world = cRoot:Get():GetDefaultWorld() + else + world = cRoot:Get():GetWorld(a_Split[4]) + if (world == nil) then + return true, "There's no world named '" .. a_Split[4] .. "'." + end + end + + -- Queue a ChunkStay for the chunk, log a message when the chunk is loaded: + world:ChunkStay({{chunkX, chunkZ}}, nil, + function() + LOG("Chunk [" .. chunkX .. ", " .. chunkZ .. "] is loaded") + end + ) + return true +end + + + + + +function HandleConsolePrepareChunk(a_Split) + -- Check params: + local numParams = #a_Split + if (numParams ~= 3) and (numParams ~= 4) then + return true, "Usage: " .. a_Split[1] .. " []" + end + + -- Get the chunk coords: + local chunkX = tonumber(a_Split[2]) + if (chunkX == nil) then + return true, "Not a number: '" .. a_Split[2] .. "'" + end + local chunkZ = tonumber(a_Split[3]) + if (chunkZ == nil) then + return true, "Not a number: '" .. a_Split[3] .. "'" + end + + -- Get the world: + local world + if (a_Split[4] == nil) then + world = cRoot:Get():GetDefaultWorld() + else + world = cRoot:Get():GetWorld(a_Split[4]) + if (world == nil) then + return true, "There's no world named '" .. a_Split[4] .. "'." + end + end + + -- Queue the chunk for preparing, log a message when prepared: + world:PrepareChunk(chunkX, chunkZ, + function(a_CBChunkX, a_CBChunkZ) + LOG("Chunk [" .. chunkX .. ", " .. chunkZ .. "] has been prepared") + end + ) + return true +end + + + + + +function HandleConsoleSchedule(a_Split) + local prev = os.clock() + LOG("Scheduling a task for 2 seconds in the future (current os.clock is " .. prev .. ")") + cRoot:Get():GetDefaultWorld():ScheduleTask(40, + function () + local current = os.clock() + local diff = current - prev + LOG("Scheduled function is called. Current os.clock is " .. current .. ", difference is " .. diff .. ")") + end + ) + return true, "Task scheduled" +end + + + + + +--- Returns the square of the distance from the specified point to the specified line +local function SqDistPtFromLine(x, y, x1, y1, x2, y2) + local dx = x - x1 + local dy = y - y1 + local px = x2 - x1 + local py = y2 - y1 + local ss = px * dx + py * dy + local ds = px * px + py * py + + if (ss < 0) then + -- Return sqdistance from point 1 + return dx * dx + dy * dy + end + if (ss > ds) then + -- Return sqdistance from point 2 + return ((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y)) + end + + -- Return sqdistance from the line + if ((px * px + py * py) == 0) then + return dx * dx + dy * dy + else + return (py * dx - px * dy) * (py * dx - px * dy) / (px * px + py * py) + end +end + + + + + +function HandleConsoleTestTracer(a_Split, a_EntireCmd) + -- Check required params: + if not(a_Split[7]) then + return true, "Usage: " .. a_Split[1] .. " []" + end + local Coords = {} + for i = 1, 6 do + local v = tonumber(a_Split[i + 1]) + if not(v) then + return true, "Parameter " .. (i + 1) .. " (" .. tostring(a_Split[i + 1]) .. ") not a number " + end + Coords[i] = v + end + + -- Get the world in which to test: + local World + if (a_Split[8]) then + World = cRoot:GetWorld(a_Split[2]) + else + World = cRoot:Get():GetDefaultWorld() + end + if not(World) then + return true, "No such world" + end + + -- Define the callbacks to use for tracing: + local Callbacks = + { + OnNextBlock = function(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_EntryFace) + LOG(string.format("{%d, %d, %d}: %s", a_BlockX, a_BlockY, a_BlockZ, ItemToString(cItem(a_BlockType, 1, a_BlockMeta)))) + end, + OnNextBlockNoData = function(a_BlockX, a_BlockY, a_BlockZ, a_EntryFace) + LOG(string.format("{%d, %d, %d} (no data)", a_BlockX, a_BlockY, a_BlockZ)) + end, + OnNoChunk = function() + LOG("Chunk not loaded") + end, + OnNoMoreHits = function() + LOG("Trace finished") + end, + OnOutOfWorld = function() + LOG("Out of world") + end, + OnIntoWorld = function() + LOG("Into world") + end, + } + + -- Approximate the chunks needed for the trace by iterating over all chunks and measuring their center's distance from the traced line + local Chunks = {} + local sx = math.floor(Coords[1] / 16) + local sz = math.floor(Coords[3] / 16) + local ex = math.floor(Coords[4] / 16) + local ez = math.floor(Coords[6] / 16) + local sgnx = (sx < ex) and 1 or -1 + local sgnz = (sz < ez) and 1 or -1 + for z = sz, ez, sgnz do + local ChunkCenterZ = z * 16 + 8 + for x = sx, ex, sgnx do + local ChunkCenterX = x * 16 + 8 + local sqdist = SqDistPtFromLine(ChunkCenterX, ChunkCenterZ, Coords[1], Coords[3], Coords[4], Coords[6]) + if (sqdist <= 128) then + table.insert(Chunks, {x, z}) + end + end + end + + -- Load the chunks and do the trace once loaded: + World:ChunkStay(Chunks, + nil, + function() + cLineBlockTracer:Trace(World, Callbacks, Coords[1], Coords[2], Coords[3], Coords[4], Coords[5], Coords[6]) + end + ) + return true +end + + + + + +function HandleConsoleBBox(a_Split) + local bbox = cBoundingBox(0, 10, 0, 10, 0, 10) + local v1 = Vector3d(1, 1, 1) + local v2 = Vector3d(5, 5, 5) + local v3 = Vector3d(11, 11, 11) + + if (bbox:IsInside(v1)) then + LOG("v1 is inside bbox") + else + LOG("v1 is not inside bbox") + end + + if (bbox:IsInside(v2)) then + LOG("v2 is inside bbox") + else + LOG("v2 is not inside bbox") + end + + if (bbox:IsInside(v3)) then + LOG("v3 is inside bbox") + else + LOG("v3 is not inside bbox") + end + + if (bbox:IsInside(v1, v2)) then + LOG("v1*v2 is inside bbox") + else + LOG("v1*v2 is not inside bbox") + end + + if (bbox:IsInside(v2, v1)) then + LOG("v2*v1 is inside bbox") + else + LOG("v2*v1 is not inside bbox") + end + + if (bbox:IsInside(v1, v3)) then + LOG("v1*v3 is inside bbox") + else + LOG("v1*v3 is not inside bbox") + end + + if (bbox:IsInside(v2, v3)) then + LOG("v2*v3 is inside bbox") + else + LOG("v2*v3 is not inside bbox") + end + + return true +end + + + + diff --git a/Server/Plugins/Debuggers/Info.lua b/Server/Plugins/Debuggers/Info.lua new file mode 100644 index 000000000..a76690ea1 --- /dev/null +++ b/Server/Plugins/Debuggers/Info.lua @@ -0,0 +1,249 @@ + +-- Info.lua + +-- Implements the g_PluginInfo standard plugin description + + + + + +g_PluginInfo = +{ + Name = "Debuggers", + Version = "14", + Date = "2014-12-11", + Description = [[Contains code for testing and debugging the server. Should not be enabled on a production server!]], + + Commands = + { + ["/arr"] = + { + Permission = "debuggers", + Handler = HandleArrowCmd, + HelpString = "Creates an arrow going away from the player" + }, + ["/compo"] = + { + Permission = "debuggers", + Handler = HandleCompo, + HelpString = "Tests the cCompositeChat bindings" + }, + ["/cstay"] = + { + Permission = "debuggers", + Handler = HandleChunkStay, + HelpString = "Tests the ChunkStay Lua integration for the specified chunk coords" + }, + ["/dash"] = + { + Permission = "debuggers", + Handler = HandleDashCmd, + HelpString = "Switches between fast and normal sprinting speed" + }, + ["/ench"] = + { + Permission = "debuggers", + Handler = HandleEnchCmd, + HelpString = "Provides an instant dummy enchantment window" + }, + ["/fast"] = + { + Permission = "debuggers", + Handler = HandleFastCmd, + HelpString = "Switches between fast and normal movement speed" + }, + ["/fb"] = + { + Permission = "debuggers", + Handler = HandleFireballCmd, + HelpString = "Creates a ghast fireball as if shot by the player" + }, + ["/ff"] = + { + Permission = "debuggers", + Handler = HandleFurnaceFuel, + HelpString = "Shows how long the currently held item would burn in a furnace" + }, + ["/fill"] = + { + Permission = "debuggers", + Handler = HandleFill, + HelpString = "Fills all block entities in current chunk with junk" + }, + ["/fl"] = + { + Permission = "debuggers", + Handler = HandleFoodLevelCmd, + HelpString = "Sets the food level to the given value" + }, + ["/fr"] = + { + Permission = "debuggers", + Handler = HandleFurnaceRecipe, + HelpString = "Shows the furnace recipe for the currently held item" + }, + ["/fs"] = + { + Permission = "debuggers", + Handler = HandleFoodStatsCmd, + HelpString = "Turns regular foodstats message on or off" + }, + ["/gc"] = + { + Permission = "debuggers", + Handler = HandleGCCmd, + HelpString = "Activates the Lua garbage collector" + }, + ["/hunger"] = + { + Permission = "debuggers", + Handler = HandleHungerCmd, + HelpString = "Lists the current hunger-related variables" + }, + ["/ke"] = + { + Permission = "debuggers", + Handler = HandleKillEntitiesCmd, + HelpString = "Kills all the loaded entities" + }, + ["/le"] = + { + Permission = "debuggers", + Handler = HandleListEntitiesCmd, + HelpString = "Shows a list of all the loaded entities" + }, + ["/nick"] = + { + Permission = "debuggers", + Handler = HandleNickCmd, + HelpString = "Gives you a custom name", + }, + ["/pickups"] = + { + Permission = "debuggers", + Handler = HandlePickups, + HelpString = "Spawns random pickups around you" + }, + ["/poison"] = + { + Permission = "debuggers", + Handler = HandlePoisonCmd, + HelpString = "Sets food-poisoning for 15 seconds" + }, + ["/poof"] = + { + Permission = "debuggers", + Handler = HandlePoof, + HelpString = "Nudges pickups close to you away from you" + }, + ["/rmitem"] = + { + Permission = "debuggers", + Handler = HandleRMItem, + HelpString = "Remove the specified item from the inventory." + }, + ["/sb"] = + { + Permission = "debuggers", + Handler = HandleSetBiome, + HelpString = "Sets the biome around you to the specified one" + }, + ["/sched"] = + { + Permission = "debuggers", + Handler = HandleSched, + HelpString = "Schedules a simple countdown using cWorld:ScheduleTask()" + }, + ["/spidey"] = + { + Permission = "debuggers", + Handler = HandleSpideyCmd, + HelpString = "Shoots a line of web blocks until it hits non-air" + }, + ["/starve"] = + { + Permission = "debuggers", + Handler = HandleStarveCmd, + HelpString = "Sets the food level to zero" + }, + ["/testwnd"] = + { + Permission = "debuggers", + Handler = HandleTestWndCmd, + HelpString = "Opens up a window using plugin API" + }, + ["/wesel"] = + { + Permission = "debuggers", + Handler = HandleWESel, + HelpString = "Expands the current WE selection by 1 block in X/Z" + }, + ["/wool"] = + { + Permission = "debuggers", + Handler = HandleWoolCmd, + HelpString = "Sets all your armor to blue wool" + }, + ["/xpa"] = + { + Permission = "debuggers", + Handler = HandleAddExperience, + HelpString = "Adds 200 experience to the player" + }, + ["/xpr"] = + { + Permission = "debuggers", + Handler = HandleRemoveXp, + HelpString = "Remove all xp" + }, + }, -- Commands + + ConsoleCommands = + { + ["bbox"] = + { + Handler = HandleConsoleBBox, + HelpString = "Performs cBoundingBox API tests", + }, + + ["hash"] = + { + Handler = HandleConsoleHash, + HelpString = "Tests the crypto hashing functions", + }, + + ["inh"] = + { + Handler = HandleConsoleInh, + HelpString = "Tests the bindings of the cEntity inheritance", + }, + + ["loadchunk"] = + { + Handler = HandleConsoleLoadChunk, + HelpString = "Loads the specified chunk into memory", + }, + + ["preparechunk"] = + { + Handler = HandleConsolePrepareChunk, + HelpString = "Prepares the specified chunk completely (load / gen / light)", + }, + + ["sched"] = + { + Handler = HandleConsoleSchedule, + HelpString = "Tests the world scheduling", + }, + + ["testtracer"] = + { + Handler = HandleConsoleTestTracer, + HelpString = "Tests the cLineBlockTracer", + } + }, -- ConsoleCommands +} -- g_PluginInfo + + + + diff --git a/Server/Plugins/DiamondMover/DiamondMover.lua b/Server/Plugins/DiamondMover/DiamondMover.lua new file mode 100644 index 000000000..d3e70acfc --- /dev/null +++ b/Server/Plugins/DiamondMover/DiamondMover.lua @@ -0,0 +1,85 @@ + +-- DiamondMover.lua + +-- An example Lua plugin using the cBlockArea object +-- When a player rclks with a diamond in their hand, an area around the clicked block is moved in the direction the player is facing + + + + + +-- Global variables +MOVER_SIZE_X = 4; +MOVER_SIZE_Y = 4; +MOVER_SIZE_Z = 4; + + + + + +function Initialize(Plugin) + Plugin:SetName("DiamondMover"); + Plugin:SetVersion(1); + + cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_USED_ITEM, OnPlayerUsedItem); + + LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion()); + return true; +end + + + + + +function OnPlayerUsedItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ) + + -- Don't check if the direction is in the air + if (BlockFace == -1) then + return false; + end; + + if (not Player:HasPermission("diamondmover.move")) then + return false; + end; + + -- Rclk with a diamond to push in the direction the player is facing + if (Player:GetEquippedItem().m_ItemType == E_ITEM_DIAMOND) then + local Area = cBlockArea(); + Area:Read(Player:GetWorld(), + BlockX - MOVER_SIZE_X, BlockX + MOVER_SIZE_X, + BlockY - MOVER_SIZE_Y, BlockY + MOVER_SIZE_Y, + BlockZ - MOVER_SIZE_Z, BlockZ + MOVER_SIZE_Z + ); + + local PlayerPitch = Player:GetPitch(); + if (PlayerPitch < -70) then -- looking up + BlockY = BlockY + 1; + else + if (PlayerPitch > 70) then -- looking down + BlockY = BlockY - 1; + else + local PlayerRot = Player:GetYaw() + 180; -- Convert [-180, 180] into [0, 360] for simpler conditions + if ((PlayerRot < 45) or (PlayerRot > 315)) then + BlockZ = BlockZ - 1; + else + if (PlayerRot < 135) then + BlockX = BlockX + 1; + else + if (PlayerRot < 225) then + BlockZ = BlockZ + 1; + else + BlockX = BlockX - 1; + end; + end; + end; + end; + end; + + Area:Write(Player:GetWorld(), BlockX - MOVER_SIZE_X, BlockY - MOVER_SIZE_Y, BlockZ - MOVER_SIZE_Z); + return false; + end +end + + + + diff --git a/Server/Plugins/DumpInfo/Init.lua b/Server/Plugins/DumpInfo/Init.lua new file mode 100644 index 000000000..2c5998e36 --- /dev/null +++ b/Server/Plugins/DumpInfo/Init.lua @@ -0,0 +1,52 @@ +function Initialize(a_Plugin) + a_Plugin:SetName("DumpInfo") + a_Plugin:SetVersion(1) + + -- Check if the infodump file exists. + if (not cFile:Exists("Plugins/InfoDump.lua")) then + LOGWARN("[DumpInfo] InfoDump.lua was not found.") + return false + end + + -- Add the webtab. + a_Plugin:AddWebTab("DumpPlugin", HandleDumpPluginRequest) + return true +end + + + + + +function HandleDumpPluginRequest(a_Request) + local Content = "" + + -- Check if it already was requested to dump a plugin. + if (a_Request.PostParams["DumpInfo"] ~= nil) then + local F = loadfile("Plugins/InfoDump.lua") + F("Plugins/" .. a_Request.PostParams["DumpInfo"]) + end + + Content = Content .. [[ + + + + ]] + + -- Loop through each plugin that is found. + cPluginManager:Get():ForEachPlugin( + function(a_Plugin) + -- Check if there is a file called 'Info.lua' + if (cFile:Exists("Plugins/" .. a_Plugin:GetName() .. "/Info.lua")) then + Content = Content .. "\n\n" + Content = Content .. "\t\n" + Content = Content .. "\t\n" + Content = Content .. "\n" + end + end + ) + + Content = Content .. [[ +
    DumpInfo
    " .. a_Plugin:GetName() .. "
    ]] + + return Content +end diff --git a/Server/Plugins/Handy b/Server/Plugins/Handy new file mode 160000 index 000000000..e64a04be3 --- /dev/null +++ b/Server/Plugins/Handy @@ -0,0 +1 @@ +Subproject commit e64a04be39ac7790abcb09de3d4c7d8fc2a2a1e2 diff --git a/Server/Plugins/HookNotify/HookNotify.lua b/Server/Plugins/HookNotify/HookNotify.lua new file mode 100644 index 000000000..411dbebbd --- /dev/null +++ b/Server/Plugins/HookNotify/HookNotify.lua @@ -0,0 +1,65 @@ + +-- HookNotify.lua + +--[[ +Implements the entire plugin + +NOTE: This plugin is not meant for production servers. It is used mainly by developers to verify that things +are working properly when implementing MCServer features. Do not enable this plugin on production servers! + +This plugin logs a notification for each hook that is being called by the server. +The TICK and WORLD_TICK hooks are disabled because they produce too much output. +--]] + + + + + +function Initialize(a_Plugin) + -- Notify the admin that HookNotify is installed, this is not meant for production servers + LOGINFO("HookNotify plugin is installed, beware, the log output may be quite large!"); + LOGINFO("You want this plugin enabled only when developing another plugin, not for regular gameplay."); + + -- These hooks will not be notified: + local hooksToIgnore = + { + ["HOOK_TICK"] = true, -- Too much spam + ["HOOK_WORLD_TICK"] = true, -- Too much spam + ["HOOK_TAKE_DAMAGE"] = true, -- Has a separate handler with more info logged + ["HOOK_MAX"] = true, -- No such hook, placeholder only + ["HOOK_NUM_HOOKS"] = true, -- No such hook, placeholder only + } + + -- Add all hooks: + for n, v in pairs(cPluginManager) do + if (n:match("HOOK_.*")) then + if not(hooksToIgnore[n]) then + LOG("Adding notification for hook " .. n .. " (" .. v .. ").") + cPluginManager.AddHook(v, + function (...) + LOG(n .. "(") + for i, param in ipairs(arg) do + LOG(" " .. i .. ": " .. tolua.type(param) .. ": " .. tostring(param)) + end + LOG(")"); + end -- hook handler + ) -- AddHook + end -- not (ignore) + end -- n matches "HOOK" + end -- for cPluginManager{} + + -- OnTakeDamage has a special handler listing the details of the damage dealt: + cPluginManager.AddHook(cPluginManager.HOOK_TAKE_DAMAGE, + function (a_Receiver, a_TDI) + -- a_Receiver is cPawn + -- a_TDI is TakeDamageInfo + + LOG("OnTakeDamage(): " .. a_Receiver:GetClass() .. " was dealt RawDamage " .. a_TDI.RawDamage .. ", FinalDamage " .. a_TDI.FinalDamage .. " (that is, " .. (a_TDI.RawDamage - a_TDI.FinalDamage) .. " HPs covered by armor)"); + end + ) + + return true +end + + + diff --git a/Server/Plugins/InfoDump.deproj b/Server/Plugins/InfoDump.deproj new file mode 100644 index 000000000..30003c36d --- /dev/null +++ b/Server/Plugins/InfoDump.deproj @@ -0,0 +1,6 @@ + + + + InfoDump.lua + + diff --git a/Server/Plugins/InfoDump.lua b/Server/Plugins/InfoDump.lua new file mode 100644 index 000000000..2c7fff163 --- /dev/null +++ b/Server/Plugins/InfoDump.lua @@ -0,0 +1,768 @@ +#!/usr/bin/lua + +-- InfoDump.lua + +--[[ +Loads plugins' Info.lua and dumps its g_PluginInfo into various text formats +This is used for generating plugin documentation for the forum and for GitHub's INFO.md files + +This script can be used in two ways: +Executing "lua InfoDump.lua" will go through all subfolders and dump each Info.lua file it can find + Note that this mode of operation requires LuaRocks with LFS installed; instructions are printed + when the prerequisites are not met. +Executing "lua InfoDump.lua PluginName" will load the Info.lua file from PluginName's folder and dump +only that one plugin's documentation. This mode of operation doesn't require LuaRocks +--]] + + + + + +-- If this file is called using the loadfile function the arg variable isn't filled. We have to do it manualy then. +local arg = arg or {...} + + + + + +-- Check Lua version. We use 5.1-specific construct when loading the plugin info, 5.2 is not compatible! +if (_VERSION ~= "Lua 5.1") then + print("Unsupported Lua version. This script requires Lua version 5.1, this Lua is version " .. (_VERSION or "")) + return +end + + + + + +--- Replaces generic formatting with forum-specific formatting +-- Also removes the single line-ends +local function ForumizeString(a_Str) + assert(type(a_Str) == "string") + + -- Remove the indentation, unless in the code tag: + -- Only one code or /code tag per line is supported! + local IsInCode = false + local function RemoveIndentIfNotInCode(s) + if (IsInCode) then + -- we're in code section, check if this line terminates it + IsInCode = (s:find("{%%/code}") ~= nil) + return s .. "\n" + else + -- we're not in code section, check if this line starts it + IsInCode = (s:find("{%%code}") ~= nil) + return s:gsub("^%s*", "") .. "\n" + end + end + a_Str = a_Str:gsub("(.-)\n", RemoveIndentIfNotInCode) + + -- Replace multiple line ends with {%p} and single line ends with a space, + -- so that manual word-wrap in the Info.lua file doesn't wrap in the forum. + a_Str = a_Str:gsub("\n\n", "{%%p}") + a_Str = a_Str:gsub("\n", " ") + + -- Replace the generic formatting: + a_Str = a_Str:gsub("{%%p}", "\n\n") + a_Str = a_Str:gsub("{%%b}", "[b]"):gsub("{%%/b}", "[/b]") + a_Str = a_Str:gsub("{%%i}", "[i]"):gsub("{%%/i}", "[/i]") + a_Str = a_Str:gsub("{%%list}", "\n[list]"):gsub("{%%/list}", "[/list]") + a_Str = a_Str:gsub("{%%li}", "\n[*]"):gsub("{%%/li}", "\n") + + -- Process links: {%a LinkDestination}LinkText{%/a} + a_Str = a_Str:gsub("{%%a%s([^}]*)}([^{]*){%%/a}", "[url=%1]%2[/url]") + + -- TODO: Other formatting + + return a_Str +end + + + + + +--- Replaces generic formatting with forum-specific formatting +-- Also removes the single line-ends +local function GithubizeString(a_Str) + assert(type(a_Str) == "string") + + -- Remove the indentation, unless in the code tag: + -- Only one code or /code tag per line is supported! + local IsInCode = false + local function RemoveIndentIfNotInCode(s) + if (IsInCode) then + -- we're in code section, check if this line terminates it + IsInCode = (s:find("{%%/code}") ~= nil) + return s .. "\n" + else + -- we're not in code section, check if this line starts it + IsInCode = (s:find("{%%code}") ~= nil) + return s:gsub("^%s*", "") .. "\n" + end + end + a_Str = a_Str:gsub("(.-)\n", RemoveIndentIfNotInCode) + + -- Replace multiple line ends with {%p} and single line ends with a space, + -- so that manual word-wrap in the Info.lua file doesn't wrap in the forum. + a_Str = a_Str:gsub("\n\n", "{%%p}") + a_Str = a_Str:gsub("\n", " ") + + -- Replace the generic formatting: + a_Str = a_Str:gsub("{%%p}", "\n\n") + a_Str = a_Str:gsub("{%%b}", "**"):gsub("{%%/b}", "**") + a_Str = a_Str:gsub("{%%i}", "*"):gsub("{%%/i}", "*") + a_Str = a_Str:gsub("{%%list}", "\n"):gsub("{%%/list}", "\n") + a_Str = a_Str:gsub("{%%li}", "\n - "):gsub("{%%/li}", "") + + -- Process links: {%a LinkDestination}LinkText{%/a} + a_Str = a_Str:gsub("{%%a%s([^}]*)}([^{]*){%%/a}", "[%2](%1)") + + -- TODO: Other formatting + + return a_Str +end + + + + + +--- Builds an array of categories, each containing all the commands belonging to the category, +-- and the category description, if available. +-- Returns the array table, each item has the following format: +-- { Name = "CategoryName", Description = "CategoryDescription", Commands = {{CommandString = "/cmd verb", Info = {...}}, ...}} +local function BuildCategories(a_PluginInfo) + -- The returned result + -- This will contain both an array and a dict of the categories, to allow fast search + local res = {} + + -- For each command add a reference to it into all of its categories: + local function AddCommands(a_CmdPrefix, a_Commands) + for cmd, info in pairs(a_Commands or {}) do + local NewCmd = + { + CommandString = a_CmdPrefix .. cmd, + Info = info, + } + + if ((info.HelpString ~= nil) and (info.HelpString ~= "")) then + -- Add to each specified category: + local Category = info.Category + if (type(Category) == "string") then + Category = {Category} + end + for idx, cat in ipairs(Category or {""}) do + local CatEntry = res[cat] + if (CatEntry == nil) then + -- First time we came across this category, create it: + local NewCat = {Name = cat, Description = "", Commands = {NewCmd}} + table.insert(res, NewCat) + res[cat] = NewCat + else + -- We already have this category, just add the command to its list of commands: + table.insert(CatEntry.Commands, NewCmd) + end + end -- for idx, cat - Category[] + end -- if (HelpString valid) + + -- Recurse all subcommands: + if (info.Subcommands ~= nil) then + AddCommands(a_CmdPrefix .. cmd .. " ", info.Subcommands) + end + end -- for cmd, info - a_Commands[] + end -- AddCommands() + + AddCommands("", a_PluginInfo.Commands) + + -- Assign descriptions to categories: + for name, desc in pairs(a_PluginInfo.Categories or {}) do + local CatEntry = res[name] + if (CatEntry ~= nil) then + -- The result has this category, add the description: + CatEntry.Description = desc.Description + end + end + + -- Alpha-sort each category's command list: + for idx, cat in ipairs(res) do + table.sort(cat.Commands, + function (cmd1, cmd2) + return (string.lower(cmd1.CommandString) < string.lower(cmd2.CommandString)) + end + ) + end + + return res +end + + + + + +--- Returns a string specifying the command. +-- If a_Command is a simple string, returns a_Command colorized to blue +-- If a_Command is a table, expects members Name (full command name) and Params (command parameters), +-- colorizes command name blue and params green +local function GetCommandRefForum(a_Command) + if (type(a_Command) == "string") then + return "[color=blue]" .. a_Command .. "[/color]" + end + return "[color=blue]" .. a_Command.Name .. "[/color] [color=green]" .. (a_Command.Params or "") .. "[/color]" +end + + + + + +--- Returns a string specifying the command. +-- If a_CommandParams is nil, returns a_CommandName apostrophed +-- If a_CommandParams is a string, apostrophes a_CommandName with a_CommandParams +local function GetCommandRefGithub(a_CommandName, a_CommandParams) + assert(type(a_CommandName) == "string") + if (a_CommandParams == nil) then + return "`" .. a_CommandName .. "`" + end + + assert(type(a_CommandParams) == "table") + if ((a_CommandParams.Params == nil) or (a_CommandParams.Params == "")) then + return "`" .. a_CommandName .. "`" + end + + assert(type(a_CommandParams.Params) == "string") + return "`" .. a_CommandName .. " " .. a_CommandParams.Params .. "`" +end + + + + + +--- Writes the specified command detailed help array to the output file, in the forum dump format +local function WriteCommandParameterCombinationsForum(a_CmdString, a_ParameterCombinations, f) + assert(type(a_CmdString) == "string") + assert(type(a_ParameterCombinations) == "table") + assert(f ~= nil) + + if (#a_ParameterCombinations == 0) then + -- No explicit parameter combinations to write + return + end + + f:write("The following parameter combinations are recognized:\n") + for idx, combination in ipairs(a_ParameterCombinations) do + f:write("[color=blue]", a_CmdString, "[/color] [color=green]", combination.Params or "", "[/color]") + if (combination.Help ~= nil) then + f:write(" - ", ForumizeString(combination.Help)) + end + if (combination.Permission ~= nil) then + f:write(" (Requires permission '[color=red]", combination.Permission, "[/color]')") + end + f:write("\n") + end +end + + + + + +--- Writes the specified command detailed help array to the output file, in the forum dump format +local function WriteCommandParameterCombinationsGithub(a_CmdString, a_ParameterCombinations, f) + assert(type(a_CmdString) == "string") + assert(type(a_ParameterCombinations) == "table") + assert(f ~= nil) + + if (#a_ParameterCombinations == 0) then + -- No explicit parameter combinations to write + return + end + + f:write("The following parameter combinations are recognized:\n\n") + for idx, combination in ipairs(a_ParameterCombinations) do + f:write(GetCommandRefGithub(a_CmdString, combination)) + if (combination.Help ~= nil) then + f:write(" - ", GithubizeString(combination.Help)) + end + if (combination.Permission ~= nil) then + f:write(" (Requires permission '**", combination.Permission, "**')") + end + f:write("\n") + end +end + + + + + +--- Writes all commands in the specified category to the output file, in the forum dump format +local function WriteCommandsCategoryForum(a_Category, f) + -- Write category name: + local CategoryName = a_Category.Name + if (CategoryName == "") then + CategoryName = "General" + end + f:write("\n[size=Large]", ForumizeString(a_Category.DisplayName or CategoryName), "[/size]\n") + + -- Write description: + if (a_Category.Description ~= "") then + f:write(ForumizeString(a_Category.Description), "\n") + end + + -- Write commands: + f:write("\n[list]") + for idx2, cmd in ipairs(a_Category.Commands) do + f:write("\n[b]", cmd.CommandString, "[/b] - ", ForumizeString(cmd.Info.HelpString or "UNDOCUMENTED"), "\n") + if (cmd.Info.Permission ~= nil) then + f:write("Permission required: [color=red]", cmd.Info.Permission, "[/color]\n") + end + if (cmd.Info.DetailedDescription ~= nil) then + f:write(ForumizeString(cmd.Info.DetailedDescription)) + end + if (cmd.Info.ParameterCombinations ~= nil) then + WriteCommandParameterCombinationsForum(cmd.CommandString, cmd.Info.ParameterCombinations, f) + end + end + f:write("[/list]\n\n") +end + + + + + +--- Writes all commands in the specified category to the output file, in the Github dump format +local function WriteCommandsCategoryGithub(a_Category, f) + -- Write category name: + local CategoryName = a_Category.Name + if (CategoryName == "") then + CategoryName = "General" + end + f:write("\n### ", GithubizeString(a_Category.DisplayName or CategoryName), "\n") + + -- Write description: + if (a_Category.Description ~= "") then + f:write(GithubizeString(a_Category.Description), "\n\n") + end + + f:write("| Command | Permission | Description |\n") + f:write("| ------- | ---------- | ----------- |\n") + + -- Write commands: + for idx2, cmd in ipairs(a_Category.Commands) do + f:write("|", cmd.CommandString, " | ", cmd.Info.Permission or "", " | ", GithubizeString(cmd.Info.HelpString or "UNDOCUMENTED"), "|\n") + end + f:write("\n\n") +end + + + + + +local function DumpCommandsForum(a_PluginInfo, f) + -- Copy all Categories from a dictionary into an array: + local Categories = BuildCategories(a_PluginInfo) + + -- Sort the categories by name: + table.sort(Categories, + function(cat1, cat2) + return (string.lower(cat1.Name) < string.lower(cat2.Name)) + end + ) + + if (#Categories == 0) then + return + end + + f:write("\n[size=X-Large]Commands[/size]\n") + + -- Dump per-category commands: + for idx, cat in ipairs(Categories) do + WriteCommandsCategoryForum(cat, f) + end +end + + + + + +local function DumpCommandsGithub(a_PluginInfo, f) + -- Copy all Categories from a dictionary into an array: + local Categories = BuildCategories(a_PluginInfo) + + -- Sort the categories by name: + table.sort(Categories, + function(cat1, cat2) + return (string.lower(cat1.Name) < string.lower(cat2.Name)) + end + ) + + if (#Categories == 0) then + return + end + + f:write("\n# Commands\n") + + -- Dump per-category commands: + for idx, cat in ipairs(Categories) do + WriteCommandsCategoryGithub(cat, f) + end +end + + + + + +local function DumpAdditionalInfoForum(a_PluginInfo, f) + local AInfo = a_PluginInfo.AdditionalInfo + if (type(AInfo) ~= "table") then + -- There is no AdditionalInfo in a_PluginInfo + return + end + + for idx, info in ipairs(a_PluginInfo.AdditionalInfo) do + if ((info.Title ~= nil) and (info.Contents ~= nil)) then + f:write("\n[size=X-Large]", ForumizeString(info.Title), "[/size]\n") + f:write(ForumizeString(info.Contents), "\n") + end + end +end + + + + + +local function DumpAdditionalInfoGithub(a_PluginInfo, f) + local AInfo = a_PluginInfo.AdditionalInfo + if (type(AInfo) ~= "table") then + -- There is no AdditionalInfo in a_PluginInfo + return + end + + for idx, info in ipairs(a_PluginInfo.AdditionalInfo) do + if ((info.Title ~= nil) and (info.Contents ~= nil)) then + f:write("\n# ", GithubizeString(info.Title), "\n") + f:write(GithubizeString(info.Contents), "\n") + end + end +end + + + + + +--- Collects all permissions mentioned in the info, returns them as a sorted array +-- Each array item is {Name = "PermissionName", Info = { PermissionInfo }} +local function BuildPermissions(a_PluginInfo) + -- Collect all used permissions from Commands, reference the commands that use the permission: + local Permissions = a_PluginInfo.Permissions or {} + local function CollectPermissions(a_CmdPrefix, a_Commands) + for cmd, info in pairs(a_Commands or {}) do + CommandString = a_CmdPrefix .. cmd + if ((info.Permission ~= nil) and (info.Permission ~= "")) then + -- Add the permission to the list of permissions: + local Permission = Permissions[info.Permission] or {} + Permissions[info.Permission] = Permission + -- Add the command to the list of commands using this permission: + Permission.CommandsAffected = Permission.CommandsAffected or {} + -- First, make sure that we don't already have this command in the list, + -- it may have already been present in a_PluginInfo + local NewCommand = true + for _, existCmd in ipairs(Permission.CommandsAffected) do + if CommandString == existCmd then + NewCommand = false + break + end + end + if NewCommand then + table.insert(Permission.CommandsAffected, CommandString) + end + end + + -- Process the command param combinations for permissions: + local ParamCombinations = info.ParameterCombinations or {} + for idx, comb in ipairs(ParamCombinations) do + if ((comb.Permission ~= nil) and (comb.Permission ~= "")) then + -- Add the permission to the list of permissions: + local Permission = Permissions[comb.Permission] or {} + Permissions[info.Permission] = Permission + -- Add the command to the list of commands using this permission: + Permission.CommandsAffected = Permission.CommandsAffected or {} + table.insert(Permission.CommandsAffected, {Name = CommandString, Params = comb.Params}) + end + end + + -- Process subcommands: + if (info.Subcommands ~= nil) then + CollectPermissions(CommandString .. " ", info.Subcommands) + end + end + end + CollectPermissions("", a_PluginInfo.Commands) + + -- Copy the list of permissions to an array: + local PermArray = {} + for name, perm in pairs(Permissions) do + table.insert(PermArray, {Name = name, Info = perm}) + end + + -- Sort the permissions array: + table.sort(PermArray, + function(p1, p2) + return (p1.Name < p2.Name) + end + ) + return PermArray +end + + + + + +local function DumpPermissionsForum(a_PluginInfo, f) + -- Get the processed sorted array of permissions: + local Permissions = BuildPermissions(a_PluginInfo) + if ((Permissions == nil) or (#Permissions <= 0)) then + return + end + + -- Dump the permissions: + f:write("\n[size=X-Large]Permissions[/size]\n[list]\n") + for idx, perm in ipairs(Permissions) do + f:write(" - [color=red]", perm.Name, "[/color] - ") + f:write(ForumizeString(perm.Info.Description or "")) + local CommandsAffected = perm.Info.CommandsAffected or {} + if (#CommandsAffected > 0) then + f:write("\n[list] Commands affected:\n- ") + local Affects = {} + for idx2, cmd in ipairs(CommandsAffected) do + table.insert(Affects, GetCommandRefForum(cmd)) + end + f:write(table.concat(Affects, "\n - ")) + f:write("\n[/list]") + end + if (perm.Info.RecommendedGroups ~= nil) then + f:write("\n[list] Recommended groups: ", perm.Info.RecommendedGroups, "[/list]") + end + f:write("\n") + end + f:write("[/list]") +end + + + + + +local function DumpPermissionsGithub(a_PluginInfo, f) + -- Get the processed sorted array of permissions: + local Permissions = BuildPermissions(a_PluginInfo) + if ((Permissions == nil) or (#Permissions <= 0)) then + return + end + + -- Dump the permissions: + f:write("\n# Permissions\n") + f:write("| Permissions | Description | Commands | Recommended groups |\n") + f:write("| ----------- | ----------- | -------- | ------------------ |\n") + for idx, perm in ipairs(Permissions) do + f:write("| ", perm.Name, " | ") + f:write(GithubizeString(perm.Info.Description or ""), " | ") + local CommandsAffected = perm.Info.CommandsAffected or {} + if (#CommandsAffected > 0) then + local Affects = {} + for idx2, cmd in ipairs(CommandsAffected) do + if (type(cmd) == "string") then + table.insert(Affects, GetCommandRefGithub(cmd)) + else + table.insert(Affects, GetCommandRefGithub(cmd.Name, cmd)) + end + end + f:write(table.concat(Affects, ", ")) + end + f:write(" | ") + if (perm.Info.RecommendedGroups ~= nil) then + f:write(perm.Info.RecommendedGroups) + end + f:write(" |\n") + end +end + + + + + +--- Dumps the forum-format info for the plugin +-- Returns true on success, nil and error message on failure +local function DumpPluginInfoForum(a_PluginFolder, a_PluginInfo) + -- Open the output file: + local f, msg = io.open(a_PluginFolder .. "/forum_info.txt", "w") + if (f == nil) then + return nil, msg + end + + -- Write the description: + f:write(ForumizeString(a_PluginInfo.Description), "\n") + DumpAdditionalInfoForum(a_PluginInfo, f) + DumpCommandsForum(a_PluginInfo, f) + DumpPermissionsForum(a_PluginInfo, f) + if (a_PluginInfo.SourceLocation ~= nil) then + f:write("\n[b]Source[/b]: ", a_PluginInfo.SourceLocation, "\n") + end + if (a_PluginInfo.DownloadLocation ~= nil) then + f:write("[b]Download[/b]: ", a_PluginInfo.DownloadLocation) + end + f:close() + return true +end + + + + + +--- Dumps the README.md file into the plugin's folder with the GitHub Markdown format +-- Returns true on success, nil and error message on failure +local function DumpPluginInfoGithub(a_PluginFolder, a_PluginInfo) + -- Check the params: + assert(type(a_PluginFolder) == "string") + assert(type(a_PluginInfo) == "table") + + -- Open the output file: + local f, msg = io.open(a_PluginFolder .. "/README.md", "w") + if (f == nil) then + print("\tCannot dump github info for plugin " .. a_PluginFolder .. ": " .. msg) + return nil, msg + end + + -- Write the description: + f:write(GithubizeString(a_PluginInfo.Description), "\n") + DumpAdditionalInfoGithub(a_PluginInfo, f) + DumpCommandsGithub(a_PluginInfo, f) + DumpPermissionsGithub(a_PluginInfo, f) + + f:close() + return true +end + + + + + +--- Tries to load the g_PluginInfo from the plugin's Info.lua file +-- Returns the g_PluginInfo table on success, or nil and error message on failure +local function LoadPluginInfo(a_FolderName) + -- Load and compile the Info file: + local cfg, err = loadfile(a_FolderName .. "/Info.lua") + if (cfg == nil) then + return nil, "Cannot open 'Info.lua': " .. err + end + + -- Execute the loaded file in a sandbox: + -- This is Lua-5.1-specific and won't work in Lua 5.2! + local Sandbox = {} + setfenv(cfg, Sandbox) + local isSuccess, errMsg = pcall(cfg) + if not(isSuccess) then + return nil, "Cannot load Info.lua: " .. (errMsg or "") + end + + if (Sandbox.g_PluginInfo == nil) then + return nil, "Info.lua doesn't contain the g_PluginInfo declaration" + end + return Sandbox.g_PluginInfo +end + + + + + +--- Processes the info for one plugin +-- Returns true on success, nil and error message on failure +local function ProcessPluginFolder(a_FolderName) + -- Load the plugin info: + local PluginInfo, Msg = LoadPluginInfo(a_FolderName) + if (PluginInfo == nil) then + return nil, "Cannot load info for plugin " .. a_FolderName .. ": " .. (Msg or "") + end + + -- Dump the forum format: + local isSuccess + isSuccess, Msg = DumpPluginInfoForum(a_FolderName, PluginInfo) + if not(isSuccess) then + return nil, "Cannot dump forum info for plugin " .. a_FolderName .. ": " .. (Msg or "") + end + + -- Dump the GitHub format: + isSuccess, Msg = DumpPluginInfoGithub(a_FolderName, PluginInfo) + if not(isSuccess) then + return nil, "Cannot dump GitHub info for plugin " .. a_FolderName .. ": " .. (Msg or "") + end + + -- All OK, return success + return true +end + + + + + +--- Tries to load LFS through LuaRocks, returns the LFS instance, or nil on error +local function LoadLFS() + -- Try to load lfs, do not abort if not found ... + local lfs, err = pcall( + function() + return require("lfs") + end + ) + + -- ... rather, print a nice message with instructions: + if not(lfs) then + print([[ + Cannot load LuaFileSystem + Install it through luarocks by executing the following command: + luarocks install luafilesystem (Windows) + sudo luarocks install luafilesystem (*nix) + + If you don't have luarocks installed, you need to install them using your OS's package manager, usually: + sudo apt-get install luarocks (Ubuntu / Debian) + On windows, a binary distribution can be downloaded from the LuaRocks homepage, http://luarocks.org/en/Download + ]]) + + print("Original error text: ", err) + return nil + end + + -- We now know that LFS is present, get it normally: + return require("lfs") +end + + + + + +local Arg1 = arg[1] +if ((Arg1 ~= nil) and (Arg1 ~= "")) then + -- Called with a plugin folder name, export only that one + local isSuccess, msg = ProcessPluginFolder(Arg1) + if not(isSuccess) then + print(msg or "") + end +else + -- Called without any arguments, process all subfolders: + local lfs = LoadLFS() + if (lfs == nil) then + -- LFS not loaded, error has already been printed, just bail out + return + end + print("Processing plugin subfolders:") + for fnam in lfs.dir(".") do + if ((fnam ~= ".") and (fnam ~= "..")) then + local Attributes = lfs.attributes(fnam) + if (Attributes ~= nil) then + if (Attributes.mode == "directory") then + print(fnam) + local isSuccess, msg = ProcessPluginFolder(fnam) + if not(isSuccess) then + print(" " .. (msg or "")) + end + end + end + end + end +end +print("Done.") + + diff --git a/Server/Plugins/InfoReg.lua b/Server/Plugins/InfoReg.lua new file mode 100644 index 000000000..cc075c0b8 --- /dev/null +++ b/Server/Plugins/InfoReg.lua @@ -0,0 +1,198 @@ + +-- InfoReg.lua + +-- Implements registration functions that process g_PluginInfo + + + + + +--- Lists all the subcommands that the player has permissions for +local function ListSubcommands(a_Player, a_Subcommands, a_CmdString) + if (a_Player == nil) then + LOGINFO("The " .. a_CmdString .. " command requires another verb:") + else + a_Player:SendMessage("The " .. a_CmdString .. " command requires another verb:") + end + + -- Enum all the subcommands: + local Verbs = {} + for cmd, info in pairs(a_Subcommands) do + if ((a_Player == nil) or (a_Player:HasPermission(info.Permission or ""))) then + table.insert(Verbs, a_CmdString .. " " .. cmd) + end + end + table.sort(Verbs) + + -- Send the list: + if (a_Player == nil) then + for idx, verb in ipairs(Verbs) do + LOGINFO(" " .. verb) + end + else + for idx, verb in ipairs(Verbs) do + a_Player:SendMessage(cCompositeChat(" ", mtInfo):AddSuggestCommandPart(verb, verb)) + end + end +end + + + + + +--- This is a generic command callback used for handling multicommands' parent commands +-- For example, if there are "/gal save" and "/gal load" commands, this callback handles the "/gal" command +-- It is used for both console and in-game commands; the console version has a_Player set to nil +local function MultiCommandHandler(a_Split, a_Player, a_CmdString, a_CmdInfo, a_Level, a_EntireCommand) + local Verb = a_Split[a_Level + 1] + if (Verb == nil) then + -- No verb was specified. If there is a handler for the upper level command, call it: + if (a_CmdInfo.Handler ~= nil) then + return a_CmdInfo.Handler(a_Split, a_Player, a_EntireCommand) + end + -- Let the player know they need to give a subcommand: + assert(type(a_CmdInfo.Subcommands) == "table", "Info.lua error: There is no handler for command \"" .. a_CmdString .. "\" and there are no subcommands defined at level " .. a_Level) + ListSubcommands(a_Player, a_CmdInfo.Subcommands, a_CmdString) + return true + end + + -- A verb was specified, look it up in the subcommands table: + local Subcommand = a_CmdInfo.Subcommands[Verb] + if (Subcommand == nil) then + if (a_Level > 1) then + -- This is a true subcommand, display the message and make MCS think the command was handled + -- Otherwise we get weird behavior: for "/cmd verb" we get "unknown command /cmd" although "/cmd" is valid + if (a_Player == nil) then + LOGWARNING("The " .. a_CmdString .. " command doesn't support verb " .. Verb) + else + a_Player:SendMessage("The " .. a_CmdString .. " command doesn't support verb " .. Verb) + end + return true + end + -- This is a top-level command, let MCS handle the unknown message + return false; + end + + -- Check the permission: + if (a_Player ~= nil) then + if not(a_Player:HasPermission(Subcommand.Permission or "")) then + a_Player:SendMessage("You don't have permission to execute this command") + return true + end + end + + -- If the handler is not valid, check the next sublevel: + if (Subcommand.Handler == nil) then + if (Subcommand.Subcommands == nil) then + LOG("Cannot find handler for command " .. a_CmdString .. " " .. Verb) + return false + end + return MultiCommandHandler(a_Split, a_Player, a_CmdString .. " " .. Verb, Subcommand, a_Level + 1, a_EntireCommand) + end + + -- Execute: + return Subcommand.Handler(a_Split, a_Player, a_EntireCommand) +end + + + + + +--- Registers all commands specified in the g_PluginInfo.Commands +function RegisterPluginInfoCommands() + -- A sub-function that registers all subcommands of a single command, using the command's Subcommands table + -- The a_Prefix param already contains the space after the previous command + -- a_Level is the depth of the subcommands being registered, with 1 being the top level command + local function RegisterSubcommands(a_Prefix, a_Subcommands, a_Level) + assert(a_Subcommands ~= nil) + + -- A table that will hold aliases to subcommands temporarily, during subcommand iteration + local AliasTable = {} + + -- Iterate through the subcommands, register them, and accumulate aliases: + for cmd, info in pairs(a_Subcommands) do + local CmdName = a_Prefix .. cmd + local Handler = info.Handler + -- Provide a special handler for multicommands: + if (info.Subcommands ~= nil) then + Handler = function(a_Split, a_Player, a_EntireCommand) + return MultiCommandHandler(a_Split, a_Player, CmdName, info, a_Level, a_EntireCommand) + end + end + + if (Handler == nil) then + LOGWARNING(g_PluginInfo.Name .. ": Invalid handler for command " .. CmdName .. ", command will not be registered.") + else + local HelpString + if (info.HelpString ~= nil) then + HelpString = " - " .. info.HelpString + else + HelpString = "" + end + cPluginManager.BindCommand(CmdName, info.Permission or "", Handler, HelpString) + -- Register all aliases for the command: + if (info.Alias ~= nil) then + if (type(info.Alias) == "string") then + info.Alias = {info.Alias} + end + for idx, alias in ipairs(info.Alias) do + cPluginManager.BindCommand(a_Prefix .. alias, info.Permission or "", Handler, HelpString) + -- Also copy the alias's info table as a separate subcommand, + -- so that MultiCommandHandler() handles it properly. Need to off-load into a separate table + -- than the one we're currently iterating and join after the iterating. + AliasTable[alias] = info + end + end + end -- else (if Handler == nil) + + -- Recursively register any subcommands: + if (info.Subcommands ~= nil) then + RegisterSubcommands(a_Prefix .. cmd .. " ", info.Subcommands, a_Level + 1) + end + end -- for cmd, info - a_Subcommands[] + + -- Add the subcommand aliases that were off-loaded during registration: + for alias, info in pairs(AliasTable) do + a_Subcommands[alias] = info + end + AliasTable = {} + end + + -- Loop through all commands in the plugin info, register each: + RegisterSubcommands("", g_PluginInfo.Commands, 1) +end + + + + + +--- Registers all console commands specified in the g_PluginInfo.ConsoleCommands +function RegisterPluginInfoConsoleCommands() + -- A sub-function that registers all subcommands of a single command, using the command's Subcommands table + -- The a_Prefix param already contains the space after the previous command + local function RegisterSubcommands(a_Prefix, a_Subcommands, a_Level) + assert(a_Subcommands ~= nil) + + for cmd, info in pairs(a_Subcommands) do + local CmdName = a_Prefix .. cmd + local Handler = info.Handler + if (Handler == nil) then + Handler = function(a_Split, a_EntireCommand) + return MultiCommandHandler(a_Split, nil, CmdName, info, a_Level, a_EntireCommand) + end + end + cPluginManager.BindConsoleCommand(CmdName, Handler, info.HelpString or "") + -- Recursively register any subcommands: + if (info.Subcommands ~= nil) then + RegisterSubcommands(a_Prefix .. cmd .. " ", info.Subcommands, a_Level + 1) + end + end + end + + -- Loop through all commands in the plugin info, register each: + RegisterSubcommands("", g_PluginInfo.ConsoleCommands, 1) +end + + + + diff --git a/Server/Plugins/MagicCarpet b/Server/Plugins/MagicCarpet new file mode 160000 index 000000000..94da343b6 --- /dev/null +++ b/Server/Plugins/MagicCarpet @@ -0,0 +1 @@ +Subproject commit 94da343b62f0498a5843247f36d6ee00cbeb8f21 diff --git a/Server/Plugins/NetworkTest/Info.lua b/Server/Plugins/NetworkTest/Info.lua new file mode 100644 index 000000000..d8c3095fe --- /dev/null +++ b/Server/Plugins/NetworkTest/Info.lua @@ -0,0 +1,148 @@ + +-- Info.lua + +-- Implements the g_PluginInfo standard plugin description + +g_PluginInfo = +{ + Name = "NetworkTest", + Version = "1", + Date = "2015-01-28", + Description = [[Implements test code (and examples) for the cNetwork API]], + + Commands = + { + }, + + ConsoleCommands = + { + net = + { + Subcommands = + { + client = + { + HelpString = "Connects, as a client, to a specified webpage (google.com by default) and downloads its front page using HTTP", + Handler = HandleConsoleNetClient, + ParameterCombinations = + { + { + Params = "", + Help = "Connects, as a client, to google.com and downloads its front page using HTTP", + }, + { + Params = "host [port]", + Help = "Connects, as a client, to the specified host and downloads its front page using HTTP", + }, + }, -- ParameterCombinations + }, -- client + + close = + { + HelpString = "Close a listening socket", + Handler = HandleConsoleNetClose, + ParameterCombinations = + { + { + Params = "[Port]", + Help = "Closes a socket listening on the specified port [1024]", + }, + }, -- ParameterCombinations + }, -- close + + ips = + { + HelpString = "Prints all locally available IP addresses", + Handler = HandleConsoleNetIps, + }, -- ips + + listen = + { + HelpString = "Creates a new listening socket on the specified port with the specified service attached to it", + Handler = HandleConsoleNetListen, + ParameterCombinations = + { + { + Params = "[Port] [Service]", + Help = "Starts listening on the specified port [1024] providing the specified service [echo]", + }, + }, -- ParameterCombinations + }, -- listen + + lookup = + { + HelpString = "Looks up the IP addresses corresponding to the given hostname (google.com by default)", + Handler = HandleConsoleNetLookup, + ParameterCombinations = + { + { + Params = "", + Help = "Looks up the IP addresses of google.com.", + }, + { + Params = "Hostname", + Help = "Looks up the IP addresses of the specified hostname.", + }, + { + Params = "IP", + Help = "Looks up the canonical name of the specified IP.", + }, + }, + }, -- lookup + + udp = + { + Subcommands = + { + close = + { + Handler = HandleConsoleNetUdpClose, + ParameterCombinations = + { + { + Params = "[Port]", + Help = "Closes the UDP endpoint on the specified port [1024].", + } + }, + }, -- close + + listen = + { + Handler = HandleConsoleNetUdpListen, + ParameterCombinations = + { + { + Params = "[Port]", + Help = "Listens on the specified UDP port [1024], dumping the incoming datagrams into log", + }, + }, + }, -- listen + + send = + { + Handler = HandleConsoleNetUdpSend, + ParameterCombinations = + { + { + Params = "[Host] [Port] [Message]", + Help = "Sends the message [\"hello\"] through UDP to the specified host [localhost] and port [1024]", + }, + }, + } -- send + }, -- Subcommands ("net udp") + }, -- udp + + wasc = + { + HelpString = "Requests the webadmin homepage using https", + Handler = HandleConsoleNetWasc, + }, -- wasc + + }, -- Subcommands + }, -- net + }, +} + + + + diff --git a/Server/Plugins/NetworkTest/NetworkTest.lua b/Server/Plugins/NetworkTest/NetworkTest.lua new file mode 100644 index 000000000..22056d4e9 --- /dev/null +++ b/Server/Plugins/NetworkTest/NetworkTest.lua @@ -0,0 +1,503 @@ + +-- NetworkTest.lua + +-- Implements a few tests for the cNetwork API + + + + + +--- Map of all servers currently open +-- g_Servers[PortNum] = cServerHandle +local g_Servers = {} + +--- Map of all UDP endpoints currently open +-- g_UDPEndpoints[PortNum] = cUDPEndpoint +local g_UDPEndpoints = {} + +--- List of fortune messages for the fortune server +-- A random message is chosen for each incoming connection +-- The contents are loaded from the splashes.txt file on plugin startup +local g_Fortunes = +{ + "Empty splashes.txt", +} + +-- HTTPS certificate to be used for the SSL server: +local g_HTTPSCert = [[ +-----BEGIN CERTIFICATE----- +MIIDfzCCAmegAwIBAgIJAOBHN+qOWodcMA0GCSqGSIb3DQEBBQUAMFYxCzAJBgNV +BAYTAmN6MQswCQYDVQQIDAJjejEMMAoGA1UEBwwDbG9jMQswCQYDVQQKDAJfWDEL +MAkGA1UECwwCT1UxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xNTAxMjQwODQ2MzFa +Fw0yNTAxMjEwODQ2MzFaMFYxCzAJBgNVBAYTAmN6MQswCQYDVQQIDAJjejEMMAoG +A1UEBwwDbG9jMQswCQYDVQQKDAJfWDELMAkGA1UECwwCT1UxEjAQBgNVBAMMCWxv +Y2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJkFYSElu/jw +nxqjimmj246DejKJK8uy/l9QQibb/Z4kO/3s0gVPOYo0mKv32xUFP7wYIE3XWT61 +zyfvK+1jpnlQTCtM8T5xw/7CULKgLmuIzlQx5Dhy7d+tW46kOjFKwQajS9YzwqWu +KBOPnFamQWz6vIzuM05+7aIMXbzamInvW/1x3klIrpGQgALwSB1N+oUzTInTBRKK +21pecUE9t3qrU40Cs5bN0fQBnBjLwbgmnTh6LEplfQZHG5wLvj0IeERVU9vH7luM +e9/IxuEZluCiu5ViF3jqLPpjYOrkX7JDSKme64CCmNIf0KkrwtFjF104Qylike60 +YD3+kw8Q+DECAwEAAaNQME4wHQYDVR0OBBYEFHHIDTc7mrLDXftjQ5ejU9Udfdyo +MB8GA1UdIwQYMBaAFHHIDTc7mrLDXftjQ5ejU9UdfdyoMAwGA1UdEwQFMAMBAf8w +DQYJKoZIhvcNAQEFBQADggEBAHxCJxZPmH9tvx8GKiDV3rgGY++sMItzrW5Uhf0/ +bl3DPbVz51CYF8nXiWvSJJzxhH61hKpZiqvRlpyMuovV415dYQ+Xc2d2IrTX6e+d +Z4Pmwfb4yaX+kYqIygjXMoyNxOJyhTnCbJzycV3v5tvncBWN9Wqez6ZonWDdFdAm +J+Moty+atc4afT02sUg1xz+CDr1uMbt62tHwKYCdxXCwT//bOs6W21+mQJ5bEAyA +YrHQPgX76uo8ed8rPf6y8Qj//lzq/+33EIWqf9pnbklQgIPXJU07h+5L+Y63RF4A +ComLkzas+qnQLcEN28Dg8QElXop6hfiD0xq3K0ac2bDnjoU= +-----END CERTIFICATE----- +]] + +local g_HTTPSPrivKey = [[ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCZBWEhJbv48J8a +o4ppo9uOg3oyiSvLsv5fUEIm2/2eJDv97NIFTzmKNJir99sVBT+8GCBN11k+tc8n +7yvtY6Z5UEwrTPE+ccP+wlCyoC5riM5UMeQ4cu3frVuOpDoxSsEGo0vWM8KlrigT +j5xWpkFs+ryM7jNOfu2iDF282piJ71v9cd5JSK6RkIAC8EgdTfqFM0yJ0wUSitta +XnFBPbd6q1ONArOWzdH0AZwYy8G4Jp04eixKZX0GRxucC749CHhEVVPbx+5bjHvf +yMbhGZbgoruVYhd46iz6Y2Dq5F+yQ0ipnuuAgpjSH9CpK8LRYxddOEMpYpHutGA9 +/pMPEPgxAgMBAAECggEAWxQ4m+I54BJYoSJ2YCqHpGvdb/b1emkvvsumlDqc2mP2 +0U0ENOTS+tATj0gXvotBRFOX5r0nAYx1oO9a1hFaJRsGOz+w19ofLqO6JJfzCU6E +gNixXmgJ7fjhZiWZ/XzhJ3JK0VQ9px/h+sKf63NJvfQABmJBZ5dlGe8CXEZARNin +03TnE3RUIEK+jEgwShN2OrGjwK9fjcnXMHwEnKZtCBiYEfD2N+pQmS20gIm13L1t ++ZmObIC24NqllXxl4I821qzBdhmcT7+rGmKR0OT5YKbt6wFA5FPKD9dqlzXzlKck +r2VAh+JlCtFKxcScmWtQOnVDtf5+mcKFbP4ck724AQKBgQDLk+RDhvE5ykin5R+B +dehUQZgHb2pPL7N1DAZShfzwSmyZSOPQDFr7c0CMijn6G0Pw9VX6Vrln0crfTQYz +Hli+zxlmcMAD/WC6VImM1LCUzouNRy37rSCnuPtngZyHdsyzfheGnjORH7HlPjtY +JCTLaekg0ckQvt//HpRV3DCdaQKBgQDAbLmIOTyGfne74HLswWnY/kCOfFt6eO+E +lZ724MWmVPWkxq+9rltC2CDx2i8jjdkm90dsgR5OG2EaLnUWldUpkE0zH0ATrZSV +ezJWD9SsxTm8ksbThD+pJKAVPxDAboejF7kPvpaO2wY+bf0AbO3M24rJ2tccpMv8 +AcfXBICDiQKBgQCSxp81/I3hf7HgszaC7ZLDZMOK4M6CJz847aGFUCtsyAwCfGYb +8zyJvK/WZDam14+lpA0IQAzPCJg/ZVZJ9uA/OivzCum2NrHNxfOiQRrLPxuokaBa +q5k2tA02tGE53fJ6mze1DEzbnkFxqeu5gd2xdzvpOLfBxgzT8KU8PlQiuQKBgGn5 +NvCj/QZhDhYFVaW4G1ArLmiKamL3yYluUV7LiW7CaYp29gBzzsTwfKxVqhJdo5NH +KinCrmr7vy2JGmj22a+LTkjyU/rCZQsyDxXAoDMKZ3LILwH8WocPqa4pzlL8TGzw +urXGE+rXCwhE0Mp0Mz7YRgZHJKMcy06duG5dh11pAoGBALHbsBIDihgHPyp2eKMP +K1f42MdKrTBiIXV80hv2OnvWVRCYvnhrqpeRMzCR1pmVbh+QhnwIMAdWq9PAVTTn +ypusoEsG8Y5fx8xhgjs0D2yMcrmi0L0kCgHIFNoym+4pI+sv6GgxpemfrmaPNcMx +DXi9JpaquFRJLGJ7jMCDgotL +-----END PRIVATE KEY----- +]] + +--- Map of all services that can be run as servers +-- g_Services[ServiceName] = function() -> accept-callbacks +local g_Services = +{ + -- Echo service: each connection echoes back what has been sent to it + echo = function (a_Port) + return + { + -- A new connection has come, give it new link-callbacks: + OnIncomingConnection = function (a_RemoteIP, a_RemotePort) + return + { + OnError = function (a_Link, a_ErrorCode, a_ErrorMsg) + LOG("EchoServer(" .. a_Port .. ": Connection to " .. a_Link:GetRemoteIP() .. ":" .. a_Link:GetRemotePort() .. " failed: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + end, + + OnReceivedData = function (a_Link, a_Data) + -- Echo the received data back to the link: + a_Link:Send(a_Data) + end, + + OnRemoteClosed = function (a_Link) + end + } -- Link callbacks + end, -- OnIncomingConnection() + + -- Send a welcome message to newly accepted connections: + OnAccepted = function (a_Link) + a_Link:Send("Hello, " .. a_Link:GetRemoteIP() .. ", welcome to the echo server @ MCServer-Lua\r\n") + end, -- OnAccepted() + + -- There was an error listening on the port: + OnError = function (a_ErrorCode, a_ErrorMsg) + LOGINFO("EchoServer(" .. a_Port .. ": Cannot listen: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + end, -- OnError() + } -- Listen callbacks + end, -- echo + + -- Fortune service: each incoming connection gets a welcome message plus a random fortune text; all communication is ignored afterwards + fortune = function (a_Port) + return + { + -- A new connection has come, give it new link-callbacks: + OnIncomingConnection = function (a_RemoteIP, a_RemotePort) + return + { + OnError = function (a_Link, a_ErrorCode, a_ErrorMsg) + LOG("FortuneServer(" .. a_Port .. "): Connection to " .. a_Link:GetRemoteIP() .. ":" .. a_Link:GetRemotePort() .. " failed: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + end, + + OnReceivedData = function (a_Link, a_Data) + -- Ignore any received data + end, + + OnRemoteClosed = function (a_Link) + end + } -- Link callbacks + end, -- OnIncomingConnection() + + -- Send a welcome message and the fortune to newly accepted connections: + OnAccepted = function (a_Link) + a_Link:Send("Hello, " .. a_Link:GetRemoteIP() .. ", welcome to the fortune server @ MCServer-Lua\r\n\r\nYour fortune:\r\n") + a_Link:Send(g_Fortunes[math.random(#g_Fortunes)] .. "\r\n") + end, -- OnAccepted() + + -- There was an error listening on the port: + OnError = function (a_ErrorCode, a_ErrorMsg) + LOGINFO("FortuneServer(" .. a_Port .. "): Cannot listen: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + end, -- OnError() + } -- Listen callbacks + end, -- fortune + + -- HTTPS time - serves current time for each https request received + httpstime = function (a_Port) + return + { + -- A new connection has come, give it new link-callbacks: + OnIncomingConnection = function (a_RemoteIP, a_RemotePort) + local IncomingData = "" -- accumulator for the incoming data, until processed by the http + return + { + OnError = function (a_Link, a_ErrorCode, a_ErrorMsg) + LOG("https-time server(" .. a_Port .. "): Connection to " .. a_Link:GetRemoteIP() .. ":" .. a_Link:GetRemotePort() .. " failed: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + end, + + OnReceivedData = function (a_Link, a_Data) + IncomingData = IncomingData .. a_Data + if (IncomingData:find("\r\n\r\n")) then + -- We have received the entire request headers, just send the response and shutdown the link: + local Content = os.date() + a_Link:Send("HTTP/1.0 200 OK\r\nContent-type: text/plain\r\nContent-length: " .. #Content .. "\r\n\r\n" .. Content) + a_Link:Shutdown() + end + end, + + OnRemoteClosed = function (a_Link) + LOG("httpstime: link closed by remote") + end + } -- Link callbacks + end, -- OnIncomingConnection() + + -- Start TLS on the new link: + OnAccepted = function (a_Link) + local res, msg = a_Link:StartTLSServer(g_HTTPSCert, g_HTTPSPrivKey, "") + if not(res) then + LOG("https-time server(" .. a_Port .. "): Cannot start TLS server: " .. msg) + a_Link:Close() + end + end, -- OnAccepted() + + -- There was an error listening on the port: + OnError = function (a_ErrorCode, a_ErrorMsg) + LOGINFO("https-time server(" .. a_Port .. "): Cannot listen: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + end, -- OnError() + } -- Listen callbacks + end, -- httpstime + + -- TODO: Other services (daytime, ...) +} + + + + + +function Initialize(a_Plugin) + -- Load the splashes.txt file into g_Fortunes, overwriting current content: + local idx = 1 + for line in io.lines(a_Plugin:GetLocalFolder() .. "/splashes.txt") do + g_Fortunes[idx] = line + idx = idx + 1 + end + + -- Use the InfoReg shared library to process the Info.lua file: + dofile(cPluginManager:GetPluginsPath() .. "/InfoReg.lua") + RegisterPluginInfoCommands() + RegisterPluginInfoConsoleCommands() + + -- Seed the random generator: + math.randomseed(os.time()) + + return true +end + + + + + +function HandleConsoleNetClient(a_Split) + -- Get the address to connect to: + local Host = a_Split[3] or "google.com" + local Port = a_Split[4] or 80 + + -- Create the callbacks "personalised" for the address: + local Callbacks = + { + OnConnected = function (a_Link) + LOG("Connected to " .. Host .. ":" .. Port .. ".") + LOG("Connection stats: Remote address: " .. a_Link:GetRemoteIP() .. ":" .. a_Link:GetRemotePort() .. ", Local address: " .. a_Link:GetLocalIP() .. ":" .. a_Link:GetLocalPort()) + LOG("Sending HTTP request for front page.") + a_Link:Send("GET / HTTP/1.0\r\nHost: " .. Host .. "\r\n\r\n") + end, + + OnError = function (a_Link, a_ErrorCode, a_ErrorMsg) + LOG("Connection to " .. Host .. ":" .. Port .. " failed: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + end, + + OnReceivedData = function (a_Link, a_Data) + LOG("Received data from " .. Host .. ":" .. Port .. ":\r\n" .. a_Data) + end, + + OnRemoteClosed = function (a_Link) + LOG("Connection to " .. Host .. ":" .. Port .. " was closed by the remote peer.") + end + } + + -- Queue a connect request: + local res = cNetwork:Connect(Host, Port, Callbacks) + if not(res) then + LOGWARNING("cNetwork:Connect call failed immediately") + return true + end + + return true, "Client connection request queued." +end + + + + + +function HandleConsoleNetClose(a_Split) + -- Get the port to close: + local Port = tonumber(a_Split[3] or 1024) + if not(Port) then + return true, "Bad port number: \"" .. a_Split[3] .. "\"." + end + + -- Close the server, if there is one: + if not(g_Servers[Port]) then + return true, "There is no server currently listening on port " .. Port .. "." + end + g_Servers[Port]:Close() + g_Servers[Port] = nil + return true, "Port " .. Port .. " closed." +end + + + + + +function HandleConsoleNetIps(a_Split) + local Addresses = cNetwork:EnumLocalIPAddresses() + LOG("IP addresses enumerated, " .. #Addresses .. " found") + for idx, addr in ipairs(Addresses) do + LOG(" IP #" .. idx .. ": " .. addr) + end + return true +end + + + + + +function HandleConsoleNetLookup(a_Split) + -- Get the name to look up: + local Addr = a_Split[3] or "google.com" + + -- Create the callbacks "personalised" for the host: + local Callbacks = + { + OnNameResolved = function (a_Hostname, a_IP) + LOG(a_Hostname .. " resolves to " .. a_IP) + end, + + OnError = function (a_Query, a_ErrorCode, a_ErrorMsg) + LOG("Failed to retrieve information for " .. a_Query .. ": " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + assert(a_Query == Addr) + end, + + OnFinished = function (a_Query) + LOG("Resolving " .. a_Query .. " has finished.") + assert(a_Query == Addr) + end, + } + + -- Queue both name and IP DNS queries; + -- we don't distinguish between an IP and a hostname in this command so we don't know which one to use: + local res = cNetwork:HostnameToIP(Addr, Callbacks) + if not(res) then + LOGWARNING("cNetwork:HostnameToIP call failed immediately") + return true + end + res = cNetwork:IPToHostname(Addr, Callbacks) + if not(res) then + LOGWARNING("cNetwork:IPToHostname call failed immediately") + return true + end + + return true, "DNS query has been queued." +end + + + + + +function HandleConsoleNetListen(a_Split) + -- Get the params: + local Port = tonumber(a_Split[3] or 1024) + if not(Port) then + return true, "Invalid port: \"" .. a_Split[3] .. "\"." + end + local Service = string.lower(a_Split[4] or "echo") + + -- Create the callbacks specific for the service: + if (g_Services[Service] == nil) then + return true, "No such service: " .. Service + end + local Callbacks = g_Services[Service](Port) + + -- Start the server: + local srv = cNetwork:Listen(Port, Callbacks) + if not(srv:IsListening()) then + -- The error message has already been printed in the Callbacks.OnError() + return true + end + g_Servers[Port] = srv + return true, Service .. " server started on port " .. Port +end + + + + + +function HandleConsoleNetUdpClose(a_Split) + -- Get the port to close: + local Port = tonumber(a_Split[4] or 1024) + if not(Port) then + return true, "Bad port number: \"" .. a_Split[4] .. "\"." + end + + -- Close the server, if there is one: + if not(g_UDPEndpoints[Port]) then + return true, "There is no UDP endpoint currently listening on port " .. Port .. "." + end + g_UDPEndpoints[Port]:Close() + g_UDPEndpoints[Port] = nil + return true, "UDP Port " .. Port .. " closed." +end + + + + + +function HandleConsoleNetUdpListen(a_Split) + -- Get the params: + local Port = tonumber(a_Split[4] or 1024) + if not(Port) then + return true, "Invalid port: \"" .. a_Split[4] .. "\"." + end + + local Callbacks = + { + OnReceivedData = function (a_Endpoint, a_Data, a_RemotePeer, a_RemotePort) + LOG("Incoming UDP datagram from " .. a_RemotePeer .. " port " .. a_RemotePort .. ":\r\n" .. a_Data) + end, + + OnError = function (a_Endpoint, a_ErrorCode, a_ErrorMsg) + LOG("Error in UDP endpoint: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + end, + } + + g_UDPEndpoints[Port] = cNetwork:CreateUDPEndpoint(Port, Callbacks) + return true, "UDP listener on port " .. Port .. " started." +end + + + + + +function HandleConsoleNetUdpSend(a_Split) + -- Get the params: + local Host = a_Split[4] or "localhost" + local Port = tonumber(a_Split[5] or 1024) + if not(Port) then + return true, "Invalid port: \"" .. a_Split[5] .. "\"." + end + local Message + if (a_Split[6]) then + Message = table.concat(a_Split, " ", 6) + else + Message = "hello" + end + + -- Define minimum callbacks for the UDP endpoint: + local Callbacks = + { + OnError = function (a_Endpoint, a_ErrorCode, a_ErrorMsg) + LOG("Error in UDP datagram sending: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + end, + + OnReceivedData = function () + -- ignore + end, + } + + -- Send the data: + local Endpoint = cNetwork:CreateUDPEndpoint(0, Callbacks) + Endpoint:EnableBroadcasts() + if not(Endpoint:Send(Message, Host, Port)) then + Endpoint:Close() + return true, "Sending UDP datagram failed" + end + Endpoint:Close() + return true, "UDP datagram sent" +end + + + + + +function HandleConsoleNetWasc(a_Split) + local Callbacks = + { + OnConnected = function (a_Link) + LOG("Connected to webadmin, starting TLS...") + local res, msg = a_Link:StartTLSClient("", "", "") + if not(res) then + LOG("Failed to start TLS client: " .. msg) + return + end + -- We need to send a keep-alive due to #1737 + a_Link:Send("GET / HTTP/1.0\r\nHost: localhost\r\nConnection: keep-alive\r\n\r\n") + end, + + OnError = function (a_Link, a_ErrorCode, a_ErrorMsg) + LOG("Connection to webadmin failed: " .. a_ErrorCode .. " (" .. a_ErrorMsg .. ")") + end, + + OnReceivedData = function (a_Link, a_Data) + LOG("Received data from webadmin:\r\n" .. a_Data) + + -- Close the link once all the data is received: + if (a_Data == "0\r\n\r\n") then -- Poor man's end-of-data detection; works on localhost + -- TODO: The Close() method is not yet exported to Lua + -- a_Link:Close() + end + end, + + OnRemoteClosed = function (a_Link) + LOG("Connection to webadmin was closed") + end, + } + + if not(cNetwork:Connect("localhost", "8080", Callbacks)) then + LOG("Canot connect to webadmin") + end + + return true +end + + + + diff --git a/Server/Plugins/NetworkTest/splashes.txt b/Server/Plugins/NetworkTest/splashes.txt new file mode 100644 index 000000000..50a87bd91 --- /dev/null +++ b/Server/Plugins/NetworkTest/splashes.txt @@ -0,0 +1,357 @@ +As seen on TV! +Awesome! +100% pure! +May contain nuts! +Better than Prey! +More polygons! +Sexy! +Limited edition! +Flashing letters! +Made by Notch! +It's here! +Best in class! +It's finished! +Kind of dragon free! +Excitement! +More than 500 sold! +One of a kind! +Heaps of hits on YouTube! +Indev! +Spiders everywhere! +Check it out! +Holy cow, man! +It's a game! +Made in Sweden! +Uses LWJGL! +Reticulating splines! +Minecraft! +Yaaay! +Singleplayer! +Keyboard compatible! +Undocumented! +Ingots! +Exploding creepers! +That's no moon! +l33t! +Create! +Survive! +Dungeon! +Exclusive! +The bee's knees! +Down with O.P.P.! +Closed source! +Classy! +Wow! +Not on steam! +Oh man! +Awesome community! +Pixels! +Teetsuuuuoooo! +Kaaneeeedaaaa! +Now with difficulty! +Enhanced! +90% bug free! +Pretty! +12 herbs and spices! +Fat free! +Absolutely no memes! +Free dental! +Ask your doctor! +Minors welcome! +Cloud computing! +Legal in Finland! +Hard to label! +Technically good! +Bringing home the bacon! +Indie! +GOTY! +Ceci n'est pas une title screen! +Euclidian! +Now in 3D! +Inspirational! +Herregud! +Complex cellular automata! +Yes, sir! +Played by cowboys! +OpenGL 2.1 (if supported)! +Thousands of colors! +Try it! +Age of Wonders is better! +Try the mushroom stew! +Sensational! +Hot tamale, hot hot tamale! +Play him off, keyboard cat! +Guaranteed! +Macroscopic! +Bring it on! +Random splash! +Call your mother! +Monster infighting! +Loved by millions! +Ultimate edition! +Freaky! +You've got a brand new key! +Water proof! +Uninflammable! +Whoa, dude! +All inclusive! +Tell your friends! +NP is not in P! +Notch <3 ez! +Music by C418! +Livestreamed! +Haunted! +Polynomial! +Terrestrial! +All is full of love! +Full of stars! +Scientific! +Cooler than Spock! +Collaborate and listen! +Never dig down! +Take frequent breaks! +Not linear! +Han shot first! +Nice to meet you! +Buckets of lava! +Ride the pig! +Larger than Earth! +sqrt(-1) love you! +Phobos anomaly! +Punching wood! +Falling off cliffs! +0% sugar! +150% hyperbole! +Synecdoche! +Let's danec! +Seecret Friday update! +Reference implementation! +Lewd with two dudes with food! +Kiss the sky! +20 GOTO 10! +Verlet intregration! +Peter Griffin! +Do not distribute! +Cogito ergo sum! +4815162342 lines of code! +A skeleton popped out! +The Work of Notch! +The sum of its parts! +BTAF used to be good! +I miss ADOM! +umop-apisdn! +OICU812! +Bring me Ray Cokes! +Finger-licking! +Thematic! +Pneumatic! +Sublime! +Octagonal! +Une baguette! +Gargamel plays it! +Rita is the new top dog! +SWM forever! +Representing Edsbyn! +Matt Damon! +Supercalifragilisticexpialidocious! +Consummate V's! +Cow Tools! +Double buffered! +Fan fiction! +Flaxkikare! +Jason! Jason! Jason! +Hotter than the sun! +Internet enabled! +Autonomous! +Engage! +Fantasy! +DRR! DRR! DRR! +Kick it root down! +Regional resources! +Woo, facepunch! +Woo, somethingawful! +Woo, /v/! +Woo, tigsource! +Woo, minecraftforum! +Woo, worldofminecraft! +Woo, reddit! +Woo, 2pp! +Google anlyticsed! +Now supports åäö! +Give us Gordon! +Tip your waiter! +Very fun! +12345 is a bad password! +Vote for net neutrality! +Lives in a pineapple under the sea! +MAP11 has two names! +Omnipotent! +Gasp! +...! +Bees, bees, bees, bees! +Jag känner en bot! +This text is hard to read if you play the game at the default resolution, but at 1080p it's fine! +Haha, LOL! +Hampsterdance! +Switches and ores! +Menger sponge! +idspispopd! +Eple (original edit)! +So fresh, so clean! +Slow acting portals! +Try the Nether! +Don't look directly at the bugs! +Oh, ok, Pigmen! +Finally with ladders! +Scary! +Play Minecraft, Watch Topgear, Get Pig! +Twittered about! +Jump up, jump up, and get down! +Joel is neat! +A riddle, wrapped in a mystery! +Huge tracts of land! +Welcome to your Doom! +Stay a while, stay forever! +Stay a while and listen! +Treatment for your rash! +"Autological" is! +Information wants to be free! +"Almost never" is an interesting concept! +Lots of truthiness! +The creeper is a spy! +Turing complete! +It's groundbreaking! +Let our battle's begin! +The sky is the limit! +Jeb has amazing hair! +Ryan also has amazing hair! +Casual gaming! +Undefeated! +Kinda like Lemmings! +Follow the train, CJ! +Leveraging synergy! +This message will never appear on the splash screen, isn't that weird? +DungeonQuest is unfair! +110813! +90210! +Check out the far lands! +Tyrion would love it! +Also try VVVVVV! +Also try Super Meat Boy! +Also try Terraria! +Also try Mount And Blade! +Also try Project Zomboid! +Also try World of Goo! +Also try Limbo! +Also try Pixeljunk Shooter! +Also try Braid! +That's super! +Bread is pain! +Read more books! +Khaaaaaaaaan! +Less addictive than TV Tropes! +More addictive than lemonade! +Bigger than a bread box! +Millions of peaches! +Fnord! +This is my true form! +Totally forgot about Dre! +Don't bother with the clones! +Pumpkinhead! +Hobo humping slobo babe! +Made by Jeb! +Has an ending! +Finally complete! +Feature packed! +Boots with the fur! +Stop, hammertime! +Testificates! +Conventional! +Homeomorphic to a 3-sphere! +Doesn't avoid double negatives! +Place ALL the blocks! +Does barrel rolls! +Meeting expectations! +PC gaming since 1873! +Ghoughpteighbteau tchoghs! +Déjà vu! +Déjà vu! +Got your nose! +Haley loves Elan! +Afraid of the big, black bat! +Doesn't use the U-word! +Child's play! +See you next Friday or so! +From the streets of Södermalm! +150 bpm for 400000 minutes! +Technologic! +Funk soul brother! +Pumpa kungen! +日本ハロー! +한국 안녕하세요! +Helo Cymru! +Cześć Polsko! +你好中国! +Привет Россия! +Γεια σου Ελλάδα! +My life for Aiur! +Lennart lennart = new Lennart(); +I see your vocabulary has improved! +Who put it there? +You can't explain that! +if not ok then return end +§1C§2o§3l§4o§5r§6m§7a§8t§9i§ac +§kFUNKY LOL +SOPA means LOSER in Swedish! +Big Pointy Teeth! +Bekarton guards the gate! +Mmmph, mmph! +Don't feed avocados to parrots! +Swords for everyone! +Plz reply to my tweet! +.party()! +Take her pillow! +Put that cookie down! +Pretty scary! +I have a suggestion. +Now with extra hugs! +Now Java 6! +Woah. +HURNERJSGER? +What's up, Doc? +Now contains 32 random daily cats! +That's Numberwang! +pls rt +Do you want to join my server? +Put a little fence around it! +Throw a blanket over it! +One day, somewhere in the future, my work will be quoted! +Now with additional stuff! +Extra things! +Yay, puppies for everyone! +So sweet, like a nice bon bon! +Popping tags! +Very influential in its circle! +Now With Multiplayer! +Rise from your grave! +Warning! A huge battleship "STEVE" is approaching fast! +Blue warrior shot the food! +Run, coward! I hunger! +Flavor with no seasoning! +Strange, but not a stranger! +Tougher than diamonds, rich like cream! +Getting ready to show! +Getting ready to know! +Getting ready to drop! +Getting ready to shock! +Getting ready to freak! +Getting ready to speak! +It swings, it jives! +Cruising streets for gold! +Take an eggbeater and beat it against a skillet! +Make me a table, a funky table! +Take the elevator to the mezzanine! +Stop being reasonable, this is the Internet! +/give @a hugs 64 +This is good for Realms. +Any computer is a laptop if you're brave enough! \ No newline at end of file diff --git a/Server/Plugins/ProtectionAreas b/Server/Plugins/ProtectionAreas new file mode 160000 index 000000000..624580e5b --- /dev/null +++ b/Server/Plugins/ProtectionAreas @@ -0,0 +1 @@ +Subproject commit 624580e5b522ba2799dfe5b5902b4002b1a8da3e diff --git a/Server/Plugins/TestLuaRocks/TestLuaRocks.lua b/Server/Plugins/TestLuaRocks/TestLuaRocks.lua new file mode 100644 index 000000000..4a7cd4e1e --- /dev/null +++ b/Server/Plugins/TestLuaRocks/TestLuaRocks.lua @@ -0,0 +1,49 @@ + +-- TestLuaRocks.lua + +-- This is a mockup plugin that does a quick test of LuaRocks capability in MCServer + +-- "Success" is when the plugin loads, downloads the forum webpage and displays the headers and length and then displays both libs as loaded. +-- "Failure" usually manifests as one of the "require" lines failing, although you have the luarock installed. +-- Note that the plugin deliberately never fully loads, so that it can be reloaded fast by pressing its Enable button in the webadmin's plugin list. + + + + + + +local log30 = require("30log"); +local socket = require("socket"); +local http = require("socket.http"); + + + + + +LOGINFO("Trying to download a webpage..."); +local body, code, headers = http.request('http://forum.mc-server.org/index.php'); +LOG("code: " .. tostring(code)); +LOG("headers: "); +for k, v in pairs(headers or {}) do + LOG(" " .. k .. ": " .. v); +end +LOG("body length: " .. string.len(body)); + + + + + +function Initialize(a_Plugin) + if (socket == nil) then + LOG("LuaSocket not found"); + else + LOG("LuaSocket loaded"); + end + if (log30 == nil) then + LOG("30log not found"); + else + LOG("30log loaded"); + end + LOGINFO("Preventing plugin load so that it may be requested again from the webadmin."); + return false; +end \ No newline at end of file diff --git a/Server/Plugins/TransAPI b/Server/Plugins/TransAPI new file mode 160000 index 000000000..be15597bf --- /dev/null +++ b/Server/Plugins/TransAPI @@ -0,0 +1 @@ +Subproject commit be15597bf3d976310a59e3aa8661cce413441c13 diff --git a/Server/Prefabs/Villages/AlchemistVillage.cubeset b/Server/Prefabs/Villages/AlchemistVillage.cubeset new file mode 100644 index 000000000..eac51e176 --- /dev/null +++ b/Server/Prefabs/Villages/AlchemistVillage.cubeset @@ -0,0 +1,3647 @@ + +-- AlchemistVillage.cubeset + +-- Defines the prefabs in the group AlchemistVillage + +-- NOTE: This file has been generated automatically by GalExport! +-- Any manual changes will be overwritten by the next automatic export! + + + + +Cubeset = +{ + Metadata = + { + CubesetFormatVersion = 1, + ExportDate = "2015-06-20 10:17:14", + ["AllowedBiomes"] = "Desert, DesertM", + ["IntendedUse"] = "Village", + }, + + Pieces = + { + { + OriginData = + { + ExportName = "LittleHouse", + Name = "Desert 65", + GalleryName = "Desert", + GalleryIndex = "65", + ID = "551", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 5, + y = 6, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 5, + MaxY = 5, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 2, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 64: 3", -- wooddoorblock + "g: 61: 2", -- furnace + "h: 65: 2", -- ladder + "i: 64: 9", -- wooddoorblock + "j:101: 0", -- ironbars + "k: 50: 4", -- torch + "l:128: 2", -- sandstonestairs + "m: 19: 0", -- sponge + "n:126: 8", -- woodenslab + "o:128: 4", -- sandstonestairs + "p:128: 5", -- sandstonestairs + "q:128: 7", -- sandstonestairs + "r: 44: 1", -- step + "s: 96: 2", -- trapdoor + }, + BlockData = + { + -- Level 0 + "abbba", -- 0 + "mbbbm", -- 1 + "accca", -- 2 + "ccccc", -- 3 + "ccccc", -- 4 + "ccccc", -- 5 + "accca", -- 6 + + -- Level 1 + "addda", -- 0 + "mdddm", -- 1 + "aceca", -- 2 + "ceeec", -- 3 + "ceeec", -- 4 + "ceeec", -- 5 + "accca", -- 6 + + -- Level 2 + "a...a", -- 0 + ".....", -- 1 + "acfca", -- 2 + "c...c", -- 3 + "c...c", -- 4 + "cg.hc", -- 5 + "accca", -- 6 + + -- Level 3 + "a...a", -- 0 + ".....", -- 1 + "acica", -- 2 + "c...c", -- 3 + "j...j", -- 4 + "ck.hc", -- 5 + "acjca", -- 6 + + -- Level 4 + "l...l", -- 0 + "c...c", -- 1 + "accca", -- 2 + "cnnnc", -- 3 + "onnnp", -- 4 + "cnnhc", -- 5 + "acqca", -- 6 + + -- Level 5 + ".....", -- 0 + ".....", -- 1 + "crcrc", -- 2 + "r...r", -- 3 + "c...c", -- 4 + "r..sr", -- 5 + "crcrc", -- 6 + + }, + }, -- LittleHouse + + + + { + OriginData = + { + ExportName = "LittleHouse3", + Name = "Desert 66", + GalleryName = "Desert", + GalleryIndex = "66", + ID = "553", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 9, + y = 6, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 9, + MaxY = 5, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 4, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 64: 3", -- wooddoorblock + "g: 65: 2", -- ladder + "h: 64: 9", -- wooddoorblock + "i:101: 0", -- ironbars + "j: 50: 4", -- torch + "k:128: 2", -- sandstonestairs + "l:126: 8", -- woodenslab + "m: 19: 0", -- sponge + "n:128: 4", -- sandstonestairs + "o:128: 5", -- sandstonestairs + "p:128: 7", -- sandstonestairs + "q: 44: 1", -- step + "r: 96: 2", -- trapdoor + }, + BlockData = + { + -- Level 0 + "mmabbbamm", -- 0 + "mmmbbbmmm", -- 1 + "accccccca", -- 2 + "ccccccccc", -- 3 + "ccccccccc", -- 4 + "ccccccccc", -- 5 + "accccccca", -- 6 + + -- Level 1 + "mmadddamm", -- 0 + "mmmdddmmm", -- 1 + "accceccca", -- 2 + "ceeeeeeec", -- 3 + "ceeeeeeec", -- 4 + "ceeeeeeec", -- 5 + "accccccca", -- 6 + + -- Level 2 + "mma...amm", -- 0 + "mm.....mm", -- 1 + "acccfccca", -- 2 + "c.......c", -- 3 + "c.......c", -- 4 + "c......gc", -- 5 + "accccccca", -- 6 + + -- Level 3 + "mma...amm", -- 0 + "mm.....mm", -- 1 + "accchccca", -- 2 + "c.......c", -- 3 + "i.......i", -- 4 + "c.j....gc", -- 5 + "acciiicca", -- 6 + + -- Level 4 + "mmk...kmm", -- 0 + "mmc...cmm", -- 1 + "accccccca", -- 2 + "clllllllc", -- 3 + "nlllllllo", -- 4 + "cllllllgc", -- 5 + "accpppcca", -- 6 + + -- Level 5 + "mm.....mm", -- 0 + "mm.....mm", -- 1 + "cqqqcqqqc", -- 2 + "q.......q", -- 3 + "c.......c", -- 4 + "q......rq", -- 5 + "cqqqcqqqc", -- 6 + + }, + }, -- LittleHouse3 + + + + { + OriginData = + { + ExportName = "SmallHouse9", + Name = "Desert 67", + GalleryName = "Desert", + GalleryIndex = "67", + ID = "556", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 9, + y = 6, + z = 11, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 9, + MaxY = 5, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 6, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 64: 3", -- wooddoorblock + "g: 65: 2", -- ladder + "h: 64: 9", -- wooddoorblock + "i:101: 0", -- ironbars + "j: 50: 2", -- torch + "k: 50: 1", -- torch + "l:128: 2", -- sandstonestairs + "m: 19: 0", -- sponge + "n:126: 8", -- woodenslab + "o:128: 5", -- sandstonestairs + "p:128: 6", -- sandstonestairs + "q:128: 4", -- sandstonestairs + "r:128: 7", -- sandstonestairs + "s: 44: 1", -- step + "t: 96: 2", -- trapdoor + }, + BlockData = + { + -- Level 0 + "mmmmabbba", -- 0 + "mmmmmbbbm", -- 1 + "mmmmaccca", -- 2 + "mmmmccccc", -- 3 + "mmmmccccc", -- 4 + "mmmmccccc", -- 5 + "acccacccc", -- 6 + "ccccccccc", -- 7 + "ccccccccc", -- 8 + "ccccccccc", -- 9 + "accccccca", -- 10 + + -- Level 1 + "mmmmaddda", -- 0 + "mmmmmdddm", -- 1 + "mmmmaceca", -- 2 + "mmmmceeec", -- 3 + "mmmmceeec", -- 4 + "mmmmceeec", -- 5 + "acccaeeec", -- 6 + "ceeeeeeec", -- 7 + "ceeeeeeec", -- 8 + "ceeeeeeec", -- 9 + "accccccca", -- 10 + + -- Level 2 + "mmmma...a", -- 0 + "mmmm.....", -- 1 + "mmmmacfca", -- 2 + "mmmmc...c", -- 3 + "mmmmc...c", -- 4 + "mmmmc...c", -- 5 + "accca...c", -- 6 + "c.......c", -- 7 + "c.......c", -- 8 + "c......gc", -- 9 + "accccccca", -- 10 + + -- Level 3 + "mmmma...a", -- 0 + "mmmm.....", -- 1 + "mmmmachca", -- 2 + "mmmmc...c", -- 3 + "mmmmc...c", -- 4 + "mmmmc...i", -- 5 + "acica...i", -- 6 + "c.......i", -- 7 + "i......jc", -- 8 + "ck.....gc", -- 9 + "acciiicca", -- 10 + + -- Level 4 + "mmmml...l", -- 0 + "mmmmc...c", -- 1 + "mmmmaccca", -- 2 + "mmmmcnnnc", -- 3 + "mmmmcnnnc", -- 4 + "mmmmcnnno", -- 5 + "acpcannno", -- 6 + "cnnnnnnno", -- 7 + "qnnnnnnnc", -- 8 + "cnnnnnngc", -- 9 + "accrrrcca", -- 10 + + -- Level 5 + "mmmm.....", -- 0 + "mmmm.....", -- 1 + "mmmmcscsc", -- 2 + "mmmms...s", -- 3 + "mmmms...s", -- 4 + "mmmms...s", -- 5 + "csssc...c", -- 6 + "s.......s", -- 7 + "s.......s", -- 8 + "s......ts", -- 9 + "cssscsssc", -- 10 + + }, + }, -- SmallHouse9 + + + + { + OriginData = + { + ExportName = "LittleHouse5", + Name = "Desert 68", + GalleryName = "Desert", + GalleryIndex = "68", + ID = "558", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 9, + y = 6, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 9, + MaxY = 5, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 6, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 64: 3", -- wooddoorblock + "g: 65: 2", -- ladder + "h: 64: 9", -- wooddoorblock + "i:101: 0", -- ironbars + "j: 50: 1", -- torch + "k: 50: 4", -- torch + "l:128: 2", -- sandstonestairs + "m: 19: 0", -- sponge + "n:126: 8", -- woodenslab + "o:128: 6", -- sandstonestairs + "p:128: 5", -- sandstonestairs + "q:128: 4", -- sandstonestairs + "r:128: 7", -- sandstonestairs + "s: 44: 1", -- step + "t: 96: 2", -- trapdoor + }, + BlockData = + { + -- Level 0 + "mmmmabbba", -- 0 + "mmmmmbbbm", -- 1 + "mmmmaccca", -- 2 + "mmmmccccc", -- 3 + "acccacccc", -- 4 + "ccccccccc", -- 5 + "ccccccccc", -- 6 + "ccccccccc", -- 7 + "accccccca", -- 8 + + -- Level 1 + "mmmmaddda", -- 0 + "mmmmmdddm", -- 1 + "mmmmaceca", -- 2 + "mmmmceeec", -- 3 + "acccaeeec", -- 4 + "ceeeeeeec", -- 5 + "ceeeeeeec", -- 6 + "ceeeeeeec", -- 7 + "accccccca", -- 8 + + -- Level 2 + "mmmma...a", -- 0 + "mmmm.....", -- 1 + "mmmmacfca", -- 2 + "mmmmc...c", -- 3 + "accca...c", -- 4 + "c.......c", -- 5 + "c.......c", -- 6 + "c......gc", -- 7 + "accccccca", -- 8 + + -- Level 3 + "mmmma...a", -- 0 + "mmmm.....", -- 1 + "mmmmachca", -- 2 + "mmmmc...c", -- 3 + "acica...i", -- 4 + "c.......i", -- 5 + "i.......i", -- 6 + "cj....kgc", -- 7 + "acciiicca", -- 8 + + -- Level 4 + "mmmml...l", -- 0 + "mmmmc...c", -- 1 + "mmmmaccca", -- 2 + "mmmmcnnnc", -- 3 + "acocannnp", -- 4 + "cnnnnnnnp", -- 5 + "qnnnnnnnp", -- 6 + "cnnnnnngc", -- 7 + "accrrrcca", -- 8 + + -- Level 5 + "mmmm.....", -- 0 + "mmmm.....", -- 1 + "mmmmcscsc", -- 2 + "mmmms...s", -- 3 + "csssc...c", -- 4 + "s.......s", -- 5 + "s.......s", -- 6 + "s......ts", -- 7 + "cssscsssc", -- 8 + + }, + }, -- LittleHouse5 + + + + { + OriginData = + { + ExportName = "LittleHouse6", + Name = "Desert 69", + GalleryName = "Desert", + GalleryIndex = "69", + ID = "559", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 9, + y = 6, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 9, + MaxY = 5, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 6, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "A: 96: 2", -- trapdoor + "a: 12: 0", -- sand + "b: 24: 2", -- sandstone + "c: 4: 0", -- cobblestone + "d: 3: 0", -- dirt + "e: 24: 0", -- sandstone + "f: 13: 0", -- gravel + "g: 2: 0", -- grass + "h: 5: 0", -- planks + "i: 85: 0", -- fence + "j: 64: 3", -- wooddoorblock + "k: 38: 1", -- rose + "l: 38: 2", -- rose + "m: 19: 0", -- sponge + "n: 38: 5", -- rose + "o: 65: 2", -- ladder + "p: 64: 9", -- wooddoorblock + "q:101: 0", -- ironbars + "r: 50: 1", -- torch + "s: 50: 4", -- torch + "t:128: 2", -- sandstonestairs + "u:126: 8", -- woodenslab + "v:128: 6", -- sandstonestairs + "w:128: 5", -- sandstonestairs + "x:128: 4", -- sandstonestairs + "y:128: 7", -- sandstonestairs + "z: 44: 1", -- step + }, + BlockData = + { + -- Level 0 + "aaaabcccb", -- 0 + "adddccccm", -- 1 + "adddbeeeb", -- 2 + "adddeeeee", -- 3 + "beeebeeee", -- 4 + "eeeeeeeee", -- 5 + "eeeeeeeee", -- 6 + "eeeeeeeee", -- 7 + "beeeeeeeb", -- 8 + + -- Level 1 + "aaaabfffb", -- 0 + "agggffffm", -- 1 + "agggbeheb", -- 2 + "agggehhhe", -- 3 + "beeebhhhe", -- 4 + "ehhhhhhhe", -- 5 + "ehhhhhhhe", -- 6 + "ehhhhhhhe", -- 7 + "beeeeeeeb", -- 8 + + -- Level 2 + "iiiib...b", -- 0 + "i........", -- 1 + "i...bejeb", -- 2 + "iklne...e", -- 3 + "beeeb...e", -- 4 + "e.......e", -- 5 + "e.......e", -- 6 + "e......oe", -- 7 + "beeeeeeeb", -- 8 + + -- Level 3 + "....b...b", -- 0 + ".........", -- 1 + "....bepeb", -- 2 + "....e...e", -- 3 + "beqeb...q", -- 4 + "e.......q", -- 5 + "q.......q", -- 6 + "er....soe", -- 7 + "beeqqqeeb", -- 8 + + -- Level 4 + "....t...t", -- 0 + "....e...e", -- 1 + "....beeeb", -- 2 + "....euuue", -- 3 + "bevebuuuw", -- 4 + "euuuuuuuw", -- 5 + "xuuuuuuuw", -- 6 + "euuuuuuoe", -- 7 + "beeyyyeeb", -- 8 + + -- Level 5 + ".........", -- 0 + ".........", -- 1 + "....ezeze", -- 2 + "....z...z", -- 3 + "ezzze...e", -- 4 + "z.......z", -- 5 + "z.......z", -- 6 + "z......Az", -- 7 + "ezzzezzze", -- 8 + + }, + }, -- LittleHouse6 + + + + { + OriginData = + { + ExportName = "LittleHouse4", + Name = "Desert 70", + GalleryName = "Desert", + GalleryIndex = "70", + ID = "560", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 5, + y = 6, + z = 11, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 5, + MaxY = 5, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 2, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 64: 3", -- wooddoorblock + "g: 65: 5", -- ladder + "h:134: 3", -- sprucewoodstairs + "i: 85: 0", -- fence + "j:134: 2", -- sprucewoodstairs + "k: 61: 2", -- furnace + "l:134: 6", -- sprucewoodstairs + "m: 19: 0", -- sponge + "n:134: 4", -- sprucewoodstairs + "o: 64: 9", -- wooddoorblock + "p: 50: 2", -- torch + "q:101: 0", -- ironbars + "r:171: 8", -- carpet + "s:128: 2", -- sandstonestairs + "t:126: 8", -- woodenslab + "u:128: 4", -- sandstonestairs + "v:128: 5", -- sandstonestairs + "w:128: 7", -- sandstonestairs + "x: 44: 1", -- step + "y: 96: 1", -- trapdoor + }, + BlockData = + { + -- Level 0 + "abbba", -- 0 + "mbbbm", -- 1 + "accca", -- 2 + "ccccc", -- 3 + "ccccc", -- 4 + "ccccc", -- 5 + "ccccc", -- 6 + "ccccc", -- 7 + "ccccc", -- 8 + "ccccc", -- 9 + "accca", -- 10 + + -- Level 1 + "addda", -- 0 + "mdddm", -- 1 + "aceca", -- 2 + "ceeec", -- 3 + "ceeec", -- 4 + "ceeec", -- 5 + "ceeec", -- 6 + "ceeec", -- 7 + "ceeec", -- 8 + "ceeec", -- 9 + "accca", -- 10 + + -- Level 2 + "a...a", -- 0 + ".....", -- 1 + "acfca", -- 2 + "cg..c", -- 3 + "c...c", -- 4 + "c..hc", -- 5 + "c..ic", -- 6 + "c..jc", -- 7 + "c...c", -- 8 + "cklnc", -- 9 + "accca", -- 10 + + -- Level 3 + "a...a", -- 0 + ".....", -- 1 + "acoca", -- 2 + "cg..c", -- 3 + "c..pc", -- 4 + "q...q", -- 5 + "q..rq", -- 6 + "q...q", -- 7 + "c...c", -- 8 + "c...c", -- 9 + "acqca", -- 10 + + -- Level 4 + "s...s", -- 0 + "c...c", -- 1 + "accca", -- 2 + "cgttc", -- 3 + "ctttc", -- 4 + "utttv", -- 5 + "utttv", -- 6 + "utttv", -- 7 + "ctttc", -- 8 + "ctttc", -- 9 + "acwca", -- 10 + + -- Level 5 + ".....", -- 0 + ".....", -- 1 + "cxcxc", -- 2 + "xy..x", -- 3 + "x...x", -- 4 + "x...x", -- 5 + "c...c", -- 6 + "x...x", -- 7 + "x...x", -- 8 + "x...x", -- 9 + "cxcxc", -- 10 + + }, + }, -- LittleHouse4 + + + + { + OriginData = + { + ExportName = "MediumHouse1", + Name = "Desert 71", + GalleryName = "Desert", + GalleryIndex = "71", + ID = "561", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 15, + y = 9, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 15, + MaxY = 8, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "80", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 12: 0", -- sand + "g: 64: 3", -- wooddoorblock + "h: 85: 0", -- fence + "i: 64: 0", -- wooddoorblock + "j: 65: 5", -- ladder + "k: 64: 9", -- wooddoorblock + "l:101: 0", -- ironbars + "m: 19: 0", -- sponge + "n: 64: 8", -- wooddoorblock + "o: 50: 4", -- torch + "p:128: 2", -- sandstonestairs + "q:126: 8", -- woodenslab + "r:128: 4", -- sandstonestairs + "s:128: 7", -- sandstonestairs + "t: 44: 1", -- step + "u: 50: 3", -- torch + "v:128: 6", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmmabbbammmmmmm", -- 0 + "mmmmbbbmmmmmmmm", -- 1 + "acccccccccacccc", -- 2 + "ccccccccccccccc", -- 3 + "ccccccccccccccc", -- 4 + "ccccccccccccccc", -- 5 + "ccccccccccccccc", -- 6 + "ccccccccccccccc", -- 7 + "acccccccccacccc", -- 8 + + -- Level 1 + "mmmadddammmmmmm", -- 0 + "mmmmdddmmmmmmmm", -- 1 + "acccceccccaffff", -- 2 + "ceeeeeeeeecffff", -- 3 + "ceeeeeeeeecffff", -- 4 + "ceeeeeeeeeeffff", -- 5 + "ceeeeeeeeecffff", -- 6 + "ceeeeeeeeecffff", -- 7 + "acccccccccaffff", -- 8 + + -- Level 2 + "mmma...ammmmmmm", -- 0 + "mmm.....mmmmmmm", -- 1 + "accccgccccahhhh", -- 2 + "c.........c...h", -- 3 + "c.........c...h", -- 4 + "c.........i...h", -- 5 + "c.........c...h", -- 6 + "c.........cj..h", -- 7 + "acccccccccahhhh", -- 8 + + -- Level 3 + "mmma...ammmmmmm", -- 0 + "mmm.....mmmmmmm", -- 1 + "acccckcccca....", -- 2 + "c.........c....", -- 3 + "l.........c....", -- 4 + "l.........n....", -- 5 + "l.........c....", -- 6 + "c..o...o..cj...", -- 7 + "accclllccca....", -- 8 + + -- Level 4 + "mmmp...pmmmmmmm", -- 0 + "mmmc...cmmmmmmm", -- 1 + "accccccccca....", -- 2 + "cqqqqqqqqqc....", -- 3 + "rqqqqqqqqqc....", -- 4 + "rqqqqqqqqqc....", -- 5 + "rqqqqqqqqqc....", -- 6 + "cqqqqqqqqqcj...", -- 7 + "acccsssccca....", -- 8 + + -- Level 5 + "mmm.....mmmmmmm", -- 0 + "mmm.....mmmmmmm", -- 1 + "cttttcttttc....", -- 2 + "t..accca..t....", -- 3 + "t..c...c..t....", -- 4 + "c.........c....", -- 5 + "t..c...c..t....", -- 6 + "t..accca..t....", -- 7 + "cttttcttttc....", -- 8 + + -- Level 6 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "...aclca.......", -- 3 + "...cu..c.......", -- 4 + "...............", -- 5 + "...c...c.......", -- 6 + "...aclca.......", -- 7 + "...............", -- 8 + + -- Level 7 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "...acvca.......", -- 3 + "...cqqqc.......", -- 4 + "...cqqqc.......", -- 5 + "...cqqqc.......", -- 6 + "...acsca.......", -- 7 + "...............", -- 8 + + -- Level 8 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "...ctctc.......", -- 3 + "...t...t.......", -- 4 + "...c...c.......", -- 5 + "...t...t.......", -- 6 + "...ctctc.......", -- 7 + "...............", -- 8 + + }, + }, -- MediumHouse1 + + + + { + OriginData = + { + ExportName = "LittleHouse2", + Name = "Desert 72", + GalleryName = "Desert", + GalleryIndex = "72", + ID = "562", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 7, + y = 6, + z = 11, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 7, + MaxY = 5, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 12: 0", -- sand + "e: 13: 0", -- gravel + "f: 5: 0", -- planks + "g: 64: 3", -- wooddoorblock + "h: 65: 5", -- ladder + "i: 85: 0", -- fence + "j:101: 0", -- ironbars + "k: 64: 9", -- wooddoorblock + "l: 50: 3", -- torch + "m: 19: 0", -- sponge + "n:128: 2", -- sandstonestairs + "o:128: 6", -- sandstonestairs + "p:126: 8", -- woodenslab + "q:128: 4", -- sandstonestairs + "r:128: 5", -- sandstonestairs + "s:128: 7", -- sandstonestairs + "t: 44: 1", -- step + "u: 96: 0", -- trapdoor + }, + BlockData = + { + -- Level 0 + "mabbbam", -- 0 + "mmbbbmm", -- 1 + "accccca", -- 2 + "ccccccc", -- 3 + "ccccccc", -- 4 + "ccccccc", -- 5 + "accccca", -- 6 + "ddddddd", -- 7 + "ddddddd", -- 8 + "ddddddd", -- 9 + "ddddddd", -- 10 + + -- Level 1 + "maeeeam", -- 0 + "mmeeemm", -- 1 + "acccfca", -- 2 + "cfffffc", -- 3 + "cfffffc", -- 4 + "cfffffc", -- 5 + "acfccca", -- 6 + "ddddddd", -- 7 + "ddddddd", -- 8 + "ddddddd", -- 9 + "ddddddd", -- 10 + + -- Level 2 + "ma...am", -- 0 + "m.....m", -- 1 + "acccgca", -- 2 + "c.....c", -- 3 + "c.....c", -- 4 + "ch....c", -- 5 + "ac.ccca", -- 6 + "i.....i", -- 7 + "i.....i", -- 8 + "i.....i", -- 9 + "iiiiiii", -- 10 + + -- Level 3 + "ma...am", -- 0 + "m.....m", -- 1 + "acjckca", -- 2 + "c..l..c", -- 3 + "j.....j", -- 4 + "ch....c", -- 5 + "ac.cjca", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + + -- Level 4 + "mn...nm", -- 0 + "mc...cm", -- 1 + "acoccca", -- 2 + "cpppppc", -- 3 + "qpppppr", -- 4 + "chppppc", -- 5 + "acccsca", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + + -- Level 5 + "m.....m", -- 0 + "m.....m", -- 1 + "cttcttc", -- 2 + "t.....t", -- 3 + "c.....c", -- 4 + "tu....t", -- 5 + "cttcttc", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + + }, + }, -- LittleHouse2 + + + + { + OriginData = + { + ExportName = "LittleHouse7", + Name = "Desert 73", + GalleryName = "Desert", + GalleryIndex = "73", + ID = "563", + CreatorName = "xoft", + }, + Size = + { + x = 9, + y = 6, + z = 11, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 9, + MaxY = 5, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 6, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 64: 3", -- wooddoorblock + "g: 65: 2", -- ladder + "h:101: 0", -- ironbars + "i: 64: 9", -- wooddoorblock + "j: 50: 1", -- torch + "k: 50: 2", -- torch + "l:128: 2", -- sandstonestairs + "m: 19: 0", -- sponge + "n:128: 6", -- sandstonestairs + "o:126: 8", -- woodenslab + "p:128: 4", -- sandstonestairs + "q:128: 5", -- sandstonestairs + "r:128: 7", -- sandstonestairs + "s: 44: 1", -- step + "t: 96: 2", -- trapdoor + }, + BlockData = + { + -- Level 0 + "mmmmabbba", -- 0 + "mmmmmbbbm", -- 1 + "accccccca", -- 2 + "ccccccccc", -- 3 + "ccccccccc", -- 4 + "ccccccccc", -- 5 + "acccacccc", -- 6 + "mmmmccccc", -- 7 + "mmmmccccc", -- 8 + "mmmmccccc", -- 9 + "mmmmaccca", -- 10 + + -- Level 1 + "mmmmaddda", -- 0 + "mmmmmdddm", -- 1 + "accccceca", -- 2 + "ceeeeeeec", -- 3 + "ceeeeeeec", -- 4 + "ceeeeeeec", -- 5 + "acccaeeec", -- 6 + "mmmmceeec", -- 7 + "mmmmceeec", -- 8 + "mmmmceeec", -- 9 + "mmmmaccca", -- 10 + + -- Level 2 + "mmmma...a", -- 0 + "mmmm.....", -- 1 + "acccccfca", -- 2 + "c.......c", -- 3 + "c.......c", -- 4 + "c.......c", -- 5 + "accca...c", -- 6 + "mmmmc...c", -- 7 + "mmmmc...c", -- 8 + "mmmmc..gc", -- 9 + "mmmmaccca", -- 10 + + -- Level 3 + "mmmma...a", -- 0 + "mmmm.....", -- 1 + "achcccica", -- 2 + "c.......c", -- 3 + "h.......c", -- 4 + "cj......h", -- 5 + "achca...h", -- 6 + "mmmmc...h", -- 7 + "mmmmh..kc", -- 8 + "mmmmc..gc", -- 9 + "mmmmachca", -- 10 + + -- Level 4 + "mmmml...l", -- 0 + "mmmmc...c", -- 1 + "acnccccca", -- 2 + "coooooooc", -- 3 + "poooooooc", -- 4 + "coooooooq", -- 5 + "acrcaoooq", -- 6 + "mmmmcoooq", -- 7 + "mmmmpoooc", -- 8 + "mmmmcoogc", -- 9 + "mmmmacrca", -- 10 + + -- Level 5 + "mmmm.....", -- 0 + "mmmm.....", -- 1 + "cssscscsc", -- 2 + "s.......s", -- 3 + "s.......s", -- 4 + "s.......s", -- 5 + "csssc...c", -- 6 + "mmmms...s", -- 7 + "mmmms...s", -- 8 + "mmmms..ts", -- 9 + "mmmmcsssc", -- 10 + + }, + }, -- LittleHouse7 + + + + { + OriginData = + { + ExportName = "MediumHouse2", + Name = "Desert 74", + GalleryName = "Desert", + GalleryIndex = "74", + ID = "573", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 11, + y = 10, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 9, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 8, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "80", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "A:128: 7", -- sandstonestairs + "B: 44: 1", -- step + "C: 96: 3", -- trapdoor + "D: 96: 2", -- trapdoor + "E:128: 2", -- sandstonestairs + "F:128: 0", -- sandstonestairs + "G: 87: 0", -- netherstone + "H:128: 1", -- sandstonestairs + "I:128: 3", -- sandstonestairs + "J: 51: 0", -- fire + "K: 44: 9", -- step + "a: 24: 2", -- sandstone + "b: 24: 0", -- sandstone + "c: 4: 0", -- cobblestone + "d: 12: 0", -- sand + "e: 13: 0", -- gravel + "f: 5: 0", -- planks + "g: 65: 3", -- ladder + "h: 85: 0", -- fence + "i: 64: 3", -- wooddoorblock + "j:134: 1", -- sprucewoodstairs + "k:134: 2", -- sprucewoodstairs + "l: 61: 2", -- furnace + "m: 19: 0", -- sponge + "n:134: 6", -- sprucewoodstairs + "o:134: 4", -- sprucewoodstairs + "p: 65: 2", -- ladder + "q:101: 0", -- ironbars + "r: 50: 2", -- torch + "s: 47: 0", -- bookshelf + "t: 64: 9", -- wooddoorblock + "u: 50: 3", -- torch + "v:171: 8", -- carpet + "w:128: 6", -- sandstonestairs + "x:126: 8", -- woodenslab + "y:128: 5", -- sandstonestairs + "z:128: 4", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "abbbammmcmm", -- 0 + "bbbbbdddcdm", -- 1 + "bbbbbmmmcdm", -- 2 + "bbbbbmmmcdm", -- 3 + "bbbbabbbbba", -- 4 + "bbbbbbbbbbb", -- 5 + "bbbbbbbbbbb", -- 6 + "bbbbbbbbbbb", -- 7 + "abbbbbbbbba", -- 8 + + -- Level 1 + "abbbammmemm", -- 0 + "bfffbdddedm", -- 1 + "bfffbmmmedm", -- 2 + "bfffbmmmedm", -- 3 + "bfffabbbfba", -- 4 + "bfffffffffb", -- 5 + "bfffffffffb", -- 6 + "bfffffffffb", -- 7 + "abbbbbbbbba", -- 8 + + -- Level 2 + "abbba......", -- 0 + "bg..bhhh.h.", -- 1 + "b...b....h.", -- 2 + "b...b....h.", -- 3 + "b...abbbiba", -- 4 + "b.........b", -- 5 + "bjh.......b", -- 6 + "bjk.lno..pb", -- 7 + "abbbbbbbbba", -- 8 + + -- Level 3 + "abqba......", -- 0 + "bg..q......", -- 1 + "b...q......", -- 2 + "q..rb......", -- 3 + "q...sbqbtba", -- 4 + "q......u..b", -- 5 + "b.v.......q", -- 6 + "b........pb", -- 7 + "abbbqqqbbba", -- 8 + + -- Level 4 + "abwba......", -- 0 + "bgxxy......", -- 1 + "bxxxy......", -- 2 + "zxxxb......", -- 3 + "zxxxabwbbba", -- 4 + "zxxxxxxxxxb", -- 5 + "bxxxxxxxxxy", -- 6 + "bxxxsssxxpb", -- 7 + "abbbAAAbbba", -- 8 + + -- Level 5 + "bBBBb......", -- 0 + "BC..B......", -- 1 + "B...B......", -- 2 + "B...B......", -- 3 + "b...bBBBBBb", -- 4 + "Bbbb......B", -- 5 + "Bbbb......B", -- 6 + "Bbbb.....DB", -- 7 + "bBBBBbBBBBb", -- 8 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "...........", -- 3 + "...........", -- 4 + ".aEa.......", -- 5 + ".FGH.......", -- 6 + ".aIa.......", -- 7 + "...........", -- 8 + + -- Level 7 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "...........", -- 3 + "...........", -- 4 + ".a.a.......", -- 5 + "..J........", -- 6 + ".a.a.......", -- 7 + "...........", -- 8 + + -- Level 8 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "...........", -- 3 + "...........", -- 4 + ".bbb.......", -- 5 + ".bKb.......", -- 6 + ".bbb.......", -- 7 + "...........", -- 8 + + -- Level 9 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "...........", -- 3 + "...........", -- 4 + ".B.B.......", -- 5 + "...........", -- 6 + ".B.B.......", -- 7 + "...........", -- 8 + + }, + }, -- MediumHouse2 + + + + { + OriginData = + { + ExportName = "MediumHouse3", + Name = "Desert 76", + GalleryName = "Desert", + GalleryIndex = "76", + ID = "575", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 12, + y = 10, + z = 11, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 12, + MaxY = 9, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 9, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "80", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 3: 0", -- dirt + "d: 24: 0", -- sandstone + "e: 13: 0", -- gravel + "f: 2: 0", -- grass + "g: 5: 0", -- planks + "h: 85: 0", -- fence + "i: 64: 3", -- wooddoorblock + "j: 64: 2", -- wooddoorblock + "k: 65: 4", -- ladder + "l: 65: 2", -- ladder + "m: 19: 0", -- sponge + "n: 50: 1", -- torch + "o: 50: 2", -- torch + "p:101: 0", -- ironbars + "q: 64: 9", -- wooddoorblock + "r:128: 2", -- sandstonestairs + "s:128: 6", -- sandstonestairs + "t:126: 8", -- woodenslab + "u:128: 5", -- sandstonestairs + "v:128: 7", -- sandstonestairs + "w: 44: 1", -- step + "x: 96: 0", -- trapdoor + "y:126: 0", -- woodenslab + "z:128: 4", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmmmmammbbba", -- 0 + "mmmmmmmmbbbm", -- 1 + "cccccaddddda", -- 2 + "cccccddddddd", -- 3 + "cccccddddddd", -- 4 + "cccccddddddd", -- 5 + "cccddddddddd", -- 6 + "mmmddddddddd", -- 7 + "mmmdddddddda", -- 8 + "mmmdddddmmmm", -- 9 + "mmmadddammmm", -- 10 + + -- Level 1 + "mmmmmammeeea", -- 0 + "mmmmmmmmeeem", -- 1 + "fffffadddgda", -- 2 + "fffffdgggggd", -- 3 + "fffffggggggd", -- 4 + "fffffdgggggd", -- 5 + "fffddggggggd", -- 6 + "mmmdgggggggd", -- 7 + "mmmdggggddda", -- 8 + "mmmdgggdmmmm", -- 9 + "mmmadddammmm", -- 10 + + -- Level 2 + "mmmmma.....a", -- 0 + "mmmmm.......", -- 1 + "hhhhhadddida", -- 2 + "h....d.....d", -- 3 + "h....j.....d", -- 4 + "h....d.....d", -- 5 + "hhhad......d", -- 6 + "mmmd......kd", -- 7 + "mmmd....ddda", -- 8 + "mmmd..ldmmmm", -- 9 + "mmmadddammmm", -- 10 + + -- Level 3 + "mmmmman...oa", -- 0 + "mmmmm.......", -- 1 + ".....appdqda", -- 2 + ".....d.....d", -- 3 + ".....q.....d", -- 4 + ".....d.....p", -- 5 + "...hd......d", -- 6 + "mmmd......kd", -- 7 + "mmmd....dppa", -- 8 + "mmmd..ldmmmm", -- 9 + "mmmhdddhmmmm", -- 10 + + -- Level 4 + "mmmmmr.....r", -- 0 + "mmmmmd.....d", -- 1 + ".....assddda", -- 2 + ".....dtttttd", -- 3 + ".....dtttttd", -- 4 + ".....dtttttu", -- 5 + "...hdatttttd", -- 6 + "mmmdttttttkd", -- 7 + "mmmdtttadvva", -- 8 + "mmmdttldmmmm", -- 9 + "mmmhdddhmmmm", -- 10 + + -- Level 5 + "............", -- 0 + "............", -- 1 + ".....dwwdwwd", -- 2 + ".....w.....w", -- 3 + ".....w.....w", -- 4 + ".....w.....d", -- 5 + "...hdadh...w", -- 6 + "mmmd...d..xw", -- 7 + "mmmd...awwwd", -- 8 + "mmmd..ldmmmm", -- 9 + "mmmhdddhmmmm", -- 10 + + -- Level 6 + "............", -- 0 + "............", -- 1 + "............", -- 2 + "............", -- 3 + "............", -- 4 + "............", -- 5 + "...hd.dh....", -- 6 + "mmmd...d....", -- 7 + "mmmp........", -- 8 + "mmmd..ldmmmm", -- 9 + "mmmhdpdhmmmm", -- 10 + + -- Level 7 + "............", -- 0 + "............", -- 1 + "............", -- 2 + "............", -- 3 + "............", -- 4 + "............", -- 5 + "...hd.dh....", -- 6 + "mmmd...d....", -- 7 + "mmmp........", -- 8 + "mmmdn.ldmmmm", -- 9 + "mmmhdpdhmmmm", -- 10 + + -- Level 8 + "............", -- 0 + "............", -- 1 + "............", -- 2 + "............", -- 3 + "............", -- 4 + "............", -- 5 + "...adsda....", -- 6 + "mmmdyyyd....", -- 7 + "mmmzyyyu....", -- 8 + "mmmdyyldmmmm", -- 9 + "mmmadvdammmm", -- 10 + + -- Level 9 + "............", -- 0 + "............", -- 1 + "............", -- 2 + "............", -- 3 + "............", -- 4 + "............", -- 5 + "...w.w.w....", -- 6 + "mmm.........", -- 7 + "mmmw...w....", -- 8 + "mmm.....mmmm", -- 9 + "mmmw.w.wmmmm", -- 10 + + }, + }, -- MediumHouse3 + + + + { + OriginData = + { + ExportName = "LargeHouse1", + Name = "Desert 77", + GalleryName = "Desert", + GalleryIndex = "77", + ID = "577", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 15, + y = 14, + z = 11, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = -1, + MaxX = 14, + MaxY = 13, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 14, + RelY = 2, + RelZ = 3, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "60", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "A: 96:10", -- trapdoor + "B:128: 4", -- sandstonestairs + "C:128: 5", -- sandstonestairs + "D:128: 7", -- sandstonestairs + "E: 44: 1", -- step + "F:128: 2", -- sandstonestairs + "G:128: 0", -- sandstonestairs + "H: 87: 0", -- netherstone + "I:128: 3", -- sandstonestairs + "J: 51: 0", -- fire + "K: 44: 9", -- step + "a: 24: 2", -- sandstone + "b: 24: 0", -- sandstone + "c: 12: 0", -- sand + "d: 4: 0", -- cobblestone + "e: 5: 0", -- planks + "f: 13: 0", -- gravel + "g: 85: 0", -- fence + "h: 5: 1", -- planks + "i: 64: 2", -- wooddoorblock + "j: 64: 0", -- wooddoorblock + "k: 61: 2", -- furnace + "l:118: 0", -- cauldronblock + "m: 19: 0", -- sponge + "n:134: 4", -- sprucewoodstairs + "o: 65: 2", -- ladder + "p:101: 0", -- ironbars + "q: 50: 1", -- torch + "r:140: 0", -- flowerpotblock + "s: 64: 9", -- wooddoorblock + "t: 50: 3", -- torch + "u: 69:12", -- lever + "v: 50: 4", -- torch + "w:128: 6", -- sandstonestairs + "x: 44:10", -- step + "y:128: 1", -- sandstonestairs + "z: 47: 0", -- bookshelf + }, + BlockData = + { + -- Level 0 + "mmmmabbbbbbbamm", -- 0 + "ccccbbbbbbbbbma", -- 1 + "ccccbbbbbbbbbdd", -- 2 + "ccccbbbbbbbbbdd", -- 3 + "ccccbbbbbbbbbdd", -- 4 + "ccccbbbbbbbbbma", -- 5 + "ccccbbbbbbbbbmm", -- 6 + "mmmmbbbbbbbbbmm", -- 7 + "mmmmbbbbbbbbbmm", -- 8 + "mmmmbbbbbbbbbmm", -- 9 + "mmmmabbbbbbbamm", -- 10 + + -- Level 1 + "mmmmabbbbbbbamm", -- 0 + "ccccbeeeeeeebma", -- 1 + "cccceeeeeeeebff", -- 2 + "ccccbeeeeeeeeff", -- 3 + "ccccbeeeeeeebff", -- 4 + "ccccbeeeeeeebma", -- 5 + "ccccbeeeeeeebmm", -- 6 + "mmmmbeeeeeeebmm", -- 7 + "mmmmbeeeeeeebmm", -- 8 + "mmmmbeeeeeeebmm", -- 9 + "mmmmabbbbbbbamm", -- 10 + + -- Level 2 + "mmmmabbbbbbbamm", -- 0 + "ggggb......hb.a", -- 1 + "g...i.......b..", -- 2 + "g...b.......j..", -- 3 + "g...bkln..o.b..", -- 4 + "g...bbbb.bbbb.a", -- 5 + "ggggb.......bmm", -- 6 + "mmmmb.......bmm", -- 7 + "mmmmb.......bmm", -- 8 + "mmmmb.......bmm", -- 9 + "mmmmabbbbbbbamm", -- 10 + + -- Level 3 + "mmmmabbpppbbamm", -- 0 + "....bq.....rb.a", -- 1 + "....s.......b.t", -- 2 + "....b.......s..", -- 3 + "....b.u...o.b.v", -- 4 + "....bbbb.bbbb.a", -- 5 + "....p..t.t..pmm", -- 6 + "mmmmp.......pmm", -- 7 + "mmmmp.......pmm", -- 8 + "mmmmb.......bmm", -- 9 + "mmmmabbpppbbamm", -- 10 + + -- Level 4 + "mmmmabbwwwbbamm", -- 0 + "....bxxxxxxxbby", -- 1 + "....bxxxxxxxb..", -- 2 + "....bxxxxxxxb..", -- 3 + "....bzzzxxAxb..", -- 4 + "....bbbbbbbbbby", -- 5 + "....BxxxxxxxCmm", -- 6 + "mmmmBxxxxxxxCmm", -- 7 + "mmmmBxxxxxxxCmm", -- 8 + "mmmmbxxxxxxxbmm", -- 9 + "mmmmabbDDDbbamm", -- 10 + + -- Level 5 + "mmmmbEEEbEEEbmm", -- 0 + "....EabbbbbaE..", -- 1 + "....Eb.....bE..", -- 2 + "....Eb.....bE..", -- 3 + "....Eb.....bE..", -- 4 + "....babb.bbab..", -- 5 + "....E.......Emm", -- 6 + "mmmmE.......Emm", -- 7 + "mmmmE.......Emm", -- 8 + "mmmmE.......Emm", -- 9 + "mmmmbEEEbEEEbmm", -- 10 + + -- Level 6 + "...............", -- 0 + ".....abbpbba...", -- 1 + ".....p.....p...", -- 2 + ".....p.....p...", -- 3 + ".....p.....p...", -- 4 + ".....abb.bba...", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + "...............", -- 9 + "...............", -- 10 + + -- Level 7 + "...............", -- 0 + ".....abbwbba...", -- 1 + ".....BxxxxxC...", -- 2 + ".....BxxxxxC...", -- 3 + ".....BxxxxxC...", -- 4 + ".....abbbbba...", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + "...............", -- 9 + "...............", -- 10 + + -- Level 8 + "...............", -- 0 + ".....bEEbEEb...", -- 1 + ".....E.bbb.E...", -- 2 + ".....b.bbb.b...", -- 3 + ".....E.bbb.E...", -- 4 + ".....bEEbEEb...", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + "...............", -- 9 + "...............", -- 10 + + -- Level 9 + "...............", -- 0 + "...............", -- 1 + ".......aFa.....", -- 2 + ".......GHy.....", -- 3 + ".......aIa.....", -- 4 + "...............", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + "...............", -- 9 + "...............", -- 10 + + -- Level 10 + "...............", -- 0 + "...............", -- 1 + ".......a.a.....", -- 2 + "........J......", -- 3 + ".......a.a.....", -- 4 + "...............", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + "...............", -- 9 + "...............", -- 10 + + -- Level 11 + "...............", -- 0 + "...............", -- 1 + ".......awa.....", -- 2 + ".......B.C.....", -- 3 + ".......aDa.....", -- 4 + "...............", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + "...............", -- 9 + "...............", -- 10 + + -- Level 12 + "...............", -- 0 + "...............", -- 1 + ".......bbb.....", -- 2 + ".......bKb.....", -- 3 + ".......bbb.....", -- 4 + "...............", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + "...............", -- 9 + "...............", -- 10 + + -- Level 13 + "...............", -- 0 + "...............", -- 1 + ".......E.E.....", -- 2 + "...............", -- 3 + ".......E.E.....", -- 4 + "...............", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + "...............", -- 9 + "...............", -- 10 + + }, + }, -- LargeHouse1 + + + + { + OriginData = + { + ExportName = "LittleTower", + Name = "Desert 79", + GalleryName = "Desert", + GalleryIndex = "79", + ID = "595", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 5, + y = 9, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 5, + MaxY = 8, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 2, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 64: 3", -- wooddoorblock + "g: 65: 5", -- ladder + "h: 64: 9", -- wooddoorblock + "i:101: 0", -- ironbars + "j: 50: 4", -- torch + "k:128: 2", -- sandstonestairs + "l:126: 8", -- woodenslab + "m: 19: 0", -- sponge + "n:128: 4", -- sandstonestairs + "o:128: 5", -- sandstonestairs + "p:128: 7", -- sandstonestairs + "q:128: 6", -- sandstonestairs + "r: 44: 1", -- step + "s: 96: 1", -- trapdoor + }, + BlockData = + { + -- Level 0 + "abbba", -- 0 + "mbbbm", -- 1 + "accca", -- 2 + "ccccc", -- 3 + "ccccc", -- 4 + "ccccc", -- 5 + "accca", -- 6 + + -- Level 1 + "addda", -- 0 + "mdddm", -- 1 + "aceca", -- 2 + "ceeec", -- 3 + "ceeec", -- 4 + "ceeec", -- 5 + "accca", -- 6 + + -- Level 2 + "a...a", -- 0 + ".....", -- 1 + "acfca", -- 2 + "cg..c", -- 3 + "c...c", -- 4 + "c...c", -- 5 + "accca", -- 6 + + -- Level 3 + "a...a", -- 0 + ".....", -- 1 + "achca", -- 2 + "cg..c", -- 3 + "i...i", -- 4 + "c..jc", -- 5 + "acica", -- 6 + + -- Level 4 + "k...k", -- 0 + "c...c", -- 1 + "accca", -- 2 + "cgllc", -- 3 + "nlllo", -- 4 + "clllc", -- 5 + "acpca", -- 6 + + -- Level 5 + ".....", -- 0 + ".....", -- 1 + "accca", -- 2 + "cg..c", -- 3 + "c...c", -- 4 + "c...c", -- 5 + "accca", -- 6 + + -- Level 6 + ".....", -- 0 + ".....", -- 1 + "acica", -- 2 + "cg..c", -- 3 + "i...i", -- 4 + "c..jc", -- 5 + "acica", -- 6 + + -- Level 7 + ".....", -- 0 + ".....", -- 1 + "acqca", -- 2 + "cgllc", -- 3 + "nlllo", -- 4 + "clllc", -- 5 + "acpca", -- 6 + + -- Level 8 + ".....", -- 0 + ".....", -- 1 + "crcrc", -- 2 + "rs..r", -- 3 + "c...c", -- 4 + "r...r", -- 5 + "crcrc", -- 6 + + }, + }, -- LittleTower + + + + { + OriginData = + { + ExportName = "LargeTower", + Name = "Desert 80", + GalleryName = "Desert", + GalleryIndex = "80", + ID = "596", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 7, + y = 12, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 7, + MaxY = 11, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b: 4: 0", -- cobblestone + "c: 12: 0", -- sand + "d: 5: 0", -- planks + "e: 13: 0", -- gravel + "f:128: 2", -- sandstonestairs + "g:128: 0", -- sandstonestairs + "h: 24: 2", -- sandstone + "i: 71: 3", -- irondoorblock + "j:128: 1", -- sandstonestairs + "k:128: 3", -- sandstonestairs + "l: 77: 4", -- stonebutton + "m: 19: 0", -- sponge + "n: 71: 9", -- irondoorblock + "o: 77: 3", -- stonebutton + "p:128: 6", -- sandstonestairs + "q:128: 4", -- sandstonestairs + "r:128: 5", -- sandstonestairs + "s: 50: 4", -- torch + "t:128: 7", -- sandstonestairs + "u: 85: 0", -- fence + "v: 24: 1", -- sandstone + "w: 44: 1", -- step + "x: 89: 0", -- lightstone + }, + BlockData = + { + -- Level 0 + "mabbbam", -- 0 + "aacdcaa", -- 1 + "madddam", -- 2 + "madddam", -- 3 + "madddam", -- 4 + "aaaaaaa", -- 5 + "mammmam", -- 6 + + -- Level 1 + "maeeeam", -- 0 + "aacdcaa", -- 1 + "madddam", -- 2 + "madddam", -- 3 + "madddam", -- 4 + "aaaaaaa", -- 5 + "mammmam", -- 6 + + -- Level 2 + "mf...fm", -- 0 + "ghaiahj", -- 1 + "ma...am", -- 2 + "ma...am", -- 3 + "ma...am", -- 4 + "ghaaahj", -- 5 + "mkmmmkm", -- 6 + + -- Level 3 + "m.l...m", -- 0 + ".hanah.", -- 1 + ".ao..a.", -- 2 + ".a...a.", -- 3 + ".a...a.", -- 4 + ".haaah.", -- 5 + "m.....m", -- 6 + + -- Level 4 + ".......", -- 0 + "..pap..", -- 1 + ".q...r.", -- 2 + ".a...a.", -- 3 + ".q.s.r.", -- 4 + "..tat..", -- 5 + ".......", -- 6 + + -- Level 5 + ".......", -- 0 + "..aua..", -- 1 + ".a...a.", -- 2 + ".u...u.", -- 3 + ".a...a.", -- 4 + "..aua..", -- 5 + ".......", -- 6 + + -- Level 6 + ".......", -- 0 + "..aua..", -- 1 + ".a...a.", -- 2 + ".u...u.", -- 3 + ".a...a.", -- 4 + "..aua..", -- 5 + ".......", -- 6 + + -- Level 7 + ".......", -- 0 + "..aua..", -- 1 + ".a...a.", -- 2 + ".u...u.", -- 3 + ".a...a.", -- 4 + "..aua..", -- 5 + ".......", -- 6 + + -- Level 8 + ".......", -- 0 + "..faf..", -- 1 + ".g...j.", -- 2 + ".a...a.", -- 3 + ".g...j.", -- 4 + "..kak..", -- 5 + ".......", -- 6 + + -- Level 9 + ".......", -- 0 + ".aavaa.", -- 1 + ".a...a.", -- 2 + ".v...v.", -- 3 + ".a...a.", -- 4 + ".aavaa.", -- 5 + ".......", -- 6 + + -- Level 10 + "...p...", -- 0 + ".haaah.", -- 1 + ".awwwa.", -- 2 + "qawawar", -- 3 + ".awwwa.", -- 4 + ".haaah.", -- 5 + "...t...", -- 6 + + -- Level 11 + "...w...", -- 0 + ".w...w.", -- 1 + ".......", -- 2 + "w..x..w", -- 3 + ".......", -- 4 + ".w...w.", -- 5 + "...w...", -- 6 + + }, + }, -- LargeTower + + + + { + OriginData = + { + ExportName = "BarWithoutBasement", + Name = "Desert 81", + GalleryName = "Desert", + GalleryIndex = "81", + ID = "597", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 11, + y = 9, + z = 10, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 8, + MaxZ = 10, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "80", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "A:126: 8", -- woodenslab + "B:128: 7", -- sandstonestairs + "C: 44: 1", -- step + "D: 64: 3", -- wooddoorblock + "E:128: 6", -- sandstonestairs + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f:128: 5", -- sandstonestairs + "g:107: 0", -- fencegate + "h:128: 4", -- sandstonestairs + "i:134: 1", -- sprucewoodstairs + "j:134: 3", -- sprucewoodstairs + "k: 85: 0", -- fence + "l:134: 0", -- sprucewoodstairs + "m: 19: 0", -- sponge + "n:134: 5", -- sprucewoodstairs + "o:134: 7", -- sprucewoodstairs + "p:134: 4", -- sprucewoodstairs + "q:107: 3", -- fencegate + "r: 64: 1", -- wooddoorblock + "s: 65: 3", -- ladder + "t: 50: 3", -- torch + "u:171: 8", -- carpet + "v:101: 0", -- ironbars + "w: 64: 9", -- wooddoorblock + "x:128: 2", -- sandstonestairs + "y: 24: 1", -- sandstone + "z: 44: 9", -- step + }, + BlockData = + { + -- Level 0 + "mmmabbbammm", -- 0 + "mmmmbbbmmmm", -- 1 + "accccccccca", -- 2 + "ccccccccccc", -- 3 + "ccccccccccc", -- 4 + "ccccccccccc", -- 5 + "ccccccccccc", -- 6 + "ccccccccccc", -- 7 + "accccccccca", -- 8 + "mmmmmmmmmmm", -- 9 + + -- Level 1 + "mmmadddammm", -- 0 + "mmmmdddmmmm", -- 1 + "accceeeccca", -- 2 + "ceeeeeeeeec", -- 3 + "ceeeeeeeeec", -- 4 + "ceeeeeeeeec", -- 5 + "ceeeeeeeeec", -- 6 + "ceeeeeeeeec", -- 7 + "aecccccccca", -- 8 + "mmmmmmmmmmm", -- 9 + + -- Level 2 + "mmma...ammm", -- 0 + "mmm.....mmm", -- 1 + "acccfghccca", -- 2 + "cij.....jjc", -- 3 + "cik.....klc", -- 4 + "c.........c", -- 5 + "cnoop.....c", -- 6 + "c...q..iklc", -- 7 + "arcccccccca", -- 8 + "mmsmmmmmmmm", -- 9 + + -- Level 3 + "mmma...ammm", -- 0 + "mmm.....mmm", -- 1 + "accc...ccca", -- 2 + "c..t...t..c", -- 3 + "c.u.....u.c", -- 4 + "v.........v", -- 5 + "c.........c", -- 6 + "c.......u.c", -- 7 + "awccvvvccca", -- 8 + "mmsmmmmmmmm", -- 9 + + -- Level 4 + "mmmx...xmmm", -- 0 + "mmmy...cmmm", -- 1 + "acccfzhccca", -- 2 + "cAAAAAAAAAc", -- 3 + "cAAAAAAAAAc", -- 4 + "hAAAAAAAAAf", -- 5 + "cAAAAAAAAAc", -- 6 + "cAAAAAAAAAc", -- 7 + "acccBBBccca", -- 8 + "mmsmmmmmmmm", -- 9 + + -- Level 5 + "mmm.....mmm", -- 0 + "mmm.....mmm", -- 1 + "cCCCCcCCCCc", -- 2 + "CacccccccaC", -- 3 + "Cc.......cC", -- 4 + "cc.......cc", -- 5 + "Cc.......cC", -- 6 + "CaDccccccaC", -- 7 + "cC.CCcCCCCc", -- 8 + "mmmmmmmmmmm", -- 9 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + ".accvvvcca.", -- 3 + ".c.......c.", -- 4 + ".v.......v.", -- 5 + ".c.......c.", -- 6 + ".awcvvvcca.", -- 7 + "...........", -- 8 + "...........", -- 9 + + -- Level 7 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + ".accEEEcca.", -- 3 + ".cAAAAAAAc.", -- 4 + ".hAAAAAAAf.", -- 5 + ".cAAAAAAAc.", -- 6 + ".accBBBcca.", -- 7 + "...........", -- 8 + "...........", -- 9 + + -- Level 8 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + ".cCCCcCCCc.", -- 3 + ".C.......C.", -- 4 + ".c.......c.", -- 5 + ".C.......C.", -- 6 + ".cCCCcCCCc.", -- 7 + "...........", -- 8 + "...........", -- 9 + + }, + }, -- BarWithoutBasement + + + + { + OriginData = + { + ExportName = "BarWithBasement", + Name = "Desert 82", + GalleryName = "Desert", + GalleryIndex = "82", + ID = "598", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 11, + y = 12, + z = 10, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 11, + MaxZ = 10, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 5, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "70", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "A: 65: 3", -- ladder + "B: 50: 3", -- torch + "C:171: 8", -- carpet + "D:101: 0", -- ironbars + "E: 64: 9", -- wooddoorblock + "F:128: 2", -- sandstonestairs + "G: 24: 1", -- sandstone + "H: 44: 9", -- step + "I:126: 8", -- woodenslab + "J:128: 7", -- sandstonestairs + "K: 44: 1", -- step + "L: 64: 3", -- wooddoorblock + "M:128: 6", -- sandstonestairs + "a: 24: 2", -- sandstone + "b: 1: 0", -- stone + "c: 24: 0", -- sandstone + "d: 12: 0", -- sand + "e:134: 4", -- sprucewoodstairs + "f: 5: 1", -- planks + "g:134: 5", -- sprucewoodstairs + "h: 65: 5", -- ladder + "i: 17: 3", -- tree + "j: 69:11", -- lever + "k: 4: 0", -- cobblestone + "l:134: 0", -- sprucewoodstairs + "m: 19: 0", -- sponge + "n:134: 1", -- sprucewoodstairs + "o: 50: 4", -- torch + "p: 13: 0", -- gravel + "q: 5: 0", -- planks + "r: 96: 8", -- trapdoor + "s:128: 5", -- sandstonestairs + "t:107: 2", -- fencegate + "u:128: 4", -- sandstonestairs + "v:134: 3", -- sprucewoodstairs + "w: 85: 0", -- fence + "x:134: 7", -- sprucewoodstairs + "y:107: 1", -- fencegate + "z: 64: 1", -- wooddoorblock + }, + BlockData = + { + -- Level 0 + "mmmabbbammm", -- 0 + "mcccccccccm", -- 1 + "abcccccccba", -- 2 + "cbcccccccbc", -- 3 + "cbcccccccbc", -- 4 + "cbcccccccbc", -- 5 + "cbcccccccbc", -- 6 + "cbcccccccbc", -- 7 + "abbbbbbbbba", -- 8 + "mmmmmmmmmmm", -- 9 + + -- Level 1 + "mmmadddammm", -- 0 + "mcccccccccm", -- 1 + "acefg.efgca", -- 2 + "ccefg.efgcc", -- 3 + "ccefg.efgcc", -- 4 + "cc.......cc", -- 5 + "cc.......cc", -- 6 + "cch......cc", -- 7 + "accccccccca", -- 8 + "mmmmmmmmmmm", -- 9 + + -- Level 2 + "mmmadddammm", -- 0 + "mcccccccccm", -- 1 + "acfff.fffca", -- 2 + "ccfff.fffcc", -- 3 + "ccfif.fifcc", -- 4 + "cc.j...j.cc", -- 5 + "cc.......cc", -- 6 + "cch......cc", -- 7 + "accccccccca", -- 8 + "mmmmmmmmmmm", -- 9 + + -- Level 3 + "mmmakkkammm", -- 0 + "mcccccccccm", -- 1 + "aclfn.lfnca", -- 2 + "cclfn.lfncc", -- 3 + "cclfn.lfncc", -- 4 + "cc.......cc", -- 5 + "cc.......cc", -- 6 + "cch..o...cc", -- 7 + "accccccccca", -- 8 + "mmmmmmmmmmm", -- 9 + + -- Level 4 + "mmmapppammm", -- 0 + "mmmmpppmmmm", -- 1 + "acccqqqccca", -- 2 + "cqqqqqqqqqc", -- 3 + "cqqqqqqqqqc", -- 4 + "cqqqqqqqqqc", -- 5 + "cqqqqqqqqqc", -- 6 + "cqrqqqqqqqc", -- 7 + "aqcccccccca", -- 8 + "mmmmmmmmmmm", -- 9 + + -- Level 5 + "mmma...ammm", -- 0 + "mmm.....mmm", -- 1 + "acccstuccca", -- 2 + "cnv.....vvc", -- 3 + "cnw.....wlc", -- 4 + "c.........c", -- 5 + "cgxxe.....c", -- 6 + "c...y..nwlc", -- 7 + "azcccccccca", -- 8 + "mmAmmmmmmmm", -- 9 + + -- Level 6 + "mmma...ammm", -- 0 + "mmm.....mmm", -- 1 + "accc...ccca", -- 2 + "c..B...B..c", -- 3 + "c.C.....C.c", -- 4 + "D.........D", -- 5 + "c.........c", -- 6 + "c.......C.c", -- 7 + "aEccDDDccca", -- 8 + "mmAmmmmmmmm", -- 9 + + -- Level 7 + "mmmF...Fmmm", -- 0 + "mmmG...cmmm", -- 1 + "acccsHuccca", -- 2 + "cIIIIIIIIIc", -- 3 + "cIIIIIIIIIc", -- 4 + "uIIIIIIIIIs", -- 5 + "cIIIIIIIIIc", -- 6 + "cIIIIIIIIIc", -- 7 + "acccJJJccca", -- 8 + "mmAmmmmmmmm", -- 9 + + -- Level 8 + "mmm.....mmm", -- 0 + "mmm.....mmm", -- 1 + "cKKKKcKKKKc", -- 2 + "KacccccccaK", -- 3 + "Kc.......cK", -- 4 + "cc.......cc", -- 5 + "Kc.......cK", -- 6 + "KaLccccccaK", -- 7 + "cK.KKcKKKKc", -- 8 + "mmmmmmmmmmm", -- 9 + + -- Level 9 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + ".accDDDcca.", -- 3 + ".c.......c.", -- 4 + ".D.......D.", -- 5 + ".c.......c.", -- 6 + ".aEcDDDcca.", -- 7 + "...........", -- 8 + "...........", -- 9 + + -- Level 10 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + ".accMMMcca.", -- 3 + ".cIIIIIIIc.", -- 4 + ".uIIIIIIIs.", -- 5 + ".cIIIIIIIc.", -- 6 + ".accJJJcca.", -- 7 + "...........", -- 8 + "...........", -- 9 + + -- Level 11 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + ".cKKKcKKKc.", -- 3 + ".K.......K.", -- 4 + ".c.......c.", -- 5 + ".K.......K.", -- 6 + ".cKKKcKKKc.", -- 7 + "...........", -- 8 + "...........", -- 9 + + }, + }, -- BarWithBasement + + + + { + OriginData = + { + ExportName = "Temple", + Name = "Desert 83", + GalleryName = "Desert", + GalleryIndex = "83", + ID = "599", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 13, + y = 10, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 13, + MaxY = 9, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 6, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "50", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "A: 51: 0", -- fire + "B: 44: 9", -- step + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 64: 3", -- wooddoorblock + "g: 17: 0", -- tree + "h:128: 5", -- sandstonestairs + "i:128: 4", -- sandstonestairs + "j:128: 7", -- sandstonestairs + "k:128: 6", -- sandstonestairs + "l:118: 3", -- cauldronblock + "m: 19: 0", -- sponge + "n:155: 1", -- quartzblock + "o: 64: 9", -- wooddoorblock + "p: 50: 3", -- torch + "q:101: 0", -- ironbars + "r:140: 0", -- flowerpotblock + "s: 24: 1", -- sandstone + "t:128: 2", -- sandstonestairs + "u:126: 8", -- woodenslab + "v: 44: 1", -- step + "w:128: 0", -- sandstonestairs + "x: 87: 0", -- netherstone + "y:128: 1", -- sandstonestairs + "z:128: 3", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmmmabbbammmm", -- 0 + "mmmmmbbbmmmmm", -- 1 + "accccccccccca", -- 2 + "ccccccccccccc", -- 3 + "ccccccccccccc", -- 4 + "ccccccccccccc", -- 5 + "ccccccccccccc", -- 6 + "ccccccccccccc", -- 7 + "accccccccccca", -- 8 + + -- Level 1 + "mmmmadddammmm", -- 0 + "mmmmmdddmmmmm", -- 1 + "accccceccccca", -- 2 + "ceeeeeeeeeeec", -- 3 + "ceeeeeeeeeeec", -- 4 + "ceeeeeeeeeeec", -- 5 + "ceeeeeeeeeeec", -- 6 + "ceeeeeeeeeeec", -- 7 + "accccccccccca", -- 8 + + -- Level 2 + "mmmma...ammmm", -- 0 + "mmmm.....mmmm", -- 1 + "acccccfccccca", -- 2 + "cgh.......igc", -- 3 + "cj.........jc", -- 4 + "c...........c", -- 5 + "ck.........kc", -- 6 + "cgh.linhl.igc", -- 7 + "accccccccccca", -- 8 + + -- Level 3 + "mmmma...ammmm", -- 0 + "mmmm.....mmmm", -- 1 + "acccccoccccca", -- 2 + "cg...p.p...gc", -- 3 + "c...........c", -- 4 + "q...........q", -- 5 + "c...........c", -- 6 + "cg...rsr...gc", -- 7 + "acqqqcccqqqca", -- 8 + + -- Level 4 + "mmmmt...tmmmm", -- 0 + "mmmms...cmmmm", -- 1 + "accccccccccca", -- 2 + "cguuuuuuuuugc", -- 3 + "cuuuuuuuuuuuc", -- 4 + "iuuuuuuuuuuuh", -- 5 + "cuuuuuuuuuuuc", -- 6 + "cguuuuuuuuugc", -- 7 + "acjjjcccjjjca", -- 8 + + -- Level 5 + "mmmm.....mmmm", -- 0 + "mmmm.....mmmm", -- 1 + "cvvvvvcvvvvvc", -- 2 + "v...........v", -- 3 + "v.ccc...ccc.v", -- 4 + "c.ccc...ccc.c", -- 5 + "v.ccc...ccc.v", -- 6 + "v...........v", -- 7 + "cvvvvvcvvvvvc", -- 8 + + -- Level 6 + ".............", -- 0 + ".............", -- 1 + ".............", -- 2 + ".............", -- 3 + "..ata...ata..", -- 4 + "..wxy...wxy..", -- 5 + "..aza...aza..", -- 6 + ".............", -- 7 + ".............", -- 8 + + -- Level 7 + ".............", -- 0 + ".............", -- 1 + ".............", -- 2 + ".............", -- 3 + "..a.a...a.a..", -- 4 + "...A.....A...", -- 5 + "..a.a...a.a..", -- 6 + ".............", -- 7 + ".............", -- 8 + + -- Level 8 + ".............", -- 0 + ".............", -- 1 + ".............", -- 2 + ".............", -- 3 + "..ccc...ccc..", -- 4 + "..cBc...cBc..", -- 5 + "..ccc...ccc..", -- 6 + ".............", -- 7 + ".............", -- 8 + + -- Level 9 + ".............", -- 0 + ".............", -- 1 + ".............", -- 2 + ".............", -- 3 + "..v.v...v.v..", -- 4 + ".............", -- 5 + "..v.v...v.v..", -- 6 + ".............", -- 7 + ".............", -- 8 + + }, + }, -- Temple + + + + { + OriginData = + { + ExportName = "Well", + Name = "Desert 90", + GalleryName = "Desert", + GalleryIndex = "90", + ID = "631", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 7, + y = 21, + z = 7, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 6, + MaxY = 20, + MaxZ = 6, + }, + Connectors = + { + { + Type = 2, + RelX = 3, + RelY = 16, + RelZ = 6, + Direction = 3, -- Z+ + }, + { + Type = 2, + RelX = 0, + RelY = 16, + RelZ = 3, + Direction = 4, -- X- + }, + { + Type = 2, + RelX = 3, + RelY = 16, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 2, + RelX = 6, + RelY = 16, + RelZ = 3, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["IsStarting"] = "1", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 1: 0", -- stone + "b: 24: 2", -- sandstone + "c: 24: 0", -- sandstone + "d: 8: 0", -- water + "e: 4: 0", -- cobblestone + "f: 13: 0", -- gravel + "g:128: 1", -- sandstonestairs + "h: 44: 1", -- step + "i:128: 0", -- sandstonestairs + "j:128: 3", -- sandstonestairs + "k:128: 2", -- sandstonestairs + "l: 44: 9", -- step + "m: 19: 0", -- sponge + "n:126: 0", -- woodenslab + }, + BlockData = + { + -- Level 0 + "mmmmmmm", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "maaaaam", -- 5 + "mmmmmmm", -- 6 + + -- Level 1 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 2 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 3 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 4 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 5 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 6 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 7 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 8 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 9 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 10 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 11 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 12 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 13 + "mmmmmmm", -- 0 + "mbcccbm", -- 1 + "mcdddcm", -- 2 + "mcdddcm", -- 3 + "mcdddcm", -- 4 + "mbcccbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 14 + "mmeeemm", -- 0 + "mbcccbm", -- 1 + "ecdddce", -- 2 + "ecdddce", -- 3 + "ecdddce", -- 4 + "mbcccbm", -- 5 + "mmeeemm", -- 6 + + -- Level 15 + "mmfffmm", -- 0 + "mbcccbm", -- 1 + "fcdddcf", -- 2 + "fcdddcf", -- 3 + "fcdddcf", -- 4 + "mbcccbm", -- 5 + "mmfffmm", -- 6 + + -- Level 16 + "mm...mm", -- 0 + "mbghibm", -- 1 + ".j...j.", -- 2 + ".h...h.", -- 3 + ".k...k.", -- 4 + "mbghibm", -- 5 + "mm...mm", -- 6 + + -- Level 17 + "mm...mm", -- 0 + "mb...bm", -- 1 + ".......", -- 2 + ".......", -- 3 + ".......", -- 4 + "mb...bm", -- 5 + "mm...mm", -- 6 + + -- Level 18 + "mm...mm", -- 0 + "mblllbm", -- 1 + ".l...l.", -- 2 + ".l...l.", -- 3 + ".l...l.", -- 4 + "mblllbm", -- 5 + "mm...mm", -- 6 + + -- Level 19 + "mm...mm", -- 0 + "mcccccm", -- 1 + ".cnnnc.", -- 2 + ".cnnnc.", -- 3 + ".cnnnc.", -- 4 + "mcccccm", -- 5 + "mm...mm", -- 6 + + -- Level 20 + "mm...mm", -- 0 + "mh.h.hm", -- 1 + ".......", -- 2 + ".h...h.", -- 3 + ".......", -- 4 + "mh.h.hm", -- 5 + "mm...mm", -- 6 + + }, + }, -- Well + + + + { + OriginData = + { + ExportName = "BlackSmith", + Name = "Desert 97", + GalleryName = "Desert", + GalleryIndex = "97", + ID = "642", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 11, + y = 6, + z = 13, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 5, + MaxZ = 13, + }, + Connectors = + { + { + Type = -1, + RelX = 8, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "0", + ["DefaultWeight"] = "50", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 4: 0", -- cobblestone + "c: 24: 0", -- sandstone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 12: 0", -- sand + "g: 64: 3", -- wooddoorblock + "h: 43: 0", -- doublestep + "i: 53: 5", -- woodstairs + "j: 53: 4", -- woodstairs + "k: 10: 0", -- lava + "l: 54: 5", -- chest + "m: 19: 0", -- sponge + "n: 64: 9", -- wooddoorblock + "o: 50: 3", -- torch + "p:101: 0", -- ironbars + "q: 50: 1", -- torch + "r: 50: 2", -- torch + "s:128: 2", -- sandstonestairs + "t: 44: 9", -- step + "u:126: 8", -- woodenslab + "v:128: 4", -- sandstonestairs + "w:128: 5", -- sandstonestairs + "x:128: 7", -- sandstonestairs + "y: 44: 1", -- step + "z: 43: 1", -- doublestep + }, + BlockData = + { + -- Level 0 + "mmmmmmabbba", -- 0 + "mmmmmmbbbbm", -- 1 + "mmmmmmaccca", -- 2 + "maccccccccc", -- 3 + "mcccccccccc", -- 4 + "mcccccccccc", -- 5 + "mcccccacccc", -- 6 + "mcccccacccc", -- 7 + "acccaaacccc", -- 8 + "ccccccccccc", -- 9 + "ccccccccccc", -- 10 + "ccccccccccc", -- 11 + "accccccccca", -- 12 + + -- Level 1 + "mmmmmmaddda", -- 0 + "mmmmmmddddm", -- 1 + "mmmmmmaceca", -- 2 + "mafcfcceeec", -- 3 + "mcfccfceeec", -- 4 + "mcccccceeec", -- 5 + "mcffaaaeeec", -- 6 + "mffcaaaeeec", -- 7 + "acccaaaeeec", -- 8 + "ceeeeeeeeec", -- 9 + "ceeeeeeeeec", -- 10 + "ceeeeeeeeec", -- 11 + "accccccccca", -- 12 + + -- Level 2 + "mmmmmma...a", -- 0 + "mmmmmm.....", -- 1 + "mmmmmmacgca", -- 2 + "ma....c...c", -- 3 + "m.h...c...c", -- 4 + "m.....c...c", -- 5 + "m...aac...c", -- 6 + "mij.akc...c", -- 7 + "accccca...c", -- 8 + "cl........c", -- 9 + "c.........c", -- 10 + "c.........c", -- 11 + "accccccccca", -- 12 + + -- Level 3 + "mmmmmma...a", -- 0 + "mmmmmm.....", -- 1 + "mmmmmmacnca", -- 2 + "ma....c..oc", -- 3 + "m.....p...c", -- 4 + "m.....c...c", -- 5 + "m...ppc...p", -- 6 + "m...p.c...p", -- 7 + "accccca...p", -- 8 + "cq........c", -- 9 + "p.........c", -- 10 + "c........rc", -- 11 + "acccpppccca", -- 12 + + -- Level 4 + "mmmmmms...s", -- 0 + "mmmmmmc...c", -- 1 + "mmmmmmaccca", -- 2 + "mattttcuuuc", -- 3 + "mtuuuuvuuuc", -- 4 + "mtuuuucuuuc", -- 5 + "mtuuaacuuuw", -- 6 + "mtuua.cuuuw", -- 7 + "acccccauuuw", -- 8 + "cuuuuuuuuuc", -- 9 + "vuuuuuuuuuc", -- 10 + "cuuuuuuuuuc", -- 11 + "acccxxxccca", -- 12 + + -- Level 5 + "mmmmmm.....", -- 0 + "mmmmmm.....", -- 1 + "mmmmmmcyyyc", -- 2 + "my.y.yy...y", -- 3 + "m.....y...y", -- 4 + "my....y...y", -- 5 + "m...zyz...y", -- 6 + "my..y.y...c", -- 7 + "cyyyzyc...y", -- 8 + "y.........y", -- 9 + "y.........y", -- 10 + "y.........y", -- 11 + "cyyyycyyyyc", -- 12 + + }, + }, -- BlackSmith + + + + { + OriginData = + { + ExportName = "LittleHouse8", + Name = "Desert 99", + GalleryName = "Desert", + GalleryIndex = "99", + ID = "739", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 9, + y = 6, + z = 9, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = -1, + MaxX = 9, + MaxY = 5, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 0, + RelY = 2, + RelZ = 2, + Direction = 4, -- X- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 2", -- sandstone + "b: 24: 0", -- sandstone + "c: 4: 0", -- cobblestone + "d: 13: 0", -- gravel + "e: 5: 0", -- planks + "f: 64: 2", -- wooddoorblock + "g: 65: 2", -- ladder + "h:101: 0", -- ironbars + "i: 64: 9", -- wooddoorblock + "j: 50: 1", -- torch + "k:128: 6", -- sandstonestairs + "l:126: 8", -- woodenslab + "m: 19: 0", -- sponge + "n:128: 5", -- sandstonestairs + "o:128: 4", -- sandstonestairs + "p:128: 7", -- sandstonestairs + "q: 44: 1", -- step + "r: 96: 2", -- trapdoor + }, + BlockData = + { + -- Level 0 + "mmmmabbba", -- 0 + "ccccbbbbb", -- 1 + "ccccbbbbb", -- 2 + "ccccbbbbb", -- 3 + "abbbabbbb", -- 4 + "bbbbbbbbb", -- 5 + "bbbbbbbbb", -- 6 + "bbbbbbbbb", -- 7 + "abbbbbbba", -- 8 + + -- Level 1 + "mmmmabbba", -- 0 + "ddddbeeeb", -- 1 + "ddddeeeeb", -- 2 + "ddddbeeeb", -- 3 + "abbbaeeeb", -- 4 + "beeeeeeeb", -- 5 + "beeeeeeeb", -- 6 + "beeeeeeeb", -- 7 + "abbbbbbba", -- 8 + + -- Level 2 + "mmmmabbba", -- 0 + "....b...b", -- 1 + "....f...b", -- 2 + "....b...b", -- 3 + "abbba...b", -- 4 + "b.......b", -- 5 + "b.......b", -- 6 + "b......gb", -- 7 + "abbbbbbba", -- 8 + + -- Level 3 + "mmmmabhba", -- 0 + "....b...b", -- 1 + "....i...b", -- 2 + "....b...h", -- 3 + "abhbaj..h", -- 4 + "b.......h", -- 5 + "h.......b", -- 6 + "b......gb", -- 7 + "abbhhhbba", -- 8 + + -- Level 4 + "mmmmabkba", -- 0 + "....blllb", -- 1 + "....blllb", -- 2 + "....bllln", -- 3 + "abkballln", -- 4 + "bllllllln", -- 5 + "olllllllb", -- 6 + "bllllllgb", -- 7 + "abbpppbba", -- 8 + + -- Level 5 + "mmmmbqbqb", -- 0 + "....q...q", -- 1 + "....q...q", -- 2 + "....q...q", -- 3 + "bqqqb...b", -- 4 + "q.......q", -- 5 + "b.......q", -- 6 + "q......rq", -- 7 + "bqqqbqqqb", -- 8 + + }, + }, -- LittleHouse8 + }, -- Pieces +} + + + + diff --git a/Server/Prefabs/Villages/JapaneseVillage.cubeset b/Server/Prefabs/Villages/JapaneseVillage.cubeset new file mode 100644 index 000000000..b3e545e52 --- /dev/null +++ b/Server/Prefabs/Villages/JapaneseVillage.cubeset @@ -0,0 +1,3467 @@ + +-- JapaneseVillage.cubeset + +-- Defines the prefabs in the group JapaneseVillage + +-- NOTE: This file has been generated automatically by GalExport! +-- Any manual changes will be overwritten by the next automatic export! + + + + +Cubeset = +{ + Metadata = + { + CubesetFormatVersion = 1, + ExportDate = "2015-06-20 10:17:02", + ["AllowedBiomes"] = "Plains, Savanna, SavannaM, SunflowerPlains", + ["IntendedUse"] = "Village", + }, + + Pieces = + { + { + OriginData = + { + ExportName = "Restaurant", + Name = "Plains 61", + GalleryName = "Plains", + GalleryIndex = "61", + ID = "117", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 15, + y = 10, + z = 15, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = -1, + MaxX = 14, + MaxY = 9, + MaxZ = 15, + }, + Connectors = + { + { + Type = -1, + RelX = 14, + RelY = 1, + RelZ = 7, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 2", -- planks + "b:135: 0", -- whitewoodstairs + "c:135: 2", -- whitewoodstairs + "d:135: 1", -- whitewoodstairs + "e: 17: 9", -- tree + "f:135: 3", -- whitewoodstairs + "g: 85: 0", -- fence + "h: 17: 1", -- tree + "i:171: 0", -- carpet + "j:171:12", -- carpet + "k:126: 1", -- woodenslab + "l: 50: 5", -- torch + "m: 19: 0", -- sponge + "n: 35: 0", -- wool + "o: 50: 3", -- torch + "p: 50: 1", -- torch + "q: 50: 4", -- torch + "r: 35:14", -- wool + "s: 44: 8", -- step + "t: 43: 0", -- doublestep + "u: 44: 0", -- step + "v: 17: 5", -- tree + }, + BlockData = + { + -- Level 0 + "mmmmaaaaaaammmm", -- 0 + "maaaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaaam", -- 3 + "aaaaaaaaaaaaaaa", -- 4 + "aaaaaaaaaaaaaaa", -- 5 + "aaaaaaaaaaaaaaa", -- 6 + "aaaaaaaaaaaaaaa", -- 7 + "aaaaaaaaaaaaaaa", -- 8 + "aaaaaaaaaaaaaaa", -- 9 + "aaaaaaaaaaaaaaa", -- 10 + "maaaaaaaaaaaaam", -- 11 + "maaaaaaaaaaaaam", -- 12 + "maaaaaaaaaaaaam", -- 13 + "mmmmaaaaaaammmm", -- 14 + + -- Level 1 + "....bcccccd....", -- 0 + ".aaaaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaaaa.", -- 3 + "caaaaaaaaaaaaac", -- 4 + "baaaaaaaaaaaaad", -- 5 + "baaaaaaaaaaaaad", -- 6 + "baaaaaaaaaaeaad", -- 7 + "baaaaaaaaaaaaad", -- 8 + "baaaaaaaaaaaaad", -- 9 + "faaaaaaaaaaaaaf", -- 10 + ".aaaaaaaaaaaaa.", -- 11 + ".aaaaaaaaaaaaa.", -- 12 + ".aaaaaaaaaaaaa.", -- 13 + "....bfffffd....", -- 14 + + -- Level 2 + "...............", -- 0 + ".gggg.....gggg.", -- 1 + ".g...........g.", -- 2 + ".g.hhhhhhhhh.g.", -- 3 + ".g.hiiijiiih.g.", -- 4 + "...hikijikih...", -- 5 + "...hiiijiiihg..", -- 6 + "...hjjjjjjj....", -- 7 + "...hiiijiiihg..", -- 8 + "...hikijikih...", -- 9 + ".g.hiiijiiih.g.", -- 10 + ".g.hhhhhhhhh.g.", -- 11 + ".g...........g.", -- 12 + ".gggg.....gggg.", -- 13 + "...............", -- 14 + + -- Level 3 + "...............", -- 0 + ".l..g.....g..l.", -- 1 + "...............", -- 2 + "...hnnnhnnnh...", -- 3 + ".g.n.......n.g.", -- 4 + "...n.......n...", -- 5 + "...n.......hl..", -- 6 + "...h...........", -- 7 + "...n.......hl..", -- 8 + "...n.......n...", -- 9 + ".g.n.......n.g.", -- 10 + "...hnnnhnnnh...", -- 11 + "...............", -- 12 + ".l..g.....g..l.", -- 13 + "...............", -- 14 + + -- Level 4 + "...............", -- 0 + "....g.....g....", -- 1 + "...............", -- 2 + "...hn.nhn.nh...", -- 3 + ".g.n...o...n.g.", -- 4 + "...n.......n...", -- 5 + "...n.......h...", -- 6 + "...hp......e...", -- 7 + "...n.......h...", -- 8 + "...n.......n...", -- 9 + ".g.n...q...n.g.", -- 10 + "...hn.nhn.nh...", -- 11 + "...............", -- 12 + "....g.....g....", -- 13 + "...............", -- 14 + + -- Level 5 + "...............", -- 0 + "....g.....g....", -- 1 + "....ggggggg....", -- 2 + "...hnnnhnnnh...", -- 3 + ".ggn.......ngg.", -- 4 + "..gn.......ng..", -- 5 + "..gn.......hg..", -- 6 + "..gh..r.r..ng..", -- 7 + "..gn.......hg..", -- 8 + "..gn.......ng..", -- 9 + ".ggn.......ngg.", -- 10 + "...hnnnhnnnh...", -- 11 + "....ggggggg....", -- 12 + "....g.....g....", -- 13 + "...............", -- 14 + + -- Level 6 + "...............", -- 0 + "...stuuuuuts...", -- 1 + "..sttttttttts..", -- 2 + ".sthvvvhvvvhts.", -- 3 + ".tte.......ett.", -- 4 + ".ute.......etu.", -- 5 + ".ute.......htu.", -- 6 + ".uth..g.g..etu.", -- 7 + ".ute.......htu.", -- 8 + ".ute.......etu.", -- 9 + ".tte.......ett.", -- 10 + ".sthvvvhvvvhts.", -- 11 + "..sttttttttts..", -- 12 + "...stuuuuuts...", -- 13 + "...............", -- 14 + + -- Level 7 + "...............", -- 0 + ".stu.......uts.", -- 1 + ".tu.........ut.", -- 2 + ".u.uuuuuuuuu.u.", -- 3 + "...utttttttu...", -- 4 + "...utttttttu...", -- 5 + "...utttttttu...", -- 6 + "...utttttttu...", -- 7 + "...utttttttu...", -- 8 + "...utttttttu...", -- 9 + "...utttttttu...", -- 10 + ".u.uuuuuuuuu.u.", -- 11 + ".tu.........ut.", -- 12 + ".stu.......uts.", -- 13 + "...............", -- 14 + + -- Level 8 + "...............", -- 0 + ".u...........u.", -- 1 + "...............", -- 2 + "...............", -- 3 + "...............", -- 4 + ".....uuuuu.....", -- 5 + ".....utttu.....", -- 6 + ".....utttu.....", -- 7 + ".....utttu.....", -- 8 + ".....uuuuu.....", -- 9 + "...............", -- 10 + "...............", -- 11 + "...............", -- 12 + ".u...........u.", -- 13 + "...............", -- 14 + + -- Level 9 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "...............", -- 3 + "...............", -- 4 + "...............", -- 5 + "...............", -- 6 + ".......u.......", -- 7 + "...............", -- 8 + "...............", -- 9 + "...............", -- 10 + "...............", -- 11 + "...............", -- 12 + "...............", -- 13 + "...............", -- 14 + + }, + }, -- Restaurant + + + + { + OriginData = + { + ExportName = "HouseMid", + Name = "Plains 62", + GalleryName = "Plains", + GalleryIndex = "62", + ID = "119", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 10, + y = 9, + z = 9, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = -1, + MaxX = 10, + MaxY = 8, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 0, + RelY = 1, + RelZ = 4, + Direction = 4, -- X- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 2", -- planks + "b:135: 2", -- whitewoodstairs + "c:135: 0", -- whitewoodstairs + "d: 17: 9", -- tree + "e:135: 3", -- whitewoodstairs + "f: 85: 0", -- fence + "g: 17: 1", -- tree + "h:171: 0", -- carpet + "i: 50: 5", -- torch + "j: 35: 0", -- wool + "k: 17: 5", -- tree + "l:124: 0", -- redstonelampon + "m: 19: 0", -- sponge + "n: 69: 9", -- lever + "o: 44: 8", -- step + "p: 43: 0", -- doublestep + "q: 44: 0", -- step + }, + BlockData = + { + -- Level 0 + "maaaaaaaaa", -- 0 + "maaaaaaaaa", -- 1 + "aaaaaaaaaa", -- 2 + "aaaaaaaaaa", -- 3 + "aaaaaaaaaa", -- 4 + "aaaaaaaaaa", -- 5 + "aaaaaaaaaa", -- 6 + "maaaaaaaaa", -- 7 + "maaaaaaaaa", -- 8 + + -- Level 1 + ".aaaaaaaaa", -- 0 + ".aaaaaaaaa", -- 1 + "baaaaaaaaa", -- 2 + "caaaaaaaaa", -- 3 + "caadaaaaaa", -- 4 + "caaaaaaaaa", -- 5 + "eaaaaaaaaa", -- 6 + ".aaaaaaaaa", -- 7 + ".aaaaaaaaa", -- 8 + + -- Level 2 + ".fffffffff", -- 0 + ".f.......f", -- 1 + ".f.ggggg.f", -- 2 + "...ghhhg.f", -- 3 + "....hhhg.f", -- 4 + "...ghhhg.f", -- 5 + ".f.ggggg.f", -- 6 + ".f.......f", -- 7 + ".fffffffff", -- 8 + + -- Level 3 + ".....i...i", -- 0 + "..........", -- 1 + ".i.jjgjj..", -- 2 + "...g...j..", -- 3 + ".......g.i", -- 4 + "...g...j..", -- 5 + ".i.jjgjj..", -- 6 + "..........", -- 7 + ".....i...i", -- 8 + + -- Level 4 + "..........", -- 0 + "..........", -- 1 + "...jjgjj..", -- 2 + "...g...j..", -- 3 + "...j...g..", -- 4 + "...g...j..", -- 5 + "...jjgjj..", -- 6 + "..........", -- 7 + "..........", -- 8 + + -- Level 5 + "..........", -- 0 + "...f...f..", -- 1 + "..fgkgkgf.", -- 2 + "..fd...d..", -- 3 + "...d.lng..", -- 4 + "..fd...d..", -- 5 + "..fgkgkgf.", -- 6 + "...f...f..", -- 7 + "..........", -- 8 + + -- Level 6 + "...ooooo..", -- 0 + "..opppppo.", -- 1 + ".opgjjjgpo", -- 2 + ".opjgggjpo", -- 3 + ".opjgggjpo", -- 4 + ".opjgggjpo", -- 5 + ".opgjjjgpo", -- 6 + "..opppppo.", -- 7 + "...ooooo..", -- 8 + + -- Level 7 + ".opq...qpo", -- 0 + ".pq.....qp", -- 1 + ".q.qqqqq.q", -- 2 + "...qpppq..", -- 3 + "...qpppq..", -- 4 + "...qpppq..", -- 5 + ".q.qqqqq.q", -- 6 + ".pq.....qp", -- 7 + ".opq...qpo", -- 8 + + -- Level 8 + ".q.......q", -- 0 + "..........", -- 1 + "..........", -- 2 + "..........", -- 3 + ".....q....", -- 4 + "..........", -- 5 + "..........", -- 6 + "..........", -- 7 + ".q.......q", -- 8 + + }, + }, -- HouseMid + + + + { + OriginData = + { + ExportName = "HouseWide", + Name = "Plains 64", + GalleryName = "Plains", + GalleryIndex = "64", + ID = "121", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 11, + y = 6, + z = 11, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = -1, + MaxX = 11, + MaxY = 5, + MaxZ = 10, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = 10, + Direction = 3, -- Z+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 2", -- planks + "b: 17: 1", -- tree + "c: 35: 0", -- wool + "d:171: 0", -- carpet + "e:126: 1", -- woodenslab + "f: 64: 1", -- wooddoorblock + "g: 85: 0", -- fence + "h: 50: 1", -- torch + "i: 50: 2", -- torch + "j: 64: 9", -- wooddoorblock + "k:126:11", -- woodenslab + "l: 17: 5", -- tree + "m: 19: 0", -- sponge + "n:126: 3", -- woodenslab + "o:125: 3", -- woodendoubleslab + "p: 5: 3", -- planks + }, + BlockData = + { + -- Level 0 + "mmmmmmmmmmm", -- 0 + "mmaaaaaaamm", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "maaaaaaaaam", -- 6 + "maaaaaaaaam", -- 7 + "maaaaaaaaam", -- 8 + "mmaaaaaaamm", -- 9 + "mmmmmmmmmmm", -- 10 + + -- Level 1 + "...........", -- 0 + "..bcbcbcb..", -- 1 + ".b.d.....b.", -- 2 + ".cded....c.", -- 3 + ".bded....b.", -- 4 + ".c.d.....c.", -- 5 + ".b.......b.", -- 6 + ".c.......c.", -- 7 + ".b.......b.", -- 8 + "..bcbfbcb..", -- 9 + "...........", -- 10 + + -- Level 2 + "...........", -- 0 + "..bgbgbgb..", -- 1 + ".b.......b.", -- 2 + ".g.......g.", -- 3 + ".bh.....ib.", -- 4 + ".g.......g.", -- 5 + ".b.......b.", -- 6 + ".g.......g.", -- 7 + ".b.......b.", -- 8 + "..bgbjbgb..", -- 9 + "...........", -- 10 + + -- Level 3 + "...kkkkk...", -- 0 + "..bcbcbcb..", -- 1 + ".b.......b.", -- 2 + "kc.......ck", -- 3 + "kb.......bk", -- 4 + "kc.......ck", -- 5 + "kb.......bk", -- 6 + "kc.......ck", -- 7 + ".b.......b.", -- 8 + "..bcblbcb..", -- 9 + "...kkkkk...", -- 10 + + -- Level 4 + ".kn.....nk.", -- 0 + "konnnnnnnok", -- 1 + "nnnnnnnnnnn", -- 2 + ".nnpppppnn.", -- 3 + ".nnpkkkpnn.", -- 4 + ".nnpkkkpnn.", -- 5 + ".nnpkkkpnn.", -- 6 + ".nnpppppnn.", -- 7 + "nnnnnnnnnnn", -- 8 + "kknnnnnnnok", -- 9 + ".kn.....nk.", -- 10 + + -- Level 5 + "n.........n", -- 0 + "...........", -- 1 + "...........", -- 2 + "...........", -- 3 + "....nnn....", -- 4 + "....non....", -- 5 + "....nnn....", -- 6 + "...........", -- 7 + "...........", -- 8 + "...........", -- 9 + "n.........n", -- 10 + + }, + }, -- HouseWide + + + + { + OriginData = + { + ExportName = "HouseWithGarden", + Name = "Plains 67", + GalleryName = "Plains", + GalleryIndex = "67", + ID = "130", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 16, + y = 9, + z = 16, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 16, + MaxY = 8, + MaxZ = 16, + }, + Connectors = + { + { + Type = -1, + RelX = 9, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 5: 2", -- planks + "c: 2: 0", -- grass + "d:113: 0", -- netherbrickfence + "e: 17: 1", -- tree + "f: 35: 0", -- wool + "g:126: 2", -- woodenslab + "h: 31: 2", -- tallgrass + "i:125: 2", -- woodendoubleslab + "j: 38: 3", -- rose + "k: 38: 2", -- rose + "l: 38: 1", -- rose + "m: 19: 0", -- sponge + "n: 17: 2", -- tree + "o: 50: 4", -- torch + "p: 85: 0", -- fence + "q:140: 0", -- flowerpotblock + "r: 50: 3", -- torch + "s: 44: 8", -- step + "t: 50: 1", -- torch + "u: 50: 2", -- torch + "v: 43: 0", -- doublestep + "w: 44: 0", -- step + "x: 18:10", -- leaves + }, + BlockData = + { + -- Level 0 + "mmmmmmmmmaammmmm", -- 0 + "aabbbbbbbbbbaaam", -- 1 + "aabbbbbbbbbbaaam", -- 2 + "aabbbbbbbbbbaaam", -- 3 + "aabbbbbbbbbbaaam", -- 4 + "aabbbbbbbbbbaaam", -- 5 + "aabbbbbbbbbbaaam", -- 6 + "aabbbbbbbbbbaaam", -- 7 + "aabbbbbbbbbbaaam", -- 8 + "aabbbbbbbbbbaaam", -- 9 + "aaaaaaaaaaaaaaam", -- 10 + "aaaaaaaaaaaaaaam", -- 11 + "aaaaaaaaaaaaaaam", -- 12 + "aaaaaaaaaaaaaaam", -- 13 + "aaaaaaaaaaaaaaam", -- 14 + "mmmmmmmmmmmmmmmm", -- 15 + + -- Level 1 + "mmmmmmmmmccmmmmm", -- 0 + "ccbbbbbbbbbbcccm", -- 1 + "ccbbbbbbbbbbcccm", -- 2 + "ccbbbbbbbbbbcccm", -- 3 + "ccbbbbbbbbbbcccm", -- 4 + "ccbbbbbbbbbbcccm", -- 5 + "ccbbbbbbbbbbcccm", -- 6 + "ccbbbbbbbbbbcccm", -- 7 + "ccbbbbbbbbbbcccm", -- 8 + "ccbbbbbbbbbbcccm", -- 9 + "cccccccccccccccm", -- 10 + "cccccccccccccccm", -- 11 + "cccccccccccccccm", -- 12 + "cccccccccccccacm", -- 13 + "cccccccccccccccm", -- 14 + "mmmmmmmmmmmmmmmm", -- 15 + + -- Level 2 + "................", -- 0 + "ddeffeffe..eddd.", -- 1 + "d.fbbgggg..f..d.", -- 2 + "d.fbgggggggf.hd.", -- 3 + "d.fbgggggggf..d.", -- 4 + "d.eggggggggehhd.", -- 5 + "d.fgiiggiigf.hd.", -- 6 + "d.fgiiggiigf..d.", -- 7 + "d.fggggggggf..d.", -- 8 + "d.efffeefffe.hd.", -- 9 + "d.............d.", -- 10 + "djhhk.jhh..hh.d.", -- 11 + "d.jlk.hj.h....d.", -- 12 + "d..jh.hh..h..nd.", -- 13 + "ddddddddddddddd.", -- 14 + "................", -- 15 + + -- Level 3 + "........o..o....", -- 0 + "..eppeffe..e....", -- 1 + "..pqq......p....", -- 2 + "..pq.......p....", -- 3 + "..pq.......p....", -- 4 + "..e........e....", -- 5 + "..p........p....", -- 6 + "..p........p....", -- 7 + "..p........p....", -- 8 + "..epppeepppe....", -- 9 + "......rr........", -- 10 + "................", -- 11 + "................", -- 12 + ".............n..", -- 13 + "................", -- 14 + "................", -- 15 + + -- Level 4 + "..ssssssssss....", -- 0 + ".seffeffeffes...", -- 1 + ".sf..r.....fs...", -- 2 + ".sf........fs...", -- 3 + ".sf........fs...", -- 4 + ".set......ues...", -- 5 + ".sf........fs...", -- 6 + ".sf........fs...", -- 7 + ".sf........fs...", -- 8 + ".sefffeefffes...", -- 9 + "..ssssssssss....", -- 10 + "................", -- 11 + "................", -- 12 + ".............n..", -- 13 + "................", -- 14 + "................", -- 15 + + -- Level 5 + ".vw........wv...", -- 0 + ".wwwwwwwwwwww...", -- 1 + "..wvvvvvvvvw....", -- 2 + "..wvvvvvvvvw....", -- 3 + "..wvvvvvvvvw....", -- 4 + "..wvvvvvvvvw....", -- 5 + "..wvvvvvvvvw....", -- 6 + "..wvvvvvvvvw....", -- 7 + "..wvvvvvvvvw....", -- 8 + ".wwwwwwwwwwww...", -- 9 + ".vw........wv...", -- 10 + "............xxx.", -- 11 + "...........xxxxx", -- 12 + "...........xxnxx", -- 13 + "...........xxxxx", -- 14 + "............xxx.", -- 15 + + -- Level 6 + "................", -- 0 + "................", -- 1 + "................", -- 2 + "....wwwwww......", -- 3 + "....wvvvvw......", -- 4 + "....wvvvvw......", -- 5 + "....wvvvvw......", -- 6 + "....wwwwww......", -- 7 + "................", -- 8 + "................", -- 9 + "................", -- 10 + "............xxx.", -- 11 + "...........xxxxx", -- 12 + "...........xxnxx", -- 13 + "...........xxxxx", -- 14 + "............xxx.", -- 15 + + -- Level 7 + "................", -- 0 + "................", -- 1 + "................", -- 2 + "................", -- 3 + "................", -- 4 + "......ww........", -- 5 + "................", -- 6 + "................", -- 7 + "................", -- 8 + "................", -- 9 + "................", -- 10 + "................", -- 11 + "............xxx.", -- 12 + "............xnx.", -- 13 + "............xx..", -- 14 + "................", -- 15 + + -- Level 8 + "................", -- 0 + "................", -- 1 + "................", -- 2 + "................", -- 3 + "................", -- 4 + "................", -- 5 + "................", -- 6 + "................", -- 7 + "................", -- 8 + "................", -- 9 + "................", -- 10 + "................", -- 11 + ".............x..", -- 12 + "............xxx.", -- 13 + ".............x..", -- 14 + "................", -- 15 + + }, + }, -- HouseWithGarden + + + + { + OriginData = + { + ExportName = "HouseSmall", + Name = "Plains 68", + GalleryName = "Plains", + GalleryIndex = "68", + ID = "131", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 6, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 7, + MaxY = 5, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 4, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 2", -- planks + "b: 17: 1", -- tree + "c: 35: 0", -- wool + "d: 50: 4", -- torch + "e: 85: 0", -- fence + "f: 44: 8", -- step + "g: 43: 0", -- doublestep + "h: 44: 0", -- step + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmmmm", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "maaaaam", -- 5 + "mmmmmmm", -- 6 + + -- Level 1 + ".......", -- 0 + ".bcc.b.", -- 1 + ".c...c.", -- 2 + ".c...c.", -- 3 + ".c...c.", -- 4 + ".bcccb.", -- 5 + ".......", -- 6 + + -- Level 2 + ".....d.", -- 0 + ".bee.b.", -- 1 + ".c...c.", -- 2 + ".e...e.", -- 3 + ".c...c.", -- 4 + ".beeeb.", -- 5 + ".......", -- 6 + + -- Level 3 + ".fffff.", -- 0 + "fbcccbf", -- 1 + "fc...cf", -- 2 + "fc...cf", -- 3 + "fc...cf", -- 4 + "fbcccbf", -- 5 + ".fffff.", -- 6 + + -- Level 4 + "gh...hg", -- 0 + "hhhhhhh", -- 1 + ".hgggh.", -- 2 + ".hgggh.", -- 3 + ".hgggh.", -- 4 + "hhhhhhh", -- 5 + "gh...hg", -- 6 + + -- Level 5 + ".......", -- 0 + ".......", -- 1 + ".......", -- 2 + "...h...", -- 3 + ".......", -- 4 + ".......", -- 5 + ".......", -- 6 + + }, + }, -- HouseSmall + + + + { + OriginData = + { + ExportName = "HighTemple", + Name = "Plains 70", + GalleryName = "Plains", + GalleryIndex = "70", + ID = "133", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 19, + z = 11, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 10, + MaxY = 18, + MaxZ = 10, + }, + Connectors = + { + { + Type = 2, + RelX = 0, + RelY = 1, + RelZ = 5, + Direction = 4, -- X- + }, + { + Type = 2, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 2, + RelX = 10, + RelY = 1, + RelZ = 5, + Direction = 5, -- X+ + }, + { + Type = 2, + RelX = 5, + RelY = 1, + RelZ = 10, + Direction = 3, -- Z+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["IsStarting"] = "1", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 2", -- planks + "b:135: 0", -- whitewoodstairs + "c:135: 2", -- whitewoodstairs + "d:135: 1", -- whitewoodstairs + "e: 17: 9", -- tree + "f:135: 3", -- whitewoodstairs + "g: 85: 0", -- fence + "h: 17: 1", -- tree + "i:171: 0", -- carpet + "j: 50: 5", -- torch + "k: 35: 0", -- wool + "l: 17: 5", -- tree + "m: 19: 0", -- sponge + "n:124: 0", -- redstonelampon + "o: 69: 9", -- lever + "p: 44: 8", -- step + "q: 43: 0", -- doublestep + "r: 44: 0", -- step + "s: 50: 4", -- torch + "t: 50: 1", -- torch + "u: 50: 3", -- torch + }, + BlockData = + { + -- Level 0 + "mmmaaaaammm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "aaaaaaaaaaa", -- 3 + "aaaaaaaaaaa", -- 4 + "aaaaaaaaaaa", -- 5 + "aaaaaaaaaaa", -- 6 + "aaaaaaaaaaa", -- 7 + "maaaaaaaaam", -- 8 + "maaaaaaaaam", -- 9 + "mmmaaaaammm", -- 10 + + -- Level 1 + "...bcccd...", -- 0 + ".aaaaaaaaa.", -- 1 + ".aaaaaaaaa.", -- 2 + "caaaaaaaaac", -- 3 + "baaaaaaaaad", -- 4 + "baaeaaaaaad", -- 5 + "baaaaaaaaad", -- 6 + "faaaaaaaaaf", -- 7 + ".aaaaaaaaa.", -- 8 + ".aaaaaaaaa.", -- 9 + "...bfffd...", -- 10 + + -- Level 2 + "...........", -- 0 + ".ggg...ggg.", -- 1 + ".g.......g.", -- 2 + ".g.hhhhh.g.", -- 3 + "...hiiih...", -- 4 + "....iiih...", -- 5 + "...hiiih...", -- 6 + ".g.hhhhh.g.", -- 7 + ".g.......g.", -- 8 + ".ggg...ggg.", -- 9 + "...........", -- 10 + + -- Level 3 + "...........", -- 0 + ".j.g...g.j.", -- 1 + "...........", -- 2 + ".g.kkhkk.g.", -- 3 + "...h...k...", -- 4 + ".......h...", -- 5 + "...h...k...", -- 6 + ".g.kkhkk.g.", -- 7 + "...........", -- 8 + ".j.g...g.j.", -- 9 + "...........", -- 10 + + -- Level 4 + "...........", -- 0 + "...g...g...", -- 1 + "...........", -- 2 + ".g.kkhkk.g.", -- 3 + "...h...k...", -- 4 + "...k...h...", -- 5 + "...h...k...", -- 6 + ".g.kkhkk.g.", -- 7 + "...........", -- 8 + "...g...g...", -- 9 + "...........", -- 10 + + -- Level 5 + "...........", -- 0 + "...g...g...", -- 1 + "...ggggg...", -- 2 + ".gghlhlhgg.", -- 3 + "..ge...eg..", -- 4 + "..ge.nohg..", -- 5 + "..ge...eg..", -- 6 + ".gghlhlhgg.", -- 7 + "...ggggg...", -- 8 + "...g...g...", -- 9 + "...........", -- 10 + + -- Level 6 + "...........", -- 0 + "..pqrrrqp..", -- 1 + ".pqqqqqqqp.", -- 2 + ".qqhkkkhqq.", -- 3 + ".rqkhhhkqr.", -- 4 + ".rqkhhhkqr.", -- 5 + ".rqkhhhkqr.", -- 6 + ".qqhkkkhqq.", -- 7 + ".pqqqqqqqp.", -- 8 + "..pqrrrqp..", -- 9 + "...........", -- 10 + + -- Level 7 + "...........", -- 0 + ".qr.....rq.", -- 1 + ".........r.", -- 2 + "...hhhhh...", -- 3 + "...hiiih...", -- 4 + "....iiih...", -- 5 + "...hiiih...", -- 6 + "...hhhhh...", -- 7 + ".r.......r.", -- 8 + ".qr.....rq.", -- 9 + "...........", -- 10 + + -- Level 8 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "...kkhkk...", -- 3 + "...h...k...", -- 4 + ".......h...", -- 5 + "...h...k...", -- 6 + "...kkhkk...", -- 7 + "...........", -- 8 + "...........", -- 9 + "...........", -- 10 + + -- Level 9 + "...........", -- 0 + "...........", -- 1 + ".....s.....", -- 2 + "...kkhkk...", -- 3 + "...h...k...", -- 4 + "...k...ht..", -- 5 + "...h...k...", -- 6 + "...kkhkk...", -- 7 + ".....u.....", -- 8 + "...........", -- 9 + "...........", -- 10 + + -- Level 10 + "...........", -- 0 + "...........", -- 1 + "...ggggg...", -- 2 + "..ghlhlhg..", -- 3 + "..ge...eg..", -- 4 + "..ge.nohg..", -- 5 + "..ge...eg..", -- 6 + "..ghlhlhg..", -- 7 + "...ggggg...", -- 8 + "...........", -- 9 + "...........", -- 10 + + -- Level 11 + "...........", -- 0 + "..prrrrrp..", -- 1 + ".pqqqqqqqp.", -- 2 + ".qqhkkkhqq.", -- 3 + ".rqkhhhkqr.", -- 4 + ".rqkhhhkqr.", -- 5 + ".rqkhhhkqr.", -- 6 + ".qqhkkkhqr.", -- 7 + ".pqqqqqqqp.", -- 8 + "..pqrrrqp..", -- 9 + "...........", -- 10 + + -- Level 12 + "...........", -- 0 + ".qr.....rq.", -- 1 + ".r.......r.", -- 2 + "...hhhhh...", -- 3 + "...hiiih...", -- 4 + "....iiih...", -- 5 + "...hiiih...", -- 6 + "...hhhhh...", -- 7 + ".r.......r.", -- 8 + ".qr.....rq.", -- 9 + "...........", -- 10 + + -- Level 13 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "...kkhkk...", -- 3 + "...h...k...", -- 4 + ".......h...", -- 5 + "...h...k...", -- 6 + "...kkhkk...", -- 7 + "...........", -- 8 + "...........", -- 9 + "...........", -- 10 + + -- Level 14 + "...........", -- 0 + "...........", -- 1 + ".....s.....", -- 2 + "...kkhkk...", -- 3 + "...h...k...", -- 4 + "...k...ht..", -- 5 + "...h...k...", -- 6 + "...kkhkk...", -- 7 + ".....u.....", -- 8 + "...........", -- 9 + "...........", -- 10 + + -- Level 15 + "...........", -- 0 + "...........", -- 1 + "...ggggg...", -- 2 + "..ghlhlhg..", -- 3 + "..ge...eg..", -- 4 + "..ge.nohg..", -- 5 + "..ge...eg..", -- 6 + "..ghlhlhg..", -- 7 + "...ggggg...", -- 8 + "...........", -- 9 + "...........", -- 10 + + -- Level 16 + "...........", -- 0 + "..pqrrrqp..", -- 1 + ".pqqqqqqqp.", -- 2 + ".qqrrrrrqq.", -- 3 + ".rqrrrrrqr.", -- 4 + ".rqrrrrrqr.", -- 5 + ".rqrrrrrqr.", -- 6 + ".qqrrrrrqq.", -- 7 + ".pqqqqqqqp.", -- 8 + "..pqrrrqp..", -- 9 + "...........", -- 10 + + -- Level 17 + "...........", -- 0 + ".qr.....rq.", -- 1 + ".rr.....rr.", -- 2 + "...rrrrr...", -- 3 + "...rqqqr...", -- 4 + "...rqqqr...", -- 5 + "...rqqqr...", -- 6 + "...rrrrr...", -- 7 + ".rr.....rr.", -- 8 + ".qr.....rq.", -- 9 + "...........", -- 10 + + -- Level 18 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "...........", -- 3 + "...........", -- 4 + ".....r.....", -- 5 + "...........", -- 6 + "...........", -- 7 + "...........", -- 8 + "...........", -- 9 + "...........", -- 10 + + }, + }, -- HighTemple + + + + { + OriginData = + { + ExportName = "HouseSmallDouble", + Name = "Plains 72", + GalleryName = "Plains", + GalleryIndex = "72", + ID = "135", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 6, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 5, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 4, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 2", -- planks + "b: 17: 1", -- tree + "c: 35: 0", -- wool + "d:171:12", -- carpet + "e:135: 1", -- whitewoodstairs + "f:126: 2", -- woodenslab + "g:135: 2", -- whitewoodstairs + "h: 50: 4", -- torch + "i: 85: 0", -- fence + "j: 44: 8", -- step + "k: 43: 0", -- doublestep + "l: 44: 0", -- step + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmmmmmmmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "mmmmmmmmmmm", -- 6 + + -- Level 1 + "...........", -- 0 + ".bcc.bcccb.", -- 1 + ".cddd.dddc.", -- 2 + ".ceddcdfdc.", -- 3 + ".cggdcdddc.", -- 4 + ".bcccbcccb.", -- 5 + "...........", -- 6 + + -- Level 2 + ".h...h...h.", -- 0 + ".bii.biiib.", -- 1 + ".c.......c.", -- 2 + ".i...i...i.", -- 3 + ".c...i...c.", -- 4 + ".biiibiiib.", -- 5 + "...........", -- 6 + + -- Level 3 + ".jjjjjjjjj.", -- 0 + "jbiiibiiibj", -- 1 + "jc.......cj", -- 2 + "jc...c...cj", -- 3 + "jc...c...cj", -- 4 + "jbcccbcccbj", -- 5 + ".jjjjjjjjj.", -- 6 + + -- Level 4 + "kl...l...lk", -- 0 + "lllllllllll", -- 1 + ".lkkklkkkl.", -- 2 + ".lkjklkkkl.", -- 3 + ".lkkklkkkl.", -- 4 + "lllllllllll", -- 5 + "kl...l...lk", -- 6 + + -- Level 5 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "...l...l...", -- 3 + "...........", -- 4 + "...........", -- 5 + "...........", -- 6 + + }, + }, -- HouseSmallDouble + + + + { + OriginData = + { + ExportName = "HouseWithSpa", + Name = "Plains 73", + GalleryName = "Plains", + GalleryIndex = "73", + ID = "139", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 16, + y = 8, + z = 14, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 15, + MaxY = 7, + MaxZ = 13, + }, + Connectors = + { + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 2", -- planks + "b: 3: 0", -- dirt + "c: 2: 0", -- grass + "d: 8: 0", -- water + "e:135: 3", -- whitewoodstairs + "f:135: 1", -- whitewoodstairs + "g:113: 0", -- netherbrickfence + "h: 17: 1", -- tree + "i: 35: 0", -- wool + "j:171:12", -- carpet + "k: 64: 6", -- wooddoorblock + "l:126: 2", -- woodenslab + "m: 19: 0", -- sponge + "n:135: 2", -- whitewoodstairs + "o: 64: 7", -- wooddoorblock + "p: 50: 4", -- torch + "q: 85: 0", -- fence + "r: 64:12", -- wooddoorblock + "s: 50: 3", -- torch + "t: 44: 8", -- step + "u: 43: 0", -- doublestep + "v: 44: 0", -- step + }, + BlockData = + { + -- Level 0 + "................", -- 0 + ".aaaaaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaaaaa.", -- 5 + ".aaaaaaaaaaaaaa.", -- 6 + ".aaaaaabbbbbbbbb", -- 7 + ".aaaaaabbbbbbbbb", -- 8 + ".aaaaaabbbbbbbbb", -- 9 + ".aaaaaabbbbbbbbb", -- 10 + ".aaaaaabbbbbbbbb", -- 11 + ".aaaaaabbbbbbbbb", -- 12 + ".......bbbbbbbbb", -- 13 + + -- Level 1 + "mmmmmmmmmmmmmmmm", -- 0 + "maaaaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaaaam", -- 3 + "maaaaaaaaaaaaaam", -- 4 + "maaaaaaaaaaaaaam", -- 5 + "maaaaaaaaaaaaaam", -- 6 + "maaaaaaaaaaccccc", -- 7 + "maaaaaaacccccccc", -- 8 + "maaaaaaacccccccc", -- 9 + "maaaaaaacccccccc", -- 10 + "maaaaaaccccccccc", -- 11 + "maaaaaaccccccccc", -- 12 + "mmmmmmmccccccccc", -- 13 + + -- Level 2 + "................", -- 0 + ".aaaaaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaaaaa.", -- 5 + ".aaddaaaaaaaaaa.", -- 6 + ".aaddaaeeef.....", -- 7 + ".aaddaaf........", -- 8 + ".aaddaaf........", -- 9 + ".aaddaae........", -- 10 + ".aaddaa.........", -- 11 + ".aaaaaa.........", -- 12 + "................", -- 13 + + -- Level 3 + "................", -- 0 + ".ggggghiiihiiih.", -- 1 + ".geee.ijjjjjjji.", -- 2 + ".gf...kjjjijlji.", -- 3 + ".gf...innjijjji.", -- 4 + ".g....hiiohiiih.", -- 5 + ".g....g.........", -- 6 + ".g..............", -- 7 + ".g..............", -- 8 + ".g..............", -- 9 + ".g....g.........", -- 10 + ".g....g.........", -- 11 + ".gggggg.........", -- 12 + "................", -- 13 + + -- Level 4 + "......p...p...p.", -- 0 + ".g....hqqqhqqqh.", -- 1 + "......i.......i.", -- 2 + "......r...q...q.", -- 3 + "......i...q...i.", -- 4 + "......hqqrhqqqh.", -- 5 + "......g...s.....", -- 6 + "................", -- 7 + "................", -- 8 + "................", -- 9 + "................", -- 10 + "................", -- 11 + ".g....g.........", -- 12 + "................", -- 13 + + -- Level 5 + ".tttttttttttttt.", -- 0 + "tggggghqqqhqqqht", -- 1 + "tg....i.......it", -- 2 + "tg....i...i...it", -- 3 + "tg....i...i...it", -- 4 + "tg....hiiihiiiht", -- 5 + "tg....gtttttttt.", -- 6 + "tg....gt........", -- 7 + "tg....gt........", -- 8 + "tg....gt........", -- 9 + "tg....gt........", -- 10 + "tg....gt........", -- 11 + "tggggggt........", -- 12 + ".tttttt.........", -- 13 + + -- Level 6 + "uv............vu", -- 0 + "vvvvvvvvvvvvvvvv", -- 1 + ".vuuuuuuuuuuuuv.", -- 2 + ".vuuuuuutuuuuuv.", -- 3 + ".vuuuuuuuuuuuuv.", -- 4 + ".vuuuuvvvvvvvvvv", -- 5 + ".vuuuuv.......vu", -- 6 + ".vuuuuv.........", -- 7 + ".vuuuuv.........", -- 8 + ".vuuuuv.........", -- 9 + ".vuuuuv.........", -- 10 + ".vuuuuv.........", -- 11 + "vvvvvvvv........", -- 12 + "uv....vu........", -- 13 + + -- Level 7 + "................", -- 0 + "................", -- 1 + "................", -- 2 + "...vvvvvvvvvv...", -- 3 + "...vv...........", -- 4 + "...vv...........", -- 5 + "...vv...........", -- 6 + "...vv...........", -- 7 + "...vv...........", -- 8 + "...vv...........", -- 9 + "...vv...........", -- 10 + "................", -- 11 + "................", -- 12 + "................", -- 13 + + }, + }, -- HouseWithSpa + + + + { + OriginData = + { + ExportName = "HouseWithSakura1", + Name = "Plains 75", + GalleryName = "Plains", + GalleryIndex = "75", + ID = "141", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 13, + y = 7, + z = 15, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 13, + MaxY = 6, + MaxZ = 15, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 2: 0", -- grass + "c: 17: 5", -- tree + "d: 5: 2", -- planks + "e: 17: 9", -- tree + "f:113: 0", -- netherbrickfence + "g: 17: 1", -- tree + "h: 35: 0", -- wool + "i: 31: 2", -- tallgrass + "j: 54: 2", -- chest + "k: 38: 6", -- rose + "l: 38: 2", -- rose + "m: 19: 0", -- sponge + "n: 50: 4", -- torch + "o: 85: 0", -- fence + "p: 44: 8", -- step + "q: 35: 6", -- wool + "r: 43: 0", -- doublestep + "s: 44: 0", -- step + }, + BlockData = + { + -- Level 0 + "aaaaaaaaaaaaa", -- 0 + "aaaaaaaaaaaaa", -- 1 + "aaaaaaaaaaaaa", -- 2 + "aaaaaaaaaaaaa", -- 3 + "aaaaaaaaaaaaa", -- 4 + "aaaaaaaaaaaaa", -- 5 + "aaaaaaaaaaaaa", -- 6 + "aaaaaaaaaaaaa", -- 7 + "aaaaaaaaaaaaa", -- 8 + "aaaaaaaaaaaaa", -- 9 + "aaaaaaaaaaaaa", -- 10 + "aaaaaaaaaaaaa", -- 11 + "aaaaaaaaaaaaa", -- 12 + "aaaaaaaaaaaaa", -- 13 + "aaaaaaaaaaaaa", -- 14 + + -- Level 1 + "bbbbbbbbbbbbb", -- 0 + "bbbbbbbbbbbbb", -- 1 + "bbbaccdabbbbb", -- 2 + "bbbedddebbbbb", -- 3 + "bbbedddebbbbb", -- 4 + "bbbedddebbbbb", -- 5 + "bbbacccabbbbb", -- 6 + "bbbbbbbbbbbbb", -- 7 + "bbbbbbbbbbbbb", -- 8 + "bbbbbbbbbbbbb", -- 9 + "bbbbbbbbbbabb", -- 10 + "bbbbbbbbbbbbb", -- 11 + "bbbbbbbbbbbbb", -- 12 + "bbbbbbbbbbbbb", -- 13 + "bbbbbbbbbbbbb", -- 14 + + -- Level 2 + "ffff...ffffff", -- 0 + "f...........f", -- 1 + "f..ghh.g..i.f", -- 2 + "f..h...h..i.f", -- 3 + "f..h...h....f", -- 4 + "fi.h..jh..i.f", -- 5 + "f..ghhhg....f", -- 6 + "f.........i.f", -- 7 + "fii.........f", -- 8 + "f.k..k.i....f", -- 9 + "fl.i..i...g.f", -- 10 + "f.i..i.k....f", -- 11 + "f.l.k.......f", -- 12 + "f.....l.....f", -- 13 + "fffffffffffff", -- 14 + + -- Level 3 + ".............", -- 0 + ".......n.....", -- 1 + "...goo.g.....", -- 2 + "...h...h.....", -- 3 + "...o...o.....", -- 4 + "...h...h.....", -- 5 + "...gooog.....", -- 6 + ".............", -- 7 + ".............", -- 8 + ".............", -- 9 + "..........g..", -- 10 + ".............", -- 11 + ".............", -- 12 + ".............", -- 13 + ".............", -- 14 + + -- Level 4 + ".............", -- 0 + "...ppppp.....", -- 1 + "..pghhhgp....", -- 2 + "..ph...hp....", -- 3 + "..ph...hp....", -- 4 + "..ph...hp....", -- 5 + "..pghhhgp....", -- 6 + "...ppppp.....", -- 7 + ".............", -- 8 + "..........q..", -- 9 + ".........qgq.", -- 10 + "..........q..", -- 11 + ".............", -- 12 + ".............", -- 13 + ".............", -- 14 + + -- Level 5 + ".............", -- 0 + "..rs...sr....", -- 1 + "..sssssss....", -- 2 + "...srrrs.....", -- 3 + "...srrrs.....", -- 4 + "...srrrs.....", -- 5 + "..sssssss....", -- 6 + "..rs...sr....", -- 7 + ".............", -- 8 + ".........qqq.", -- 9 + ".........qqq.", -- 10 + ".........qqq.", -- 11 + ".............", -- 12 + ".............", -- 13 + ".............", -- 14 + + -- Level 6 + ".............", -- 0 + ".............", -- 1 + ".............", -- 2 + ".............", -- 3 + ".....s.......", -- 4 + ".............", -- 5 + ".............", -- 6 + ".............", -- 7 + ".............", -- 8 + ".............", -- 9 + "..........q..", -- 10 + ".............", -- 11 + ".............", -- 12 + ".............", -- 13 + ".............", -- 14 + + }, + }, -- HouseWithSakura1 + + + + { + OriginData = + { + ExportName = "SakuraDouble", + Name = "Plains 76", + GalleryName = "Plains", + GalleryIndex = "76", + ID = "142", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 12, + y = 8, + z = 6, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = -1, + MaxX = 12, + MaxY = 7, + MaxZ = 6, + }, + Connectors = + { + { + Type = -1, + RelX = -1, + RelY = 2, + RelZ = 2, + Direction = 4, -- X- + }, + { + Type = 3, + RelX = 5, + RelY = 2, + RelZ = 6, + Direction = 3, -- Z+ + }, + { + Type = -3, + RelX = 6, + RelY = 2, + RelZ = -1, + Direction = 2, -- Z- + }, + { + Type = -3, + RelX = 12, + RelY = 2, + RelZ = 2, + Direction = 5, -- X+ + }, + { + Type = 3, + RelX = 12, + RelY = 2, + RelZ = 2, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 2: 0", -- grass + "c: 17: 1", -- tree + "d: 35: 6", -- wool + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaaaaaaa", -- 0 + "aaaaaaaaaaaa", -- 1 + "aaaaaaaaaaaa", -- 2 + "aaaaaaaaaaaa", -- 3 + "aaaaaaaaaaaa", -- 4 + "aaaaaaaaaaaa", -- 5 + + -- Level 1 + "bbbbbbbbbbbb", -- 0 + "bbbbbbbbbbbb", -- 1 + "bbabbbbbbbbb", -- 2 + "bbbbbbbbbabb", -- 3 + "bbbbbbbbbbbb", -- 4 + "bbbbbbbbbbbb", -- 5 + + -- Level 2 + "............", -- 0 + "............", -- 1 + "..c.........", -- 2 + ".........c..", -- 3 + "............", -- 4 + "............", -- 5 + + -- Level 3 + "............", -- 0 + "............", -- 1 + "..c.........", -- 2 + ".........c..", -- 3 + "............", -- 4 + "............", -- 5 + + -- Level 4 + "..d.........", -- 0 + "ddddd.......", -- 1 + "ddcdd...ddd.", -- 2 + "ddddd...dcd.", -- 3 + "..d.....ddd.", -- 4 + "............", -- 5 + + -- Level 5 + ".ddd........", -- 0 + ".ddd....ddd.", -- 1 + "ddddd..ddddd", -- 2 + ".ddd...ddcdd", -- 3 + ".ddd...ddddd", -- 4 + "........ddd.", -- 5 + + -- Level 6 + "............", -- 0 + "..d......d..", -- 1 + ".ddd....ddd.", -- 2 + "..d....ddddd", -- 3 + "........ddd.", -- 4 + ".........d..", -- 5 + + -- Level 7 + "............", -- 0 + "............", -- 1 + "............", -- 2 + ".........d..", -- 3 + "............", -- 4 + "............", -- 5 + + }, + }, -- SakuraDouble + + + + { + OriginData = + { + ExportName = "Forge", + Name = "Plains 79", + GalleryName = "Plains", + GalleryIndex = "79", + ID = "145", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 16, + y = 11, + z = 14, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = -1, + MaxX = 16, + MaxY = 10, + MaxZ = 14, + }, + Connectors = + { + { + Type = -1, + RelX = 0, + RelY = 1, + RelZ = 3, + Direction = 4, -- X- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 17: 1", -- tree + "c: 67: 0", -- stairs + "d: 5: 2", -- planks + "e: 67: 2", -- stairs + "f:113: 0", -- netherbrickfence + "g:118: 2", -- cauldronblock + "h: 67: 6", -- stairs + "i: 67: 4", -- stairs + "j: 87: 0", -- netherstone + "k: 67: 7", -- stairs + "l: 54: 5", -- chest + "m: 19: 0", -- sponge + "n: 61: 2", -- furnace + "o:101: 0", -- ironbars + "p: 51: 0", -- fire + "q: 50: 4", -- torch + "r: 50: 2", -- torch + "s: 35: 0", -- wool + "t: 67: 3", -- stairs + "u: 50: 3", -- torch + "v: 44: 8", -- step + "w: 43: 0", -- doublestep + "x: 44: 0", -- step + "y: 17: 5", -- tree + "z: 17: 9", -- tree + }, + BlockData = + { + -- Level 0 + "mmmmmmmmmmmmmmmm", -- 0 + "mmmmmmmmmmmmmmmm", -- 1 + "mmaaaaaaaaaaaamm", -- 2 + "mmaaaaaaaaaaaamm", -- 3 + "mmaaaaaaaaaaaamm", -- 4 + "mmaaaaaaaaaaaamm", -- 5 + "mmaaaaaaaaaaaamm", -- 6 + "mmaaaaaaaaaaaamm", -- 7 + "mmaaaaaaaaaaaamm", -- 8 + "mmaaaaaaaaaaaamm", -- 9 + "mmaaaaaaaaaaaamm", -- 10 + "mmaaaaaaaaaaaamm", -- 11 + "mmmmmmmmmmmmmmmm", -- 12 + "mmmmmmmmmmmmmmmm", -- 13 + + -- Level 1 + "................", -- 0 + "................", -- 1 + ".....bbbbbbbbb..", -- 2 + ".....cdddddddb..", -- 3 + ".....cddaaaadb..", -- 4 + "..beeedaaaaadb..", -- 5 + "..bddddaaaaadb..", -- 6 + "..bddddaaaaadb..", -- 7 + "..bddddaaaaadb..", -- 8 + "..bddddaaaaadb..", -- 9 + "..bddddddddddb..", -- 10 + "..bbbbbbbbbbbb..", -- 11 + "................", -- 12 + "................", -- 13 + + -- Level 2 + "................", -- 0 + "................", -- 1 + ".....bfffbfffb..", -- 2 + ".............a..", -- 3 + ".............a..", -- 4 + "..b.....ghh..a..", -- 5 + "..f.....haa..b..", -- 6 + "..f.....ija..b..", -- 7 + "..f.....kaa..a..", -- 8 + "..f..........a..", -- 9 + "..fl.........a..", -- 10 + "..bffffbbffffb..", -- 11 + "................", -- 12 + "................", -- 13 + + -- Level 3 + "................", -- 0 + "................", -- 1 + ".....bfffbfffb..", -- 2 + ".............a..", -- 3 + ".............a..", -- 4 + "..b......nn..a..", -- 5 + "..f.....oaa..b..", -- 6 + "..f.....opa..b..", -- 7 + "..f.....oaa..a..", -- 8 + "..f..........a..", -- 9 + "..f..........a..", -- 10 + "..bffffbbffffb..", -- 11 + "................", -- 12 + "................", -- 13 + + -- Level 4 + "................", -- 0 + ".........q...q..", -- 1 + "....rbsssbsssb..", -- 2 + ".............a..", -- 3 + "..q..........a..", -- 4 + "..b......ce..a..", -- 5 + "..s......ea..b..", -- 6 + "..s......aa..b..", -- 7 + "..s......ta..a..", -- 8 + "..s..........a..", -- 9 + "..s..........a..", -- 10 + ".rbssssbbssssb..", -- 11 + "..u....uu....u..", -- 12 + "................", -- 13 + + -- Level 5 + ".vwxxxxxxxxxxwv.", -- 0 + "vvvvvvvvvvvvvvvv", -- 1 + "wvbyybyyybbyybvw", -- 2 + "xvz..........zvx", -- 3 + "xvz..........zvx", -- 4 + "xvb..........zvx", -- 5 + "xvz.......a..bvx", -- 6 + "xvz......ca..bvx", -- 7 + "xvz.......a..zvx", -- 8 + "xvz..........zvx", -- 9 + "xvz..........zvx", -- 10 + "wvbyyyyyyyyyybvw", -- 11 + "vvvvvvvvvvvvvvvv", -- 12 + ".vwxxxxxxxxxxwv.", -- 13 + + -- Level 6 + "wx............xw", -- 0 + "x..............x", -- 1 + "..xxxxxxxxxxxx..", -- 2 + "..xwwwwwwwwwwx..", -- 3 + "..xwvvvvvvvvvx..", -- 4 + "..xwv.......vx..", -- 5 + "..xwv.....a.vx..", -- 6 + "..xwv.....a.vx..", -- 7 + "..xwv.....a.vx..", -- 8 + "..xwvvvvvvvvvx..", -- 9 + "..xwwwwwwwwwwx..", -- 10 + "..xxxxxxxxxxxx..", -- 11 + "x..............x", -- 12 + "wx............xw", -- 13 + + -- Level 7 + "................", -- 0 + "................", -- 1 + "................", -- 2 + "................", -- 3 + "....xxxxxxxx....", -- 4 + "....xxxxxxxx....", -- 5 + "....xwwwwwax....", -- 6 + "....xwvvvvax....", -- 7 + "....xwwwwwax....", -- 8 + "....xxxxxxxx....", -- 9 + "................", -- 10 + "................", -- 11 + "................", -- 12 + "................", -- 13 + + -- Level 8 + "................", -- 0 + "................", -- 1 + "................", -- 2 + "................", -- 3 + "................", -- 4 + "................", -- 5 + "..........a.....", -- 6 + ".......xx.a.....", -- 7 + "..........a.....", -- 8 + "................", -- 9 + "................", -- 10 + "................", -- 11 + "................", -- 12 + "................", -- 13 + + -- Level 9 + "................", -- 0 + "................", -- 1 + "................", -- 2 + "................", -- 3 + "................", -- 4 + "................", -- 5 + "..........a.....", -- 6 + "..........a.....", -- 7 + "..........a.....", -- 8 + "................", -- 9 + "................", -- 10 + "................", -- 11 + "................", -- 12 + "................", -- 13 + + -- Level 10 + "................", -- 0 + "................", -- 1 + "................", -- 2 + "................", -- 3 + "................", -- 4 + "................", -- 5 + "..........a.....", -- 6 + "..........a.....", -- 7 + "..........a.....", -- 8 + "................", -- 9 + "................", -- 10 + "................", -- 11 + "................", -- 12 + "................", -- 13 + + }, + }, -- Forge + + + + { + OriginData = + { + ExportName = "HouseSmallWithDoor", + Name = "Plains 112", + GalleryName = "Plains", + GalleryIndex = "112", + ID = "264", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 6, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 7, + MaxY = 5, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 2", -- planks + "b: 17: 1", -- tree + "c: 35: 0", -- wool + "d: 64: 3", -- wooddoorblock + "e: 50: 4", -- torch + "f: 64: 9", -- wooddoorblock + "g: 85: 0", -- fence + "h: 44: 8", -- step + "i: 43: 0", -- doublestep + "j: 44: 0", -- step + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmmmm", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "maaaaam", -- 5 + "mmmmmmm", -- 6 + + -- Level 1 + ".......", -- 0 + ".bcdcb.", -- 1 + ".c...c.", -- 2 + ".c...c.", -- 3 + ".c...c.", -- 4 + ".bcccb.", -- 5 + ".......", -- 6 + + -- Level 2 + ".....e.", -- 0 + ".bcfcb.", -- 1 + ".g...g.", -- 2 + ".g...g.", -- 3 + ".g...g.", -- 4 + ".bgggb.", -- 5 + ".......", -- 6 + + -- Level 3 + ".hhhhh.", -- 0 + "hbcccbh", -- 1 + "hc...ch", -- 2 + "hc...ch", -- 3 + "hc...ch", -- 4 + "hbcccbh", -- 5 + ".hhhhh.", -- 6 + + -- Level 4 + "ij...ji", -- 0 + "jjjjjjj", -- 1 + ".jiiij.", -- 2 + ".jiiij.", -- 3 + ".jiiij.", -- 4 + "jjjjjjj", -- 5 + "ij...ji", -- 6 + + -- Level 5 + ".......", -- 0 + ".......", -- 1 + ".......", -- 2 + "...j...", -- 3 + ".......", -- 4 + ".......", -- 5 + ".......", -- 6 + + }, + }, -- HouseSmallWithDoor + + + + { + OriginData = + { + ExportName = "HouseSmallDblWithDoor", + Name = "Plains 113", + GalleryName = "Plains", + GalleryIndex = "113", + ID = "265", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 6, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 5, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = -1, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 2", -- planks + "b: 17: 9", -- tree + "c: 17: 1", -- tree + "d: 35: 0", -- wool + "e: 64: 3", -- wooddoorblock + "f:171:12", -- carpet + "g:135: 1", -- whitewoodstairs + "h:126: 2", -- woodenslab + "i:135: 2", -- whitewoodstairs + "j: 50: 4", -- torch + "k: 64: 9", -- wooddoorblock + "l: 85: 0", -- fence + "m: 19: 0", -- sponge + "n: 44: 8", -- step + "o: 43: 0", -- doublestep + "p: 44: 0", -- step + }, + BlockData = + { + -- Level 0 + "mmmmmmmmmmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaabaaaam", -- 2 + "maaaabaaaam", -- 3 + "maaaabaaaam", -- 4 + "maaaaaaaaam", -- 5 + "mmmmmmmmmmm", -- 6 + + -- Level 1 + "...........", -- 0 + ".cdedcdddc.", -- 1 + ".dfff.fffd.", -- 2 + ".dgffdfhfd.", -- 3 + ".diifdfffd.", -- 4 + ".cdddcdddc.", -- 5 + "...........", -- 6 + + -- Level 2 + ".j...j...j.", -- 0 + ".cdkdclllc.", -- 1 + ".d.......l.", -- 2 + ".l...l...l.", -- 3 + ".d...l...l.", -- 4 + ".clllclllc.", -- 5 + "...........", -- 6 + + -- Level 3 + ".nnnnnnnnn.", -- 0 + "ncdddcdddcn", -- 1 + "nd...d...dn", -- 2 + "nd...d...dn", -- 3 + "nd...d...dn", -- 4 + "ncdddcdddcn", -- 5 + ".nnnnnnnnn.", -- 6 + + -- Level 4 + "op.......po", -- 0 + "ppppppppppp", -- 1 + ".pooooooop.", -- 2 + ".ponndnnop.", -- 3 + ".pooooooop.", -- 4 + "ppppppppppp", -- 5 + "op.......po", -- 6 + + -- Level 5 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "...ppppp...", -- 3 + "...........", -- 4 + "...........", -- 5 + "...........", -- 6 + + }, + }, -- HouseSmallDblWithDoor + + + + { + OriginData = + { + ExportName = "Well", + Name = "Plains 143", + GalleryName = "Plains", + GalleryIndex = "143", + ID = "487", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 7, + y = 14, + z = 7, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 6, + MaxY = 13, + MaxZ = 6, + }, + Connectors = + { + { + Type = 2, + RelX = 0, + RelY = 9, + RelZ = 3, + Direction = 4, -- X- + }, + { + Type = 2, + RelX = 3, + RelY = 9, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 2, + RelX = 6, + RelY = 9, + RelZ = 3, + Direction = 5, -- X+ + }, + { + Type = 2, + RelX = 3, + RelY = 9, + RelZ = 6, + Direction = 3, -- Z+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["IsStarting"] = "1", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 1: 0", -- stone + "b: 4: 0", -- cobblestone + "c: 8: 0", -- water + "d: 13: 0", -- gravel + "e: 67: 1", -- stairs + "f: 67: 2", -- stairs + "g: 67: 0", -- stairs + "h: 67: 3", -- stairs + "i: 85: 0", -- fence + "j: 44: 8", -- step + "k: 44: 0", -- step + "l: 43: 0", -- doublestep + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmmmm", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "maaaaam", -- 5 + "mmmmmmm", -- 6 + + -- Level 1 + "mmmmmmm", -- 0 + "mbbbbbm", -- 1 + "mbcc.bm", -- 2 + "mbcccbm", -- 3 + "mbcccbm", -- 4 + "mbbbbbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 2 + "mmmmmmm", -- 0 + "mbbbbbm", -- 1 + "mbcccbm", -- 2 + "mbcccbm", -- 3 + "mbcccbm", -- 4 + "mbbbbbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 3 + "mmmmmmm", -- 0 + "mbbbbbm", -- 1 + "mbcccbm", -- 2 + "mbcccbm", -- 3 + "mbcccbm", -- 4 + "mbbbbbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 4 + "mmmmmmm", -- 0 + "mbbbbbm", -- 1 + "mbcccbm", -- 2 + "mbcccbm", -- 3 + "mbcccbm", -- 4 + "mbbbbbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 5 + "mmmmmmm", -- 0 + "mbbbbbm", -- 1 + "mbcccbm", -- 2 + "mbcccbm", -- 3 + "mbcccbm", -- 4 + "mbbbbbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 6 + "mmmmmmm", -- 0 + "mbbbbbm", -- 1 + "mbcccbm", -- 2 + "mbcccbm", -- 3 + "mbcccbm", -- 4 + "mbbbbbm", -- 5 + "mmmmmmm", -- 6 + + -- Level 7 + "mmbbbmm", -- 0 + "mbbbbbm", -- 1 + "bbcccbb", -- 2 + "bbcccbb", -- 3 + "bbcccbb", -- 4 + "mbbbbbm", -- 5 + "mmbbbmm", -- 6 + + -- Level 8 + "mmdddmm", -- 0 + "mbbbbbm", -- 1 + "dbcccbd", -- 2 + "dbcccbd", -- 3 + "dbcccbd", -- 4 + "mbbbbbm", -- 5 + "mmdddmm", -- 6 + + -- Level 9 + "mm...mm", -- 0 + "mbefgbm", -- 1 + ".h...h.", -- 2 + ".g...e.", -- 3 + ".f...f.", -- 4 + "mbehgbm", -- 5 + "mm...mm", -- 6 + + -- Level 10 + "mm...mm", -- 0 + "mi...im", -- 1 + ".......", -- 2 + ".......", -- 3 + ".......", -- 4 + "mi...im", -- 5 + "mm...mm", -- 6 + + -- Level 11 + "mm...mm", -- 0 + "mi...im", -- 1 + ".......", -- 2 + ".......", -- 3 + ".......", -- 4 + "mi...im", -- 5 + "mm...mm", -- 6 + + -- Level 12 + "mjkkkjm", -- 0 + "jlllllj", -- 1 + "klllllk", -- 2 + "klllllk", -- 3 + "klllllk", -- 4 + "jlllllj", -- 5 + "mjkkkjm", -- 6 + + -- Level 13 + "k.....k", -- 0 + ".......", -- 1 + "..kkk..", -- 2 + "..klk..", -- 3 + "..kkk..", -- 4 + ".......", -- 5 + "k.....k", -- 6 + + }, + }, -- Well + + + + { + OriginData = + { + ExportName = "Arch", + Name = "Plains 144", + GalleryName = "Plains", + GalleryIndex = "144", + ID = "488", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 7, + z = 5, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 6, + MaxZ = 4, + }, + Connectors = + { + { + Type = 2, + RelX = 5, + RelY = 1, + RelZ = 4, + Direction = 3, -- Z+ + }, + { + Type = 2, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 2: 0", -- grass + "b: 13: 0", -- gravel + "c:113: 0", -- netherbrickfence + "d: 50: 5", -- torch + "e: 44: 8", -- step + "f: 44: 0", -- step + "g: 43: 0", -- doublestep + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaabbbaaaa", -- 0 + "aaaabbbaaaa", -- 1 + "aaaabbbaaaa", -- 2 + "aaaabbbaaaa", -- 3 + "aaaabbbaaaa", -- 4 + + -- Level 1 + "..c.....c..", -- 0 + "..c.....c..", -- 1 + "..c.....c..", -- 2 + "..c.....c..", -- 3 + "..c.....c..", -- 4 + + -- Level 2 + "..c.....c..", -- 0 + "...........", -- 1 + "..c.....c..", -- 2 + "...........", -- 3 + "..c.....c..", -- 4 + + -- Level 3 + "..d.....d..", -- 0 + "...........", -- 1 + "..c.....c..", -- 2 + "...........", -- 3 + "..d.....d..", -- 4 + + -- Level 4 + "...eeeee...", -- 0 + "...........", -- 1 + "..c.....c..", -- 2 + "...........", -- 3 + "...eeeee...", -- 4 + + -- Level 5 + "..f.....f..", -- 0 + ".egfffffge.", -- 1 + ".egeeeeege.", -- 2 + ".egfffffge.", -- 3 + "..f.....f..", -- 4 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "gf.......fg", -- 2 + "...........", -- 3 + "...........", -- 4 + + }, + }, -- Arch + + + + { + OriginData = + { + ExportName = "SakuraSmall", + Name = "Plains 145", + GalleryName = "Plains", + GalleryIndex = "145", + ID = "489", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 5, + y = 7, + z = 5, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = -1, + MaxX = 5, + MaxY = 6, + MaxZ = 5, + }, + Connectors = + { + { + Type = -1, + RelX = 2, + RelY = 2, + RelZ = -1, + Direction = 2, -- Z- + }, + { + Type = 3, + RelX = 5, + RelY = 2, + RelZ = 2, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = -1, + RelY = 2, + RelZ = 2, + Direction = 4, -- X- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 2: 0", -- grass + "c: 17: 1", -- tree + "d: 35: 6", -- wool + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaa", -- 0 + "aaaaa", -- 1 + "aaaaa", -- 2 + "aaaaa", -- 3 + "aaaaa", -- 4 + + -- Level 1 + "bbbbb", -- 0 + "bbbbb", -- 1 + "bbabb", -- 2 + "bbbbb", -- 3 + "bbbbb", -- 4 + + -- Level 2 + ".....", -- 0 + ".....", -- 1 + "..c..", -- 2 + ".....", -- 3 + ".....", -- 4 + + -- Level 3 + ".....", -- 0 + ".....", -- 1 + "..c..", -- 2 + ".....", -- 3 + ".....", -- 4 + + -- Level 4 + "..d..", -- 0 + "ddddd", -- 1 + "ddcdd", -- 2 + "ddddd", -- 3 + "..d..", -- 4 + + -- Level 5 + ".ddd.", -- 0 + ".ddd.", -- 1 + "ddddd", -- 2 + ".ddd.", -- 3 + ".ddd.", -- 4 + + -- Level 6 + ".....", -- 0 + "..d..", -- 1 + ".ddd.", -- 2 + "..d..", -- 3 + ".....", -- 4 + + }, + }, -- SakuraSmall + + + + { + OriginData = + { + ExportName = "MediumSakuraTree", + Name = "Plains 146", + GalleryName = "Plains", + GalleryIndex = "146", + ID = "490", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 7, + y = 10, + z = 7, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 6, + MaxY = 9, + MaxZ = 6, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 2, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 3, + RelX = 6, + RelY = 2, + RelZ = 3, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 0, + RelY = 2, + RelZ = 3, + Direction = 4, -- X- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 2: 0", -- grass + "c: 31: 1", -- tallgrass + "d: 38: 7", -- rose + "e: 17: 1", -- tree + "f: 38: 0", -- rose + "g: 38: 8", -- rose + "h: 38: 5", -- rose + "i: 35: 6", -- wool + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaa", -- 0 + "aaaaaaa", -- 1 + "aaaaaaa", -- 2 + "aaaaaaa", -- 3 + "aaaaaaa", -- 4 + "aaaaaaa", -- 5 + "aaaaaaa", -- 6 + + -- Level 1 + "bbbbbbb", -- 0 + "bbbbbbb", -- 1 + "bbbbbbb", -- 2 + "bbbabbb", -- 3 + "bbbbbbb", -- 4 + "bbbbbbb", -- 5 + "bbbbbbb", -- 6 + + -- Level 2 + "mm...mm", -- 0 + "m.c...m", -- 1 + ".dccdc.", -- 2 + "..cefc.", -- 3 + ".ccfgh.", -- 4 + "m.ccc.m", -- 5 + "mm...mm", -- 6 + + -- Level 3 + "m.....m", -- 0 + ".......", -- 1 + ".......", -- 2 + "...e...", -- 3 + ".......", -- 4 + ".......", -- 5 + "m.....m", -- 6 + + -- Level 4 + ".......", -- 0 + "..i....", -- 1 + ".......", -- 2 + "...e.i.", -- 3 + ".i.....", -- 4 + ".......", -- 5 + ".......", -- 6 + + -- Level 5 + ".......", -- 0 + "..i....", -- 1 + "...i...", -- 2 + "..ieii.", -- 3 + ".i.ii..", -- 4 + "...i...", -- 5 + ".......", -- 6 + + -- Level 6 + ".......", -- 0 + "..ii...", -- 1 + "..iii..", -- 2 + ".iieii.", -- 3 + ".iiii..", -- 4 + "..iii..", -- 5 + ".......", -- 6 + + -- Level 7 + ".......", -- 0 + "..iii..", -- 1 + ".iiiii.", -- 2 + ".iieii.", -- 3 + ".iiiii.", -- 4 + "..iii..", -- 5 + ".......", -- 6 + + -- Level 8 + ".......", -- 0 + "...i...", -- 1 + "..iiii.", -- 2 + ".iiiii.", -- 3 + "..iii..", -- 4 + "...i...", -- 5 + ".......", -- 6 + + -- Level 9 + ".......", -- 0 + ".......", -- 1 + "...i...", -- 2 + "..iii..", -- 3 + "...i...", -- 4 + ".......", -- 5 + ".......", -- 6 + + }, + }, -- MediumSakuraTree + + + + { + OriginData = + { + ExportName = "Garden2", + Name = "Plains 147", + GalleryName = "Plains", + GalleryIndex = "147", + ID = "491", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 16, + y = 5, + z = 16, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 15, + MaxY = 4, + MaxZ = 15, + }, + Connectors = + { + { + Type = -1, + RelX = 12, + RelY = 3, + RelZ = 15, + Direction = 3, -- Z+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 8: 0", -- water + "c: 2: 0", -- grass + "d: 17: 1", -- tree + "e: 13: 0", -- gravel + "f: 31: 2", -- tallgrass + "g: 18: 5", -- leaves + "h: 38: 7", -- rose + "i: 17: 9", -- tree + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaaaaaaaaaaa", -- 0 + "aaaaaaaaaaaaaaaa", -- 1 + "aaaaaaaaaaaaaaaa", -- 2 + "aaaaaaaaaaaaaaaa", -- 3 + "aaaaaaaaaaaaaaaa", -- 4 + "aaaaaaaaaaaaaaaa", -- 5 + "aaaaaaaaaaaaaaaa", -- 6 + "aaaaaaaaaaaaaaaa", -- 7 + "aaaaaaaaaaaaaaaa", -- 8 + "aaaaaaaaaaaaaaaa", -- 9 + "aaaaaaaaaaaaaaaa", -- 10 + "aaaaaaaaaaaaaaaa", -- 11 + "aaaaaaaaaaaaaaaa", -- 12 + "aaaaaaaaaaaaaaaa", -- 13 + "aaaaaaaaaaaaaaaa", -- 14 + "aaaaaaaaaaaaaaaa", -- 15 + + -- Level 1 + "aaaaaaaaaaaaaaaa", -- 0 + "aaaaaaaaaaaaaaaa", -- 1 + "aaaaaaaaaaaaaaaa", -- 2 + "aaaaaaaaaaaaaaaa", -- 3 + "aaaaaaaaaaaaaaaa", -- 4 + "aaaaaaaaaaaaaaaa", -- 5 + "aaaabbaaaaaaaaaa", -- 6 + "aaabbbaaaaaaaaaa", -- 7 + "aaabbaaaaaaaaaaa", -- 8 + "aaaabaaaaaaaaaaa", -- 9 + "aaaaaaaaaaaaaaaa", -- 10 + "aaaaaaaaaaaaaaaa", -- 11 + "aaaaaaaaaaaaaaaa", -- 12 + "aaaaaaaaaaaaaaaa", -- 13 + "aaaaaaaaaaaaaaaa", -- 14 + "aaaaaaaaaaaaaaaa", -- 15 + + -- Level 2 + "cccccccccccccccc", -- 0 + "ccdccccccccdcccc", -- 1 + "cccccceecccccdcc", -- 2 + "ccccccceeccccccc", -- 3 + "cccccccceccccccc", -- 4 + "cccbbbbceccccccc", -- 5 + "cccbbbbceecccccc", -- 6 + "ccbbbbbcceeeeccc", -- 7 + "ccbbbbbccccceecc", -- 8 + "ccbbbbcccccccecc", -- 9 + "ccccbcccccccceec", -- 10 + "ccccccccccccccec", -- 11 + "ccccccccaaacccec", -- 12 + "cccccccccaccccec", -- 13 + "ccccccccccccceec", -- 14 + "cccccccccccceecc", -- 15 + + -- Level 3 + "......f...gg.g..", -- 0 + "..gg.....gggggg.", -- 1 + "ffgg......ghgggg", -- 2 + ".............gg.", -- 3 + "...........f....", -- 4 + "...........h.ff.", -- 5 + ".............fh.", -- 6 + "...............f", -- 7 + "................", -- 8 + ".......ff.f.....", -- 9 + ".f.....ffggf....", -- 10 + ".......gggg.f...", -- 11 + ".f......iddg....", -- 12 + ".....f..gdgg....", -- 13 + "....ff...gg.....", -- 14 + "................", -- 15 + + -- Level 4 + "................", -- 0 + "...........g.g..", -- 1 + ".............gg.", -- 2 + "................", -- 3 + "................", -- 4 + "................", -- 5 + "................", -- 6 + "................", -- 7 + "................", -- 8 + "................", -- 9 + ".........g......", -- 10 + "........ggg.....", -- 11 + "........ggg.....", -- 12 + ".........g......", -- 13 + "................", -- 14 + "................", -- 15 + + }, + }, -- Garden2 + + + + { + OriginData = + { + ExportName = "Farm", + Name = "Plains 166", + GalleryName = "Plains", + GalleryIndex = "166", + ID = "554", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 8, + z = 13, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 10, + MaxY = 7, + MaxZ = 12, + }, + Connectors = + { + { + Type = -1, + RelX = 10, + RelY = 2, + RelZ = 6, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 60: 7", -- tilleddirt + "c: 8: 0", -- water + "d: 43: 0", -- doublestep + "e: 44: 0", -- step + "f: 59: 7", -- crops + "g: 83: 0", -- reedblock + "h:113: 0", -- netherbrickfence + "i: 50: 5", -- torch + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmmmmmmmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "maaaaaaaaam", -- 6 + "maaaaaaaaam", -- 7 + "maaaaaaaaam", -- 8 + "maaaaaaaaam", -- 9 + "maaaaaaaaam", -- 10 + "maaaaaaaaam", -- 11 + "mmmmmmmmmmm", -- 12 + + -- Level 1 + "mmmmmmmmmmm", -- 0 + "maaaaaaaaam", -- 1 + "mabbbbbbbam", -- 2 + "mabbbbbbbam", -- 3 + "mabbbbbbbam", -- 4 + "mabbbbbbbam", -- 5 + "mabcccccaam", -- 6 + "mabbbbbbbam", -- 7 + "mabbbbbbbam", -- 8 + "mabbbbbbbam", -- 9 + "mabbbbbbbam", -- 10 + "maaaaaaaaam", -- 11 + "mmmmmmmmmmm", -- 12 + + -- Level 2 + "...........", -- 0 + ".deeeeeeed.", -- 1 + ".efffffffe.", -- 2 + ".efffffffe.", -- 3 + ".efffffffe.", -- 4 + ".efgggggfe.", -- 5 + ".eg.....ge.", -- 6 + ".efgggggfe.", -- 7 + ".efffffffe.", -- 8 + ".efffffffe.", -- 9 + ".efffffffe.", -- 10 + ".deeeeeeed.", -- 11 + "...........", -- 12 + + -- Level 3 + "...........", -- 0 + ".h.......h.", -- 1 + "...........", -- 2 + "...........", -- 3 + "...........", -- 4 + "...ggggg...", -- 5 + "..g.....g..", -- 6 + "...ggggg...", -- 7 + "...........", -- 8 + "...........", -- 9 + "...........", -- 10 + ".h.......h.", -- 11 + "...........", -- 12 + + -- Level 4 + "...........", -- 0 + ".h.......h.", -- 1 + "...........", -- 2 + "...........", -- 3 + "...........", -- 4 + "...ggggg...", -- 5 + "..g.....g..", -- 6 + "...ggggg...", -- 7 + "...........", -- 8 + "...........", -- 9 + "...........", -- 10 + ".h.......h.", -- 11 + "...........", -- 12 + + -- Level 5 + "...........", -- 0 + ".h.......h.", -- 1 + "...........", -- 2 + "...........", -- 3 + "...........", -- 4 + "...........", -- 5 + "...........", -- 6 + "...........", -- 7 + "...........", -- 8 + "...........", -- 9 + "...........", -- 10 + ".h.......h.", -- 11 + "...........", -- 12 + + -- Level 6 + ".h.......h.", -- 0 + "hhh.....hhh", -- 1 + ".h.......h.", -- 2 + "...........", -- 3 + "...........", -- 4 + "...........", -- 5 + "...........", -- 6 + "...........", -- 7 + "...........", -- 8 + "...........", -- 9 + ".h.......h.", -- 10 + "hhh.....hhh", -- 11 + ".h.......h.", -- 12 + + -- Level 7 + ".i.......i.", -- 0 + "i.i.....i.i", -- 1 + ".i.......i.", -- 2 + "...........", -- 3 + "...........", -- 4 + "...........", -- 5 + "...........", -- 6 + "...........", -- 7 + "...........", -- 8 + "...........", -- 9 + ".i.......i.", -- 10 + "i.i.....i.i", -- 11 + ".i.......i.", -- 12 + + }, + }, -- Farm + }, -- Pieces +} + + + + diff --git a/Server/Prefabs/Villages/PlainsVillage.cubeset b/Server/Prefabs/Villages/PlainsVillage.cubeset new file mode 100644 index 000000000..0ad53a762 --- /dev/null +++ b/Server/Prefabs/Villages/PlainsVillage.cubeset @@ -0,0 +1,6521 @@ + +-- PlainsVillage.cubeset + +-- Defines the prefabs in the group PlainsVillage + +-- NOTE: This file has been generated automatically by GalExport! +-- Any manual changes will be overwritten by the next automatic export! + + + + +Cubeset = +{ + Metadata = + { + CubesetFormatVersion = 1, + ExportDate = "2015-06-20 10:16:55", + ["AllowedBiomes"] = "Plains, Savanna, SavannaM, SunflowerPlains", + ["IntendedUse"] = "Village", + }, + + Pieces = + { + { + OriginData = + { + ExportName = "WoodenHouseL14x14", + Name = "Plains 0", + GalleryName = "Plains", + GalleryIndex = "0", + ID = "4", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 16, + y = 8, + z = 16, + }, + Hitbox = + { + MinX = -1, + MinY = 1, + MinZ = 0, + MaxX = 16, + MaxY = 7, + MaxZ = 16, + }, + Connectors = + { + { + Type = -1, + RelX = 9, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 5: 0", -- planks + "f: 67: 3", -- stairs + "g: 17: 0", -- tree + "h: 64: 3", -- wooddoorblock + "i: 64: 1", -- wooddoorblock + "j:102: 0", -- glasspane + "k: 64: 9", -- wooddoorblock + "l: 53: 2", -- woodstairs + "m: 19: 0", -- sponge + "n: 53: 1", -- woodstairs + "o: 53: 7", -- woodstairs + "p: 53: 6", -- woodstairs + "q: 53: 3", -- woodstairs + "r: 53: 0", -- woodstairs + "s: 53: 5", -- woodstairs + "t: 53: 4", -- woodstairs + "u: 50: 3", -- torch + "v: 50: 2", -- torch + "w: 50: 4", -- torch + "x: 50: 1", -- torch + }, + BlockData = + { + -- Level 0 + "mmmmmmmmaaammmmm", -- 0 + "maaaaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaaaam", -- 3 + "maaaaaaaaaaaaaam", -- 4 + "maaaaaaaaaaaaaam", -- 5 + "maaaaaaaaaaaaaam", -- 6 + "maaaaaaaaaaaaaam", -- 7 + "mmmmmaaaaaaaaaam", -- 8 + "mmmmmmmmaaaaaaam", -- 9 + "mmmmmmmmaaaaaaam", -- 10 + "mmmmmmmmaaaaaaam", -- 11 + "mmmmmmmmaaaaaaam", -- 12 + "mmmmmmmmaaaaaaam", -- 13 + "mmmmmmmmaaaaaaam", -- 14 + "mmmmmmmmmmmmmmmm", -- 15 + + -- Level 1 + "........bcd.....", -- 0 + ".aaaaaaaaaaaaaa.", -- 1 + ".aeeeeeeeeeeeea.", -- 2 + ".aeeeeeeeeeeeea.", -- 3 + ".aeeeeeeeeeeeea.", -- 4 + ".aeeeeeeeeeeeea.", -- 5 + ".aeeeeeeeeeeeea.", -- 6 + ".aaaaaaaaeeeeea.", -- 7 + ".....bfdaeeeeea.", -- 8 + "mmmm....aeeeeea.", -- 9 + "mmmmmmm.aeeeeea.", -- 10 + "mmmmmmm.aeeeeea.", -- 11 + "mmmmmmm.aeeeeea.", -- 12 + "mmmmmmm.aeeeeea.", -- 13 + "mmmmmmm.aaaaaaa.", -- 14 + "mmmmmmm.........", -- 15 + + -- Level 2 + "................", -- 0 + ".geeeeeeghgeeeg.", -- 1 + ".e............e.", -- 2 + ".e............e.", -- 3 + ".e............e.", -- 4 + ".e............e.", -- 5 + ".e............e.", -- 6 + ".geeeeieg.....e.", -- 7 + "........e.....e.", -- 8 + "mmmm....e.....e.", -- 9 + "mmmmmmm.e.....e.", -- 10 + "mmmmmmm.e.....e.", -- 11 + "mmmmmmm.e.....e.", -- 12 + "mmmmmmm.e.....e.", -- 13 + "mmmmmmm.geeeeeg.", -- 14 + "mmmmmmm.........", -- 15 + + -- Level 3 + "................", -- 0 + ".gejjejjgkgjjeg.", -- 1 + ".j............e.", -- 2 + ".j............j.", -- 3 + ".j............j.", -- 4 + ".j............e.", -- 5 + ".j............j.", -- 6 + ".gejjekeg.....j.", -- 7 + "........e.....e.", -- 8 + "mmmm....j.....j.", -- 9 + "mmmmmmm.j.....j.", -- 10 + "mmmmmmm.e.....e.", -- 11 + "mmmmmmm.j.....j.", -- 12 + "mmmmmmm.j.....j.", -- 13 + "mmmmmmm.gjjjjjg.", -- 14 + "mmmmmmm.........", -- 15 + + -- Level 4 + "llllllllllllllln", -- 0 + "ogeeeeeegegeeegn", -- 1 + ".e............en", -- 2 + ".e............en", -- 3 + ".e............en", -- 4 + ".e............en", -- 5 + ".e............en", -- 6 + "pgeeeeeeg.....en", -- 7 + "qqqqqqqre.....en", -- 8 + "mmmm...re.....en", -- 9 + "mmmmmmmre.....en", -- 10 + "mmmmmmmre.....en", -- 11 + "mmmmmmmre.....en", -- 12 + "mmmmmmmre.....en", -- 13 + "mmmmmmmrgeeeeegn", -- 14 + "mmmmmmmrs.....tn", -- 15 + + -- Level 5 + "................", -- 0 + "lllllllllllllll.", -- 1 + "oeeeeeeeeeeeeen.", -- 2 + ".e.........u.en.", -- 3 + ".e..........ven.", -- 4 + ".e......w....en.", -- 5 + "peeeeeeeee...en.", -- 6 + "qqqqqqqqrex..en.", -- 7 + "........re...en.", -- 8 + "mmmm....re...en.", -- 9 + "mmmmmmm.re...en.", -- 10 + "mmmmmmm.re...en.", -- 11 + "mmmmmmm.re...en.", -- 12 + "mmmmmmm.re...en.", -- 13 + "mmmmmmm.reeeeen.", -- 14 + "mmmmmmm.rs...tn.", -- 15 + + -- Level 6 + "................", -- 0 + "................", -- 1 + "llllllllllllln..", -- 2 + "oeeeeeeeeeeeen..", -- 3 + ".ex.........en..", -- 4 + "peeeeeeeeee.en..", -- 5 + "qqqqqqqqqre.en..", -- 6 + ".........re.en..", -- 7 + ".........re.en..", -- 8 + "mmmm.....re.en..", -- 9 + "mmmmmmm..re.en..", -- 10 + "mmmmmmm..re.en..", -- 11 + "mmmmmmm..re.en..", -- 12 + "mmmmmmm..rewen..", -- 13 + "mmmmmmm..reeen..", -- 14 + "mmmmmmm..rs.tn..", -- 15 + + -- Level 7 + "................", -- 0 + "................", -- 1 + "................", -- 2 + "lllllllllllll...", -- 3 + "eeeeeeeeeeeen...", -- 4 + "qqqqqqqqqqren...", -- 5 + "..........ren...", -- 6 + "..........ren...", -- 7 + "..........ren...", -- 8 + "mmmm......ren...", -- 9 + "mmmmmmm...ren...", -- 10 + "mmmmmmm...ren...", -- 11 + "mmmmmmm...ren...", -- 12 + "mmmmmmm...ren...", -- 13 + "mmmmmmm...ren...", -- 14 + "mmmmmmm...ren...", -- 15 + + }, + }, -- WoodenHouseL14x14 + + + + { + OriginData = + { + ExportName = "CobbleWell4x4", + Name = "Plains 1", + GalleryName = "Plains", + GalleryIndex = "1", + ID = "5", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 4, + y = 13, + z = 4, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 3, + MaxY = 12, + MaxZ = 3, + }, + Connectors = + { + { + Type = 2, + RelX = 1, + RelY = 9, + RelZ = 3, + Direction = 3, -- Z+ + }, + { + Type = 2, + RelX = 2, + RelY = 9, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 2, + RelX = 0, + RelY = 9, + RelZ = 1, + Direction = 4, -- X- + }, + { + Type = 2, + RelX = 3, + RelY = 9, + RelZ = 2, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["IsStarting"] = "1", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 1: 0", -- stone + "b: 4: 0", -- cobblestone + "c: 8: 0", -- water + "d: 85: 0", -- fence + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaa", -- 0 + "aaaa", -- 1 + "aaaa", -- 2 + "aaaa", -- 3 + + -- Level 1 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 2 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 3 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 4 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 5 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 6 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 7 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 8 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 9 + "bbbb", -- 0 + "b..b", -- 1 + "b..b", -- 2 + "bbbb", -- 3 + + -- Level 10 + "d..d", -- 0 + "....", -- 1 + "....", -- 2 + "d..d", -- 3 + + -- Level 11 + "d..d", -- 0 + "....", -- 1 + "....", -- 2 + "d..d", -- 3 + + -- Level 12 + "bbbb", -- 0 + "bbbb", -- 1 + "bbbb", -- 2 + "bbbb", -- 3 + + }, + }, -- CobbleWell4x4 + + + + { + OriginData = + { + ExportName = "DoublePlantBed", + Name = "Plains 5", + GalleryName = "Plains", + GalleryIndex = "5", + ID = "20", + CreatorName = "tonibm1999", + }, + Size = + { + x = 15, + y = 8, + z = 9, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 14, + MaxY = 7, + MaxZ = 8, + }, + Connectors = + { + { + Type = -1, + RelX = 7, + RelY = 2, + RelZ = 8, + Direction = 3, -- Z+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 2: 0", -- grass + "c: 17: 0", -- tree + "d: 60: 7", -- tilleddirt + "e: 8: 0", -- water + "f: 60: 5", -- tilleddirt + "g: 60: 4", -- tilleddirt + "h: 60: 1", -- tilleddirt + "i: 50: 5", -- torch + "j: 59: 7", -- crops + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaabaaaaaaa", -- 0 + "aaaaaaabaaaaaaa", -- 1 + "aaaaaaabaaaaaaa", -- 2 + "aaaaaaabaaaaaaa", -- 3 + "aaaaaaabaaaaaaa", -- 4 + "aaaaaaabaaaaaaa", -- 5 + "aaaaaaabaaaaaaa", -- 6 + "aaaaaaabaaaaaaa", -- 7 + "aaaaaaabaaaaaaa", -- 8 + + -- Level 1 + "aaaaaaamaaaaaaa", -- 0 + "aaaaaaamaaaaaaa", -- 1 + "aaaaaaamaaaaaaa", -- 2 + "aaaaaaamaaaaaaa", -- 3 + "aaaaaaamaaaaaaa", -- 4 + "aaaaaaamaaaaaaa", -- 5 + "aaaaaaamaaaaaaa", -- 6 + "aaaaaaamaaaaaaa", -- 7 + "aaaaaaamaaaaaaa", -- 8 + + -- Level 2 + "ccccccc.ccccccc", -- 0 + "cddeddc.cddeddc", -- 1 + "cddeddc.cddeddc", -- 2 + "cddeddc.cddeddc", -- 3 + "cddeddc.cddeddc", -- 4 + "cddeddc.cddeddc", -- 5 + "cdfeddc.cdgeddc", -- 6 + "cdfefhc.cddeddc", -- 7 + "ccccccc.ccccccc", -- 8 + + -- Level 3 + "i.....i.i.....i", -- 0 + ".jj.jj...jj.jj.", -- 1 + ".jj.jj...jj.jj.", -- 2 + ".jj.jj...jj.jj.", -- 3 + ".jj.jj...jj.jj.", -- 4 + ".jj.jj...jj.jj.", -- 5 + ".jj.jj...jj.jj.", -- 6 + ".jj.jj...jj.jj.", -- 7 + "i.....i.i.....i", -- 8 + + -- Level 4 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "...............", -- 3 + "...............", -- 4 + "...............", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + + -- Level 5 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "...............", -- 3 + "...............", -- 4 + "...............", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + + -- Level 6 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "...............", -- 3 + "...............", -- 4 + "...............", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + + -- Level 7 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "...............", -- 3 + "...............", -- 4 + "...............", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + + }, + }, -- DoublePlantBed + + + + { + OriginData = + { + ExportName = "WoodenHouse9x5Fence", + Name = "p9", + GalleryName = "Plains", + GalleryIndex = "9", + ID = "26", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 10, + y = 7, + z = 11, + }, + Hitbox = + { + MinX = 0, + MinY = -1, + MinZ = -1, + MaxX = 10, + MaxY = 6, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 0, + RelY = 1, + RelZ = 5, + Direction = 4, -- X- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 3: 0", -- dirt + "c: 5: 0", -- planks + "d: 2: 0", -- grass + "e: 67: 2", -- stairs + "f: 43: 0", -- doublestep + "g: 67: 0", -- stairs + "h: 67: 3", -- stairs + "i: 17: 0", -- tree + "j: 53: 1", -- woodstairs + "k: 85: 0", -- fence + "l: 53: 0", -- woodstairs + "m: 19: 0", -- sponge + "n: 64: 2", -- wooddoorblock + "o: 64: 0", -- wooddoorblock + "p:102: 0", -- glasspane + "q: 72: 0", -- woodplate + "r: 64: 9", -- wooddoorblock + "s: 53: 5", -- woodstairs + "t: 53: 4", -- woodstairs + "u: 50: 1", -- torch + "v: 50: 2", -- torch + }, + BlockData = + { + -- Level 0 + "mmmmmmmmmm", -- 0 + "maaaaammmm", -- 1 + "maaaaammmm", -- 2 + "maaaaabbbb", -- 3 + "aaaaaabbbb", -- 4 + "aaaaaabbbb", -- 5 + "aaaaaabbbb", -- 6 + "maaaaabbbb", -- 7 + "maaaaabbbb", -- 8 + "maaaaammmm", -- 9 + "mmmmmmmmmm", -- 10 + + -- Level 1 + "......mmmm", -- 0 + ".aaaaammmm", -- 1 + ".acccammmm", -- 2 + ".acccadddd", -- 3 + "eafffadddd", -- 4 + "gaffffdddd", -- 5 + "hafffadddd", -- 6 + ".afffadddd", -- 7 + ".afffadddd", -- 8 + ".aaaaammmm", -- 9 + "......mmmm", -- 10 + + -- Level 2 + "......mmmm", -- 0 + ".icccimmmm", -- 1 + ".cjklcmmmm", -- 2 + ".c...ckkkk", -- 3 + ".c...c...k", -- 4 + ".n...o...k", -- 5 + ".c...c...k", -- 6 + ".cff.c...k", -- 7 + ".c...ckkkk", -- 8 + ".icccimmmm", -- 9 + "......mmmm", -- 10 + + -- Level 3 + "......mmmm", -- 0 + ".ipppimmmm", -- 1 + ".p.q.pmmmm", -- 2 + ".p...p....", -- 3 + ".c...c....", -- 4 + ".r...r....", -- 5 + ".c...c....", -- 6 + ".p...p....", -- 7 + ".p...p....", -- 8 + ".ipppimmmm", -- 9 + "......mmmm", -- 10 + + -- Level 4 + "ls...tjmmm", -- 0 + "licccijmmm", -- 1 + "lc...cjmmm", -- 2 + "lc...cj...", -- 3 + "lcu.vcj...", -- 4 + "lc...cj...", -- 5 + "lcu.vcj...", -- 6 + "lc...cj...", -- 7 + "lc...cj...", -- 8 + "licccijmmm", -- 9 + "ls...tjmmm", -- 10 + + -- Level 5 + ".ls.tj.mmm", -- 0 + ".lcccj.mmm", -- 1 + ".lc.cj.mmm", -- 2 + ".lc.cj....", -- 3 + ".lc.cj....", -- 4 + ".lc.cj....", -- 5 + ".lc.cj....", -- 6 + ".lc.cj....", -- 7 + ".lc.cj....", -- 8 + ".lcccj.mmm", -- 9 + ".ls.tj.mmm", -- 10 + + -- Level 6 + "..lcj..mmm", -- 0 + "..lcj..mmm", -- 1 + "..lcj..mmm", -- 2 + "..lcj.....", -- 3 + "..lcj.....", -- 4 + "..lcj.....", -- 5 + "..lcj.....", -- 6 + "..lcj.....", -- 7 + "..lcj.....", -- 8 + "..lcj..mmm", -- 9 + "..lcj..mmm", -- 10 + + }, + }, -- WoodenHouse9x5Fence + + + + { + OriginData = + { + ExportName = "SinglePlantBed", + Name = "Plains 17", + GalleryName = "Plains", + GalleryIndex = "17", + ID = "60", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 10, + y = 7, + z = 7, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 9, + MaxY = 6, + MaxZ = 6, + }, + Connectors = + { + { + Type = -1, + RelX = 9, + RelY = 1, + RelZ = 3, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 17: 0", -- tree + "c: 60: 7", -- tilleddirt + "d: 60: 6", -- tilleddirt + "e: 8: 0", -- water + "f: 59: 7", -- crops + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaaaaa", -- 0 + "aaaaaaaaaa", -- 1 + "aaaaaaaaaa", -- 2 + "aaaaaaaaaa", -- 3 + "aaaaaaaaaa", -- 4 + "aaaaaaaaaa", -- 5 + "aaaaaaaaaa", -- 6 + + -- Level 1 + "bbbbbbbbbb", -- 0 + "bccccccccb", -- 1 + "bcccccdccb", -- 2 + "beeeeeeeeb", -- 3 + "bccccccccb", -- 4 + "bccccccccb", -- 5 + "bbbbbbbbbb", -- 6 + + -- Level 2 + "..........", -- 0 + ".ffffffff.", -- 1 + ".ffffffff.", -- 2 + "..........", -- 3 + ".ffffffff.", -- 4 + ".ffffffff.", -- 5 + "..........", -- 6 + + -- Level 3 + "..........", -- 0 + "..........", -- 1 + "..........", -- 2 + "..........", -- 3 + "..........", -- 4 + "..........", -- 5 + "..........", -- 6 + + -- Level 4 + "..........", -- 0 + "..........", -- 1 + "..........", -- 2 + "..........", -- 3 + "..........", -- 4 + "..........", -- 5 + "..........", -- 6 + + -- Level 5 + "..........", -- 0 + "..........", -- 1 + "..........", -- 2 + "..........", -- 3 + "..........", -- 4 + "..........", -- 5 + "..........", -- 6 + + -- Level 6 + "..........", -- 0 + "..........", -- 1 + "..........", -- 2 + "..........", -- 3 + "..........", -- 4 + "..........", -- 5 + "..........", -- 6 + + }, + }, -- SinglePlantBed + + + + { + OriginData = + { + ExportName = "CobbleHouse10x5Library", + Name = "Plains 23", + GalleryName = "Plains", + GalleryIndex = "23", + ID = "66", + CreatorName = "xoft", + }, + Size = + { + x = 12, + y = 7, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 12, + MaxY = 6, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 8, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 64: 3", -- wooddoorblock + "f: 53: 3", -- woodstairs + "g: 53: 1", -- woodstairs + "h: 85: 0", -- fence + "i: 53: 0", -- woodstairs + "j: 53: 2", -- woodstairs + "k:102: 0", -- glasspane + "l: 64: 9", -- wooddoorblock + "m: 19: 0", -- sponge + "n: 50: 3", -- torch + "o: 72: 0", -- woodplate + "p: 50: 4", -- torch + "q: 53: 7", -- woodstairs + "r: 47: 0", -- bookshelf + "s: 50: 1", -- torch + "t: 50: 2", -- torch + "u: 53: 6", -- woodstairs + "v: 5: 0", -- planks + }, + BlockData = + { + -- Level 0 + "mmmmmmmaaamm", -- 0 + "maaaaaaaaaam", -- 1 + "maaaaaaaaaam", -- 2 + "maaaaaaaaaam", -- 3 + "maaaaaaaaaam", -- 4 + "maaaaaaaaaam", -- 5 + "mmmmmmmmmmmm", -- 6 + + -- Level 1 + ".......bcd..", -- 0 + ".aaaaaaaaaa.", -- 1 + ".aaaaaaaaaa.", -- 2 + ".aaaaaaaaaa.", -- 3 + ".aaaaaaaaaa.", -- 4 + ".aaaaaaaaaa.", -- 5 + "............", -- 6 + + -- Level 2 + "............", -- 0 + ".aaaaaaaeaa.", -- 1 + ".af.ghi...a.", -- 2 + ".ah.......a.", -- 3 + ".aj.ghighia.", -- 4 + ".aaaaaaaaaa.", -- 5 + "............", -- 6 + + -- Level 3 + "............", -- 0 + ".akkakkalaa.", -- 1 + ".k..no.n.nk.", -- 2 + ".ko.......k.", -- 3 + ".k..po.po.k.", -- 4 + ".akkakkakka.", -- 5 + "............", -- 6 + + -- Level 4 + "jjjjjjjjjjjj", -- 0 + "qaaaaaaaaaaq", -- 1 + ".arrrrrrrra.", -- 2 + ".as......ta.", -- 3 + ".arrrrrrrra.", -- 4 + "uaaaaaaaaaau", -- 5 + "ffffffffffff", -- 6 + + -- Level 5 + "............", -- 0 + "jjjjjjjjjjjj", -- 1 + "qvvvvvvvvvvq", -- 2 + ".vvvvvvvvvv.", -- 3 + "uvvvvvvvvvvu", -- 4 + "ffffffffffff", -- 5 + "............", -- 6 + + -- Level 6 + "............", -- 0 + "............", -- 1 + "jjjjjjjjjjjj", -- 2 + "vvvvvvvvvvvv", -- 3 + "ffffffffffff", -- 4 + "............", -- 5 + "............", -- 6 + + }, + }, -- CobbleHouse10x5Library + + + + { + OriginData = + { + ExportName = "BigPlantBed", + Name = "Plains 26", + GalleryName = "Plains", + GalleryIndex = "26", + ID = "70", + CreatorName = "Taugrammaton", + }, + Size = + { + x = 13, + y = 8, + z = 12, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 12, + MaxY = 7, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 7, + RelY = 1, + RelZ = 11, + Direction = 3, -- Z+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 5: 0", -- planks + "c: 13: 0", -- gravel + "d: 17: 0", -- tree + "e: 60: 7", -- tilleddirt + "f: 8: 0", -- water + "g: 60: 6", -- tilleddirt + "h: 85: 0", -- fence + "i: 59: 7", -- crops + "j: 50: 5", -- torch + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaaaaaaaa", -- 0 + "aaaaaaaaaaaaa", -- 1 + "aaaaaaaaaaaaa", -- 2 + "aaaaaaaaaaaaa", -- 3 + "aaaaaaaaaaaaa", -- 4 + "aaaaaaaaaaaaa", -- 5 + "aaaaaaaaaaaaa", -- 6 + "aaaaaaaaaaaaa", -- 7 + "aaaaaaaaaaaaa", -- 8 + "aaaaaaaaaaaaa", -- 9 + "aaaaaaaaaaaaa", -- 10 + "aaaaaaaaaaaaa", -- 11 + + -- Level 1 + "bbbbbbbbbbbbb", -- 0 + "bcccccccccccb", -- 1 + "bcccccccccccb", -- 2 + "bcccccccccccb", -- 3 + "bcccccccccccb", -- 4 + "bcccccccccccb", -- 5 + "bcccccccccccb", -- 6 + "bcccccccccccb", -- 7 + "bcccccccccccb", -- 8 + "bcccccccccccb", -- 9 + "bcccccccccccb", -- 10 + "bbbbbbbbbbbbb", -- 11 + + -- Level 2 + "ddddddddddddd", -- 0 + "deefeefeefeed", -- 1 + "deefeefeefeed", -- 2 + "deefeefeefeed", -- 3 + "deefeefeefeed", -- 4 + "deefeefeefeed", -- 5 + "deefeefeefeed", -- 6 + "deefeefegfeed", -- 7 + "deefeefeefeed", -- 8 + "deefeefeefeed", -- 9 + "deefeefeefeed", -- 10 + "ddddddddddddd", -- 11 + + -- Level 3 + "h..h..h..h..h", -- 0 + "hii.i..ii.iih", -- 1 + "hii..i.ii.iih", -- 2 + "hii.i..i..iih", -- 3 + "hii.ii.i..iih", -- 4 + "hii.i..ii.iih", -- 5 + "hii.ii.ii.iih", -- 6 + "hii....i..iih", -- 7 + "hii..i....iih", -- 8 + "hii.....i.iih", -- 9 + "hii.ii.i..iih", -- 10 + "h..h..h..h..h", -- 11 + + -- Level 4 + "j..j..j..j..j", -- 0 + ".............", -- 1 + ".............", -- 2 + ".............", -- 3 + ".............", -- 4 + ".............", -- 5 + ".............", -- 6 + ".............", -- 7 + ".............", -- 8 + ".............", -- 9 + ".............", -- 10 + "j..j..j..j..j", -- 11 + + -- Level 5 + ".............", -- 0 + ".............", -- 1 + ".............", -- 2 + ".............", -- 3 + ".............", -- 4 + ".............", -- 5 + ".............", -- 6 + ".............", -- 7 + ".............", -- 8 + ".............", -- 9 + ".............", -- 10 + ".............", -- 11 + + -- Level 6 + ".............", -- 0 + ".............", -- 1 + ".............", -- 2 + ".............", -- 3 + ".............", -- 4 + ".............", -- 5 + ".............", -- 6 + ".............", -- 7 + ".............", -- 8 + ".............", -- 9 + ".............", -- 10 + ".............", -- 11 + + -- Level 7 + ".............", -- 0 + ".............", -- 1 + ".............", -- 2 + ".............", -- 3 + ".............", -- 4 + ".............", -- 5 + ".............", -- 6 + ".............", -- 7 + ".............", -- 8 + ".............", -- 9 + ".............", -- 10 + ".............", -- 11 + + }, + }, -- BigPlantBed + + + + { + OriginData = + { + ExportName = "LampPost", + Name = "Plains 28", + GalleryName = "Plains", + GalleryIndex = "28", + ID = "73", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 3, + y = 7, + z = 3, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 2, + MaxY = 6, + MaxZ = 2, + }, + Connectors = + { + { + Type = -1, + RelX = 1, + RelY = 1, + RelZ = 2, + Direction = 3, -- Z+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 3: 0", -- dirt + "b: 43: 0", -- doublestep + "c:139: 0", -- cobblestonewall + "d: 50: 4", -- torch + "e: 50: 2", -- torch + "f: 50: 1", -- torch + "g: 50: 3", -- torch + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmm", -- 0 + "mam", -- 1 + "mmm", -- 2 + + -- Level 1 + "...", -- 0 + ".b.", -- 1 + "...", -- 2 + + -- Level 2 + "...", -- 0 + ".c.", -- 1 + "...", -- 2 + + -- Level 3 + "...", -- 0 + ".c.", -- 1 + "...", -- 2 + + -- Level 4 + ".d.", -- 0 + "ebf", -- 1 + ".g.", -- 2 + + -- Level 5 + "...", -- 0 + "...", -- 1 + "...", -- 2 + + -- Level 6 + "...", -- 0 + "...", -- 1 + "...", -- 2 + + }, + }, -- LampPost + + + + { + OriginData = + { + ExportName = "WoodenHouse9x7DoubleDoor", + Name = "Plains 38", + GalleryName = "Plains", + GalleryIndex = "38", + ID = "87", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 8, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 11, + MaxY = 7, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 67: 3", -- stairs + "f: 17: 0", -- tree + "g: 5: 0", -- planks + "h: 64: 3", -- wooddoorblock + "i: 64: 1", -- wooddoorblock + "j:102: 0", -- glasspane + "k: 64: 9", -- wooddoorblock + "l: 53: 2", -- woodstairs + "m: 19: 0", -- sponge + "n: 53: 7", -- woodstairs + "o: 17: 4", -- tree + "p: 17: 8", -- tree + "q: 50: 3", -- torch + "r: 50: 4", -- torch + "s: 53: 6", -- woodstairs + "t: 53: 3", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "maaaaaaaaam", -- 6 + "maaaaaaaaam", -- 7 + "mmmmaaammmm", -- 8 + + -- Level 1 + "....bcd....", -- 0 + ".aaaaaaaaa.", -- 1 + ".aaaaaaaaa.", -- 2 + ".aaaaaaaaa.", -- 3 + ".aaaaaaaaa.", -- 4 + ".aaaaaaaaa.", -- 5 + ".aaaaaaaaa.", -- 6 + ".aaaaaaaaa.", -- 7 + "....bed....", -- 8 + + -- Level 2 + "...........", -- 0 + ".fggfhfggf.", -- 1 + ".g.......g.", -- 2 + ".g.......g.", -- 3 + ".f.......f.", -- 4 + ".g.......g.", -- 5 + ".g.......g.", -- 6 + ".fggfifggf.", -- 7 + "...........", -- 8 + + -- Level 3 + "...........", -- 0 + ".fjjfkfjjf.", -- 1 + ".j.......j.", -- 2 + ".j.......j.", -- 3 + ".f.......f.", -- 4 + ".j.......j.", -- 5 + ".j.......j.", -- 6 + ".fjjfkfjjf.", -- 7 + "...........", -- 8 + + -- Level 4 + "lllllllllll", -- 0 + "nfooooooofn", -- 1 + ".p..q.q..p.", -- 2 + ".p.......p.", -- 3 + ".p.......p.", -- 4 + ".p.......p.", -- 5 + ".p..r.r..p.", -- 6 + "sfooooooofs", -- 7 + "ttttttttttt", -- 8 + + -- Level 5 + "...........", -- 0 + "lllllllllll", -- 1 + "ngggggggggn", -- 2 + ".g.......g.", -- 3 + ".g.......g.", -- 4 + ".g.......g.", -- 5 + "sgggggggggs", -- 6 + "ttttttttttt", -- 7 + "...........", -- 8 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "lllllllllll", -- 2 + "ngggggggggn", -- 3 + ".g.......g.", -- 4 + "sgggggggggs", -- 5 + "ttttttttttt", -- 6 + "...........", -- 7 + "...........", -- 8 + + -- Level 7 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "lllllllllll", -- 3 + "ggggggggggg", -- 4 + "ttttttttttt", -- 5 + "...........", -- 6 + "...........", -- 7 + "...........", -- 8 + + }, + }, -- WoodenHouse9x7DoubleDoor + + + + { + OriginData = + { + ExportName = "WoodenHouseL13x14", + Name = "Plains 39", + GalleryName = "Plains", + GalleryIndex = "39", + ID = "90", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 15, + y = 9, + z = 16, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 15, + MaxY = 8, + MaxZ = 16, + }, + Connectors = + { + { + Type = -1, + RelX = 7, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "A: 53: 7", -- woodstairs + "B: 53: 4", -- woodstairs + "C: 53: 5", -- woodstairs + "D: 53: 6", -- woodstairs + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 43: 0", -- doublestep + "f: 17: 0", -- tree + "g: 5: 0", -- planks + "h: 64: 3", -- wooddoorblock + "i: 96: 8", -- trapdoor + "j: 61: 2", -- furnace + "k: 53: 3", -- woodstairs + "l: 85: 0", -- fence + "m: 19: 0", -- sponge + "n: 53: 2", -- woodstairs + "o: 53: 1", -- woodstairs + "p: 53: 0", -- woodstairs + "q: 47: 0", -- bookshelf + "r:102: 0", -- glasspane + "s: 64: 9", -- wooddoorblock + "t: 72: 0", -- woodplate + "u: 17: 4", -- tree + "v: 17: 8", -- tree + "w: 50: 3", -- torch + "x: 50: 1", -- torch + "y: 50: 4", -- torch + "z: 50: 2", -- torch + }, + BlockData = + { + -- Level 0 + "mmmmmmaaammmmmm", -- 0 + "maaaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaaam", -- 3 + "maaaaaaaaaaaaam", -- 4 + "maaaaaaaaaaaaam", -- 5 + "maaaaaaaaaaaaam", -- 6 + "maaaaaaaaaaaaam", -- 7 + "mmmmmmmmaaaaaam", -- 8 + "mmmmmmmmaaaaaam", -- 9 + "mmmmmmmmaaaaaam", -- 10 + "mmmmmmmmaaaaaam", -- 11 + "mmmmmmmmaaaaaam", -- 12 + "mmmmmmmmaaaaaam", -- 13 + "mmmmmmmmaaaaaam", -- 14 + "mmmmmmmmmmmmmmm", -- 15 + + -- Level 1 + "......bcd......", -- 0 + ".aaaaaaaaaaaaa.", -- 1 + ".aeeeeaaaaaaaa.", -- 2 + ".aeeeeaaaaaaaa.", -- 3 + ".aaaaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaaaa.", -- 5 + ".aaaaaaaaaaaaa.", -- 6 + ".aaaaaaaaaaaaa.", -- 7 + "........aaaaaa.", -- 8 + "mmmmmmm.aaaaaa.", -- 9 + "mmmmmmm.aaaaaa.", -- 10 + "mmmmmmm.aaaaaa.", -- 11 + "mmmmmmm.aaaaaa.", -- 12 + "mmmmmmm.aaaaaa.", -- 13 + "mmmmmmm.aaaaaa.", -- 14 + "mmmmmmm........", -- 15 + + -- Level 2 + "...............", -- 0 + ".fggggfhfggggf.", -- 1 + ".g...i.......g.", -- 2 + ".gjeee......kg.", -- 3 + ".f..........lg.", -- 4 + ".g..........ng.", -- 5 + ".g.olp..ol...g.", -- 6 + ".fggggggfn...f.", -- 7 + "........g....g.", -- 8 + "mmmmmmm.gk...g.", -- 9 + "mmmmmmm.gl..kg.", -- 10 + "mmmmmmm.gn..lg.", -- 11 + "mmmmmmm.g...ng.", -- 12 + "mmmmmmm.gq..qg.", -- 13 + "mmmmmmm.fggggf.", -- 14 + "mmmmmmm........", -- 15 + + -- Level 3 + "...............", -- 0 + ".fgrrgfsfgrrgf.", -- 1 + ".g...........g.", -- 2 + ".g...........r.", -- 3 + ".f..........tr.", -- 4 + ".g...........r.", -- 5 + ".g..t....t...g.", -- 6 + ".fgrrrrgf....f.", -- 7 + "........g....g.", -- 8 + "mmmmmmm.r....r.", -- 9 + "mmmmmmm.rt...r.", -- 10 + "mmmmmmm.r...tr.", -- 11 + "mmmmmmm.r....r.", -- 12 + "mmmmmmm.gq..qg.", -- 13 + "mmmmmmm.fgrrgf.", -- 14 + "mmmmmmm........", -- 15 + + -- Level 4 + "...............", -- 0 + ".fuuuuuuuuuuuf.", -- 1 + ".v....w.w....v.", -- 2 + ".v...........v.", -- 3 + ".vx..........v.", -- 4 + ".v...........v.", -- 5 + ".v......y....v.", -- 6 + ".fuuuuuufx..zv.", -- 7 + "........v....v.", -- 8 + "mmmmmmm.v....v.", -- 9 + "mmmmmmm.v....v.", -- 10 + "mmmmmmm.v....v.", -- 11 + "mmmmmmm.v....v.", -- 12 + "mmmmmmm.v.yy.v.", -- 13 + "mmmmmmm.fuuuuf.", -- 14 + "mmmmmmm........", -- 15 + + -- Level 5 + "nnnnnnnnnnnnnno", -- 0 + "pgggggggggggggo", -- 1 + "pgAAAAAAAAAABgo", -- 2 + "pgC.........Bgo", -- 3 + "pgC.........Bgo", -- 4 + "pgC.........Bgo", -- 5 + "pgCDDDDDDD..Bgo", -- 6 + "pggggggggC..Bgo", -- 7 + "pkkkkkkpgC..Bgo", -- 8 + "mmmmmmmpgC..Bgo", -- 9 + "mmmmmmmpgC..Bgo", -- 10 + "mmmmmmmpgC..Bgo", -- 11 + "mmmmmmmpgC..Bgo", -- 12 + "mmmmmmmpgCDDBgo", -- 13 + "mmmmmmmpggggggo", -- 14 + "mmmmmmmpkkkkkkk", -- 15 + + -- Level 6 + "...............", -- 0 + ".pnnnnnnnnnnno.", -- 1 + ".pgggggggggggo.", -- 2 + ".pgggggggggggo.", -- 3 + ".pgggggggggggo.", -- 4 + ".pgggggggggggo.", -- 5 + ".pgggggggggggo.", -- 6 + ".pkkkkkkkggggo.", -- 7 + "........pggggo.", -- 8 + "mmmmmmm.pggggo.", -- 9 + "mmmmmmm.pggggo.", -- 10 + "mmmmmmm.pggggo.", -- 11 + "mmmmmmm.pggggo.", -- 12 + "mmmmmmm.pggggo.", -- 13 + "mmmmmmm.kkkkko.", -- 14 + "mmmmmmm........", -- 15 + + -- Level 7 + "...............", -- 0 + "...............", -- 1 + "..nnnnnnnnnnn..", -- 2 + "..pgggggggggo..", -- 3 + "..pgggggggggo..", -- 4 + "..pgggggggggo..", -- 5 + "..kkkkkkkkggo..", -- 6 + ".........pggo..", -- 7 + ".........pggo..", -- 8 + "mmmmmmm..pggo..", -- 9 + "mmmmmmm..pggo..", -- 10 + "mmmmmmm..pggo..", -- 11 + "mmmmmmm..pggo..", -- 12 + "mmmmmmm..kkko..", -- 13 + "mmmmmmm........", -- 14 + "mmmmmmm........", -- 15 + + -- Level 8 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "...pnnnnnnno...", -- 3 + "...pgggggggo...", -- 4 + "...pkkkkkkpo...", -- 5 + "..........po...", -- 6 + "..........po...", -- 7 + "..........po...", -- 8 + "mmmmmmm...po...", -- 9 + "mmmmmmm...po...", -- 10 + "mmmmmmm...po...", -- 11 + "mmmmmmm...pk...", -- 12 + "mmmmmmm........", -- 13 + "mmmmmmm........", -- 14 + "mmmmmmm........", -- 15 + + }, + }, -- WoodenHouseL13x14 + + + + { + OriginData = + { + ExportName = "WoodenHouse7x5", + Name = "Plains 40", + GalleryName = "Plains", + GalleryIndex = "40", + ID = "91", + CreatorName = "xoft", + }, + Size = + { + x = 9, + y = 7, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 9, + MaxY = 6, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 4, + RelY = 1, + RelZ = -1, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 64: 3", -- wooddoorblock + "h:102: 0", -- glasspane + "i: 64: 9", -- wooddoorblock + "j: 53: 2", -- woodstairs + "k: 53: 7", -- woodstairs + "l: 50: 3", -- torch + "m: 19: 0", -- sponge + "n: 53: 6", -- woodstairs + "o: 53: 3", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmmaaammm", -- 0 + "maaaaaaam", -- 1 + "maaaaaaam", -- 2 + "maaaaaaam", -- 3 + "maaaaaaam", -- 4 + "maaaaaaam", -- 5 + "mmmmmmmmm", -- 6 + + -- Level 1 + "...bcd...", -- 0 + ".aaaaaaa.", -- 1 + ".aaaaaaa.", -- 2 + ".aaaaaaa.", -- 3 + ".aaaaaaa.", -- 4 + ".aaaaaaa.", -- 5 + ".........", -- 6 + + -- Level 2 + ".........", -- 0 + ".effgffe.", -- 1 + ".f.....f.", -- 2 + ".f.....f.", -- 3 + ".f.....f.", -- 4 + ".efffffe.", -- 5 + ".........", -- 6 + + -- Level 3 + ".........", -- 0 + ".ehfifhe.", -- 1 + ".h.....h.", -- 2 + ".h.....h.", -- 3 + ".h.....h.", -- 4 + ".ehhfhhe.", -- 5 + ".........", -- 6 + + -- Level 4 + "jjjjjjjjj", -- 0 + "kefffffek", -- 1 + ".f.l.l.f.", -- 2 + ".f.....f.", -- 3 + ".f.....f.", -- 4 + "nefffffen", -- 5 + "ooooooooo", -- 6 + + -- Level 5 + ".........", -- 0 + "jjjjjjjjj", -- 1 + "kfffffffk", -- 2 + ".f.....f.", -- 3 + "nfffffffn", -- 4 + "ooooooooo", -- 5 + ".........", -- 6 + + -- Level 6 + ".........", -- 0 + ".........", -- 1 + "jjjjjjjjj", -- 2 + "fffffffff", -- 3 + "ooooooooo", -- 4 + ".........", -- 5 + ".........", -- 6 + + }, + }, -- WoodenHouse7x5 + + + + { + OriginData = + { + ExportName = "WoodenHouse9x5", + Name = "Plains 41", + GalleryName = "Plains", + GalleryIndex = "41", + ID = "92", + CreatorName = "xoft", + }, + Size = + { + x = 11, + y = 7, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 11, + MaxY = 6, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = -1, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 64: 3", -- wooddoorblock + "h:102: 0", -- glasspane + "i: 64: 9", -- wooddoorblock + "j: 53: 2", -- woodstairs + "k: 53: 7", -- woodstairs + "l: 50: 3", -- torch + "m: 19: 0", -- sponge + "n: 53: 6", -- woodstairs + "o: 53: 3", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "mmmmmmmmmmm", -- 6 + + -- Level 1 + "....bcd....", -- 0 + ".aaaaaaaaa.", -- 1 + ".aaaaaaaaa.", -- 2 + ".aaaaaaaaa.", -- 3 + ".aaaaaaaaa.", -- 4 + ".aaaaaaaaa.", -- 5 + "...........", -- 6 + + -- Level 2 + "...........", -- 0 + ".efffgfffe.", -- 1 + ".f.......f.", -- 2 + ".f.......f.", -- 3 + ".f.......f.", -- 4 + ".efffffffe.", -- 5 + "...........", -- 6 + + -- Level 3 + "...........", -- 0 + ".ehhfifhhe.", -- 1 + ".h.......h.", -- 2 + ".h.......h.", -- 3 + ".h.......h.", -- 4 + ".ehhhfhhhe.", -- 5 + "...........", -- 6 + + -- Level 4 + "jjjjjjjjjjj", -- 0 + "kfffffffffk", -- 1 + ".f..l.l.ff.", -- 2 + ".f......ff.", -- 3 + ".f......ff.", -- 4 + "nfffffffffn", -- 5 + "ooooooooooo", -- 6 + + -- Level 5 + "...........", -- 0 + "jjjjjjjjjjj", -- 1 + "kfffffffffk", -- 2 + ".fffffffff.", -- 3 + "nfffffffffn", -- 4 + "ooooooooooo", -- 5 + "...........", -- 6 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "jjjjjjjjjjj", -- 2 + "fffffffffff", -- 3 + "ooooooooooo", -- 4 + "...........", -- 5 + "...........", -- 6 + + }, + }, -- WoodenHouse9x5 + + + + { + OriginData = + { + ExportName = "WoodenHouseL9x9", + Name = "Plains 42", + GalleryName = "Plains", + GalleryIndex = "42", + ID = "93", + CreatorName = "xoft", + }, + Size = + { + x = 11, + y = 7, + z = 11, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 11, + MaxY = 6, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 64: 3", -- wooddoorblock + "h:102: 0", -- glasspane + "i: 64: 9", -- wooddoorblock + "j: 53: 2", -- woodstairs + "k: 53: 7", -- woodstairs + "l: 53: 1", -- woodstairs + "m: 19: 0", -- sponge + "n: 50: 3", -- torch + "o: 50: 4", -- torch + "p: 53: 6", -- woodstairs + "q: 50: 1", -- torch + "r: 50: 2", -- torch + "s: 53: 3", -- woodstairs + "t: 53: 0", -- woodstairs + "u: 53: 5", -- woodstairs + "v: 53: 4", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "mmmmmaaaaam", -- 6 + "mmmmmaaaaam", -- 7 + "mmmmmaaaaam", -- 8 + "mmmmmaaaaam", -- 9 + "mmmmmmmmmmm", -- 10 + + -- Level 1 + "....bcd....", -- 0 + ".aaaaaaaaa.", -- 1 + ".aaaaaaaaa.", -- 2 + ".aaaaaaaaa.", -- 3 + ".aaaaaaaaa.", -- 4 + ".aaaaaaaaa.", -- 5 + ".....aaaaa.", -- 6 + "mmmm.aaaaa.", -- 7 + "mmmm.aaaaa.", -- 8 + "mmmm.aaaaa.", -- 9 + "mmmm.......", -- 10 + + -- Level 2 + "...........", -- 0 + ".efffgfffe.", -- 1 + ".f.......f.", -- 2 + ".f.......f.", -- 3 + ".f.......f.", -- 4 + ".efffe...f.", -- 5 + ".....f...f.", -- 6 + "mmmm.f...f.", -- 7 + "mmmm.f...f.", -- 8 + "mmmm.efffe.", -- 9 + "mmmm.......", -- 10 + + -- Level 3 + "...........", -- 0 + ".ehhfifhhe.", -- 1 + ".h.......h.", -- 2 + ".h.......h.", -- 3 + ".h.......h.", -- 4 + ".ehhhe...f.", -- 5 + ".....h...h.", -- 6 + "mmmm.h...h.", -- 7 + "mmmm.h...h.", -- 8 + "mmmm.ehhhe.", -- 9 + "mmmm.......", -- 10 + + -- Level 4 + "jjjjjjjjjjj", -- 0 + "kfffffffffl", -- 1 + ".f..n.n..fl", -- 2 + ".f.......fl", -- 3 + ".f...o...fl", -- 4 + "pfffffq.rfl", -- 5 + "sssssf...fl", -- 6 + "mmmmtf...fl", -- 7 + "mmmmtf...fl", -- 8 + "mmmmtfffffl", -- 9 + "mmmmtu...vl", -- 10 + + -- Level 5 + "...........", -- 0 + "jjjjjjjjjl.", -- 1 + "kffffffffl.", -- 2 + ".f......fl.", -- 3 + "pffffff.fl.", -- 4 + "ssssssf.fl.", -- 5 + ".....tf.fl.", -- 6 + "mmmm.tf.fl.", -- 7 + "mmmm.tf.fl.", -- 8 + "mmmm.tfffl.", -- 9 + "mmmm.tu.vl.", -- 10 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "jjjjjjjjj..", -- 2 + "ffffffffl..", -- 3 + "sssssstfl..", -- 4 + "......tfl..", -- 5 + "......tfl..", -- 6 + "mmmm..tfl..", -- 7 + "mmmm..tfl..", -- 8 + "mmmm..tfl..", -- 9 + "mmmm..tfl..", -- 10 + + }, + }, -- WoodenHouseL9x9 + + + + { + OriginData = + { + ExportName = "WoodenHouseU13x9", + Name = "Plains 43", + GalleryName = "Plains", + GalleryIndex = "43", + ID = "94", + CreatorName = "xoft", + }, + Size = + { + x = 15, + y = 7, + z = 11, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 15, + MaxY = 6, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 7, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 64: 3", -- wooddoorblock + "h:102: 0", -- glasspane + "i: 64: 9", -- wooddoorblock + "j: 53: 2", -- woodstairs + "k: 53: 0", -- woodstairs + "l: 53: 1", -- woodstairs + "m: 19: 0", -- sponge + "n: 50: 3", -- torch + "o: 50: 4", -- torch + "p: 50: 2", -- torch + "q: 50: 1", -- torch + "r: 53: 3", -- woodstairs + "s: 53: 5", -- woodstairs + "t: 53: 4", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmmmmmaaammmmmm", -- 0 + "maaaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaaam", -- 3 + "maaaaaaaaaaaaam", -- 4 + "maaaaaaaaaaaaam", -- 5 + "maaaaammmaaaaam", -- 6 + "maaaaammmaaaaam", -- 7 + "maaaaammmaaaaam", -- 8 + "maaaaammmaaaaam", -- 9 + "mmmmmmmmmmmmmmm", -- 10 + + -- Level 1 + "......bcd......", -- 0 + ".aaaaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaaaa.", -- 5 + ".aaaaa...aaaaa.", -- 6 + ".aaaaa...aaaaa.", -- 7 + ".aaaaa...aaaaa.", -- 8 + ".aaaaa...aaaaa.", -- 9 + "...............", -- 10 + + -- Level 2 + "...............", -- 0 + ".efffffgfffffe.", -- 1 + ".f...........f.", -- 2 + ".f...........f.", -- 3 + ".f...........f.", -- 4 + ".f...efffe...f.", -- 5 + ".f...f...f...f.", -- 6 + ".f...f...f...f.", -- 7 + ".f...f...f...f.", -- 8 + ".efffe...efffe.", -- 9 + "...............", -- 10 + + -- Level 3 + "...............", -- 0 + ".ehhhhfifhhhhe.", -- 1 + ".h...........h.", -- 2 + ".h...........h.", -- 3 + ".h...........h.", -- 4 + ".f...ehhhe...f.", -- 5 + ".h...h...h...h.", -- 6 + ".h...h...h...h.", -- 7 + ".h...h...h...h.", -- 8 + ".ehhhe...ehhhe.", -- 9 + "...............", -- 10 + + -- Level 4 + "jjjjjjjjjjjjjjj", -- 0 + "kfffffffffffffl", -- 1 + "kf....n.n....fl", -- 2 + "kf...........fl", -- 3 + "kf...o...o...fl", -- 4 + "kf..pfffffq..fl", -- 5 + "kf...frrrf...fl", -- 6 + "kf...fl.kf...fl", -- 7 + "kf...fl.kf...fl", -- 8 + "kfffffl.kfffffl", -- 9 + "ks...tl.ks...tl", -- 10 + + -- Level 5 + "...............", -- 0 + ".jjjjjjjjjjjjl.", -- 1 + ".kfffffffffffl.", -- 2 + ".kfffffffffffl.", -- 3 + ".kfffffffffffl.", -- 4 + ".kffflrrrrfffl.", -- 5 + ".kfffl...kfffl.", -- 6 + ".kfffl...kfffl.", -- 7 + ".kfffl...kfffl.", -- 8 + ".kfffl...kfffl.", -- 9 + ".ks.tl...ks.tl.", -- 10 + + -- Level 6 + "...............", -- 0 + "...............", -- 1 + "..kjjjjjjjjjj..", -- 2 + "..kfffffffffl..", -- 3 + "..kflrrrrrkfl..", -- 4 + "..kfl.....kfl..", -- 5 + "..kfl.....kfl..", -- 6 + "..kfl.....kfl..", -- 7 + "..kfl.....kfl..", -- 8 + "..kfl.....kfl..", -- 9 + "..kfl.....kfl..", -- 10 + + }, + }, -- WoodenHouseU13x9 + + + + { + OriginData = + { + ExportName = "WoodenHouse9x5Library", + Name = "Plains 46", + GalleryName = "Plains", + GalleryIndex = "46", + ID = "97", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 7, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 11, + MaxY = 6, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 64: 3", -- wooddoorblock + "h: 53: 3", -- woodstairs + "i: 85: 0", -- fence + "j: 53: 2", -- woodstairs + "k: 53: 1", -- woodstairs + "l: 53: 0", -- woodstairs + "m: 19: 0", -- sponge + "n:102: 0", -- glasspane + "o: 64: 9", -- wooddoorblock + "p: 50: 3", -- torch + "q: 72: 0", -- woodplate + "r: 53: 7", -- woodstairs + "s: 47: 0", -- bookshelf + "t: 50: 1", -- torch + "u: 50: 2", -- torch + "v: 53: 6", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "mmmmmmmmmmm", -- 6 + + -- Level 1 + "....bcd....", -- 0 + ".aaaaaaaaa.", -- 1 + ".aaaaaaaaa.", -- 2 + ".aaaaaaaaa.", -- 3 + ".aaaaaaaaa.", -- 4 + ".aaaaaaaaa.", -- 5 + "...........", -- 6 + + -- Level 2 + "...........", -- 0 + ".efffgfffe.", -- 1 + ".fh.....hf.", -- 2 + ".fi.....if.", -- 3 + ".fj.kil.jf.", -- 4 + ".efffffffe.", -- 5 + "...........", -- 6 + + -- Level 3 + "...........", -- 0 + ".ennfofnne.", -- 1 + ".n..p.p..n.", -- 2 + ".nq.....qn.", -- 3 + ".n...q...n.", -- 4 + ".ennnfnnne.", -- 5 + "...........", -- 6 + + -- Level 4 + "jjjjjjjjjjj", -- 0 + "rfffffffffr", -- 1 + ".fsssssssf.", -- 2 + ".ft.....uf.", -- 3 + ".fsssssssf.", -- 4 + "vfffffffffv", -- 5 + "hhhhhhhhhhh", -- 6 + + -- Level 5 + "...........", -- 0 + "jjjjjjjjjjj", -- 1 + "rfffffffffr", -- 2 + ".f.......f.", -- 3 + "vfffffffffv", -- 4 + "hhhhhhhhhhh", -- 5 + "...........", -- 6 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "jjjjjjjjjjj", -- 2 + "fffffffffff", -- 3 + "hhhhhhhhhhh", -- 4 + "...........", -- 5 + "...........", -- 6 + + }, + }, -- WoodenHouse9x5Library + + + + { + OriginData = + { + ExportName = "WoodenHouse10x7Library", + Name = "Plains 47", + GalleryName = "Plains", + GalleryIndex = "47", + ID = "98", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 12, + y = 8, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 12, + MaxY = 7, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 64: 3", -- wooddoorblock + "h: 53: 3", -- woodstairs + "i: 85: 0", -- fence + "j: 53: 2", -- woodstairs + "k: 53: 1", -- woodstairs + "l: 53: 0", -- woodstairs + "m: 19: 0", -- sponge + "n:102: 0", -- glasspane + "o: 64: 8", -- wooddoorblock + "p: 64: 9", -- wooddoorblock + "q: 50: 3", -- torch + "r: 72: 0", -- woodplate + "s: 53: 7", -- woodstairs + "t: 47: 0", -- bookshelf + "u: 50: 1", -- torch + "v: 50: 2", -- torch + "w: 53: 6", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmmmaaaammmm", -- 0 + "maaaaaaaaaam", -- 1 + "maaaaaaaaaam", -- 2 + "maaaaaaaaaam", -- 3 + "maaaaaaaaaam", -- 4 + "maaaaaaaaaam", -- 5 + "maaaaaaaaaam", -- 6 + "maaaaaaaaaam", -- 7 + "mmmmmmmmmmmm", -- 8 + + -- Level 1 + "....bccd....", -- 0 + ".aaaaaaaaaa.", -- 1 + ".aaaaaaaaaa.", -- 2 + ".aaaaaaaaaa.", -- 3 + ".aaaaaaaaaa.", -- 4 + ".aaaaaaaaaa.", -- 5 + ".aaaaaaaaaa.", -- 6 + ".aaaaaaaaaa.", -- 7 + "............", -- 8 + + -- Level 2 + "............", -- 0 + ".efffggfffe.", -- 1 + ".f........f.", -- 2 + ".fh......hf.", -- 3 + ".fi......if.", -- 4 + ".fj......jf.", -- 5 + ".f.kilkil.f.", -- 6 + ".effffffffe.", -- 7 + "............", -- 8 + + -- Level 3 + "............", -- 0 + ".ennfopfnne.", -- 1 + ".n..q..q..n.", -- 2 + ".n........n.", -- 3 + ".fr......rf.", -- 4 + ".n........n.", -- 5 + ".n..r..r..n.", -- 6 + ".ennfnnfnne.", -- 7 + "............", -- 8 + + -- Level 4 + "jjjjjjjjjjjj", -- 0 + "sffffffffffs", -- 1 + ".fttttttttf.", -- 2 + ".f........f.", -- 3 + ".fu......vf.", -- 4 + ".f........f.", -- 5 + ".fttttttttf.", -- 6 + "wffffffffffw", -- 7 + "hhhhhhhhhhhh", -- 8 + + -- Level 5 + "............", -- 0 + "jjjjjjjjjjjj", -- 1 + "sffffffffffs", -- 2 + ".fttttttttf.", -- 3 + ".f........f.", -- 4 + ".fttttttttf.", -- 5 + "wffffffffffw", -- 6 + "hhhhhhhhhhhh", -- 7 + "............", -- 8 + + -- Level 6 + "............", -- 0 + "............", -- 1 + "jjjjjjjjjjjj", -- 2 + "sffffffffffs", -- 3 + ".f........f.", -- 4 + "wffffffffffw", -- 5 + "hhhhhhhhhhhh", -- 6 + "............", -- 7 + "............", -- 8 + + -- Level 7 + "............", -- 0 + "............", -- 1 + "............", -- 2 + "jjjjjjjjjjjj", -- 3 + "ffffffffffff", -- 4 + "hhhhhhhhhhhh", -- 5 + "............", -- 6 + "............", -- 7 + "............", -- 8 + + }, + }, -- WoodenHouse10x7Library + + + + { + OriginData = + { + ExportName = "WoodenHouse9x7Butcher", + Name = "Plains 48", + GalleryName = "Plains", + GalleryIndex = "48", + ID = "99", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 8, + z = 13, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 7, + MaxZ = 13, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 3: 0", -- dirt + "c: 67: 0", -- stairs + "d: 67: 2", -- stairs + "e: 67: 1", -- stairs + "f: 43: 0", -- doublestep + "g: 2: 0", -- grass + "h: 17: 0", -- tree + "i: 5: 0", -- planks + "j: 64: 3", -- wooddoorblock + "k: 53: 3", -- woodstairs + "l: 85: 0", -- fence + "m: 19: 0", -- sponge + "n: 53: 2", -- woodstairs + "o: 64: 1", -- wooddoorblock + "p:102: 0", -- glasspane + "q: 64: 9", -- wooddoorblock + "r: 72: 0", -- woodplate + "s: 53: 7", -- woodstairs + "t: 50: 1", -- torch + "u: 50: 2", -- torch + "v: 53: 6", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "maaaaaaaaam", -- 6 + "maaaaaaaaam", -- 7 + "mmbbbbbbbmm", -- 8 + "mmbbbbbbbmm", -- 9 + "mmbbbbbbbmm", -- 10 + "mmbbbbbbbmm", -- 11 + "mmbbbbbbbmm", -- 12 + + -- Level 1 + "....cde....", -- 0 + ".aaaaaaaaa.", -- 1 + ".affffaaaa.", -- 2 + ".affffaaaa.", -- 3 + ".affffaaaa.", -- 4 + ".affffaaaa.", -- 5 + ".affffaaaa.", -- 6 + ".aaaaaaaaa.", -- 7 + "..ggggggg..", -- 8 + "mmgggggggmm", -- 9 + "mmgggggggmm", -- 10 + "mmgggggggmm", -- 11 + "mmgggggggmm", -- 12 + + -- Level 2 + "...........", -- 0 + ".hiiijiiih.", -- 1 + ".i.f....ki.", -- 2 + ".i.f....li.", -- 3 + ".i.f....ni.", -- 4 + ".i.......i.", -- 5 + ".i.......i.", -- 6 + ".hiiioiiih.", -- 7 + "..l.....l..", -- 8 + "mml.....lmm", -- 9 + "mml.....lmm", -- 10 + "mml.....lmm", -- 11 + "mmlllllllmm", -- 12 + + -- Level 3 + "...........", -- 0 + ".hppiqipph.", -- 1 + ".p.......p.", -- 2 + ".p......rp.", -- 3 + ".i.......i.", -- 4 + ".p.......p.", -- 5 + ".p.......p.", -- 6 + ".hppiqipph.", -- 7 + "...........", -- 8 + "mm.......mm", -- 9 + "mm.......mm", -- 10 + "mm.......mm", -- 11 + "mm.......mm", -- 12 + + -- Level 4 + "nnnnnnnnnnn", -- 0 + "siiiiiiiiis", -- 1 + ".i.......i.", -- 2 + ".i.......i.", -- 3 + ".it.....ui.", -- 4 + ".i.......i.", -- 5 + ".i.......i.", -- 6 + "viiiiiiiiiv", -- 7 + "kkkkkkkkkkk", -- 8 + "mm.......mm", -- 9 + "mm.......mm", -- 10 + "mm.......mm", -- 11 + "mm.......mm", -- 12 + + -- Level 5 + "...........", -- 0 + "nnnnnnnnnnn", -- 1 + "siiiiiiiiis", -- 2 + ".i.......i.", -- 3 + ".i.......i.", -- 4 + ".i.......i.", -- 5 + "viiiiiiiiiv", -- 6 + "kkkkkkkkkkk", -- 7 + "...........", -- 8 + "mm.......mm", -- 9 + "mm.......mm", -- 10 + "mm.......mm", -- 11 + "mm.......mm", -- 12 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "nnnnnnnnnnn", -- 2 + "siiiiiiiiis", -- 3 + ".i.......i.", -- 4 + "viiiiiiiiiv", -- 5 + "kkkkkkkkkkk", -- 6 + "...........", -- 7 + "...........", -- 8 + "mm.......mm", -- 9 + "mm.......mm", -- 10 + "mm.......mm", -- 11 + "mm.......mm", -- 12 + + -- Level 7 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "nnnnnnnnnnn", -- 3 + "iiiiiiiiiii", -- 4 + "kkkkkkkkkkk", -- 5 + "...........", -- 6 + "...........", -- 7 + "...........", -- 8 + "mm.......mm", -- 9 + "mm.......mm", -- 10 + "mm.......mm", -- 11 + "mm.......mm", -- 12 + + }, + }, -- WoodenHouse9x7Butcher + + + + { + OriginData = + { + ExportName = "WoodenHouse5x5", + Name = "Plains 49", + GalleryName = "Plains", + GalleryIndex = "49", + ID = "100", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 7, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 7, + MaxY = 6, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 64: 3", -- wooddoorblock + "h: 64: 9", -- wooddoorblock + "i:102: 0", -- glasspane + "j: 53: 2", -- woodstairs + "k: 53: 7", -- woodstairs + "l: 50: 3", -- torch + "m: 19: 0", -- sponge + "n: 53: 6", -- woodstairs + "o: 53: 3", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmaaamm", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "maaaaam", -- 5 + "mmmmmmm", -- 6 + + -- Level 1 + "..bcd..", -- 0 + ".aaaaa.", -- 1 + ".aaaaa.", -- 2 + ".aaaaa.", -- 3 + ".aaaaa.", -- 4 + ".aaaaa.", -- 5 + ".......", -- 6 + + -- Level 2 + ".......", -- 0 + ".efgfe.", -- 1 + ".f...f.", -- 2 + ".f...f.", -- 3 + ".f...f.", -- 4 + ".efffe.", -- 5 + ".......", -- 6 + + -- Level 3 + ".......", -- 0 + ".efhfe.", -- 1 + ".i...i.", -- 2 + ".i...i.", -- 3 + ".i...i.", -- 4 + ".eiiie.", -- 5 + ".......", -- 6 + + -- Level 4 + "jjjjjjj", -- 0 + "kfffffk", -- 1 + ".fl.lf.", -- 2 + ".f...f.", -- 3 + ".f...f.", -- 4 + "nfffffn", -- 5 + "ooooooo", -- 6 + + -- Level 5 + ".......", -- 0 + "jjjjjjj", -- 1 + "kfffffk", -- 2 + ".f...f.", -- 3 + "nfffffn", -- 4 + "ooooooo", -- 5 + ".......", -- 6 + + -- Level 6 + ".......", -- 0 + ".......", -- 1 + "jjjjjjj", -- 2 + "fffffff", -- 3 + "ooooooo", -- 4 + ".......", -- 5 + ".......", -- 6 + + }, + }, -- WoodenHouse5x5 + + + + { + OriginData = + { + ExportName = "Forge", + Name = "Plains 51", + GalleryName = "Plains", + GalleryIndex = "51", + ID = "102", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 12, + y = 9, + z = 11, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 12, + MaxY = 8, + MaxZ = 11, + }, + Connectors = + { + { + Type = -1, + RelX = 7, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 64: 0", -- wooddoorblock + "h: 10: 0", -- lava + "i: 54: 2", -- chest + "j: 61: 2", -- furnace + "k:102: 0", -- glasspane + "l: 64: 9", -- wooddoorblock + "m: 19: 0", -- sponge + "n:139: 0", -- cobblestonewall + "o:101: 0", -- ironbars + "p: 53: 2", -- woodstairs + "q: 53: 7", -- woodstairs + "r: 50: 2", -- torch + "s: 50: 1", -- torch + "t: 53: 6", -- woodstairs + "u: 53: 3", -- woodstairs + "v: 43: 0", -- doublestep + "w: 44: 0", -- step + }, + BlockData = + { + -- Level 0 + "mmmmmaaaaamm", -- 0 + "maaaaaaaaamm", -- 1 + "maaaaaaaaamm", -- 2 + "maaaaaaaaaaa", -- 3 + "maaaaaaaaaaa", -- 4 + "maaaaaaaaaaa", -- 5 + "maaaaaaaaaaa", -- 6 + "maaaaaaaaaaa", -- 7 + "maaaaammmmmm", -- 8 + "maaaaammmmmm", -- 9 + "mmmmmmmmmmmm", -- 10 + + -- Level 1 + ".....bcccd..", -- 0 + ".aaaaaaaad..", -- 1 + ".aaaaaaaad..", -- 2 + ".aaaaaaaaaaa", -- 3 + ".aaaaaaaaaaa", -- 4 + ".aaaaaaaaaaa", -- 5 + ".aaaaaaaaaaa", -- 6 + ".aaaaaaaaaaa", -- 7 + ".aaaaa......", -- 8 + ".aaaaa......", -- 9 + "............", -- 10 + + -- Level 2 + "............", -- 0 + ".efffe......", -- 1 + ".f...g......", -- 2 + ".f...ea..aaa", -- 3 + ".f...f...aha", -- 4 + ".f...f...aha", -- 5 + ".f...fijjaha", -- 6 + ".f...eaaaaaa", -- 7 + ".f...f......", -- 8 + ".efffe......", -- 9 + "............", -- 10 + + -- Level 3 + "............", -- 0 + ".ekkke......", -- 1 + ".k...l......", -- 2 + ".k...en..n.a", -- 3 + ".k...k.....o", -- 4 + ".f...k.....o", -- 5 + ".k...k.....o", -- 6 + ".k...eaooooa", -- 7 + ".k...f......", -- 8 + ".ekkke......", -- 9 + "............", -- 10 + + -- Level 4 + "ppppppp.....", -- 0 + "qfffffq.....", -- 1 + ".f...f......", -- 2 + ".f..rfa..aoa", -- 3 + ".f...f...o.a", -- 4 + ".f...f...o.a", -- 5 + ".fs..f...o.a", -- 6 + ".f...faaaaaa", -- 7 + ".f...f......", -- 8 + "tffffft.....", -- 9 + "uuuuuuu.....", -- 10 + + -- Level 5 + "............", -- 0 + "ppppppp.....", -- 1 + "qfffffq.....", -- 2 + ".f...fvvvvvv", -- 3 + ".f...fvwwwwv", -- 4 + ".f...fvwwwwv", -- 5 + ".f...fvwwwwv", -- 6 + ".f...fvvvvvv", -- 7 + "tffffft.....", -- 8 + "uuuuuuu.....", -- 9 + "............", -- 10 + + -- Level 6 + "............", -- 0 + "............", -- 1 + "ppppppp.....", -- 2 + "qfffffq.....", -- 3 + ".f...f......", -- 4 + ".f...f......", -- 5 + ".f...f......", -- 6 + "tffffft.....", -- 7 + "uuuuuuu.....", -- 8 + "............", -- 9 + "............", -- 10 + + -- Level 7 + "............", -- 0 + "............", -- 1 + "............", -- 2 + "ppppppp.....", -- 3 + "qfffffq.....", -- 4 + ".f...f......", -- 5 + "tffffft.....", -- 6 + "uuuuuuu.....", -- 7 + "............", -- 8 + "............", -- 9 + "............", -- 10 + + -- Level 8 + "............", -- 0 + "............", -- 1 + "............", -- 2 + "............", -- 3 + "ppppppp.....", -- 4 + "fffffff.....", -- 5 + "uuuuuuu.....", -- 6 + "............", -- 7 + "............", -- 8 + "............", -- 9 + "............", -- 10 + + }, + }, -- Forge + + + + { + OriginData = + { + ExportName = "WoodenHouse9x7", + Name = "Plains 52", + GalleryName = "Plains", + GalleryIndex = "52", + ID = "103", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 8, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 11, + MaxY = 7, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 64: 3", -- wooddoorblock + "h:102: 0", -- glasspane + "i: 64: 9", -- wooddoorblock + "j: 53: 2", -- woodstairs + "k: 53: 7", -- woodstairs + "l: 50: 3", -- torch + "m: 19: 0", -- sponge + "n: 50: 4", -- torch + "o: 53: 6", -- woodstairs + "p: 53: 3", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "maaaaaaaaam", -- 6 + "maaaaaaaaam", -- 7 + "mmmmmmmmmmm", -- 8 + + -- Level 1 + "....bcd....", -- 0 + ".aaaaaaaaa.", -- 1 + ".aaaaaaaaa.", -- 2 + ".aaaaaaaaa.", -- 3 + ".aaaaaaaaa.", -- 4 + ".aaaaaaaaa.", -- 5 + ".aaaaaaaaa.", -- 6 + ".aaaaaaaaa.", -- 7 + "...........", -- 8 + + -- Level 2 + "...........", -- 0 + ".efffgfffe.", -- 1 + ".f.......f.", -- 2 + ".f.......f.", -- 3 + ".f.......f.", -- 4 + ".f.......f.", -- 5 + ".f.......f.", -- 6 + ".efffffffe.", -- 7 + "...........", -- 8 + + -- Level 3 + "...........", -- 0 + ".ehhfifhhe.", -- 1 + ".h.......h.", -- 2 + ".h.......h.", -- 3 + ".f.......f.", -- 4 + ".h.......h.", -- 5 + ".h.......h.", -- 6 + ".ehhhfhhhe.", -- 7 + "...........", -- 8 + + -- Level 4 + "jjjjjjjjjjj", -- 0 + "kfffffffffk", -- 1 + ".f..l.l..f.", -- 2 + ".f.......f.", -- 3 + ".f.......f.", -- 4 + ".f.......f.", -- 5 + ".f...n...f.", -- 6 + "offfffffffo", -- 7 + "ppppppppppp", -- 8 + + -- Level 5 + "...........", -- 0 + "jjjjjjjjjjj", -- 1 + "kfffffffffk", -- 2 + ".f.......f.", -- 3 + ".f.......f.", -- 4 + ".f.......f.", -- 5 + "offfffffffo", -- 6 + "ppppppppppp", -- 7 + "...........", -- 8 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "jjjjjjjjjjj", -- 2 + "kfffffffffk", -- 3 + ".f.......f.", -- 4 + "offfffffffo", -- 5 + "ppppppppppp", -- 6 + "...........", -- 7 + "...........", -- 8 + + -- Level 7 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "jjjjjjjjjjj", -- 3 + "fffffffffff", -- 4 + "ppppppppppp", -- 5 + "...........", -- 6 + "...........", -- 7 + "...........", -- 8 + + }, + }, -- WoodenHouse9x7 + + + + { + OriginData = + { + ExportName = "WoodenGranary", + Name = "Plains 54", + GalleryName = "Plains", + GalleryIndex = "54", + ID = "105", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 7, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 7, + MaxY = 6, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = -1, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "20", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b:170: 0", -- haybale + "c: 67: 0", -- stairs + "d: 67: 2", -- stairs + "e: 67: 1", -- stairs + "f: 17: 0", -- tree + "g: 5: 0", -- planks + "h:170: 4", -- haybale + "i:170: 8", -- haybale + "j: 54: 2", -- chest + "k: 50: 4", -- torch + "l: 53: 0", -- woodstairs + "m: 19: 0", -- sponge + "n: 53: 5", -- woodstairs + "o: 53: 4", -- woodstairs + "p: 53: 1", -- woodstairs + }, + BlockData = + { + -- Level 0 + "maaaaam", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "maaaaam", -- 5 + "maaaaam", -- 6 + "maaaaam", -- 7 + "mmmmmmm", -- 8 + + -- Level 1 + "bcddde.", -- 0 + ".aaaaa.", -- 1 + ".aaaaa.", -- 2 + ".aaaaa.", -- 3 + ".aaaaa.", -- 4 + ".aaaaa.", -- 5 + ".aaaaa.", -- 6 + ".aaaaa.", -- 7 + ".......", -- 8 + + -- Level 2 + ".......", -- 0 + ".f..bf.", -- 1 + ".g...g.", -- 2 + ".gb.hg.", -- 3 + ".fihif.", -- 4 + ".gbbbg.", -- 5 + ".gijbg.", -- 6 + ".fgfgf.", -- 7 + ".......", -- 8 + + -- Level 3 + ".k...k.", -- 0 + ".f...f.", -- 1 + ".g...g.", -- 2 + ".g...g.", -- 3 + ".fh..f.", -- 4 + ".ghibg.", -- 5 + ".ghiig.", -- 6 + ".fgfgf.", -- 7 + ".......", -- 8 + + -- Level 4 + "ln...op", -- 0 + "lgggggp", -- 1 + "lg...gp", -- 2 + "lg...gp", -- 3 + "lg...gp", -- 4 + "lgbb.gp", -- 5 + "lgibigp", -- 6 + "lgggggp", -- 7 + "ln...op", -- 8 + + -- Level 5 + ".ln.op.", -- 0 + ".lgggp.", -- 1 + ".lg.gp.", -- 2 + ".lg.gp.", -- 3 + ".lg.gp.", -- 4 + ".lg.gp.", -- 5 + ".lg.gp.", -- 6 + ".lgggp.", -- 7 + ".ln.op.", -- 8 + + -- Level 6 + "..lgp..", -- 0 + "..lgp..", -- 1 + "..lgp..", -- 2 + "..lgp..", -- 3 + "..lgp..", -- 4 + "..lgp..", -- 5 + "..lgp..", -- 6 + "..lgp..", -- 7 + "..lgp..", -- 8 + + }, + }, -- WoodenGranary + + + + { + OriginData = + { + ExportName = "WoodenStables", + Name = "Plains 55", + GalleryName = "Plains", + GalleryIndex = "55", + ID = "106", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 15, + y = 9, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 15, + MaxY = 8, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 7, + RelY = 1, + RelZ = -1, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 3: 0", -- dirt + "f: 17: 0", -- tree + "g:107: 0", -- fencegate + "h:107: 4", -- fencegate + "i: 5: 0", -- planks + "j:107: 6", -- fencegate + "k: 85: 0", -- fence + "l:170: 0", -- haybale + "m: 19: 0", -- sponge + "n:170: 4", -- haybale + "o:170: 8", -- haybale + "p: 50: 1", -- torch + "q: 50: 2", -- torch + "r: 53: 2", -- woodstairs + "s: 53: 7", -- woodstairs + "t: 53: 6", -- woodstairs + "u: 53: 3", -- woodstairs + }, + BlockData = + { + -- Level 0 + "maaaaaaaaaaaaam", -- 0 + "maaaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaaam", -- 3 + "maaaaaaaaaaaaam", -- 4 + "maaaaaaaaaaaaam", -- 5 + "maaaaaaaaaaaaam", -- 6 + "maaaaaaaaaaaaam", -- 7 + "mmmmmmmmmmmmmmm", -- 8 + + -- Level 1 + ".bcccccccccccd.", -- 0 + ".aaaaaaaaaaaaa.", -- 1 + ".aeeeeeeeeeeea.", -- 2 + ".aeeeeeeeeeeea.", -- 3 + ".aeeeeeeeeeeea.", -- 4 + ".aeeeeeeeeeeea.", -- 5 + ".aeeeeeeeeeeea.", -- 6 + ".aaaaaaaaaaaaa.", -- 7 + "...............", -- 8 + + -- Level 2 + "...............", -- 0 + ".fghgighgigjgf.", -- 1 + ".k...k...k...k.", -- 2 + ".k...k...k...k.", -- 3 + ".k...k...k...k.", -- 4 + ".k...k...k...k.", -- 5 + ".kl..k..nko..k.", -- 6 + ".fkkkikkkikkkf.", -- 7 + "...............", -- 8 + + -- Level 3 + "...............", -- 0 + ".f...i...i...f.", -- 1 + "...............", -- 2 + "...............", -- 3 + "...............", -- 4 + "...............", -- 5 + "...............", -- 6 + ".f...i...i...f.", -- 7 + "...............", -- 8 + + -- Level 4 + "...............", -- 0 + ".fp.qip.qip.qf.", -- 1 + "...............", -- 2 + "...............", -- 3 + "...............", -- 4 + "...............", -- 5 + "...............", -- 6 + ".f...i...i...f.", -- 7 + "...............", -- 8 + + -- Level 5 + "rrrrrrrrrrrrrrr", -- 0 + "siiiiiiiiiiiiis", -- 1 + ".i...........i.", -- 2 + ".i...........i.", -- 3 + ".i...........i.", -- 4 + ".i...........i.", -- 5 + ".i...........i.", -- 6 + "tiiiiiiiiiiiiit", -- 7 + "uuuuuuuuuuuuuuu", -- 8 + + -- Level 6 + "...............", -- 0 + "rrrrrrrrrrrrrrr", -- 1 + "siiiiiiiiiiiiis", -- 2 + ".i...........i.", -- 3 + ".i...........i.", -- 4 + ".i...........i.", -- 5 + "tiiiiiiiiiiiiit", -- 6 + "uuuuuuuuuuuuuuu", -- 7 + "...............", -- 8 + + -- Level 7 + "...............", -- 0 + "...............", -- 1 + "rrrrrrrrrrrrrrr", -- 2 + "siiiiiiiiiiiiis", -- 3 + ".i...........i.", -- 4 + "tiiiiiiiiiiiiit", -- 5 + "uuuuuuuuuuuuuuu", -- 6 + "...............", -- 7 + "...............", -- 8 + + -- Level 8 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "rrrrrrrrrrrrrrr", -- 3 + "iiiiiiiiiiiiiii", -- 4 + "uuuuuuuuuuuuuuu", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + + }, + }, -- WoodenStables + + + + { + OriginData = + { + ExportName = "WoodenChurchMid", + Name = "Plains 58", + GalleryName = "Plains", + GalleryIndex = "58", + ID = "109", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 15, + z = 13, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 7, + MaxY = 14, + MaxZ = 13, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "20", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "A: 85: 0", -- fence + "B:126: 8", -- woodenslab + "a: 4: 0", -- cobblestone + "b: 67: 0", -- stairs + "c: 67: 2", -- stairs + "d: 67: 1", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 64: 1", -- wooddoorblock + "h: 65: 3", -- ladder + "i: 53: 3", -- woodstairs + "j: 53: 7", -- woodstairs + "k: 64: 9", -- wooddoorblock + "l:102: 0", -- glasspane + "m: 19: 0", -- sponge + "n: 50: 1", -- torch + "o: 50: 2", -- torch + "p:171:14", -- carpet + "q: 50: 3", -- torch + "r: 53: 2", -- woodstairs + "s: 53: 0", -- woodstairs + "t: 53: 1", -- woodstairs + "u: 53: 5", -- woodstairs + "v: 53: 4", -- woodstairs + "w: 17: 4", -- tree + "x: 17: 8", -- tree + "y: 54: 2", -- chest + "z: 50: 4", -- torch + }, + BlockData = + { + -- Level 0 + "mmaaamm", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "maaaaam", -- 5 + "maaaaam", -- 6 + "maaaaam", -- 7 + "maaaaam", -- 8 + "maaaaam", -- 9 + "maaaaam", -- 10 + "maaaaam", -- 11 + "mmmmmmm", -- 12 + + -- Level 1 + "..bcd..", -- 0 + ".aaaaa.", -- 1 + ".aaaaa.", -- 2 + ".aaaaa.", -- 3 + ".aaaaa.", -- 4 + ".aaaaa.", -- 5 + ".aaaaa.", -- 6 + ".aaaaa.", -- 7 + ".aaaaa.", -- 8 + ".aaaaa.", -- 9 + ".aaaaa.", -- 10 + ".aaaaa.", -- 11 + ".......", -- 12 + + -- Level 2 + ".......", -- 0 + ".efgfe.", -- 1 + ".f..hf.", -- 2 + ".f...f.", -- 3 + ".f...f.", -- 4 + ".ei.ie.", -- 5 + ".f...f.", -- 6 + ".fi.if.", -- 7 + ".f...f.", -- 8 + ".f.j.f.", -- 9 + ".f...f.", -- 10 + ".efffe.", -- 11 + ".......", -- 12 + + -- Level 3 + ".......", -- 0 + ".efkfe.", -- 1 + ".l..hl.", -- 2 + ".l...l.", -- 3 + ".l...l.", -- 4 + ".e...e.", -- 5 + ".l...l.", -- 6 + ".l...l.", -- 7 + ".fn.of.", -- 8 + ".l.p.l.", -- 9 + ".l...l.", -- 10 + ".ellle.", -- 11 + ".......", -- 12 + + -- Level 4 + ".......", -- 0 + ".efffe.", -- 1 + ".f.qhf.", -- 2 + ".f...f.", -- 3 + ".f...f.", -- 4 + "re...er", -- 5 + "sf...ft", -- 6 + "sf...ft", -- 7 + "sf...ft", -- 8 + "sf...ft", -- 9 + "sf...ft", -- 10 + "sefffet", -- 11 + "su...vt", -- 12 + + -- Level 5 + ".......", -- 0 + ".ewwwe.", -- 1 + ".xffhx.", -- 2 + ".xfffx.", -- 3 + ".xfffx.", -- 4 + ".ewwwe.", -- 5 + ".sf.ft.", -- 6 + ".sf.ft.", -- 7 + ".sf.ft.", -- 8 + ".sf.ft.", -- 9 + ".sf.ft.", -- 10 + ".sffft.", -- 11 + ".su.vt.", -- 12 + + -- Level 6 + ".......", -- 0 + ".eflfe.", -- 1 + ".f..hf.", -- 2 + ".f...f.", -- 3 + ".f.y.f.", -- 4 + ".efffe.", -- 5 + "..sft..", -- 6 + "..sft..", -- 7 + "..sft..", -- 8 + "..sft..", -- 9 + "..sft..", -- 10 + "..sft..", -- 11 + "..sft..", -- 12 + + -- Level 7 + ".......", -- 0 + ".eflfe.", -- 1 + ".f..hf.", -- 2 + ".l...l.", -- 3 + ".f...f.", -- 4 + ".efffe.", -- 5 + ".......", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + ".......", -- 11 + ".......", -- 12 + + -- Level 8 + ".......", -- 0 + ".eflfe.", -- 1 + ".f..hf.", -- 2 + ".f...f.", -- 3 + ".f.z.f.", -- 4 + ".efffe.", -- 5 + ".......", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + ".......", -- 11 + ".......", -- 12 + + -- Level 9 + ".......", -- 0 + ".ewwwe.", -- 1 + ".xffhx.", -- 2 + ".xfffx.", -- 3 + ".xfffx.", -- 4 + ".ewwwe.", -- 5 + ".......", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + ".......", -- 11 + ".......", -- 12 + + -- Level 10 + ".......", -- 0 + ".eAAAe.", -- 1 + ".A...A.", -- 2 + ".A...A.", -- 3 + ".A...A.", -- 4 + ".eAAAe.", -- 5 + ".......", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + ".......", -- 11 + ".......", -- 12 + + -- Level 11 + ".......", -- 0 + ".e...e.", -- 1 + ".......", -- 2 + ".......", -- 3 + ".......", -- 4 + ".e...e.", -- 5 + ".......", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + ".......", -- 11 + ".......", -- 12 + + -- Level 12 + "su...vt", -- 0 + "sefffet", -- 1 + "sfBBBft", -- 2 + "sfBBBft", -- 3 + "sfBBBft", -- 4 + "sefffet", -- 5 + "su...vt", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + ".......", -- 11 + ".......", -- 12 + + -- Level 13 + ".su.vt.", -- 0 + ".sffft.", -- 1 + ".sffft.", -- 2 + ".sffft.", -- 3 + ".sffft.", -- 4 + ".sffft.", -- 5 + ".su.vt.", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + ".......", -- 11 + ".......", -- 12 + + -- Level 14 + "..sft..", -- 0 + "..sft..", -- 1 + "..sft..", -- 2 + "..sft..", -- 3 + "..sft..", -- 4 + "..sft..", -- 5 + "..sft..", -- 6 + ".......", -- 7 + ".......", -- 8 + ".......", -- 9 + ".......", -- 10 + ".......", -- 11 + ".......", -- 12 + + }, + }, -- WoodenChurchMid + + + + { + OriginData = + { + ExportName = "WoodenMill5x5", + Name = "Plains 60", + GalleryName = "Plains", + GalleryIndex = "60", + ID = "111", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 9, + y = 17, + z = 13, + }, + Hitbox = + { + MinX = -1, + MinY = -1, + MinZ = 0, + MaxX = 8, + MaxY = 16, + MaxZ = 12, + }, + Connectors = + { + { + Type = -1, + RelX = 8, + RelY = 1, + RelZ = 6, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 4: 0", -- cobblestone + "b: 67: 2", -- stairs + "c: 67: 1", -- stairs + "d: 67: 3", -- stairs + "e: 17: 0", -- tree + "f: 5: 0", -- planks + "g: 54: 4", -- chest + "h:154: 4", -- hopper + "i: 64: 0", -- wooddoorblock + "j:102: 0", -- glasspane + "k: 85: 0", -- fence + "l: 64: 9", -- wooddoorblock + "m: 19: 0", -- sponge + "n: 50: 2", -- torch + "o: 35: 0", -- wool + "p: 17: 4", -- tree + "q: 17: 8", -- tree + "r: 53: 2", -- woodstairs + "s: 53: 7", -- woodstairs + "t: 53: 6", -- woodstairs + "u: 53: 3", -- woodstairs + }, + BlockData = + { + -- Level 0 + "mmmmmmmmm", -- 0 + "mmmmmmmmm", -- 1 + "mmmmmmmmm", -- 2 + "mmmmmmmmm", -- 3 + "maaaaammm", -- 4 + "maaaaaamm", -- 5 + "maaaaaamm", -- 6 + "maaaaaamm", -- 7 + "maaaaammm", -- 8 + "mmmmmmmmm", -- 9 + "mmmmmmmmm", -- 10 + "mmmmmmmmm", -- 11 + "mmmmmmmmm", -- 12 + + -- Level 1 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + ".aaaaa...", -- 4 + ".aaaaab..", -- 5 + ".aaaaac..", -- 6 + ".aaaaad..", -- 7 + ".aaaaa...", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 2 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + ".efffe...", -- 4 + ".f...f...", -- 5 + ".fgh.i...", -- 6 + ".f...f...", -- 7 + ".efffe...", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 3 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + ".ejjje...", -- 4 + ".j...f...", -- 5 + ".j.k.l...", -- 6 + ".j...f...", -- 7 + ".ejjje...", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 4 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + ".efffe...", -- 4 + ".f..nf...", -- 5 + ".f.k.f...", -- 6 + ".f..nf..k", -- 7 + ".efffe..o", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 5 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + ".epppe...", -- 4 + ".q...q...", -- 5 + ".q.k.q...", -- 6 + ".q...q..k", -- 7 + ".epppe..o", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 6 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + ".efffe...", -- 4 + ".f...f...", -- 5 + ".f.k.f..k", -- 6 + ".f...f..o", -- 7 + ".efffe..o", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 7 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + ".ejjje...", -- 4 + ".j...j...", -- 5 + ".j.k.j..k", -- 6 + ".j...j..o", -- 7 + ".ejjje...", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 8 + "mmmmmmm.o", -- 0 + "mmmmmmm.o", -- 1 + "mmmmmmm.o", -- 2 + ".........", -- 3 + ".efffe...", -- 4 + ".f...f..k", -- 5 + ".f.k.f..o", -- 6 + ".f...f..o", -- 7 + ".efffe...", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 9 + "mmmmmmm.k", -- 0 + "mmmmmmm.k", -- 1 + "mmmmmmm.o", -- 2 + "........o", -- 3 + ".epppe..o", -- 4 + ".q...q..k", -- 5 + ".q.k.q..o", -- 6 + ".q...q..k", -- 7 + ".epppe..k", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 10 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm.k", -- 2 + "rrrrrrr.k", -- 3 + "sfffffs.o", -- 4 + ".f...f..o", -- 5 + ".f.kppppp", -- 6 + ".f...f..o", -- 7 + "tffffft.o", -- 8 + "uuuuuuu.k", -- 9 + "mmmmmmm.k", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 11 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + "rrrrrrr.k", -- 4 + "sfffffs.k", -- 5 + ".f...f..o", -- 6 + "tffffft.k", -- 7 + "uuuuuuu.o", -- 8 + "........o", -- 9 + "mmmmmmm.o", -- 10 + "mmmmmmm.k", -- 11 + "mmmmmmm.k", -- 12 + + -- Level 12 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + ".........", -- 4 + "rrrrrrr.o", -- 5 + "fffffff.o", -- 6 + "uuuuuuu.k", -- 7 + ".........", -- 8 + ".........", -- 9 + "mmmmmmm.o", -- 10 + "mmmmmmm.o", -- 11 + "mmmmmmm.o", -- 12 + + -- Level 13 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + ".........", -- 4 + "........o", -- 5 + "........k", -- 6 + ".........", -- 7 + ".........", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 14 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + "........o", -- 4 + "........o", -- 5 + "........k", -- 6 + ".........", -- 7 + ".........", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 15 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + "........o", -- 4 + "........k", -- 5 + ".........", -- 6 + ".........", -- 7 + ".........", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + -- Level 16 + "mmmmmmm..", -- 0 + "mmmmmmm..", -- 1 + "mmmmmmm..", -- 2 + ".........", -- 3 + "........o", -- 4 + "........k", -- 5 + ".........", -- 6 + ".........", -- 7 + ".........", -- 8 + ".........", -- 9 + "mmmmmmm..", -- 10 + "mmmmmmm..", -- 11 + "mmmmmmm..", -- 12 + + }, + }, -- WoodenMill5x5 + + + + { + OriginData = + { + ExportName = "RoofedWell", + Name = "Plains 119", + GalleryName = "Plains", + GalleryIndex = "119", + ID = "271", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 7, + y = 15, + z = 7, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 6, + MaxY = 14, + MaxZ = 6, + }, + Connectors = + { + { + Type = 2, + RelX = 0, + RelY = 9, + RelZ = 3, + Direction = 4, -- X- + }, + { + Type = 2, + RelX = 3, + RelY = 9, + RelZ = 6, + Direction = 3, -- Z+ + }, + { + Type = 2, + RelX = 6, + RelY = 9, + RelZ = 3, + Direction = 5, -- X+ + }, + { + Type = 2, + RelX = 3, + RelY = 9, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["IsStarting"] = "1", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 1: 0", -- stone + "b: 4: 0", -- cobblestone + "c: 8: 0", -- water + "d: 3: 0", -- dirt + "e: 2: 0", -- grass + "f: 13: 0", -- gravel + "g:118: 3", -- cauldronblock + "h: 85: 0", -- fence + "i: 53: 2", -- woodstairs + "j: 53: 7", -- woodstairs + "k: 5: 0", -- planks + "l: 53: 4", -- woodstairs + "m: 19: 0", -- sponge + "n: 53: 5", -- woodstairs + "o: 53: 6", -- woodstairs + "p: 53: 3", -- woodstairs + }, + BlockData = + { + -- Level 0 + "aaaaaaa", -- 0 + "aaaaaaa", -- 1 + "aaaaaaa", -- 2 + "aaaaaaa", -- 3 + "aaaaaaa", -- 4 + "aaaaaaa", -- 5 + "aaaaaaa", -- 6 + + -- Level 1 + "aaaaaaa", -- 0 + "abbbbba", -- 1 + "abcccba", -- 2 + "abcccba", -- 3 + "abcccba", -- 4 + "abbbbba", -- 5 + "aaaaaaa", -- 6 + + -- Level 2 + "aaaaaaa", -- 0 + "abbbbba", -- 1 + "abcccba", -- 2 + "abcccba", -- 3 + "abcccba", -- 4 + "abbbbba", -- 5 + "aaaaaaa", -- 6 + + -- Level 3 + "aaaaaaa", -- 0 + "abbbbba", -- 1 + "abcccba", -- 2 + "abcccba", -- 3 + "abcccba", -- 4 + "abbbbba", -- 5 + "aaaaaaa", -- 6 + + -- Level 4 + "aaaaaaa", -- 0 + "abbbbba", -- 1 + "abcccba", -- 2 + "abcccba", -- 3 + "abcccba", -- 4 + "abbbbba", -- 5 + "aaaaaaa", -- 6 + + -- Level 5 + "ddddddd", -- 0 + "dbbbbbd", -- 1 + "dbcccbd", -- 2 + "dbcccbd", -- 3 + "dbcccbd", -- 4 + "dbbbbbd", -- 5 + "ddddddd", -- 6 + + -- Level 6 + "ddddddd", -- 0 + "dbbbbbd", -- 1 + "dbcccbd", -- 2 + "dbcccbd", -- 3 + "dbcccbd", -- 4 + "dbbbbbd", -- 5 + "ddddddd", -- 6 + + -- Level 7 + "ddddddd", -- 0 + "dbbbbbd", -- 1 + "dbcccbd", -- 2 + "dbcccbd", -- 3 + "dbcccbd", -- 4 + "dbbbbbd", -- 5 + "ddddddd", -- 6 + + -- Level 8 + "eefffee", -- 0 + "ebbbbbe", -- 1 + "fbcccbf", -- 2 + "fbcccbf", -- 3 + "fbcccbf", -- 4 + "ebbbbbe", -- 5 + "eefffee", -- 6 + + -- Level 9 + ".......", -- 0 + ".bbbbb.", -- 1 + ".b...b.", -- 2 + ".b.g.b.", -- 3 + ".b...b.", -- 4 + ".bbbbb.", -- 5 + ".......", -- 6 + + -- Level 10 + ".......", -- 0 + ".h...h.", -- 1 + ".......", -- 2 + "...h...", -- 3 + ".......", -- 4 + ".h...h.", -- 5 + ".......", -- 6 + + -- Level 11 + ".......", -- 0 + ".h...h.", -- 1 + ".......", -- 2 + "...h...", -- 3 + ".......", -- 4 + ".h...h.", -- 5 + ".......", -- 6 + + -- Level 12 + "iiiiiii", -- 0 + "jkjjjkj", -- 1 + ".l...n.", -- 2 + ".l.h.n.", -- 3 + ".l...n.", -- 4 + "okoooko", -- 5 + "ppppppp", -- 6 + + -- Level 13 + ".......", -- 0 + "iiiiiii", -- 1 + "jkjjjkj", -- 2 + ".k.h.k.", -- 3 + "okoooko", -- 4 + "ppppppp", -- 5 + ".......", -- 6 + + -- Level 14 + ".......", -- 0 + ".......", -- 1 + "iiiiiii", -- 2 + "kkkkkkk", -- 3 + "ppppppp", -- 4 + ".......", -- 5 + ".......", -- 6 + + }, + }, -- RoofedWell + + + + { + OriginData = + { + ExportName = "MineEntrance", + Name = "Plains 138", + GalleryName = "Plains", + GalleryIndex = "138", + ID = "446", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 7, + y = 38, + z = 7, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 6, + MaxY = 37, + MaxZ = 6, + }, + Connectors = + { + { + Type = 2, + RelX = 6, + RelY = 32, + RelZ = 3, + Direction = 5, -- X+ + }, + { + Type = 2, + RelX = 3, + RelY = 32, + RelZ = 6, + Direction = 3, -- Z+ + }, + { + Type = 2, + RelX = 0, + RelY = 32, + RelZ = 3, + Direction = 4, -- X- + }, + { + Type = 2, + RelX = 3, + RelY = 32, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 3, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["IsStarting"] = "1", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "0", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 0", -- planks + "b: 77: 2", -- stonebutton + "c: 66: 6", -- tracks + "d: 27: 1", -- poweredrail + "e: 66: 5", -- tracks + "f: 66: 9", -- tracks + "g: 66: 2", -- tracks + "h: 50: 4", -- torch + "i: 66: 4", -- tracks + "j: 66: 8", -- tracks + "k: 66: 3", -- tracks + "l: 66: 7", -- tracks + "m: 19: 0", -- sponge + "n: 50: 2", -- torch + "o: 4: 0", -- cobblestone + "p: 2: 0", -- grass + "q: 13: 0", -- gravel + "r: 53: 2", -- woodstairs + "s: 77: 1", -- stonebutton + "t: 27: 0", -- poweredrail + "u: 53: 7", -- woodstairs + "v: 53: 6", -- woodstairs + "w: 53: 3", -- woodstairs + }, + BlockData = + { + -- Level 0 + "maaaaam", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "maaaaam", -- 5 + "mmmmmmm", -- 6 + + -- Level 1 + "mm...mm", -- 0 + "mm.abam", -- 1 + "mmcddam", -- 2 + "mae..am", -- 3 + "mmaa.mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 2 + "mm...mm", -- 0 + "mm.a.mm", -- 1 + "mm...mm", -- 2 + "ma..aam", -- 3 + "mmfgamm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 3 + "mm.h.mm", -- 0 + "mm.a.mm", -- 1 + "mm.aamm", -- 2 + "ma..iam", -- 3 + "mm..jmm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 4 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmaklmm", -- 2 + "maa..am", -- 3 + "mm...mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 5 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmc..mm", -- 2 + "mae.nam", -- 3 + "mmaa.mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 6 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm...mm", -- 2 + "ma..aam", -- 3 + "mmfgamm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 7 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm.aamm", -- 2 + "ma..iam", -- 3 + "mm..jmm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 8 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmaklmm", -- 2 + "maa..am", -- 3 + "mm...mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 9 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmc..mm", -- 2 + "mae.nam", -- 3 + "mmaa.mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 10 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm...mm", -- 2 + "ma..aam", -- 3 + "mmfgamm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 11 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm.aamm", -- 2 + "ma..iam", -- 3 + "mm..jmm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 12 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmaklmm", -- 2 + "maa..am", -- 3 + "mm...mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 13 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmc..mm", -- 2 + "mae.nam", -- 3 + "mmaa.mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 14 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm...mm", -- 2 + "ma..aam", -- 3 + "mmfgamm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 15 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm.aamm", -- 2 + "ma..iam", -- 3 + "mm..jmm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 16 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmaklmm", -- 2 + "maa..am", -- 3 + "mm...mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 17 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmc..mm", -- 2 + "mae.nam", -- 3 + "mmaa.mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 18 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm...mm", -- 2 + "ma..aam", -- 3 + "mmfgamm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 19 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm.aamm", -- 2 + "ma..iam", -- 3 + "mm..jmm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 20 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmaklmm", -- 2 + "maa..am", -- 3 + "mm...mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 21 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmc..mm", -- 2 + "mae.nam", -- 3 + "mmaa.mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 22 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm...mm", -- 2 + "ma..aam", -- 3 + "mmfgamm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 23 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm.aamm", -- 2 + "ma..iam", -- 3 + "mm..jmm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 24 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmaklmm", -- 2 + "maa..am", -- 3 + "mm...mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 25 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmc..mm", -- 2 + "mae.nam", -- 3 + "mmaa.mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 26 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm...mm", -- 2 + "ma..aam", -- 3 + "mmfgamm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 27 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mm.aamm", -- 2 + "ma..iam", -- 3 + "mm..jmm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 28 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmaklmm", -- 2 + "maa..am", -- 3 + "mm...mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 29 + "mmmmmmm", -- 0 + "mmmammm", -- 1 + "mmc..mm", -- 2 + "mae.nam", -- 3 + "mmaa.mm", -- 4 + "mmmammm", -- 5 + "mmmmmmm", -- 6 + + -- Level 30 + "mmooomm", -- 0 + "mmmammm", -- 1 + "om...mo", -- 2 + "oa..aao", -- 3 + "omfgamo", -- 4 + "mmmammm", -- 5 + "mmooomm", -- 6 + + -- Level 31 + "ppqqqpp", -- 0 + "paaaaap", -- 1 + "qa.aaaq", -- 2 + "qa..iaq", -- 3 + "qa..jaq", -- 4 + "paaaaap", -- 5 + "ppqqqpp", -- 6 + + -- Level 32 + "...r...", -- 0 + ".astba.", -- 1 + "...fl..", -- 2 + ".......", -- 3 + ".......", -- 4 + ".a...a.", -- 5 + ".......", -- 6 + + -- Level 33 + ".......", -- 0 + ".a...a.", -- 1 + ".......", -- 2 + ".......", -- 3 + ".......", -- 4 + ".a...a.", -- 5 + ".......", -- 6 + + -- Level 34 + ".......", -- 0 + ".a...a.", -- 1 + ".......", -- 2 + ".......", -- 3 + ".......", -- 4 + ".a...a.", -- 5 + ".......", -- 6 + + -- Level 35 + "rrrrrrr", -- 0 + "uaaaaau", -- 1 + ".a...a.", -- 2 + ".a...a.", -- 3 + ".a...a.", -- 4 + "vaaaaav", -- 5 + "wwwwwww", -- 6 + + -- Level 36 + ".......", -- 0 + "rrrrrrr", -- 1 + "uaaaaau", -- 2 + ".aaaaa.", -- 3 + "vaaaaav", -- 4 + "wwwwwww", -- 5 + ".......", -- 6 + + -- Level 37 + ".......", -- 0 + ".......", -- 1 + "rrrrrrr", -- 2 + "aaaaaaa", -- 3 + "wwwwwww", -- 4 + ".......", -- 5 + ".......", -- 6 + + }, + }, -- MineEntrance + + + + { + OriginData = + { + ExportName = "MineshaftCorridor", + Name = "Plains 139", + GalleryName = "Plains", + GalleryIndex = "139", + ID = "447", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 10, + y = 4, + z = 3, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 9, + MaxY = 3, + MaxZ = 2, + }, + Connectors = + { + { + Type = -3, + RelX = 0, + RelY = 1, + RelZ = 1, + Direction = 4, -- X- + }, + { + Type = 3, + RelX = 9, + RelY = 1, + RelZ = 1, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "0", + ["MoveToGround"] = "0", + ["AddWeightIfSame"] = "200", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 0", -- planks + "b: 85: 0", -- fence + "c: 66: 1", -- tracks + "d: 50: 2", -- torch + "e: 50: 1", -- torch + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaaaaa", -- 0 + "aaaaaaaaaa", -- 1 + "aaaaaaaaaa", -- 2 + + -- Level 1 + "..b....b..", -- 0 + "cccccccccc", -- 1 + "..b....b..", -- 2 + + -- Level 2 + "..b....b..", -- 0 + "..........", -- 1 + "..b....b..", -- 2 + + -- Level 3 + "..a....a..", -- 0 + ".dae..dae.", -- 1 + "..a....a..", -- 2 + + }, + }, -- MineshaftCorridor + + + + { + OriginData = + { + ExportName = "Scarecrow", + Name = "Plains 150", + GalleryName = "Plains", + GalleryIndex = "150", + ID = "494", + CreatorName = "STR_Warrior", + }, + Size = + { + x = 1, + y = 6, + z = 3, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 0, + MaxY = 5, + MaxZ = 2, + }, + Connectors = + { + { + Type = -1, + RelX = -1, + RelY = 0, + RelZ = 1, + Direction = 4, -- X- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "10", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a:139: 0", -- cobblestonewall + "b: 85: 0", -- fence + "c:126: 4", -- woodenslab + "d: 86: 1", -- pumpkin + "e:139: 1", -- cobblestonewall + "f:163: 4", -- acaciawoodstairs + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + ".", -- 0 + "a", -- 1 + ".", -- 2 + + -- Level 1 + ".", -- 0 + "b", -- 1 + ".", -- 2 + + -- Level 2 + "c", -- 0 + "d", -- 1 + "c", -- 2 + + -- Level 3 + ".", -- 0 + "e", -- 1 + ".", -- 2 + + -- Level 4 + "f", -- 0 + "d", -- 1 + "f", -- 2 + + -- Level 5 + ".", -- 0 + "f", -- 1 + ".", -- 2 + + }, + }, -- Scarecrow + + + + { + OriginData = + { + ExportName = "MineshaftCrossing", + Name = "Plains 171", + GalleryName = "Plains", + GalleryIndex = "171", + ID = "578", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 5, + y = 4, + z = 5, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 4, + MaxY = 3, + MaxZ = 4, + }, + Connectors = + { + { + Type = 3, + RelX = 4, + RelY = 1, + RelZ = 2, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 4, + RelY = 1, + RelZ = 2, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 2, + RelY = 1, + RelZ = 4, + Direction = 3, -- Z+ + }, + { + Type = 3, + RelX = 2, + RelY = 1, + RelZ = 4, + Direction = 3, -- Z+ + }, + { + Type = 3, + RelX = 0, + RelY = 1, + RelZ = 2, + Direction = 4, -- X- + }, + { + Type = -3, + RelX = 0, + RelY = 1, + RelZ = 2, + Direction = 4, -- X- + }, + { + Type = 3, + RelX = 2, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = -3, + RelX = 2, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "0", + ["MoveToGround"] = "0", + ["DefaultWeight"] = "1", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 0", -- planks + "b: 66: 0", -- tracks + "c: 66: 1", -- tracks + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaa", -- 0 + "aaaaa", -- 1 + "aaaaa", -- 2 + "aaaaa", -- 3 + "aaaaa", -- 4 + + -- Level 1 + "m.b.m", -- 0 + ".aba.", -- 1 + "ccccc", -- 2 + ".aba.", -- 3 + "m.b.m", -- 4 + + -- Level 2 + "m...m", -- 0 + ".a.a.", -- 1 + ".....", -- 2 + ".a.a.", -- 3 + "m...m", -- 4 + + -- Level 3 + "m...m", -- 0 + ".a.a.", -- 1 + ".....", -- 2 + ".a.a.", -- 3 + "m...m", -- 4 + + }, + }, -- MineshaftCrossing + + + + { + OriginData = + { + ExportName = "MineshaftDoubleCrossing", + Name = "Plains 172", + GalleryName = "Plains", + GalleryIndex = "172", + ID = "579", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 5, + y = 8, + z = 5, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 4, + MaxY = 7, + MaxZ = 4, + }, + Connectors = + { + { + Type = -3, + RelX = 4, + RelY = 5, + RelZ = 2, + Direction = 5, -- X+ + }, + { + Type = 3, + RelX = 4, + RelY = 5, + RelZ = 2, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 2, + RelY = 1, + RelZ = 4, + Direction = 3, -- Z+ + }, + { + Type = 3, + RelX = 2, + RelY = 1, + RelZ = 4, + Direction = 3, -- Z+ + }, + { + Type = -3, + RelX = 0, + RelY = 1, + RelZ = 2, + Direction = 4, -- X- + }, + { + Type = 3, + RelX = 0, + RelY = 1, + RelZ = 2, + Direction = 4, -- X- + }, + { + Type = -3, + RelX = 2, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 3, + RelX = 2, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = -3, + RelX = 4, + RelY = 1, + RelZ = 2, + Direction = 5, -- X+ + }, + { + Type = 3, + RelX = 4, + RelY = 1, + RelZ = 2, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 2, + RelY = 5, + RelZ = 4, + Direction = 3, -- Z+ + }, + { + Type = 3, + RelX = 2, + RelY = 5, + RelZ = 4, + Direction = 3, -- Z+ + }, + { + Type = -3, + RelX = 0, + RelY = 5, + RelZ = 2, + Direction = 4, -- X- + }, + { + Type = 3, + RelX = 0, + RelY = 5, + RelZ = 2, + Direction = 4, -- X- + }, + { + Type = -3, + RelX = 2, + RelY = 5, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 3, + RelX = 2, + RelY = 5, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "0", + ["MoveToGround"] = "0", + ["DefaultWeight"] = "1", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 0", -- planks + "b: 66: 0", -- tracks + "c: 66: 1", -- tracks + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaa", -- 0 + "aaaaa", -- 1 + "aaaaa", -- 2 + "aaaaa", -- 3 + "aaaaa", -- 4 + + -- Level 1 + "m.b.m", -- 0 + ".aba.", -- 1 + "ccccc", -- 2 + ".aba.", -- 3 + "m.b.m", -- 4 + + -- Level 2 + "m...m", -- 0 + ".a.a.", -- 1 + ".....", -- 2 + ".a.a.", -- 3 + "m...m", -- 4 + + -- Level 3 + "m...m", -- 0 + ".a.a.", -- 1 + ".....", -- 2 + ".a.a.", -- 3 + "m...m", -- 4 + + -- Level 4 + "aaaaa", -- 0 + "aa.aa", -- 1 + "a...a", -- 2 + "aa.aa", -- 3 + "aaaaa", -- 4 + + -- Level 5 + "m...m", -- 0 + ".a.a.", -- 1 + ".....", -- 2 + ".a.a.", -- 3 + "m...m", -- 4 + + -- Level 6 + "m...m", -- 0 + ".a.a.", -- 1 + ".....", -- 2 + ".a.a.", -- 3 + "m...m", -- 4 + + -- Level 7 + "m...m", -- 0 + ".a.a.", -- 1 + ".....", -- 2 + ".a.a.", -- 3 + "m...m", -- 4 + + }, + }, -- MineshaftDoubleCrossing + + + + { + OriginData = + { + ExportName = "MineshaftCrossing", + Name = "Plains 193", + GalleryName = "Plains", + GalleryIndex = "193", + ID = "657", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 4, + z = 11, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 10, + MaxY = 3, + MaxZ = 10, + }, + Connectors = + { + { + Type = 3, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = -3, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 3, + RelX = 0, + RelY = 1, + RelZ = 5, + Direction = 4, -- X- + }, + { + Type = -3, + RelX = 0, + RelY = 1, + RelZ = 5, + Direction = 4, -- X- + }, + { + Type = 3, + RelX = 5, + RelY = 1, + RelZ = 10, + Direction = 3, -- Z+ + }, + { + Type = -3, + RelX = 5, + RelY = 1, + RelZ = 10, + Direction = 3, -- Z+ + }, + { + Type = 3, + RelX = 10, + RelY = 1, + RelZ = 5, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 10, + RelY = 1, + RelZ = 5, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "0", + ["MoveToGround"] = "0", + ["DefaultWeight"] = "10", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 0", -- planks + "b: 66: 0", -- tracks + "c: 85: 0", -- fence + "d: 66: 1", -- tracks + "e: 50: 4", -- torch + "f: 50: 3", -- torch + "g: 50: 2", -- torch + "h: 50: 1", -- torch + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "mmmmaaammmm", -- 1 + "mmmmaaammmm", -- 2 + "mmmmaaammmm", -- 3 + "aaaaaaaaaaa", -- 4 + "aaaaaaaaaaa", -- 5 + "aaaaaaaaaaa", -- 6 + "mmmmaaammmm", -- 7 + "mmmmaaammmm", -- 8 + "mmmmaaammmm", -- 9 + "mmmmaaammmm", -- 10 + + -- Level 1 + "mmmm.b.mmmm", -- 0 + "mmmm.b.mmmm", -- 1 + "mmmmcbcmmmm", -- 2 + "mmmm.b.mmmm", -- 3 + "..c..b..c..", -- 4 + "ddddddddddd", -- 5 + "..c..b..c..", -- 6 + "mmmm.b.mmmm", -- 7 + "mmmmcbcmmmm", -- 8 + "mmmm.b.mmmm", -- 9 + "mmmm.b.mmmm", -- 10 + + -- Level 2 + "mmmm...mmmm", -- 0 + "mmmm...mmmm", -- 1 + "mmmmc.cmmmm", -- 2 + "mmmm...mmmm", -- 3 + "..c.....c..", -- 4 + "...........", -- 5 + "..c.....c..", -- 6 + "mmmm...mmmm", -- 7 + "mmmmc.cmmmm", -- 8 + "mmmm...mmmm", -- 9 + "mmmm...mmmm", -- 10 + + -- Level 3 + "mmmm...mmmm", -- 0 + "mmmm.e.mmmm", -- 1 + "mmmmaaammmm", -- 2 + "mmmm.f.mmmm", -- 3 + "..a.....a..", -- 4 + ".gah...gah.", -- 5 + "..a.....a..", -- 6 + "mmmm.e.mmmm", -- 7 + "mmmmaaammmm", -- 8 + "mmmm.f.mmmm", -- 9 + "mmmm...mmmm", -- 10 + + }, + }, -- MineshaftCrossing + + + + { + OriginData = + { + ExportName = "MineshaftTee", + Name = "Plains 194", + GalleryName = "Plains", + GalleryIndex = "194", + ID = "658", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 4, + z = 7, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 10, + MaxY = 3, + MaxZ = 6, + }, + Connectors = + { + { + Type = 3, + RelX = 0, + RelY = 1, + RelZ = 5, + Direction = 4, -- X- + }, + { + Type = -3, + RelX = 0, + RelY = 1, + RelZ = 5, + Direction = 4, -- X- + }, + { + Type = 3, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = -3, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 3, + RelX = 10, + RelY = 1, + RelZ = 5, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 10, + RelY = 1, + RelZ = 5, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "0", + ["MoveToGround"] = "0", + ["DefaultWeight"] = "20", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 0", -- planks + "b: 66: 0", -- tracks + "c: 85: 0", -- fence + "d: 66: 1", -- tracks + "e: 50: 4", -- torch + "f: 50: 3", -- torch + "g: 50: 2", -- torch + "h: 50: 1", -- torch + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "mmmmaaammmm", -- 1 + "mmmmaaammmm", -- 2 + "mmmmaaammmm", -- 3 + "aaaaaaaaaaa", -- 4 + "aaaaaaaaaaa", -- 5 + "aaaaaaaaaaa", -- 6 + + -- Level 1 + "mmmm.b.mmmm", -- 0 + "mmmm.b.mmmm", -- 1 + "mmmmcbcmmmm", -- 2 + "mmmm.b.mmmm", -- 3 + "..c..b..c..", -- 4 + "ddddddddddd", -- 5 + "..c.....c..", -- 6 + + -- Level 2 + "mmmm...mmmm", -- 0 + "mmmm...mmmm", -- 1 + "mmmmc.cmmmm", -- 2 + "mmmm...mmmm", -- 3 + "..c.....c..", -- 4 + "...........", -- 5 + "..c.....c..", -- 6 + + -- Level 3 + "mmmm...mmmm", -- 0 + "mmmm.e.mmmm", -- 1 + "mmmmaaammmm", -- 2 + "mmmm.f.mmmm", -- 3 + "..a.....a..", -- 4 + ".gah...gah.", -- 5 + "..a.....a..", -- 6 + + }, + }, -- MineshaftTee + + + + { + OriginData = + { + ExportName = "MineshaftStairs", + Name = "Plains 195", + GalleryName = "Plains", + GalleryIndex = "195", + ID = "659", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 8, + z = 3, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 6, + MaxY = 7, + MaxZ = 2, + }, + Connectors = + { + { + Type = 3, + RelX = 0, + RelY = 1, + RelZ = 1, + Direction = 4, -- X- + }, + { + Type = -3, + RelX = 0, + RelY = 1, + RelZ = 1, + Direction = 4, -- X- + }, + { + Type = 3, + RelX = 6, + RelY = 5, + RelZ = 1, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 6, + RelY = 5, + RelZ = 1, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "0", + ["MoveToGround"] = "0", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 0", -- planks + "b: 66: 1", -- tracks + "c: 66: 2", -- tracks + "d: 85: 0", -- fence + "e: 50: 1", -- torch + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaammmm", -- 0 + "aaammmm", -- 1 + "aaammmm", -- 2 + + -- Level 1 + "..aammm", -- 0 + "bcaammm", -- 1 + "..aammm", -- 2 + + -- Level 2 + "...aamm", -- 0 + "..caamm", -- 1 + "...aamm", -- 2 + + -- Level 3 + "...daam", -- 0 + "...caam", -- 1 + "...daam", -- 2 + + -- Level 4 + "m..d.aa", -- 0 + "m...caa", -- 1 + "m..d.aa", -- 2 + + -- Level 5 + "mm.d...", -- 0 + "mm...bb", -- 1 + "mm.d...", -- 2 + + -- Level 6 + "mmmd...", -- 0 + "mmm....", -- 1 + "mmmd...", -- 2 + + -- Level 7 + "mmma...", -- 0 + "mmmae..", -- 1 + "mmma...", -- 2 + + }, + }, -- MineshaftStairs + + + + { + OriginData = + { + ExportName = "MineshaftSpiral", + Name = "Plains 198", + GalleryName = "Plains", + GalleryIndex = "198", + ID = "662", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 12, + z = 7, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 6, + MaxY = 11, + MaxZ = 6, + }, + Connectors = + { + { + Type = 3, + RelX = 1, + RelY = 1, + RelZ = 6, + Direction = 3, -- Z+ + }, + { + Type = -3, + RelX = 1, + RelY = 1, + RelZ = 6, + Direction = 3, -- Z+ + }, + { + Type = 3, + RelX = 0, + RelY = 9, + RelZ = 5, + Direction = 4, -- X- + }, + { + Type = -3, + RelX = 0, + RelY = 9, + RelZ = 5, + Direction = 4, -- X- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "0", + ["MoveToGround"] = "0", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 0", -- planks + "b: 85: 0", -- fence + "c: 66: 4", -- tracks + "d: 66: 0", -- tracks + "e: 66: 6", -- tracks + "f: 66: 2", -- tracks + "g: 50: 1", -- torch + "h: 50: 3", -- torch + "i: 66: 1", -- tracks + "j: 66: 7", -- tracks + "k: 66: 5", -- tracks + "l: 50: 2", -- torch + "m: 19: 0", -- sponge + "n: 66: 3", -- tracks + "o: 66: 8", -- tracks + "p: 50: 4", -- torch + }, + BlockData = + { + -- Level 0 + "mmmmmmm", -- 0 + "mmmmmmm", -- 1 + "mmmmmmm", -- 2 + "aaabmmm", -- 3 + "aaammmm", -- 4 + "aaammmm", -- 5 + "aaammmm", -- 6 + + -- Level 1 + "mmmmmmm", -- 0 + "mmmmmmm", -- 1 + "aaammmm", -- 2 + "aaabmmm", -- 3 + ".c.mmmm", -- 4 + ".d.mmmm", -- 5 + ".d.mmmm", -- 6 + + -- Level 2 + "aaaammm", -- 0 + "aaaammm", -- 1 + "aaaammm", -- 2 + ".c.bmmm", -- 3 + "...mmmm", -- 4 + "...mmmm", -- 5 + "...mmmm", -- 6 + + -- Level 3 + "b..aamm", -- 0 + ".efaamm", -- 1 + ".d.aamm", -- 2 + "...bmmm", -- 3 + "...mmmm", -- 4 + "...mmmm", -- 5 + "...mmmm", -- 6 + + -- Level 4 + "b...aaa", -- 0 + "...faaa", -- 1 + "....aaa", -- 2 + "...baaa", -- 3 + "...mmmm", -- 4 + "mmmmmmm", -- 5 + "mmmmmmm", -- 6 + + -- Level 5 + "ag....b", -- 0 + "h...ij.", -- 1 + ".....k.", -- 2 + "...baaa", -- 3 + "mmmmaaa", -- 4 + "mmmmmmm", -- 5 + "mmmmmmm", -- 6 + + -- Level 6 + "mm....b", -- 0 + "mm.....", -- 1 + "mm.....", -- 2 + "mmmb.k.", -- 3 + "mmmaaaa", -- 4 + "mmmaaaa", -- 5 + "mmmaaaa", -- 6 + + -- Level 7 + "mmm..la", -- 0 + "mmm...h", -- 1 + "mmm....", -- 2 + "mmmb...", -- 3 + "mmaa.d.", -- 4 + "mmaano.", -- 5 + "mmaa..b", -- 6 + + -- Level 8 + "mmmmmmm", -- 0 + "mmmmmmm", -- 1 + "mmmm...", -- 2 + "mmmb...", -- 3 + "aaa....", -- 4 + "aaan...", -- 5 + "aaa...b", -- 6 + + -- Level 9 + "mmmmmmm", -- 0 + "mmmmmmm", -- 1 + "mmmmmmm", -- 2 + "mmmb...", -- 3 + ".......", -- 4 + "iii...p", -- 5 + ".....la", -- 6 + + -- Level 10 + "mmmmmmm", -- 0 + "mmmmmmm", -- 1 + "mmmmmmm", -- 2 + "mmmbmmm", -- 3 + ".....mm", -- 4 + ".....mm", -- 5 + ".....mm", -- 6 + + -- Level 11 + "mmmmmmm", -- 0 + "mmmmmmm", -- 1 + "mmmmmmm", -- 2 + "mmmbmmm", -- 3 + "....mmm", -- 4 + "....mmm", -- 5 + "....mmm", -- 6 + + }, + }, -- MineshaftSpiral + + + + { + OriginData = + { + ExportName = "MineshaftStairsCrossing", + Name = "Plains 199", + GalleryName = "Plains", + GalleryIndex = "199", + ID = "663", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 12, + z = 12, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 10, + MaxY = 11, + MaxZ = 11, + }, + Connectors = + { + { + Type = 3, + RelX = 0, + RelY = 5, + RelZ = 6, + Direction = 4, -- X- + }, + { + Type = -3, + RelX = 0, + RelY = 5, + RelZ = 6, + Direction = 4, -- X- + }, + { + Type = 3, + RelX = 10, + RelY = 5, + RelZ = 6, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 10, + RelY = 5, + RelZ = 6, + Direction = 5, -- X+ + }, + { + Type = 3, + RelX = 5, + RelY = 9, + RelZ = 11, + Direction = 3, -- Z+ + }, + { + Type = -3, + RelX = 5, + RelY = 9, + RelZ = 11, + Direction = 3, -- Z+ + }, + { + Type = 3, + RelX = 5, + RelY = 1, + RelZ = 1, + Direction = 2, -- Z- + }, + { + Type = -3, + RelX = 5, + RelY = 1, + RelZ = 1, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "0", + ["MoveToGround"] = "0", + ["DefaultWeight"] = "30", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 0", -- planks + "b: 66: 0", -- tracks + "c: 66: 5", -- tracks + "d: 85: 0", -- fence + "e: 66: 1", -- tracks + "f: 50: 3", -- torch + "g: 50: 2", -- torch + "h: 50: 1", -- torch + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "mmmmaaammmm", -- 1 + "mmmmaaammmm", -- 2 + "mmmmmmmmmmm", -- 3 + "mmmmmmmmmmm", -- 4 + "mmmmmmmmmmm", -- 5 + "mmmmmmmmmmm", -- 6 + "mmmmmmmmmmm", -- 7 + "mmmmmmmmmmm", -- 8 + "mmmmmmmmmmm", -- 9 + "mmmmmmmmmmm", -- 10 + "mmmmmmmmmmm", -- 11 + + -- Level 1 + "mmmm.b.mmmm", -- 0 + "mmmm.c.mmmm", -- 1 + "mmmmaaammmm", -- 2 + "mmmmaaammmm", -- 3 + "mmmmmmmmmmm", -- 4 + "mmmmmmmmmmm", -- 5 + "mmmmmmmmmmm", -- 6 + "mmmmmmmmmmm", -- 7 + "mmmmmmmmmmm", -- 8 + "mmmmmmmmmmm", -- 9 + "mmmmmmmmmmm", -- 10 + "mmmmmmmmmmm", -- 11 + + -- Level 2 + "mmmm...mmmm", -- 0 + "mmmm...mmmm", -- 1 + "mmmm.c.mmmm", -- 2 + "mmmmaaammmm", -- 3 + "mmmmaaammmm", -- 4 + "mmmmmmmmmmm", -- 5 + "mmmmmmmmmmm", -- 6 + "mmmmmmmmmmm", -- 7 + "mmmmmmmmmmm", -- 8 + "mmmmmmmmmmm", -- 9 + "mmmmmmmmmmm", -- 10 + "mmmmmmmmmmm", -- 11 + + -- Level 3 + "mmmm...mmmm", -- 0 + "mmmm...mmmm", -- 1 + "mmmm...mmmm", -- 2 + "mmmmdcdmmmm", -- 3 + "mmmmaaammmm", -- 4 + "mmmmaaammmm", -- 5 + "mmmmmmmmmmm", -- 6 + "mmmmmmmmmmm", -- 7 + "mmmmmmmmmmm", -- 8 + "mmmmmmmmmmm", -- 9 + "mmmmmmmmmmm", -- 10 + "mmmmmmmmmmm", -- 11 + + -- Level 4 + "mmmmmmmmmmm", -- 0 + "mmmm...mmmm", -- 1 + "mmmm...mmmm", -- 2 + "mmmmd.dmmmm", -- 3 + "mmmm.c.mmmm", -- 4 + "aaaaaaaaaaa", -- 5 + "aaaaaaaaaaa", -- 6 + "aaaaaaaaaaa", -- 7 + "mmmmaaammmm", -- 8 + "mmmmmmmmmmm", -- 9 + "mmmmmmmmmmm", -- 10 + "mmmmmmmmmmm", -- 11 + + -- Level 5 + "mmmmmmmmmmm", -- 0 + "mmmmmmmmmmm", -- 1 + "mmmm...mmmm", -- 2 + "mmmmd.dmmmm", -- 3 + "mmmm...mmmm", -- 4 + "..d..b..d..", -- 5 + "eeeeeeeeeee", -- 6 + "..d..c..d..", -- 7 + "mmmmaaammmm", -- 8 + "mmmmaaammmm", -- 9 + "mmmmmmmmmmm", -- 10 + "mmmmmmmmmmm", -- 11 + + -- Level 6 + "mmmmmmmmmmm", -- 0 + "mmmmmmmmmmm", -- 1 + "mmmmmmmmmmm", -- 2 + "mmmmd.dmmmm", -- 3 + "mmmm...mmmm", -- 4 + "..d.....d..", -- 5 + "...........", -- 6 + "..d.....d..", -- 7 + "mmmm.c.mmmm", -- 8 + "mmmmaaammmm", -- 9 + "mmmmaaammmm", -- 10 + "mmmmmmmmmmm", -- 11 + + -- Level 7 + "mmmmmmmmmmm", -- 0 + "mmmmmmmmmmm", -- 1 + "mmmmmmmmmmm", -- 2 + "mmmmaaammmm", -- 3 + "mmmm.f.mmmm", -- 4 + "..a.....a..", -- 5 + ".gah...gah.", -- 6 + "..a.....a..", -- 7 + "mmmm...mmmm", -- 8 + "mmmmdcdmmmm", -- 9 + "mmmmaaammmm", -- 10 + "mmmmaaammmm", -- 11 + + -- Level 8 + "mmmmmmmmmmm", -- 0 + "mmmmmmmmmmm", -- 1 + "mmmmmmmmmmm", -- 2 + "mmmmmmmmmmm", -- 3 + "mmmmmmmmmmm", -- 4 + "mmmmmmmmmmm", -- 5 + "mmmmmmmmmmm", -- 6 + "mmmm...mmmm", -- 7 + "mmmm...mmmm", -- 8 + "mmmmd.dmmmm", -- 9 + "mmmm.c.mmmm", -- 10 + "mmmmaaammmm", -- 11 + + -- Level 9 + "mmmmmmmmmmm", -- 0 + "mmmmmmmmmmm", -- 1 + "mmmmmmmmmmm", -- 2 + "mmmmmmmmmmm", -- 3 + "mmmmmmmmmmm", -- 4 + "mmmmmmmmmmm", -- 5 + "mmmmmmmmmmm", -- 6 + "mmmmmmmmmmm", -- 7 + "mmmm...mmmm", -- 8 + "mmmmd.dmmmm", -- 9 + "mmmm...mmmm", -- 10 + "mmmm.b.mmmm", -- 11 + + -- Level 10 + "mmmmmmmmmmm", -- 0 + "mmmmmmmmmmm", -- 1 + "mmmmmmmmmmm", -- 2 + "mmmmmmmmmmm", -- 3 + "mmmmmmmmmmm", -- 4 + "mmmmmmmmmmm", -- 5 + "mmmmmmmmmmm", -- 6 + "mmmmmmmmmmm", -- 7 + "mmmmmmmmmmm", -- 8 + "mmmmd.dmmmm", -- 9 + "mmmm...mmmm", -- 10 + "mmmm...mmmm", -- 11 + + -- Level 11 + "mmmmmmmmmmm", -- 0 + "mmmmmmmmmmm", -- 1 + "mmmmmmmmmmm", -- 2 + "mmmmmmmmmmm", -- 3 + "mmmmmmmmmmm", -- 4 + "mmmmmmmmmmm", -- 5 + "mmmmmmmmmmm", -- 6 + "mmmmmmmmmmm", -- 7 + "mmmmmmmmmmm", -- 8 + "mmmmaaammmm", -- 9 + "mmmm.f.mmmm", -- 10 + "mmmm...mmmm", -- 11 + + }, + }, -- MineshaftStairsCrossing + + + + { + OriginData = + { + ExportName = "MineshaftsCorridor5", + Name = "Plains 200", + GalleryName = "Plains", + GalleryIndex = "200", + ID = "664", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 4, + z = 3, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 10, + MaxY = 3, + MaxZ = 2, + }, + Connectors = + { + { + Type = 3, + RelX = 10, + RelY = 1, + RelZ = 1, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 10, + RelY = 1, + RelZ = 1, + Direction = 5, -- X+ + }, + { + Type = -3, + RelX = 0, + RelY = 1, + RelZ = 1, + Direction = 4, -- X- + }, + { + Type = 3, + RelX = 0, + RelY = 1, + RelZ = 1, + Direction = 4, -- X- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "0", + ["MoveToGround"] = "0", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 5: 0", -- planks + "b: 85: 0", -- fence + "c: 66: 1", -- tracks + "d: 50: 2", -- torch + "e: 50: 1", -- torch + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaaaaaa", -- 0 + "aaaaaaaaaaa", -- 1 + "aaaaaaaaaaa", -- 2 + + -- Level 1 + "..b.....b..", -- 0 + "ccccccccccc", -- 1 + "..b.....b..", -- 2 + + -- Level 2 + "..b.....b..", -- 0 + "...........", -- 1 + "..b.....b..", -- 2 + + -- Level 3 + "..a.....a..", -- 0 + ".dae...dae.", -- 1 + "..a.....a..", -- 2 + + }, + }, -- MineshaftsCorridor5 + }, -- Pieces +} + + + + diff --git a/Server/Prefabs/Villages/SandFlatRoofVillage.cubeset b/Server/Prefabs/Villages/SandFlatRoofVillage.cubeset new file mode 100644 index 000000000..cbaac332a --- /dev/null +++ b/Server/Prefabs/Villages/SandFlatRoofVillage.cubeset @@ -0,0 +1,1741 @@ + +-- SandFlatRoofVillage.cubeset + +-- Defines the prefabs in the group SandFlatRoofVillage + +-- NOTE: This file has been generated automatically by GalExport! +-- Any manual changes will be overwritten by the next automatic export! + + + + +Cubeset = +{ + Metadata = + { + CubesetFormatVersion = 1, + ExportDate = "2015-06-20 10:17:05", + ["AllowedBiomes"] = "Desert, DesertM", + ["IntendedUse"] = "Village", + }, + + Pieces = + { + { + OriginData = + { + ExportName = "House5x4", + Name = "Desert 25", + GalleryName = "Desert", + GalleryIndex = "25", + ID = "166", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 6, + z = 6, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 7, + MaxY = 5, + MaxZ = 6, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:171: 0", -- carpet + "g:171:14", -- carpet + "h: 24: 2", -- sandstone + "i: 64: 9", -- wooddoorblock + "j: 50: 3", -- torch + "k:128: 4", -- sandstonestairs + "l:128: 6", -- sandstonestairs + "m: 19: 0", -- sponge + "n:128: 5", -- sandstonestairs + "o:128: 7", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmaaamm", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "mmmmmmm", -- 5 + + -- Level 1 + "..bcd..", -- 0 + ".aaaaa.", -- 1 + ".aaaaa.", -- 2 + ".aaaaa.", -- 3 + ".aaaaa.", -- 4 + ".......", -- 5 + + -- Level 2 + ".......", -- 0 + ".aaeaa.", -- 1 + ".afgfa.", -- 2 + ".afgfa.", -- 3 + ".aaaaa.", -- 4 + ".......", -- 5 + + -- Level 3 + ".......", -- 0 + ".hhihh.", -- 1 + ".h...h.", -- 2 + ".h...h.", -- 3 + ".hh.hh.", -- 4 + ".......", -- 5 + + -- Level 4 + ".......", -- 0 + ".aaaaa.", -- 1 + ".aj.ja.", -- 2 + ".a...a.", -- 3 + ".aaaaa.", -- 4 + ".......", -- 5 + + -- Level 5 + "kllllln", -- 0 + "kaaaaan", -- 1 + "kaaaaan", -- 2 + "kaaaaan", -- 3 + "kaaaaan", -- 4 + "oooooon", -- 5 + + }, + }, -- House5x4 + + + + { + OriginData = + { + ExportName = "House5x5", + Name = "Desert 26", + GalleryName = "Desert", + GalleryIndex = "26", + ID = "167", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 6, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 7, + MaxY = 5, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:171: 0", -- carpet + "g:171:15", -- carpet + "h:171:14", -- carpet + "i: 24: 2", -- sandstone + "j: 64: 9", -- wooddoorblock + "k: 50: 3", -- torch + "l:128: 4", -- sandstonestairs + "m: 19: 0", -- sponge + "n:128: 6", -- sandstonestairs + "o:128: 5", -- sandstonestairs + "p:128: 7", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmaaamm", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "maaaaam", -- 5 + "mmmmmmm", -- 6 + + -- Level 1 + "..bcd..", -- 0 + ".aaaaa.", -- 1 + ".aaaaa.", -- 2 + ".aaaaa.", -- 3 + ".aaaaa.", -- 4 + ".aaaaa.", -- 5 + ".......", -- 6 + + -- Level 2 + ".......", -- 0 + ".aaeaa.", -- 1 + ".afffa.", -- 2 + ".aghga.", -- 3 + ".afffa.", -- 4 + ".aaaaa.", -- 5 + ".......", -- 6 + + -- Level 3 + ".......", -- 0 + ".iijii.", -- 1 + ".i...i.", -- 2 + ".......", -- 3 + ".i...i.", -- 4 + ".ii.ii.", -- 5 + ".......", -- 6 + + -- Level 4 + ".......", -- 0 + ".aaaaa.", -- 1 + ".ak.ka.", -- 2 + ".a...a.", -- 3 + ".a...a.", -- 4 + ".aaaaa.", -- 5 + ".......", -- 6 + + -- Level 5 + "lnnnnno", -- 0 + "laaaaao", -- 1 + "laaaaao", -- 2 + "laaaaao", -- 3 + "laaaaao", -- 4 + "laaaaao", -- 5 + "ppppppo", -- 6 + + }, + }, -- House5x5 + + + + { + OriginData = + { + ExportName = "House7x5", + Name = "Desert 27", + GalleryName = "Desert", + GalleryIndex = "27", + ID = "168", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 9, + y = 6, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 9, + MaxY = 5, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:171:14", -- carpet + "g:171: 0", -- carpet + "h:171:15", -- carpet + "i: 24: 2", -- sandstone + "j: 64: 9", -- wooddoorblock + "k: 50: 3", -- torch + "l:128: 4", -- sandstonestairs + "m: 19: 0", -- sponge + "n:128: 6", -- sandstonestairs + "o:128: 5", -- sandstonestairs + "p:128: 7", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmaaammmm", -- 0 + "maaaaaaam", -- 1 + "maaaaaaam", -- 2 + "maaaaaaam", -- 3 + "maaaaaaam", -- 4 + "maaaaaaam", -- 5 + "mmmmmmmmm", -- 6 + + -- Level 1 + "..bcd....", -- 0 + ".aaaaaaa.", -- 1 + ".aaaaaaa.", -- 2 + ".aaaaaaa.", -- 3 + ".aaaaaaa.", -- 4 + ".aaaaaaa.", -- 5 + ".........", -- 6 + + -- Level 2 + ".........", -- 0 + ".aaeaaaa.", -- 1 + ".afffffa.", -- 2 + ".aghhhga.", -- 3 + ".afffffa.", -- 4 + ".aaaaaaa.", -- 5 + ".........", -- 6 + + -- Level 3 + ".........", -- 0 + ".iiji.ii.", -- 1 + ".i.....i.", -- 2 + ".........", -- 3 + ".i.....i.", -- 4 + ".iii.iii.", -- 5 + ".........", -- 6 + + -- Level 4 + ".........", -- 0 + ".aaaaaaa.", -- 1 + ".ak.k..a.", -- 2 + ".a.....a.", -- 3 + ".a.....a.", -- 4 + ".aaaaaaa.", -- 5 + ".........", -- 6 + + -- Level 5 + "lnnnnnnnn", -- 0 + "laaaaaaao", -- 1 + "laaaaaaao", -- 2 + "laaaaaaao", -- 3 + "laaaaaaao", -- 4 + "laaaaaaao", -- 5 + "ppppppppo", -- 6 + + }, + }, -- House7x5 + + + + { + OriginData = + { + ExportName = "House8x5", + Name = "Desert 28", + GalleryName = "Desert", + GalleryIndex = "28", + ID = "169", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 10, + y = 6, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 10, + MaxY = 5, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:171: 0", -- carpet + "g:171:14", -- carpet + "h:171:15", -- carpet + "i: 24: 2", -- sandstone + "j: 64: 9", -- wooddoorblock + "k: 50: 3", -- torch + "l:128: 4", -- sandstonestairs + "m: 19: 0", -- sponge + "n:128: 6", -- sandstonestairs + "o:128: 5", -- sandstonestairs + "p:128: 7", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmaaammmmm", -- 0 + "maaaaaaaam", -- 1 + "maaaaaaaam", -- 2 + "maaaaaaaam", -- 3 + "maaaaaaaam", -- 4 + "maaaaaaaam", -- 5 + "mmmmmmmmmm", -- 6 + + -- Level 1 + "..bcd.....", -- 0 + ".aaaaaaaa.", -- 1 + ".aaaaaaaa.", -- 2 + ".aaaaaaaa.", -- 3 + ".aaaaaaaa.", -- 4 + ".aaaaaaaa.", -- 5 + "..........", -- 6 + + -- Level 2 + "..........", -- 0 + ".aaeaaaaa.", -- 1 + ".afghhgfa.", -- 2 + ".afhffhfa.", -- 3 + ".afghhgfa.", -- 4 + ".aaaaaaaa.", -- 5 + "..........", -- 6 + + -- Level 3 + "..........", -- 0 + ".iijii.ii.", -- 1 + ".i......i.", -- 2 + "..........", -- 3 + ".i......i.", -- 4 + ".ii.ii.ii.", -- 5 + "..........", -- 6 + + -- Level 4 + "..........", -- 0 + ".aaaaaaaa.", -- 1 + ".ak.k...a.", -- 2 + ".a......a.", -- 3 + ".a......a.", -- 4 + ".aaaaaaaa.", -- 5 + "..........", -- 6 + + -- Level 5 + "lnnnnnnnnn", -- 0 + "laaaaaaaao", -- 1 + "laaaaaaaao", -- 2 + "laaaaaaaao", -- 3 + "laaaaaaaao", -- 4 + "laaaaaaaao", -- 5 + "pppppppppo", -- 6 + + }, + }, -- House8x5 + + + + { + OriginData = + { + ExportName = "House8x7", + Name = "Desert 29", + GalleryName = "Desert", + GalleryIndex = "29", + ID = "170", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 10, + y = 6, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 10, + MaxY = 5, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:171: 0", -- carpet + "g:171:14", -- carpet + "h:171:15", -- carpet + "i: 24: 2", -- sandstone + "j: 64: 9", -- wooddoorblock + "k: 50: 3", -- torch + "l: 50: 1", -- torch + "m: 19: 0", -- sponge + "n: 50: 2", -- torch + "o:128: 4", -- sandstonestairs + "p:128: 6", -- sandstonestairs + "q:128: 5", -- sandstonestairs + "r:128: 7", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmaaammmmm", -- 0 + "maaaaaaaam", -- 1 + "maaaaaaaam", -- 2 + "maaaaaaaam", -- 3 + "maaaaaaaam", -- 4 + "maaaaaaaam", -- 5 + "maaaaaaaam", -- 6 + "maaaaaaaam", -- 7 + "mmmmmmmmmm", -- 8 + + -- Level 1 + "..bcd.....", -- 0 + ".aaaaaaaa.", -- 1 + ".aaaaaaaa.", -- 2 + ".aaaaaaaa.", -- 3 + ".aaaaaaaa.", -- 4 + ".aaaaaaaa.", -- 5 + ".aaaaaaaa.", -- 6 + ".aaaaaaaa.", -- 7 + "..........", -- 8 + + -- Level 2 + "..........", -- 0 + ".aaeaaaaa.", -- 1 + ".afghhgfa.", -- 2 + ".afhffhfa.", -- 3 + ".afhgghfa.", -- 4 + ".afhffhfa.", -- 5 + ".afghhgfa.", -- 6 + ".aaaaaaaa.", -- 7 + "..........", -- 8 + + -- Level 3 + "..........", -- 0 + ".iijii.ii.", -- 1 + ".i......i.", -- 2 + ".i......i.", -- 3 + "..........", -- 4 + ".i......i.", -- 5 + ".i......i.", -- 6 + ".ii.ii.ii.", -- 7 + "..........", -- 8 + + -- Level 4 + "..........", -- 0 + ".aaaaaaaa.", -- 1 + ".a..k...a.", -- 2 + ".a......a.", -- 3 + ".al....na.", -- 4 + ".a......a.", -- 5 + ".a......a.", -- 6 + ".aaaaaaaa.", -- 7 + "..........", -- 8 + + -- Level 5 + "oppppppppp", -- 0 + "oaaaaaaaaq", -- 1 + "oaaaaaaaaq", -- 2 + "oaaaaaaaaq", -- 3 + "oaaaaaaaaq", -- 4 + "oaaaaaaaaq", -- 5 + "oaaaaaaaaq", -- 6 + "oaaaaaaaaq", -- 7 + "rrrrrrrrrq", -- 8 + + }, + }, -- House8x7 + + + + { + OriginData = + { + ExportName = "House9x7", + Name = "Desert 30", + GalleryName = "Desert", + GalleryIndex = "30", + ID = "171", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 6, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 5, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:171: 0", -- carpet + "g:171:15", -- carpet + "h:171:14", -- carpet + "i: 24: 2", -- sandstone + "j: 64: 9", -- wooddoorblock + "k: 50: 3", -- torch + "l: 50: 1", -- torch + "m: 19: 0", -- sponge + "n: 50: 2", -- torch + "o: 50: 4", -- torch + "p:128: 4", -- sandstonestairs + "q:128: 6", -- sandstonestairs + "r:128: 5", -- sandstonestairs + "s:128: 7", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmaaammmmmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "maaaaaaaaam", -- 6 + "maaaaaaaaam", -- 7 + "mmmmmmmmmmm", -- 8 + + -- Level 1 + "..bcd......", -- 0 + ".aaaaaaaaa.", -- 1 + ".aaaaaaaaa.", -- 2 + ".aaaaaaaaa.", -- 3 + ".aaaaaaaaa.", -- 4 + ".aaaaaaaaa.", -- 5 + ".aaaaaaaaa.", -- 6 + ".aaaaaaaaa.", -- 7 + "...........", -- 8 + + -- Level 2 + "...........", -- 0 + ".aaeaaaaaa.", -- 1 + ".affgggffa.", -- 2 + ".afghhhgfa.", -- 3 + ".afghfhgfa.", -- 4 + ".afghhhgfa.", -- 5 + ".affgggffa.", -- 6 + ".aaaaaaaaa.", -- 7 + "...........", -- 8 + + -- Level 3 + "...........", -- 0 + ".iijii.iii.", -- 1 + ".i.......i.", -- 2 + ".i.......i.", -- 3 + "...........", -- 4 + ".i.......i.", -- 5 + ".i.......i.", -- 6 + ".ii.iii.ii.", -- 7 + "...........", -- 8 + + -- Level 4 + "...........", -- 0 + ".aaaaaaaaa.", -- 1 + ".a..k....a.", -- 2 + ".a.......a.", -- 3 + ".al.....na.", -- 4 + ".a.......a.", -- 5 + ".a...o...a.", -- 6 + ".aaaaaaaaa.", -- 7 + "...........", -- 8 + + -- Level 5 + "pqqqqqqqqqq", -- 0 + "paaaaaaaaar", -- 1 + "paaaaaaaaar", -- 2 + "paaaaaaaaar", -- 3 + "paaaaaaaaar", -- 4 + "paaaaaaaaar", -- 5 + "paaaaaaaaar", -- 6 + "paaaaaaaaar", -- 7 + "ssssssssssr", -- 8 + + }, + }, -- House9x7 + + + + { + OriginData = + { + ExportName = "House11x7", + Name = "Desert 31", + GalleryName = "Desert", + GalleryIndex = "31", + ID = "172", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 13, + y = 6, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 13, + MaxY = 5, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:171: 0", -- carpet + "g:171:15", -- carpet + "h:171:14", -- carpet + "i: 24: 2", -- sandstone + "j: 64: 9", -- wooddoorblock + "k: 50: 3", -- torch + "l: 50: 1", -- torch + "m: 19: 0", -- sponge + "n: 50: 2", -- torch + "o: 50: 4", -- torch + "p:128: 4", -- sandstonestairs + "q:128: 6", -- sandstonestairs + "r:128: 5", -- sandstonestairs + "s:128: 7", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmaaammmmmmmm", -- 0 + "maaaaaaaaaaam", -- 1 + "maaaaaaaaaaam", -- 2 + "maaaaaaaaaaam", -- 3 + "maaaaaaaaaaam", -- 4 + "maaaaaaaaaaam", -- 5 + "maaaaaaaaaaam", -- 6 + "maaaaaaaaaaam", -- 7 + "mmmmmmmmmmmmm", -- 8 + + -- Level 1 + "..bcd........", -- 0 + ".aaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaa.", -- 5 + ".aaaaaaaaaaa.", -- 6 + ".aaaaaaaaaaa.", -- 7 + ".............", -- 8 + + -- Level 2 + ".............", -- 0 + ".aaeaaaaaaaa.", -- 1 + ".affgggggffa.", -- 2 + ".afghhhhhgfa.", -- 3 + ".afghfffhgfa.", -- 4 + ".afghhhhhgfa.", -- 5 + ".affgggggffa.", -- 6 + ".aaaaaaaaaaa.", -- 7 + ".............", -- 8 + + -- Level 3 + ".............", -- 0 + ".iiji.iii.ii.", -- 1 + ".i.........i.", -- 2 + ".i.........i.", -- 3 + ".............", -- 4 + ".i.........i.", -- 5 + ".i.........i.", -- 6 + ".ii.ii.ii.ii.", -- 7 + ".............", -- 8 + + -- Level 4 + ".............", -- 0 + ".aaaaaaaaaaa.", -- 1 + ".a..k..k...a.", -- 2 + ".a.........a.", -- 3 + ".al.......na.", -- 4 + ".a.........a.", -- 5 + ".a....o....a.", -- 6 + ".aaaaaaaaaaa.", -- 7 + ".............", -- 8 + + -- Level 5 + "pqqqqqqqqqqqq", -- 0 + "paaaaaaaaaaar", -- 1 + "paaaaaaaaaaar", -- 2 + "paaaaaaaaaaar", -- 3 + "paaaaaaaaaaar", -- 4 + "paaaaaaaaaaar", -- 5 + "paaaaaaaaaaar", -- 6 + "paaaaaaaaaaar", -- 7 + "ssssssssssssr", -- 8 + + }, + }, -- House11x7 + + + + { + OriginData = + { + ExportName = "Forge", + Name = "Desert 32", + GalleryName = "Desert", + GalleryIndex = "32", + ID = "173", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 12, + y = 6, + z = 10, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 12, + MaxY = 5, + MaxZ = 10, + }, + Connectors = + { + { + Type = -1, + RelX = 3, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e:128: 3", -- sandstonestairs + "f:171:15", -- carpet + "g: 64: 2", -- wooddoorblock + "h:171: 0", -- carpet + "i:171:14", -- carpet + "j: 61: 2", -- furnace + "k: 10: 0", -- lava + "l: 54: 2", -- chest + "m: 19: 0", -- sponge + "n: 24: 2", -- sandstone + "o: 64: 9", -- wooddoorblock + "p: 50: 1", -- torch + "q:101: 0", -- ironbars + "r:128: 4", -- sandstonestairs + "s:128: 6", -- sandstonestairs + "t:128: 5", -- sandstonestairs + "u:128: 7", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "aaaaaaammmmm", -- 0 + "aaaaaaaaaaam", -- 1 + "aaaaaaaaaaam", -- 2 + "aaaaaaaaaaam", -- 3 + "aaaaaaaaaaam", -- 4 + "aaaaaaaaaaam", -- 5 + "maaaaaaaaaam", -- 6 + "maaaaaaaaaam", -- 7 + "maaaaaaaaaam", -- 8 + "mmmmmmmmmmmm", -- 9 + + -- Level 1 + "bcccccd.....", -- 0 + "baaaaaaaaaa.", -- 1 + "baaaaaaaaaa.", -- 2 + "baaaaaaaaaa.", -- 3 + "baaaaaaaaaa.", -- 4 + "eaaaaaaaaaa.", -- 5 + ".aaaaaaaaaa.", -- 6 + ".aaaaaaaaaa.", -- 7 + ".aaaaaaaaaa.", -- 8 + "............", -- 9 + + -- Level 2 + "............", -- 0 + ".a....aaaaa.", -- 1 + "......afffa.", -- 2 + "......ghfha.", -- 3 + "......aiiia.", -- 4 + ".a....ahfha.", -- 5 + ".ajaajafffa.", -- 6 + ".aakkaal..a.", -- 7 + ".aaaaaaaaaa.", -- 8 + "............", -- 9 + + -- Level 3 + "............", -- 0 + ".n....nn.nn.", -- 1 + "......n...n.", -- 2 + "......o...n.", -- 3 + "......n.....", -- 4 + ".n....n...n.", -- 5 + ".n....n...n.", -- 6 + ".n....n...n.", -- 7 + ".nnn.nnn.nn.", -- 8 + "............", -- 9 + + -- Level 4 + "............", -- 0 + ".a....aaaaa.", -- 1 + "......a...a.", -- 2 + "......a...a.", -- 3 + "......ap..a.", -- 4 + ".a....a...a.", -- 5 + ".aqqqqa...a.", -- 6 + ".a....a...a.", -- 7 + ".aaaaaaaaaa.", -- 8 + "............", -- 9 + + -- Level 5 + "rsssssssssss", -- 0 + "raaaaaaaaaat", -- 1 + "raaaaaaaaaat", -- 2 + "raaaaaaaaaat", -- 3 + "raaaaaaaaaat", -- 4 + "raaaaaaaaaat", -- 5 + "raaaaaaaaaat", -- 6 + "raaaaaaaaaat", -- 7 + "raaaaaaaaaat", -- 8 + "uuuuuuuuuuut", -- 9 + + }, + }, -- Forge + + + + { + OriginData = + { + ExportName = "MarketStall", + Name = "Desert 34", + GalleryName = "Desert", + GalleryIndex = "34", + ID = "175", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 6, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 7, + MaxY = 5, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 2, + RelY = 0, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "5", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 12: 0", -- sand + "b: 85: 0", -- fence + "c:171:14", -- carpet + "d:171:15", -- carpet + "e:171: 0", -- carpet + "f: 35:14", -- wool + "g: 35: 0", -- wool + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaa", -- 0 + "aaaaaaa", -- 1 + "aaaaaaa", -- 2 + "aaaaaaa", -- 3 + "aaaaaaa", -- 4 + "aaaaaaa", -- 5 + "aaaaaaa", -- 6 + + -- Level 1 + "b.....b", -- 0 + "cddeddc", -- 1 + "cdeeedc", -- 2 + "cdeeedc", -- 3 + "cddeddc", -- 4 + "b.....b", -- 5 + ".......", -- 6 + + -- Level 2 + "b.....b", -- 0 + ".......", -- 1 + ".......", -- 2 + ".......", -- 3 + ".......", -- 4 + "b.....b", -- 5 + ".......", -- 6 + + -- Level 3 + "b.....b", -- 0 + ".......", -- 1 + ".......", -- 2 + ".......", -- 3 + ".......", -- 4 + "b.....b", -- 5 + "fgfgfgf", -- 6 + + -- Level 4 + "fgfgfgf", -- 0 + ".......", -- 1 + ".......", -- 2 + ".......", -- 3 + ".......", -- 4 + "fgfgfgf", -- 5 + ".......", -- 6 + + -- Level 5 + ".......", -- 0 + "fgfgfgf", -- 1 + "fgfgfgf", -- 2 + "fgfgfgf", -- 3 + "fgfgfgf", -- 4 + ".......", -- 5 + ".......", -- 6 + + }, + }, -- MarketStall + + + + { + OriginData = + { + ExportName = "Marketplace", + Name = "Desert 38", + GalleryName = "Desert", + GalleryIndex = "38", + ID = "261", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 14, + y = 4, + z = 16, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 14, + MaxY = 3, + MaxZ = 16, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 0, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["AddWeightIfSame"] = "0", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["DefaultWeight"] = "20", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b: 12: 0", -- sand + "c: 24: 2", -- sandstone + "d: 12: 2", -- sand + "e: 85: 0", -- fence + "f: 5: 0", -- planks + "g:128: 2", -- sandstonestairs + "h:128: 0", -- sandstonestairs + "i: 8: 0", -- water + "j:128: 1", -- sandstonestairs + "k:128: 3", -- sandstonestairs + "l: 35: 0", -- wool + "m: 19: 0", -- sponge + "n: 35:14", -- wool + }, + BlockData = + { + -- Level 0 + "aaaabbbaaabbbb", -- 0 + "aaaabbaabbabbb", -- 1 + "aababbabcabbbb", -- 2 + "aaaaabaaaaabbb", -- 3 + "bbbbbbbbbbbbbb", -- 4 + "bbbbbbbbbbaabb", -- 5 + "bbbbccccbbabab", -- 6 + "ccbbccccbbaaab", -- 7 + "ccbbccccbbabbb", -- 8 + "dcbbccccbbabaa", -- 9 + "ccbbbbbbbbaaba", -- 10 + "ccbbbbbbbbabaa", -- 11 + "bbbbbbbbbbabaa", -- 12 + "bbbaababbbaaba", -- 13 + "bbbcaaaabbabbb", -- 14 + "bbbcccabbbabbb", -- 15 + + -- Level 1 + "e...e.e...e...", -- 0 + "..............", -- 1 + "..............", -- 2 + "fffff.fffff...", -- 3 + "..............", -- 4 + "..........f..e", -- 5 + "....gggg..f...", -- 6 + ".f..hiij..f...", -- 7 + ".f..hiij..f...", -- 8 + ".f..kkkk..f..e", -- 9 + ".f............", -- 10 + ".f........f..e", -- 11 + "...fffff..f...", -- 12 + "..........f...", -- 13 + "..........f...", -- 14 + "...e...e..f..e", -- 15 + + -- Level 2 + "lnlnl.lnlnl...", -- 0 + "..............", -- 1 + "..............", -- 2 + "e...e.e...e...", -- 3 + "..............", -- 4 + "..........e..l", -- 5 + ".............n", -- 6 + ".e...........l", -- 7 + ".............n", -- 8 + "..........e..l", -- 9 + "..............", -- 10 + ".e........e..l", -- 11 + "...e...e.....n", -- 12 + ".............l", -- 13 + ".............n", -- 14 + "...lnlnl..e..l", -- 15 + + -- Level 3 + "..............", -- 0 + "lnlnl.lnlnl...", -- 1 + "lnlnl.lnlnl...", -- 2 + "lnlnl.lnlnl...", -- 3 + "..............", -- 4 + "..........lll.", -- 5 + "..........nnn.", -- 6 + "ll........lll.", -- 7 + "nn........nnn.", -- 8 + "ll........lll.", -- 9 + "nn............", -- 10 + "ll........lll.", -- 11 + "...lnlnl..nnn.", -- 12 + "...lnlnl..lll.", -- 13 + "...lnlnl..nnn.", -- 14 + "..........lll.", -- 15 + + }, + }, -- Marketplace + + + + { + OriginData = + { + ExportName = "Well", + Name = "Desert 44", + GalleryName = "Desert", + GalleryIndex = "44", + ID = "275", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 5, + y = 16, + z = 5, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 4, + MaxY = 15, + MaxZ = 4, + }, + Connectors = + { + { + Type = 2, + RelX = 4, + RelY = 11, + RelZ = 2, + Direction = 5, -- X+ + }, + { + Type = 2, + RelX = 2, + RelY = 11, + RelZ = 4, + Direction = 3, -- Z+ + }, + { + Type = 2, + RelX = 0, + RelY = 11, + RelZ = 2, + Direction = 4, -- X- + }, + { + Type = 2, + RelX = 2, + RelY = 11, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["IsStarting"] = "1", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 1: 0", -- stone + "b: 24: 0", -- sandstone + "c: 8: 0", -- water + "d:128: 2", -- sandstonestairs + "e:128: 0", -- sandstonestairs + "f:128: 1", -- sandstonestairs + "g:128: 3", -- sandstonestairs + "h:128: 6", -- sandstonestairs + "i:128: 4", -- sandstonestairs + "j:128: 5", -- sandstonestairs + "k:128: 7", -- sandstonestairs + "l: 44: 1", -- step + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaa", -- 0 + "abbba", -- 1 + "abbba", -- 2 + "abbba", -- 3 + "aaaaa", -- 4 + + -- Level 1 + "bbbbb", -- 0 + "bcccb", -- 1 + "bcccb", -- 2 + "bcccb", -- 3 + "bbbbb", -- 4 + + -- Level 2 + "bbbbb", -- 0 + "bcccb", -- 1 + "bcccb", -- 2 + "bcccb", -- 3 + "bbbbb", -- 4 + + -- Level 3 + "bbbbb", -- 0 + "bcccb", -- 1 + "bcccb", -- 2 + "bcccb", -- 3 + "bbbbb", -- 4 + + -- Level 4 + "bbbbb", -- 0 + "bcccb", -- 1 + "bcccb", -- 2 + "bcccb", -- 3 + "bbbbb", -- 4 + + -- Level 5 + "bbbbb", -- 0 + "bcccb", -- 1 + "bcccb", -- 2 + "bcccb", -- 3 + "bbbbb", -- 4 + + -- Level 6 + "bbbbb", -- 0 + "bcccb", -- 1 + "bcccb", -- 2 + "bcccb", -- 3 + "bbbbb", -- 4 + + -- Level 7 + "bbbbb", -- 0 + "bcccb", -- 1 + "bcccb", -- 2 + "bcccb", -- 3 + "bbbbb", -- 4 + + -- Level 8 + "bbbbb", -- 0 + "bcbcb", -- 1 + "bbcbb", -- 2 + "bcbcb", -- 3 + "bbbbb", -- 4 + + -- Level 9 + "bbbbb", -- 0 + "bcbcb", -- 1 + "bbbbb", -- 2 + "bcbcb", -- 3 + "bbbbb", -- 4 + + -- Level 10 + "bbbbb", -- 0 + "bcbcb", -- 1 + "bbbbb", -- 2 + "bcbcb", -- 3 + "bbbbb", -- 4 + + -- Level 11 + "ddddd", -- 0 + "ecccf", -- 1 + "ecbcf", -- 2 + "ecccf", -- 3 + "ggggf", -- 4 + + -- Level 12 + ".....", -- 0 + ".....", -- 1 + "..b..", -- 2 + ".....", -- 3 + ".....", -- 4 + + -- Level 13 + ".....", -- 0 + ".....", -- 1 + "..b..", -- 2 + ".....", -- 3 + ".....", -- 4 + + -- Level 14 + ".....", -- 0 + ".hhh.", -- 1 + ".ibj.", -- 2 + ".kkj.", -- 3 + ".....", -- 4 + + -- Level 15 + "lllll", -- 0 + "lllll", -- 1 + "lllll", -- 2 + "lllll", -- 3 + "lllll", -- 4 + + }, + }, -- Well + + + + { + OriginData = + { + ExportName = "HouseL13x12", + Name = "Desert 53", + GalleryName = "Desert", + GalleryIndex = "53", + ID = "345", + CreatorName = "jakibaki", + }, + Size = + { + x = 15, + y = 6, + z = 14, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 15, + MaxY = 5, + MaxZ = 14, + }, + Connectors = + { + { + Type = -1, + RelX = 4, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 43: 1", -- doublestep + "f: 64: 3", -- wooddoorblock + "g:171: 0", -- carpet + "h:171:15", -- carpet + "i:171:14", -- carpet + "j: 58: 0", -- workbench + "k: 24: 2", -- sandstone + "l: 64: 9", -- wooddoorblock + "m: 19: 0", -- sponge + "n: 50: 3", -- torch + "o: 50: 1", -- torch + "p: 50: 2", -- torch + "q: 50: 4", -- torch + "r:128: 6", -- sandstonestairs + "s:128: 5", -- sandstonestairs + "t:128: 4", -- sandstonestairs + "u:128: 7", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmmaaammmmmmmmm", -- 0 + "maaaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaaam", -- 3 + "maaaaaaaaaaaaam", -- 4 + "maaaaaaaaaaaaam", -- 5 + "maaaaaaaaaaaaam", -- 6 + "maaaaaaaaaaaaam", -- 7 + "mmmmmmmaaaaaaam", -- 8 + "mmmmmmmaaaaaaam", -- 9 + "mmmmmmmaaaaaaam", -- 10 + "mmmmmmmaaaaaaam", -- 11 + "mmmmmmmaaaaaaam", -- 12 + "mmmmmmmmmmmmmmm", -- 13 + + -- Level 1 + "...bcd.........", -- 0 + ".aaaaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaaea.", -- 5 + ".aaaaaaaaaaaaa.", -- 6 + ".aaaaaaaaaaaaa.", -- 7 + ".......aeaaaaa.", -- 8 + "mmmmmm.aaaaaaa.", -- 9 + "mmmmmm.aaaaaaa.", -- 10 + "mmmmmm.aaaaaaa.", -- 11 + "mmmmmm.aaaaaaa.", -- 12 + "...............", -- 13 + + -- Level 2 + "...............", -- 0 + ".aaafaaaaaaaaa.", -- 1 + ".agghhhhhhhhga.", -- 2 + ".aghiiiiiiiiha.", -- 3 + ".aghiggggggiha.", -- 4 + ".aghiiiiiigiha.", -- 5 + ".agghhhhhigiha.", -- 6 + ".aaaaaaahigiha.", -- 7 + ".......ahigiha.", -- 8 + "mmmmmm.ahiiiha.", -- 9 + "mmmmmm.aghhhga.", -- 10 + "mmmmmm.aggggja.", -- 11 + "mmmmmm.aaaaaaa.", -- 12 + "...............", -- 13 + + -- Level 3 + "...............", -- 0 + ".kkklkkkk.kkkk.", -- 1 + ".k...........k.", -- 2 + ".k...........k.", -- 3 + "...............", -- 4 + ".k...........k.", -- 5 + ".k...........k.", -- 6 + ".kkk.kkk.....k.", -- 7 + ".......k.....k.", -- 8 + "mmmmmm.k.......", -- 9 + "mmmmmm.......k.", -- 10 + "mmmmmm.k.....k.", -- 11 + "mmmmmm.kkk.kkk.", -- 12 + "...............", -- 13 + + -- Level 4 + "...............", -- 0 + ".aaaaaaaaaaaaa.", -- 1 + ".a......n....a.", -- 2 + ".a...........a.", -- 3 + ".ao..........a.", -- 4 + ".a...........a.", -- 5 + ".a..........pa.", -- 6 + ".aaaaaaa.....a.", -- 7 + ".......a.....a.", -- 8 + "mmmmmm.a.....a.", -- 9 + "mmmmmm.a.....a.", -- 10 + "mmmmmm.a..q..a.", -- 11 + "mmmmmm.aaaaaaa.", -- 12 + "...............", -- 13 + + -- Level 5 + "rrrrrrrrrrrrrrs", -- 0 + "taaaaaaaaaaaaas", -- 1 + "taaaaaaaaaaaaas", -- 2 + "taaaaaaaaaaaaas", -- 3 + "taaaaaaaaaaaaas", -- 4 + "taaaaaaaaaaaaas", -- 5 + "taaaaaaaaaaaaas", -- 6 + "taaaaaaaaaaaaas", -- 7 + "tuuuuutaaaaaaas", -- 8 + "mmmmmmtaaaaaaas", -- 9 + "mmmmmmtaaaaaaas", -- 10 + "mmmmmmtaaaaaaas", -- 11 + "mmmmmmtaaaaaaas", -- 12 + "......tuuuuuuuu", -- 13 + + }, + }, -- HouseL13x12 + }, -- Pieces +} + + + + diff --git a/Server/Prefabs/Villages/SandVillage.cubeset b/Server/Prefabs/Villages/SandVillage.cubeset new file mode 100644 index 000000000..63238fa6e --- /dev/null +++ b/Server/Prefabs/Villages/SandVillage.cubeset @@ -0,0 +1,2389 @@ + +-- SandVillage.cubeset + +-- Defines the prefabs in the group SandVillage + +-- NOTE: This file has been generated automatically by GalExport! +-- Any manual changes will be overwritten by the next automatic export! + + + + +Cubeset = +{ + Metadata = + { + CubesetFormatVersion = 1, + ExportDate = "2015-06-20 10:16:49", + ["AllowedBiomes"] = "Desert, DesertM", + ["IntendedUse"] = "Village", + }, + + Pieces = + { + { + OriginData = + { + ExportName = "Well", + Name = "Desert 0", + GalleryName = "Desert", + GalleryIndex = "0", + ID = "1", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 4, + y = 13, + z = 4, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 3, + MaxY = 12, + MaxZ = 3, + }, + Connectors = + { + { + Type = 2, + RelX = 2, + RelY = 8, + RelZ = 0, + Direction = 2, -- Z- + }, + { + Type = 2, + RelX = 0, + RelY = 8, + RelZ = 1, + Direction = 4, -- X- + }, + { + Type = 2, + RelX = 1, + RelY = 8, + RelZ = 3, + Direction = 3, -- Z+ + }, + { + Type = 2, + RelX = 3, + RelY = 8, + RelZ = 2, + Direction = 5, -- X+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["IsStarting"] = "1", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 1: 0", -- stone + "b: 24: 0", -- sandstone + "c: 8: 0", -- water + "d: 85: 0", -- fence + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaa", -- 0 + "aaaa", -- 1 + "aaaa", -- 2 + "aaaa", -- 3 + + -- Level 1 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 2 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 3 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 4 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 5 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 6 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 7 + "bbbb", -- 0 + "bccb", -- 1 + "bccb", -- 2 + "bbbb", -- 3 + + -- Level 8 + "bbbb", -- 0 + "b..b", -- 1 + "b..b", -- 2 + "bbbb", -- 3 + + -- Level 9 + "d..d", -- 0 + "....", -- 1 + "....", -- 2 + "d..d", -- 3 + + -- Level 10 + "d..d", -- 0 + "....", -- 1 + "....", -- 2 + "d..d", -- 3 + + -- Level 11 + "d..d", -- 0 + "....", -- 1 + "....", -- 2 + "d..d", -- 3 + + -- Level 12 + "bbbb", -- 0 + "bbbb", -- 1 + "bbbb", -- 2 + "bbbb", -- 3 + + }, + }, -- Well + + + + { + OriginData = + { + ExportName = "SmallHut", + Name = "Desert 4", + GalleryName = "Desert", + GalleryIndex = "4", + ID = "68", + CreatorName = "tonibm1999", + }, + Size = + { + x = 5, + y = 6, + z = 6, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = -1, + MaxX = 5, + MaxY = 5, + MaxZ = 5, + }, + Connectors = + { + { + Type = -1, + RelX = 2, + RelY = 1, + RelZ = 5, + Direction = 3, -- Z+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 3", -- sandstonestairs + "c: 24: 2", -- sandstone + "d: 50: 5", -- torch + "e: 26:10", -- bedblock + "f: 26: 2", -- bedblock + "g: 64: 1", -- wooddoorblock + "h: 64: 9", -- wooddoorblock + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaa", -- 0 + "aaaaa", -- 1 + "aaaaa", -- 2 + "aaaaa", -- 3 + "aaaaa", -- 4 + "mmamm", -- 5 + + -- Level 1 + "aaaaa", -- 0 + "aaaaa", -- 1 + "aaaaa", -- 2 + "aaaaa", -- 3 + "aaaaa", -- 4 + "..b..", -- 5 + + -- Level 2 + "accca", -- 0 + "cdedc", -- 1 + "c.f.c", -- 2 + "c...c", -- 3 + "acgca", -- 4 + ".....", -- 5 + + -- Level 3 + "ac.ca", -- 0 + "c...c", -- 1 + ".....", -- 2 + "c...c", -- 3 + "achca", -- 4 + ".....", -- 5 + + -- Level 4 + "accca", -- 0 + "c...c", -- 1 + "c...c", -- 2 + "c...c", -- 3 + "accca", -- 4 + ".....", -- 5 + + -- Level 5 + ".aaa.", -- 0 + "aaaaa", -- 1 + "aaaaa", -- 2 + "aaaaa", -- 3 + ".aaa.", -- 4 + ".....", -- 5 + + }, + }, -- SmallHut + + + + { + OriginData = + { + ExportName = "DoubleField", + Name = "Desert 5", + GalleryName = "Desert", + GalleryIndex = "5", + ID = "75", + CreatorName = "tonibm1999", + }, + Size = + { + x = 13, + y = 3, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = -1, + MaxX = 13, + MaxY = 2, + MaxZ = 8, + }, + Connectors = + { + { + Type = -1, + RelX = 6, + RelY = 1, + RelZ = 8, + Direction = 3, -- Z+ + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b: 60: 7", -- tilleddirt + "c: 8: 0", -- water + "d: 50: 5", -- torch + "e: 59: 7", -- crops + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaaaaaaaa", -- 0 + "aaaaaaaaaaaaa", -- 1 + "aaaaaaaaaaaaa", -- 2 + "aaaaaaaaaaaaa", -- 3 + "aaaaaaaaaaaaa", -- 4 + "aaaaaaaaaaaaa", -- 5 + "aaaaaaaaaaaaa", -- 6 + "aaaaaaaaaaaaa", -- 7 + "aaaaaaaaaaaaa", -- 8 + + -- Level 1 + "aaaaaaaaaaaaa", -- 0 + "abbcbbabbcbba", -- 1 + "abbcbbabbcbba", -- 2 + "abbcbbabbcbba", -- 3 + "abbcbbabbcbba", -- 4 + "abbcbbabbcbba", -- 5 + "abbcbbabbcbba", -- 6 + "abbcbbabbcbba", -- 7 + "aaaaaaaaaaaaa", -- 8 + + -- Level 2 + "d.....d.....d", -- 0 + ".ee.ee.ee.ee.", -- 1 + ".ee.ee.ee.ee.", -- 2 + ".ee.ee.ee.ee.", -- 3 + ".ee.ee.ee.ee.", -- 4 + ".ee.ee.ee.ee.", -- 5 + ".ee.ee.ee.ee.", -- 6 + ".ee.ee.ee.ee.", -- 7 + "d.....d.....d", -- 8 + + }, + }, -- DoubleField + + + + { + OriginData = + { + ExportName = "House11x7", + Name = "Desert 6", + GalleryName = "Desert", + GalleryIndex = "6", + ID = "81", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 11, + y = 7, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 6, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:102: 0", -- glasspane + "g: 64: 9", -- wooddoorblock + "h:128: 7", -- sandstonestairs + "i: 50: 3", -- torch + "j: 50: 4", -- torch + "k:128: 6", -- sandstonestairs + "l:128: 3", -- sandstonestairs + "m: 19: 0", -- sponge + "n: 50: 1", -- torch + "o: 50: 2", -- torch + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "mmmmmmmmmmm", -- 6 + + -- Level 1 + "....bcd....", -- 0 + ".aaaaaaaaa.", -- 1 + ".aaaaaaaaa.", -- 2 + ".aaaaaaaaa.", -- 3 + ".aaaaaaaaa.", -- 4 + ".aaaaaaaaa.", -- 5 + "...........", -- 6 + + -- Level 2 + "...........", -- 0 + ".aaaaeaaaa.", -- 1 + ".a.......a.", -- 2 + ".a.......a.", -- 3 + ".a.......a.", -- 4 + ".aaaaaaaaa.", -- 5 + "...........", -- 6 + + -- Level 3 + "...........", -- 0 + ".affagaffa.", -- 1 + ".f.......f.", -- 2 + ".f.......f.", -- 3 + ".f.......f.", -- 4 + ".affafaffa.", -- 5 + "...........", -- 6 + + -- Level 4 + "ccccccccccc", -- 0 + "haaaaaaaaah", -- 1 + ".a..i.i..a.", -- 2 + ".a.......a.", -- 3 + ".a..j.j..a.", -- 4 + "kaaaaaaaaak", -- 5 + "lllllllllll", -- 6 + + -- Level 5 + "...........", -- 0 + "ccccccccccc", -- 1 + "haaaaaaaaah", -- 2 + ".an.....oa.", -- 3 + "kaaaaaaaaak", -- 4 + "lllllllllll", -- 5 + "...........", -- 6 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "ccccccccccc", -- 2 + "aaaaaaaaaaa", -- 3 + "lllllllllll", -- 4 + "...........", -- 5 + "...........", -- 6 + + }, + }, -- House11x7 + + + + { + OriginData = + { + ExportName = "HouseL14x12", + Name = "Desert 7", + GalleryName = "Desert", + GalleryIndex = "7", + ID = "82", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 14, + y = 7, + z = 12, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 14, + MaxY = 6, + MaxZ = 12, + }, + Connectors = + { + { + Type = -1, + RelX = 8, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e:128: 3", -- sandstonestairs + "f: 64: 3", -- wooddoorblock + "g: 64: 1", -- wooddoorblock + "h:102: 0", -- glasspane + "i: 64: 9", -- wooddoorblock + "j:128: 7", -- sandstonestairs + "k: 50: 3", -- torch + "l: 50: 4", -- torch + "m: 19: 0", -- sponge + "n:128: 6", -- sandstonestairs + "o:128: 5", -- sandstonestairs + "p:128: 4", -- sandstonestairs + "q: 50: 1", -- torch + }, + BlockData = + { + -- Level 0 + "mmmmmmmaaammmm", -- 0 + "maaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaam", -- 3 + "maaaaaaaaaaaam", -- 4 + "maaaaaaaaaaaam", -- 5 + "mmmmaaamaaaaam", -- 6 + "mmmmmmmmaaaaam", -- 7 + "mmmmmmmmaaaaam", -- 8 + "mmmmmmmmaaaaam", -- 9 + "mmmmmmmmaaaaam", -- 10 + "mmmmmmmmmmmmmm", -- 11 + + -- Level 1 + ".......bcd....", -- 0 + ".aaaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaaa.", -- 5 + "....bed.aaaaa.", -- 6 + "........aaaaa.", -- 7 + "........aaaaa.", -- 8 + "........aaaaa.", -- 9 + "........aaaaa.", -- 10 + "..............", -- 11 + + -- Level 2 + "..............", -- 0 + ".aaaaaaafaaaa.", -- 1 + ".a..........a.", -- 2 + ".a..........a.", -- 3 + ".a..........a.", -- 4 + ".aaaagaaa...a.", -- 5 + "........a...a.", -- 6 + "........a...a.", -- 7 + "........a...a.", -- 8 + "........a...a.", -- 9 + "........aaaaa.", -- 10 + "..............", -- 11 + + -- Level 3 + "..............", -- 0 + ".ahhahhaiahha.", -- 1 + ".h..........h.", -- 2 + ".h..........h.", -- 3 + ".h..........a.", -- 4 + ".ahhaiahh...h.", -- 5 + "........h...h.", -- 6 + "........a...a.", -- 7 + "........h...h.", -- 8 + "........h...h.", -- 9 + "........ahhha.", -- 10 + "..............", -- 11 + + -- Level 4 + "cccccccccccccc", -- 0 + "jaaaaaaaaaaaad", -- 1 + ".a.....k.k..ad", -- 2 + ".a..........ad", -- 3 + ".a..l.l.....ad", -- 4 + "naaaaaaaa...ad", -- 5 + "eeeeeeeba...ad", -- 6 + ".......ba...ad", -- 7 + ".......ba...ad", -- 8 + ".......ba...ad", -- 9 + ".......baaaaad", -- 10 + ".......bo...pd", -- 11 + + -- Level 5 + "..............", -- 0 + "ccccccccccccc.", -- 1 + "jaaaaaaaaaaad.", -- 2 + ".aq........ad.", -- 3 + "naaaaaaaaa.ad.", -- 4 + "eeeeeeeeba.ad.", -- 5 + "........ba.ad.", -- 6 + "........ba.ad.", -- 7 + "........ba.ad.", -- 8 + "........balad.", -- 9 + "........baaad.", -- 10 + "........bo.pd.", -- 11 + + -- Level 6 + "..............", -- 0 + "..............", -- 1 + "cccccccccccc..", -- 2 + "aaaaaaaaaaad..", -- 3 + "eeeeeeeeebad..", -- 4 + ".........bad..", -- 5 + ".........bad..", -- 6 + ".........bad..", -- 7 + ".........bad..", -- 8 + ".........bad..", -- 9 + ".........bad..", -- 10 + ".........bad..", -- 11 + + }, + }, -- HouseL14x12 + + + + { + OriginData = + { + ExportName = "House7x7", + Name = "Desert 8", + GalleryName = "Desert", + GalleryIndex = "8", + ID = "112", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 7, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 7, + MaxY = 6, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 4, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:102: 0", -- glasspane + "g: 64: 9", -- wooddoorblock + "h:128: 7", -- sandstonestairs + "i: 50: 3", -- torch + "j:128: 6", -- sandstonestairs + "k:128: 3", -- sandstonestairs + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmaaam", -- 0 + "maaaaam", -- 1 + "maaaaam", -- 2 + "maaaaam", -- 3 + "maaaaam", -- 4 + "maaaaam", -- 5 + "mmmmmmm", -- 6 + + -- Level 1 + "...bcd.", -- 0 + ".aaaaa.", -- 1 + ".aaaaa.", -- 2 + ".aaaaa.", -- 3 + ".aaaaa.", -- 4 + ".aaaaa.", -- 5 + ".......", -- 6 + + -- Level 2 + ".......", -- 0 + ".aaaea.", -- 1 + ".a...a.", -- 2 + ".a...a.", -- 3 + ".a...a.", -- 4 + ".aaaaa.", -- 5 + ".......", -- 6 + + -- Level 3 + ".......", -- 0 + ".afaga.", -- 1 + ".f...f.", -- 2 + ".f...f.", -- 3 + ".f...f.", -- 4 + ".afffa.", -- 5 + ".......", -- 6 + + -- Level 4 + "ccccccc", -- 0 + "haaaaah", -- 1 + ".a.i.a.", -- 2 + ".a...a.", -- 3 + ".a...a.", -- 4 + "jaaaaaj", -- 5 + "kkkkkkk", -- 6 + + -- Level 5 + ".......", -- 0 + "ccccccc", -- 1 + "haaaaah", -- 2 + ".a...a.", -- 3 + "jaaaaaj", -- 4 + "kkkkkkk", -- 5 + ".......", -- 6 + + -- Level 6 + ".......", -- 0 + ".......", -- 1 + "ccccccc", -- 2 + "aaaaaaa", -- 3 + "kkkkkkk", -- 4 + ".......", -- 5 + ".......", -- 6 + + }, + }, -- House7x7 + + + + { + OriginData = + { + ExportName = "House9x7", + Name = "Desert 9", + GalleryName = "Desert", + GalleryIndex = "9", + ID = "113", + CreatorName = "xoft", + }, + Size = + { + x = 9, + y = 7, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 9, + MaxY = 6, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 4, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:102: 0", -- glasspane + "g: 64: 9", -- wooddoorblock + "h:128: 7", -- sandstonestairs + "i: 50: 3", -- torch + "j: 50: 4", -- torch + "k:128: 6", -- sandstonestairs + "l:128: 3", -- sandstonestairs + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmaaammm", -- 0 + "maaaaaaam", -- 1 + "maaaaaaam", -- 2 + "maaaaaaam", -- 3 + "maaaaaaam", -- 4 + "maaaaaaam", -- 5 + "mmmmmmmmm", -- 6 + + -- Level 1 + "...bcd...", -- 0 + ".aaaaaaa.", -- 1 + ".aaaaaaa.", -- 2 + ".aaaaaaa.", -- 3 + ".aaaaaaa.", -- 4 + ".aaaaaaa.", -- 5 + ".........", -- 6 + + -- Level 2 + ".........", -- 0 + ".aaaeaaa.", -- 1 + ".a.....a.", -- 2 + ".a.....a.", -- 3 + ".a.....a.", -- 4 + ".aaaaaaa.", -- 5 + ".........", -- 6 + + -- Level 3 + ".........", -- 0 + ".afagafa.", -- 1 + ".f.....f.", -- 2 + ".f.....f.", -- 3 + ".f.....f.", -- 4 + ".affaffa.", -- 5 + ".........", -- 6 + + -- Level 4 + "ccccccccc", -- 0 + "haaaaaaah", -- 1 + ".a.i.i.a.", -- 2 + ".a.....a.", -- 3 + ".a..j..a.", -- 4 + "kaaaaaaak", -- 5 + "lllllllll", -- 6 + + -- Level 5 + ".........", -- 0 + "ccccccccc", -- 1 + "haaaaaaah", -- 2 + ".a.....a.", -- 3 + "kaaaaaaak", -- 4 + "lllllllll", -- 5 + ".........", -- 6 + + -- Level 6 + ".........", -- 0 + ".........", -- 1 + "ccccccccc", -- 2 + "aaaaaaaaa", -- 3 + "lllllllll", -- 4 + ".........", -- 5 + ".........", -- 6 + + }, + }, -- House9x7 + + + + { + OriginData = + { + ExportName = "House9x9", + Name = "Desert 10", + GalleryName = "Desert", + GalleryIndex = "10", + ID = "114", + CreatorName = "xoft", + }, + Size = + { + x = 9, + y = 8, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 9, + MaxY = 7, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 4, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:102: 0", -- glasspane + "g: 64: 9", -- wooddoorblock + "h:128: 7", -- sandstonestairs + "i: 50: 3", -- torch + "j: 50: 4", -- torch + "k:128: 6", -- sandstonestairs + "l:128: 3", -- sandstonestairs + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmaaammm", -- 0 + "maaaaaaam", -- 1 + "maaaaaaam", -- 2 + "maaaaaaam", -- 3 + "maaaaaaam", -- 4 + "maaaaaaam", -- 5 + "maaaaaaam", -- 6 + "maaaaaaam", -- 7 + "mmmmmmmmm", -- 8 + + -- Level 1 + "...bcd...", -- 0 + ".aaaaaaa.", -- 1 + ".aaaaaaa.", -- 2 + ".aaaaaaa.", -- 3 + ".aaaaaaa.", -- 4 + ".aaaaaaa.", -- 5 + ".aaaaaaa.", -- 6 + ".aaaaaaa.", -- 7 + ".........", -- 8 + + -- Level 2 + ".........", -- 0 + ".aaaeaaa.", -- 1 + ".a.....a.", -- 2 + ".a.....a.", -- 3 + ".a.....a.", -- 4 + ".a.....a.", -- 5 + ".a.....a.", -- 6 + ".aaaaaaa.", -- 7 + ".........", -- 8 + + -- Level 3 + ".........", -- 0 + ".afagafa.", -- 1 + ".f.....f.", -- 2 + ".f.....f.", -- 3 + ".a.....a.", -- 4 + ".f.....f.", -- 5 + ".f.....f.", -- 6 + ".affaffa.", -- 7 + ".........", -- 8 + + -- Level 4 + "ccccccccc", -- 0 + "haaaaaaah", -- 1 + ".a.i.i.a.", -- 2 + ".a.....a.", -- 3 + ".a.....a.", -- 4 + ".a.....a.", -- 5 + ".a..j..a.", -- 6 + "kaaaaaaak", -- 7 + "lllllllll", -- 8 + + -- Level 5 + ".........", -- 0 + "ccccccccc", -- 1 + "haaaaaaah", -- 2 + ".a.....a.", -- 3 + ".a.....a.", -- 4 + ".a.....a.", -- 5 + "kaaaaaaak", -- 6 + "lllllllll", -- 7 + ".........", -- 8 + + -- Level 6 + ".........", -- 0 + ".........", -- 1 + "ccccccccc", -- 2 + "haaaaaaah", -- 3 + ".a.....a.", -- 4 + "kaaaaaaak", -- 5 + "lllllllll", -- 6 + ".........", -- 7 + ".........", -- 8 + + -- Level 7 + ".........", -- 0 + ".........", -- 1 + ".........", -- 2 + "ccccccccc", -- 3 + "aaaaaaaaa", -- 4 + "lllllllll", -- 5 + ".........", -- 6 + ".........", -- 7 + ".........", -- 8 + + }, + }, -- House9x9 + + + + { + OriginData = + { + ExportName = "House11x9", + Name = "Desert 11", + GalleryName = "Desert", + GalleryIndex = "11", + ID = "115", + CreatorName = "xoft", + }, + Size = + { + x = 11, + y = 8, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 11, + MaxY = 7, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:102: 0", -- glasspane + "g: 64: 9", -- wooddoorblock + "h:128: 7", -- sandstonestairs + "i: 50: 3", -- torch + "j: 50: 4", -- torch + "k:128: 6", -- sandstonestairs + "l:128: 3", -- sandstonestairs + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmaaammmm", -- 0 + "maaaaaaaaam", -- 1 + "maaaaaaaaam", -- 2 + "maaaaaaaaam", -- 3 + "maaaaaaaaam", -- 4 + "maaaaaaaaam", -- 5 + "maaaaaaaaam", -- 6 + "maaaaaaaaam", -- 7 + "mmmmmmmmmmm", -- 8 + + -- Level 1 + "....bcd....", -- 0 + ".aaaaaaaaa.", -- 1 + ".aaaaaaaaa.", -- 2 + ".aaaaaaaaa.", -- 3 + ".aaaaaaaaa.", -- 4 + ".aaaaaaaaa.", -- 5 + ".aaaaaaaaa.", -- 6 + ".aaaaaaaaa.", -- 7 + "...........", -- 8 + + -- Level 2 + "...........", -- 0 + ".aaaaeaaaa.", -- 1 + ".a.......a.", -- 2 + ".a.......a.", -- 3 + ".a.......a.", -- 4 + ".a.......a.", -- 5 + ".a.......a.", -- 6 + ".aaaaaaaaa.", -- 7 + "...........", -- 8 + + -- Level 3 + "...........", -- 0 + ".affagaffa.", -- 1 + ".f.......f.", -- 2 + ".f.......f.", -- 3 + ".a.......a.", -- 4 + ".f.......f.", -- 5 + ".f.......f.", -- 6 + ".afffafffa.", -- 7 + "...........", -- 8 + + -- Level 4 + "ccccccccccc", -- 0 + "haaaaaaaaah", -- 1 + ".a..i.i..a.", -- 2 + ".a.......a.", -- 3 + ".a.......a.", -- 4 + ".a.......a.", -- 5 + ".a...j...a.", -- 6 + "kaaaaaaaaak", -- 7 + "lllllllllll", -- 8 + + -- Level 5 + "...........", -- 0 + "ccccccccccc", -- 1 + "haaaaaaaaah", -- 2 + ".a.......a.", -- 3 + ".a.......a.", -- 4 + ".a.......a.", -- 5 + "kaaaaaaaaak", -- 6 + "lllllllllll", -- 7 + "...........", -- 8 + + -- Level 6 + "...........", -- 0 + "...........", -- 1 + "ccccccccccc", -- 2 + "haaaaaaaaah", -- 3 + ".a.......a.", -- 4 + "kaaaaaaaaak", -- 5 + "lllllllllll", -- 6 + "...........", -- 7 + "...........", -- 8 + + -- Level 7 + "...........", -- 0 + "...........", -- 1 + "...........", -- 2 + "ccccccccccc", -- 3 + "aaaaaaaaaaa", -- 4 + "lllllllllll", -- 5 + "...........", -- 6 + "...........", -- 7 + "...........", -- 8 + + }, + }, -- House11x9 + + + + { + OriginData = + { + ExportName = "House13x9", + Name = "Desert 12", + GalleryName = "Desert", + GalleryIndex = "12", + ID = "116", + CreatorName = "xoft", + }, + Size = + { + x = 13, + y = 8, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 13, + MaxY = 7, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 6, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:102: 0", -- glasspane + "g: 64: 9", -- wooddoorblock + "h:128: 7", -- sandstonestairs + "i: 50: 3", -- torch + "j: 50: 4", -- torch + "k:128: 6", -- sandstonestairs + "l:128: 3", -- sandstonestairs + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmmaaammmmm", -- 0 + "maaaaaaaaaaam", -- 1 + "maaaaaaaaaaam", -- 2 + "maaaaaaaaaaam", -- 3 + "maaaaaaaaaaam", -- 4 + "maaaaaaaaaaam", -- 5 + "maaaaaaaaaaam", -- 6 + "maaaaaaaaaaam", -- 7 + "mmmmmmmmmmmmm", -- 8 + + -- Level 1 + ".....bcd.....", -- 0 + ".aaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaa.", -- 5 + ".aaaaaaaaaaa.", -- 6 + ".aaaaaaaaaaa.", -- 7 + ".............", -- 8 + + -- Level 2 + ".............", -- 0 + ".aaaaaeaaaaa.", -- 1 + ".a.........a.", -- 2 + ".a.........a.", -- 3 + ".a.........a.", -- 4 + ".a.........a.", -- 5 + ".a.........a.", -- 6 + ".aaaaaaaaaaa.", -- 7 + ".............", -- 8 + + -- Level 3 + ".............", -- 0 + ".afffagafffa.", -- 1 + ".f.........f.", -- 2 + ".f.........f.", -- 3 + ".a.........a.", -- 4 + ".f.........f.", -- 5 + ".f.........f.", -- 6 + ".affaffafffa.", -- 7 + ".............", -- 8 + + -- Level 4 + "ccccccccccccc", -- 0 + "haaaaaaaaaaah", -- 1 + ".a...i.i...a.", -- 2 + ".a.........a.", -- 3 + ".a.........a.", -- 4 + ".a.........a.", -- 5 + ".a..j..j...a.", -- 6 + "kaaaaaaaaaaak", -- 7 + "lllllllllllll", -- 8 + + -- Level 5 + ".............", -- 0 + "ccccccccccccc", -- 1 + "haaaaaaaaaaah", -- 2 + ".a.........a.", -- 3 + ".a.........a.", -- 4 + ".a.........a.", -- 5 + "kaaaaaaaaaaak", -- 6 + "lllllllllllll", -- 7 + ".............", -- 8 + + -- Level 6 + ".............", -- 0 + ".............", -- 1 + "ccccccccccccc", -- 2 + "haaaaaaaaaaah", -- 3 + ".a.........a.", -- 4 + "kaaaaaaaaaaak", -- 5 + "lllllllllllll", -- 6 + ".............", -- 7 + ".............", -- 8 + + -- Level 7 + ".............", -- 0 + ".............", -- 1 + ".............", -- 2 + "ccccccccccccc", -- 3 + "aaaaaaaaaaaaa", -- 4 + "lllllllllllll", -- 5 + ".............", -- 6 + ".............", -- 7 + ".............", -- 8 + + }, + }, -- House13x9 + + + + { + OriginData = + { + ExportName = "House15x9", + Name = "Desert 13", + GalleryName = "Desert", + GalleryIndex = "13", + ID = "118", + CreatorName = "xoft", + }, + Size = + { + x = 15, + y = 8, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 15, + MaxY = 7, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 6, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:102: 0", -- glasspane + "g: 64: 9", -- wooddoorblock + "h:128: 7", -- sandstonestairs + "i: 50: 3", -- torch + "j: 50: 4", -- torch + "k:128: 6", -- sandstonestairs + "l:128: 3", -- sandstonestairs + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmmaaammmmmmm", -- 0 + "maaaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaaam", -- 3 + "maaaaaaaaaaaaam", -- 4 + "maaaaaaaaaaaaam", -- 5 + "maaaaaaaaaaaaam", -- 6 + "maaaaaaaaaaaaam", -- 7 + "mmmmmmmmmmmmmmm", -- 8 + + -- Level 1 + ".....bcd.......", -- 0 + ".aaaaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaaaa.", -- 5 + ".aaaaaaaaaaaaa.", -- 6 + ".aaaaaaaaaaaaa.", -- 7 + "...............", -- 8 + + -- Level 2 + "...............", -- 0 + ".aaaaaeaaaaaaa.", -- 1 + ".a...........a.", -- 2 + ".a...........a.", -- 3 + ".a...........a.", -- 4 + ".a...........a.", -- 5 + ".a...........a.", -- 6 + ".aaaaaaaaaaaaa.", -- 7 + "...............", -- 8 + + -- Level 3 + "...............", -- 0 + ".afffagaffaffa.", -- 1 + ".f...........f.", -- 2 + ".f...........f.", -- 3 + ".a...........a.", -- 4 + ".f...........f.", -- 5 + ".f...........f.", -- 6 + ".affaffaffaffa.", -- 7 + "...............", -- 8 + + -- Level 4 + "ccccccccccccccc", -- 0 + "haaaaaaaaaaaaah", -- 1 + ".a...i.i..i..a.", -- 2 + ".a...........a.", -- 3 + ".a...........a.", -- 4 + ".a...........a.", -- 5 + ".a..j..j..j..a.", -- 6 + "kaaaaaaaaaaaaak", -- 7 + "lllllllllllllll", -- 8 + + -- Level 5 + "...............", -- 0 + "ccccccccccccccc", -- 1 + "haaaaaaaaaaaaah", -- 2 + ".a...........a.", -- 3 + ".a...........a.", -- 4 + ".a...........a.", -- 5 + "kaaaaaaaaaaaaak", -- 6 + "lllllllllllllll", -- 7 + "...............", -- 8 + + -- Level 6 + "...............", -- 0 + "...............", -- 1 + "ccccccccccccccc", -- 2 + "haaaaaaaaaaaaah", -- 3 + ".a...........a.", -- 4 + "kaaaaaaaaaaaaak", -- 5 + "lllllllllllllll", -- 6 + "...............", -- 7 + "...............", -- 8 + + -- Level 7 + "...............", -- 0 + "...............", -- 1 + "...............", -- 2 + "ccccccccccccccc", -- 3 + "aaaaaaaaaaaaaaa", -- 4 + "lllllllllllllll", -- 5 + "...............", -- 6 + "...............", -- 7 + "...............", -- 8 + + }, + }, -- House15x9 + + + + { + OriginData = + { + ExportName = "HouseL14x12", + Name = "Desert 14", + GalleryName = "Desert", + GalleryIndex = "14", + ID = "124", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 14, + y = 8, + z = 12, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 14, + MaxY = 7, + MaxZ = 12, + }, + Connectors = + { + { + Type = -1, + RelX = 5, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e:128: 3", -- sandstonestairs + "f: 64: 3", -- wooddoorblock + "g: 64: 1", -- wooddoorblock + "h:102: 0", -- glasspane + "i: 64: 9", -- wooddoorblock + "j: 64: 8", -- wooddoorblock + "k:128: 7", -- sandstonestairs + "l: 50: 3", -- torch + "m: 19: 0", -- sponge + "n: 50: 2", -- torch + "o: 50: 4", -- torch + "p:128: 6", -- sandstonestairs + "q: 50: 1", -- torch + "r:128: 5", -- sandstonestairs + "s:128: 4", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "mmmmaaammmmmmm", -- 0 + "maaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaam", -- 3 + "maaaaaaaaaaaam", -- 4 + "maaaaaaaaaaaam", -- 5 + "maaaaaaaaaaaam", -- 6 + "maaaaaaaaaaaam", -- 7 + "mmmmaaaaaaaaam", -- 8 + "mmmmmmaaaaaaam", -- 9 + "mmmmmmaaaaaaam", -- 10 + "mmmmmmmmmmmmmm", -- 11 + + -- Level 1 + "....bcd.......", -- 0 + ".aaaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaaa.", -- 5 + ".aaaaaaaaaaaa.", -- 6 + ".aaaaaaaaaaaa.", -- 7 + "....beaaaaaaa.", -- 8 + "mmmmm.aaaaaaa.", -- 9 + "mmmmm.aaaaaaa.", -- 10 + "mmmmm.........", -- 11 + + -- Level 2 + "..............", -- 0 + ".aaaafaaaaaaa.", -- 1 + ".a..........a.", -- 2 + ".a..........a.", -- 3 + ".a..........a.", -- 4 + ".a..........a.", -- 5 + ".a..........a.", -- 6 + ".aaaaga.....a.", -- 7 + "......a.....a.", -- 8 + "mmmmm.a.....a.", -- 9 + "mmmmm.aaaaaaa.", -- 10 + "mmmmm.........", -- 11 + + -- Level 3 + "..............", -- 0 + ".ahhaiahhahha.", -- 1 + ".h..........h.", -- 2 + ".h..........h.", -- 3 + ".a..........a.", -- 4 + ".h..........h.", -- 5 + ".h..........h.", -- 6 + ".ahhaja.....a.", -- 7 + "......h.....h.", -- 8 + "mmmmm.h.....h.", -- 9 + "mmmmm.ahhahha.", -- 10 + "mmmmm.........", -- 11 + + -- Level 4 + "cccccccccccccc", -- 0 + "kaaaaaaaaaaaad", -- 1 + ".a..l.l.....ad", -- 2 + ".a..........ad", -- 3 + ".a.........nad", -- 4 + ".a..........ad", -- 5 + ".a..o.o.....ad", -- 6 + "paaaaaaq...nad", -- 7 + "eeeeeba.....ad", -- 8 + "mmmmmba.....ad", -- 9 + "mmmmmbaaaaaaad", -- 10 + "mmmmmbr.....sd", -- 11 + + -- Level 5 + "..............", -- 0 + "ccccccccccccd.", -- 1 + "kaaaaaaaaaaad.", -- 2 + ".a.........ad.", -- 3 + ".a.........ad.", -- 4 + ".a.........ad.", -- 5 + "paaaaaaa...ad.", -- 6 + "eeeeeeba...ad.", -- 7 + "......ba...ad.", -- 8 + "mmmmm.ba...ad.", -- 9 + "mmmmm.baaaaad.", -- 10 + "mmmmm.br...sd.", -- 11 + + -- Level 6 + "..............", -- 0 + "..............", -- 1 + "cccccccccccc..", -- 2 + "kaaaaaaaaaad..", -- 3 + ".a........ad..", -- 4 + "paaaaaaaa.ad..", -- 5 + "eeeeeeeea.ad..", -- 6 + ".......ba.ad..", -- 7 + ".......ba.ad..", -- 8 + "mmmmm..ba.ad..", -- 9 + "mmmmm..baaad..", -- 10 + "mmmmm..br.sd..", -- 11 + + -- Level 7 + "..............", -- 0 + "..............", -- 1 + "..............", -- 2 + "ccccccccccc...", -- 3 + "aaaaaaaaaad...", -- 4 + "eeeeeeeebad...", -- 5 + "........bad...", -- 6 + "........bad...", -- 7 + "........bad...", -- 8 + "mmmmm...bad...", -- 9 + "mmmmm...bad...", -- 10 + "mmmmm...bad...", -- 11 + + }, + }, -- HouseL14x12 + + + + { + OriginData = + { + ExportName = "House13x7", + Name = "Desert 15", + GalleryName = "Desert", + GalleryIndex = "15", + ID = "125", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 13, + y = 7, + z = 7, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 13, + MaxY = 6, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 6, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:102: 0", -- glasspane + "g: 64: 9", -- wooddoorblock + "h:128: 7", -- sandstonestairs + "i: 50: 3", -- torch + "j: 50: 4", -- torch + "k:128: 6", -- sandstonestairs + "l:128: 3", -- sandstonestairs + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmmaaammmmm", -- 0 + "maaaaaaaaaaam", -- 1 + "maaaaaaaaaaam", -- 2 + "maaaaaaaaaaam", -- 3 + "maaaaaaaaaaam", -- 4 + "maaaaaaaaaaam", -- 5 + "mmmmmmmmmmmmm", -- 6 + + -- Level 1 + ".....bcd.....", -- 0 + ".aaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaa.", -- 5 + ".............", -- 6 + + -- Level 2 + ".............", -- 0 + ".aaaaaeaaaaa.", -- 1 + ".a.........a.", -- 2 + ".a.........a.", -- 3 + ".a.........a.", -- 4 + ".aaaaaaaaaaa.", -- 5 + ".............", -- 6 + + -- Level 3 + ".............", -- 0 + ".afffagafffa.", -- 1 + ".f.........f.", -- 2 + ".f.........f.", -- 3 + ".f.........f.", -- 4 + ".affafffaffa.", -- 5 + ".............", -- 6 + + -- Level 4 + "ccccccccccccc", -- 0 + "haaaaaaaaaaah", -- 1 + ".a...i.i...a.", -- 2 + ".a.........a.", -- 3 + ".a..j...j..a.", -- 4 + "kaaaaaaaaaaak", -- 5 + "lllllllllllll", -- 6 + + -- Level 5 + ".............", -- 0 + "ccccccccccccc", -- 1 + "haaaaaaaaaaah", -- 2 + ".a.........a.", -- 3 + "kaaaaaaaaaaak", -- 4 + "lllllllllllll", -- 5 + ".............", -- 6 + + -- Level 6 + ".............", -- 0 + ".............", -- 1 + "ccccccccccccc", -- 2 + "aaaaaaaaaaaaa", -- 3 + "lllllllllllll", -- 4 + ".............", -- 5 + ".............", -- 6 + + }, + }, -- House13x7 + + + + { + OriginData = + { + ExportName = "House16x9", + Name = "Desert 16", + GalleryName = "Desert", + GalleryIndex = "16", + ID = "126", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 16, + y = 8, + z = 9, + }, + Hitbox = + { + MinX = -1, + MinY = 0, + MinZ = 0, + MaxX = 16, + MaxY = 7, + MaxZ = 9, + }, + Connectors = + { + { + Type = -1, + RelX = 9, + RelY = 1, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b:128: 0", -- sandstonestairs + "c:128: 2", -- sandstonestairs + "d:128: 1", -- sandstonestairs + "e: 64: 3", -- wooddoorblock + "f:102: 0", -- glasspane + "g: 64: 9", -- wooddoorblock + "h:128: 7", -- sandstonestairs + "i: 50: 3", -- torch + "j: 50: 4", -- torch + "k:128: 6", -- sandstonestairs + "l:128: 3", -- sandstonestairs + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "mmmmmmmmaaammmmm", -- 0 + "maaaaaaaaaaaaaam", -- 1 + "maaaaaaaaaaaaaam", -- 2 + "maaaaaaaaaaaaaam", -- 3 + "maaaaaaaaaaaaaam", -- 4 + "maaaaaaaaaaaaaam", -- 5 + "maaaaaaaaaaaaaam", -- 6 + "maaaaaaaaaaaaaam", -- 7 + "mmmmmmmmmmmmmmmm", -- 8 + + -- Level 1 + "........bcd.....", -- 0 + ".aaaaaaaaaaaaaa.", -- 1 + ".aaaaaaaaaaaaaa.", -- 2 + ".aaaaaaaaaaaaaa.", -- 3 + ".aaaaaaaaaaaaaa.", -- 4 + ".aaaaaaaaaaaaaa.", -- 5 + ".aaaaaaaaaaaaaa.", -- 6 + ".aaaaaaaaaaaaaa.", -- 7 + "................", -- 8 + + -- Level 2 + "................", -- 0 + ".aaaaaaaaeaaaaa.", -- 1 + ".a............a.", -- 2 + ".a............a.", -- 3 + ".a............a.", -- 4 + ".a............a.", -- 5 + ".a............a.", -- 6 + ".aaaaaaaaaaaaaa.", -- 7 + "................", -- 8 + + -- Level 3 + "................", -- 0 + ".affafffagafffa.", -- 1 + ".f............f.", -- 2 + ".f............f.", -- 3 + ".a............a.", -- 4 + ".f............f.", -- 5 + ".f............f.", -- 6 + ".affaffafffaffa.", -- 7 + "................", -- 8 + + -- Level 4 + "cccccccccccccccc", -- 0 + "haaaaaaaaaaaaaah", -- 1 + ".a..i...i.i...a.", -- 2 + ".a............a.", -- 3 + ".a............a.", -- 4 + ".a............a.", -- 5 + ".a..j..j...j..a.", -- 6 + "kaaaaaaaaaaaaaak", -- 7 + "llllllllllllllll", -- 8 + + -- Level 5 + "................", -- 0 + "cccccccccccccccc", -- 1 + "haaaaaaaaaaaaaah", -- 2 + ".a............a.", -- 3 + ".a............a.", -- 4 + ".a............a.", -- 5 + "kaaaaaaaaaaaaaak", -- 6 + "llllllllllllllll", -- 7 + "................", -- 8 + + -- Level 6 + "................", -- 0 + "................", -- 1 + "cccccccccccccccc", -- 2 + "haaaaaaaaaaaaaah", -- 3 + ".a............a.", -- 4 + "kaaaaaaaaaaaaaak", -- 5 + "llllllllllllllll", -- 6 + "................", -- 7 + "................", -- 8 + + -- Level 7 + "................", -- 0 + "................", -- 1 + "................", -- 2 + "cccccccccccccccc", -- 3 + "aaaaaaaaaaaaaaaa", -- 4 + "llllllllllllllll", -- 5 + "................", -- 6 + "................", -- 7 + "................", -- 8 + + }, + }, -- House16x9 + + + + { + OriginData = + { + ExportName = "SingleField", + Name = "Desert 17", + GalleryName = "Desert", + GalleryIndex = "17", + ID = "127", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 10, + y = 3, + z = 7, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = -1, + MaxX = 10, + MaxY = 2, + MaxZ = 7, + }, + Connectors = + { + { + Type = -1, + RelX = 0, + RelY = 1, + RelZ = 3, + Direction = 4, -- X- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["IsStarting"] = "0", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 24: 0", -- sandstone + "b: 60: 7", -- tilleddirt + "c: 8: 0", -- water + "d: 50: 5", -- torch + "e: 59: 7", -- crops + "m: 19: 0", -- sponge + }, + BlockData = + { + -- Level 0 + "aaaaaaaaaa", -- 0 + "aaaaaaaaaa", -- 1 + "aaaaaaaaaa", -- 2 + "aaaaaaaaaa", -- 3 + "aaaaaaaaaa", -- 4 + "aaaaaaaaaa", -- 5 + "aaaaaaaaaa", -- 6 + + -- Level 1 + "aaaaaaaaaa", -- 0 + "abbbbbbbba", -- 1 + "abbbbbbbba", -- 2 + "acccccccca", -- 3 + "abbbbbbbba", -- 4 + "abbbbbbbba", -- 5 + "aaaaaaaaaa", -- 6 + + -- Level 2 + "d........d", -- 0 + ".eeeeeeee.", -- 1 + ".eeeeeeee.", -- 2 + "..........", -- 3 + ".eeeeeeee.", -- 4 + ".eeeeeeee.", -- 5 + "d........d", -- 6 + + }, + }, -- SingleField + + + + { + OriginData = + { + ExportName = "RoofedWell", + Name = "Desert 43", + GalleryName = "Desert", + GalleryIndex = "43", + ID = "274", + CreatorName = "Aloe_vera", + }, + Size = + { + x = 7, + y = 14, + z = 7, + }, + Hitbox = + { + MinX = 0, + MinY = 0, + MinZ = 0, + MaxX = 6, + MaxY = 13, + MaxZ = 6, + }, + Connectors = + { + { + Type = 2, + RelX = 6, + RelY = 8, + RelZ = 3, + Direction = 5, -- X+ + }, + { + Type = 2, + RelX = 3, + RelY = 8, + RelZ = 6, + Direction = 3, -- Z+ + }, + { + Type = 2, + RelX = 0, + RelY = 8, + RelZ = 3, + Direction = 4, -- X- + }, + { + Type = 2, + RelX = 3, + RelY = 8, + RelZ = 0, + Direction = 2, -- Z- + }, + }, + Metadata = + { + ["DefaultWeight"] = "100", + ["AllowedRotations"] = "7", + ["MergeStrategy"] = "msSpongePrint", + ["IsStarting"] = "1", + ["DepthWeight"] = "", + ["ShouldExpandFloor"] = "1", + ["MoveToGround"] = "1", + ["AddWeightIfSame"] = "0", + }, + BlockDefinitions = + { + ".: 0: 0", -- air + "a: 1: 0", -- stone + "b: 24: 0", -- sandstone + "c: 8: 0", -- water + "d: 12: 0", -- sand + "e: 4: 0", -- cobblestone + "f: 13: 0", -- gravel + "g:118: 3", -- cauldronblock + "h: 85: 0", -- fence + "i:128: 2", -- sandstonestairs + "j:128: 7", -- sandstonestairs + "k:128: 4", -- sandstonestairs + "l:128: 5", -- sandstonestairs + "m: 19: 0", -- sponge + "n:128: 6", -- sandstonestairs + "o:128: 3", -- sandstonestairs + }, + BlockData = + { + -- Level 0 + "aaaaaaa", -- 0 + "aaaaaaa", -- 1 + "aaaaaaa", -- 2 + "aaaaaaa", -- 3 + "aaaaaaa", -- 4 + "aaaaaaa", -- 5 + "aaaaaaa", -- 6 + + -- Level 1 + "aaaaaaa", -- 0 + "abbbbba", -- 1 + "abcccba", -- 2 + "abcccba", -- 3 + "abcccba", -- 4 + "abbbbba", -- 5 + "aaaaaaa", -- 6 + + -- Level 2 + "aaaaaaa", -- 0 + "abbbbba", -- 1 + "abcccba", -- 2 + "abcccba", -- 3 + "abcccba", -- 4 + "abbbbba", -- 5 + "aaaaaaa", -- 6 + + -- Level 3 + "aaaaaaa", -- 0 + "abbbbba", -- 1 + "abcccba", -- 2 + "abcccba", -- 3 + "abcccba", -- 4 + "abbbbba", -- 5 + "aaaaaaa", -- 6 + + -- Level 4 + "ddddddd", -- 0 + "dbbbbbd", -- 1 + "dbcccbd", -- 2 + "dbcccbd", -- 3 + "dbcccbd", -- 4 + "dbbbbbd", -- 5 + "ddddddd", -- 6 + + -- Level 5 + "ddddddd", -- 0 + "dbbbbbd", -- 1 + "dbcccbd", -- 2 + "dbcccbd", -- 3 + "dbcccbd", -- 4 + "dbbbbbd", -- 5 + "ddddddd", -- 6 + + -- Level 6 + "ddeeedd", -- 0 + "dbbbbbd", -- 1 + "ebcccbe", -- 2 + "ebcccbe", -- 3 + "ebcccbe", -- 4 + "dbbbbbd", -- 5 + "ddeeedd", -- 6 + + -- Level 7 + "ddfffdd", -- 0 + "dbbbbbd", -- 1 + "fbcccbf", -- 2 + "fbcccbf", -- 3 + "fbcccbf", -- 4 + "dbbbbbd", -- 5 + "ddfffdd", -- 6 + + -- Level 8 + ".......", -- 0 + ".bbbbb.", -- 1 + ".b...b.", -- 2 + ".b.g.b.", -- 3 + ".b...b.", -- 4 + ".bbbbb.", -- 5 + ".......", -- 6 + + -- Level 9 + ".......", -- 0 + ".h...h.", -- 1 + ".......", -- 2 + "...h...", -- 3 + ".......", -- 4 + ".h...h.", -- 5 + ".......", -- 6 + + -- Level 10 + ".......", -- 0 + ".h...h.", -- 1 + ".......", -- 2 + "...h...", -- 3 + ".......", -- 4 + ".h...h.", -- 5 + ".......", -- 6 + + -- Level 11 + "iiiiiii", -- 0 + "jbjjjbj", -- 1 + ".k...l.", -- 2 + ".k.h.l.", -- 3 + ".k...l.", -- 4 + "nbnnnbn", -- 5 + "ooooooo", -- 6 + + -- Level 12 + ".......", -- 0 + "iiiiiii", -- 1 + "jb...bj", -- 2 + ".b.h.b.", -- 3 + "nb...bn", -- 4 + "ooooooo", -- 5 + ".......", -- 6 + + -- Level 13 + ".......", -- 0 + ".......", -- 1 + "iiiiiii", -- 2 + "bbbbbbb", -- 3 + "ooooooo", -- 4 + ".......", -- 5 + ".......", -- 6 + + }, + }, -- RoofedWell + }, -- Pieces +} + + + + diff --git a/Server/README.txt b/Server/README.txt new file mode 100644 index 000000000..3cddc37d2 --- /dev/null +++ b/Server/README.txt @@ -0,0 +1,20 @@ +/============================\ +| Custom Minecraft Server | +| (MCServer) | +| | +| Founder: Kevin Bansberg | +| A.K.A. FakeTruth | +| Lead dev: Mattes D | +| A.K.A. _Xoft(o) | +| A.K.A. xoft | +| Monsters by Alex Sonek | +| A.K.A. Duralex | +|============================| +| Info: www.mc-server.org | +| www.ae-c.net | +| www.rbthinktank.com | +| Mail: faketruth@gmail.com | +\============================/ + +Compatible clients: 1.7.x and 1.8.x +Compatible protocol versions: 4, 5, 47 diff --git a/Server/crafting.txt b/Server/crafting.txt new file mode 100644 index 000000000..243e52fdb --- /dev/null +++ b/Server/crafting.txt @@ -0,0 +1,645 @@ +# This file describes the crafting recipes that MCServer knows. +# The syntax is as follows: +# = # +# = = | | ... | +# = , : , : , ..., : +# = [^] +# , = "1" .. "3", or "*" for any value. "*:*" can be replaced by a single "*". +# = [^] [, ] +# +# The Xn, Yn coordinates are a reference to the crafting grid: +# 1:1 | 2:1 | 3:1 +# 1:2 | 2:2 | 3:2 +# 1:3 | 2:3 | 3:3 +# +# can be either a number, or an item name (checked against items.ini) +# +# ^ is optional, if not present, the default damage for the given item is used +# +# If the DamageValue in the ingredients list is set to -1, the ingredient matches the specified item with any DamageValue. +# This is used e. g. for "any planks -> sticks", or beds using any color wool etc. +# +# Ingredients with an asterisk for a coord will not match already matched crafting grid items. This enables simplifying some of the recipes, +# e. g. hoe: "Iron, 2:1, *:1" +# -- this means "one iron at 2:1, and another one at either 1:1 or 3:1" +# +# To require multiple items of the same type in a slot, specify the slot number several times: +# "Iron, 1:1, 2:2, 2:2" +# -- this means "take one iron from slot 1:1 and two irons from slot 2:2" +# Note that asterisked items cannot require multiple items in a single slot. +# +# Note that due to technical problems, it is NOT advised to use asterisked ingredients in crossing directions, such as "*:1, "2:*". +# The parser may be unable to match such a recipe to the crafting grid! +# +# Whitespace is optional. Use it reasonably. Please do NOT use Tabs in the middle of lines! + + + + + +#******************************************************# +# Basic Crafts +# + +# Need to list each of the four log types, otherwise all logs would get converted into apple planks (^0) + +OakPlanks, 4 = OakLog, * +SprucePlanks, 4 = SpruceLog, * +BirchPlanks, 4 = BirchLog, * +JunglePlanks, 4 = JungleLog, * +AcaciaPlanks, 4 = AcaciaLog, * +DarkOakPlanks, 4 = DarkOakLog, * +Stick, 4 = Planks^-1, 2:2, 2:3 +Torch, 4 = Stick, 1:2 | Coal^-1, 1:1 +Workbench = Planks^-1, 1:1, 1:2, 2:1, 2:2 +Chest = Planks^-1, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 +TrappedChest = TripWireHook, 1:1 | Chest, 2:1 +EnderChest = EyeOfEnder, 2:2 | Obsidian, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 +Furnace = Cobblestone, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 + + + + + +#******************************************************# +# Blocks +# +IronBlock = IronIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +GoldBlock = GoldIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +DiamondBlock = Diamond, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +LapisBlock = LapisLazuli, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +EmeraldBlock = Emerald, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +RedstoneBlock = RedstoneDust, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +CoalBlock = Coal, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +QuartzBlock = NetherQuartz, 1:1, 1:2, 2:1, 2:2 +NetherBrick = netherbrickitem, 1:1, 1:2, 2:1, 2:2 +Glowstone = GlowstoneDust, 1:1, 1:2, 2:1, 2:2 +Wool = String, 1:1, 1:2, 2:1, 2:2 +TNT = Gunpowder, 1:1, 3:1, 2:2, 1:3, 3:3 | Sand, 2:1, 1:2, 3:2, 2:3 +PillarQuartzBlock, 2 = QuartzBlock, 1:1, 1:2 +ChiseledQuartzBlock = QuartzSlab, 1:1, 1:2 +HayBale = Wheat, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +SnowBlock = SnowBall, 1:1, 1:2, 2:1, 2:2 +ClayBlock = Clay, 1:1, 1:2, 2:1, 2:2 +BrickBlock = Brick, 1:1, 1:2, 2:1, 2:2 +PolishedGranite, 4 = Granite, 1:1, 1:2, 2:1, 2:2 +PolishedDiorite, 4 = Diorite, 1:1, 1:2, 2:1, 2:2 +PolishedAndesite, 4 = Andesite, 1:1, 1:2, 2:1, 2:2 +Granite, 2 = Diorite, * | NetherQuartz, * +Diorite, 2 = Cobblestone, * | NetherQuartz, * +Andesite, 2 = Diorite, * | Cobblestone, * +StoneBrick, 4 = Stone, 1:1, 1:2, 2:1, 2:2 +BookShelf = Planks^-1, 1:1, 2:1, 3:1, 1:3, 2:3, 3:3 | Book, 1:2, 2:2, 3:2 +Sandstone, 4 = Sand, 1:1, 1:2, 2:1, 2:2 +SmoothSandstone, 4 = Sandstone, 1:1, 1:2, 2:1, 2:2 +OrnamentSandstone = SandstoneSlab, 1:1, 1:2 +JackOLantern = Pumpkin, 1:1 | Torch, 1:2 +CoarsedDirt, 4 = Dirt, 1:1, 2:2 | Gravel, 1:2, 2:1 +CoarsedDirt, 4 = Gravel, 1:1, 2:2 | Dirt, 1:2, 2:1 +SlimeBlock = Slimeball, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +Prismarine = PrismarineShard, 1:1, 1:2, 2:1, 2:2 +PrismarineBricks = PrismarineShard, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +DarkPrismarine = PrismarineShard, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | Inksac, 2:2 +SeaLantern = PrismarineShard, 1:1, 1:3, 3:1, 3:3 | PrismarineCrystals, 1:2, 2:1, 2:2, 2:3, 3:2 +RedSandstone, 4 = RedSand, 1:1, 1:2, 2:1, 2:2 +ChiseledRedSandstone, 4 = RedSandstoneSlab, 1:1, 1:2 +SmoothRedSandstone, 4 = RedSand, 1:1, 1:2, 2:1, 2:2 +MossyStoneBrick = Stonebrick, * | Vines, * +Leather = RabbitHide, 1:1, 1:2, 2:1, 2:2 + +# Slabs: +StoneSlab, 6 = Stone, 1:1, 2:1, 3:1 +SandstoneSlab, 6 = Sandstone, 1:1, 2:1, 3:1 +SpruceWoodSlab, 6 = SprucePlanks, 1:1, 2:1, 3:1 +BirchWoodSlab, 6 = BirchPlanks, 1:1, 2:1, 3:1 +JungleWoodSlab, 6 = JunglePlanks, 1:1, 2:1, 3:1 +AcaciaWoodSlab, 6 = AcaciaPlanks, 1:1, 2:1, 3:1 +DarkOakWoodSlab, 6 = DarkOakPlanks, 1:1, 2:1, 3:1 +OakWoodSlab, 6 = OakPlanks, 1:1, 2:1, 3:1 +CobblestoneSlab, 6 = Cobblestone, 1:1, 2:1, 3:1 +BrickSlab, 6 = BrickBlock, 1:1, 2:1, 3:1 +StonebrickSlab, 6 = StoneBrick, 1:1, 2:1, 3:1 +NetherbrickSlab, 6 = NetherBrick, 1:1, 2:1, 3:1 +Quartzslab, 6 = QuartzBlock, 1:1, 2:1, 3:1 +snow, 6 = SnowBlock, 1:1, 2:1, 3:1 +RedSandstoneSlab, 6 = RedSandstone, 1:1, 2:1, 3:1 + + +# Stairs: +SpruceWoodStairs, 4 = SprucePlanks, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +SpruceWoodStairs, 4 = SprucePlanks, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +BirchWoodStairs, 4 = BirchPlanks, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +BirchWoodStairs, 4 = BirchPlanks, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +JungleWoodStairs, 4 = JunglePlanks, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +JungleWoodStairs, 4 = JunglePlanks, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +AcaciaWoodStairs, 4 = AcaciaPlanks, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +AcaciaWoodStairs, 4 = AcaciaPlanks, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +DarkOakWoodStairs, 4 = DarkOakPlanks, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +DarkOakWoodStairs, 4 = DarkOakPlanks, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +WoodStairs, 4 = OakPlanks, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +WoodStairs, 4 = OakPlanks, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +cobblestoneStairs, 4 = Cobblestone, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +cobblestoneStairs, 4 = Cobblestone, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +BrickStairs, 4 = BrickBlock, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +BrickStairs, 4 = BrickBlock, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +SandstoneStairs, 4 = Sandstone, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +SandstoneStairs, 4 = Sandstone, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +NetherBrickStairs, 4 = NetherBrick, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +NetherBrickStairs, 4 = NetherBrick, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +quartzstairs, 4 = QuartzBlock, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +quartzstairs, 4 = QuartzBlock, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +StoneBrickStairs, 4 = StoneBrick, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3 +StoneBrickStairs, 4 = StoneBrick, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +RedSandstoneStairs, 4 = RedSandstone, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 +RedSandstoneStairs, 4 = RedSandstone, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3 + + + +#******************************************************# +# Tools +# + +# Axes: +WoodenAxe = Stick, 2:2, 2:3 | Planks^-1, 2:1, 1:1, 1:2 +WoodenAxe = Stick, 2:2, 2:3 | Planks^-1, 2:1, 3:1, 3:2 +StoneAxe = Stick, 2:2, 2:3 | Cobblestone, 2:1, 1:1, 1:2 +StoneAxe = Stick, 2:2, 2:3 | Cobblestone, 2:1, 3:1, 3:2 +GoldenAxe = Stick, 2:2, 2:3 | GoldIngot, 2:1, 1:1, 1:2 +GoldenAxe = Stick, 2:2, 2:3 | GoldIngot, 2:1, 3:1, 3:2 +IronAxe = Stick, 2:2, 2:3 | IronIngot, 2:1, 1:1, 1:2 +IronAxe = Stick, 2:2, 2:3 | IronIngot, 2:1, 3:1, 3:2 +DiamondAxe = Stick, 2:2, 2:3 | Diamond, 2:1, 1:1, 1:2 +DiamondAxe = Stick, 2:2, 2:3 | Diamond, 2:1, 3:1, 3:2 + +# Pickaxes: +WoodenPickaxe = Stick, 2:2, 2:3 | Planks^-1, 1:1, 2:1, 3:1 +StonePickaxe = Stick, 2:2, 2:3 | Cobblestone, 1:1, 2:1, 3:1 +GoldenPickaxe = Stick, 2:2, 2:3 | GoldIngot, 1:1, 2:1, 3:1 +IronPickaxe = Stick, 2:2, 2:3 | IronIngot, 1:1, 2:1, 3:1 +DiamondPickaxe = Stick, 2:2, 2:3 | Diamond, 1:1, 2:1, 3:1 + +# Shovels: +WoodenShovel = Stick, 2:2, 2:3 | Planks^-1, 2:1 +StoneShovel = Stick, 2:2, 2:3 | Cobblestone, 2:1 +GoldenShovel = Stick, 2:2, 2:3 | GoldIngot, 2:1 +IronShovel = Stick, 2:2, 2:3 | IronIngot, 2:1 +DiamondShovel = Stick, 2:2, 2:3 | Diamond, 2:1 + +# Hoes: +WoodenHoe = Stick, 2:2, 2:3 | Planks^-1, 2:1, *:1 +StoneHoe = Stick, 2:2, 2:3 | Cobblestone, 2:1, *:1 +GoldenHoe = Stick, 2:2, 2:3 | GoldIngot, 2:1, *:1 +IronHoe = Stick, 2:2, 2:3 | IronIngot, 2:1, *:1 +DiamondHoe = Stick, 2:2, 2:3 | Diamond, 2:1, *:1 + +Lighter = IronIngot, 1:1 | Flint, 2:2 +Lighter = IronIngot, 2:1 | Flint, 1:2 +Bucket = IronIngot, 1:1, 2:2, 3:1 +Compass = IronIngot, 2:1, 1:2, 3:2, 2:3 | RedstoneDust, 2:2 +EmptyMap = Paper, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | Compass, 2:2 +Watch = GoldIngot, 2:1, 1:2, 3:2, 2:3 | RedstoneDust, 2:2 +FishingRod = Stick, 1:3, 2:2, 3:1 | String, 3:2, 3:3 +FishingRod = Stick, 3:3, 2:2, 1:1 | String, 1:2, 1:3 +Shears = IronIngot, 1:1, 2:2 +Shears = IronIngot, 2:1, 1:2 +FireCharge = BlazePowder, * | Coal, * | Gunpowder, * +Lead = String, 1:1, 1:2, 2:1, 3:3 | Slimeball, 2:2 + + + + + +#******************************************************# +# Weapons +# +WoodenSword = Stick, 2:3 | Planks^-1, 2:1, 2:2 +StoneSword = Stick, 2:3 | Cobblestone, 2:1, 2:2 +GoldenSword = Stick, 2:3 | GoldIngot, 2:1, 2:2 +IronSword = Stick, 2:3 | IronIngot, 2:1, 2:2 +DiamondSword = Stick, 2:3 | Diamond, 2:1, 2:2 +Bow = Stick, 2:1, 1:2, 2:3 | String, 3:1, 3:2, 3:3 +Bow = Stick, 2:1, 3:2, 2:3 | String, 1:1, 1:2, 1:3 +Arrow, 4 = Flint, 1:1 | Stick, 1:2 | Feather, 1:3 + + + + + + +#******************************************************# +# Armor +# + +# Helmets: +LeatherHelmet = Leather, 1:1, 2:1, 3:1, 1:2, 3:2 +ChainmailHelmet = Fire, 1:1, 2:1, 3:1, 1:2, 3:2 +GoldenHelmet = GoldIngot, 1:1, 2:1, 3:1, 1:2, 3:2 +IronHelmet = IronIngot, 1:1, 2:1, 3:1, 1:2, 3:2 +DiamondHelmet = Diamond, 1:1, 2:1, 3:1, 1:2, 3:2 + +# Chestplates: +LeatherChestplate = Leather, 1:1, 3:1, 1:2, 2:2, 3:2, 1:3, 2:3, 3:3 +ChainmailChestplate = Fire, 1:1, 3:1, 1:2, 2:2, 3:2, 1:3, 2:3, 3:3 +GoldenChestplate = GoldIngot, 1:1, 3:1, 1:2, 2:2, 3:2, 1:3, 2:3, 3:3 +IronChestplate = IronIngot, 1:1, 3:1, 1:2, 2:2, 3:2, 1:3, 2:3, 3:3 +DiamondChestplate = Diamond, 1:1, 3:1, 1:2, 2:2, 3:2, 1:3, 2:3, 3:3 + +# Leggins: +LeatherPants = Leather, 1:1, 2:1, 3:1, 1:2, 3:2, 1:3, 3:3 +ChainmailPants = Fire, 1:1, 2:1, 3:1, 1:2, 3:2, 1:3, 3:3 +GoldenPants = GoldIngot, 1:1, 2:1, 3:1, 1:2, 3:2, 1:3, 3:3 +IronPants = IronIngot, 1:1, 2:1, 3:1, 1:2, 3:2, 1:3, 3:3 +DiamondPants = Diamond, 1:1, 2:1, 3:1, 1:2, 3:2, 1:3, 3:3 + +# Boots: +LeatherBoots = Leather, 1:1, 3:1, 1:2, 3:2 +ChainmailBoots = Fire, 1:1, 3:1, 1:2, 3:2 +GoldenBoots = GoldIngot, 1:1, 3:1, 1:2, 3:2 +IronBoots = IronIngot, 1:1, 3:1, 1:2, 3:2 +DiamondBoots = Diamond, 1:1, 3:1, 1:2, 3:2 + + + + + +#******************************************************# +# Transportation +# +CarrotOnAStick = FishingRod, 1:2 | Carrot, 2:3 +Minecart = IronIngot, 1:1, 3:1, 1:2, 2:2, 3:2 +PoweredMinecart = Minecart, * | Furnace, * +StorageMinecart = Minecart, * | Chest, * +TNTMinecart = Minecart, * | TNT, * +hopperminecart = Minecart, * | Hopper, * +Rails, 16 = IronIngot, 1:1, 3:1, 1:2, 3:2, 1:3, 3:3 | Stick, 2:2 +PoweredRail, 6 = GoldIngot, 1:1, 3:1, 1:2, 3:2, 1:3, 3:3 | Stick, 2:2 | RedstoneDust, 2:3 +DetectorRail, 6 = IronIngot, 1:1, 3:1, 1:2, 3:2, 1:3, 3:3 | StonePlate, 2:2 | RedstoneDust, 2:3 +Boat = Planks^-1, 1:1, 3:1, 1:2, 2:2, 3:2 +ActivatorRail, 6 = IronIngot, 1:1, 1:2, 1:3, 3:1, 3:2, 3:3 | Stick, 2:1, 2:3 | RedstoneTorchon, 2:2 + + + + +#******************************************************# +# Mechanisms +# +SpruceDoor, 3 = SprucePlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3 +BirchDoor, 3 = BirchPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3 +JungleDoor, 3 = JunglePlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3 +AcaciaDoor, 3 = AcaciaPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3 +DarkOakDoor, 3 = DarkOakPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3 +WoodenDoor, 3 = OakPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3 +IronDoor, 3 = IronIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3 +TrapDoor, 2 = Planks^-1, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2 +IronTrapDoor = IronIngot, 1:1, 1:2, 2:1, 2:2 +WoodPlate = Planks^-1, 1:1, 2:1 +StonePlate = Stone, 1:1, 2:1 +lightweightedpressureplate = IronIngot, 1:1, 2:1 +heavyweightedpressureplate = GoldIngot, 1:1, 2:1 +StoneButton = Stone, 1:1 +WoodenButton = Planks^-1, 1:1 +RedstoneTorchOn = Stick, 1:2 | RedstoneDust, 1:1 +Lever = Cobblestone, 1:2 | Stick, 1:1 +NoteBlock = Planks^-1, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | RedstoneDust, 2:2 +Jukebox = Planks^-1, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | Diamond, 2:2 +Dispenser = Cobblestone, 1:1, 1:2, 1:3, 2:1, 3:1, 3:2, 3:3 | RedstoneDust, 2:3 | Bow, 2:2 +Dropper = Cobblestone, 1:1, 2:1, 3:1, 1:2, 1:3, 3:2, 3:3 | Hopper, 2:2 | RedstoneDust, 2:3 +Repeater = Stone, 1:2, 2:2, 3:2 | RedstoneTorchOn, 1:1, 3:1 | RedstoneDust, 2:1 +Comparator = RedstoneTorchOn, 2:1, 1:2, 3:2 | NetherQuartz, 2:2 | Stone, 1:3, 2:3, 3:3 +DaylightSensor = Glass, 1:1, 2:1, 3:1 | NetherQuartz, 1:2, 2:2, 3:2 | WoodenSlab^-1, 1:3, 2:3, 3:3 +Hopper = IronIngot, 1:1, 3:1, 1:2, 3:2, 2:3 | Chest, 2:2 +Piston = Planks^-1, 1:1, 2:1, 3:1 | RedstoneDust, 2:3 | Cobblestone, 1:2, 3:2, 1:3, 3:3 | IronIngot, 2:2 +StickyPiston = Piston, * | SlimeBall, * +RedstoneLamp = RedstoneDust, 2:1, 1:2, 3:2, 2:3 | Glowstone, 2:2 +TripwireHook, 2 = Planks^-1, 2:3 | stick, 2:2 | IronIngot, 2:1 + + + + + +#******************************************************# +# Food +# +Bowl, 4 = Planks^-1, 1:1, 2:2, 3:1 +MushroomStew = Bowl, * | BrownMushroom, * | RedMushroom, * +Bread = Wheat, 1:1, 2:1, 3:1 +Sugar = Sugarcane, * +Cake = MilkBucket, 1:1, 2:1, 3:1 | Sugar, 1:2, 3:2 | Egg, 2:2 | Wheat, 1:3, 2:3, 3:3 +Cookie, 8 = Wheat, *, * | CocoaBeans, * +GoldenApple = RedApple, 2:2 | GoldIngot, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 +EnchantedGoldenApple = RedApple, 2:2 | GoldBlock, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 +Melon = MelonSlice, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +MelonSeeds = MelonSlice, * +PumpkinSeeds, 4 = Pumpkin, * +PumpkinPie = Pumpkin, * | Sugar, * | egg, * +Wheat, 9 = Haybale, * +RabbitStew = Cooked Rabbit, 2:1 | Carrot, 1:2 | BakedPotato, 2:2 | BrownMushroom, 3:2 | Bowl, 2:3 +RabbitStew = Cooked Rabbit, 2:1 | Carrot, 1:2 | BakedPotato, 2:2 | RedMushroom, 3:2 | Bowl, 2:3 + + + + + +#******************************************************# +# Miscellaneous +# + +# Minerals: +IronIngot, 9 = IronBlock, * +GoldIngot, 9 = GoldBlock, * +Diamond, 9 = DiamondBlock, * +LapisLazuli, 9 = LapisBlock, * +Emerald, 9 = EmeraldBlock, * +RedstoneDust, 9 = RedstoneBlock, * +Coal, 9 = CoalBlock, * +Clay, 4 = ClayBlock, * +SlimeBall, 9 = SlimeBlock, * + +Painting = Stick, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | Wool^-1, 2:2 +ItemFrame = Stick, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | Leather, 2:2 +Sign, 3 = Planks^-1, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2 | Stick, 2:3 +Ladder, 3 = Stick, 1:1, 3:1, 1:2, 2:2, 3:2, 1:3, 3:3 +GlassPane, 16 = Glass, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2 +IronBars, 16 = IronIngot, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2 +Paper, 3 = Sugarcane, 1:1, 2:1, 3:1 +Book = Paper, *, *, * | leather, * +Bookandquill = Book, * | feather, * | inksac, * +SpruceFence, 3 = SprucePlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2 +BirchFence, 3 = BirchPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2 +JungleFence, 3 = JunglePlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2 +DarkOakFence, 3 = DarkOakPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2 +AcaciaFence, 3 = AcaciaPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2 +Fence, 3 = OakPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2 +Cobblestonewall, 6 = cobblestone, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +mossycobblestonewall, 6 = mossycobblestone, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +NetherBrickFence, 6 = NetherBrick, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2 +SpruceFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | SprucePlanks, 2:1, 2:2 +BirchFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | BirchPlanks, 2:1, 2:2 +JungleFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | JunglePlanks, 2:1, 2:2 +DarkOakFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | DarkOakPlanks, 2:1, 2:2 +AcaciaFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | AcaciaPlanks, 2:1, 2:2 +FenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | OakPlanks, 2:1, 2:2 +Bed = Planks^-1, 1:2, 2:2, 3:2 | Wool^-1, 1:1, 2:1, 3:1 +GoldIngot = GoldNugget, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3 +EyeOfEnder = EnderPearl, * | BlazePowder, * +Beacon = Glass, 1:1, 1:2, 2:1, 3:1, 3:2 | Obsidian, 1:3, 2:3, 3:3 | NetherStar, 2:2 +Anvil = IronBlock, 1:1, 2:1, 3:1 | IronIngot, 2:2, 1:3, 2:3, 3:3 +FlowerPot = Brick, 1:2, 2:3, 3:2 +ArmorStand = Stick, 1:1, 1:3, 2:1, 2:2, 3:1, 3:3 | StoneSlab, 2:3 + +# These are just the basic ones, you can add various shapes and stuff to each of them +# ToDo: Add the various shapes (saved in NBT-Tags, not in meta) +# Banners: + +WhiteBanner = Stick, 2:3 | WhiteWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +OrangeBanner = Stick, 2:3 | OrangeWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +MagentaBanner = Stick, 2:3 | MagentaWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +LightBlueBanner = Stick, 2:3 | LightBlueWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +YellowBanner = Stick, 2:3 | YellowWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +LimeBanner = Stick, 2:3 | LimeWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +PinkBanner = Stick, 2:3 | PinkWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +GrayBanner = Stick, 2:3 | GrayWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +LightGrayBanner = Stick, 2:3 | LightGrayWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +CyanBanner = Stick, 2:3 | CyanWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +PurpleBanner = Stick, 2:3 | PurpleWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +BlueBanner = Stick, 2:3 | BlueWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +BrownBanner = Stick, 2:3 | BrownWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +GreenBanner = Stick, 2:3 | GreenWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +RedBanner = Stick, 2:3 | RedWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 +BlackBanner = Stick, 2:3 | BlackWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2 + + + + + +#******************************************************# +# Dyes +# + +WhiteDye, 3 = Bone, * +RedDye, 2 = Rose, * +YellowDye, 2 = Dandelion, * + +# Color mixing, duals: +OrangeDye, 2 = YellowDye, * | RedDye, * +CyanDye, 2 = GreenDye, * | BlueDye, * +PurpleDye, 2 = RedDye, * | BlueDye, * +GrayDye, 2 = BlackDye, * | WhiteDye, * +LtBlueDye, 2 = BlueDye, * | WhiteDye, * +PinkDye, 2 = RedDye, * | WhiteDye, * +LimeDye, 2 = GreenDye, * | WhiteDye, * +MagentaDye, 2 = PurpleDye, * | PinkDye, * +LtGrayDye, 2 = GrayDye, * | WhiteDye, * + +# triplets: +LtGrayDye, 3 = BlackDye, * | WhiteDye, *, * +MagentaDye, 3 = BlueDye, * | PinkDye, * | RedDye, * + +# quads: +MagentaDye, 4 = BlueDye, * | WhiteDye, * | RedDye, *, * + + + + + +#******************************************************# +# Colored wool: +# +WhiteWool = Wool^-1, * | BoneMeal, * +OrangeWool = WhiteWool, * | OrangeDye, * +MagentaWool = WhiteWool, * | MagentaDye, * +LightBlueWool = WhiteWool, * | LightBlueDye, * +YellowWool = WhiteWool, * | YellowDye, * +LimeWool = WhiteWool, * | LimeDye, * +PinkWool = WhiteWool, * | PinkDye, * +GrayWool = WhiteWool, * | GrayDye, * +LightGrayWool = WhiteWool, * | LightGrayDye, * +CyanWool = WhiteWool, * | CyanDye, * +PurpleWool = WhiteWool, * | PurpleDye, * +BlueWool = WhiteWool, * | BlueDye, * +BrownWool = WhiteWool, * | BrownDye, * +GreenWool = WhiteWool, * | GreenDye, * +RedWool = WhiteWool, * | RedDye, * +BlackWool = WhiteWool, * | BlackDye, * + +OrangeCarpet, 3 = OrangeWool, 1:1, 2:1 +MagentaCarpet, 3 = MagentaWool, 1:1, 2:1 +LightBlueCarpet, 3 = LightBlueWool, 1:1, 2:1 +YellowCarpet, 3 = YellowWool, 1:1, 2:1 +LimeCarpet, 3 = LimeWool, 1:1, 2:1 +PinkCarpet, 3 = PinkWool, 1:1, 2:1 +GrayCarpet, 3 = GrayWool, 1:1, 2:1 +LightGrayCarpet, 3 = LightGrayWool, 1:1, 2:1 +CyanCarpet, 3 = CyanWool, 1:1, 2:1 +PurpleCarpet, 3 = PurpleWool, 1:1, 2:1 +BlueCarpet, 3 = BlueWool, 1:1, 2:1 +BrownCarpet, 3 = BrownWool, 1:1, 2:1 +GreenCarpet, 3 = GreenWool, 1:1, 2:1 +RedCarpet, 3 = RedWool, 1:1, 2:1 +BlackCarpet, 3 = BlackWool, 1:1, 2:1 +WhiteCarpet, 3 = WhiteWool, 1:1, 2:1 + +#******************************************************# +# Stained Glass: +# +OrangeStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | OrangeDye, 2:2 +MagentaStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | MagentaDye, 2:2 +LightBlueStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | LightBlueDye, 2:2 +YellowStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | YellowDye, 2:2 +LimeStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | LimeDye, 2:2 +PinkStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | PinkDye, 2:2 +GrayStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | GrayDye, 2:2 +LightGrayStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | LightGrayDye, 2:2 +CyanStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | CyanDye, 2:2 +VioletStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | VioletDye, 2:2 +BlueStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | BlueDye, 2:2 +BrownStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | BrownDye, 2:2 +GreenStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | GreenDye, 2:2 +RedStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | RedDye, 2:2 +BlackStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | BlackDye, 2:2 +WhiteStainedGlass, 8 = Glass, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | BoneMeal, 2:2 + +#******************************************************# +# Stained Glass Pane: +# +OrangeStainedGlassPane, 16 = OrangeStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +MagentaStainedGlassPane, 16 = MagentaStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +LightBlueStainedGlassPane, 16 = LightBlueStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +YellowStainedGlassPane, 16 = YellowStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +LimeStainedGlassPane, 16 = LimeStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +PinkStainedGlassPane, 16 = PinkStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +GrayStainedGlassPane, 16 = GrayStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +LightGrayStainedGlassPane, 16 = LightGrayStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +CyanStainedGlassPane, 16 = CyanStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +VioletStainedGlassPane, 16 = VioletStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +BlueStainedGlassPane, 16 = BlueStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +BrownStainedGlassPane, 16 = BrownStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +GreenStainedGlassPane, 16 = GreenStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +RedStainedGlassPane, 16 = RedStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +BlackStainedGlassPane , 16 = BlackStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 +WhiteStainedGlassPane, 16 = WhiteStainedGlass, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3 + +#******************************************************# +# Stained Clay: +# +WhiteStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | BoneMeal, 2:2 +OrangeStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | OrangeDye, 2:2 +MagentaStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | MagentaDye, 2:2 +LightBlueStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | LightBlueDye, 2:2 +YellowStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | YellowDye, 2:2 +LimeStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | LimeDye, 2:2 +PinkStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | PinkDye, 2:2 +GrayStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | GrayDye, 2:2 +LightGrayStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | LightGrayDye, 2:2 +CyanStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | CyanDye, 2:2 +VioletStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | VioletDye, 2:2 +BlueStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | BlueDye, 2:2 +BrownStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | BrownDye, 2:2 +GreenStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | GreenDye, 2:2 +RedStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | RedDye, 2:2 +BlackStainedClay, 8 = HardenedClay, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | BlackDye, 2:2 + +#******************************************************# +# Enchantment & Brewing +# +GlassBottle, 3 = Glass, 1:1, 2:2, 3:1 +Cauldron = IronIngot, 1:1, 3:1, 1:2, 3:2, 1:3, 2:3, 3:3 +BrewingStand = Cobblestone, 1:2, 2:2, 3:2 | BlazeRod, 2:1 +BlazePowder, 2 = BlazeRod, * +MagmaCream = SlimeBall, * | BlazePowder, * +FermentedSpiderEye = SpiderEye, * | Sugar, * | BrownMushroom, * +GlisteringMelon = MelonSlice, 2:2 | GoldNugget, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 +GoldNugget, 9 = GoldIngot, * +EnchantmentTable = Obsidian, 1:3, 2:3, 3:3, 2:2 | Diamond, 1:2, 3:2 | Book, 2:1 + +#******************************************************# +# Dyed Armor +# Do not modify +LeatherHelmet = LeatherHelmet^-1, * | Dye^-1, * +LeatherHelmet = LeatherHelmet^-1, * | Dye^-1, * | Dye^-1, * +LeatherHelmet = LeatherHelmet^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherHelmet = LeatherHelmet^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherHelmet = LeatherHelmet^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherHelmet = LeatherHelmet^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherHelmet = LeatherHelmet^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherHelmet = LeatherHelmet^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * + +LeatherChestplate = LeatherChestplate^-1, * | Dye^-1, * +LeatherChestplate = LeatherChestplate^-1, * | Dye^-1, * | Dye^-1, * +LeatherChestplate = LeatherChestplate^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherChestplate = LeatherChestplate^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherChestplate = LeatherChestplate^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherChestplate = LeatherChestplate^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherChestplate = LeatherChestplate^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherChestplate = LeatherChestplate^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * + +LeatherPants = LeatherPants^-1, * | Dye^-1, * +LeatherPants = LeatherPants^-1, * | Dye^-1, * | Dye^-1, * +LeatherPants = LeatherPants^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherPants = LeatherPants^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherPants = LeatherPants^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherPants = LeatherPants^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherPants = LeatherPants^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherPants = LeatherPants^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * + +LeatherBoots = LeatherBoots^-1, * | Dye^-1, * +LeatherBoots = LeatherBoots^-1, * | Dye^-1, * | Dye^-1, * +LeatherBoots = LeatherBoots^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherBoots = LeatherBoots^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherBoots = LeatherBoots^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherBoots = LeatherBoots^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherBoots = LeatherBoots^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * +LeatherBoots = LeatherBoots^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * | Dye^-1, * + +#******************************************************# +# Fireworks & Co. +# (Best not to add non-vanilla items to this as it will cause internal firework data handling code to log warnings) + +# Ballistic firework rockets - plain and with firework star, all with 1 - 3 gunpowder +FireworkRocket = Paper, * | Gunpowder, * +FireworkRocket = Paper, * | Gunpowder, * | Gunpowder, * +FireworkRocket = Paper, * | Gunpowder, * | Gunpowder, * | Gunpowder, * +FireworkRocket = FireworkStar, * | Paper, * | Gunpowder, * +FireworkRocket = FireworkStar, * | Paper, * | Gunpowder, * | Gunpowder, * +FireworkRocket = FireworkStar, * | Paper, * | Gunpowder, * | Gunpowder, * | Gunpowder, * + +# Radioactive firework stars +# Plain powder and dye +FireworkStar = Gunpowder, * | Dye ^-1, * + +# Powder and effect, with effect combining +FireworkStar = Gunpowder, * | Dye ^-1, * | Diamond, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Glowdust, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Glowdust, * | Diamond, * + +# Powder and shape (no shape combining possible) +FireworkStar = Gunpowder, * | Dye ^-1, * | Firecharge, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Goldnugget, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Feather, * +FireworkStar = Gunpowder, * | Dye ^-1, * | SkeletonHead ^-1, * + +# Power and shape (no shape combining possible), combined with effect +FireworkStar = Gunpowder, * | Dye ^-1, * | Firecharge, * | Diamond, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Firecharge, * | Glowdust, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Goldnugget, * | Diamond, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Goldnugget, * | Glowdust, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Feather, * | Diamond, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Feather, * | Glowdust, * +FireworkStar = Gunpowder, * | Dye ^-1, * | SkeletonHead ^-1, * | Diamond, * +FireworkStar = Gunpowder, * | Dye ^-1, * | SkeletonHead ^-1, * | Glowdust, * + +# Power and shape (no shape combining possible), combined with effect (with effect combining) +FireworkStar = Gunpowder, * | Dye ^-1, * | Firecharge, * | Glowdust, * | Diamond, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Goldnugget, * | Glowdust, * | Diamond, * +FireworkStar = Gunpowder, * | Dye ^-1, * | Feather, * | Glowdust, * | Diamond, * +FireworkStar = Gunpowder, * | Dye ^-1, * | SkeletonHead ^-1, * | Glowdust, * | Diamond, * + +# Star fade colour-change +FireworkStar = FireworkStar, * | Dye ^-1, * +FireworkStar = FireworkStar, * | Dye ^-1, * | Dye ^-1, * +FireworkStar = FireworkStar, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * +FireworkStar = FireworkStar, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * +FireworkStar = FireworkStar, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * +FireworkStar = FireworkStar, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * +FireworkStar = FireworkStar, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * +FireworkStar = FireworkStar, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * | Dye ^-1, * diff --git a/Server/delete_windows_service.cmd b/Server/delete_windows_service.cmd new file mode 100644 index 000000000..14a55edfc --- /dev/null +++ b/Server/delete_windows_service.cmd @@ -0,0 +1,4 @@ +@echo off +set SERVICENAME="Cuberite" + +sc delete %SERVICENAME% diff --git a/Server/favicon.png b/Server/favicon.png new file mode 100644 index 000000000..61d201abf Binary files /dev/null and b/Server/favicon.png differ diff --git a/Server/furnace.txt b/Server/furnace.txt new file mode 100644 index 000000000..24bc35bc8 --- /dev/null +++ b/Server/furnace.txt @@ -0,0 +1,130 @@ +#*****************# +# Furnace Recipes # +#*****************# +# +# +#******************************************************# +# Basic Notation Help +# +# **** Item Definition **** +# An Item is defined by an Item Type, an amount (and damage) +# The damage is optional, and if not specified it's assumed to be 0 +# +# Cactus Green example: +# 351 : 2 ( , 1 ) +# ItemType : Damage ( , Amount ) +# or simple use the item name (marked in items.ini): +# CactusGreen ( , 1 ) +# +# +# **** Recipe and result **** +# +# Cobble @ 200 = Stone -> Produces 1 smooth stone from 1 cobblestone in 200 ticks (10 seconds) +# +# Write in full: +# Cobble : 0 , 1 @ 200 = 1 : 1 , 1 +# ItemType : Damage , Amount @ ticks = ItemType : Damage , Amount +# +# +# **** Fuel **** +# +# !17:1 = 300 -> 1 Wood burns for 300 ticks (15 s) +# +# ! Wood , 1 = 300 +# Fuel ItemType , Amount = ticks +# +#******************************************************# + + + + + +#-------------------------- +# Smelting recipes + +Cobble = Stone +IronOre = IronIngot +GoldOre = GoldIngot +NetherQuartzOre = NetherQuartz +Sand = Glass +Pork = CookedPork +RawBeef = Steak +Potato = BakedPotato +RawChicken = CookedChicken +Clay = Brick +ClayBlock = HardenedClay +Netherrack = NetherBrickItem +RawFish = CookedFish +Log = CharCoal +DarkOakLog = CharCoal +Cactus = GreenDye +WetSponge = Sponge +Stonebrick = CrackedStonebrick +RawRabbit = CookedRabbit +RawMutton = CookedMutton + + + + + +#-------------------------- +# Fuels + +! CharCoal = 1600 # -> 80 sec +! Coal = 1600 # -> 80 sec +! WoodenSlab = 15 # -> 7.5 sec +! Planks = 300 # -> 15 sec +! Stick = 100 # -> 5 sec +! Fence = 300 # -> 15 sec +! SpruceFence = 300 # -> 15 sec +! BirchFence = 300 # -> 15 sec +! JungleFence = 300 # -> 15 sec +! DarkOakFence = 300 # -> 15 sec +! AcaciaFence = 300 # -> 15 sec +! WoodStairs = 300 # -> 15 sec +! Workbench = 300 # -> 15 sec +! Bookshelf = 300 # -> 15 sec +! Chest = 300 # -> 15 sec +! Jukebox = 300 # -> 15 sec +! Lavabucket = 20000 # -> 1000 sec +! Log = 300 # -> 15 sec +! DarkOakLog = 300 # -> 15 sec +! Sapling = 100 # -> 5 sec +! CoalBlock = 16000 # -> 800 sec +! BlazeRod = 2400 # -> 120 sec +! NoteBlock = 300 # -> 15 sec +! HugeRedMushroom = 300 # -> 15 sec +! HugeBrownMushroom = 300 # -> 15 sec +! Banner = 300 # -> 15 sec +! BlackBanner = 300 # -> 15 sec +! RedBanner = 300 # -> 15 sec +! GreenBanner = 300 # -> 15 sec +! BrownBanner = 300 # -> 15 sec +! BlueBanner = 300 # -> 15 sec +! PurpleBanner = 300 # -> 15 sec +! CyanBanner = 300 # -> 15 sec +! SilverBanner = 300 # -> 15 sec +! GrayBanner = 300 # -> 15 sec +! PinkBanner = 300 # -> 15 sec +! LimeBanner = 300 # -> 15 sec +! YellowBanner = 300 # -> 15 sec +! LightBlueBanner = 300 # -> 15 sec +! MagentaBanner = 300 # -> 15 sec +! OrangeBanner = 300 # -> 15 sec +! WhiteBanner = 300 # -> 15 sec +! DaylightSensor = 300 # -> 15 sec +! FenceGate = 300 # -> 15 sec +! SpruceFenceGate = 300 # -> 15 sec +! BirchFenceGate = 300 # -> 15 sec +! JungleFenceGate = 300 # -> 15 sec +! DarkOakFenceGate = 300 # -> 15 sec +! Trapdoor = 300 # -> 15 sec +! TrappedChest = 300 # -> 15 sec +! WoodPlate = 300 # -> 15 sec +! WoodPickaxe = 200 # -> 10 sec +! WoodAxe = 200 # -> 10 sec +! WoodShovel = 200 # -> 10 sec +! WoodHoe = 200 # -> 10 sec +! WoodSword = 200 # -> 10 sec + + diff --git a/Server/hg b/Server/hg new file mode 100755 index 000000000..f79dce8e8 --- /dev/null +++ b/Server/hg @@ -0,0 +1,7 @@ +#! /bin/bash + +# This script runs MCServer under helgrind +# It expects valgrind to be normally installed and available +# Note that this is for Linux only and debug-only, since it slows down MCS way too much + +valgrind --log-file=helgrind.log --suppressions=hg.supp --gen-suppressions=all --tool=helgrind -v ./Cuberite diff --git a/Server/hg.supp b/Server/hg.supp new file mode 100644 index 000000000..27eb8c27a --- /dev/null +++ b/Server/hg.supp @@ -0,0 +1,22 @@ +# This is a valgrind suppressions file for running helgrind on MCServer +# Use by adding "--suppressions=hg.supp" to the helgrind commandline + + + + + + +# This covers GCC bug 40518, http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40518 +# "Erasing an empty string causes a global value write / race condition warning in helgrind" +# Original suppression authored by Jonathan Wakely: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40518#c20 +# Modified by Mattes to match the mangled function name used on Ubuntu + +{ + libstdcxx_std_string_race_pr40518 + Helgrind:Race + fun:_ZNSs9_M_mutateEjjj +} + + + + diff --git a/Server/install_windows_service.cmd b/Server/install_windows_service.cmd new file mode 100644 index 000000000..84d69ee1a --- /dev/null +++ b/Server/install_windows_service.cmd @@ -0,0 +1,7 @@ +rem Alter this if you need to install multiple instances. +@echo off +set SERVICENAME="Cuberite" + +set CURRENTDIR=%CD% +sc create %SERVICENAME% binPath= "%CURRENTDIR%\Cuberite.exe -d" start= auto DisplayName= %SERVICENAME% +sc description %SERVICENAME% "Minecraft server instance" diff --git a/Server/items.ini b/Server/items.ini new file mode 100644 index 000000000..5eb04619c --- /dev/null +++ b/Server/items.ini @@ -0,0 +1,887 @@ +[Items] +air=0 +stone=1 +rock=1 +granite=1:1 +polishedgranite=1:2 +diorite=1:3 +polisheddiorite=1:4 +andesite=1:5 +polishedandesite=1:6 +grass=2 +dirt=3 +coarseddirt=3:1 +podzol=3:2 +cobblestone=4 +cobble=4 +planks=5 +oakplanks=5:0 +appleplanks=5:0 +spruceplanks=5:1 +coniferplanks=5:1 +pineplanks=5:1 +darkplanks=5:1 +birchplanks=5:2 +lightplanks=5:2 +jungleplanks=5:3 +redplanks=5:3 +acaciaplanks=5:4 +darkoakplanks=5:5 +bigoakplanks=5:5 +roofedoakplanks=5:5 +sapling=6 +oaksapling=6:0 +applesapling=6:0 +sprucesapling=6:1 +conifersapling=6:1 +pinesapling=6:1 +darkplanks=6:1 +birchsapling=6:2 +whitesapling=6:2 +junglesapling=6:3 +redsapling=6:3 +acaciasapling=6:4 +darkoaksapling=6:5 +bigoaksapling=6:5 +roofedoaksapling=6:5 +bedrock=7 +adminium=7 +water=8 +flowingwater=8 +stationarywater=9 +stillwater=9 +swater=9 +lava=10 +flowinglava=10 +stationarylava=11 +stilllava=11 +slava=11 +sand=12 +redsand=12:1 +gravel=13 +goldore=14 +ironore=15 +coalore=16 +log=17 +tree=17 +oaklog=17:0 +applelog=17:0 +sprucelog=17:1 +coniferlog=17:1 +pinelog=17:1 +darklog=17:1 +birchlog=17:2 +whitelog=17:2 +junglelog=17:3 +leaves=18 +oakleaves=18:0 +appleleaves=18:0 +spruceleaves=18:1 +coniferleaves=18:1 +pineleaves=18:1 +darkleaves=18:1 +birchleaves=18:2 +whiteleaves=18:2 +jungleleaves=18:3 +sponge=19 +wetsponge=19:1 +glass=20 +lapisore=21 +lapisblock=22 +dispenser=23 +sandstone=24 +normalsandstone=24:0 +chiseledsandstone=24:1 +decorativesandstone=24:1 +ornamentsandstone=24:1 +smoothsandstone=24:2 +noteblock=25 +bedblock=26 +poweredrail=27 +detectorrail=28 +stickypiston=29 +cobweb=30 +tallgrass=31 +tallgrassone=31:1 +tallgrasstwo=31:2 +deadbush=32 +piston=33 +pistonextension=34 +pistonhead=34 +wool=35 +cloth=35 +whitewool=35:0 +orangewool=35:1 +magentawool=35:2 +lightbluewool=35:3 +ltbluewool=35:3 +yellowwool=35:4 +limewool=35:5 +ltbluewool=35:3 +lightgreenwool=35:5 +ltgreenwool=35:5 +pinkwool=35:6 +graywool=35:7 +greywool=35:7 +darkgraywool=35:7 +darkgreywool=35:7 +dkgraywool=35:7 +dkgreywool=35:7 +lightgraywool=35:8 +lightgreywool=35:8 +ltgraywool=35:8 +ltgreywool=35:8 +silverwool=35:8 +cyanwool=35:9 +purplewool=35:10 +violetwool=35:10 +bluewool=35:11 +darkbluewool=35:11 +dkbluewool=35:11 +brownwool=35:12 +greenwool=35:13 +darkgreenwool=35:13 +dkgreenwool=35:13 +redwool=35:14 +blackwool=35:15 +dandelion=37 +poppy=38 +rose=38 +flower=38 +blueorchid=38:1 +allium=38:2 +azurebluet=38:3 +redtulip=38:4 +orangetulip=38:5 +whitetulip=38:6 +pinktulip=38:7 +oxeyedaisy=38:8 +brownmushroom=39 +redmushroom=40 +goldblock=41 +gold=41 +ironblock=42 +iron=42 +doubleslab=43 +doublestep=43 +stonedoubleslab=43:0 +sandstonedoubleslab=43:1 +wooddoubleslab=43:2 +cobblestonedoubleslab=43:3 +brickdoubleslab=43:4 +stonebrickdoubleslab=43:5 +netherbrickdoubleslab=43:6 +quartzdoubleslab=43:7 +slab=44 +step=44 +stoneslab=44:0 +sandstoneslab=44:1 +woodslab=44:2 +cobblestoneslab=44:3 +brickslab=44:4 +stonebrickslab=44:5 +netherbrickslab=44:6 +quartzslab=44:7 +brickblock=45 +brickwall=45 +tnt=46 +bookshelf=47 +bookcase=47 +mossycobblestone=48 +mossy=48 +obsidian=49 +torch=50 +fire=51 +mobspawner=52 +oakwoodstairs=53 +woodstairs=53 +chest=54 +redstonewire=55 +redstonedust=55 +diamondore=56 +diamondblock=57 +workbench=58 +crop=59 +crops=59 +farmland=60 +tilleddirt=60 +soil=60 +furnace=61 +litfurnace=62 +signblock=63 +wooddoorblock=64 +ladder=65 +rails=66 +rail=66 +track=66 +tracks=66 +cobblestonestairs=67 +stairs=67 +wallsign=68 +signblocktop=68 +lever=69 +stoneplate=70 +rockplate=70 +irondoorblock=71 +woodplate=72 +redstoneore=73 +redstoneorealt=74 +redstonetorchoff=75 +redstonetorchon=76 +stonebutton=77 +snow=78 +ice=79 +snowblock=80 +cactus=81 +clayblock=82 +reedblock=83 +jukebox=84 +fence=85 +pumpkin=86 +netherrack=87 +hellrock=87 +netherstone=87 +soulsand=88 +slowsand=88 +glowstone=89 +lightstone=89 +portal=90 +jackolantern=91 +jacko=91 +cakeblock=92 +whitestainedglass=95 +orangestainedglass=95:1 +magentastainedglass=95:2 +lightbluestainedglass=95:3 +ltbluestainedglass=95:3 +yellowstainedglass=95:4 +limestainedglass=95:5 +lightgreenstainedglass=95:5 +ltgreenstainedglass=95:5 +pinkstainedglass=95:6 +graystainedglass=95:7 +greystainedglass=95:7 +darkgraystainedglass=95:7 +darkgreystainedglass=95:7 +dkgraystainedglass=95:7 +dkgreystainedglass=95:7 +lightgraystainedglass=95:8 +lightgreystainedglass=95:8 +ltgraystainedglass=95:8 +ltgreystainedglass=95:8 +silverstainedglass=95:8 +cyanstainedglass=95:9 +purplestainedglass=95:10 +violetstainedglass=95:10 +bluestainedglass=95:11 +darkbluestainedglass=95:11 +dkbluestainedglass=95:11 +brownstainedglass=95:12 +greenstainedglass=95:13 +darkgreenstainedglass=95:13 +dkgreenstainedglass=95:13 +redstainedglass=95:14 +blackstainedglass=95:15 +trapdoor=96 +silverfishblock=97 +stonebrick=98 +stonebricks=98 +mossystonebrick=98:1 +crackedstonebrick=98:2 +chiseledstonebrick=98:3 +hugebrownmushroom=99 +hugeredmushroom=100 +ironbars=101 +glasspane=102 +melon=103 +pumpkinstem=104 +melonstem=105 +vines=106 +fencegate=107 +brickstairs=108 +stonebrickstairs=109 +mycelium=110 +lilypad=111 +netherbrick=112 +netherbrickfence=113 +netherbrickstairs=114 +netherwartblock=115 +enchantmenttable=116 +brewingstandblock=117 +cauldronblock=118 +endportal=119 +endportalframe=120 +endstone=121 +dragonegg=122 +redstonelamp=123 +redstonelampoff=123 +litredstonelamp=124 +redstonelampon=124 +woodendoubleslab=125 +oakwooddoubleslab=125:0 +appledoublewoodslab=125:0 +sprucewooddoubleslab=125:1 +coniferwooddoubleslab=125:1 +pinewooddoubleslab=125:1 +darkwooddoubleslab=125:1 +birchwooddoubleslab=125:2 +whitewooddoubleslab=125:2 +junglewooddoubleslab=125:3 +acaciawooddoubleslab=125:4 +darkoakwooddoubleslab=125:5 +bigoakwooddoubleslab=125:5 +roofedwooddoubleslab=125:5 +woodenslab=126 +oakwoodslab=126:0 +applewoodslab=126:0 +sprucewoodslab=126:1 +coniferwoodslab=126:1 +pinewoodslab=126:1 +darkwoodslab=126:1 +birchwoodslab=126:2 +whitewoodslab=126:2 +junglewoodslab=126:3 +acaciawoodslab=126:4 +darkoakwoodslab=126:5 +roofedwoodslab=126:5 +bigoakwoodslab=126:5 +cocoabeans=127 +sandstonestairs=128 +emeraldore=129 +enderchest=130 +tripwirehook=131 +tripwire=132 +emeraldblock=133 +sprucewoodstairs=134 +coniferwoodstairs=134 +pinewoodstairs=134 +darkwoodstairs=134 +birchwoodstairs=135 +whitewoodstairs=135 +junglewoodstairs=136 +commandblock=137 +beacon=138 +cobblestonewall=139 +mossycobblestonewall=139:1 +flowerpotblock=140 +carrotcrop=141 +potatocrop=142 +woodenbutton=143 +skeletonhead=144 +witherhead=144:1 +zombiehead=144:2 +playerhead=144:3 +humanhead=144:3 +stevehead=144:3 +creeperhead=144:4 +anvil=145 +trappedchest=146 +lightweightedpressureplate=147 +heavyweightedpressureplate=148 +inactivecomparator=149 +activecomparator=150 +daylightsensor=151 +redstoneblock=152 +netherquartzore=153 +hopper=154 +quartzblock=155 +chiseledquartzblock=155:1 +pillarquartzblock=155:2 +quartzstairs=156 +activatorrail=157 +dropper=158 +whitestainedclay=159 +orangestainedclay=159:1 +magentastainedclay=159:2 +lightbluestainedclay=159:3 +ltbluestainedclay=159:3 +yellowstainedclay=159:4 +limestainedclay=159:5 +lightgreenstainedclay=159:5 +ltgreenstainedclay=159:5 +pinkstainedclay=159:6 +graystainedclay=159:7 +greystainedclay=159:7 +darkgraystainedclay=159:7 +darkgreystainedclay=159:7 +dkgraystainedclay=159:7 +dkgreystainedclay=159:7 +lightgraystainedclay=159:8 +lightgreystainedclay=159:8 +ltgraystainedclay=159:8 +ltgreystainedclay=159:8 +silverstainedclay=159:8 +cyanstainedclay=159:9 +purplestainedclay=159:10 +violetstainedclay=159:10 +bluestainedclay=159:11 +darkbluestainedclay=159:11 +dkbluestainedclay=159:11 +brownstainedclay=159:12 +greenstainedclay=159:13 +darkgreenstainedclay=159:13 +dkgreenstainedclay=159:13 +redstainedclay=159:14 +blackstainedclay=159:15 +whitestainedglasspane=160 +orangestainedglasspane=160:1 +magentastainedglasspane=160:2 +lightbluestainedglasspane=160:3 +ltbluestainedglasspane=160:3 +yellowstainedglasspane=160:4 +limestainedglasspane=160:5 +lightgreenstainedglasspane=160:5 +ltgreenstainedglasspane=160:5 +pinkstainedglasspane=160:6 +graystainedglasspane=160:7 +greystainedglasspane=160:7 +darkgraystainedglasspane=160:7 +darkgreystainedglasspane=160:7 +dkgraystainedglasspane=160:7 +dkgreystainedglasspane=160:7 +lightgraystainedglasspane=160:8 +lightgreystainedglasspane=160:8 +ltgraystainedglasspane=160:8 +ltgreystainedglasspane=160:8 +silverstainedglasspane=160:8 +cyanstainedglasspane=160:9 +purplestainedglasspane=160:10 +violetstainedglasspane=160:10 +bluestainedglasspane=160:11 +darkbluestainedglasspane=160:11 +dkbluestainedglasspane=160:11 +brownstainedglasspane=160:12 +greenstainedglasspane=160:13 +darkgreenstainedglasspane=160:13 +dkgreenstainedglasspane=160:13 +redstainedglasspane=160:14 +blackstainedglasspane=160:15 +newleaves=161 +acacialeaves=161:0 +darkoakleaves=161:1 +bigoakleaves=161:1 +roofedoakleaves=161:1 +newlog=162 +acacialog=162:0 +darkoaklog=162:1 +bigoaklog=162:1 +roofedoaklog=162:1 +acaciawoodstairs=163 +darkoakwoodstairs=164 +bigoakwoodstiars=164 +roofedoakwoodstairs=164 +slimeblock=165 +barrier=166 +irontrapdoor=167 +prismarine=168 +prismarinebricks=168:1 +darkprismarine=168:2 +sealantern=169 +haybale=170 +carpet=171 +whitecarpet=171:0 +orangecarpet=171:1 +magentacarpet=171:2 +lightbluecarpet=171:3 +ltbluecarpet=171:3 +yellowcarpet=171:4 +limecarpet=171:5 +lightgreencarpet=171:5 +ltgreencarpet=171:5 +pinkcarpet=171:6 +graycarpet=171:7 +greycarpet=171:7 +darkgraycarpet=171:7 +darkgreycarpet=171:7 +dkgraycarpet=171:7 +dkgreycarpet=171:7 +lightgraycarpet=171:8 +lightgreycarpet=171:8 +ltgraycarpet=171:8 +ltgreycarpet=171:8 +silvercarpet=171:8 +cyancarpet=171:9 +purplecarpet=171:10 +violetcarpet=171:10 +bluecarpet=171:11 +darkbluecarpet=171:11 +dkbluecarpet=171:11 +browncarpet=171:12 +greencarpet=171:13 +darkgreencarpet=171:13 +dkgreencarpet=171:13 +redcarpet=171:14 +blackcarpet=171:15 +hardenedclay=172 +coalblock=173 +packedice=174 +doubleplant=175 +sunflower=175:0 +lilac=175:1 +doubletallgrass=175:2 +doubletallfern=175:3 +rosebush=175:4 +peony=175:5 +redsandstone=179 +chiseledredsandstone=179:1 +smoothredsandstone=179:2 +redsandstonestairs=180 +newstoneslab=182 +redsandstoneslab=182:0 +sprucefencegate=183 +coniferfencegate=183 +pinefencegate=183 +darkfencegate=183 +birchfencegate=184 +whitefencegate=184 +junglefencegate=185 +darkoakfencegate=186 +bigoakfencegate=186 +roofedoakfencegate=186 +acaciafencegate=187 +sprucefence=188 +coniferfence=188 +pinefence=188 +darkfence=188 +birchfence=189 +whitefence=189 +junglefence=190 +darkoakfence=191 +bigoakfence=191 +roofedoakfence=191 +acaciafence=192 +ironshovel=256 +ironspade=256 +ironpickaxe=257 +ironpick=257 +ironaxe=258 +flintandsteel=259 +lighter=259 +apple=260 +redapple=260 +bow=261 +arrow=262 +coal=263 +charcoal=263:1 +diamond=264 +ironingot=265 +ironbar=265 +goldingot=266 +goldeningot=266 +goldbar=266 +goldenbar=266 +ironsword=267 +woodensword=268 +woodsword=268 +woodenshovel=269 +woodspade=269 +woodshovel=269 +woodenspade=269 +woodenpickaxe=270 +woodpickaxe=270 +woodenpick=270 +woodpick=270 +woodenaxe=271 +woodaxe=271 +stonesword=272 +stoneshovel=273 +stonespade=273 +stonepickaxe=274 +stonepick=274 +stoneaxe=275 +diamondsword=276 +diamondshovel=277 +diamondspade=277 +diamondpickaxe=278 +diamondpick=278 +diamondaxe=279 +stick=280 +bowl=281 +mushroomstew=282 +bowlwithsoup=282 +soupbowl=282 +soup=282 +goldensword=283 +goldsword=283 +goldenshovel=284 +goldenspade=284 +goldshovel=284 +goldspade=284 +goldenpickaxe=285 +goldpickaxe=285 +goldenpick=285 +goldpick=285 +goldenaxe=286 +goldaxe=286 +string=287 +feather=288 +gunpowder=289 +woodenhoe=290 +woodhoe=290 +stonehoe=291 +ironhoe=292 +diamondhoe=293 +goldenhoe=294 +goldhoe=294 +seeds=295 +wheat=296 +bread=297 +leatherhelmet=298 +leatherchestplate=299 +leatherpants=300 +leatherboots=301 +chainmailhelmet=302 +chainmailchestplate=303 +chainmailpants=304 +chainmailboots=305 +ironhelmet=306 +ironchestplate=307 +ironpants=308 +ironboots=309 +diamondhelmet=310 +diamondchestplate=311 +diamondpants=312 +diamondboots=313 +goldenhelmet=314 +goldhelmet=314 +goldenchestplate=315 +goldchestplate=315 +goldenpants=316 +goldpants=316 +goldenboots=317 +goldboots=317 +flint=318 +porkchop=319 +meat=319 +pork=319 +cookedporkchop=320 +cookedmeat=320 +cookedpork=320 +painting=321 +paintings=321 +goldenapple=322 +goldapple=322 +notchapple=322:1 +enchantedgoldenapple=322:1 +enchantedgoldapple=322:1 +sign=323 +oakdoor=324 +appledoor=324 +woodendoor=324 +wooddoor=324 +bucket=325 +waterbucket=326 +lavabucket=327 +minecart=328 +saddle=329 +irondoor=330 +redstonedust=331 +snowball=332 +boat=333 +leather=334 +milkbucket=335 +brick=336 +clay=337 +sugarcane=338 +reed=338 +paper=339 +book=340 +slimeball=341 +slimeorb=341 +storageminecart=342 +poweredminecart=343 +egg=344 +compass=345 +fishingrod=346 +watch=347 +glowstonedust=348 +lightstonedust=348 +lightdust=348 +glowdust=348 +fish=349 +rawfish=349 +rawsalmon=349:1 +clownfish=349:2 +pufferfish=349:3 +cookedfish=350 +cookedsalmon=350:1 +dye=351 +inksac=351:0 +blackdye=351:0 +rosered=351:1 +reddye=351:1 +cactusgreen=351:2 +greendye=351:2 +darkgreendye=351:2 +dkgreendye=351:2 +cocoabeans=351:3 +browndye=351:3 +lapislazuli=351:4 +bluedye=351:4 +darkbluedye=351:4 +dkbluedye=351:4 +purpledye=351:5 +violetdye=351:5 +cyandye=351:6 +lightgraydye=351:7 +lightgreydye=351:7 +ltgraydye=351:7 +ltgreydye=351:7 +silverdye=351:7 +graydye=351:8 +greydye=351:8 +darkgreydye=351:8 +darkgraydye=351:8 +dkgreydye=351:8 +dkgraydye=351:8 +pinkdye=351:9 +limedye=351:10 +lightgreendye=351:10 +ltgreendye=351:10 +dandellionyellow=351:11 +yellowdye=351:11 +lightbluedye=351:12 +ltbluedye=351:12 +magentadye=351:13 +orangedye=351:14 +bonemeal=351:15 +whitedye=351:15 +bone=352 +sugar=353 +cake=354 +bed=355 +repeater=356 +diode=356 +cookie=357 +map=358 +shears=359 +melonslice=360 +pumpkinseeds=361 +melonseeds=362 +rawbeef=363 +steak=364 +rawchicken=365 +cookedchicken=366 +rottenflesh=367 +enderpearl=368 +blazerod=369 +ghasttear=370 +goldnugget=371 +netherwart=372 +potion=373 +glassbottle=374 +spidereye=375 +fermentedspidereye=376 +blazepowder=377 +magmacream=378 +brewingstand=379 +cauldron=380 +eyeofender=381 +glisteringmelon=382 +spawnegg=383 +bottleoenchanting=384 +firecharge=385 +bookandquill=386 +writtenbook=387 +emerald=388 +itemframe=389 +flowerpot=390 +carrot=391 +potato=392 +bakedpotato=393 +poisonouspotato=394 +emptymap=395 +goldencarrot=396 +skeletonhead=397 +witherhead=397:1 +zombiehead=397:2 +playerhead=397:3 +stevehead=397:3 +creeperhead=397:4 +carrotonastick=398 +netherstar=399 +pumpkinpie=400 +fireworkrocket=401 +fireworkstar=402 +enchantedbook=403 +comparator=404 +netherbrickitem=405 +netherquartz=406 +tntminecart=407 +hopperminecart=408 +prismarineshard=409 +prismarinecrystals=410 +rawrabbit=411 +cookedrabbit=412 +rabbitstew=413 +rabbitsoup=413 +rabbitsfoot=414 +rabbithide=415 +armorstand=416 +ironhorsearmor=417 +goldhorsearmor=418 +diamondhorsearmor=419 +lead=420 +nametag=421 +commandblockminecart=422 +rawmutton=423 +cookedmutton=424 +banner=425 +blackbanner=415:0 +redbanner=415:1 +greenbanner=415:2 +darkgreenbanner=415:2 +dkgreenbanner=415:2 +brownbanner=415:3 +bluebanner=415:4 +darkbluebanner=415:4 +dkbluebanner=415:4 +purplebanner=415:5 +violetbanner=415:5 +cyanbanner=415:6 +lightgraybanner=415:7 +lightgreybanner=415:7 +ltgraybanner=415:7 +ltgreybanner=415:7 +silverbanner=415:7 +graybanner=415:8 +greybanner=415:8 +darkgraybanner=415:8 +darkgreybanner=415:8 +dkgraybanner=415:8 +dkgreybanner=415:8 +pinkbanner=415:9 +limebanner=415:10 +lightgreenbanner=415:10 +ltgreenbanner=415:10 +yellowbanner=415:11 +lightbluebanner=415:12 +ltbluebanner=415:12 +magentabanner=415:13 +orangebanner=415:14 +whitebanner=415:15 +sprucedoor=427 +coniferdoor=427 +pinedoor=427 +darkdoor=427 +birchdoor=428 +whitedoor=428 +jungledoor=429 +acaciadoor=430 +darkoakdoor=431 +bigoakdoor=431 +roofedoakdoor=431 +goldrecord=2256 +greenrecord=2257 +blocksrecord=2258 +chirprecord=2259 +farrecord=2260 +mallrecord=2261 +mellohirecord=2262 +stalrecord=2263 +stradrecord=2264 +wardrecord=2265 +11record=2266 + + + diff --git a/Server/lang/items_de.ini b/Server/lang/items_de.ini new file mode 100644 index 000000000..3c2ab87d1 --- /dev/null +++ b/Server/lang/items_de.ini @@ -0,0 +1,603 @@ +[Items] +luft=0 +stein=1 +granit=1:1 +poliertergranit=1:2 +diorit=1:3 +polierterdiorit=1:4 +andesit=1:5 +polierterandesit=1:6 +grasblock=2 +erde=3 +grobeerde=3:1 +podsol=3:2 +bruchstein=4 +holzbretter=5 +eichenholzbretter=5:0 +fichtenholzbretter=5:1 +birkenholzbretter=5:2 +tropenholzbretter=5:3 +akazienholzbretter=5:4 +schwarzeichenholzbretter=5:5 +setzling=6 +eichensetzling=6:0 +fichtensetzling=6:1 +birkensetzling=6:2 +tropensetzling=6:3 +akaziensetzling=6:4 +schwarzeichensetzling=6:5 +grundgestein=7 +wasser=8 +fliessendeswasser=8 +stehendeswasser=9 +stilleswasser=9 +swasser=9 +lava=10 +fliessendelava=10 +stehendelava=11 +stillelava=11 +slava=11 +sand=12 +rotersand=12:1 +kies=13 +golderz=14 +eisenerz=15 +kohleerz=16 +stamm=17 +eichenholz=17:0 +fichtenholz=17:1 +birkenholz=17:2 +tropenholz=17:3 +laub=18 +eichenlaub=18:0 +fichtenlaub=18:1 +birkenlaub=18:2 +tropenlaub=18:3 +schwamm=19 +nasserschwamm=19:1 +glas=20 +lapislazulierz=21 +lapislazuliblock=22 +werfer=23 +sandstein=24 +normalersandstein=24:0 +gemeisseltersandstein=24:1 +glattersandstein=24:2 +notenblock=25 +bettblock=26 +antriebsschiene=27 +sensorschiene=28 +klebrigerkolben=29 +spinnenweben=30 +gras=31 +gras=31:1 +farn=31:2 +toterbusch=32 +kolben=33 +kolbenkopf=34 +wolle=35 +weissewolle=35:0 +orangenewolle=35:1 +magentawolle=35:2 +hellblauewolle=35:3 +gelbewolle=35:4 +hellgruene=35:5 +rosawolle=35:6 +grauwool=35:7 +greywool=35:7 +grauewolle=35:7 +hellgrauewolle=35:8 +tuerkisewolle=35:9 +violettewolle=35:10 +blauewolle=35:11 +braunewolle=35:12 +gruenewolle=35:13 +rotewolle=35:14 +schwarzewolle=35:15 +loewenzahn=37 +blume=38 +mohn=38:0 +blaueorchidee=38:1 +sternlauch=38:2 +porzellansternchen=38:3 +rotetulpe=38:4 +orangenetulpe=38:5 +weissetulpe=38:6 +rosatulpe=38:7 +margerite=38:8 +braunerpilz=39 +roterpilz=40 +goldblock=41 +eisenblock=42 +doppelstufe=43 +doppelsteinstufe=43:0 +doppelsandsteinstufe=43:1 +doppelholzstufe=43:2 +doppelbruchsteinstufe=43:3 +doppelziegelstufe=43:4 +doppelsteinziegelstufe=43:5 +doppelnetherziegelstufe=43:6 +doppelquarzstufe=43:7 +stufe=44 +steinstufe=44:0 +sandsteinstufe=44:1 +holzstufe=44:2 +bruchsteinstufe=44:3 +ziegelstufe=44:4 +steinziegelstufe=44:5 +netherziegelstufe=44:6 +quarzstufe=44:7 +ziegelsteine=45 +tnt=46 +buecherregal=47 +bemoosterbruchstein=48 +obsidian=49 +fackel=50 +feuer=51 +monsterspawner=52 +eichenholztreppe=53 +kiste=54 +rotstonekabel=55 +diamanterz=56 +diamantblock=57 +werkbank=58 +ernte=59 +farmland=60 +ofen=61 +brennenderofen=62 +schildblock=63 +holztuerblock=64 +leiter=65 +schiene=66 +bruchsteintreppe=67 +wandschild=68 +schalter=69 +steindruckplatte=70 +eisentuerblock=71 +holzdruckplatte=72 +rotstoneerz=73 +leuchtendesrotstoneerz=74 +erloschenerotstonefackel=75 +rotstonefackel=76 +setinknopf=77 +schnee=78 +eis=79 +schneeblock=80 +kaktus=81 +ton=82 +zuckerrohrblock=83 +plattenspieler=84 +eichenholzzaun=85 +kuerbis=86 +netherstein=87 +selensand=88 +leuchtstein=89 +portal=90 +kürbislaterne=91 +kuchenlock=92 +weissesglas=95 +orangenesglas=95:1 +magentaglas=95:2 +hellblauesglas=95:3 +gelbesglas=95:4 +hellgruenesglas=95:5 +rosagerfaerbtglas=95:6 +grauesglas=95:7 +hellgrauesglas=95:8 +tuerkisesglas=95:9 +violettesglas=95:10 +blauesglas=95:11 +braunesglas=95:12 +gruenesglas=95:13 +rotesglas=95:14 +schwarzesglas=95:15 +falltuer=96 +silberfischblock=97 +steinziegel=98 +bemoostesteinziegel=98:1 +rissigesteinziegel=98:2 +gemeisseltesteinziegel=98:3 +braunerpilzblock=99 +roterpilzblock=100 +eisengitter=101 +glasscheibe=102 +melone=103 +kuerbispflanze=104 +melonenpflanze=105 +ranken=106 +eichenholzzauntor=107 +ziegeltreppe=108 +steinziegeltreppe=109 +myzel=110 +seerosenblatt=111 +netherziegel=112 +netherziegelzaun=113 +netherziegeltreppe=114 +netherwarzenblock=115 +zaubertisch=116 +braustandblock=117 +kesselblock=118 +endportal=119 +endportalrahmen=120 +endstein=121 +drachenei=122 +redstonelampe=123 +erlosscheneredstonelampe=124 +doppelholzstufe=125 +doppeleichenholzstufe=125:0 +doppelfichtenholzstufe=125:1 +doppelbirkenholzstufe=125:2 +doppeltropenholzstufe=125:3 +doppelakazienholzstufe=125:4 +doppelschwarzeichenstufe=125:5 +holzstufe=126 +eichenholzstufe=126:0 +fichtenholzstufe=126:1 +birkenholzstufe=126:2 +tropenholzstufe=126:3 +akazienholzstufe=126:4 +schwarzeichenholzstufe=126:5 +kakaobohnen=127 +sandsteintreppe=128 +smaragderz=129 +endertruhe=130 +haken=131 +stolperdraht=132 +smaragdblock=133 +fichtenholztreppe=134 +birkenholztreppe=135 +tropenholztreppe=136 +kommandoblock=137 +leuchtfeuer=138 +bruchsteinmauer=139 +bemoostebruchsteinmauer=139:1 +blumentopfblock=140 +karottenpflanze=141 +kartoffelpflanze=142 +knopf=143 +skelettschaedel=144 +witherskelettschaedel=144:1 +zombieschaedel=144:2 +schaedel=144:3 +creeperschaedel=144:4 +amboss=145 +redstonetruhe=146 +waegeplatteniedrigegewichte=147 # WTF, that names are so stupid... +waegeplattehohegewichte=148 +inaktiverkomparator=149 +aktiverkomparator=150 +tageslichtsensor=151 +redstoneblock=152 +netherquarzerz=153 +trichter=154 +quarzblock=155 +gemeisselterquarzblock=155:1 +quarzsaeule=155:2 +quarztreppe=156 +aktivierungsschiene=157 +spender=158 +weissgerfaerbterton=159 +orangegerfaerbterton=159:1 +magentagerfaerbterton=159:2 +hellblaugerfaerbterton=159:3 +gelbgerfaerbterton=159:4 +hellgruengerfaerbterton=159:5 +rosagerfaerbterton=159:6 +graugerfaerbterton=159:7 +hellgraugefaerbterton=159:8 +tuerkisgerfaerbterton=159:9 +purplegerfaerbterton=159:10 +violettegerfaerbterton=159:10 +blaugerfaerbterton=159:11 +braungerfaerbterton=159:12 +gruengerfaerbterton=159:13 +rotgerfaerbterton=159:14 +schwarzgerfaerbterton=159:15 +weisseglasscheibe=160 +orangeneglasscheibe=160:1 +magentaglasscheibe=160:2 +hellblaueglasscheibe=160:3 +gelbeglasscheibe=160:4 +hellgrueneglasscheibe=160:5 +rosaglasscheibe=160:6 +graueglasscheibe=160:7 +hellgraueglasscheibe=160:8 +tuerkiseglasscheibe=160:9 +violetteglasscheibe=160:10 +blaueglasscheibe=160:11 +brauneglasscheibe=160:12 +grueneglasscheibe=160:13 +roteglasscheibe=160:14 +schwarzeglasscheibe=160:15 +neueslaub=161 +akazienlaub=161:0 +schwarzeichenlaub=161:1 +neuestaemme=162 +akazienholz=162:0 +schwarzeichenholz=162:1 +akazientreppe=163 +schwarzeichentreppe=164 +schleimblock=165 +bartriere=166 +eisenfalltür=167 +prismarin=168 +prismarinziegel=168:1 +dunklerprismarin=168:2 +seelaterne=169 +strohballen=170 +teppich=171 +weisserteppich=171:0 +orangenerteppich=171:1 +magentateppich=171:2 +hellblauerteppich=171:3 +gelberteppich=171:4 +hellgruenerteppich=171:5 +rosateppich=171:6 +grauerteppich=171:7 +hellgrauerteppich=171:8 +tuerkiserteppich=171:9 +violetterteppich=171:10 +blauerteppich=171:11 +braunerteppich=171:12 +gruenerteppich=171:13 +roterteppich=171:14 +schwarzerteppich=171:15 +gebrannterton=172 +kohleblock=173 +packeis=174 +doppelpflanze=175 +sonnenblume=175:0 +Flieder=175:1 +hohesgras=175:2 +grosserfarn=175:3 +rosenstrauch=175:4 +pfingstrose=175:5 +rotersandstein=179 +gemeisselterrotersandstein=179:1 +glatterrotersandstein=179:2 +rotesandsteintreppe=180 +neuesteinstufe=182 +rotesandsteinstufe=182:0 +fichtenzauntor=183 +birkenzauntor=184 +tropenzauntor=185 +schwarzeichenzauntor=186 +akazienzauntor=187 +fichtenzaun=188 +birkenzaun=189 +tropenzaun=190 +schwarzeichenzaun=191 +akazienzaun=192 +eisenschaufel=256 +eisenspitzhacke=257 +eisenaxt=258 +feuerzeug=259 +apfel=260 +bogen=261 +pfeil=262 +kohle=263 +holzkohle=263:1 +diamant=264 +eisenbarren=265 +goldbarren=266 +eisenschwert=267 +holzschwert=268 +holzschaufel=269 +holzspitzhacke=270 +holzaxt=271 +steinschwert=272 +steinschaufel=273 +steinspitzhacke=274 +steinaxt=275 +diamantschwert=276 +diamantschaufel=277 +diamantspitzhacke=278 +diamantaxt=279 +stock=280 +schuessel=281 +pilzsuppe=282 +goldschwert=283 +goldschaufel=284 +goldspitzhacke=285 +goldaxt=286 +faden=287 +feder=288 +schwarzpulver=289 +holzhacke=290 +steinhacke=291 +eisenhacke=292 +diamanthacke=293 +goldhacke=294 +samen=295 +weizen=296 +brot=297 +lederkappe=298 +lederjacke=299 +lederhose=300 +lederstiefel=301 +kettenhaube=302 +kettenhemd=303 +kettenhose=304 +kettenstiefel=305 +eisenhelm=306 +eisenbrustplatte=307 +eisenbeinschutz=308 +eisenstiefel=309 +diamanthelm=310 +diamantbrustplatte=311 +diamantbeinschutz=312 +diamantstiefel=313 +goldhelm=314 +goldharnisch=315 +goldbeinschutz=316 +goldstiefel=317 +goldboots=317 +feuerstein=318 +rohesschweinefleisch=319 +gebratenesschweinefleisch=320 +gemaelde=321 +goldenerapfel=322 +goldenerapfel=322:1 +schild=323 +eichenholztuer=324 +eimer=325 +wassereimer=326 +lavaeimer=327 +lore=328 +sattel=329 +eisentuer=330 +redstone=331 +schneeballl=332 +boot=333 +leder=334 +milcht=335 +ziegel=336 +ton=337 +zuckercane=338 +papier=339 +buch=340 +schleimball=341 +gueterlore=342 +angetriebenelore=343 +ei=344 +kompass=345 +angel=346 +uhr=347 +glowstonestaub=348 +fisch=349 +roherfisch=349 +roherlachs=349:1 +clownfisch=349:2 +kugelfisch=349:3 +gebratenerfisch=350 +gebratenerlachs=350:1 +farbe=351 +tintenbeutel=351:0 +rosenrot=351:1 +kaktusgruen=351:2 +kakaobohnen=351:3 +lapislazuli=351:4 +violetterfarbstoff=351:5 +tuerkiserfarbstoff=351:6 +hellgrauerfarbstoff=351:7 +grauerfarbstoff=351:8 +rosafarbstoff=351:9 +hellgruenerfarbstoff=351:10 +gelberfarbstoff=351:11 +hellblauerfarbstoff=351:12 +magentafarbstoff=351:13 +orangenerfarbstoff=351:14 +knochenmehl=351:15 +knochen=352 +zucker=353 +kuchen=354 +bett=355 +redstoneverstaerker=356 +keks=357 +karte=358 +schere=359 +melone=360 +kürbiskerne=361 +melonenkerne=362 +rohesrindfleisch=363 +steak=364 +roheshühnchen=365 +gebrateneshühnchen=366 +verrottetesfleisch=367 +enderperle=368 +lohenrute=369 +ghasttraene=370 +goldnugget=371 +netherwarze=372 +trank=373 +glasflasche=374 +spinnenauge=375 +fermentiertesspinnenauge=376 +lohenstaub=377 +magmacreme=378 +braustand=379 +kessel=380 +enderauge=381 +glitzerndemelone=382 +spawnei=383 +erfahrungsfläschchen=384 +feuerkugel=385 +buchundfeder=386 +beschriebenesbuch=387 +smaragd=388 +rahmen=389 +blumentopf=390 +karotte=391 +kartoffel=392 +ofenkartoffel=393 +giftigekartoffel=394 +leerekarte=395 +goldenekarotte=396 +skelettschaedel=397 +witherschaedel=397:1 +zombieschaedel=397:2 +kopf=397:3 +creeperschaedel=397:4 +karottenrute=398 +netherstern=399 +kuerbiskuchen=400 +feuerwerksrakete=401 +feuerwerksstern=402 +verzauberungsbuch=403 +redstonekomparator=404 +netherziegelitem=405 +netherquarz=406 +tntlore=407 +trichterlore=408 +prismarinscherbe=409 +prismarinkristalle=410 +roheskaninchen=411 +gebrateneskaninchen=412 +kaninchenragout=413 +hasenpfote=414 +kaninchenfell=415 +ruestungsstaender=416 +eisernepferderuestung=417 +goldenepferderuestung=418 +diamantenepferderuestung=419 +leine=420 +namensschild=421 +kommandoblocklore=422 +roheshammelfleisch=423 +gebrateneshammelfleisch=424 +banner=425 +schwarzesbanner=415:0 +rotesbanner=415:1 +gruenesbanner=415:2 +braunbanner=415:3 +blauesbanner=415:4 +violettesbanner=415:5 +tuerkisesbanner=415:6 +hellgrauesbanner=415:7 +grauesbanner=415:8 +rosabanner=415:9 +hellgruenesbanner=415:10 +gelbesbanner=415:11 +hellblauesbanner=415:12 +magentabanner=415:13 +orangenesbanner=415:14 +weissesbanner=415:15 +fichtenholztuer=427 +birkenholztuer=428 +tropentuer=429 +akazientuer=430 +schwarzeichentuer=431 +goldeneschallplatte=2256 +grueneschallplatte=2257 +blocksschallplatte=2258 +chirpschallplatte=2259 +farschallplatte=2260 +mallschallplatte=2261 +mellohischallplatte=2262 +stalschallplatte=2263 +stradschallplatte=2264 +wardschallplatte=2265 +11schallplatte=2266 + + + diff --git a/Server/monsters.ini b/Server/monsters.ini new file mode 100644 index 000000000..af1938e3e --- /dev/null +++ b/Server/monsters.ini @@ -0,0 +1,213 @@ +[Bat] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=6 + +[Blaze] +AttackRange=15.0 +AttackRate=1 +AttackDamage=6.0 +SightDistance=25.0 +MaxHealth=20 +IsFireproof=1 + +[CaveSpider] +AttackRange=2.0 +AttackRate=1 +AttackDamage=2.0 +SightDistance=25.0 +MaxHealth=12 + +[Chicken] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=4 + +[Cow] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=10 + +[Creeper] +AttackRange=3.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=20 + +[EnderDragon] +AttackRange=2.0 +AttackRate=1 +AttackDamage=6.0 +SightDistance=25.0 +MaxHealth=200 + +[Enderman] +AttackRange=2.0 +AttackRate=1 +AttackDamage=4.0 +SightDistance=64.0 +MaxHealth=40 + + +[Ghast] +AttackRange=50.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=50.0 +MaxHealth=10 +IsFireproof=1 + +[Giant] +AttackRange=2.0 +AttackRate=1 +AttackDamage=6.0 +SightDistance=25.0 +MaxHealth=100 + +[Guardian] +AttackRange=2.0 +AttackRate=1 +AttackDamage=9.0 +SightDistance=25.0 +MaxHealth=30 + +[Horse] +AttackRange=2.0 +AttackRate=1 +AttackDamage=6.0 +SightDistance=25.0 +MaxHealth=30 + +[IronGolem] +AttackRange=2.0 +AttackRate=1 +AttackDamage=6.0 +SightDistance=25.0 +MaxHealth=100 + +[MagmaCube] +AttackRange=2.0 +AttackRate=1 +AttackDamage=6.0 +SightDistance=25.0 +MaxHealth=16 +IsFireproof=1 + +[Mooshroom] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=10 + +[Ocelot] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=10 + +[Pig] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=10 + +[Rabbit] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=10 + +[Sheep] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=8 + +[Silverfish] +AttackRange=2.0 +AttackRate=1 +AttackDamage=1.0 +SightDistance=25.0 +MaxHealth=8 + +[Skeleton] +AttackRange=15.0 +AttackRate=1 +SightDistance=40.0 +MaxHealth=20 + +[Slime] +AttackRange=2.0 +AttackRate=1 +AttackDamage=4.0 +SightDistance=25.0 +MaxHealth=16 + +[SnowGolem] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=4 + +[Spider] +AttackRange=2.0 +AttackRate=1 +AttackDamage=2.0 +SightDistance=25.0 +MaxHealth=16 + +[Squid] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=10 + +[Villager] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=20 + +[Witch] +AttackRange=2.0 +AttackRate=1 +AttackDamage=0.0 +SightDistance=25.0 +MaxHealth=26 + +[Wolf] +AttackRange=2.0 +AttackRate=1 +AttackDamage=4.0 +SightDistance=25.0 +MaxHealth=20 + +[Zombie] +AttackRange=2.0 +AttackRate=1 +AttackDamage=4.0 +SightDistance=25.0 +MaxHealth=20 + +[ZombiePigman] +AttackRange=2.0 +AttackRate=1 +AttackDamage=7.0 +SightDistance=25.0 +MaxHealth=20 +IsFireproof=1 diff --git a/Server/vg b/Server/vg new file mode 100755 index 000000000..5fc22ab68 --- /dev/null +++ b/Server/vg @@ -0,0 +1,7 @@ +#! /bin/bash + +# This script runs MCServer under valgrind +# It expects valgrind to be normally installed and available +# Note that this is for Linux only and debug-only, since it slows down MCS way too much + +valgrind --log-file=valgrind.log --suppressions=vg.supp --tool=memcheck --leak-check=full --leak-resolution=high --show-reachable=yes --track-origins=yes -v ./Cuberite diff --git a/Server/vg.supp b/Server/vg.supp new file mode 100644 index 000000000..e69de29bb diff --git a/Server/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd b/Server/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd new file mode 100644 index 000000000..7022ef12a --- /dev/null +++ b/Server/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.cmd @@ -0,0 +1,12 @@ +@echo off +echo This script generates the certificate and private key for the https webadmin +echo Note that the generated certificate is self-signed, and therefore not trusted by browsers +echo Note that this script requires openssl to be installed and in PATH +echo. +echo When OpenSSL asks you for Common Name, you need to enter the fully qualified domain name of the server, that is, e. g. gallery.xoft.cz +echo. +echo If OpenSSL fails with an error, "WARNING: can't open config file: /usr/local/ssl/openssl.cnf", you need to run this script as an administrator +echo. + +openssl req -x509 -newkey rsa:2048 -keyout httpskey.pem -out httpscert.crt -days 3650 -nodes +pause diff --git a/Server/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh b/Server/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh new file mode 100755 index 000000000..5cf1237c8 --- /dev/null +++ b/Server/webadmin/GenerateSelfSignedHTTPSCertUsingOpenssl.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo "This script generates the certificate and private key for the https webadmin" +echo "Note that the generated certificate is self-signed, and therefore not trusted by browsers" +echo "Note that this script requires openssl to be installed and in PATH" +echo "" +echo "When OpenSSL asks you for Common Name, you need to enter the fully qualified domain name of the server, that is, e. g. gallery.xoft.cz" +echo "" + +openssl req -x509 -newkey rsa:2048 -keyout httpskey.pem -out httpscert.crt -days 3650 -nodes diff --git a/Server/webadmin/files/background.gif b/Server/webadmin/files/background.gif new file mode 100644 index 000000000..cab9bed56 Binary files /dev/null and b/Server/webadmin/files/background.gif differ diff --git a/Server/webadmin/files/favicon.ico b/Server/webadmin/files/favicon.ico new file mode 100644 index 000000000..ea4bde926 Binary files /dev/null and b/Server/webadmin/files/favicon.ico differ diff --git a/Server/webadmin/files/guest.html b/Server/webadmin/files/guest.html new file mode 100644 index 000000000..4f965b75c --- /dev/null +++ b/Server/webadmin/files/guest.html @@ -0,0 +1,18 @@ + + + + + + Guest Information + + + +

    + Hello! Welcome to the MCServer WebAdmin. +

    +

    + This is a default message, edit files/guest.html to add your own custom message. +

    + + + diff --git a/Server/webadmin/files/header.png b/Server/webadmin/files/header.png new file mode 100644 index 000000000..97b067715 Binary files /dev/null and b/Server/webadmin/files/header.png differ diff --git a/Server/webadmin/files/home.gif b/Server/webadmin/files/home.gif new file mode 100644 index 000000000..b10e0bed7 Binary files /dev/null and b/Server/webadmin/files/home.gif differ diff --git a/Server/webadmin/files/loading.gif b/Server/webadmin/files/loading.gif new file mode 100644 index 000000000..b8d06f669 Binary files /dev/null and b/Server/webadmin/files/loading.gif differ diff --git a/Server/webadmin/files/log_out.png b/Server/webadmin/files/log_out.png new file mode 100644 index 000000000..63232417a Binary files /dev/null and b/Server/webadmin/files/log_out.png differ diff --git a/Server/webadmin/files/login.css b/Server/webadmin/files/login.css new file mode 100644 index 000000000..5d87da4c5 --- /dev/null +++ b/Server/webadmin/files/login.css @@ -0,0 +1,219 @@ +/* Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 */ +* { + margin: 0; +} + +body { + font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; + -webkit-font-smoothing: antialiased; + background: #fff url(header.png) repeat-x top left; + width: 100%; + min-width: 100%; + overflow: hidden; +} + +a:link { + color: #555; + text-decoration: none; +} + +a:visited { + color: #444; + text-decoration: none; +} + +a:hover, a:active { + color: #000; + text-decoration: underline; +} + +img { + border: none; +} + +h1 { + color: #069; +} + +.row1 { + border-bottom: 1px solid #000; + height: 100px; + max-height: 100px; +} + +.row2 { + margin: 0 auto; + text-align: center; + vertical-align: middle; +} + +.contention { + color: #000; + text-align: left; + line-height: 1.4; + margin: 0; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + font-size: 13px; +} + +button { + background: #fff; + color: #000; + border: 1px solid #ccc; + padding: 3px; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + margin: -3px 0; +} + +button:hover { + border-top-color: #28597a; + background: #28597a; + color: #ccc; +} + +button:active { + border-top-color: #1b435e; + background: #1b435e; +} + +.push10 { + padding-bottom: 75px; +} + +#panel .upper { + background: #dcdbdc url(tcat.png) repeat-x; + border-top: 1px solid #fff; + border-bottom: 1px solid #bbb; + padding: 7px; +} + +#footer { + z-index: 99999; +} + +#footer ul.menu { + margin: 0; + padding: 0; + list-style: none; +} + +#footer ul.menu li { + margin: 0 5px; + display: inline; +} + +#footer .upper { + background: #dcdbdc url(tcat.png) repeat-x; + border-top: 1px solid #bbb; + padding: 6px; + overflow: hidden; + font-size: 12px; +} + +#footer .upper ul.bottom_links { + float: left; + margin: 3px 0 0 -5px; +} + +#footer .lower { + background: #a1a2a2 url(thead.png) top left repeat-x; + color: #fff; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ddd; + overflow: hidden; + padding: 8px; + font-size: 11px; +} + +#footer .lower a:link, #footer .lower a:visited { + color: #fff; + font-weight: 700; +} + +#footer .lower a:hover, #footer .lower a:active { + color: #fff; + font-weight: 700; +} + +#footer .lower #current_time { + float: right; + padding-right: 6px; +} + +.wrapper { + width: 85%; + min-width: 970px; + max-width: 1500px; + margin: auto; +} + +#footer { + position: fixed; + left: 0; + bottom: 0; + height: 60px; + width: 100%; + background: #999; + border-top: 1px #000 solid; +} + +* html #footer { + position: absolute; + top: expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px'); +} + +tr td.trow2:first-child { + border-left: 0; +} + +tr td.trow2:last-child { + border-right: 0; +} + +.tborder { + -moz-border-radius: 7px; + -webkit-border-radius: 7px; + border-radius: 7px; +} + +.thead, .rounded_top { + -moz-border-radius-topleft: 6px; + -moz-border-radius-topright: 6px; + -webkit-border-top-left-radius: 6px; + -webkit-border-top-right-radius: 6px; + border-top-left-radius: 6px; + border-top-right-radius: 6px; +} + +table { + color: #000; + font-size: 13px; +} + +.tborder { + background: #fff; + width: 100%; + margin: auto; + border: 1px solid #ccc; + padding: 1px; +} + +.thead { + background: #a1a2a2 url(thead.png) top left repeat-x; + color: #fff; + border-bottom: 1px solid #8e8f8f; + padding: 8px; +} + +.trow2 { + background: #efefef; + border: 1px solid; + border-color: #fff #ddd #ddd #fff; +} + +.padtopp { + padding-top: 25px; +} diff --git a/Server/webadmin/files/login.gif b/Server/webadmin/files/login.gif new file mode 100644 index 000000000..ce2cb6fc0 Binary files /dev/null and b/Server/webadmin/files/login.gif differ diff --git a/Server/webadmin/files/logo.png b/Server/webadmin/files/logo.png new file mode 100644 index 000000000..50733e824 Binary files /dev/null and b/Server/webadmin/files/logo.png differ diff --git a/Server/webadmin/files/logo_login.png b/Server/webadmin/files/logo_login.png new file mode 100644 index 000000000..d2155f928 Binary files /dev/null and b/Server/webadmin/files/logo_login.png differ diff --git a/Server/webadmin/files/mc-logo.png b/Server/webadmin/files/mc-logo.png new file mode 100644 index 000000000..9a77a490f Binary files /dev/null and b/Server/webadmin/files/mc-logo.png differ diff --git a/Server/webadmin/files/pmfolder.gif b/Server/webadmin/files/pmfolder.gif new file mode 100644 index 000000000..3fc68fdcb Binary files /dev/null and b/Server/webadmin/files/pmfolder.gif differ diff --git a/Server/webadmin/files/style.css b/Server/webadmin/files/style.css new file mode 100644 index 000000000..7c0671970 --- /dev/null +++ b/Server/webadmin/files/style.css @@ -0,0 +1,427 @@ +/* Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 */ +* { + margin: 0; +} + +body { + font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; + -webkit-font-smoothing: antialiased; + background: #fff; + width: 100%; + min-width: 100%; + height:100%; + min-height:100%; + overflow-y: scroll; + overflow-x: hidden; +} + +a:link { + color: #555; + text-decoration: none; +} + +a:visited { + color: #444; + text-decoration: none; +} + +a:hover, a:active { + color: #000; + text-decoration: underline; +} + +img { + border: none; +} + +h1 { + color: #069; + text-shadow: 2px 2px #000; +} + +.row1 { + border-bottom: 1px #000 solid; + height: 100px; + max-height: 100px; + background: #fff url(header.png) repeat-x top left; +} + +.row2 { + margin: 0 auto; + text-align: center; + vertical-align: middle; + margin-top: 25px; + margin-bottom: 25px; +} + +.contention { + color: #000; + text-align: left; + line-height: 1.4; + margin: 0; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + font-size: 13px; + margin-bottom:75px; +} + +.push25 { +} + +#panel ul.menu { + margin: 0; + padding: 0; + list-style: none; +} + +#panel ul.menu li { + margin: 0 5px; + display: inline; +} + +#panel ul.menu li a { + padding-left: 20px; + background-repeat: no-repeat; + background-position: left center; +} + +#panel .upper ul.top_links { + float: right; + font-weight: 700; +} + +#panel .upper { + background: #dcdbdc url(tcat.png) repeat-x; + border-top: 1px solid #fff; + border-bottom: 1px solid #bbb; + padding: 7px; +} + +#footer ul.menu { + margin: 0; + padding: 0; + list-style: none; +} + +#footer ul.menu li { + margin: 0 5px; + display: inline; +} + +#footer .upper { + background: #dcdbdc url(tcat.png) repeat-x; + border-top: 1px solid #bbb; + padding: 6px; + overflow: hidden; + font-size: 12px; +} + +#footer .upper ul.bottom_links { + float: left; + margin: 3px 0 0 -5px; +} + +#footer .lower { + background: #a1a2a2 url(thead.png) top left repeat-x; + color: #fff; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ddd; + overflow: hidden; + padding: 8px; + font-size: 11px; +} + +#footer .lower a:link,#footer .lower a:visited { + color: #fff; + font-weight: 700; +} + +#footer .lower a:hover,#footer .lower a:active { + color: #fff; + font-weight: 700; +} + +#footer .lower #current_time { + float: right; + padding-right: 6px; +} + +.wrapper { + width: 85%; + min-width: 970px; + max-width: 1500px; + margin: auto; +} + +#footer { + position: fixed; + left:0; + bottom:0; + height: 61px; + width: 100%; + background: #999; + border-top: 1px #000 solid; + border-bottom: 1px #000 solid; +} + +* html #footer { + position: absolute; + top: expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px'); +} + +tr td.trow1:first-child, tr td.trow2:first-child { + border-left: 0; +} + +tr td.trow1:last-child, tr td.trow2:last-child { + border-right: 0; +} + +.tborder { + -moz-border-radius: 7px; + -webkit-border-radius: 7px; + border-radius: 7px; +} + +.thead { + -moz-border-radius-topleft: 6px; + -moz-border-radius-topright: 6px; + -webkit-border-top-left-radius: 6px; + -webkit-border-top-right-radius: 6px; + border-top-left-radius: 6px; + border-top-right-radius: 6px; +} + +table { + color: #000; + font-size: 13px; +} + +.tborder { + background: #fff; + width: 100%; + margin: auto; + border: 1px solid #ccc; + padding: 1px; +} + +.thead { + background: #a1a2a2 url(thead.png) top left repeat-x; + color: #fff; + border-bottom: 1px solid #8e8f8f; + padding: 8px; +} + +.tcat { + background: #dcdbdc url(tcat.png) repeat-x; + color: #fff; + border-bottom: 1px solid #bbb; + padding: 6px; + font-size: 12px; +} + +.trow1 { + background: #f5f5f5; + border: 1px solid; + border-color: #fff #ddd #ddd #fff; +} + +.trow2 { + background: #efefef; + border: 1px solid; + border-color: #fff #ddd #ddd #fff; + padding: 15px; + box-sizing: border-box; + -moz-box-sizing: border-box; +} + +table { + color: #000; + font-size: 13px; + text-align: left; +} + +.tborder { + background: #fff; + width: 100%; + margin: auto; + border: 1px solid #ccc; + padding: 1px; +} + +.thead { + background: #a1a2a2 url(thead.png) top left repeat-x; + color: #fff; + border-bottom: 1px solid #8e8f8f; + padding: 8px; +} + +.tcat { + background: #dcdbdc url(tcat.png) repeat-x; + color: #fff; + border-bottom: 1px solid #bbb; + padding: 6px; + font-size: 12px; +} + +.trow1 { + background: #f5f5f5; + border: 1px solid; + border-color: #fff #ddd #ddd #fff; +} + +.trow2 { + background: #efefef; + border: 1px solid; + border-color: #fff #ddd #ddd #fff; +} + +.smalltext { + font-size: 11px; +} + +textarea { + background: #fff; + color: #000; + border: 1px solid #ccc; + padding: 2px; + line-height: 1.4; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + font-size: 13px; +} + +select { + background: #fff; + padding: 3px; + border: 1px solid #ccc; + font-family: Tahoma,Verdana,Arial,Sans-Serif; +} + +.usercp_nav_item { + display: block; + padding: 1px 0 1px 23px; +} + +.usercp_nav_pmfolder { + background: url(pmfolder.gif) no-repeat left center; +} + +.usercp_nav_sub_pmfolder { + padding-left: 40px; + background: url(sub_pmfolder.gif) no-repeat left center; +} + +.usercp_nav_home { + background: url(home.gif) no-repeat left center; +} + +.pagehead { + top: 0; + left: 0; + width: 100%; +} + +table { + width: 100%; +} + +table th { + border-bottom: 1px solid rgba(0,0,0,0.12); + padding: 5px; + text-align: left; +} + +table tr:nth-child(odd) { + background-color: rgba(0,0,0,0.015); +} + +p { + margin: 4px 0; + padding: 4px 3px; +} + +a { + text-decoration: none; + color: #000; + -webkit-transition: color .1s linear; + -moz-transition: color .1s linear; + transition: color .1s linear; +} + +a:hover { + color: #888; +} + +input[type="text"] { + background: #fff; + color: #000; + border: 1px solid #ccc; + padding: 2px; + line-height: 1.4; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + font-size: 13px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +input[type="text"]:hover { + background-color: #E5E4E2; +} + +input[type="text"]:focus { + background-color: #E5E4E2; +} + +hr { + border: none; + height: 1px; + background-color: rgba(0,0,0,0.12); +} + +h4 { + padding-bottom: 10px; + margin-bottom: 12px; + border-bottom: 1px solid rgba(0,0,0,0.12); +} + +#ChatDiv { + margin-bottom: 10px; +} + +#ChatMessage { + width: 92%; + margin-right: 5px; + box-sizing: border-box; + -moz-box-sizing: border-box; +} + +input[type="submit"] { + padding: 3px; + padding-left: 5px; + padding-right: 5px; + cursor: pointer; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + background: #f5f5f5; + border: 1px solid #ccc; +} + +input[type="submit"]:hover { + background-color: #E5E4E2; +} + +button:disabled,input:disabled { + padding: 3px; + padding-left: 5px; + padding-right: 5px; + cursor: pointer; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + border: none!important; + color: #fff!important; + background-color: #ccc!important; +} diff --git a/Server/webadmin/files/sub_pmfolder.gif b/Server/webadmin/files/sub_pmfolder.gif new file mode 100644 index 000000000..3d0d6e627 Binary files /dev/null and b/Server/webadmin/files/sub_pmfolder.gif differ diff --git a/Server/webadmin/files/tcat.png b/Server/webadmin/files/tcat.png new file mode 100644 index 000000000..eb64eb3d6 Binary files /dev/null and b/Server/webadmin/files/tcat.png differ diff --git a/Server/webadmin/files/thead.png b/Server/webadmin/files/thead.png new file mode 100644 index 000000000..81aa04bac Binary files /dev/null and b/Server/webadmin/files/thead.png differ diff --git a/Server/webadmin/login_template.html b/Server/webadmin/login_template.html new file mode 100644 index 000000000..fb6f21b52 --- /dev/null +++ b/Server/webadmin/login_template.html @@ -0,0 +1,69 @@ + + + + Cuberite WebAdmin - Login + + + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + +
    +
    MCServer WebAdmin
    +
    +
    + +
    +
    +
    +
    +
    + + + diff --git a/Server/webadmin/template.html b/Server/webadmin/template.html new file mode 100644 index 000000000..b0864e35d --- /dev/null +++ b/Server/webadmin/template.html @@ -0,0 +1,140 @@ + + + + {TITLE} | {PLUGIN_NAME} + + + + + + +
    + + Login: {USERNAME} + +
    +
    + +
    + +
    + {CONTENT} +
    +
    +

    MCServer is using {MEM}MB of memory, with {NUMCHUNKS} chunks loaded.

    +

    Web Design by

    +
    +
    + + diff --git a/Server/webadmin/template.lua b/Server/webadmin/template.lua new file mode 100644 index 000000000..5b3ecf152 --- /dev/null +++ b/Server/webadmin/template.lua @@ -0,0 +1,200 @@ +-- Use a table for fast concatenation of strings +local SiteContent = {} +function Output(String) + table.insert(SiteContent, String) +end + + + + + +function GetTableSize(Table) + local Size = 0 + for key,value in pairs(Table) do + Size = Size + 1 + end + return Size +end + + + + + +function GetDefaultPage() + local PM = cRoot:Get():GetPluginManager() + + local SubTitle = "Current Game" + local Content = "" + + Content = Content .. "

    Plugins:

      " + PM:ForEachPlugin( + function (a_CBPlugin) + if (a_CBPlugin:IsLoaded()) then + Content = Content .. "
    • " .. a_CBPlugin:GetName() .. " (version " .. a_CBPlugin:GetVersion() .. ")
    • " + end + end + ) + + Content = Content .. "
    " + Content = Content .. "

    Players:

      " + + cRoot:Get():ForEachPlayer( + function(a_CBPlayer) + Content = Content .. "
    • " .. a_CBPlayer:GetName() .. "
    • " + end + ) + + Content = Content .. "

    "; + + return Content, SubTitle +end + + + + + +function ShowPage(WebAdmin, TemplateRequest) + SiteContent = {} + local BaseURL = WebAdmin:GetBaseURL(TemplateRequest.Request.Path) + local Title = "Cuberite WebAdmin" + local NumPlayers = cRoot:Get():GetServer():GetNumPlayers() + local MemoryUsageKiB = cRoot:GetPhysicalRAMUsage() + local NumChunks = cRoot:Get():GetTotalChunkCount() + local PluginPage = WebAdmin:GetPage(TemplateRequest.Request) + local PageContent = PluginPage.Content + local SubTitle = PluginPage.PluginName + if (PluginPage.TabName ~= "") then + SubTitle = PluginPage.PluginName .. " - " .. PluginPage.TabName + end + if (PageContent == "") then + PageContent, SubTitle = GetDefaultPage() + end + + local reqParamsClass = "" + + for key,value in pairs(TemplateRequest.Request.Params) do + reqParamsClass = reqParamsClass .. " param-" .. string.lower(string.gsub(key, "[^a-zA-Z0-9]+", "-") .. "-" .. string.gsub(value, "[^a-zA-Z0-9]+", "-")) + end + + if (string.gsub(reqParamsClass, "%s", "") == "") then + reqParamsClass = " no-param" + end + + Output([[ + + + + ]] .. Title .. [[ + + + + + +
    + +
    +
    + + + + + + + +
    + + + + + + + + + + + + + + + + + +
    Menu
    Home
    Server Management
    + ]]) + + + local AllPlugins = WebAdmin:GetPlugins() + for key,value in pairs(AllPlugins) do + local PluginWebTitle = value:GetWebTitle() + local TabNames = value:GetTabNames() + if (GetTableSize(TabNames) > 0) then + Output("\n"); + + for webname,prettyname in pairs(TabNames) do + Output("\n") + end + + Output("
    \n"); + end + end + + + Output([[ +
    +
    + + + + + + + + + +
    ]] .. SubTitle .. [[
    ]] .. PageContent .. [[
    +
    +
    +
    + +
    + + +]]) + + return table.concat(SiteContent) +end -- cgit v1.2.3