summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitmodules12
-rw-r--r--.travis.yml24
-rw-r--r--CMakeLists.txt106
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--CONTRIBUTORS17
-rw-r--r--GETTING-STARTED.md16
-rw-r--r--Install/MCServer_high_detail_debug.cmd2
-rw-r--r--Install/MCServer_medium_detail_debug.cmd2
-rw-r--r--Install/Zip2008.list1
-rw-r--r--LICENSE6
-rw-r--r--MCServer/Plugins/APIDump/APIDesc.lua86
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnEntityChangedWorld.lua28
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnEntityChangingWorld.lua29
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnKilled.lua22
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnKilling.lua7
-rw-r--r--MCServer/Plugins/APIDump/InfoFile.html8
-rw-r--r--MCServer/Plugins/APIDump/main.css2
-rw-r--r--MCServer/Plugins/APIDump/main_APIDump.lua34
m---------MCServer/Plugins/Core0
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua111
-rw-r--r--MCServer/Plugins/Debuggers/Info.lua6
-rw-r--r--MCServer/Plugins/DumpInfo/Init.lua18
-rw-r--r--MCServer/Plugins/InfoDump.lua4
m---------MCServer/Plugins/MagicCarpet0
m---------MCServer/Plugins/TransAPI0
-rw-r--r--MCServer/Prefabs/Villages/AlchemistVillage.cubeset3647
-rw-r--r--MCServer/Prefabs/Villages/JapaneseVillage.cubeset3467
-rw-r--r--MCServer/Prefabs/Villages/PlainsVillage.cubeset6521
-rw-r--r--MCServer/Prefabs/Villages/SandFlatRoofVillage.cubeset1741
-rw-r--r--MCServer/Prefabs/Villages/SandVillage.cubeset2389
-rw-r--r--MCServer/crafting.txt7
-rw-r--r--MCServer/install_windows_service.cmd2
-rw-r--r--MCServer/items.ini2
-rw-r--r--MCServer/settings_apidump.ini30
-rw-r--r--MakeLuaAPI.cmd66
-rw-r--r--README.md34
-rw-r--r--SetFlags.cmake82
-rw-r--r--Tools/MCADefrag/CMakeLists.txt9
-rw-r--r--Tools/MCADefrag/MCADefrag.cpp2
-rw-r--r--Tools/ProtoProxy/CMakeLists.txt8
-rw-r--r--Tools/ProtoProxy/ProtoProxy.cpp2
-rw-r--r--Tools/QtBiomeVisualiser/MainWindow.cpp8
-rw-r--r--app.yml4
-rwxr-xr-xcompile.sh198
-rw-r--r--docs/Cubeset file format.html296
-rw-r--r--docs/style.css12
-rwxr-xr-xeasyinstall.sh8
m---------lib/SQLiteCpp0
m---------lib/TCLAP0
-rw-r--r--lib/expat/expat.h39
-rw-r--r--lib/expat/xmlparse.c375
-rw-r--r--lib/expat/xmlrole.c148
-rw-r--r--lib/expat/xmltok.c59
-rw-r--r--lib/expat/xmltok_impl.c23
-rw-r--r--lib/expat/xmltok_ns.c4
m---------lib/jsoncpp0
-rw-r--r--lib/jsoncpp/CMakeLists.txt13
-rw-r--r--lib/jsoncpp/include/json/autolink.h19
-rw-r--r--lib/jsoncpp/include/json/config.h43
-rw-r--r--lib/jsoncpp/include/json/features.h42
-rw-r--r--lib/jsoncpp/include/json/forwards.h39
-rw-r--r--lib/jsoncpp/include/json/json.h10
-rw-r--r--lib/jsoncpp/include/json/reader.h196
-rw-r--r--lib/jsoncpp/include/json/value.h1069
-rw-r--r--lib/jsoncpp/include/json/writer.h174
-rw-r--r--lib/jsoncpp/src/lib_json/json_batchallocator.h125
-rw-r--r--lib/jsoncpp/src/lib_json/json_internalarray.inl448
-rw-r--r--lib/jsoncpp/src/lib_json/json_internalmap.inl607
-rw-r--r--lib/jsoncpp/src/lib_json/json_reader.cpp885
-rw-r--r--lib/jsoncpp/src/lib_json/json_value.cpp1727
-rw-r--r--lib/jsoncpp/src/lib_json/json_valueiterator.inl292
-rw-r--r--lib/jsoncpp/src/lib_json/json_writer.cpp829
-rw-r--r--lib/jsoncpp/src/lib_json/sconscript8
-rw-r--r--lib/luaexpat/lxplib.c37
-rw-r--r--lib/luaexpat/lxplib.h1
-rw-r--r--lib/sqlite/CMakeLists.txt2
-rw-r--r--lib/tolua++/CMakeLists.txt4
-rw-r--r--lib/zlib/compress.c2
-rw-r--r--lib/zlib/deflate.c12
-rw-r--r--lib/zlib/deflate.h2
-rw-r--r--lib/zlib/gzguts.h22
-rw-r--r--lib/zlib/gzlib.c40
-rw-r--r--lib/zlib/gzread.c21
-rw-r--r--lib/zlib/gzwrite.c64
-rw-r--r--lib/zlib/infback.c2
-rw-r--r--lib/zlib/inffast.c6
-rw-r--r--lib/zlib/inflate.c64
-rw-r--r--lib/zlib/inftrees.c14
-rw-r--r--lib/zlib/trees.c14
-rw-r--r--lib/zlib/uncompr.c2
-rw-r--r--lib/zlib/zconf.h33
-rw-r--r--lib/zlib/zlib.h48
-rw-r--r--lib/zlib/zutil.c2
-rw-r--r--lib/zlib/zutil.h9
-rw-r--r--src/AllocationPool.h6
-rw-r--r--src/Bindings/BindingsProcessor.lua16
-rw-r--r--src/Bindings/CMakeLists.txt9
-rw-r--r--src/Bindings/LuaChunkStay.cpp6
-rw-r--r--src/Bindings/LuaState.cpp138
-rw-r--r--src/Bindings/LuaState.h187
-rw-r--r--src/Bindings/ManualBindings.cpp62
-rw-r--r--src/Bindings/ManualBindings.h12
-rw-r--r--src/Bindings/ManualBindings_Network.cpp7
-rw-r--r--src/Bindings/ManualBindings_World.cpp9
-rw-r--r--src/Bindings/Plugin.h3
-rw-r--r--src/Bindings/PluginLua.cpp84
-rw-r--r--src/Bindings/PluginLua.h5
-rw-r--r--src/Bindings/PluginManager.cpp93
-rw-r--r--src/Bindings/PluginManager.h17
-rw-r--r--src/BiomeDef.cpp4
-rw-r--r--src/BiomeDef.h22
-rw-r--r--src/BlockArea.cpp75
-rw-r--r--src/BlockArea.h11
-rw-r--r--src/BlockEntities/BeaconEntity.cpp6
-rw-r--r--src/BlockEntities/BlockEntity.h3
-rw-r--r--src/BlockEntities/BlockEntityWithItems.h2
-rw-r--r--src/BlockEntities/CMakeLists.txt5
-rw-r--r--src/BlockEntities/ChestEntity.cpp16
-rw-r--r--src/BlockEntities/ChestEntity.h18
-rw-r--r--src/BlockEntities/DropSpenserEntity.cpp4
-rw-r--r--src/BlockEntities/EnderChestEntity.cpp12
-rw-r--r--src/BlockEntities/FurnaceEntity.cpp42
-rw-r--r--src/BlockEntities/FurnaceEntity.h8
-rw-r--r--src/BlockEntities/HopperEntity.cpp2
-rw-r--r--src/BlockEntities/MobSpawnerEntity.cpp18
-rw-r--r--src/BlockEntities/NoteEntity.cpp11
-rw-r--r--src/BlockEntities/NoteEntity.h2
-rw-r--r--src/BlockID.cpp38
-rw-r--r--src/BlockInfo.cpp3
-rw-r--r--src/Blocks/BlockAnvil.h8
-rw-r--r--src/Blocks/BlockBed.h7
-rw-r--r--src/Blocks/BlockButton.h34
-rw-r--r--src/Blocks/BlockCocoaPod.h8
-rw-r--r--src/Blocks/BlockComparator.h79
-rw-r--r--src/Blocks/BlockDirt.h41
-rw-r--r--src/Blocks/BlockDoor.cpp20
-rw-r--r--src/Blocks/BlockDoor.h12
-rw-r--r--src/Blocks/BlockFarmland.h13
-rw-r--r--src/Blocks/BlockFire.h19
-rw-r--r--src/Blocks/BlockFluid.h6
-rw-r--r--src/Blocks/BlockHandler.cpp40
-rw-r--r--src/Blocks/BlockHandler.h23
-rw-r--r--src/Blocks/BlockHopper.h2
-rw-r--r--src/Blocks/BlockLadder.h11
-rw-r--r--src/Blocks/BlockLeaves.h36
-rw-r--r--src/Blocks/BlockLever.h18
-rw-r--r--src/Blocks/BlockPiston.cpp6
-rw-r--r--src/Blocks/BlockQuartz.h7
-rw-r--r--src/Blocks/BlockRail.h43
-rw-r--r--src/Blocks/BlockSapling.h142
-rw-r--r--src/Blocks/BlockSideways.h6
-rw-r--r--src/Blocks/BlockSlab.h10
-rw-r--r--src/Blocks/BlockStairs.h6
-rw-r--r--src/Blocks/BlockTorch.h23
-rw-r--r--src/Blocks/BlockTrapdoor.h11
-rw-r--r--src/Blocks/BlockTripwireHook.h16
-rw-r--r--src/Blocks/BlockVine.h2
-rw-r--r--src/Blocks/BlockWallSign.h12
-rw-r--r--src/Blocks/CMakeLists.txt5
-rw-r--r--src/Blocks/WorldInterface.h12
-rw-r--r--src/BoundingBox.cpp13
-rw-r--r--src/ByteBuffer.cpp15
-rw-r--r--src/CMakeLists.txt52
-rw-r--r--src/Chunk.cpp42
-rw-r--r--src/Chunk.h1
-rw-r--r--src/ChunkDef.h52
-rw-r--r--src/ChunkMap.cpp20
-rw-r--r--src/ChunkMap.h3
-rw-r--r--src/ChunkSender.cpp279
-rw-r--r--src/ChunkSender.h120
-rw-r--r--src/ClientHandle.cpp177
-rw-r--r--src/ClientHandle.h23
-rw-r--r--src/CompositeChat.cpp37
-rw-r--r--src/CraftingRecipes.cpp20
-rw-r--r--src/Defines.h93
-rw-r--r--src/Enchantments.cpp10
-rw-r--r--src/Enchantments.h8
-rw-r--r--src/Endianness.h4
-rw-r--r--src/Entities/ArrowEntity.cpp13
-rw-r--r--src/Entities/CMakeLists.txt8
-rw-r--r--src/Entities/EnderCrystal.cpp2
-rw-r--r--src/Entities/Entity.cpp76
-rw-r--r--src/Entities/Entity.h49
-rw-r--r--src/Entities/ExpOrb.cpp4
-rw-r--r--src/Entities/FallingBlock.cpp2
-rw-r--r--src/Entities/FireChargeEntity.cpp10
-rw-r--r--src/Entities/FireChargeEntity.h2
-rw-r--r--src/Entities/GhastFireballEntity.cpp8
-rw-r--r--src/Entities/GhastFireballEntity.h2
-rw-r--r--src/Entities/HangingEntity.h20
-rw-r--r--src/Entities/ItemFrame.cpp6
-rw-r--r--src/Entities/Minecart.cpp17
-rw-r--r--src/Entities/Minecart.h2
-rw-r--r--src/Entities/Painting.cpp2
-rw-r--r--src/Entities/Pawn.cpp4
-rw-r--r--src/Entities/Pickup.cpp7
-rw-r--r--src/Entities/Player.cpp195
-rw-r--r--src/Entities/Player.h200
-rw-r--r--src/Entities/ProjectileEntity.cpp7
-rw-r--r--src/Entities/SplashPotionEntity.cpp12
-rw-r--r--src/Entities/ThrownEnderPearlEntity.cpp4
-rw-r--r--src/Entities/ThrownSnowballEntity.cpp2
-rw-r--r--src/FastRandom.cpp26
-rw-r--r--src/FurnaceRecipe.cpp12
-rw-r--r--src/Generating/BioGen.cpp116
-rw-r--r--src/Generating/BioGen.h14
-rw-r--r--src/Generating/CMakeLists.txt28
-rw-r--r--src/Generating/ChunkDesc.cpp12
-rw-r--r--src/Generating/ChunkDesc.h8
-rw-r--r--src/Generating/CompoGenBiomal.cpp22
-rw-r--r--src/Generating/ComposableGenerator.cpp10
-rw-r--r--src/Generating/CompositedHeiGen.h7
-rw-r--r--src/Generating/DungeonRoomsFinisher.cpp4
-rw-r--r--src/Generating/FinishGen.cpp37
-rw-r--r--src/Generating/GridStructGen.cpp4
-rw-r--r--src/Generating/HeiGen.cpp51
-rw-r--r--src/Generating/HeiGen.h14
-rw-r--r--src/Generating/IntGen.h4
-rw-r--r--src/Generating/MineShafts.cpp28
-rw-r--r--src/Generating/NetherFortGen.cpp4
-rw-r--r--src/Generating/Noise3DGenerator.cpp7
-rw-r--r--src/Generating/POCPieceGenerator.cpp4
-rw-r--r--src/Generating/PieceGenerator.cpp28
-rw-r--r--src/Generating/Prefab.cpp59
-rw-r--r--src/Generating/Prefab.h25
-rw-r--r--src/Generating/PrefabPiecePool.cpp494
-rw-r--r--src/Generating/PrefabPiecePool.h140
-rw-r--r--src/Generating/Prefabs/AlchemistVillagePrefabs.cpp3590
-rw-r--r--src/Generating/Prefabs/AlchemistVillagePrefabs.h15
-rw-r--r--src/Generating/Prefabs/CMakeLists.txt16
-rw-r--r--src/Generating/Prefabs/JapaneseVillagePrefabs.cpp3386
-rw-r--r--src/Generating/Prefabs/JapaneseVillagePrefabs.h15
-rw-r--r--src/Generating/Prefabs/PlainsVillagePrefabs.cpp6118
-rw-r--r--src/Generating/Prefabs/PlainsVillagePrefabs.h15
-rw-r--r--src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp1669
-rw-r--r--src/Generating/Prefabs/SandFlatRoofVillagePrefabs.h15
-rw-r--r--src/Generating/Prefabs/SandVillagePrefabs.cpp2307
-rw-r--r--src/Generating/Prefabs/SandVillagePrefabs.h15
-rw-r--r--src/Generating/Prefabs/UnderwaterBasePrefabs.cpp185
-rw-r--r--src/Generating/ProtIntGen.h288
-rw-r--r--src/Generating/RainbowRoadsGen.cpp2
-rw-r--r--src/Generating/Ravines.cpp16
-rw-r--r--src/Generating/RoughRavines.cpp16
-rw-r--r--src/Generating/StructGen.cpp28
-rw-r--r--src/Generating/TestRailsGen.cpp2
-rw-r--r--src/Generating/Trees.cpp138
-rw-r--r--src/Generating/Trees.h6
-rw-r--r--src/Generating/TwoHeights.cpp2
-rw-r--r--src/Generating/UnderwaterBaseGen.cpp2
-rw-r--r--src/Generating/VillageGen.cpp174
-rw-r--r--src/Generating/VillageGen.h24
-rw-r--r--src/Globals.h35
-rw-r--r--src/HTTPServer/CMakeLists.txt5
-rw-r--r--src/HTTPServer/HTTPConnection.cpp2
-rw-r--r--src/HTTPServer/HTTPFormParser.cpp7
-rw-r--r--src/HTTPServer/HTTPServer.cpp4
-rw-r--r--src/HTTPServer/SslHTTPConnection.cpp2
-rw-r--r--src/IniFile.cpp66
-rw-r--r--src/IniFile.h56
-rw-r--r--src/Inventory.cpp29
-rw-r--r--src/Inventory.h10
-rw-r--r--src/ItemGrid.cpp2
-rw-r--r--src/Items/CMakeLists.txt4
-rw-r--r--src/Items/ItemBed.h15
-rw-r--r--src/Items/ItemBigFlower.h15
-rw-r--r--src/Items/ItemBow.h11
-rw-r--r--src/Items/ItemBucket.h20
-rw-r--r--src/Items/ItemChest.h75
-rw-r--r--src/Items/ItemDoor.h13
-rw-r--r--src/Items/ItemDye.h2
-rw-r--r--src/Items/ItemEmptyMap.h2
-rw-r--r--src/Items/ItemHandler.cpp71
-rw-r--r--src/Items/ItemHandler.h20
-rw-r--r--src/Items/ItemMobHead.h33
-rw-r--r--src/Items/ItemMushroomSoup.h2
-rw-r--r--src/Items/ItemSign.h2
-rw-r--r--src/LightingThread.cpp14
-rw-r--r--src/LightingThread.h6
-rw-r--r--src/LineBlockTracer.cpp31
-rw-r--r--src/LinearUpscale.h10
-rw-r--r--src/LoggerListeners.cpp36
-rw-r--r--src/LoggerListeners.h2
-rw-r--r--src/Map.cpp6
-rw-r--r--src/MapManager.cpp6
-rw-r--r--src/MapManager.h2
-rw-r--r--src/Matrix4.h8
-rw-r--r--src/MemorySettingsRepository.cpp312
-rw-r--r--src/MemorySettingsRepository.h80
-rw-r--r--src/MobCensus.cpp9
-rw-r--r--src/MobFamilyCollecter.cpp2
-rw-r--r--src/MobSpawner.cpp2
-rw-r--r--src/Mobs/AggressiveMonster.cpp16
-rw-r--r--src/Mobs/Blaze.cpp2
-rw-r--r--src/Mobs/CMakeLists.txt6
-rw-r--r--src/Mobs/CaveSpider.cpp4
-rw-r--r--src/Mobs/Chicken.cpp2
-rw-r--r--src/Mobs/Cow.cpp2
-rw-r--r--src/Mobs/Creeper.cpp8
-rw-r--r--src/Mobs/Enderman.cpp4
-rw-r--r--src/Mobs/Ghast.cpp2
-rw-r--r--src/Mobs/Guardian.cpp11
-rw-r--r--src/Mobs/Horse.cpp10
-rw-r--r--src/Mobs/Horse.h2
-rw-r--r--src/Mobs/Monster.cpp157
-rw-r--r--src/Mobs/Monster.h30
-rw-r--r--src/Mobs/Mooshroom.cpp2
-rw-r--r--src/Mobs/PassiveAggressiveMonster.cpp2
-rw-r--r--src/Mobs/PassiveMonster.cpp2
-rw-r--r--src/Mobs/Path.cpp260
-rw-r--r--src/Mobs/Path.h86
-rw-r--r--src/Mobs/Pig.cpp2
-rw-r--r--src/Mobs/Rabbit.cpp2
-rw-r--r--src/Mobs/Sheep.cpp6
-rw-r--r--src/Mobs/Skeleton.cpp9
-rw-r--r--src/Mobs/Slime.cpp2
-rw-r--r--src/Mobs/Spider.cpp2
-rw-r--r--src/Mobs/Squid.cpp11
-rw-r--r--src/Mobs/Witch.cpp2
-rw-r--r--src/Mobs/Wolf.cpp7
-rw-r--r--src/Mobs/Wolf.h4
-rw-r--r--src/Mobs/Zombie.cpp2
-rw-r--r--src/Mobs/ZombiePigman.cpp2
-rw-r--r--src/MonsterConfig.cpp4
-rw-r--r--src/NetherPortalScanner.cpp296
-rw-r--r--src/NetherPortalScanner.h75
-rw-r--r--src/Noise/CMakeLists.txt4
-rw-r--r--src/Noise/Noise.cpp32
-rw-r--r--src/Noise/Noise.h16
-rw-r--r--src/OSSupport/CMakeLists.txt6
-rw-r--r--src/OSSupport/Errors.cpp2
-rw-r--r--src/OSSupport/Event.cpp60
-rw-r--r--src/OSSupport/Event.h11
-rw-r--r--src/OSSupport/File.cpp30
-rw-r--r--src/OSSupport/File.h8
-rw-r--r--src/OSSupport/GZipFile.h2
-rw-r--r--src/OSSupport/IsThread.cpp4
-rw-r--r--src/OSSupport/IsThread.h15
-rw-r--r--src/OSSupport/NetworkInterfaceEnum.cpp13
-rw-r--r--src/OSSupport/Semaphore.cpp107
-rw-r--r--src/OSSupport/Semaphore.h17
-rw-r--r--src/OSSupport/ServerHandleImpl.cpp4
-rw-r--r--src/OSSupport/StackTrace.cpp9
-rw-r--r--src/OverridesSettingsRepository.cpp273
-rw-r--r--src/OverridesSettingsRepository.h52
-rw-r--r--src/PolarSSL++/BlockingSslClientSocket.cpp8
-rw-r--r--src/PolarSSL++/BlockingSslClientSocket.h5
-rw-r--r--src/PolarSSL++/BufferedSslContext.cpp6
-rw-r--r--src/PolarSSL++/CMakeLists.txt4
-rw-r--r--src/PolarSSL++/CryptoKey.cpp12
-rw-r--r--src/PolarSSL++/CtrDrbgContext.cpp2
-rw-r--r--src/PolarSSL++/SslContext.cpp4
-rw-r--r--src/PolarSSL++/SslContext.h4
-rw-r--r--src/PolarSSL++/X509Cert.cpp2
-rw-r--r--src/Protocol/Authenticator.cpp20
-rw-r--r--src/Protocol/Authenticator.h6
-rw-r--r--src/Protocol/CMakeLists.txt9
-rw-r--r--src/Protocol/ChunkDataSerializer.cpp60
-rw-r--r--src/Protocol/ChunkDataSerializer.h2
-rw-r--r--src/Protocol/MojangAPI.cpp48
-rw-r--r--src/Protocol/MojangAPI.h4
-rw-r--r--src/Protocol/Packetizer.h2
-rw-r--r--src/Protocol/Protocol.h13
-rw-r--r--src/Protocol/Protocol17x.cpp137
-rw-r--r--src/Protocol/Protocol17x.h13
-rw-r--r--src/Protocol/Protocol18x.cpp232
-rw-r--r--src/Protocol/Protocol18x.h13
-rw-r--r--src/Protocol/ProtocolRecognizer.cpp130
-rw-r--r--src/Protocol/ProtocolRecognizer.h13
-rw-r--r--src/RCONServer.cpp8
-rw-r--r--src/RCONServer.h6
-rw-r--r--src/Root.cpp130
-rw-r--r--src/Root.h82
-rw-r--r--src/Scoreboard.cpp10
-rw-r--r--src/SelfTests.cpp71
-rw-r--r--src/SelfTests.h51
-rw-r--r--src/Server.cpp24
-rw-r--r--src/Server.h4
-rw-r--r--src/SettingsRepositoryInterface.h61
-rw-r--r--src/Simulator/CMakeLists.txt7
-rw-r--r--src/Simulator/DelayedFluidSimulator.cpp10
-rw-r--r--src/Simulator/FloodyFluidSimulator.cpp18
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.cpp1070
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.h203
-rw-r--r--src/Simulator/SandSimulator.cpp11
-rw-r--r--src/Simulator/VanillaFluidSimulator.cpp2
-rw-r--r--src/Simulator/VaporizeFluidSimulator.cpp9
-rw-r--r--src/SpawnPrepare.cpp125
-rw-r--r--src/SpawnPrepare.h49
-rw-r--r--src/Statistics.cpp2
-rw-r--r--src/StringUtils.h10
-rw-r--r--src/Tracer.cpp2
-rw-r--r--src/UI/CMakeLists.txt6
-rw-r--r--src/UI/EnchantingWindow.cpp6
-rw-r--r--src/UI/EnderChestWindow.cpp17
-rw-r--r--src/UI/SlotArea.cpp8
-rw-r--r--src/UI/SlotArea.h2
-rw-r--r--src/UI/Window.cpp14
-rw-r--r--src/Vector3.h22
-rw-r--r--src/WebAdmin.cpp6
-rw-r--r--src/World.cpp352
-rw-r--r--src/World.h58
-rw-r--r--src/WorldStorage/CMakeLists.txt18
-rw-r--r--src/WorldStorage/EnchantmentSerializer.cpp6
-rw-r--r--src/WorldStorage/FastNBT.cpp7
-rw-r--r--src/WorldStorage/FastNBT.h60
-rw-r--r--src/WorldStorage/FireworksSerializer.cpp2
-rw-r--r--src/WorldStorage/MapSerializer.cpp12
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp33
-rw-r--r--src/WorldStorage/SchematicFileSerializer.cpp30
-rw-r--r--src/WorldStorage/StatSerializer.cpp6
-rwxr-xr-xsrc/WorldStorage/WSSAnvil.cpp224
-rw-r--r--src/WorldStorage/WorldStorage.cpp4
-rw-r--r--src/main.cpp264
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/ChunkData/CMakeLists.txt6
-rw-r--r--tests/ChunkData/Coordinates.cpp12
-rw-r--r--tests/LoadablePieces/Bindings.h15
-rw-r--r--tests/LoadablePieces/CMakeLists.txt96
-rw-r--r--tests/LoadablePieces/LoadablePieces.cpp57
-rw-r--r--tests/LoadablePieces/LuaState_Declaration.inc4
-rw-r--r--tests/LoadablePieces/LuaState_Typedefs.inc19
-rw-r--r--tests/LoadablePieces/Stubs.cpp274
-rw-r--r--tests/LoadablePieces/Test.cubeset154
-rw-r--r--tests/LoadablePieces/Test1.schematicbin0 -> 184 bytes
-rw-r--r--tests/Network/CMakeLists.txt8
425 files changed, 28316 insertions, 28041 deletions
diff --git a/.gitmodules b/.gitmodules
index 93fac9d1f..f3653ec9f 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -22,9 +22,21 @@
[submodule "lib/polarssl"]
path = lib/polarssl
url = https://github.com/mc-server/polarssl.git
+ ignore = dirty
[submodule "lib/SQLiteCpp"]
path = lib/SQLiteCpp
url = https://github.com/mc-server/SQLiteCpp.git
+ ignore = dirty
[submodule "lib/libevent"]
path = lib/libevent
url = https://github.com/mc-server/libevent.git
+ ignore = dirty
+[submodule "lib/jsoncpp"]
+ path = lib/jsoncpp
+ url = https://github.com/open-source-parsers/jsoncpp.git
+ ignore = dirty
+[submodule "lib/TCLAP"]
+ path = lib/TCLAP
+ url = https://github.com/mc-server/TCLAP.git
+ ignore = dirty
+
diff --git a/.travis.yml b/.travis.yml
index 2fd3bf991..e39cdbc14 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,39 +1,27 @@
language: cpp
-compiler: clang
-before_install:
- - if [ "$TRAVIS_MCSERVER_BUILD_TYPE" == "COVERAGE" ]; then sudo pip install cpp_coveralls; fi
+compiler:
+- clang
+- gcc
- # g++4.8
+before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
install:
- # g++4.8 and clang
- sudo apt-get install -qq g++-4.8
+ - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
+ - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90
# lua, needed for style checking and possibly later on for bindings generation
- sudo apt-get install -qq lua5.1
-
- # g++4.8
- - if [ "$CXX" == "g++" ]; then export CXX="g++-4.8"; export CC="gcc-4.8"; fi
-# Build MCServer
script: ./CIbuild.sh
-after_success:
- - ./uploadCoverage.sh
-
env:
- TRAVIS_MCSERVER_BUILD_TYPE=RELEASE MCSERVER_PATH=./MCServer
- TRAVIS_MCSERVER_BUILD_TYPE=DEBUG MCSERVER_PATH=./MCServer_debug
-matrix:
- include:
- - compiler: gcc
- env: TRAVIS_MCSERVER_BUILD_TYPE=COVERAGE MCSERVER_PATH=./MCServer
-
-# Notification Settings
notifications:
email:
on_success: change
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2bb780eba..a02c9b4fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,11 @@ cmake_minimum_required (VERSION 2.8.7)
# Without this, the MSVC variable isn't defined for MSVC builds ( http://www.cmake.org/pipermail/cmake/2011-November/047130.html )
enable_language(CXX C)
+# Enable the support for solution folders in MSVC
+if (MSVC)
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+endif()
+
# These env variables are used for configuring Travis CI builds.
# See https://github.com/mc-server/MCServer/pull/767
if(DEFINED ENV{TRAVIS_MCSERVER_BUILD_TYPE})
@@ -19,6 +24,7 @@ if(DEFINED ENV{TRAVIS_BUILD_WITH_COVERAGE})
endif()
if(DEFINED ENV{MCSERVER_BUILD_ID})
+ # The build info is defined by the build system (Travis / Jenkins)
set(BUILD_ID $ENV{MCSERVER_BUILD_ID})
set(BUILD_SERIES_NAME $ENV{MCSERVER_BUILD_SERIES_NAME})
set(BUILD_DATETIME $ENV{MCSERVER_BUILD_DATETIME})
@@ -29,12 +35,41 @@ if(DEFINED ENV{MCSERVER_BUILD_ID})
execute_process(
COMMAND git rev-parse HEAD
RESULT_VARIABLE GIT_EXECUTED
- OUTPUT_VARIABLE BUILD_COMMIT_ID)
- string(STRIP ${BUILD_COMMIT_ID} BUILD_COMMIT_ID)
+ OUTPUT_VARIABLE BUILD_COMMIT_ID
+ )
+ string(STRIP ${BUILD_COMMIT_ID} BUILD_COMMIT_ID)
if (NOT (GIT_EXECUTED EQUAL 0))
message(FATAL_ERROR "Could not identifiy git commit id")
endif()
endif()
+else()
+ # This is a local build, stuff in some basic info:
+ set(BUILD_ID "Unknown")
+ set(BUILD_SERIES_NAME "local build")
+ execute_process(
+ COMMAND git rev-parse HEAD
+ RESULT_VARIABLE GIT_EXECUTED
+ OUTPUT_VARIABLE BUILD_COMMIT_ID
+ )
+ if (NOT(GIT_EXECUTED EQUAL 0))
+ set(BUILD_COMMIT_ID "Unknown")
+ endif()
+ string(STRIP ${BUILD_COMMIT_ID} BUILD_COMMIT_ID)
+ execute_process(
+ COMMAND git log -1 --date=iso --pretty=format:%ai
+ RESULT_VARIABLE GIT_EXECUTED
+ OUTPUT_VARIABLE BUILD_DATETIME
+ )
+ if (NOT(GIT_EXECUTED EQUAL 0))
+ set(BUILD_DATETIME "Unknown")
+ endif()
+ string(STRIP ${BUILD_DATETIME} BUILD_DATETIME)
+
+ # The BUILD_COMMIT_ID and BUILD_DATETIME aren't updated on each repo pull
+ # They are only updated when cmake re-configures the project
+ # Therefore mark them as "approx: "
+ set(BUILD_COMMIT_ID "approx: ${BUILD_COMMIT_ID}")
+ set(BUILD_DATETIME "approx: ${BUILD_DATETIME}")
endif()
# We need C++11 features, Visual Studio has those from VS2012, but it needs a new platform toolset for those; VS2013 supports them natively:
@@ -52,6 +87,9 @@ if(MSVC OR MSVC_IDE)
endif()
endif()
+set(BUILD_TOOLS OFF CACHE BOOL "")
+set(SELF_TEST OFF CACHE BOOL "")
+
# This has to be done before any flags have been set up.
if(${BUILD_TOOLS})
message("Building tools")
@@ -64,6 +102,7 @@ if(${BUILD_UNSTABLE_TOOLS})
add_subdirectory(Tools/GeneratorPerformanceTest/)
endif()
+include(CheckCXXCompilerFlag)
include(SetFlags.cmake)
set_flags()
set_lib_flags()
@@ -99,6 +138,7 @@ set(SQLITECPP_RUN_DOXYGEN OFF CACHE BOOL "Run Doxygen C++ documentation tool
set(SQLITECPP_BUILD_EXAMPLES OFF CACHE BOOL "Build examples." FORCE)
set(SQLITECPP_BUILD_TESTS OFF CACHE BOOL "Build and run tests." FORCE)
set(SQLITECPP_INTERNAL_SQLITE OFF CACHE BOOL "Add the internal SQLite3 source to the project." FORCE)
+set(SQLITE_ENABLE_COLUMN_METADATA OFF CACHE BOOL "" FORCE)
# Set options for LibEvent, disable all their tests and benchmarks:
set(EVENT__DISABLE_OPENSSL YES CACHE BOOL "Disable OpenSSL in LibEvent" FORCE)
@@ -107,6 +147,13 @@ set(EVENT__DISABLE_TESTS YES CACHE BOOL "Disable LibEvent tests"
set(EVENT__DISABLE_REGRESS YES CACHE BOOL "Disable LibEvent regression tests" FORCE)
set(EVENT__DISABLE_SAMPLES YES CACHE BOOL "Disable LibEvent samples" FORCE)
+# Set options for JsonCPP, disabling all of their tests
+# Additionally, their library is output to a strange location; make sure the linker knows where to find it
+set(JSONCPP_WITH_TESTS OFF CACHE BOOL "Compile and (for jsoncpp_check) run JsonCpp test executables")
+set(JSONCPP_WITH_POST_BUILD_UNITTEST OFF CACHE BOOL "Automatically run unit-tests as a post build step")
+set(JSONCPP_WITH_PKGCONFIG_SUPPORT OFF CACHE BOOL "Generate and install .pc files")
+link_directories(lib/jsoncpp/src/lib_json)
+
# Check that the libraries are present:
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/SQLiteCpp/CMakeLists.txt)
message(FATAL_ERROR "SQLiteCpp is missing in folder lib/SQLiteCpp. Have you initialized the submodules / downloaded the extra libraries?")
@@ -127,7 +174,7 @@ add_subdirectory(lib/sqlite/)
add_subdirectory(lib/SQLiteCpp/)
add_subdirectory(lib/expat/)
add_subdirectory(lib/luaexpat/)
-add_subdirectory(lib/libevent/)
+add_subdirectory(lib/libevent/ EXCLUDE_FROM_ALL)
# Add proper include directories so that SQLiteCpp can find SQLite3:
get_property(SQLITECPP_INCLUDES DIRECTORY "lib/SQLiteCpp/" PROPERTY INCLUDE_DIRECTORIES)
@@ -138,6 +185,9 @@ set_property(TARGET SQLiteCpp PROPERTY INCLUDE_DIRECTORIES "${SQLITECPP_INCLUDES
# Add proper includes for LibEvent's event-config.h header:
include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS})
+# Prettify jsoncpp_lib_static name in VS solution explorer
+set_property(TARGET jsoncpp_lib_static PROPERTY PROJECT_LABEL "jsoncpp")
+
if (WIN32)
add_subdirectory(lib/luaproxy/)
endif()
@@ -157,3 +207,53 @@ if(${SELF_TEST})
add_subdirectory (tests)
endif()
+# Put projects into solution folders in MSVC:
+if (MSVC)
+ set_target_properties(
+ event_core
+ event_extra
+ expat
+ jsoncpp_lib_static
+ lua
+ luaexpat
+ mbedtls
+ sqlite
+ SQLiteCpp
+ tolualib
+ zlib
+ PROPERTIES FOLDER Lib
+ )
+ set_target_properties(
+ luaproxy
+ tolua
+ PROPERTIES FOLDER Support
+ )
+ if (${SELF_TEST})
+ set_target_properties(
+ Network
+ PROPERTIES FOLDER Lib
+ )
+ set_target_properties(
+ arraystocoords-exe
+ ChunkBuffer
+ coordinates-exe
+ copies-exe
+ copyblocks-exe
+ creatable-exe
+ EchoServer
+ Google-exe
+ LoadablePieces
+ NameLookup
+ PROPERTIES FOLDER Tests
+ )
+ endif()
+
+ if(${BUILD_TOOLS})
+ set_target_properties(
+ MCADefrag
+ ProtoProxy
+ PROPERTIES FOLDER Tools
+ )
+ endif()
+endif()
+
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4e57e6efb..1b43ed214 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -23,7 +23,7 @@ Here are the conventions:
- This helps prevent mistakes such as `if (a & 1 == 0)`
*
* Use the provided wrappers for OS stuff:
- - Threading is done by inheriting from `cIsThread`, thread synchronization through `cCriticalSection`, `cSemaphore` and `cEvent`, file access and filesystem operations through the `cFile` class, high-precision timers through `cTimer`, high-precision sleep through `cSleep`
+ - Threading is done by inheriting from `cIsThread`, thread synchronization through `cCriticalSection` and `cEvent`, file access and filesystem operations through the `cFile` class, high-precision timers through `cTimer`, high-precision sleep through `cSleep`
* No magic numbers, use named constants:
- `E_ITEM_XXX`, `E_BLOCK_XXX` and `E_META_XXX` for items and blocks
- `cEntity::etXXX` for entity types, `cMonster::mtXXX` for mob types
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index a25c6f06b..f4b527000 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1,30 +1,39 @@
-Many people have contributed to MCServer, and this list attempts to broadcast at least some of them.
+Many people have contributed to Cuberite, and this list attempts to broadcast at least some of them.
BasedDoge (Donated AlchemistVillage prefabs)
bearbin (Alexander Harkness)
+beeduck
+birkett (Anthony Birkett)
derouinw
Diusrex
Duralex
FakeTruth (founder)
+HaoTNN
Howaner
+jan64
+jasperarmstrong
keyboard
Lapayo
+lkolbly
Luksor
+linnemannr (Reid Linnemann)
M10360
marmot21
Masy98
mborland
mgueydan
MikeHunsinger
+missingchar (mathias-github)
mtilden
nesco
p-mcgowan
rs2k
SafwatHalaby (Safwat Halaby)
SamJBarney
+Seadragon91 (Lukas Pioch)
Sofapriester
SphinxC0re
-STR_Warrior
+NiLSPACE (formerly STR_Warrior)
structinf (xdot)
Sxw1212
Taugeshtu
@@ -33,7 +42,7 @@ tonibm19
UltraCoderRU
WebFreak001
worktycho
-xoft
+xoft (Mattes Dolak/madmaxoft on GH)
Yeeeeezus (Donated AlchemistVillage prefabs)
-Please add yourself to this list if you contribute to MCServer.
+Please add yourself to this list if you contribute to Cuberite.
diff --git a/GETTING-STARTED.md b/GETTING-STARTED.md
index 2e2568e64..772637304 100644
--- a/GETTING-STARTED.md
+++ b/GETTING-STARTED.md
@@ -56,20 +56,20 @@ After that they should come down automatically when you pull but it's not bad to
Repo Arrangement
---------------------------
-The MCServer repo has recently been rearranged for better code separation and other things, but basically it's split into a few areas:
+The Cuberite repo has recently been rearranged for better code separation and other things, but basically it's split into a few areas:
* `src`
- This holds all of the MCServer source code, and is where most development takes place.
+ This holds all of the Cuberite source code, and is where most development takes place.
It's split into logical areas for blocks, the protocol handling and other things.
* `lib`
- This holds all the 3rd party libraries for MCServer. You basically don't need to touch these, and we're thinking of switching them into submodules soon.
+ This holds all the 3rd party libraries for Cuberite. You basically don't need to touch these, and we're thinking of switching them into submodules soon.
* `MCServer`
This folder isn't greatly named, but it contains the default plugins and environment to actually run the server. You'll find the executable (named `MCServer`) here and in the `plugins` subdir the default plugins. The config files are also stored here. Config files with `.example.ini` on the end are generated by the server or source control and should be left alone, instead you should copy them to a file without the `example` in the name which will be prioritised over the generated ones.
Code Styles
------------------
-Mainly follow the code styles in [CONTRIBUTING.md](https://github.com/mc-server/MCServer/blob/master/CONTRIBUTING.md), which is definitely an important read.
+Mainly follow the code styles in [CONTRIBUTING.md](https://github.com/cuberite/cuberite/blob/master/CONTRIBUTING.md), which is definitely an important read.
Note that there is a script file, $/src/CheckBasicStyle.lua, that can check some common violations of the coding style. You should run this file to check your code regularly. This script is run during the integration builds and if it fails, the build will fail. Note that you need Lua installed in order to run this script.
@@ -79,7 +79,7 @@ How to Build
**Linux/BSD/Solaris/OSX:**
-Follow the instructions in [COMPILING.md](https://github.com/mc-server/MCServer/blob/master/COMPILING.md). You probably want to build in debug mode (when you're developing) for console alerts and debugging capability, even though it's much slower for everyday use.
+Follow the instructions in [COMPILING.md](https://github.com/cuberite/cuberite/blob/master/COMPILING.md). You probably want to build in debug mode (when you're developing) for console alerts and debugging capability, even though it's much slower for everyday use.
Basically, the process is:
@@ -88,7 +88,7 @@ Basically, the process is:
**Windows:**
You need to first generate a solution file by executing `cmake .` on the commandline at the top-level folder of the repository, then just open the solution file in MSVC and build. Note that the first time after generating the solution, you will need to do extra setup in order to be able to fully debug in MSVC:
-- Set the startup project to MCServer: right-click the MCServer project in the Solution Explorer and choose "Set as Startup Project".
+- Set the startup project to Cuberite: right-click the MCServer project in the Solution Explorer and choose "Set as Startup Project".
- Set the debugging folder: right-click the MCServer project in the Solution Explorer, choose "Properties". In the dialog, browse to "Configuration Properties" -> "Debugging" and set "Working Directory" to "../MCServer".
How to Run
@@ -108,7 +108,7 @@ There are a few fairly easy issues for you to get started with, as well as some
* #577
* #381
* #752
- * Clean up some of the compiler warnings. (Check [Travis CI](http://travis-ci.org/mc-server/MCServer) for a list of them.) With clang, there are over 10000 lines of warnings to clean up.
+ * Clean up some of the compiler warnings. (Check [Travis CI](http://travis-ci.org/cuberite/cuberite) for a list of them.) With clang, there are over 10000 lines of warnings to clean up.
**More Difficult**:
@@ -116,7 +116,7 @@ There are a few fairly easy issues for you to get started with, as well as some
* #134
* #215
-You may also want to write some plugins. They are written in lua, with excellent API documentation available via [APIDump](http://mc-server.xoft.cz/LuaAPI). The [Core](https://github.com/mc-server/Core) plugin should also help quite a bit here.
+You may also want to write some plugins. They are written in lua, with excellent API documentation available via [APIDump](http://api-docs.cuberite.org). The [Core](https://github.com/mc-server/Core) plugin should also help quite a bit here.
Special Things
---------------------
diff --git a/Install/MCServer_high_detail_debug.cmd b/Install/MCServer_high_detail_debug.cmd
index 384189c42..d94af8150 100644
--- a/Install/MCServer_high_detail_debug.cmd
+++ b/Install/MCServer_high_detail_debug.cmd
@@ -1 +1 @@
-MCServer /cdf \ No newline at end of file
+MCServer --crash-dump-full
diff --git a/Install/MCServer_medium_detail_debug.cmd b/Install/MCServer_medium_detail_debug.cmd
index b5bb0954c..0a33c27fd 100644
--- a/Install/MCServer_medium_detail_debug.cmd
+++ b/Install/MCServer_medium_detail_debug.cmd
@@ -1 +1 @@
-MCServer /cdg \ No newline at end of file
+MCServer --crash-dump-globals
diff --git a/Install/Zip2008.list b/Install/Zip2008.list
index e69857d09..f14362e46 100644
--- a/Install/Zip2008.list
+++ b/Install/Zip2008.list
@@ -1,6 +1,7 @@
..\MCServer\MCServer.exe
..\MCServer\*.dll
..\MCServer\Plugins
+..\MCServer\Prefabs
..\MCServer\webadmin
..\MCServer\crafting.txt
..\MCServer\furnace.txt
diff --git a/LICENSE b/LICENSE
index d8a8ec1e4..1ded9b926 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,7 +1,7 @@
-MCServer: A performant C++ Minecraft Server
-www: http://mc-server.org/
+Cuberite: A performant C++ Minecraft Server
+www: https://github.com/cuberite/cuberite
-Copyright 2011-2015 MCServer Team
+Copyright 2011-2015 Cuberite Team
------
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 2c26ccecc..09479ee4e 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -29,7 +29,7 @@ g_APIDesc =
{
ConstantName = { Notes = "Notes about the constant" },
} ,
-
+
ConstantGroups =
{
GroupName1 = -- GroupName1 is used as the HTML anchor name
@@ -100,6 +100,11 @@ g_APIDesc =
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." },
@@ -270,7 +275,7 @@ g_APIDesc =
<h3>Special strategies</h3>
<p>For each strategy, evaluate the table rows from top downwards, the first match wins.</p>
-
+
<p>
<strong>msDifference</strong> - changes all the blocks which are the same to air. Otherwise the source block gets placed.
</p>
@@ -282,8 +287,8 @@ g_APIDesc =
<td> B </td><td> B </td><td> Air </td><td> The blocks are the same so we get air. </td>
</tr>
</tbody></table>
-
-
+
+
<p>
<strong>msLake</strong> - used for merging areas with lava and water lakes, in the appropriate generator.
</p>
@@ -363,7 +368,7 @@ g_APIDesc =
<td> A </td><td> non-A </td><td> A </td><td> Differing blocks are kept from 'self' </td>
</tr>
</tbody></table>
-
+
<p>
<strong>msSimpleCompare</strong> - 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
@@ -535,7 +540,7 @@ g_APIDesc =
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);
@@ -666,7 +671,7 @@ end</pre>
},
}, -- AdditionalInfo
}, -- cCompositeChat
-
+
cCraftingGrid =
{
Desc = [[
@@ -738,7 +743,7 @@ local Hash = cCryptoHash.sha1HexString("DataToHash")
</pre></p>
<p>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." },
@@ -747,7 +752,7 @@ local Hash = cCryptoHash.sha1HexString("DataToHash")
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 = [[
@@ -1038,7 +1043,7 @@ cFile:Delete("/usr/bin/virus.exe");
},
Inherits = "cEntity",
},
-
+
cIniFile =
{
Desc = [[
@@ -1073,7 +1078,7 @@ ValueName0=SomeOtherValue
{
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 =
+ 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" },
@@ -1117,12 +1122,12 @@ ValueName0=SomeOtherValue
{ 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 =
+ 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 =
+ 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." },
@@ -1130,7 +1135,7 @@ ValueName0=SomeOtherValue
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 =
+ 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()." },
@@ -1141,7 +1146,7 @@ ValueName0=SomeOtherValue
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 =
+ 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)." },
@@ -1917,6 +1922,8 @@ a_Player:OpenWindow(Window);
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." },
@@ -2036,7 +2043,7 @@ a_Player:OpenWindow(Window);
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." },
+ { 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." },
@@ -2046,12 +2053,16 @@ a_Player:OpenWindow(Window);
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.<br><br><b>NOTE</b>This function is currently unsafe, do not use!" },
+ 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.<br><br><b>NOTE:</b> 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.<br>This function is case-insensitive and will match partial names.<br>Returns false if player not found or there is ambiguity, true otherwise. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cPlayer|Player}})</pre>" },
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: <pre class=\"prettyprint lang-lua\">function Callback({{cPlayer|Player}})</pre> 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: <pre class=\"prettyprint lang-lua\">function Callback({{cPlayer|cPlayer}})</pre>" },
ForEachWorld = { Params = "CallbackFunction", Return = "", Notes = "Calls the given callback function for each world. The callback function has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cWorld|cWorld}})</pre>" },
- Get = { Params = "", Return = "Root object", Notes = "(STATIC)This function returns the cRoot object." },
+ 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: &lt;CommitHash&gt;\"." },
+ 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: &lt;DateTime-iso8601&gt;\"." },
+ 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 \"MCServer 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." },
@@ -2061,6 +2072,7 @@ a_Player:OpenWindow(Window);
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 MCServer process is using, in KiB. Negative if the OS doesn't support this query." },
GetWebAdmin = { Params = "", Return = "{{cWebAdmin|cWebAdmin}}", Notes = "Returns the cWebAdmin object." },
@@ -2146,7 +2158,7 @@ end
ShouldAuthenticate = { Params = "", Return = "bool", Notes = "Returns true iff the server is set to authenticate players (\"online mode\")." },
},
}, -- cServer
-
+
cStringCompression =
{
Desc = [[
@@ -2157,7 +2169,7 @@ end
local CompressedString = cStringCompression.CompressStringGZIP("DataToCompress")
</pre>
]],
-
+
Functions =
{
CompressStringGZIP = {Params = "string", Return = "string", Notes = "Compress a string using GZIP"},
@@ -2205,7 +2217,7 @@ local CompressedString = cStringCompression.CompressStringGZIP("DataToCompress")
},
Inherits = "cEntity",
},
-
+
cWebPlugin =
{
Desc = "",
@@ -2361,14 +2373,18 @@ local CompressedString = cStringCompression.CompressStringGZIP("DataToCompress")
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. <b>WARNING</b>: 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." },
+ 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. " },
@@ -2436,6 +2452,10 @@ local CompressedString = cStringCompression.CompressStringGZIP("DataToCompress")
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." },
@@ -2514,7 +2534,7 @@ World:ForEachEntity(
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
@@ -2565,7 +2585,7 @@ end
}
},
}, -- ItemCategory
-
+
lxp =
{
Desc = [[
@@ -2635,7 +2655,7 @@ 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);
@@ -2671,12 +2691,12 @@ 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." },
@@ -2700,7 +2720,7 @@ myDB:close()
version = { Return = "string", Notes = "Returns a string with SQLite version information, in the form 'x.y[.z]'." },
},
},
-
+
TakeDamageInfo =
{
Desc = [[
@@ -2994,7 +3014,7 @@ end
"WriteHtmlHook",
"WriteStats",
},
-
+
IgnoreConstants =
{
"cChestEntity.__cBlockEntityWindowOwner__",
@@ -3003,12 +3023,12 @@ end
"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
@@ -3020,7 +3040,3 @@ end
{ FileName = "WebWorldThreads.html", Title = "Webserver vs World threads" },
}
} ;
-
-
-
-
diff --git a/MCServer/Plugins/APIDump/Hooks/OnEntityChangedWorld.lua b/MCServer/Plugins/APIDump/Hooks/OnEntityChangedWorld.lua
new file mode 100644
index 000000000..6675fdbe0
--- /dev/null
+++ b/MCServer/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.<p>
+ 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/MCServer/Plugins/APIDump/Hooks/OnEntityChangingWorld.lua b/MCServer/Plugins/APIDump/Hooks/OnEntityChangingWorld.lua
new file mode 100644
index 000000000..521f829c7
--- /dev/null
+++ b/MCServer/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.<p>
+ 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/MCServer/Plugins/APIDump/Hooks/OnKilled.lua b/MCServer/Plugins/APIDump/Hooks/OnKilled.lua
new file mode 100644
index 000000000..9289b8f35
--- /dev/null
+++ b/MCServer/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.</p>
+ <p>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.</p>
+ <p>In either case, the victim is dead.
+ ]],
+ }, -- HOOK_KILLED
+}
diff --git a/MCServer/Plugins/APIDump/Hooks/OnKilling.lua b/MCServer/Plugins/APIDump/Hooks/OnKilling.lua
index 8ec1cfe2e..d2339e60b 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnKilling.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnKilling.lua
@@ -7,16 +7,13 @@ return
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.</p>
- <p>
- FIXME: There is no HOOK_KILLED notification hook yet; this is deliberate because HOOK_KILLED has
- been recently renamed to HOOK_KILLING, and plugins need to be updated. Once updated, the HOOK_KILLED
- notification will be implemented.
+ 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, MCServer calls other plugins with this event. If the
diff --git a/MCServer/Plugins/APIDump/InfoFile.html b/MCServer/Plugins/APIDump/InfoFile.html
index 3fff06d20..adaae2cb6 100644
--- a/MCServer/Plugins/APIDump/InfoFile.html
+++ b/MCServer/Plugins/APIDump/InfoFile.html
@@ -15,7 +15,7 @@
<ul>
<li><a href="#Introduction">Introduction</a></li>
<li><a href="#Overall">The overall structure</a></li>
- <li><a href="#AdditionalInformation">AdditionalInformation table</a></li>
+ <li><a href="#AdditionalInfo">AdditionalInfo table</a></li>
<li><a href="#Commands">Commands table</a></li>
<li><a href="#ConsoleCommands">ConsoleCommands table</a></li>
<li><a href="#Permissions">Permissions table</a></li>
@@ -51,7 +51,7 @@ g_PluginInfo =
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:
- AdditionalInformation = {},
+ AdditionalInfo = {},
Commands = {},
ConsoleCommands = {},
Permissions = {},
@@ -63,13 +63,13 @@ g_PluginInfo =
<hr />
- <a name="AdditionalInformation"><h2>AdditionalInformation table</h2></a>
+ <a name="AdditionalInfo"><h2>AdditionalInfo table</h2></a>
<p>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.</p>
<p>The table should have the following layout:</p>
<pre class="prettyprint lang-lua">
-AdditionalInformation =
+AdditionalInfo =
{
{
Title = "Chapter 1",
diff --git a/MCServer/Plugins/APIDump/main.css b/MCServer/Plugins/APIDump/main.css
index 8041e0d01..e5685caab 100644
--- a/MCServer/Plugins/APIDump/main.css
+++ b/MCServer/Plugins/APIDump/main.css
@@ -61,7 +61,7 @@ footer
font-family: Segoe UI Light, Helvetica;
}
-#content
+#content, #timestamp
{
padding: 0px 25px 25px 25px;
}
diff --git a/MCServer/Plugins/APIDump/main_APIDump.lua b/MCServer/Plugins/APIDump/main_APIDump.lua
index 4ca06b974..543a299af 100644
--- a/MCServer/Plugins/APIDump/main_APIDump.lua
+++ b/MCServer/Plugins/APIDump/main_APIDump.lua
@@ -153,6 +153,19 @@ end
+--- Returns the timestamp in HTML format
+-- The timestamp will be inserted to all generated HTML files
+local function GetHtmlTimestamp()
+ return string.format("<div id='timestamp'>Generated on %s, Build ID %s, Commit %s</div>",
+ os.date("%Y-%m-%d %H:%M:%S"),
+ cRoot:GetBuildID(), cRoot:GetBuildCommitID()
+ )
+end
+
+
+
+
+
local function WriteArticles(f)
f:write([[
<a name="articles"><h2>Articles</h2></a>
@@ -296,7 +309,9 @@ local function WriteHtmlHook(a_Hook, a_HookNav)
f:write("<p>", (example.Desc or "<i>missing Desc</i>"), "</p>\n");
f:write("<pre class=\"prettyprint lang-lua\">", (example.Code or "<i>missing Code</i>"), "\n</pre>\n\n");
end
- f:write([[</td></tr></table></div><script>prettyPrint();</script></body></html>]]);
+ f:write([[</td></tr></table></div><script>prettyPrint();</script>]])
+ f:write(GetHtmlTimestamp())
+ f:write([[</body></html>]])
f:close();
end
@@ -941,8 +956,10 @@ local function WriteHtmlClass(a_ClassAPI, a_ClassMenu)
end
end
- cf:write([[</td></tr></table></div><script>prettyPrint();</script></body></html>]]);
- cf:close();
+ cf:write([[</td></tr></table></div><script>prettyPrint();</script>]])
+ cf:write(GetHtmlTimestamp())
+ cf:write([[</body></html>]])
+ cf:close()
end
@@ -971,7 +988,7 @@ end
--- Writes a list of undocumented objects into a file
local function ListUndocumentedObjects(API, UndocumentedHooks)
- f = io.open("API/_undocumented.lua", "w");
+ 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");
@@ -1320,11 +1337,10 @@ local function DumpAPIHtml(a_API)
WriteStats(f);
- f:write([[ </ul>
- </div>
- </body>
-</html>]]);
- f:close();
+ f:write([[</ul></div>]])
+ f:write(GetHtmlTimestamp())
+ f:write([[</body></html>]])
+ f:close()
LOG("API subfolder written");
end
diff --git a/MCServer/Plugins/Core b/MCServer/Plugins/Core
-Subproject ea0ab964d568630fd4f2b52954186f2851a769e
+Subproject cbf3280a6a3cbf9468742dbbdaca9ff6f0a7743
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index a49f8b5a6..bd0b94a06 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -1880,6 +1880,117 @@ 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] .. " <x1> <y1> <z1> <x2> <y2> <z2> [<WorldName>]"
+ 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)
diff --git a/MCServer/Plugins/Debuggers/Info.lua b/MCServer/Plugins/Debuggers/Info.lua
index 2e170487b..a76690ea1 100644
--- a/MCServer/Plugins/Debuggers/Info.lua
+++ b/MCServer/Plugins/Debuggers/Info.lua
@@ -235,6 +235,12 @@ g_PluginInfo =
Handler = HandleConsoleSchedule,
HelpString = "Tests the world scheduling",
},
+
+ ["testtracer"] =
+ {
+ Handler = HandleConsoleTestTracer,
+ HelpString = "Tests the cLineBlockTracer",
+ }
}, -- ConsoleCommands
} -- g_PluginInfo
diff --git a/MCServer/Plugins/DumpInfo/Init.lua b/MCServer/Plugins/DumpInfo/Init.lua
index 1faa8d60f..2c5998e36 100644
--- a/MCServer/Plugins/DumpInfo/Init.lua
+++ b/MCServer/Plugins/DumpInfo/Init.lua
@@ -33,15 +33,17 @@ function HandleDumpPluginRequest(a_Request)
</tr>]]
-- Loop through each plugin that is found.
- for PluginName, k in pairs(cPluginManager:Get():GetAllPlugins()) do
- -- Check if there is a file called 'Info.lua' or 'info.lua'
- if (cFile:Exists("Plugins/" .. PluginName .. "/Info.lua")) then
- Content = Content .. "\n<tr>\n"
- Content = Content .. "\t<td>" .. PluginName .. "</td>\n"
- Content = Content .. "\t<td><form method='POST'> <input type='hidden' value='" .. PluginName .. "' name='DumpInfo'> <input type='submit' value='DumpInfo'></form></td>\n"
- Content = Content .. "</tr>\n"
+ 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<tr>\n"
+ Content = Content .. "\t<td>" .. a_Plugin:GetName() .. "</td>\n"
+ Content = Content .. "\t<td><form method='POST'> <input type='hidden' value='" .. a_Plugin:GetName() .. "' name='DumpInfo'> <input type='submit' value='DumpInfo'></form></td>\n"
+ Content = Content .. "</tr>\n"
+ end
end
- end
+ )
Content = Content .. [[
</table>]]
diff --git a/MCServer/Plugins/InfoDump.lua b/MCServer/Plugins/InfoDump.lua
index a715c9a18..2c7fff163 100644
--- a/MCServer/Plugins/InfoDump.lua
+++ b/MCServer/Plugins/InfoDump.lua
@@ -136,7 +136,7 @@ local function BuildCategories(a_PluginInfo)
-- 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) do
+ for cmd, info in pairs(a_Commands or {}) do
local NewCmd =
{
CommandString = a_CmdPrefix .. cmd,
@@ -451,7 +451,7 @@ 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) do
+ 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:
diff --git a/MCServer/Plugins/MagicCarpet b/MCServer/Plugins/MagicCarpet
-Subproject 493f2dfa6d39f134e37c4c614cf8d6ffd10c825
+Subproject 94da343b62f0498a5843247f36d6ee00cbeb8f2
diff --git a/MCServer/Plugins/TransAPI b/MCServer/Plugins/TransAPI
-Subproject 6527b80a77b3b7f5fac0ef214c1b59ad83e39b2
+Subproject be15597bf3d976310a59e3aa8661cce413441c1
diff --git a/MCServer/Prefabs/Villages/AlchemistVillage.cubeset b/MCServer/Prefabs/Villages/AlchemistVillage.cubeset
new file mode 100644
index 000000000..eac51e176
--- /dev/null
+++ b/MCServer/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/MCServer/Prefabs/Villages/JapaneseVillage.cubeset b/MCServer/Prefabs/Villages/JapaneseVillage.cubeset
new file mode 100644
index 000000000..b3e545e52
--- /dev/null
+++ b/MCServer/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/MCServer/Prefabs/Villages/PlainsVillage.cubeset b/MCServer/Prefabs/Villages/PlainsVillage.cubeset
new file mode 100644
index 000000000..0ad53a762
--- /dev/null
+++ b/MCServer/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/MCServer/Prefabs/Villages/SandFlatRoofVillage.cubeset b/MCServer/Prefabs/Villages/SandFlatRoofVillage.cubeset
new file mode 100644
index 000000000..cbaac332a
--- /dev/null
+++ b/MCServer/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/MCServer/Prefabs/Villages/SandVillage.cubeset b/MCServer/Prefabs/Villages/SandVillage.cubeset
new file mode 100644
index 000000000..63238fa6e
--- /dev/null
+++ b/MCServer/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/MCServer/crafting.txt b/MCServer/crafting.txt
index e7d11ab92..b08a82f2f 100644
--- a/MCServer/crafting.txt
+++ b/MCServer/crafting.txt
@@ -85,6 +85,9 @@ 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
@@ -303,7 +306,7 @@ Dispenser = Cobblestone, 1:1, 1:2, 1:3, 2:1, 3:1, 3:2, 3:3 | Redston
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 | Woodslab, 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, *
@@ -322,7 +325,7 @@ 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 = Wheat, *, * | CocoaBeans, *
+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
diff --git a/MCServer/install_windows_service.cmd b/MCServer/install_windows_service.cmd
index ba8a8c128..d6b6c15a3 100644
--- a/MCServer/install_windows_service.cmd
+++ b/MCServer/install_windows_service.cmd
@@ -3,5 +3,5 @@ rem Alter this if you need to install multiple instances.
set SERVICENAME="MCServer"
set CURRENTDIR=%CD%
-sc create %SERVICENAME% binPath= "%CURRENTDIR%\MCServer.exe /service" start= auto DisplayName= %SERVICENAME%
+sc create %SERVICENAME% binPath= "%CURRENTDIR%\MCServer.exe -d" start= auto DisplayName= %SERVICENAME%
sc description %SERVICENAME% "Minecraft server instance" \ No newline at end of file
diff --git a/MCServer/items.ini b/MCServer/items.ini
index daf366654..5eb04619c 100644
--- a/MCServer/items.ini
+++ b/MCServer/items.ini
@@ -815,7 +815,7 @@ rawrabbit=411
cookedrabbit=412
rabbitstew=413
rabbitsoup=413
-rabbitsfood=414
+rabbitsfoot=414
rabbithide=415
armorstand=416
ironhorsearmor=417
diff --git a/MCServer/settings_apidump.ini b/MCServer/settings_apidump.ini
deleted file mode 100644
index 80227a713..000000000
--- a/MCServer/settings_apidump.ini
+++ /dev/null
@@ -1,30 +0,0 @@
-; This settings file is used by the $/MakeLuaAPI.cmd script
-; It is copied over settings.ini so that the APIDump plugin gets loaded upon server start
-
-[Server]
-Description=MCServer - in C++!
-MaxPlayers=100
-HardcoreEnabled=0
-Port=25565
-PortsIPv6=
-DefaultViewDistance=10
-
-[RCON]
-Enabled=0
-
-[Authentication]
-Authenticate=1
-Server=session.minecraft.net
-Address=/game/checkserver.jsp?user=%USERNAME%&serverId=%SERVERID%
-
-[Worlds]
-; World=secondworld
-DefaultWorld=world
-
-[Plugins]
-Plugin=APIDump
-
-[DeadlockDetect]
-Enabled=0
-IntervalSec=20
-
diff --git a/MakeLuaAPI.cmd b/MakeLuaAPI.cmd
deleted file mode 100644
index 90b8cf53e..000000000
--- a/MakeLuaAPI.cmd
+++ /dev/null
@@ -1,66 +0,0 @@
-@echo off
-:: MakeLuaAPI.cmd
-:: This script is run after the nightbuild to produce the Lua API documentation and upload it to a website.
-:: It expects at least three environment variables set: ftpsite, ftpuser and ftppass, specifying the FTP site and login to use for the upload
-
-
-
-
-
-:: Check that we got all the environment vars needed for the upload:
-
-if "a%ftppass%" == "a" (
- echo You need to set FTP password in the ftppass environment variable to upload the files
- goto end
-)
-if "a%ftpuser%" == "a" (
- echo You need to set FTP username in the ftpuser environment variable to upload the files
- goto end
-)
-if "a%ftpsite%" == "a" (
- echo You need to set FTP server in the ftpsite environment variable to upload the files
- goto end
-)
-
-
-
-
-
-:: Create the API documentation by running the server and stopping it right after it starts:
-
-cd MCServer
-copy /Y settings_apidump.ini settings.ini
-echo api | MCServer
-cd ..
-
-
-
-
-
-:: Upload the API to the web:
-
-ncftpput -p %ftppass% -u %ftpuser% -T temp_ -R %ftpsite% /LuaAPI MCServer/API/*.*
-if errorlevel 1 goto haderror
-echo Upload finished.
-
-goto end
-
-
-
-
-
-:haderror
-echo an error was encountered, check command output above
-pause
-goto finished
-
-
-
-
-
-:end
-if "a%1" == "a" pause
-
-
-
-:finished \ No newline at end of file
diff --git a/README.md b/README.md
index 3d013eff5..600fda5c9 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,9 @@
-MCServer [![Build Status](http://img.shields.io/travis/mc-server/MCServer/master.svg?style=flat)](https://travis-ci.org/mc-server/MCServer) [![Coverity Scan Build Status](https://img.shields.io/coverity/scan/1930.svg)](https://scan.coverity.com/projects/1930) [![weekly tips](http://img.shields.io/gratipay/cuberite_team.svg?style=flat)](http://gratipay.com/cuberite_team)
+Cuberite [![Build Status](http://img.shields.io/travis/cuberite/cuberite/master.svg?style=flat)](https://travis-ci.org/cuberite/cuberite) [![Coverity Scan Build Status](https://img.shields.io/coverity/scan/1930.svg)](https://scan.coverity.com/projects/1930) [![weekly tips](http://img.shields.io/gratipay/cuberite.svg?style=flat)](http://gratipay.com/cuberite)
========
-MCServer is a Minecraft-compatible multiplayer game server that is written in C++ and designed to be efficient with memory and CPU, as well as having a flexible Lua Plugin API. MCServer is compatible with the vanilla Minecraft client.
+Cuberite is a Minecraft-compatible multiplayer game server that is written in C++ and designed to be efficient with memory and CPU, as well as having a flexible Lua Plugin API. Cuberite is compatible with the vanilla Minecraft client.
-MCServer can run on Windows, *nix and Android operating systems. This includes Android phones and tablets as well as Raspberry Pis.
+Cuberite can run on Windows, *nix and Android operating systems. This includes Android phones and tablets as well as Raspberry Pis.
We currently support Release 1.7 and 1.8 (not beta) Minecraft protocol versions.
@@ -11,36 +11,38 @@ Subscribe to [the newsletter](http://newsletter.cuberite.org/subscribe.htm) for
Installation
------------
-Hosted MCServer is available DIY on DigitalOcean: [![Install on DigitalOcean](http://doinstall.bearbin.net/button.svg)](http://doinstall.bearbin.net/install?url=https://github.com/mc-server/MCServer) and [Gamososm](https://gamocosm.com) also offers MCServer support.
+Hosted Cuberite is available DIY on DigitalOcean: [![Install on DigitalOcean](http://doinstall.bearbin.net/button.svg)](http://doinstall.bearbin.net/install?url=https://github.com/cuberite/cuberite) and [Gamocosm](https://gamocosm.com) also offers Cuberite support.
For Linux there is an easy installation method, just run this in your terminal:
- curl -s https://raw.githubusercontent.com/mc-server/MCServer/master/easyinstall.sh | sh
+ curl -s https://raw.githubusercontent.com/cuberite/cuberite/master/easyinstall.sh | sh
For Windows, you just need to download a file and extract it:
- - [Windows 32 bit](http://builds.cuberite.org/job/MCServer%20Windows%20x86/lastSuccessfulBuild/artifact/Install/MCServer.zip)
- - [Windows 64 bit](http://builds.cuberite.org/job/MCServer%20Windows%20x64/lastSuccessfulBuild/artifact/Install/MCServer.zip)
+ - [Windows 32 bit](http://builds.cuberite.org/job/Cuberite%20Windows%20x86%20Master/lastSuccessfulBuild/artifact/Install/Cuberite.zip)
+ - [Windows 64 bit](http://builds.cuberite.org/job/Cuberite%20Windows%20x64%20Master/lastSuccessfulBuild/artifact/Install/Cuberite.zip)
-For other operating systems you need to download and compile yourself. There is also an archive of binary builds on the buildserver: http://builds.cuberite.org
+For other operating systems you need to download and compile yourself. This can be done either manually, or with this automatic script:
-Compiling the server yourself has other benefits: you may get better performance performance (1.5-3x as fast) and it supports more operating systems. See the [COMPILING.md](https://github.com/mc-server/MCServer/blob/master/COMPILING.md) file for more details.
+ bash -c "$(wget -O - https://raw.githubusercontent.com/cuberite/cuberite/master/compile.sh)"
+
+There is also an archive of binary builds on the buildserver: http://builds.cuberite.org
+
+Compiling the server yourself has other benefits: you may get better performance performance (1.5-3x as fast) and it supports more operating systems. See the [COMPILING.md](https://github.com/cuberite/cuberite/blob/master/COMPILING.md) file for more details.
Contributing
------------
-MCServer is licensed under the Apache License V2, and we welcome anybody to fork and submit a Pull Request back with their changes, and if you want to join as a permanent member we can add you to the team.
+Cuberite is licensed under the Apache License V2, and we welcome anybody to fork and submit a Pull Request back with their changes, and if you want to join as a permanent member we can add you to the team.
-Check out the [CONTRIBUTING.md](https://github.com/mc-server/MCServer/blob/master/CONTRIBUTING.md) file for more details.
+Check out the [CONTRIBUTING.md](https://github.com/cuberite/cuberite/blob/master/CONTRIBUTING.md) file for more details.
Other Stuff
-----------
-For other stuff, including plugins and discussion, check the [forums](http://forum.mc-server.org) and [Plugin API](http://mc-server.xoft.cz/LuaAPI/).
-
-Earn bitcoins for commits or donate to reward the MCServer developers: [![tip for next commit](http://tip4commit.com/projects/74.svg)](http://tip4commit.com/projects/74)
+For other stuff, including plugins and discussion, check out the [forums](http://forum.mc-server.org) and [Plugin API](http://api-docs.cuberite.org).
-Support Us on Gratipay: [![Support via Gratipay](http://img.shields.io/gittip/cuberite_team.svg)](https://www.gratipay.com/cuberite_team)
+Support Us on Gratipay: [![gratipay shield](http://img.shields.io/gratipay/cuberite.svg)](https://www.gratipay.com/cuberite)
-Travis CI: [![Build Status](http://img.shields.io/travis/mc-server/MCServer.svg)](https://travis-ci.org/mc-server/MCServer)
+Travis CI: [![travis build status shield](http://img.shields.io/travis/cuberite/cuberite.svg)](https://travis-ci.org/cuberite/cuberite)
diff --git a/SetFlags.cmake b/SetFlags.cmake
index 0d1bd99b3..57cab5a1c 100644
--- a/SetFlags.cmake
+++ b/SetFlags.cmake
@@ -16,14 +16,18 @@ macro (add_flags_lnk FLAGS)
endmacro()
macro(add_flags_cxx FLAGS)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}")
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAGS}")
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAGS}")
- set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} ${FLAGS}")
- set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_COVERAGE} ${FLAGS}")
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${FLAGS}")
- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}")
+endmacro()
+
+
+#this is a hack because we can't use cmake 2.8.10 because of travis
+macro(get_clang_version)
+ execute_process(
+ COMMAND "${CMAKE_CXX_COMPILER}" "--version"
+ OUTPUT_VARIABLE CLANG_VERSION_OUTPUT)
+ string(REGEX MATCH "version ([0-9]\\.[0-9])" x ${CLANG_VERSION_OUTPUT})
+ set(CLANG_VERSION ${CMAKE_MATCH_1})
endmacro()
@@ -59,7 +63,7 @@ macro(set_flags)
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG")
elseif(APPLE)
-
+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
@@ -80,8 +84,9 @@ macro(set_flags)
else()
# Let gcc / clang know that we're compiling a multi-threaded app:
- if (UNIX)
+ if (${UNIX})
add_flags_cxx("-pthread")
+ add_flags_lnk("-pthread")
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@@ -112,6 +117,10 @@ macro(set_flags)
add_flags_cxx("-march=native")
endif()
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ get_clang_version()
+ endif()
+
# Use static CRT in MSVC builds:
if (MSVC)
@@ -214,15 +223,6 @@ macro(enable_profile)
endif()
endmacro()
-#this is a hack because we can't use cmake 2.8.10 because of travis
-macro(get_clang_version)
- execute_process(
- COMMAND "${CMAKE_CXX_COMPILER}" "--version"
- OUTPUT_VARIABLE CLANG_VERSION_OUTPUT)
- string(REGEX MATCH "version ([0-9]\\.[0-9])" x ${CLANG_VERSION_OUTPUT})
- set(CLANG_VERSION ${CMAKE_MATCH_1})
-endmacro()
-
macro(set_exe_flags)
# Remove disabling the maximum warning level:
# clang does not like a command line that reads -Wall -Wextra -w -Wall -Wextra and does not output any warnings
@@ -235,35 +235,57 @@ macro(set_exe_flags)
string(REPLACE "-w" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
string(REPLACE "-w" "" CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE}")
string(REPLACE "-w" "" CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_COVERAGE}")
- add_flags_cxx("-Wall -Wextra -Wno-unused-parameter -Wno-error=switch")
+ add_flags_cxx("-Wall -Wextra -Wno-unused-parameter")
# we support non-IEEE 754 fpus so can make no guarentees about error
add_flags_cxx("-ffast-math")
+ if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+ # backtrace() and friends are in libexecinfo
+ add_flags_lnk("-lexecinfo")
+ endif()
+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- get_clang_version()
if ("${CLANG_VERSION}" VERSION_LESS 3.0)
message(FATAL_ERROR "MCServer requires clang version 3.0 or higher, version is ${CLANG_VERSION}")
endif()
# clang does not provide the __extern_always_inline macro and a part of libm depends on this when using fast-math
add_flags_cxx("-D__extern_always_inline=inline")
- add_flags_cxx("-Werror -Weverything -Wno-c++98-compat-pedantic -Wno-string-conversion")
- add_flags_cxx("-Wno-exit-time-destructors -Wno-padded")
- add_flags_cxx("-Wno-error=sign-conversion -Wno-error=conversion -Wno-error=deprecated")
- add_flags_cxx("-Wno-error=missing-prototypes")
- add_flags_cxx("-Wno-error=shadow -Wno-error=old-style-cast -Wno-error=global-constructors")
- add_flags_cxx("-Wno-error=float-equal")
- add_flags_cxx("-Wno-weak-vtables -Wno-switch-enum")
+ add_flags_cxx("-Weverything -Werror -Wno-c++98-compat-pedantic -Wno-string-conversion")
+ add_flags_cxx("-Wno-exit-time-destructors -Wno-padded -Wno-weak-vtables")
if ("${CLANG_VERSION}" VERSION_GREATER 3.0)
# flags that are not present in 3.0
- add_flags_cxx("-Wno-error=covered-switch-default -Wno-error=missing-variable-declarations")
- add_flags_cxx("-Wno-implicit-fallthrough -Wno-error=extra-semi")
+ add_flags_cxx("-Wno-implicit-fallthrough")
endif()
if ("${CLANG_VERSION}" VERSION_GREATER 3.1)
# flags introduced in 3.2
add_flags_cxx("-Wno-documentation")
endif()
+ if ("${CLANG_VERSION}" VERSION_GREATER 3.5)
+ check_cxx_compiler_flag(-Wno-reserved-id-macro HAS_NO_RESERVED_ID_MACRO)
+ if (HAS_NO_RESERVED_ID_MACRO)
+ # Use this flag to ignore error for a reserved macro problem in sqlite 3
+ add_flags_cxx("-Wno-reserved-id-macro")
+ endif()
+ endif()
endif()
endif()
endmacro()
+
+# if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+# foreach(FILENAME ${ARGN})
+# message("downgrade_warnings for ${FILENAME}")
+# set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=conversion")
+# set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-error=missing-prototypes -Wno-error=deprecated")
+# set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-error=shadow -Wno-error=old-style-cast -Wno-error=switch-enum -Wno-error=switch")
+# set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-error=float-equal -Wno-error=global-constructors")
+
+# if ("${CLANG_VERSION}" VERSION_GREATER 3.0)
+# # flags that are not present in 3.0
+# set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-error=covered-switch-default ")
+# set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-implicit-fallthrough -Wno-error=extra-semi")
+# set_source_files_properties(${FILENAME} PROPERTIES COMPILE_FLAGS "-Wno-error=missing-variable-declarations")
+# endif()
+# endforeach()
+# endif()
diff --git a/Tools/MCADefrag/CMakeLists.txt b/Tools/MCADefrag/CMakeLists.txt
index 700310edc..9d600d3ec 100644
--- a/Tools/MCADefrag/CMakeLists.txt
+++ b/Tools/MCADefrag/CMakeLists.txt
@@ -11,8 +11,13 @@ set_flags()
set_lib_flags()
enable_profile()
-
-
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_flags_cxx("-Wno-error=sign-conversion -Wno-error=conversion -Wno-error=shorten-64-to-32")
+ add_flags_cxx("-Wno-error=old-style-cast")
+ if ("${CLANG_VERSION}" VERSION_GREATER 3.5)
+ add_flags_cxx("-Wno-error=keyword-macro")
+ endif()
+endif()
# Set include paths to the used libraries:
include_directories("../../lib")
diff --git a/Tools/MCADefrag/MCADefrag.cpp b/Tools/MCADefrag/MCADefrag.cpp
index 0d38a87f1..80c6f5be2 100644
--- a/Tools/MCADefrag/MCADefrag.cpp
+++ b/Tools/MCADefrag/MCADefrag.cpp
@@ -22,7 +22,7 @@ static const Byte g_Zeroes[4096] = {0};
int main(int argc, char ** argv)
{
- cLogger::cListener * consoleLogListener = MakeConsoleListener();
+ cLogger::cListener * consoleLogListener = MakeConsoleListener(false);
cLogger::cListener * fileLogListener = new cFileListener();
cLogger::GetInstance().AttachListener(consoleLogListener);
cLogger::GetInstance().AttachListener(fileLogListener);
diff --git a/Tools/ProtoProxy/CMakeLists.txt b/Tools/ProtoProxy/CMakeLists.txt
index ce64db38d..480e6fba8 100644
--- a/Tools/ProtoProxy/CMakeLists.txt
+++ b/Tools/ProtoProxy/CMakeLists.txt
@@ -14,7 +14,13 @@ include_directories("../../lib")
include_directories("../../lib/polarssl/include")
include_directories("../../src")
-
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_flags_cxx("-Wno-error=sign-conversion -Wno-error=conversion -Wno-error=shorten-64-to-32")
+ add_flags_cxx("-Wno-error=old-style-cast")
+ if ("${CLANG_VERSION}" VERSION_GREATER 3.5)
+ add_flags_cxx("-Wno-error=keyword-macro")
+ endif()
+endif()
function(flatten_files arg1)
set(res "")
diff --git a/Tools/ProtoProxy/ProtoProxy.cpp b/Tools/ProtoProxy/ProtoProxy.cpp
index 3f427f83f..2d27d7556 100644
--- a/Tools/ProtoProxy/ProtoProxy.cpp
+++ b/Tools/ProtoProxy/ProtoProxy.cpp
@@ -16,7 +16,7 @@ int main(int argc, char ** argv)
{
// Initialize logging subsystem:
cLogger::InitiateMultithreading();
- auto consoleLogListener = MakeConsoleListener();
+ auto consoleLogListener = MakeConsoleListener(false);
auto fileLogListener = new cFileListener();
cLogger::GetInstance().AttachListener(consoleLogListener);
cLogger::GetInstance().AttachListener(fileLogListener);
diff --git a/Tools/QtBiomeVisualiser/MainWindow.cpp b/Tools/QtBiomeVisualiser/MainWindow.cpp
index c6ea8656e..8d5b768d8 100644
--- a/Tools/QtBiomeVisualiser/MainWindow.cpp
+++ b/Tools/QtBiomeVisualiser/MainWindow.cpp
@@ -87,7 +87,7 @@ void MainWindow::newGenerator()
// Set the chunk source:
cIniFilePtr iniFile = m_GeneratorSetup->getIniFile();
- m_BiomeView->setChunkSource(std::shared_ptr<BioGenSource>(new BioGenSource(iniFile)));
+ m_BiomeView->setChunkSource(std::make_shared<BioGenSource>(iniFile));
m_BiomeView->redraw();
}
@@ -108,7 +108,7 @@ void MainWindow::openGenerator()
openGeneratorSetup(worldIni.toStdString());
// Set the chunk source:
- m_BiomeView->setChunkSource(std::shared_ptr<BioGenSource>(new BioGenSource(m_GeneratorSetup->getIniFile())));
+ m_BiomeView->setChunkSource(std::make_shared<BioGenSource>(m_GeneratorSetup->getIniFile()));
m_BiomeView->redraw();
}
@@ -129,7 +129,7 @@ void MainWindow::openWorld()
closeGeneratorSetup();
// Set the chunk source:
- m_BiomeView->setChunkSource(std::shared_ptr<AnvilSource>(new AnvilSource(regionFolder)));
+ m_BiomeView->setChunkSource(std::make_shared<AnvilSource>(regionFolder));
m_BiomeView->redraw();
}
@@ -150,7 +150,7 @@ void MainWindow::openVanillaWorld()
closeGeneratorSetup();
// Set the chunk source:
- m_BiomeView->setChunkSource(std::shared_ptr<AnvilSource>(new AnvilSource(action->data().toString())));
+ m_BiomeView->setChunkSource(std::make_shared<AnvilSource>(action->data().toString()));
m_BiomeView->redraw();
}
diff --git a/app.yml b/app.yml
index f72089f51..f107f6387 100644
--- a/app.yml
+++ b/app.yml
@@ -5,5 +5,5 @@ config:
packages:
- git
runcmd:
- - cd /tmp && git clone https://github.com/cuberite/mcserver-ocean.git
- - cd /tmp/mcserver-ocean && ./initialinstall.sh
+ - cd /tmp && git clone https://github.com/cuberite/cuberite-ocean.git
+ - cd /tmp/cuberite-ocean && ./initialinstall.sh
diff --git a/compile.sh b/compile.sh
new file mode 100755
index 000000000..9ef6d6149
--- /dev/null
+++ b/compile.sh
@@ -0,0 +1,198 @@
+#|| goto :windows_detected
+
+# Do we already have a repo?
+if [[ -d .git && -f easyinstall.sh && -f src/BlockArea.cpp ]]; then # A good enough indicator that we're in the MCServer git repo.
+cd ../
+echo "MCServer repository detected. This should make the process faster, especially if you compiled before."
+fi
+
+# Error functions.
+function error
+{
+ echo
+ echo "-----------------"
+ echo "Script aborted, reason:"
+ echo $1
+ exit -1
+}
+
+function missingDepsExit
+{
+ echo
+ echo "Please install the dependencies, then come back."
+ echo
+ exit -2
+}
+
+
+# Echo: Greetings.
+echo
+echo "Hello, this script will download and compile Cuberite/MCServer."
+echo "On subsequent runs, it will update your MCServer."
+echo "The compilation and download will occur in the current directory."
+echo "If you're updating, you should run <Path to MCServer>/MCServer/compile.sh"
+echo "Compiling from source takes time, but it usually generates better executables."
+echo "If you prefer ready-to-use binaries or if you want more info, please visit:"
+echo "http://cuberite.org/"
+echo "http://mc-server.org/"
+
+MISSING_PROGRAMS=""
+
+# Compiler check.
+GCC_EXISTS=0
+CLANG_EXISTS=0
+g++ --help > /dev/null 2> /dev/null && GCC_EXISTS=1
+clang --help > /dev/null 2> /dev/null && CLANG_EXISTS=1
+if [[ $GCC_EXISTS == 0 && $CLANG_EXISTS == 0 ]]; then
+MISSING_PROGRAMS="gcc g++"
+fi
+
+# Depdendency check.
+while read program; do
+$program --help > /dev/null 2> /dev/null || MISSING_PROGRAMS="$MISSING_PROGRAMS $program"
+done <<"EOF"
+git
+make
+cmake
+EOF
+if [[ $MISSING_PROGRAMS != "" ]]; then
+ echo
+ echo "-----------------"
+ echo "You have missing compilation dependencies:"
+ echo $MISSING_PROGRAMS
+ echo
+
+ # apt-get guide.
+ apt-get --help > /dev/null 2> /dev/null && \
+ echo "You can install the missing depndencies via:" && \
+ echo -n "sudo apt-get install " && echo $MISSING_PROGRAMS && missingDepsExit
+
+ # yum guide.
+ yum --help > /dev/null 2> /dev/null && \
+ echo "You can install the missing depndencies via:" && \
+ echo -n "sudo yum install " && echo $MISSING_PROGRAMS && missingDepsExit
+
+ # rpm guide.
+ rpm --help > /dev/null 2> /dev/null && \
+ echo "You can install the missing depndencies via:" && \
+ echo -n "sudo rpm -i " && echo $MISSING_PROGRAMS && missingDepsExit
+
+ # pacman guide.
+ pacman --help > /dev/null 2> /dev/null && \
+ echo "You can install the missing depndencies via:" && \
+ echo -n "sudo pacman -S " && echo $MISSING_PROGRAMS && missingDepsExit
+
+ missingDepsExit
+fi
+
+# Echo: Branch choice.
+echo
+echo "You can choose between 2 branches:"
+echo "* (S)Stable: (Coming soon) Choose the stable branch if you want the most reliable server."
+echo " As of now, Stable is not yet available, please use testing instead."
+echo
+echo "* (T)Testing: The testing branch is less stable,"
+echo " but using it and finding and reporting bugs helps us a lot!"
+echo
+echo "* (D)Dev: The least stable of the three. (Master branch)"
+echo " Choose the development branch if you are feeling adventurous and"
+echo " want to try new, bleeding edge features."
+echo
+
+
+# Input: Branch choice.
+echo -n "Choose the branch (s/t/d): "
+read BRANCH
+if [[ ($BRANCH == "s") || ($BRANCH == "S" ) ]]; then
+ #BRANCH="stable"
+ error "We don't have a stable branch yet, please use testing, sorry."
+elif [[ ($BRANCH == "t") || ($BRANCH == "T" ) ]]; then
+ BRANCH="testing"
+elif [[ ($BRANCH == "d") || ($BRANCH == "D" ) ]]; then
+ BRANCH="master"
+else
+ error "Unrecognized user input."
+fi
+
+# Echo: Compile mode choice.
+echo
+echo "Choose compile mode:"
+echo "* (N)Normal: Compiles normally."
+echo
+echo "* (D)Debug: Compiles in debug mode. Makes your console and crashes much more verbose."
+echo " But it costs performance."
+echo
+echo "Note that the script will connect to the internet in order to fetch code after this step."
+echo "It will then compile your program."
+echo
+
+# Input: Compile mode choice.
+echo -n "Choose compile mode: (n/d): "
+read BUILDTYPE
+if [[ ($BUILDTYPE == "d") || ($BUILDTYPE == "D") ]]; then
+ BUILDTYPE="Debug"
+elif [[ ($BUILDTYPE == "n") || ($BUILDTYPE == "N") ]]; then
+ BUILDTYPE="Release"
+else
+ error "Unrecognized user input."
+fi
+
+
+# Echo: Downloading began.
+echo
+echo " --- Downloading MCServer's source code from the $BRANCH branch..."
+
+
+# Git: Clone.
+if [ ! -d MCServer ]; then
+ echo " --- Looks like your first run, cloning the whole code..."
+ git clone https://github.com/mc-server/MCServer.git
+fi
+
+
+# Git: Fetch.
+pushd MCServer
+echo " --- Updating the $BRANCH branch..."
+git fetch origin $BRANCH || error "git fetch failed"
+git checkout $BRANCH || error "git checkout failed"
+git merge origin/$BRANCH || error "git merge failed"
+
+
+# Git: Submodules.
+echo " --- Updating submodules..."
+git submodule init
+git submodule update
+
+
+# Cmake.
+echo " --- Running cmake..."
+popd
+if [ ! -d build-mcserver ]; then mkdir build-mcserver; fi
+pushd build-mcserver
+cmake ../MCServer/ -DCMAKE_BUILD_TYPE=$BUILDTYPE || error "cmake failed"
+
+
+# Make.
+echo " --- Compiling..."
+make -j`nproc` || error "Compiling failed"
+echo
+
+
+# Echo: Compilation complete.
+popd
+pushd MCServer/MCServer
+echo
+echo "-----------------"
+echo "Compilation done!"
+echo
+echo "Cuberite awaits you at:"
+echo "`pwd`/MCServer"
+echo
+echo "Enjoy :)"
+popd
+exit 0
+
+:windows_detected
+echo "This script is not available for Windows yet, sorry."
+echo "You can still download the Windows binaries from: http://mc-server.org"
+
diff --git a/docs/Cubeset file format.html b/docs/Cubeset file format.html
new file mode 100644
index 000000000..916d723af
--- /dev/null
+++ b/docs/Cubeset file format.html
@@ -0,0 +1,296 @@
+<html>
+<head>
+<title>Cubeset file format</title>
+<link rel="stylesheet" type="text/css" href="style.css">
+</head>
+<body>
+<h2>Contents</h2>
+<ul>
+<li><a href="#abstract">Abstract - what and why</a></li>
+<li><a href="#details">Detailed description of the format</a>
+<ul>
+<li><a href="#csmeta">Cubeset metadata</a></li>
+<li><a href="#piece">Individual piece</a></li>
+<li><a href="#piecemeta">Piece metadata</a></li>
+</ul>
+</li>
+<li><a href="#example">Example</a></li>
+</ul>
+<hr>
+<a name="abstract"><h2>Abstract - what and why</h2></a>
+<p>We're seeing an increased need to store "prefabs" - little areas with predefined block contents, such as village houses or fortress rooms - in collections. We have one collection of village houses for the plains village, one collection for the desert village, one collection for the nether fortress... And there are plans in the future to use even more collections - trees, overworld fortresses, more village types and even custom structures. The point that they have in common is that they need to store not only the prefabs, but also metadata for those prefabs - how often they generate, how they connect together. There's even need for metadata for the entire collection, such as what the accepted biomes are, what block should village roads use, and various other generator parameters. So we need a file format that could store all this information together.</p>
+<p>There are some existing formats available to consider first:
+<ul>
+<li><a href="http://minecraft.gamepedia.com/Schematic_file_format"><b>schematic</b></a> - file format native to MCEdit / Bukkit / WorldEdit communities. Can store the prefab, the block entities and regular entities, and any metadata. Cannot store multiple prefabs. No effort to read or write, there's already code to do that (except for the entities) in the server.</li>
+<li><a href="http://dev.bukkit.org/bukkit-plugins/terrain-control/"><b>bob / bo2 / bo3</b></a> - file format created for prefabs in the Terrain Control mod. Can store the prefab and any metadata. Support for block entities and regular entities is unknown. Cannot store multiple prefabs. Medium difficulty for reading and writing, would need new parser and serializer. Unknown (but assumed true) whether the format truly supports any metadata.</li>
+<li><a href="https://github.com/cuberite/cuberite/tree/master/src/Generating/Prefabs"><b>cpp</b></a> - export from our Gallery server directly into C++ source files. Can store the prefab and any metadata, block entities and regular entities currently not implemented but could be added. Very difficult for reading, writing already implemented. Only usable when compiling directly into the server. Can store multiple prefabs and metadata for the entire set.</li>
+</ul>
+Obviously none of these fully satisfy our needs, so we'll need to either extend one of them or create yet another one. Extending the .schematic file would mean that the exporter plugin would need to change most of the export code, which was deemed too unmaintainable. Because the bob format is not implemented at all, it wasn't even considered. The cpp format would have been a great candidate if it weren't so difficult to parse. However, it sparked an idea - something similar in form to the cpp format, but easily parsed. Since we already have the Lua interpreter, why not base the new format in Lua?</p>
+<p>
+With Lua, we could store any metadata for the prefabs, any additional information related to the entire set of prefabs. There's nothing stopping us from adding more items in a backward- and forward-compatible way. The prefabs can be stored very similar to the cpp format, an array of strings plus a charmap, or they can be stored externally in individual .schematic files and the Lua file would provide just the metadata. The server has already vast amounts of Lua-related support code that can be used for accessing the data. In the end this became the chosen solution. The format has been named "Cubeset" - a set of cube-based prefabs.</p>
+
+<hr/>
+
+<a name="details"><h2>Detailed description of the format</h2></a>
+<p>
+The Cubeset file has a .cubeset extension. Internally it is a Lua source file that provides a global value, Cubeset, which is a table containing the structured data. The loader checks the file's first 4 KiB to see if there is a "CubesetFormatVersion =" string in it, and if it is, the file is considered a Cubeset file and further loading is attempted. It is therefore crucial that tools producing this file format include this string as early as possible in the file.</p>
+<p>
+The top-level Cubeset table must contain at least two sub-tables: Metadata and Pieces. The Metadata table contains the metadata relevant to the entire set of prefabs in the file, the Pieces table contains the definitions and metadata for the individual prefabs. It is advised to make the Metadata table the first one, because it contains the signature used to identify the file ("CubesetFormatVersion ="). Apart from these two subtables the server ignores everything else.</p>
+
+<a name="csmeta"><h3>Cubeset metadata</h3></a>
+<p>
+The Cubeset.Metadata table is used to store metadata for the entire set of prefabs, and also for the format and version identification. It is a regular dictionary-style Lua table; the following elements are recognized:
+<table>
+<tr><th>Name</th><th>Type</th><th>Content</th></tr>
+<tr><td>CubesetFormatVersion</td><td>number</td><td>This is the format identification and at the same time it specifies the version of the file. Currently the file version is 1.</td></tr>
+<tr><td>ExportDate</td><td>string</td><td>The date when this file was exported, in the ISO format ("2015-06-16 13:34:03"). Inserted by <a href="https://github.com/madmaxoft/GalExport">GalExport</a> for versioning purposes. Ignored elsewhere.</td></tr>
+<tr><td>ExternalSchematic</td><td>boolean</td><td>Flag inserted by <a href="https://github.com/madmaxoft/GalExport">GalExport</a> to indicate that the individual prefabs are stored in separate .schematic files. Ignored elsewhere.</td></tr>
+</table>
+We expect that the set of values recognized by the server will grow when the format is used for some time. All values are optional, except for the CubesetFormatVersion value which is strictly checked by the server. </p>
+
+<a name="piece"><h3>Individual piece</h3></a>
+<p>
+The Cubeset.Pieces table is an array containing individual prefabs. Each element describes a single prefab and its associated metadata. The following values are recognized:
+<table>
+<tr><th>Name</th><th>Type</th><th>Content</th></tr>
+<tr><td>OriginData</td><td>table</td><td>Inserted by <a href="https://github.com/madmaxoft/GalExport">GalExport</a> to identify the gallery area from which the prefab is exported. Ignored elsewhere.</td></tr>
+<tr><td>Hitbox</td><td>table</td><td>The relative coords of the prefab's hitbox (where the prefab is not allowed to overlap another prefab when generating). Members: MinX, MinY, MinZ, MaxX, MaxY, MaxZ, all numbers.</td></tr>
+<tr><td>Connectors</td><td>table</td><td>Array of <a href="#conndef">connector definitions</a>. The table must be present for each prefab, even if the prefab doesn't have any connectors (use an empty table, then).</td></tr>
+<tr><td>SchematicFileName</td><td>string</td><td>Name of the .schematic file that contains the block data for the prefab.</td></tr>
+<tr><td>Size</td><td>table</td><td>Table containing the dimensions of the prefab, if it is inlined into the BlockData element. Contains three members, x, y, z, each is a number.</td></tr>
+<tr><td>BlockData</td><td>table</td><td>Array of strings that are processed to produce the block data for the prefab. Each letter in the string corresponds to one block, the type of the block is translated through the BlockDefinitions table. The blocks are ordered YZX, that is, the X coord varies the most.</td></tr>
+<tr><td>BlockDefinitions</td><td>table</td><td>Array of strings that defines the mapping of each letter in BlockData to a specific blocktype. Each string should have the format "Letter: BlockType: BlockMeta".</td></tr>
+<tr><td>Metadata</td><td>table</td><td>Dictionary-style table of various per-prefab <a href="#piecemeta">metadata values</a>.</td></tr>
+</table>
+The prefab can either have the SchematicFileName element, in which case the specified schematic file is loaded as the block data, or it can have the Size, BlockData and BlockDefinitions elements, then the server parses the block data from those. If both data members are included, the SchematicFileName takes precedence and the server loads the data from the schematic file (note that this behavior may change, having both definitions is considered "undefined behavior").</p>
+<a name="conndef"><p>
+The connector definitions table is an array of tables, each element describing one connector. The following values are recognized:
+<table>
+<tr><th>Name</th><th>type</th><th>Content</th></tr>
+<tr><td>Type</td><td>number</td><td>The connector's type. The piece generator will only connect the connectors of inverse types ('1'-type connector will connect only to '-1'-type connector).</td></tr>
+<tr><td>RelX</td><td>number</td><td>X coord of the connector, relative to the prefab's zero point ({0, 0, 0} - the first block in the image).</td></tr>
+<tr><td>RelY</td><td>number</td><td>Y coord of the connector, relative to the prefab's zero point ({0, 0, 0} - the first block in the image).</td></tr>
+<tr><td>RelZ</td><td>number</td><td>Z coord of the connector, relative to the prefab's zero point ({0, 0, 0} - the first block in the image).</td></tr>
+<tr><td>Direction</td><td>number</td><td>The direction in which the connector is facing. Corresponds to the eBlockFace constants:
+ <table>
+ <tr><th>Value</th><th>Direction</th></tr>
+ <tr><td>0</td><td>Y-</td></tr>
+ <tr><td>1</td><td>Y+</td></tr>
+ <tr><td>2</td><td>Z-</td></tr>
+ <tr><td>3</td><td>Z+</td></tr>
+ <tr><td>4</td><td>X-</td></tr>
+ <tr><td>5</td><td>X+</td></tr>
+ </table>
+</td></tr>
+</table>
+If a connector definition is missing any of the fields, the server will not add the connector to the prefab upon loading. If a prefab doesn't have any connectors, it still needs to provide an empty Connectors table.</p></a>
+
+<a name="piecemeta"><h3>Piece metadata</h3></a>
+<p>
+Each piece contains additional metadata describing its properties. The server ignores metadata that it doesn't understand. The following values are recognized:
+<table>
+<tr><th>Name</th><th>Type</th><th>IsRequired</th><th>Contents</th></tr>
+<tr><td>IsStarting</td><td>number</td><td>Yes</td><td>Zero means that the piece is a regular piece, nonzero means that the piece is a starting piece (the "seed" of the structure). Required even for cubesets that don't represent a piece-generator data (such as trees). </td></tr>
+<tr><td>AllowedRotations</td><td>number</td><td>&nbsp;</td><td>Number representing a bitmask for which rotations the piece supports. Defaults to 0 (no rotations). Bit 0 (value 1) represents whether 1 counter-clockwise rotation is allowed, bit 1 (value 2) represents whether 2 rotations (180 degrees) are allowed, bit 2 (value 4) represents whether 1 clockwise rotation is allowed.</td></tr>
+<tr><td>AddWeightIfSame</td><td>number</td><td>&nbsp;</td><td>How much weight (chance to generate) should the piece generator add to this piece when the parent piece is the same. It is possible to have negative values, meaning that the piece doesn't like repeating itself. Defaults to 0.</td></tr>
+<tr><td>DefaultWeight</td><td>number</td><td>&nbsp;</td><td>How much weight (chance to generate) does the piece have by default, without any modifiers (AddWeightIfSame, DepthWeight). Defaults to 0.</td></tr>
+<tr><td>DepthWeight</td><td>string</td><td>&nbsp;</td><td>Override for DefaultWeight for specific depth (in the tree used by the piece generator). String in the format "Depth1:Weight1|Depth2:Weight2|...". Each unlisted depth gets the DefaultWeight. Defaults to empty string (no override).</td></tr>
+<tr><td>MergeStrategy</td><td>string</td><td>&nbsp;</td><td>Which merge strategy should be used when drawing the prefab into the world. String representation of one of the cBlockArea:eMergeStrategy constants: "msOverwrite", "msFillAir", "msImprint", "msLake", "msSpongePrint", "msDifference", "msSimpleCompare", "msMask". Defaults to "msSpongePrint".</td></tr>
+<tr><td>MoveToGround</td><td>number</td><td>&nbsp;</td><td>Zero means that the piece will stay where generated by the piece generator, nonzero means that the piece will be moved Y-wise so that its first connector will be on the top block of the existing terrain. Useful for village houses. Defaults to 0.</td></tr>
+<tr><td>ShouldExpandFloor</td><td>number</td><td>&nbsp;</td><td>Nonzero means that the prefab's lowest slice will be repeated downwards until it hits a solid block, effectively creating a foundation for the piece. Useful for nether fortresses and village houses. Defaults to 0.</td></tr>
+</table>
+Each value that should be a number also allows a string that represents a number. This makes it easier for automated exporters - they can export all values as strings.</p>
+
+<hr/>
+
+<a name="example"><h2>Example</h2></a>
+<p>
+The following example defines a cubeset with two pieces. The first piece is inlined into the cubeset file, the second piece uses an external schematic file.</p>
+<pre>
+Cubeset =
+{
+ Metadata =
+ {
+ CubesetFormatVersion = 1,
+ },
+
+ Pieces =
+ {
+ -- The following piece was exported from the Gallery server by the GalExport plugin in the "cubeset" format:
+ {
+ OriginData =
+ {
+ ExportName = "DarkCorridor",
+ Name = "Nether 3",
+ GalleryName = "Nether",
+ GalleryIndex = "3",
+ ID = "30",
+ CreatorName = "STR_Warrior",
+ },
+ Size =
+ {
+ x = 14,
+ y = 6,
+ z = 5,
+ },
+ Hitbox =
+ {
+ MinX = 0,
+ MinY = 0,
+ MinZ = 0,
+ MaxX = 13,
+ MaxY = 5,
+ MaxZ = 4,
+ },
+ Connectors =
+ {
+ {
+ Type = 1,
+ RelX = 0,
+ RelY = 1,
+ RelZ = 2,
+ Direction = 4, -- X-
+ },
+ {
+ Type = 1,
+ RelX = 13,
+ RelY = 1,
+ RelZ = 2,
+ Direction = 5, -- X+
+ },
+ {
+ Type = -1,
+ RelX = 0,
+ RelY = 1,
+ RelZ = 2,
+ Direction = 4, -- X-
+ },
+ {
+ Type = -1,
+ RelX = 13,
+ RelY = 1,
+ RelZ = 2,
+ Direction = 5, -- X+
+ },
+ },
+ Metadata =
+ {
+ ["DefaultWeight"] = "100",
+ ["IsStarting"] = "0",
+ ["AllowedRotations"] = "7",
+ ["MergeStrategy"] = "msSpongePrint",
+ ["DepthWeight"] = "",
+ ["ShouldExpandFloor"] = "1",
+ ["MoveToGround"] = "0",
+ ["AddWeightIfSame"] = "0",
+ },
+ BlockDefinitions =
+ {
+ ".: 0: 0", -- air
+ "a:112: 0", -- netherbrick
+ "b:113: 0", -- netherbrickfence
+ "c:114: 2", -- netherbrickstairs
+ "d:114: 3", -- netherbrickstairs
+ "m: 19: 0", -- sponge
+ },
+ BlockData =
+ {
+ -- Level 0
+ "aaaaaaaaaaaaaa", -- 0
+ "aaaaaaaaaaaaaa", -- 1
+ "aaaaaaaaaaaaaa", -- 2
+ "aaaaaaaaaaaaaa", -- 3
+ "aaaaaaaaaaaaaa", -- 4
+
+ -- Level 1
+ "aaaaaaaaaaaaaa", -- 0
+ "..............", -- 1
+ "..............", -- 2
+ "..............", -- 3
+ "aaaaaaaaaaaaaa", -- 4
+
+ -- Level 2
+ "aabaaaaaaaabaa", -- 0
+ "..............", -- 1
+ "..............", -- 2
+ "..............", -- 3
+ "aabaaaaaaaabaa", -- 4
+
+ -- Level 3
+ "aabaaaaaaaabaa", -- 0
+ "..............", -- 1
+ "..............", -- 2
+ "..............", -- 3
+ "aabaaaaaaaabaa", -- 4
+
+ -- Level 4
+ "aabaaaaaaaabaa", -- 0
+ "..............", -- 1
+ "..............", -- 2
+ "..............", -- 3
+ "aabaaaaaaaabaa", -- 4
+
+ -- Level 5
+ "cccccccccccccc", -- 0
+ "aaaaaaaaaaaaaa", -- 1
+ "aaaaaaaaaaaaaa", -- 2
+ "aaaaaaaaaaaaaa", -- 3
+ "dddddddddddddd", -- 4
+ },
+ }, -- DarkCorridor
+
+ -- The following piece was exported from the Gallery server by the GalExport plugin in the "cubesetext" format:
+ {
+ 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",
+ },
+ SchematicFile = "PlainsVillage/20.schematic",
+ }, -- DoublePlantBed
+ }
+}
+</pre>
+
+</body>
+</html>
diff --git a/docs/style.css b/docs/style.css
new file mode 100644
index 000000000..74419d8da
--- /dev/null
+++ b/docs/style.css
@@ -0,0 +1,12 @@
+table
+{
+ border: 1px outset;
+ border-spacing: 0px;
+ border-collapse: separate;
+}
+
+td, th
+{
+ border: 1px inset
+}
+
diff --git a/easyinstall.sh b/easyinstall.sh
index 15ca1d358..71d99312b 100755
--- a/easyinstall.sh
+++ b/easyinstall.sh
@@ -4,14 +4,14 @@ PLATFORM=$(uname -m)
echo "Identifying platform: $PLATFORM"
case $PLATFORM in
- "i686") DOWNLOADURL="http://builds.cuberite.org/job/MCServer%20Linux%20x86/lastSuccessfulBuild/artifact/MCServer.tar.gz" ;;
- "x86_64") DOWNLOADURL="http://builds.cuberite.org/job/MCServer%20Linux%20x64/lastSuccessfulBuild/artifact/MCServer.tar.gz" ;;
+ "i686") DOWNLOADURL="http://builds.cuberite.org/job/Cuberite%20Linux%20x86%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz" ;;
+ "x86_64") DOWNLOADURL="http://builds.cuberite.org/job/Cuberite%20Linux%20x64%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz" ;;
# Assume that all arm devices are a raspi for now.
- arm*) DOWNLOADURL="http://builds.cuberite.org/job/MCServer%20Linux%20armhf/lastSuccessfulBuild/artifact/MCServer/MCServer.tar.gz"
+ arm*) DOWNLOADURL="http://builds.cuberite.org/job/Cuberite%20Linux%20raspi-armhf%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz"
esac
echo "Downloading precompiled binaries."
curl -s $DOWNLOADURL | tar -xzf -
echo "Done."
-echo "MCServer is now installed, run using 'cd MCServer; ./MCServer'."
+echo "Cuberite is now installed, run using 'cd MCServer; ./MCServer'."
diff --git a/lib/SQLiteCpp b/lib/SQLiteCpp
-Subproject b17195b8d03e8908807c51f4d6ce610b148fc1b
+Subproject 49679e7b54726e2d94d3aad76a65aeb9c1088af
diff --git a/lib/TCLAP b/lib/TCLAP
new file mode 160000
+Subproject 12cee38782897cfe60a1611615c200c45cd99ea
diff --git a/lib/expat/expat.h b/lib/expat/expat.h
index 20a8278f7..9a21680be 100644
--- a/lib/expat/expat.h
+++ b/lib/expat/expat.h
@@ -742,6 +742,29 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser);
XMLPARSEAPI(int)
XML_GetIdAttributeIndex(XML_Parser parser);
+#ifdef XML_ATTR_INFO
+/* Source file byte offsets for the start and end of attribute names and values.
+ The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
+ file an attribute value of "blah" will yield:
+ info->valueEnd - info->valueStart = 4 bytes.
+*/
+typedef struct {
+ XML_Index nameStart; /* Offset to beginning of the attribute name. */
+ XML_Index nameEnd; /* Offset after the attribute name's last byte. */
+ XML_Index valueStart; /* Offset to beginning of the attribute value. */
+ XML_Index valueEnd; /* Offset after the attribute value's last byte. */
+} XML_AttrInfo;
+
+/* Returns an array of XML_AttrInfo structures for the attribute/value pairs
+ passed in last call to the XML_StartElementHandler that were specified
+ in the start-tag rather than defaulted. Each attribute/value pair counts
+ as 1; thus the number of entries in the array is
+ XML_GetSpecifiedAttributeCount(parser) / 2.
+*/
+XMLPARSEAPI(const XML_AttrInfo *)
+XML_GetAttributeInfo(XML_Parser parser);
+#endif
+
/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
detected. The last call to XML_Parse must have isFinal true; len
may be zero for this call (or any other).
@@ -883,6 +906,15 @@ XMLPARSEAPI(int)
XML_SetParamEntityParsing(XML_Parser parser,
enum XML_ParamEntityParsing parsing);
+/* Sets the hash salt to use for internal hash calculations.
+ Helps in preventing DoS attacks based on predicting hash
+ function behavior. This must be called before parsing is started.
+ Returns 1 if successful, 0 when called after parsing has started.
+*/
+XMLPARSEAPI(int)
+XML_SetHashSalt(XML_Parser parser,
+ unsigned long hash_salt);
+
/* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
XML_GetErrorCode returns information about the error.
*/
@@ -984,7 +1016,8 @@ enum XML_FeatureEnum {
XML_FEATURE_SIZEOF_XML_CHAR,
XML_FEATURE_SIZEOF_XML_LCHAR,
XML_FEATURE_NS,
- XML_FEATURE_LARGE_SIZE
+ XML_FEATURE_LARGE_SIZE,
+ XML_FEATURE_ATTR_INFO
/* Additional features must be added to the end of this enum. */
};
@@ -1004,8 +1037,8 @@ XML_GetFeatureList(void);
change to major or minor version.
*/
#define XML_MAJOR_VERSION 2
-#define XML_MINOR_VERSION 0
-#define XML_MICRO_VERSION 1
+#define XML_MINOR_VERSION 1
+#define XML_MICRO_VERSION 0
#ifdef __cplusplus
}
diff --git a/lib/expat/xmlparse.c b/lib/expat/xmlparse.c
index 115b42127..759a0c04b 100644
--- a/lib/expat/xmlparse.c
+++ b/lib/expat/xmlparse.c
@@ -5,17 +5,18 @@
#include <stddef.h>
#include <string.h> /* memset(), memcpy() */
#include <assert.h>
+#include <limits.h> /* UINT_MAX */
+#include <time.h> /* time() */
-#define XML_BUILDING_EXPAT 1
-
-// 2013_04_09 _X: Quick and dirty "fix" for expat compilation under Linux:
+// 2013_04_09 _X: Quick and dirty "fix" for expat compilation under Linux and Windows:
#define HAVE_MEMMOVE
+#define XML_BUILDING_EXPAT 1
#ifdef COMPILED_FROM_DSP
#include "winconfig.h"
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
-#elif defined(__amigaos4__)
+#elif defined(__amigaos__)
#include "amigaconfig.h"
#elif defined(__WATCOMC__)
#include "watcomconfig.h"
@@ -330,15 +331,15 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
static enum XML_Error
initializeEncoding(XML_Parser parser);
static enum XML_Error
-doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
- const char *end, int tok, const char *next, const char **nextPtr,
+doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
+ const char *end, int tok, const char *next, const char **nextPtr,
XML_Bool haveMore);
static enum XML_Error
-processInternalEntity(XML_Parser parser, ENTITY *entity,
+processInternalEntity(XML_Parser parser, ENTITY *entity,
XML_Bool betweenDecl);
static enum XML_Error
doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
- const char *start, const char *end, const char **endPtr,
+ const char *start, const char *end, const char **endPtr,
XML_Bool haveMore);
static enum XML_Error
doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr,
@@ -356,7 +357,7 @@ static enum XML_Error
addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
const XML_Char *uri, BINDING **bindingsPtr);
static int
-defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata,
+defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata,
XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser);
static enum XML_Error
storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
@@ -394,12 +395,13 @@ static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms);
static void
dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
static int
-dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
+dtdCopy(XML_Parser oldParser,
+ DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
static int
-copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
-
+copyEntityTable(XML_Parser oldParser,
+ HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
static NAMED *
-lookup(HASH_TABLE *table, KEY name, size_t createSize);
+lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize);
static void FASTCALL
hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms);
static void FASTCALL hashTableClear(HASH_TABLE *);
@@ -432,11 +434,15 @@ static ELEMENT_TYPE *
getElementType(XML_Parser parser, const ENCODING *enc,
const char *ptr, const char *end);
+static unsigned long generate_hash_secret_salt(void);
+static XML_Bool startParsing(XML_Parser parser);
+
static XML_Parser
parserCreate(const XML_Char *encodingName,
const XML_Memory_Handling_Suite *memsuite,
const XML_Char *nameSep,
DTD *dtd);
+
static void
parserInit(XML_Parser parser, const XML_Char *encodingName);
@@ -536,6 +542,9 @@ struct XML_ParserStruct {
NS_ATT *m_nsAtts;
unsigned long m_nsAttsVersion;
unsigned char m_nsAttsPower;
+#ifdef XML_ATTR_INFO
+ XML_AttrInfo *m_attInfo;
+#endif
POSITION m_position;
STRING_POOL m_tempPool;
STRING_POOL m_temp2Pool;
@@ -549,6 +558,7 @@ struct XML_ParserStruct {
XML_Bool m_useForeignDTD;
enum XML_ParamEntityParsing m_paramEntityParsing;
#endif
+ unsigned long m_hash_secret_salt;
};
#define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
@@ -643,6 +653,7 @@ struct XML_ParserStruct {
#define nsAtts (parser->m_nsAtts)
#define nsAttsVersion (parser->m_nsAttsVersion)
#define nsAttsPower (parser->m_nsAttsPower)
+#define attInfo (parser->m_attInfo)
#define tempPool (parser->m_tempPool)
#define temp2Pool (parser->m_temp2Pool)
#define groupConnector (parser->m_groupConnector)
@@ -656,6 +667,7 @@ struct XML_ParserStruct {
#define useForeignDTD (parser->m_useForeignDTD)
#define paramEntityParsing (parser->m_paramEntityParsing)
#endif /* XML_DTD */
+#define hash_secret_salt (parser->m_hash_secret_salt)
XML_Parser XMLCALL
XML_ParserCreate(const XML_Char *encodingName)
@@ -673,29 +685,42 @@ XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep)
static const XML_Char implicitContext[] = {
ASCII_x, ASCII_m, ASCII_l, ASCII_EQUALS, ASCII_h, ASCII_t, ASCII_t, ASCII_p,
- ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w,
+ ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w,
ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD, ASCII_o, ASCII_r, ASCII_g,
ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L, ASCII_SLASH, ASCII_1, ASCII_9,
ASCII_9, ASCII_8, ASCII_SLASH, ASCII_n, ASCII_a, ASCII_m, ASCII_e,
ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e, '\0'
};
+static unsigned long
+generate_hash_secret_salt(void)
+{
+ unsigned int seed = time(NULL) % UINT_MAX;
+ srand(seed);
+ return rand();
+}
+
+static XML_Bool /* only valid for root parser */
+startParsing(XML_Parser parser)
+{
+ /* hash functions must be initialized before setContext() is called */
+ if (hash_secret_salt == 0)
+ hash_secret_salt = generate_hash_secret_salt();
+ if (ns) {
+ /* implicit context only set for root parser, since child
+ parsers (i.e. external entity parsers) will inherit it
+ */
+ return setContext(parser, implicitContext);
+ }
+ return XML_TRUE;
+}
+
XML_Parser XMLCALL
XML_ParserCreate_MM(const XML_Char *encodingName,
const XML_Memory_Handling_Suite *memsuite,
const XML_Char *nameSep)
{
- XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
- if (parser != NULL && ns) {
- /* implicit context only set for root parser, since child
- parsers (i.e. external entity parsers) will inherit it
- */
- if (!setContext(parser, implicitContext)) {
- XML_ParserFree(parser);
- return NULL;
- }
- }
- return parser;
+ return parserCreate(encodingName, memsuite, nameSep, NULL);
}
static XML_Parser
@@ -740,9 +765,20 @@ parserCreate(const XML_Char *encodingName,
FREE(parser);
return NULL;
}
+#ifdef XML_ATTR_INFO
+ attInfo = (XML_AttrInfo*)MALLOC(attsSize * sizeof(XML_AttrInfo));
+ if (attInfo == NULL) {
+ FREE(atts);
+ FREE(parser);
+ return NULL;
+ }
+#endif
dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
if (dataBuf == NULL) {
FREE(atts);
+#ifdef XML_ATTR_INFO
+ FREE(attInfo);
+#endif
FREE(parser);
return NULL;
}
@@ -755,6 +791,9 @@ parserCreate(const XML_Char *encodingName,
if (_dtd == NULL) {
FREE(dataBuf);
FREE(atts);
+#ifdef XML_ATTR_INFO
+ FREE(attInfo);
+#endif
FREE(parser);
return NULL;
}
@@ -869,6 +908,7 @@ parserInit(XML_Parser parser, const XML_Char *encodingName)
useForeignDTD = XML_FALSE;
paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
#endif
+ hash_secret_salt = 0;
}
/* moves list of bindings to freeBindingList */
@@ -916,7 +956,7 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encodingName)
poolClear(&temp2Pool);
parserInit(parser, encodingName);
dtdReset(_dtd, &parser->m_mem);
- return setContext(parser, implicitContext);
+ return XML_TRUE;
}
enum XML_Status XMLCALL
@@ -985,6 +1025,12 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser,
int oldInEntityValue = prologState.inEntityValue;
#endif
XML_Bool oldns_triplets = ns_triplets;
+ /* Note that the new parser shares the same hash secret as the old
+ parser, so that dtdCopy and copyEntityTable can lookup values
+ from hash tables associated with either parser without us having
+ to worry which hash secrets each table has.
+ */
+ unsigned long oldhash_secret_salt = hash_secret_salt;
#ifdef XML_DTD
if (!context)
@@ -1038,13 +1084,14 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser,
externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
ns_triplets = oldns_triplets;
+ hash_secret_salt = oldhash_secret_salt;
parentParser = oldParser;
#ifdef XML_DTD
paramEntityParsing = oldParamEntityParsing;
prologState.inEntityValue = oldInEntityValue;
if (context) {
#endif /* XML_DTD */
- if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
+ if (!dtdCopy(oldParser, _dtd, oldDtd, &parser->m_mem)
|| !setContext(parser, context)) {
XML_ParserFree(parser);
return NULL;
@@ -1133,6 +1180,9 @@ XML_ParserFree(XML_Parser parser)
#endif /* XML_DTD */
dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
FREE((void *)atts);
+#ifdef XML_ATTR_INFO
+ FREE((void *)attInfo);
+#endif
FREE(groupConnector);
FREE(buffer);
FREE(dataBuf);
@@ -1213,6 +1263,14 @@ XML_GetIdAttributeIndex(XML_Parser parser)
return idAttIndex;
}
+#ifdef XML_ATTR_INFO
+const XML_AttrInfo * XMLCALL
+XML_GetAttributeInfo(XML_Parser parser)
+{
+ return attInfo;
+}
+#endif
+
void XMLCALL
XML_SetElementHandler(XML_Parser parser,
XML_StartElementHandler start,
@@ -1429,6 +1487,17 @@ XML_SetParamEntityParsing(XML_Parser parser,
#endif
}
+int XMLCALL
+XML_SetHashSalt(XML_Parser parser,
+ unsigned long hash_salt)
+{
+ /* block after XML_Parse()/XML_ParseBuffer() has been called */
+ if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
+ return 0;
+ hash_secret_salt = hash_salt;
+ return 1;
+}
+
enum XML_Status XMLCALL
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
{
@@ -1439,6 +1508,11 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
case XML_FINISHED:
errorCode = XML_ERROR_FINISHED;
return XML_STATUS_ERROR;
+ case XML_INITIALIZED:
+ if (parentParser == NULL && !startParsing(parser)) {
+ errorCode = XML_ERROR_NO_MEMORY;
+ return XML_STATUS_ERROR;
+ }
default:
ps_parsing = XML_PARSING;
}
@@ -1462,7 +1536,7 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
positionPtr = bufferPtr;
return XML_STATUS_SUSPENDED;
- case XML_INITIALIZED:
+ case XML_INITIALIZED:
case XML_PARSING:
ps_parsing = XML_FINISHED;
/* fall through */
@@ -1497,11 +1571,13 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
break;
case XML_INITIALIZED:
case XML_PARSING:
- result = XML_STATUS_OK;
if (isFinal) {
ps_parsing = XML_FINISHED;
- return result;
+ return XML_STATUS_OK;
}
+ /* fall through */
+ default:
+ result = XML_STATUS_OK;
}
}
@@ -1516,15 +1592,11 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
: (char *)REALLOC(buffer, len * 2));
if (temp == NULL) {
errorCode = XML_ERROR_NO_MEMORY;
- return XML_STATUS_ERROR;
- }
- buffer = temp;
- if (!buffer) {
- errorCode = XML_ERROR_NO_MEMORY;
eventPtr = eventEndPtr = NULL;
processor = errorProcessor;
return XML_STATUS_ERROR;
}
+ buffer = temp;
bufferLim = buffer + len * 2;
}
memcpy(buffer, end, nLeftOver);
@@ -1562,6 +1634,11 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
case XML_FINISHED:
errorCode = XML_ERROR_FINISHED;
return XML_STATUS_ERROR;
+ case XML_INITIALIZED:
+ if (parentParser == NULL && !startParsing(parser)) {
+ errorCode = XML_ERROR_NO_MEMORY;
+ return XML_STATUS_ERROR;
+ }
default:
ps_parsing = XML_PARSING;
}
@@ -1585,7 +1662,7 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
case XML_SUSPENDED:
result = XML_STATUS_SUSPENDED;
break;
- case XML_INITIALIZED:
+ case XML_INITIALIZED:
case XML_PARSING:
if (isFinal) {
ps_parsing = XML_FINISHED;
@@ -1675,6 +1752,8 @@ XML_GetBuffer(XML_Parser parser, int len)
bufferPtr = buffer = newBuf;
#endif /* not defined XML_CONTEXT_BYTES */
}
+ eventPtr = eventEndPtr = NULL;
+ positionPtr = NULL;
}
return bufferEnd;
}
@@ -1732,7 +1811,7 @@ XML_ResumeParser(XML_Parser parser)
case XML_SUSPENDED:
result = XML_STATUS_SUSPENDED;
break;
- case XML_INITIALIZED:
+ case XML_INITIALIZED:
case XML_PARSING:
if (ps_finalBuffer) {
ps_parsing = XML_FINISHED;
@@ -1959,7 +2038,10 @@ XML_GetFeatureList(void)
#endif
#ifdef XML_LARGE_SIZE
{XML_FEATURE_LARGE_SIZE, XML_L("XML_LARGE_SIZE"), 0},
-#endif
+#endif
+#ifdef XML_ATTR_INFO
+ {XML_FEATURE_ATTR_INFO, XML_L("XML_ATTR_INFO"), 0},
+#endif
{XML_FEATURE_END, NULL, 0}
};
@@ -2022,7 +2104,7 @@ contentProcessor(XML_Parser parser,
const char *end,
const char **endPtr)
{
- enum XML_Error result = doContent(parser, 0, encoding, start, end,
+ enum XML_Error result = doContent(parser, 0, encoding, start, end,
endPtr, (XML_Bool)!ps_finalBuffer);
if (result == XML_ERROR_NONE) {
if (!storeRawNames(parser))
@@ -2104,7 +2186,7 @@ externalEntityInitProcessor3(XML_Parser parser,
if (result != XML_ERROR_NONE)
return result;
switch (ps_parsing) {
- case XML_SUSPENDED:
+ case XML_SUSPENDED:
*endPtr = next;
return XML_ERROR_NONE;
case XML_FINISHED:
@@ -2138,7 +2220,7 @@ externalEntityContentProcessor(XML_Parser parser,
const char *end,
const char **endPtr)
{
- enum XML_Error result = doContent(parser, 1, encoding, start, end,
+ enum XML_Error result = doContent(parser, 1, encoding, start, end,
endPtr, (XML_Bool)!ps_finalBuffer);
if (result == XML_ERROR_NONE) {
if (!storeRawNames(parser))
@@ -2157,7 +2239,7 @@ doContent(XML_Parser parser,
XML_Bool haveMore)
{
/* save one level of indirection */
- DTD * const dtd = _dtd;
+ DTD * const dtd = _dtd;
const char **eventPP;
const char **eventEndPP;
@@ -2188,8 +2270,8 @@ doContent(XML_Parser parser,
}
else if (defaultHandler)
reportDefault(parser, enc, s, end);
- /* We are at the end of the final buffer, should we check for
- XML_SUSPENDED, XML_FINISHED?
+ /* We are at the end of the final buffer, should we check for
+ XML_SUSPENDED, XML_FINISHED?
*/
if (startTagLevel == 0)
return XML_ERROR_NO_ELEMENTS;
@@ -2243,7 +2325,7 @@ doContent(XML_Parser parser,
next - enc->minBytesPerChar);
if (!name)
return XML_ERROR_NO_MEMORY;
- entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0);
+ entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
poolDiscard(&dtd->pool);
/* First, determine if a check for an existing declaration is needed;
if yes, check that the entity exists, and that it is internal,
@@ -2540,8 +2622,8 @@ doContent(XML_Parser parser,
}
else if (defaultHandler)
reportDefault(parser, enc, s, end);
- /* We are at the end of the final buffer, should we check for
- XML_SUSPENDED, XML_FINISHED?
+ /* We are at the end of the final buffer, should we check for
+ XML_SUSPENDED, XML_FINISHED?
*/
if (startTagLevel == 0) {
*eventPP = end;
@@ -2553,7 +2635,7 @@ doContent(XML_Parser parser,
}
*nextPtr = end;
return XML_ERROR_NONE;
- case XML_TOK_DATA_CHARS:
+ case XML_TOK_DATA_CHARS:
{
XML_CharacterDataHandler charDataHandler = characterDataHandler;
if (charDataHandler) {
@@ -2593,7 +2675,7 @@ doContent(XML_Parser parser,
}
*eventPP = s = next;
switch (ps_parsing) {
- case XML_SUSPENDED:
+ case XML_SUSPENDED:
*nextPtr = next;
return XML_ERROR_NONE;
case XML_FINISHED:
@@ -2633,12 +2715,12 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
const XML_Char *localPart;
/* lookup the element type name */
- elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0);
+ elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, tagNamePtr->str,0);
if (!elementType) {
const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
if (!name)
return XML_ERROR_NO_MEMORY;
- elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name,
+ elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, name,
sizeof(ELEMENT_TYPE));
if (!elementType)
return XML_ERROR_NO_MEMORY;
@@ -2652,23 +2734,44 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
if (n + nDefaultAtts > attsSize) {
int oldAttsSize = attsSize;
ATTRIBUTE *temp;
+#ifdef XML_ATTR_INFO
+ XML_AttrInfo *temp2;
+#endif
attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;
temp = (ATTRIBUTE *)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE));
if (temp == NULL)
return XML_ERROR_NO_MEMORY;
atts = temp;
+#ifdef XML_ATTR_INFO
+ temp2 = (XML_AttrInfo *)REALLOC((void *)attInfo, attsSize * sizeof(XML_AttrInfo));
+ if (temp2 == NULL)
+ return XML_ERROR_NO_MEMORY;
+ attInfo = temp2;
+#endif
if (n > oldAttsSize)
XmlGetAttributes(enc, attStr, n, atts);
}
appAtts = (const XML_Char **)atts;
for (i = 0; i < n; i++) {
+ ATTRIBUTE *currAtt = &atts[i];
+#ifdef XML_ATTR_INFO
+ XML_AttrInfo *currAttInfo = &attInfo[i];
+#endif
/* add the name and value to the attribute list */
- ATTRIBUTE_ID *attId = getAttributeId(parser, enc, atts[i].name,
- atts[i].name
- + XmlNameLength(enc, atts[i].name));
+ ATTRIBUTE_ID *attId = getAttributeId(parser, enc, currAtt->name,
+ currAtt->name
+ + XmlNameLength(enc, currAtt->name));
if (!attId)
return XML_ERROR_NO_MEMORY;
+#ifdef XML_ATTR_INFO
+ currAttInfo->nameStart = parseEndByteIndex - (parseEndPtr - currAtt->name);
+ currAttInfo->nameEnd = currAttInfo->nameStart +
+ XmlNameLength(enc, currAtt->name);
+ currAttInfo->valueStart = parseEndByteIndex -
+ (parseEndPtr - currAtt->valuePtr);
+ currAttInfo->valueEnd = parseEndByteIndex - (parseEndPtr - currAtt->valueEnd);
+#endif
/* Detect duplicate attributes by their QNames. This does not work when
namespace processing is turned on and different prefixes for the same
namespace are used. For this case we have a check further down.
@@ -2807,9 +2910,9 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
if (s[-1] == 2) { /* prefixed */
ATTRIBUTE_ID *id;
const BINDING *b;
- unsigned long uriHash = 0;
+ unsigned long uriHash = hash_secret_salt;
((XML_Char *)s)[-1] = 0; /* clear flag */
- id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, s, 0);
+ id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, s, 0);
b = id->prefix->binding;
if (!b)
return XML_ERROR_UNBOUND_PREFIX;
@@ -2831,7 +2934,7 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
} while (*s++);
{ /* Check hash table for duplicate of expanded name (uriName).
- Derived from code in lookup(HASH_TABLE *table, ...).
+ Derived from code in lookup(parser, HASH_TABLE *table, ...).
*/
unsigned char step = 0;
unsigned long mask = nsAttsSize - 1;
@@ -2952,27 +3055,27 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
static const XML_Char xmlNamespace[] = {
ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH, ASCII_SLASH,
ASCII_w, ASCII_w, ASCII_w, ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD,
- ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L,
+ ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L,
ASCII_SLASH, ASCII_1, ASCII_9, ASCII_9, ASCII_8, ASCII_SLASH,
ASCII_n, ASCII_a, ASCII_m, ASCII_e, ASCII_s, ASCII_p, ASCII_a, ASCII_c,
ASCII_e, '\0'
};
- static const int xmlLen =
+ static const int xmlLen =
(int)sizeof(xmlNamespace)/sizeof(XML_Char) - 1;
static const XML_Char xmlnsNamespace[] = {
ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH, ASCII_SLASH,
ASCII_w, ASCII_w, ASCII_w, ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD,
- ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_2, ASCII_0, ASCII_0,
- ASCII_0, ASCII_SLASH, ASCII_x, ASCII_m, ASCII_l, ASCII_n, ASCII_s,
+ ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_2, ASCII_0, ASCII_0,
+ ASCII_0, ASCII_SLASH, ASCII_x, ASCII_m, ASCII_l, ASCII_n, ASCII_s,
ASCII_SLASH, '\0'
};
- static const int xmlnsLen =
+ static const int xmlnsLen =
(int)sizeof(xmlnsNamespace)/sizeof(XML_Char) - 1;
XML_Bool mustBeXML = XML_FALSE;
XML_Bool isXML = XML_TRUE;
XML_Bool isXMLNS = XML_TRUE;
-
+
BINDING *b;
int len;
@@ -2999,7 +3102,7 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
if (isXML && (len > xmlLen || uri[len] != xmlNamespace[len]))
isXML = XML_FALSE;
- if (!mustBeXML && isXMLNS
+ if (!mustBeXML && isXMLNS
&& (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
isXMLNS = XML_FALSE;
}
@@ -3210,7 +3313,7 @@ ignoreSectionProcessor(XML_Parser parser,
const char *end,
const char **endPtr)
{
- enum XML_Error result = doIgnoreSection(parser, encoding, &start, end,
+ enum XML_Error result = doIgnoreSection(parser, encoding, &start, end,
endPtr, (XML_Bool)!ps_finalBuffer);
if (result != XML_ERROR_NONE)
return result;
@@ -3492,7 +3595,7 @@ entityValueInitProcessor(XML_Parser parser,
const char *next = start;
eventPtr = start;
- for (;;) {
+ for (;;) {
tok = XmlPrologTok(encoding, start, end, &next);
eventEndPtr = next;
if (tok <= 0) {
@@ -3520,7 +3623,7 @@ entityValueInitProcessor(XML_Parser parser,
if (result != XML_ERROR_NONE)
return result;
switch (ps_parsing) {
- case XML_SUSPENDED:
+ case XML_SUSPENDED:
*nextPtr = next;
return XML_ERROR_NONE;
case XML_FINISHED:
@@ -3585,7 +3688,7 @@ externalParEntProcessor(XML_Parser parser,
}
processor = prologProcessor;
- return doProlog(parser, encoding, s, end, tok, next,
+ return doProlog(parser, encoding, s, end, tok, next,
nextPtr, (XML_Bool)!ps_finalBuffer);
}
@@ -3635,7 +3738,7 @@ prologProcessor(XML_Parser parser,
{
const char *next = s;
int tok = XmlPrologTok(encoding, s, end, &next);
- return doProlog(parser, encoding, s, end, tok, next,
+ return doProlog(parser, encoding, s, end, tok, next,
nextPtr, (XML_Bool)!ps_finalBuffer);
}
@@ -3652,7 +3755,7 @@ doProlog(XML_Parser parser,
#ifdef XML_DTD
static const XML_Char externalSubsetName[] = { ASCII_HASH , '\0' };
#endif /* XML_DTD */
- static const XML_Char atypeCDATA[] =
+ static const XML_Char atypeCDATA[] =
{ ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' };
static const XML_Char atypeID[] = { ASCII_I, ASCII_D, '\0' };
static const XML_Char atypeIDREF[] =
@@ -3673,7 +3776,7 @@ doProlog(XML_Parser parser,
static const XML_Char enumValueStart[] = { ASCII_LPAREN, '\0' };
/* save one level of indirection */
- DTD * const dtd = _dtd;
+ DTD * const dtd = _dtd;
const char **eventPP;
const char **eventEndPP;
@@ -3706,6 +3809,9 @@ doProlog(XML_Parser parser,
return XML_ERROR_UNCLOSED_TOKEN;
case XML_TOK_PARTIAL_CHAR:
return XML_ERROR_PARTIAL_CHAR;
+ case -XML_TOK_PROLOG_S:
+ tok = -tok;
+ break;
case XML_TOK_NONE:
#ifdef XML_DTD
/* for internal PE NOT referenced between declarations */
@@ -3777,7 +3883,8 @@ doProlog(XML_Parser parser,
case XML_ROLE_DOCTYPE_PUBLIC_ID:
#ifdef XML_DTD
useForeignDTD = XML_FALSE;
- declEntity = (ENTITY *)lookup(&dtd->paramEntities,
+ declEntity = (ENTITY *)lookup(parser,
+ &dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
if (!declEntity)
@@ -3785,15 +3892,17 @@ doProlog(XML_Parser parser,
#endif /* XML_DTD */
dtd->hasParamEntityRefs = XML_TRUE;
if (startDoctypeDeclHandler) {
+ XML_Char *pubId;
if (!XmlIsPublicId(enc, s, next, eventPP))
return XML_ERROR_PUBLICID;
- doctypePubid = poolStoreString(&tempPool, enc,
- s + enc->minBytesPerChar,
- next - enc->minBytesPerChar);
- if (!doctypePubid)
+ pubId = poolStoreString(&tempPool, enc,
+ s + enc->minBytesPerChar,
+ next - enc->minBytesPerChar);
+ if (!pubId)
return XML_ERROR_NO_MEMORY;
- normalizePublicId((XML_Char *)doctypePubid);
+ normalizePublicId(pubId);
poolFinish(&tempPool);
+ doctypePubid = pubId;
handleDefault = XML_FALSE;
goto alreadyChecked;
}
@@ -3832,7 +3941,8 @@ doProlog(XML_Parser parser,
XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
dtd->hasParamEntityRefs = XML_TRUE;
if (paramEntityParsing && externalEntityRefHandler) {
- ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities,
+ ENTITY *entity = (ENTITY *)lookup(parser,
+ &dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
if (!entity)
@@ -3847,8 +3957,8 @@ doProlog(XML_Parser parser,
entity->publicId))
return XML_ERROR_EXTERNAL_ENTITY_HANDLING;
if (dtd->paramEntityRead) {
- if (!dtd->standalone &&
- notStandaloneHandler &&
+ if (!dtd->standalone &&
+ notStandaloneHandler &&
!notStandaloneHandler(handlerArg))
return XML_ERROR_NOT_STANDALONE;
}
@@ -3876,7 +3986,7 @@ doProlog(XML_Parser parser,
XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
dtd->hasParamEntityRefs = XML_TRUE;
if (paramEntityParsing && externalEntityRefHandler) {
- ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities,
+ ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
if (!entity)
@@ -4090,7 +4200,8 @@ doProlog(XML_Parser parser,
break;
#else /* XML_DTD */
if (!declEntity) {
- declEntity = (ENTITY *)lookup(&dtd->paramEntities,
+ declEntity = (ENTITY *)lookup(parser,
+ &dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
if (!declEntity)
@@ -4165,7 +4276,7 @@ doProlog(XML_Parser parser,
const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
if (!name)
return XML_ERROR_NO_MEMORY;
- declEntity = (ENTITY *)lookup(&dtd->generalEntities, name,
+ declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name,
sizeof(ENTITY));
if (!declEntity)
return XML_ERROR_NO_MEMORY;
@@ -4197,7 +4308,7 @@ doProlog(XML_Parser parser,
const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
if (!name)
return XML_ERROR_NO_MEMORY;
- declEntity = (ENTITY *)lookup(&dtd->paramEntities,
+ declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities,
name, sizeof(ENTITY));
if (!declEntity)
return XML_ERROR_NO_MEMORY;
@@ -4286,7 +4397,7 @@ doProlog(XML_Parser parser,
switch (tok) {
case XML_TOK_PARAM_ENTITY_REF:
/* PE references in internal subset are
- not allowed within declarations. */
+ not allowed within declarations. */
return XML_ERROR_PARAM_ENTITY_REF;
case XML_TOK_XML_DECL:
return XML_ERROR_MISPLACED_XML_PI;
@@ -4379,7 +4490,7 @@ doProlog(XML_Parser parser,
next - enc->minBytesPerChar);
if (!name)
return XML_ERROR_NO_MEMORY;
- entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0);
+ entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
poolDiscard(&dtd->pool);
/* first, determine if a check for an existing declaration is needed;
if yes, check that the entity exists, and that it is internal,
@@ -4407,7 +4518,7 @@ doProlog(XML_Parser parser,
return XML_ERROR_RECURSIVE_ENTITY_REF;
if (entity->textPtr) {
enum XML_Error result;
- XML_Bool betweenDecl =
+ XML_Bool betweenDecl =
(role == XML_ROLE_PARAM_ENTITY_REF ? XML_TRUE : XML_FALSE);
result = processInternalEntity(parser, entity, betweenDecl);
if (result != XML_ERROR_NONE)
@@ -4602,7 +4713,7 @@ doProlog(XML_Parser parser,
reportDefault(parser, enc, s, next);
switch (ps_parsing) {
- case XML_SUSPENDED:
+ case XML_SUSPENDED:
*nextPtr = next;
return XML_ERROR_NONE;
case XML_FINISHED:
@@ -4672,7 +4783,7 @@ epilogProcessor(XML_Parser parser,
}
eventPtr = s = next;
switch (ps_parsing) {
- case XML_SUSPENDED:
+ case XML_SUSPENDED:
*nextPtr = next;
return XML_ERROR_NONE;
case XML_FINISHED:
@@ -4715,12 +4826,12 @@ processInternalEntity(XML_Parser parser, ENTITY *entity,
#ifdef XML_DTD
if (entity->is_param) {
int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next);
- result = doProlog(parser, internalEncoding, textStart, textEnd, tok,
+ result = doProlog(parser, internalEncoding, textStart, textEnd, tok,
next, &next, XML_FALSE);
}
- else
+ else
#endif /* XML_DTD */
- result = doContent(parser, tagLevel, internalEncoding, textStart,
+ result = doContent(parser, tagLevel, internalEncoding, textStart,
textEnd, &next, XML_FALSE);
if (result == XML_ERROR_NONE) {
@@ -4760,13 +4871,13 @@ internalEntityProcessor(XML_Parser parser,
#ifdef XML_DTD
if (entity->is_param) {
int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next);
- result = doProlog(parser, internalEncoding, textStart, textEnd, tok,
+ result = doProlog(parser, internalEncoding, textStart, textEnd, tok,
next, &next, XML_FALSE);
}
else
#endif /* XML_DTD */
- result = doContent(parser, openEntity->startTagLevel, internalEncoding,
- textStart, textEnd, &next, XML_FALSE);
+ result = doContent(parser, openEntity->startTagLevel, internalEncoding,
+ textStart, textEnd, &next, XML_FALSE);
if (result != XML_ERROR_NONE)
return result;
@@ -4787,7 +4898,7 @@ internalEntityProcessor(XML_Parser parser,
int tok;
processor = prologProcessor;
tok = XmlPrologTok(encoding, s, end, &next);
- return doProlog(parser, encoding, s, end, tok, next, nextPtr,
+ return doProlog(parser, encoding, s, end, tok, next, nextPtr,
(XML_Bool)!ps_finalBuffer);
}
else
@@ -4796,8 +4907,8 @@ internalEntityProcessor(XML_Parser parser,
processor = contentProcessor;
/* see externalEntityContentProcessor vs contentProcessor */
return doContent(parser, parentParser ? 1 : 0, encoding, s, end,
- nextPtr, (XML_Bool)!ps_finalBuffer);
- }
+ nextPtr, (XML_Bool)!ps_finalBuffer);
+ }
}
static enum XML_Error PTRCALL
@@ -4806,10 +4917,6 @@ errorProcessor(XML_Parser parser,
const char *end,
const char **nextPtr)
{
- (void)s;
- (void)end;
- (void)nextPtr;
-
return errorCode;
}
@@ -4907,7 +5014,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
next - enc->minBytesPerChar);
if (!name)
return XML_ERROR_NO_MEMORY;
- entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0);
+ entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
poolDiscard(&temp2Pool);
/* First, determine if a check for an existing declaration is needed;
if yes, check that the entity exists, and that it is internal.
@@ -4954,7 +5061,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
if (!entity->textPtr) {
if (enc == encoding)
eventPtr = ptr;
- return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF;
+ return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF;
}
else {
enum XML_Error result;
@@ -5016,7 +5123,7 @@ storeEntityValue(XML_Parser parser,
result = XML_ERROR_NO_MEMORY;
goto endEntityValue;
}
- entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0);
+ entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
poolDiscard(&tempPool);
if (!entity) {
/* not a well-formedness error - see XML 1.0: WFC Entity Declared */
@@ -5306,7 +5413,7 @@ setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType)
}
if (!poolAppendChar(&dtd->pool, XML_T('\0')))
return 0;
- prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool),
+ prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
sizeof(PREFIX));
if (!prefix)
return 0;
@@ -5335,7 +5442,7 @@ getAttributeId(XML_Parser parser, const ENCODING *enc,
return NULL;
/* skip quotation mark - its storage will be re-used (like in name[-1]) */
++name;
- id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, name, sizeof(ATTRIBUTE_ID));
+ id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, name, sizeof(ATTRIBUTE_ID));
if (!id)
return NULL;
if (id->name != name)
@@ -5353,7 +5460,7 @@ getAttributeId(XML_Parser parser, const ENCODING *enc,
if (name[5] == XML_T('\0'))
id->prefix = &dtd->defaultPrefix;
else
- id->prefix = (PREFIX *)lookup(&dtd->prefixes, name + 6, sizeof(PREFIX));
+ id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, name + 6, sizeof(PREFIX));
id->xmlns = XML_TRUE;
}
else {
@@ -5368,7 +5475,7 @@ getAttributeId(XML_Parser parser, const ENCODING *enc,
}
if (!poolAppendChar(&dtd->pool, XML_T('\0')))
return NULL;
- id->prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool),
+ id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool),
sizeof(PREFIX));
if (id->prefix->name == poolStart(&dtd->pool))
poolFinish(&dtd->pool);
@@ -5464,7 +5571,7 @@ setContext(XML_Parser parser, const XML_Char *context)
ENTITY *e;
if (!poolAppendChar(&tempPool, XML_T('\0')))
return XML_FALSE;
- e = (ENTITY *)lookup(&dtd->generalEntities, poolStart(&tempPool), 0);
+ e = (ENTITY *)lookup(parser, &dtd->generalEntities, poolStart(&tempPool), 0);
if (e)
e->open = XML_TRUE;
if (*s != XML_T('\0'))
@@ -5479,7 +5586,7 @@ setContext(XML_Parser parser, const XML_Char *context)
else {
if (!poolAppendChar(&tempPool, XML_T('\0')))
return XML_FALSE;
- prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&tempPool),
+ prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&tempPool),
sizeof(PREFIX));
if (!prefix)
return XML_FALSE;
@@ -5643,7 +5750,7 @@ dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms)
The new DTD has already been initialized.
*/
static int
-dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
+dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
{
HASH_TABLE_ITER iter;
@@ -5658,7 +5765,7 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
name = poolCopyString(&(newDtd->pool), oldP->name);
if (!name)
return 0;
- if (!lookup(&(newDtd->prefixes), name, sizeof(PREFIX)))
+ if (!lookup(oldParser, &(newDtd->prefixes), name, sizeof(PREFIX)))
return 0;
}
@@ -5680,7 +5787,7 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
if (!name)
return 0;
++name;
- newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name,
+ newA = (ATTRIBUTE_ID *)lookup(oldParser, &(newDtd->attributeIds), name,
sizeof(ATTRIBUTE_ID));
if (!newA)
return 0;
@@ -5690,7 +5797,7 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
if (oldA->prefix == &oldDtd->defaultPrefix)
newA->prefix = &newDtd->defaultPrefix;
else
- newA->prefix = (PREFIX *)lookup(&(newDtd->prefixes),
+ newA->prefix = (PREFIX *)lookup(oldParser, &(newDtd->prefixes),
oldA->prefix->name, 0);
}
}
@@ -5709,7 +5816,7 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
name = poolCopyString(&(newDtd->pool), oldE->name);
if (!name)
return 0;
- newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name,
+ newE = (ELEMENT_TYPE *)lookup(oldParser, &(newDtd->elementTypes), name,
sizeof(ELEMENT_TYPE));
if (!newE)
return 0;
@@ -5723,14 +5830,14 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
}
if (oldE->idAtt)
newE->idAtt = (ATTRIBUTE_ID *)
- lookup(&(newDtd->attributeIds), oldE->idAtt->name, 0);
+ lookup(oldParser, &(newDtd->attributeIds), oldE->idAtt->name, 0);
newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts;
if (oldE->prefix)
- newE->prefix = (PREFIX *)lookup(&(newDtd->prefixes),
+ newE->prefix = (PREFIX *)lookup(oldParser, &(newDtd->prefixes),
oldE->prefix->name, 0);
for (i = 0; i < newE->nDefaultAtts; i++) {
newE->defaultAtts[i].id = (ATTRIBUTE_ID *)
- lookup(&(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0);
+ lookup(oldParser, &(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0);
newE->defaultAtts[i].isCdata = oldE->defaultAtts[i].isCdata;
if (oldE->defaultAtts[i].value) {
newE->defaultAtts[i].value
@@ -5744,13 +5851,15 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
}
/* Copy the entity tables. */
- if (!copyEntityTable(&(newDtd->generalEntities),
+ if (!copyEntityTable(oldParser,
+ &(newDtd->generalEntities),
&(newDtd->pool),
&(oldDtd->generalEntities)))
return 0;
#ifdef XML_DTD
- if (!copyEntityTable(&(newDtd->paramEntities),
+ if (!copyEntityTable(oldParser,
+ &(newDtd->paramEntities),
&(newDtd->pool),
&(oldDtd->paramEntities)))
return 0;
@@ -5773,7 +5882,8 @@ dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms)
} /* End dtdCopy */
static int
-copyEntityTable(HASH_TABLE *newTable,
+copyEntityTable(XML_Parser oldParser,
+ HASH_TABLE *newTable,
STRING_POOL *newPool,
const HASH_TABLE *oldTable)
{
@@ -5792,7 +5902,7 @@ copyEntityTable(HASH_TABLE *newTable,
name = poolCopyString(newPool, oldE->name);
if (!name)
return 0;
- newE = (ENTITY *)lookup(newTable, name, sizeof(ENTITY));
+ newE = (ENTITY *)lookup(oldParser, newTable, name, sizeof(ENTITY));
if (!newE)
return 0;
if (oldE->systemId) {
@@ -5850,16 +5960,16 @@ keyeq(KEY s1, KEY s2)
}
static unsigned long FASTCALL
-hash(KEY s)
+hash(XML_Parser parser, KEY s)
{
- unsigned long h = 0;
+ unsigned long h = hash_secret_salt;
while (*s)
h = CHAR_HASH(h, *s++);
return h;
}
static NAMED *
-lookup(HASH_TABLE *table, KEY name, size_t createSize)
+lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize)
{
size_t i;
if (table->size == 0) {
@@ -5876,10 +5986,10 @@ lookup(HASH_TABLE *table, KEY name, size_t createSize)
return NULL;
}
memset(table->v, 0, tsize);
- i = hash(name) & ((unsigned long)table->size - 1);
+ i = hash(parser, name) & ((unsigned long)table->size - 1);
}
else {
- unsigned long h = hash(name);
+ unsigned long h = hash(parser, name);
unsigned long mask = (unsigned long)table->size - 1;
unsigned char step = 0;
i = h & mask;
@@ -5905,7 +6015,7 @@ lookup(HASH_TABLE *table, KEY name, size_t createSize)
memset(newV, 0, tsize);
for (i = 0; i < table->size; i++)
if (table->v[i]) {
- unsigned long newHash = hash(table->v[i]->name);
+ unsigned long newHash = hash(parser, table->v[i]->name);
size_t j = newHash & newMask;
step = 0;
while (newV[j]) {
@@ -6126,12 +6236,13 @@ poolGrow(STRING_POOL *pool)
}
if (pool->blocks && pool->start == pool->blocks->s) {
int blockSize = (int)(pool->end - pool->start)*2;
- pool->blocks = (BLOCK *)
+ BLOCK *temp = (BLOCK *)
pool->mem->realloc_fcn(pool->blocks,
(offsetof(BLOCK, s)
+ blockSize * sizeof(XML_Char)));
- if (pool->blocks == NULL)
+ if (temp == NULL)
return XML_FALSE;
+ pool->blocks = temp;
pool->blocks->size = blockSize;
pool->ptr = pool->blocks->s + (pool->ptr - pool->start);
pool->start = pool->blocks->s;
@@ -6280,7 +6391,7 @@ getElementType(XML_Parser parser,
if (!name)
return NULL;
- ret = (ELEMENT_TYPE *) lookup(&dtd->elementTypes, name, sizeof(ELEMENT_TYPE));
+ ret = (ELEMENT_TYPE *) lookup(parser, &dtd->elementTypes, name, sizeof(ELEMENT_TYPE));
if (!ret)
return NULL;
if (ret->name != name)
diff --git a/lib/expat/xmlrole.c b/lib/expat/xmlrole.c
index 55cba6429..44772e21d 100644
--- a/lib/expat/xmlrole.c
+++ b/lib/expat/xmlrole.c
@@ -8,7 +8,7 @@
#include "winconfig.h"
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
-#elif defined(__amigaos4__)
+#elif defined(__amigaos__)
#include "amigaconfig.h"
#elif defined(__WATCOMC__)
#include "watcomconfig.h"
@@ -199,10 +199,6 @@ prolog2(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NONE;
@@ -224,10 +220,6 @@ doctype0(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_DOCTYPE_NONE;
@@ -276,10 +268,6 @@ doctype2(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_DOCTYPE_NONE;
@@ -297,10 +285,6 @@ doctype3(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_DOCTYPE_NONE;
@@ -318,10 +302,6 @@ doctype4(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_DOCTYPE_NONE;
@@ -342,10 +322,6 @@ doctype5(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_DOCTYPE_NONE;
@@ -465,10 +441,6 @@ entity0(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@@ -489,10 +461,6 @@ entity1(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@@ -538,10 +506,6 @@ entity3(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@@ -559,10 +523,6 @@ entity4(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@@ -603,10 +563,6 @@ entity6(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@@ -653,10 +609,6 @@ entity8(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@@ -674,10 +626,6 @@ entity9(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@@ -695,10 +643,6 @@ entity10(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ENTITY_NONE;
@@ -716,10 +660,6 @@ notation0(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NOTATION_NONE;
@@ -761,10 +701,6 @@ notation2(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NOTATION_NONE;
@@ -782,10 +718,6 @@ notation3(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NOTATION_NONE;
@@ -804,10 +736,6 @@ notation4(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NOTATION_NONE;
@@ -829,10 +757,6 @@ attlist0(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@@ -851,10 +775,6 @@ attlist1(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@@ -917,10 +837,6 @@ attlist3(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@@ -940,10 +856,6 @@ attlist4(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@@ -964,10 +876,6 @@ attlist5(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@@ -985,10 +893,6 @@ attlist6(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@@ -1006,10 +910,6 @@ attlist7(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@@ -1071,10 +971,6 @@ attlist9(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ATTLIST_NONE;
@@ -1092,10 +988,6 @@ element0(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@@ -1184,10 +1076,6 @@ element3(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@@ -1213,10 +1101,6 @@ element4(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@@ -1235,10 +1119,6 @@ element5(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@@ -1260,10 +1140,6 @@ element6(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@@ -1294,10 +1170,6 @@ element7(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_ELEMENT_NONE;
@@ -1372,10 +1244,6 @@ condSect1(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NONE;
@@ -1394,10 +1262,6 @@ condSect2(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return XML_ROLE_NONE;
@@ -1417,10 +1281,6 @@ declClose(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)ptr;
- (void)end;
- (void)enc;
-
switch (tok) {
case XML_TOK_PROLOG_S:
return state->role_none;
@@ -1438,12 +1298,6 @@ error(PROLOG_STATE *state,
const char *end,
const ENCODING *enc)
{
- (void)state;
- (void)tok;
- (void)ptr;
- (void)end;
- (void)enc;
-
return XML_ROLE_NONE;
}
diff --git a/lib/expat/xmltok.c b/lib/expat/xmltok.c
index c23b348eb..bf09dfc72 100644
--- a/lib/expat/xmltok.c
+++ b/lib/expat/xmltok.c
@@ -8,7 +8,7 @@
#include "winconfig.h"
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
-#elif defined(__amigaos4__)
+#elif defined(__amigaos__)
#include "amigaconfig.h"
#elif defined(__WATCOMC__)
#include "watcomconfig.h"
@@ -124,25 +124,18 @@
static int PTRFASTCALL
isNever(const ENCODING *enc, const char *p)
{
- (void)enc;
- (void)p;
-
return 0;
}
static int PTRFASTCALL
utf8_isName2(const ENCODING *enc, const char *p)
{
- (void)enc;
-
return UTF8_GET_NAMING2(namePages, (const unsigned char *)p);
}
static int PTRFASTCALL
utf8_isName3(const ENCODING *enc, const char *p)
{
- (void)enc;
-
return UTF8_GET_NAMING3(namePages, (const unsigned char *)p);
}
@@ -151,16 +144,12 @@ utf8_isName3(const ENCODING *enc, const char *p)
static int PTRFASTCALL
utf8_isNmstrt2(const ENCODING *enc, const char *p)
{
- (void)enc;
-
return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p);
}
static int PTRFASTCALL
utf8_isNmstrt3(const ENCODING *enc, const char *p)
{
- (void)enc;
-
return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p);
}
@@ -169,24 +158,18 @@ utf8_isNmstrt3(const ENCODING *enc, const char *p)
static int PTRFASTCALL
utf8_isInvalid2(const ENCODING *enc, const char *p)
{
- (void)enc;
-
return UTF8_INVALID2((const unsigned char *)p);
}
static int PTRFASTCALL
utf8_isInvalid3(const ENCODING *enc, const char *p)
{
- (void)enc;
-
return UTF8_INVALID3((const unsigned char *)p);
}
static int PTRFASTCALL
utf8_isInvalid4(const ENCODING *enc, const char *p)
{
- (void)enc;
-
return UTF8_INVALID4((const unsigned char *)p);
}
@@ -253,7 +236,7 @@ static int FASTCALL checkCharRefNumber(int);
#define MINBPC(enc) ((enc)->minBytesPerChar)
#else
/* minimum bytes per character */
-#define MINBPC(enc) (((int)(enc) & 0) + 1)
+#define MINBPC(enc) 1
#endif
#define SB_BYTE_TYPE(enc, p) \
@@ -296,8 +279,8 @@ sb_byteToAscii(const ENCODING *enc, const char *p)
#define IS_NMSTRT_CHAR_MINBPC(enc, p) \
(AS_NORMAL_ENCODING(enc)->isNmstrtMin(enc, p))
#else
-#define IS_NAME_CHAR_MINBPC(enc, p) ((int)(enc) & 0)
-#define IS_NMSTRT_CHAR_MINBPC(enc, p) ((int)(enc) & 0)
+#define IS_NAME_CHAR_MINBPC(enc, p) (0)
+#define IS_NMSTRT_CHAR_MINBPC(enc, p) (0)
#endif
#ifdef XML_MIN_SIZE
@@ -342,9 +325,6 @@ utf8_toUtf8(const ENCODING *enc,
{
char *to;
const char *from;
-
- (void)enc;
-
if (fromLim - *fromP > toLim - *toP) {
/* Avoid copying partial characters. */
for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--)
@@ -450,8 +430,6 @@ latin1_toUtf8(const ENCODING *enc,
const char **fromP, const char *fromLim,
char **toP, const char *toLim)
{
- (void)enc;
-
for (;;) {
unsigned char c;
if (*fromP == fromLim)
@@ -477,8 +455,6 @@ latin1_toUtf16(const ENCODING *enc,
const char **fromP, const char *fromLim,
unsigned short **toP, const unsigned short *toLim)
{
- (void)enc;
-
while (*fromP != fromLim && *toP != toLim)
*(*toP)++ = (unsigned char)*(*fromP)++;
}
@@ -512,8 +488,6 @@ ascii_toUtf8(const ENCODING *enc,
const char **fromP, const char *fromLim,
char **toP, const char *toLim)
{
- (void)enc;
-
while (*fromP != fromLim && *toP != toLim)
*(*toP)++ = *(*fromP)++;
}
@@ -568,9 +542,6 @@ E ## toUtf8(const ENCODING *enc, \
char **toP, const char *toLim) \
{ \
const char *from; \
- \
- (void)enc; \
- \
for (from = *fromP; from != fromLim; from += 2) { \
int plane; \
unsigned char lo2; \
@@ -612,7 +583,7 @@ E ## toUtf8(const ENCODING *enc, \
return; \
} \
plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \
- *(*toP)++ = (((char)((plane >> 2) & 0xff)) | UTF8_cval4); \
+ *(*toP)++ = ((plane >> 2) | UTF8_cval4); \
*(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \
from += 2; \
lo2 = GET_LO(from); \
@@ -633,8 +604,6 @@ E ## toUtf16(const ENCODING *enc, \
const char **fromP, const char *fromLim, \
unsigned short **toP, const unsigned short *toLim) \
{ \
- (void)enc; \
- \
/* Avoid copying first half only of surrogate */ \
if (fromLim - *fromP > ((toLim - *toP) << 1) \
&& (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \
@@ -717,14 +686,14 @@ little2_isNmstrtMin(const ENCODING *enc, const char *p)
#undef PREFIX
#define PREFIX(ident) little2_ ## ident
-#define MINBPC(enc) (((int)(enc) & 0) + 2)
+#define MINBPC(enc) 2
/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */
#define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p)
#define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p)
#define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c)
-#define IS_NAME_CHAR(enc, p, n) ((int)(enc) & 0)
+#define IS_NAME_CHAR(enc, p, n) 0
#define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p)
-#define IS_NMSTRT_CHAR(enc, p, n) ((int)(enc) & 0)
+#define IS_NMSTRT_CHAR(enc, p, n) (0)
#define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p)
#define XML_TOK_IMPL_C
@@ -858,14 +827,14 @@ big2_isNmstrtMin(const ENCODING *enc, const char *p)
#undef PREFIX
#define PREFIX(ident) big2_ ## ident
-#define MINBPC(enc) (((int)(enc) & 0) + 2)
+#define MINBPC(enc) 2
/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */
#define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p)
#define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p)
#define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c)
-#define IS_NAME_CHAR(enc, p, n) ((int)(enc) & 0)
+#define IS_NAME_CHAR(enc, p, n) 0
#define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p)
-#define IS_NMSTRT_CHAR(enc, p, n) ((int)(enc) & 0)
+#define IS_NMSTRT_CHAR(enc, p, n) (0)
#define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p)
#define XML_TOK_IMPL_C
@@ -972,8 +941,6 @@ static void PTRCALL
initUpdatePosition(const ENCODING *enc, const char *ptr,
const char *end, POSITION *pos)
{
- (void)enc;
-
normal_updatePosition(&utf8_encoding.enc, ptr, end, pos);
}
@@ -1378,7 +1345,7 @@ unknown_toUtf16(const ENCODING *enc,
ENCODING *
XmlInitUnknownEncoding(void *mem,
int *table,
- CONVERTER convert,
+ CONVERTER convert,
void *userData)
{
int i;
@@ -1672,7 +1639,7 @@ initScan(const ENCODING * const *encodingTable,
ENCODING *
XmlInitUnknownEncodingNS(void *mem,
int *table,
- CONVERTER convert,
+ CONVERTER convert,
void *userData)
{
ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData);
diff --git a/lib/expat/xmltok_impl.c b/lib/expat/xmltok_impl.c
index 5fa578a43..9c2895b87 100644
--- a/lib/expat/xmltok_impl.c
+++ b/lib/expat/xmltok_impl.c
@@ -6,7 +6,7 @@
#ifdef XML_TOK_IMPL_C
#ifndef IS_INVALID_CHAR
-#define IS_INVALID_CHAR(enc, ptr, n) ((int)(enc) & 0)
+#define IS_INVALID_CHAR(enc, ptr, n) (0)
#endif
#define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \
@@ -179,9 +179,6 @@ PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr,
const char *end, int *tokPtr)
{
int upper = 0;
-
- (void)enc;
-
*tokPtr = XML_TOK_PI;
if (end - ptr != MINBPC(enc)*3)
return 1;
@@ -291,9 +288,6 @@ PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr,
static const char CDATA_LSQB[] = { ASCII_C, ASCII_D, ASCII_A,
ASCII_T, ASCII_A, ASCII_LSQB };
int i;
-
- (void)enc;
-
/* CDATA[ */
if (end - ptr < 6 * MINBPC(enc))
return XML_TOK_PARTIAL;
@@ -891,7 +885,7 @@ PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
if (ptr == end)
- return -XML_TOK_PERCENT;
+ return XML_TOK_PARTIAL;
switch (BYTE_TYPE(enc, ptr)) {
CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
case BT_S: case BT_LF: case BT_CR: case BT_PERCNT:
@@ -1530,9 +1524,6 @@ static int PTRFASTCALL
PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr)
{
int result = 0;
-
- (void)enc;
-
/* skip &# */
ptr += 2*MINBPC(enc);
if (CHAR_MATCHES(enc, ptr, ASCII_x)) {
@@ -1577,8 +1568,6 @@ static int PTRCALL
PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr,
const char *end)
{
- (void)enc;
-
switch ((end - ptr)/MINBPC(enc)) {
case 2:
if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_t)) {
@@ -1697,8 +1686,6 @@ static int PTRCALL
PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1,
const char *end1, const char *ptr2)
{
- (void)enc;
-
for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) {
if (ptr1 == end1)
return 0;
@@ -1757,7 +1744,7 @@ PREFIX(updatePosition)(const ENCODING *enc,
const char *end,
POSITION *pos)
{
- while (ptr != end) {
+ while (ptr < end) {
switch (BYTE_TYPE(enc, ptr)) {
#define LEAD_CASE(n) \
case BT_LEAD ## n: \
@@ -1793,8 +1780,4 @@ PREFIX(updatePosition)(const ENCODING *enc,
#undef CHECK_NMSTRT_CASE
#undef CHECK_NMSTRT_CASES
-#else /* XML_TOK_IMPL_C */
-
-int xml_tok_impl_c;
-
#endif /* XML_TOK_IMPL_C */
diff --git a/lib/expat/xmltok_ns.c b/lib/expat/xmltok_ns.c
index 5afdfbe5c..c3b88fdf4 100644
--- a/lib/expat/xmltok_ns.c
+++ b/lib/expat/xmltok_ns.c
@@ -112,8 +112,4 @@ NS(XmlParseXmlDecl)(int isGeneralTextEntity,
standalone);
}
-#else /* XML_TOK_NS_C */
-
-int xml_tok_ns_c;
-
#endif /* XML_TOK_NS_C */
diff --git a/lib/jsoncpp b/lib/jsoncpp
new file mode 160000
+Subproject 81cf237917b6873decd27e15b7fe8473003a276
diff --git a/lib/jsoncpp/CMakeLists.txt b/lib/jsoncpp/CMakeLists.txt
deleted file mode 100644
index 6c678f6a6..000000000
--- a/lib/jsoncpp/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-
-cmake_minimum_required (VERSION 2.6)
-project (jsoncpp)
-
-include_directories ("${PROJECT_SOURCE_DIR}/../../src/")
-
-file(GLOB SOURCE
- "src/lib_json/*.h"
- "src/lib_json/*.cpp"
-)
-
-
-add_library(jsoncpp ${SOURCE})
diff --git a/lib/jsoncpp/include/json/autolink.h b/lib/jsoncpp/include/json/autolink.h
deleted file mode 100644
index 37c9258ed..000000000
--- a/lib/jsoncpp/include/json/autolink.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef JSON_AUTOLINK_H_INCLUDED
-# define JSON_AUTOLINK_H_INCLUDED
-
-# include "config.h"
-
-# ifdef JSON_IN_CPPTL
-# include <cpptl/cpptl_autolink.h>
-# endif
-
-# if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && !defined(JSON_IN_CPPTL)
-# define CPPTL_AUTOLINK_NAME "json"
-# undef CPPTL_AUTOLINK_DLL
-# ifdef JSON_DLL
-# define CPPTL_AUTOLINK_DLL
-# endif
-# include "autolink.h"
-# endif
-
-#endif // JSON_AUTOLINK_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/config.h b/lib/jsoncpp/include/json/config.h
deleted file mode 100644
index 5d334cbc5..000000000
--- a/lib/jsoncpp/include/json/config.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef JSON_CONFIG_H_INCLUDED
-# define JSON_CONFIG_H_INCLUDED
-
-/// If defined, indicates that json library is embedded in CppTL library.
-//# define JSON_IN_CPPTL 1
-
-/// If defined, indicates that json may leverage CppTL library
-//# define JSON_USE_CPPTL 1
-/// If defined, indicates that cpptl vector based map should be used instead of std::map
-/// as Value container.
-//# define JSON_USE_CPPTL_SMALLMAP 1
-/// If defined, indicates that Json specific container should be used
-/// (hash table & simple deque container with customizable allocator).
-/// THIS FEATURE IS STILL EXPERIMENTAL!
-//# define JSON_VALUE_USE_INTERNAL_MAP 1
-/// Force usage of standard new/malloc based allocator instead of memory pool based allocator.
-/// The memory pools allocator used optimization (initializing Value and ValueInternalLink
-/// as if it was a POD) that may cause some validation tool to report errors.
-/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined.
-//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1
-
-/// If defined, indicates that Json use exception to report invalid type manipulation
-/// instead of C assert macro.
-# define JSON_USE_EXCEPTION 1
-
-# ifdef JSON_IN_CPPTL
-# include <cpptl/config.h>
-# ifndef JSON_USE_CPPTL
-# define JSON_USE_CPPTL 1
-# endif
-# endif
-
-# ifdef JSON_IN_CPPTL
-# define JSON_API CPPTL_API
-# elif defined(JSON_DLL_BUILD)
-# define JSON_API __declspec(dllexport)
-# elif defined(JSON_DLL)
-# define JSON_API __declspec(dllimport)
-# else
-# define JSON_API
-# endif
-
-#endif // JSON_CONFIG_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/features.h b/lib/jsoncpp/include/json/features.h
deleted file mode 100644
index 5a9adec11..000000000
--- a/lib/jsoncpp/include/json/features.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
-# define CPPTL_JSON_FEATURES_H_INCLUDED
-
-# include "forwards.h"
-
-namespace Json {
-
- /** \brief Configuration passed to reader and writer.
- * This configuration object can be used to force the Reader or Writer
- * to behave in a standard conforming way.
- */
- class JSON_API Features
- {
- public:
- /** \brief A configuration that allows all features and assumes all strings are UTF-8.
- * - C & C++ comments are allowed
- * - Root object can be any JSON value
- * - Assumes Value strings are encoded in UTF-8
- */
- static Features all();
-
- /** \brief A configuration that is strictly compatible with the JSON specification.
- * - Comments are forbidden.
- * - Root object must be either an array or an object value.
- * - Assumes Value strings are encoded in UTF-8
- */
- static Features strictMode();
-
- /** \brief Initialize the configuration like JsonConfig::allFeatures;
- */
- Features();
-
- /// \c true if comments are allowed. Default: \c true.
- bool allowComments_;
-
- /// \c true if root must be either an array or an object value. Default: \c false.
- bool strictRoot_;
- };
-
-} // namespace Json
-
-#endif // CPPTL_JSON_FEATURES_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/forwards.h b/lib/jsoncpp/include/json/forwards.h
deleted file mode 100644
index d0ce8300c..000000000
--- a/lib/jsoncpp/include/json/forwards.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef JSON_FORWARDS_H_INCLUDED
-# define JSON_FORWARDS_H_INCLUDED
-
-# include "config.h"
-
-namespace Json {
-
- // writer.h
- class FastWriter;
- class StyledWriter;
-
- // reader.h
- class Reader;
-
- // features.h
- class Features;
-
- // value.h
- typedef int Int;
- typedef unsigned int UInt;
- class StaticString;
- class Path;
- class PathArgument;
- class Value;
- class ValueIteratorBase;
- class ValueIterator;
- class ValueConstIterator;
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- class ValueAllocator;
- class ValueMapAllocator;
- class ValueInternalLink;
- class ValueInternalArray;
- class ValueInternalMap;
-#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
-
-} // namespace Json
-
-
-#endif // JSON_FORWARDS_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/json.h b/lib/jsoncpp/include/json/json.h
deleted file mode 100644
index c71ed65ab..000000000
--- a/lib/jsoncpp/include/json/json.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef JSON_JSON_H_INCLUDED
-# define JSON_JSON_H_INCLUDED
-
-# include "autolink.h"
-# include "value.h"
-# include "reader.h"
-# include "writer.h"
-# include "features.h"
-
-#endif // JSON_JSON_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/reader.h b/lib/jsoncpp/include/json/reader.h
deleted file mode 100644
index ee1d6a244..000000000
--- a/lib/jsoncpp/include/json/reader.h
+++ /dev/null
@@ -1,196 +0,0 @@
-#ifndef CPPTL_JSON_READER_H_INCLUDED
-# define CPPTL_JSON_READER_H_INCLUDED
-
-# include "features.h"
-# include "value.h"
-# include <deque>
-# include <stack>
-# include <string>
-# include <iostream>
-
-namespace Json {
-
- /** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a Value.
- *
- */
- class JSON_API Reader
- {
- public:
- typedef char Char;
- typedef const Char *Location;
-
- /** \brief Constructs a Reader allowing all features
- * for parsing.
- */
- Reader();
-
- /** \brief Constructs a Reader allowing the specified feature set
- * for parsing.
- */
- Reader( const Features &features );
-
- /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a> document.
- * \param document UTF-8 encoded string containing the document to read.
- * \param root [out] Contains the root value of the document if it was
- * successfully parsed.
- * \param collectComments \c true to collect comment and allow writing them back during
- * serialization, \c false to discard comments.
- * This parameter is ignored if Features::allowComments_
- * is \c false.
- * \return \c true if the document was successfully parsed, \c false if an error occurred.
- */
- bool parse( const std::string &document,
- Value &root,
- bool collectComments = true );
-
- /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a> document.
- * \param document UTF-8 encoded string containing the document to read.
- * \param root [out] Contains the root value of the document if it was
- * successfully parsed.
- * \param collectComments \c true to collect comment and allow writing them back during
- * serialization, \c false to discard comments.
- * This parameter is ignored if Features::allowComments_
- * is \c false.
- * \return \c true if the document was successfully parsed, \c false if an error occurred.
- */
- bool parse( const char *beginDoc, const char *endDoc,
- Value &root,
- bool collectComments = true );
-
- /// \brief Parse from input stream.
- /// \see Json::operator>>(std::istream&, Json::Value&).
- bool parse( std::istream &is,
- Value &root,
- bool collectComments = true );
-
- /** \brief Returns a user friendly string that list errors in the parsed document.
- * \return Formatted error message with the list of errors with their location in
- * the parsed document. An empty string is returned if no error occurred
- * during parsing.
- */
- std::string getFormatedErrorMessages() const;
-
- private:
- enum TokenType
- {
- tokenEndOfStream = 0,
- tokenObjectBegin,
- tokenObjectEnd,
- tokenArrayBegin,
- tokenArrayEnd,
- tokenString,
- tokenNumber,
- tokenTrue,
- tokenFalse,
- tokenNull,
- tokenArraySeparator,
- tokenMemberSeparator,
- tokenComment,
- tokenError
- };
-
- class Token
- {
- public:
- TokenType type_;
- Location start_;
- Location end_;
- };
-
- class ErrorInfo
- {
- public:
- Token token_;
- std::string message_;
- Location extra_;
- };
-
- typedef std::deque<ErrorInfo> Errors;
-
- bool expectToken( TokenType type, Token &token, const char *message );
- bool readToken( Token &token );
- void skipSpaces();
- bool match( Location pattern,
- int patternLength );
- bool readComment();
- bool readCStyleComment();
- bool readCppStyleComment();
- bool readString();
- void readNumber();
- bool readValue();
- bool readObject( Token &token );
- bool readArray( Token &token );
- bool decodeNumber( Token &token );
- bool decodeString( Token &token );
- bool decodeString( Token &token, std::string &decoded );
- bool decodeDouble( Token &token );
- bool decodeUnicodeCodePoint( Token &token,
- Location &current,
- Location end,
- unsigned int &unicode );
- bool decodeUnicodeEscapeSequence( Token &token,
- Location &current,
- Location end,
- unsigned int &unicode );
- bool addError( const std::string &message,
- Token &token,
- Location extra = 0 );
- bool recoverFromError( TokenType skipUntilToken );
- bool addErrorAndRecover( const std::string &message,
- Token &token,
- TokenType skipUntilToken );
- void skipUntilSpace();
- Value &currentValue();
- Char getNextChar();
- void getLocationLineAndColumn( Location location,
- int &line,
- int &column ) const;
- std::string getLocationLineAndColumn( Location location ) const;
- void addComment( Location begin,
- Location end,
- CommentPlacement placement );
- void skipCommentTokens( Token &token );
-
- typedef std::stack<Value *> Nodes;
- Nodes nodes_;
- Errors errors_;
- std::string document_;
- Location begin_;
- Location end_;
- Location current_;
- Location lastValueEnd_;
- Value *lastValue_;
- std::string commentsBefore_;
- Features features_;
- bool collectComments_;
- };
-
- /** \brief Read from 'sin' into 'root'.
-
- Always keep comments from the input JSON.
-
- This can be used to read a file into a particular sub-object.
- For example:
- \code
- Json::Value root;
- cin >> root["dir"]["file"];
- cout << root;
- \endcode
- Result:
- \verbatim
- {
- "dir": {
- "file": {
- // The input stream JSON would be nested here.
- }
- }
- }
- \endverbatim
- \throw std::exception on parse error.
- \see Json::operator<<()
- */
- std::istream& operator>>( std::istream&, Value& );
-
-} // namespace Json
-
-#endif // CPPTL_JSON_READER_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/value.h b/lib/jsoncpp/include/json/value.h
deleted file mode 100644
index 58bfd88e7..000000000
--- a/lib/jsoncpp/include/json/value.h
+++ /dev/null
@@ -1,1069 +0,0 @@
-#ifndef CPPTL_JSON_H_INCLUDED
-# define CPPTL_JSON_H_INCLUDED
-
-# include "forwards.h"
-# include <string>
-# include <vector>
-
-# ifndef JSON_USE_CPPTL_SMALLMAP
-# include <map>
-# else
-# include <cpptl/smallmap.h>
-# endif
-# ifdef JSON_USE_CPPTL
-# include <cpptl/forwards.h>
-# endif
-
-/** \brief JSON (JavaScript Object Notation).
- */
-namespace Json {
-
- /** \brief Type of the value held by a Value object.
- */
- enum ValueType
- {
- nullValue = 0, ///< 'null' value
- intValue, ///< signed integer value
- uintValue, ///< unsigned integer value
- realValue, ///< double value
- stringValue, ///< UTF-8 string value
- booleanValue, ///< bool value
- arrayValue, ///< array value (ordered list)
- objectValue ///< object value (collection of name/value pairs).
- };
-
- enum CommentPlacement
- {
- commentBefore = 0, ///< a comment placed on the line before a value
- commentAfterOnSameLine, ///< a comment just after a value on the same line
- commentAfter, ///< a comment on the line after a value (only make sense for root value)
- numberOfCommentPlacement
- };
-
-//# ifdef JSON_USE_CPPTL
-// typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
-// typedef CppTL::AnyEnumerator<const Value &> EnumValues;
-//# endif
-
- /** \brief Lightweight wrapper to tag static string.
- *
- * Value constructor and objectValue member assignement takes advantage of the
- * StaticString and avoid the cost of string duplication when storing the
- * string or the member name.
- *
- * Example of usage:
- * \code
- * Json::Value aValue( StaticString("some text") );
- * Json::Value object;
- * static const StaticString code("code");
- * object[code] = 1234;
- * \endcode
- */
- class JSON_API StaticString
- {
- public:
- explicit StaticString( const char *czstring )
- : str_( czstring )
- {
- }
-
- operator const char *() const
- {
- return str_;
- }
-
- const char *c_str() const
- {
- return str_;
- }
-
- private:
- const char *str_;
- };
-
- /** \brief Represents a <a HREF="http://www.json.org">JSON</a> value.
- *
- * This class is a discriminated union wrapper that can represents a:
- * - signed integer [range: Value::minInt - Value::maxInt]
- * - unsigned integer (range: 0 - Value::maxUInt)
- * - double
- * - UTF-8 string
- * - boolean
- * - 'null'
- * - an ordered list of Value
- * - collection of name/value pairs (javascript object)
- *
- * The type of the held value is represented by a #ValueType and
- * can be obtained using type().
- *
- * values of an #objectValue or #arrayValue can be accessed using operator[]() methods.
- * Non const methods will automatically create the a #nullValue element
- * if it does not exist.
- * The sequence of an #arrayValue will be automatically resize and initialized
- * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue.
- *
- * The get() methods can be used to obtanis default value in the case the required element
- * does not exist.
- *
- * It is possible to iterate over the list of a #objectValue values using
- * the getMemberNames() method.
- */
- class JSON_API Value
- {
- friend class ValueIteratorBase;
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- friend class ValueInternalLink;
- friend class ValueInternalMap;
-# endif
- public:
- typedef std::vector<std::string> Members;
- typedef ValueIterator iterator;
- typedef ValueConstIterator const_iterator;
- typedef Json::UInt UInt;
- typedef Json::Int Int;
- typedef UInt ArrayIndex;
-
- static const Value null;
- static const Int minInt;
- static const Int maxInt;
- static const UInt maxUInt;
-
- private:
-#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-# ifndef JSON_VALUE_USE_INTERNAL_MAP
- class CZString
- {
- public:
- enum DuplicationPolicy
- {
- noDuplication = 0,
- duplicate,
- duplicateOnCopy
- };
- CZString( int index );
- CZString( const char *cstr, DuplicationPolicy allocate );
- CZString( const CZString &other );
- ~CZString();
- CZString &operator =( const CZString &other );
- bool operator<( const CZString &other ) const;
- bool operator==( const CZString &other ) const;
- int index() const;
- const char *c_str() const;
- bool isStaticString() const;
- private:
- void swap( CZString &other );
- const char *cstr_;
- int index_;
- };
-
- public:
-# ifndef JSON_USE_CPPTL_SMALLMAP
- typedef std::map<CZString, Value> ObjectValues;
-# else
- typedef CppTL::SmallMap<CZString, Value> ObjectValues;
-# endif // ifndef JSON_USE_CPPTL_SMALLMAP
-# endif // ifndef JSON_VALUE_USE_INTERNAL_MAP
-#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
- public:
- /** \brief Create a default Value of the given type.
-
- This is a very useful constructor.
- To create an empty array, pass arrayValue.
- To create an empty object, pass objectValue.
- Another Value can then be set to this one by assignment.
- This is useful since clear() and resize() will not alter types.
-
- Examples:
- \code
- Json::Value null_value; // null
- Json::Value arr_value(Json::arrayValue); // []
- Json::Value obj_value(Json::objectValue); // {}
- \endcode
- */
- Value( ValueType type = nullValue );
- Value( Int value );
- Value( UInt value );
- Value( double value );
- Value( const char *value );
- Value( const char *beginValue, const char *endValue );
- /** \brief Constructs a value from a static string.
-
- * Like other value string constructor but do not duplicate the string for
- * internal storage. The given string must remain alive after the call to this
- * constructor.
- * Example of usage:
- * \code
- * Json::Value aValue( StaticString("some text") );
- * \endcode
- */
- Value( const StaticString &value );
- Value( const std::string &value );
-# ifdef JSON_USE_CPPTL
- Value( const CppTL::ConstString &value );
-# endif
- Value( bool value );
- Value( const Value &other );
- ~Value();
-
- Value &operator=( const Value &other );
- /// Swap values.
- /// \note Currently, comments are intentionally not swapped, for
- /// both logic and efficiency.
- void swap( Value &other );
-
- ValueType type() const;
-
- bool operator <( const Value &other ) const;
- bool operator <=( const Value &other ) const;
- bool operator >=( const Value &other ) const;
- bool operator >( const Value &other ) const;
-
- bool operator ==( const Value &other ) const;
- bool operator !=( const Value &other ) const;
-
- int compare( const Value &other );
-
- const char *asCString() const;
- std::string asString() const;
-# ifdef JSON_USE_CPPTL
- CppTL::ConstString asConstString() const;
-# endif
- Int asInt() const;
- UInt asUInt() const;
- double asDouble() const;
- bool asBool() const;
-
- bool isNull() const;
- bool isBool() const;
- bool isInt() const;
- bool isUInt() const;
- bool isIntegral() const;
- bool isDouble() const;
- bool isNumeric() const;
- bool isString() const;
- bool isArray() const;
- bool isObject() const;
-
- bool isConvertibleTo( ValueType other ) const;
-
- /// Number of values in array or object
- UInt size() const;
-
- /// \brief Return true if empty array, empty object, or null;
- /// otherwise, false.
- bool empty() const;
-
- /// Return isNull()
- bool operator!() const;
-
- /// Remove all object members and array elements.
- /// \pre type() is arrayValue, objectValue, or nullValue
- /// \post type() is unchanged
- void clear();
-
- /// Resize the array to size elements.
- /// New elements are initialized to null.
- /// May only be called on nullValue or arrayValue.
- /// \pre type() is arrayValue or nullValue
- /// \post type() is arrayValue
- void resize( UInt size );
-
- /// Access an array element (zero based index ).
- /// If the array contains less than index element, then null value are inserted
- /// in the array so that its size is index+1.
- /// (You may need to say 'value[0u]' to get your compiler to distinguish
- /// this from the operator[] which takes a string.)
- Value &operator[]( UInt index );
- /// Access an array element (zero based index )
- /// (You may need to say 'value[0u]' to get your compiler to distinguish
- /// this from the operator[] which takes a string.)
- const Value &operator[]( UInt index ) const;
- /// If the array contains at least index+1 elements, returns the element value,
- /// otherwise returns defaultValue.
- Value get( UInt index,
- const Value &defaultValue ) const;
- /// Return true if index < size().
- bool isValidIndex( UInt index ) const;
- /// \brief Append value to array at the end.
- ///
- /// Equivalent to jsonvalue[jsonvalue.size()] = value;
- Value &append( const Value &value );
-
- /// Access an object value by name, create a null member if it does not exist.
- Value &operator[]( const char *key );
- /// Access an object value by name, returns null if there is no member with that name.
- const Value &operator[]( const char *key ) const;
- /// Access an object value by name, create a null member if it does not exist.
- Value &operator[]( const std::string &key );
- /// Access an object value by name, returns null if there is no member with that name.
- const Value &operator[]( const std::string &key ) const;
- /** \brief Access an object value by name, create a null member if it does not exist.
-
- * If the object as no entry for that name, then the member name used to store
- * the new entry is not duplicated.
- * Example of use:
- * \code
- * Json::Value object;
- * static const StaticString code("code");
- * object[code] = 1234;
- * \endcode
- */
- Value &operator[]( const StaticString &key );
-# ifdef JSON_USE_CPPTL
- /// Access an object value by name, create a null member if it does not exist.
- Value &operator[]( const CppTL::ConstString &key );
- /// Access an object value by name, returns null if there is no member with that name.
- const Value &operator[]( const CppTL::ConstString &key ) const;
-# endif
- /// Return the member named key if it exist, defaultValue otherwise.
- Value get( const char *key,
- const Value &defaultValue ) const;
- /// Return the member named key if it exist, defaultValue otherwise.
- Value get( const std::string &key,
- const Value &defaultValue ) const;
-# ifdef JSON_USE_CPPTL
- /// Return the member named key if it exist, defaultValue otherwise.
- Value get( const CppTL::ConstString &key,
- const Value &defaultValue ) const;
-# endif
- /// \brief Remove and return the named member.
- ///
- /// Do nothing if it did not exist.
- /// \return the removed Value, or null.
- /// \pre type() is objectValue or nullValue
- /// \post type() is unchanged
- Value removeMember( const char* key );
- /// Same as removeMember(const char*)
- Value removeMember( const std::string &key );
-
- /// Return true if the object has a member named key.
- bool isMember( const char *key ) const;
- /// Return true if the object has a member named key.
- bool isMember( const std::string &key ) const;
-# ifdef JSON_USE_CPPTL
- /// Return true if the object has a member named key.
- bool isMember( const CppTL::ConstString &key ) const;
-# endif
-
- /// \brief Return a list of the member names.
- ///
- /// If null, return an empty list.
- /// \pre type() is objectValue or nullValue
- /// \post if type() was nullValue, it remains nullValue
- Members getMemberNames() const;
-
-//# ifdef JSON_USE_CPPTL
-// EnumMemberNames enumMemberNames() const;
-// EnumValues enumValues() const;
-//# endif
-
- /// Comments must be //... or /* ... */
- void setComment( const char *comment,
- CommentPlacement placement );
- /// Comments must be //... or /* ... */
- void setComment( const std::string &comment,
- CommentPlacement placement );
- bool hasComment( CommentPlacement placement ) const;
- /// Include delimiters and embedded newlines.
- std::string getComment( CommentPlacement placement ) const;
-
- std::string toStyledString() const;
-
- const_iterator begin() const;
- const_iterator end() const;
-
- iterator begin();
- iterator end();
-
- private:
- Value &resolveReference( const char *key,
- bool isStatic );
-
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- inline bool isItemAvailable() const
- {
- return itemIsUsed_ == 0;
- }
-
- inline void setItemUsed( bool isUsed = true )
- {
- itemIsUsed_ = isUsed ? 1 : 0;
- }
-
- inline bool isMemberNameStatic() const
- {
- return memberNameIsStatic_ == 0;
- }
-
- inline void setMemberNameIsStatic( bool isStatic )
- {
- memberNameIsStatic_ = isStatic ? 1 : 0;
- }
-# endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP
-
- private:
- struct CommentInfo
- {
- CommentInfo();
- ~CommentInfo();
-
- void setComment( const char *text );
-
- char *comment_;
- };
-
- //struct MemberNamesTransform
- //{
- // typedef const char *result_type;
- // const char *operator()( const CZString &name ) const
- // {
- // return name.c_str();
- // }
- //};
-
- union ValueHolder
- {
- Int int_;
- UInt uint_;
- double real_;
- bool bool_;
- char *string_;
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- ValueInternalArray *array_;
- ValueInternalMap *map_;
-#else
- ObjectValues *map_;
-# endif
- } value_;
- ValueType type_ : 8;
- int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container.
- int memberNameIsStatic_ : 1; // used by the ValueInternalMap container.
-# endif
- CommentInfo *comments_;
- };
-
-
- /** \brief Experimental and untested: represents an element of the "path" to access a node.
- */
- class PathArgument
- {
- public:
- friend class Path;
-
- PathArgument();
- PathArgument( UInt index );
- PathArgument( const char *key );
- PathArgument( const std::string &key );
-
- private:
- enum Kind
- {
- kindNone = 0,
- kindIndex,
- kindKey
- };
- std::string key_;
- UInt index_;
- Kind kind_;
- };
-
- /** \brief Experimental and untested: represents a "path" to access a node.
- *
- * Syntax:
- * - "." => root node
- * - ".[n]" => elements at index 'n' of root node (an array value)
- * - ".name" => member named 'name' of root node (an object value)
- * - ".name1.name2.name3"
- * - ".[0][1][2].name1[3]"
- * - ".%" => member name is provided as parameter
- * - ".[%]" => index is provied as parameter
- */
- class Path
- {
- public:
- Path( const std::string &path,
- const PathArgument &a1 = PathArgument(),
- const PathArgument &a2 = PathArgument(),
- const PathArgument &a3 = PathArgument(),
- const PathArgument &a4 = PathArgument(),
- const PathArgument &a5 = PathArgument() );
-
- const Value &resolve( const Value &root ) const;
- Value resolve( const Value &root,
- const Value &defaultValue ) const;
- /// Creates the "path" to access the specified node and returns a reference on the node.
- Value &make( Value &root ) const;
-
- private:
- typedef std::vector<const PathArgument *> InArgs;
- typedef std::vector<PathArgument> Args;
-
- void makePath( const std::string &path,
- const InArgs &in );
- void addPathInArg( const std::string &path,
- const InArgs &in,
- InArgs::const_iterator &itInArg,
- PathArgument::Kind kind );
- void invalidPath( const std::string &path,
- int location );
-
- Args args_;
- };
-
- /** \brief Experimental do not use: Allocator to customize member name and string value memory management done by Value.
- *
- * - makeMemberName() and releaseMemberName() are called to respectively duplicate and
- * free an Json::objectValue member name.
- * - duplicateStringValue() and releaseStringValue() are called similarly to
- * duplicate and free a Json::stringValue value.
- */
- class ValueAllocator
- {
- public:
- enum { unknown = (unsigned)-1 };
-
- virtual ~ValueAllocator();
-
- virtual char *makeMemberName( const char *memberName ) = 0;
- virtual void releaseMemberName( char *memberName ) = 0;
- virtual char *duplicateStringValue( const char *value,
- unsigned int length = unknown ) = 0;
- virtual void releaseStringValue( char *value ) = 0;
- };
-
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- /** \brief Allocator to customize Value internal map.
- * Below is an example of a simple implementation (default implementation actually
- * use memory pool for speed).
- * \code
- class DefaultValueMapAllocator : public ValueMapAllocator
- {
- public: // overridden from ValueMapAllocator
- virtual ValueInternalMap *newMap()
- {
- return new ValueInternalMap();
- }
-
- virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )
- {
- return new ValueInternalMap( other );
- }
-
- virtual void destructMap( ValueInternalMap *map )
- {
- delete map;
- }
-
- virtual ValueInternalLink *allocateMapBuckets( unsigned int size )
- {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets( ValueInternalLink *links )
- {
- delete [] links;
- }
-
- virtual ValueInternalLink *allocateMapLink()
- {
- return new ValueInternalLink();
- }
-
- virtual void releaseMapLink( ValueInternalLink *link )
- {
- delete link;
- }
- };
- * \endcode
- */
- class JSON_API ValueMapAllocator
- {
- public:
- virtual ~ValueMapAllocator();
- virtual ValueInternalMap *newMap() = 0;
- virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) = 0;
- virtual void destructMap( ValueInternalMap *map ) = 0;
- virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) = 0;
- virtual void releaseMapBuckets( ValueInternalLink *links ) = 0;
- virtual ValueInternalLink *allocateMapLink() = 0;
- virtual void releaseMapLink( ValueInternalLink *link ) = 0;
- };
-
- /** \brief ValueInternalMap hash-map bucket chain link (for internal use only).
- * \internal previous_ & next_ allows for bidirectional traversal.
- */
- class JSON_API ValueInternalLink
- {
- public:
- enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture.
- enum InternalFlags {
- flagAvailable = 0,
- flagUsed = 1
- };
-
- ValueInternalLink();
-
- ~ValueInternalLink();
-
- Value items_[itemPerLink];
- char *keys_[itemPerLink];
- ValueInternalLink *previous_;
- ValueInternalLink *next_;
- };
-
-
- /** \brief A linked page based hash-table implementation used internally by Value.
- * \internal ValueInternalMap is a tradional bucket based hash-table, with a linked
- * list in each bucket to handle collision. There is an addional twist in that
- * each node of the collision linked list is a page containing a fixed amount of
- * value. This provides a better compromise between memory usage and speed.
- *
- * Each bucket is made up of a chained list of ValueInternalLink. The last
- * link of a given bucket can be found in the 'previous_' field of the following bucket.
- * The last link of the last bucket is stored in tailLink_ as it has no following bucket.
- * Only the last link of a bucket may contains 'available' item. The last link always
- * contains at least one element unless is it the bucket one very first link.
- */
- class JSON_API ValueInternalMap
- {
- friend class ValueIteratorBase;
- friend class Value;
- public:
- typedef unsigned int HashKey;
- typedef unsigned int BucketIndex;
-
-# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
- struct IteratorState
- {
- IteratorState()
- : map_(0)
- , link_(0)
- , itemIndex_(0)
- , bucketIndex_(0)
- {
- }
- ValueInternalMap *map_;
- ValueInternalLink *link_;
- BucketIndex itemIndex_;
- BucketIndex bucketIndex_;
- };
-# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
- ValueInternalMap();
- ValueInternalMap( const ValueInternalMap &other );
- ValueInternalMap &operator =( const ValueInternalMap &other );
- ~ValueInternalMap();
-
- void swap( ValueInternalMap &other );
-
- BucketIndex size() const;
-
- void clear();
-
- bool reserveDelta( BucketIndex growth );
-
- bool reserve( BucketIndex newItemCount );
-
- const Value *find( const char *key ) const;
-
- Value *find( const char *key );
-
- Value &resolveReference( const char *key,
- bool isStatic );
-
- void remove( const char *key );
-
- void doActualRemove( ValueInternalLink *link,
- BucketIndex index,
- BucketIndex bucketIndex );
-
- ValueInternalLink *&getLastLinkInBucket( BucketIndex bucketIndex );
-
- Value &setNewItem( const char *key,
- bool isStatic,
- ValueInternalLink *link,
- BucketIndex index );
-
- Value &unsafeAdd( const char *key,
- bool isStatic,
- HashKey hashedKey );
-
- HashKey hash( const char *key ) const;
-
- int compare( const ValueInternalMap &other ) const;
-
- private:
- void makeBeginIterator( IteratorState &it ) const;
- void makeEndIterator( IteratorState &it ) const;
- static bool equals( const IteratorState &x, const IteratorState &other );
- static void increment( IteratorState &iterator );
- static void incrementBucket( IteratorState &iterator );
- static void decrement( IteratorState &iterator );
- static const char *key( const IteratorState &iterator );
- static const char *key( const IteratorState &iterator, bool &isStatic );
- static Value &value( const IteratorState &iterator );
- static int distance( const IteratorState &x, const IteratorState &y );
-
- private:
- ValueInternalLink *buckets_;
- ValueInternalLink *tailLink_;
- BucketIndex bucketsSize_;
- BucketIndex itemCount_;
- };
-
- /** \brief A simplified deque implementation used internally by Value.
- * \internal
- * It is based on a list of fixed "page", each page contains a fixed number of items.
- * Instead of using a linked-list, a array of pointer is used for fast item look-up.
- * Look-up for an element is as follow:
- * - compute page index: pageIndex = itemIndex / itemsPerPage
- * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage]
- *
- * Insertion is amortized constant time (only the array containing the index of pointers
- * need to be reallocated when items are appended).
- */
- class JSON_API ValueInternalArray
- {
- friend class Value;
- friend class ValueIteratorBase;
- public:
- enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo.
- typedef Value::ArrayIndex ArrayIndex;
- typedef unsigned int PageIndex;
-
-# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
- struct IteratorState // Must be a POD
- {
- IteratorState()
- : array_(0)
- , currentPageIndex_(0)
- , currentItemIndex_(0)
- {
- }
- ValueInternalArray *array_;
- Value **currentPageIndex_;
- unsigned int currentItemIndex_;
- };
-# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
- ValueInternalArray();
- ValueInternalArray( const ValueInternalArray &other );
- ValueInternalArray &operator =( const ValueInternalArray &other );
- ~ValueInternalArray();
- void swap( ValueInternalArray &other );
-
- void clear();
- void resize( ArrayIndex newSize );
-
- Value &resolveReference( ArrayIndex index );
-
- Value *find( ArrayIndex index ) const;
-
- ArrayIndex size() const;
-
- int compare( const ValueInternalArray &other ) const;
-
- private:
- static bool equals( const IteratorState &x, const IteratorState &other );
- static void increment( IteratorState &iterator );
- static void decrement( IteratorState &iterator );
- static Value &dereference( const IteratorState &iterator );
- static Value &unsafeDereference( const IteratorState &iterator );
- static int distance( const IteratorState &x, const IteratorState &y );
- static ArrayIndex indexOf( const IteratorState &iterator );
- void makeBeginIterator( IteratorState &it ) const;
- void makeEndIterator( IteratorState &it ) const;
- void makeIterator( IteratorState &it, ArrayIndex index ) const;
-
- void makeIndexValid( ArrayIndex index );
-
- Value **pages_;
- ArrayIndex size_;
- PageIndex pageCount_;
- };
-
- /** \brief Experimental: do not use. Allocator to customize Value internal array.
- * Below is an example of a simple implementation (actual implementation use
- * memory pool).
- \code
-class DefaultValueArrayAllocator : public ValueArrayAllocator
-{
-public: // overridden from ValueArrayAllocator
- virtual ~DefaultValueArrayAllocator()
- {
- }
-
- virtual ValueInternalArray *newArray()
- {
- return new ValueInternalArray();
- }
-
- virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )
- {
- return new ValueInternalArray( other );
- }
-
- virtual void destruct( ValueInternalArray *array )
- {
- delete array;
- }
-
- virtual void reallocateArrayPageIndex( Value **&indexes,
- ValueInternalArray::PageIndex &indexCount,
- ValueInternalArray::PageIndex minNewIndexCount )
- {
- ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;
- if ( minNewIndexCount > newIndexCount )
- newIndexCount = minNewIndexCount;
- void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );
- if ( !newIndexes )
- throw std::bad_alloc();
- indexCount = newIndexCount;
- indexes = static_cast<Value **>( newIndexes );
- }
- virtual void releaseArrayPageIndex( Value **indexes,
- ValueInternalArray::PageIndex indexCount )
- {
- if ( indexes )
- free( indexes );
- }
-
- virtual Value *allocateArrayPage()
- {
- return static_cast<Value *>( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) );
- }
-
- virtual void releaseArrayPage( Value *value )
- {
- if ( value )
- free( value );
- }
-};
- \endcode
- */
- class JSON_API ValueArrayAllocator
- {
- public:
- virtual ~ValueArrayAllocator();
- virtual ValueInternalArray *newArray() = 0;
- virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) = 0;
- virtual void destructArray( ValueInternalArray *array ) = 0;
- /** \brief Reallocate array page index.
- * Reallocates an array of pointer on each page.
- * \param indexes [input] pointer on the current index. May be \c NULL.
- * [output] pointer on the new index of at least
- * \a minNewIndexCount pages.
- * \param indexCount [input] current number of pages in the index.
- * [output] number of page the reallocated index can handle.
- * \b MUST be >= \a minNewIndexCount.
- * \param minNewIndexCount Minimum number of page the new index must be able to
- * handle.
- */
- virtual void reallocateArrayPageIndex( Value **&indexes,
- ValueInternalArray::PageIndex &indexCount,
- ValueInternalArray::PageIndex minNewIndexCount ) = 0;
- virtual void releaseArrayPageIndex( Value **indexes,
- ValueInternalArray::PageIndex indexCount ) = 0;
- virtual Value *allocateArrayPage() = 0;
- virtual void releaseArrayPage( Value *value ) = 0;
- };
-#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
-
-
- /** \brief base class for Value iterators.
- *
- */
- class ValueIteratorBase
- {
- public:
- typedef unsigned int size_t;
- typedef int difference_type;
- typedef ValueIteratorBase SelfType;
-
- ValueIteratorBase();
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- explicit ValueIteratorBase( const Value::ObjectValues::iterator &current );
-#else
- ValueIteratorBase( const ValueInternalArray::IteratorState &state );
- ValueIteratorBase( const ValueInternalMap::IteratorState &state );
-#endif
-
- bool operator ==( const SelfType &other ) const
- {
- return isEqual( other );
- }
-
- bool operator !=( const SelfType &other ) const
- {
- return !isEqual( other );
- }
-
- difference_type operator -( const SelfType &other ) const
- {
- return computeDistance( other );
- }
-
- /// Return either the index or the member name of the referenced value as a Value.
- Value key() const;
-
- /// Return the index of the referenced Value. -1 if it is not an arrayValue.
- UInt index() const;
-
- /// Return the member name of the referenced Value. "" if it is not an objectValue.
- const char *memberName() const;
-
- protected:
- Value &deref() const;
-
- void increment();
-
- void decrement();
-
- difference_type computeDistance( const SelfType &other ) const;
-
- bool isEqual( const SelfType &other ) const;
-
- void copy( const SelfType &other );
-
- private:
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- Value::ObjectValues::iterator current_;
- // Indicates that iterator is for a null value.
- bool isNull_;
-#else
- union
- {
- ValueInternalArray::IteratorState array_;
- ValueInternalMap::IteratorState map_;
- } iterator_;
- bool isArray_;
-#endif
- };
-
- /** \brief const iterator for object and array value.
- *
- */
- class ValueConstIterator : public ValueIteratorBase
- {
- friend class Value;
- public:
- typedef unsigned int size_t;
- typedef int difference_type;
- typedef const Value &reference;
- typedef const Value *pointer;
- typedef ValueConstIterator SelfType;
-
- ValueConstIterator();
- private:
- /*! \internal Use by Value to create an iterator.
- */
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- explicit ValueConstIterator( const Value::ObjectValues::iterator &current );
-#else
- ValueConstIterator( const ValueInternalArray::IteratorState &state );
- ValueConstIterator( const ValueInternalMap::IteratorState &state );
-#endif
- public:
- SelfType &operator =( const ValueIteratorBase &other );
-
- SelfType operator++( int )
- {
- SelfType temp( *this );
- ++*this;
- return temp;
- }
-
- SelfType operator--( int )
- {
- SelfType temp( *this );
- --*this;
- return temp;
- }
-
- SelfType &operator--()
- {
- decrement();
- return *this;
- }
-
- SelfType &operator++()
- {
- increment();
- return *this;
- }
-
- reference operator *() const
- {
- return deref();
- }
- };
-
-
- /** \brief Iterator for object and array value.
- */
- class ValueIterator : public ValueIteratorBase
- {
- friend class Value;
- public:
- typedef unsigned int size_t;
- typedef int difference_type;
- typedef Value &reference;
- typedef Value *pointer;
- typedef ValueIterator SelfType;
-
- ValueIterator();
- ValueIterator( const ValueConstIterator &other );
- ValueIterator( const ValueIterator &other );
- private:
- /*! \internal Use by Value to create an iterator.
- */
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- explicit ValueIterator( const Value::ObjectValues::iterator &current );
-#else
- ValueIterator( const ValueInternalArray::IteratorState &state );
- ValueIterator( const ValueInternalMap::IteratorState &state );
-#endif
- public:
-
- SelfType &operator =( const SelfType &other );
-
- SelfType operator++( int )
- {
- SelfType temp( *this );
- ++*this;
- return temp;
- }
-
- SelfType operator--( int )
- {
- SelfType temp( *this );
- --*this;
- return temp;
- }
-
- SelfType &operator--()
- {
- decrement();
- return *this;
- }
-
- SelfType &operator++()
- {
- increment();
- return *this;
- }
-
- reference operator *() const
- {
- return deref();
- }
- };
-
-
-} // namespace Json
-
-
-#endif // CPPTL_JSON_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/writer.h b/lib/jsoncpp/include/json/writer.h
deleted file mode 100644
index 5f4b83be4..000000000
--- a/lib/jsoncpp/include/json/writer.h
+++ /dev/null
@@ -1,174 +0,0 @@
-#ifndef JSON_WRITER_H_INCLUDED
-# define JSON_WRITER_H_INCLUDED
-
-# include "value.h"
-# include <vector>
-# include <string>
-# include <iostream>
-
-namespace Json {
-
- class Value;
-
- /** \brief Abstract class for writers.
- */
- class JSON_API Writer
- {
- public:
- virtual ~Writer();
-
- virtual std::string write( const Value &root ) = 0;
- };
-
- /** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format without formatting (not human friendly).
- *
- * The JSON document is written in a single line. It is not intended for 'human' consumption,
- * but may be usefull to support feature such as RPC where bandwith is limited.
- * \sa Reader, Value
- */
- class JSON_API FastWriter : public Writer
- {
- public:
- FastWriter();
- virtual ~FastWriter(){}
-
- void enableYAMLCompatibility();
-
- public: // overridden from Writer
- virtual std::string write( const Value &root );
-
- private:
- void writeValue( const Value &value );
-
- std::string document_;
- bool yamlCompatiblityEnabled_;
- };
-
- /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a human friendly way.
- *
- * The rules for line break and indent are as follow:
- * - Object value:
- * - if empty then print {} without indent and line break
- * - if not empty the print '{', line break & indent, print one value per line
- * and then unindent and line break and print '}'.
- * - Array value:
- * - if empty then print [] without indent and line break
- * - if the array contains no object value, empty array or some other value types,
- * and all the values fit on one lines, then print the array on a single line.
- * - otherwise, it the values do not fit on one line, or the array contains
- * object or non empty array, then print one value per line.
- *
- * If the Value have comments then they are outputed according to their #CommentPlacement.
- *
- * \sa Reader, Value, Value::setComment()
- */
- class JSON_API StyledWriter: public Writer
- {
- public:
- StyledWriter();
- virtual ~StyledWriter(){}
-
- public: // overridden from Writer
- /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
- * \param root Value to serialize.
- * \return String containing the JSON document that represents the root value.
- */
- virtual std::string write( const Value &root );
-
- private:
- void writeValue( const Value &value );
- void writeArrayValue( const Value &value );
- bool isMultineArray( const Value &value );
- void pushValue( const std::string &value );
- void writeIndent();
- void writeWithIndent( const std::string &value );
- void indent();
- void unindent();
- void writeCommentBeforeValue( const Value &root );
- void writeCommentAfterValueOnSameLine( const Value &root );
- bool hasCommentForValue( const Value &value );
- static std::string normalizeEOL( const std::string &text );
-
- typedef std::vector<std::string> ChildValues;
-
- ChildValues childValues_;
- std::string document_;
- std::string indentString_;
- int rightMargin_;
- int indentSize_;
- bool addChildValues_;
- };
-
- /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a human friendly way,
- to a stream rather than to a string.
- *
- * The rules for line break and indent are as follow:
- * - Object value:
- * - if empty then print {} without indent and line break
- * - if not empty the print '{', line break & indent, print one value per line
- * and then unindent and line break and print '}'.
- * - Array value:
- * - if empty then print [] without indent and line break
- * - if the array contains no object value, empty array or some other value types,
- * and all the values fit on one lines, then print the array on a single line.
- * - otherwise, it the values do not fit on one line, or the array contains
- * object or non empty array, then print one value per line.
- *
- * If the Value have comments then they are outputed according to their #CommentPlacement.
- *
- * \param indentation Each level will be indented by this amount extra.
- * \sa Reader, Value, Value::setComment()
- */
- class JSON_API StyledStreamWriter
- {
- public:
- StyledStreamWriter( std::string indentation="\t" );
- ~StyledStreamWriter(){}
-
- public:
- /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
- * \param out Stream to write to. (Can be ostringstream, e.g.)
- * \param root Value to serialize.
- * \note There is no point in deriving from Writer, since write() should not return a value.
- */
- void write( std::ostream &out, const Value &root );
-
- private:
- void writeValue( const Value &value );
- void writeArrayValue( const Value &value );
- bool isMultineArray( const Value &value );
- void pushValue( const std::string &value );
- void writeIndent();
- void writeWithIndent( const std::string &value );
- void indent();
- void unindent();
- void writeCommentBeforeValue( const Value &root );
- void writeCommentAfterValueOnSameLine( const Value &root );
- bool hasCommentForValue( const Value &value );
- static std::string normalizeEOL( const std::string &text );
-
- typedef std::vector<std::string> ChildValues;
-
- ChildValues childValues_;
- std::ostream* document_;
- std::string indentString_;
- int rightMargin_;
- std::string indentation_;
- bool addChildValues_;
- };
-
- std::string JSON_API valueToString( Int value );
- std::string JSON_API valueToString( UInt value );
- std::string JSON_API valueToString( double value );
- std::string JSON_API valueToString( bool value );
- std::string JSON_API valueToQuotedString( const char *value );
-
- /// \brief Output using the StyledStreamWriter.
- /// \see Json::operator>>()
- std::ostream& operator<<( std::ostream&, const Value &root );
-
-} // namespace Json
-
-
-
-#endif // JSON_WRITER_H_INCLUDED
diff --git a/lib/jsoncpp/src/lib_json/json_batchallocator.h b/lib/jsoncpp/src/lib_json/json_batchallocator.h
deleted file mode 100644
index 87ea5ed80..000000000
--- a/lib/jsoncpp/src/lib_json/json_batchallocator.h
+++ /dev/null
@@ -1,125 +0,0 @@
-#ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED
-# define JSONCPP_BATCHALLOCATOR_H_INCLUDED
-
-# include <stdlib.h>
-# include <assert.h>
-
-# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
-namespace Json {
-
-/* Fast memory allocator.
- *
- * This memory allocator allocates memory for a batch of object (specified by
- * the page size, the number of object in each page).
- *
- * It does not allow the destruction of a single object. All the allocated objects
- * can be destroyed at once. The memory can be either released or reused for future
- * allocation.
- *
- * The in-place new operator must be used to construct the object using the pointer
- * returned by allocate.
- */
-template<typename AllocatedType
- ,const unsigned int objectPerAllocation>
-class BatchAllocator
-{
-public:
- typedef AllocatedType Type;
-
- BatchAllocator( unsigned int objectsPerPage = 255 )
- : freeHead_( 0 )
- , objectsPerPage_( objectsPerPage )
- {
-// printf( "Size: %d => %s\n", sizeof(AllocatedType), typeid(AllocatedType).name() );
- assert( sizeof(AllocatedType) * objectPerAllocation >= sizeof(AllocatedType *) ); // We must be able to store a slist in the object free space.
- assert( objectsPerPage >= 16 );
- batches_ = allocateBatch( 0 ); // allocated a dummy page
- currentBatch_ = batches_;
- }
-
- ~BatchAllocator()
- {
- for ( BatchInfo *batch = batches_; batch; )
- {
- BatchInfo *nextBatch = batch->next_;
- free( batch );
- batch = nextBatch;
- }
- }
-
- /// allocate space for an array of objectPerAllocation object.
- /// @warning it is the responsability of the caller to call objects constructors.
- AllocatedType *allocate()
- {
- if ( freeHead_ ) // returns node from free list.
- {
- AllocatedType *object = freeHead_;
- freeHead_ = *(AllocatedType **)object;
- return object;
- }
- if ( currentBatch_->used_ == currentBatch_->end_ )
- {
- currentBatch_ = currentBatch_->next_;
- while ( currentBatch_ && currentBatch_->used_ == currentBatch_->end_ )
- currentBatch_ = currentBatch_->next_;
-
- if ( !currentBatch_ ) // no free batch found, allocate a new one
- {
- currentBatch_ = allocateBatch( objectsPerPage_ );
- currentBatch_->next_ = batches_; // insert at the head of the list
- batches_ = currentBatch_;
- }
- }
- AllocatedType *allocated = currentBatch_->used_;
- currentBatch_->used_ += objectPerAllocation;
- return allocated;
- }
-
- /// Release the object.
- /// @warning it is the responsability of the caller to actually destruct the object.
- void release( AllocatedType *object )
- {
- assert( object != 0 );
- *(AllocatedType **)object = freeHead_;
- freeHead_ = object;
- }
-
-private:
- struct BatchInfo
- {
- BatchInfo *next_;
- AllocatedType *used_;
- AllocatedType *end_;
- AllocatedType buffer_[objectPerAllocation];
- };
-
- // disabled copy constructor and assignement operator.
- BatchAllocator( const BatchAllocator & );
- void operator =( const BatchAllocator &);
-
- static BatchInfo *allocateBatch( unsigned int objectsPerPage )
- {
- const unsigned int mallocSize = sizeof(BatchInfo) - sizeof(AllocatedType)* objectPerAllocation
- + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage;
- BatchInfo *batch = static_cast<BatchInfo*>( malloc( mallocSize ) );
- batch->next_ = 0;
- batch->used_ = batch->buffer_;
- batch->end_ = batch->buffer_ + objectsPerPage;
- return batch;
- }
-
- BatchInfo *batches_;
- BatchInfo *currentBatch_;
- /// Head of a single linked list within the allocated space of freeed object
- AllocatedType *freeHead_;
- unsigned int objectsPerPage_;
-};
-
-
-} // namespace Json
-
-# endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION
-
-#endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED
-
diff --git a/lib/jsoncpp/src/lib_json/json_internalarray.inl b/lib/jsoncpp/src/lib_json/json_internalarray.inl
deleted file mode 100644
index 9b985d258..000000000
--- a/lib/jsoncpp/src/lib_json/json_internalarray.inl
+++ /dev/null
@@ -1,448 +0,0 @@
-// included by json_value.cpp
-// everything is within Json namespace
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalArray
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueArrayAllocator::~ValueArrayAllocator()
-{
-}
-
-// //////////////////////////////////////////////////////////////////
-// class DefaultValueArrayAllocator
-// //////////////////////////////////////////////////////////////////
-#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-class DefaultValueArrayAllocator : public ValueArrayAllocator
-{
-public: // overridden from ValueArrayAllocator
- virtual ~DefaultValueArrayAllocator()
- {
- }
-
- virtual ValueInternalArray *newArray()
- {
- return new ValueInternalArray();
- }
-
- virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )
- {
- return new ValueInternalArray( other );
- }
-
- virtual void destructArray( ValueInternalArray *array )
- {
- delete array;
- }
-
- virtual void reallocateArrayPageIndex( Value **&indexes,
- ValueInternalArray::PageIndex &indexCount,
- ValueInternalArray::PageIndex minNewIndexCount )
- {
- ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;
- if ( minNewIndexCount > newIndexCount )
- newIndexCount = minNewIndexCount;
- void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );
- if ( !newIndexes )
- throw std::bad_alloc();
- indexCount = newIndexCount;
- indexes = static_cast<Value **>( newIndexes );
- }
- virtual void releaseArrayPageIndex( Value **indexes,
- ValueInternalArray::PageIndex indexCount )
- {
- if ( indexes )
- free( indexes );
- }
-
- virtual Value *allocateArrayPage()
- {
- return static_cast<Value *>( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) );
- }
-
- virtual void releaseArrayPage( Value *value )
- {
- if ( value )
- free( value );
- }
-};
-
-#else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-/// @todo make this thread-safe (lock when accessign batch allocator)
-class DefaultValueArrayAllocator : public ValueArrayAllocator
-{
-public: // overridden from ValueArrayAllocator
- virtual ~DefaultValueArrayAllocator()
- {
- }
-
- virtual ValueInternalArray *newArray()
- {
- ValueInternalArray *array = arraysAllocator_.allocate();
- new (array) ValueInternalArray(); // placement new
- return array;
- }
-
- virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )
- {
- ValueInternalArray *array = arraysAllocator_.allocate();
- new (array) ValueInternalArray( other ); // placement new
- return array;
- }
-
- virtual void destructArray( ValueInternalArray *array )
- {
- if ( array )
- {
- array->~ValueInternalArray();
- arraysAllocator_.release( array );
- }
- }
-
- virtual void reallocateArrayPageIndex( Value **&indexes,
- ValueInternalArray::PageIndex &indexCount,
- ValueInternalArray::PageIndex minNewIndexCount )
- {
- ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;
- if ( minNewIndexCount > newIndexCount )
- newIndexCount = minNewIndexCount;
- void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );
- if ( !newIndexes )
- throw std::bad_alloc();
- indexCount = newIndexCount;
- indexes = static_cast<Value **>( newIndexes );
- }
- virtual void releaseArrayPageIndex( Value **indexes,
- ValueInternalArray::PageIndex indexCount )
- {
- if ( indexes )
- free( indexes );
- }
-
- virtual Value *allocateArrayPage()
- {
- return static_cast<Value *>( pagesAllocator_.allocate() );
- }
-
- virtual void releaseArrayPage( Value *value )
- {
- if ( value )
- pagesAllocator_.release( value );
- }
-private:
- BatchAllocator<ValueInternalArray,1> arraysAllocator_;
- BatchAllocator<Value,ValueInternalArray::itemsPerPage> pagesAllocator_;
-};
-#endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-
-static ValueArrayAllocator *&arrayAllocator()
-{
- static DefaultValueArrayAllocator defaultAllocator;
- static ValueArrayAllocator *arrayAllocator = &defaultAllocator;
- return arrayAllocator;
-}
-
-static struct DummyArrayAllocatorInitializer {
- DummyArrayAllocatorInitializer()
- {
- arrayAllocator(); // ensure arrayAllocator() statics are initialized before main().
- }
-} dummyArrayAllocatorInitializer;
-
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalArray
-// //////////////////////////////////////////////////////////////////
-bool
-ValueInternalArray::equals( const IteratorState &x,
- const IteratorState &other )
-{
- return x.array_ == other.array_
- && x.currentItemIndex_ == other.currentItemIndex_
- && x.currentPageIndex_ == other.currentPageIndex_;
-}
-
-
-void
-ValueInternalArray::increment( IteratorState &it )
-{
- JSON_ASSERT_MESSAGE( it.array_ &&
- (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_
- != it.array_->size_,
- "ValueInternalArray::increment(): moving iterator beyond end" );
- ++(it.currentItemIndex_);
- if ( it.currentItemIndex_ == itemsPerPage )
- {
- it.currentItemIndex_ = 0;
- ++(it.currentPageIndex_);
- }
-}
-
-
-void
-ValueInternalArray::decrement( IteratorState &it )
-{
- JSON_ASSERT_MESSAGE( it.array_ && it.currentPageIndex_ == it.array_->pages_
- && it.currentItemIndex_ == 0,
- "ValueInternalArray::decrement(): moving iterator beyond end" );
- if ( it.currentItemIndex_ == 0 )
- {
- it.currentItemIndex_ = itemsPerPage-1;
- --(it.currentPageIndex_);
- }
- else
- {
- --(it.currentItemIndex_);
- }
-}
-
-
-Value &
-ValueInternalArray::unsafeDereference( const IteratorState &it )
-{
- return (*(it.currentPageIndex_))[it.currentItemIndex_];
-}
-
-
-Value &
-ValueInternalArray::dereference( const IteratorState &it )
-{
- JSON_ASSERT_MESSAGE( it.array_ &&
- (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_
- < it.array_->size_,
- "ValueInternalArray::dereference(): dereferencing invalid iterator" );
- return unsafeDereference( it );
-}
-
-void
-ValueInternalArray::makeBeginIterator( IteratorState &it ) const
-{
- it.array_ = const_cast<ValueInternalArray *>( this );
- it.currentItemIndex_ = 0;
- it.currentPageIndex_ = pages_;
-}
-
-
-void
-ValueInternalArray::makeIterator( IteratorState &it, ArrayIndex index ) const
-{
- it.array_ = const_cast<ValueInternalArray *>( this );
- it.currentItemIndex_ = index % itemsPerPage;
- it.currentPageIndex_ = pages_ + index / itemsPerPage;
-}
-
-
-void
-ValueInternalArray::makeEndIterator( IteratorState &it ) const
-{
- makeIterator( it, size_ );
-}
-
-
-ValueInternalArray::ValueInternalArray()
- : pages_( 0 )
- , size_( 0 )
- , pageCount_( 0 )
-{
-}
-
-
-ValueInternalArray::ValueInternalArray( const ValueInternalArray &other )
- : pages_( 0 )
- , pageCount_( 0 )
- , size_( other.size_ )
-{
- PageIndex minNewPages = other.size_ / itemsPerPage;
- arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages );
- JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages,
- "ValueInternalArray::reserve(): bad reallocation" );
- IteratorState itOther;
- other.makeBeginIterator( itOther );
- Value *value;
- for ( ArrayIndex index = 0; index < size_; ++index, increment(itOther) )
- {
- if ( index % itemsPerPage == 0 )
- {
- PageIndex pageIndex = index / itemsPerPage;
- value = arrayAllocator()->allocateArrayPage();
- pages_[pageIndex] = value;
- }
- new (value) Value( dereference( itOther ) );
- }
-}
-
-
-ValueInternalArray &
-ValueInternalArray::operator =( const ValueInternalArray &other )
-{
- ValueInternalArray temp( other );
- swap( temp );
- return *this;
-}
-
-
-ValueInternalArray::~ValueInternalArray()
-{
- // destroy all constructed items
- IteratorState it;
- IteratorState itEnd;
- makeBeginIterator( it);
- makeEndIterator( itEnd );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- Value *value = &dereference(it);
- value->~Value();
- }
- // release all pages
- PageIndex lastPageIndex = size_ / itemsPerPage;
- for ( PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex )
- arrayAllocator()->releaseArrayPage( pages_[pageIndex] );
- // release pages index
- arrayAllocator()->releaseArrayPageIndex( pages_, pageCount_ );
-}
-
-
-void
-ValueInternalArray::swap( ValueInternalArray &other )
-{
- Value **tempPages = pages_;
- pages_ = other.pages_;
- other.pages_ = tempPages;
- ArrayIndex tempSize = size_;
- size_ = other.size_;
- other.size_ = tempSize;
- PageIndex tempPageCount = pageCount_;
- pageCount_ = other.pageCount_;
- other.pageCount_ = tempPageCount;
-}
-
-void
-ValueInternalArray::clear()
-{
- ValueInternalArray dummy;
- swap( dummy );
-}
-
-
-void
-ValueInternalArray::resize( ArrayIndex newSize )
-{
- if ( newSize == 0 )
- clear();
- else if ( newSize < size_ )
- {
- IteratorState it;
- IteratorState itEnd;
- makeIterator( it, newSize );
- makeIterator( itEnd, size_ );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- Value *value = &dereference(it);
- value->~Value();
- }
- PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage;
- PageIndex lastPageIndex = size_ / itemsPerPage;
- for ( ; pageIndex < lastPageIndex; ++pageIndex )
- arrayAllocator()->releaseArrayPage( pages_[pageIndex] );
- size_ = newSize;
- }
- else if ( newSize > size_ )
- resolveReference( newSize );
-}
-
-
-void
-ValueInternalArray::makeIndexValid( ArrayIndex index )
-{
- // Need to enlarge page index ?
- if ( index >= pageCount_ * itemsPerPage )
- {
- PageIndex minNewPages = (index + 1) / itemsPerPage;
- arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages );
- JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" );
- }
-
- // Need to allocate new pages ?
- ArrayIndex nextPageIndex =
- (size_ % itemsPerPage) != 0 ? size_ - (size_%itemsPerPage) + itemsPerPage
- : size_;
- if ( nextPageIndex <= index )
- {
- PageIndex pageIndex = nextPageIndex / itemsPerPage;
- PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1;
- for ( ; pageToAllocate-- > 0; ++pageIndex )
- pages_[pageIndex] = arrayAllocator()->allocateArrayPage();
- }
-
- // Initialize all new entries
- IteratorState it;
- IteratorState itEnd;
- makeIterator( it, size_ );
- size_ = index + 1;
- makeIterator( itEnd, size_ );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- Value *value = &dereference(it);
- new (value) Value(); // Construct a default value using placement new
- }
-}
-
-Value &
-ValueInternalArray::resolveReference( ArrayIndex index )
-{
- if ( index >= size_ )
- makeIndexValid( index );
- return pages_[index/itemsPerPage][index%itemsPerPage];
-}
-
-Value *
-ValueInternalArray::find( ArrayIndex index ) const
-{
- if ( index >= size_ )
- return 0;
- return &(pages_[index/itemsPerPage][index%itemsPerPage]);
-}
-
-ValueInternalArray::ArrayIndex
-ValueInternalArray::size() const
-{
- return size_;
-}
-
-int
-ValueInternalArray::distance( const IteratorState &x, const IteratorState &y )
-{
- return indexOf(y) - indexOf(x);
-}
-
-
-ValueInternalArray::ArrayIndex
-ValueInternalArray::indexOf( const IteratorState &iterator )
-{
- if ( !iterator.array_ )
- return ArrayIndex(-1);
- return ArrayIndex(
- (iterator.currentPageIndex_ - iterator.array_->pages_) * itemsPerPage
- + iterator.currentItemIndex_ );
-}
-
-
-int
-ValueInternalArray::compare( const ValueInternalArray &other ) const
-{
- int sizeDiff( size_ - other.size_ );
- if ( sizeDiff != 0 )
- return sizeDiff;
-
- for ( ArrayIndex index =0; index < size_; ++index )
- {
- int diff = pages_[index/itemsPerPage][index%itemsPerPage].compare(
- other.pages_[index/itemsPerPage][index%itemsPerPage] );
- if ( diff != 0 )
- return diff;
- }
- return 0;
-}
diff --git a/lib/jsoncpp/src/lib_json/json_internalmap.inl b/lib/jsoncpp/src/lib_json/json_internalmap.inl
deleted file mode 100644
index 19771488d..000000000
--- a/lib/jsoncpp/src/lib_json/json_internalmap.inl
+++ /dev/null
@@ -1,607 +0,0 @@
-// included by json_value.cpp
-// everything is within Json namespace
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalMap
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-/** \internal MUST be safely initialized using memset( this, 0, sizeof(ValueInternalLink) );
- * This optimization is used by the fast allocator.
- */
-ValueInternalLink::ValueInternalLink()
- : previous_( 0 )
- , next_( 0 )
-{
-}
-
-ValueInternalLink::~ValueInternalLink()
-{
- for ( int index =0; index < itemPerLink; ++index )
- {
- if ( !items_[index].isItemAvailable() )
- {
- if ( !items_[index].isMemberNameStatic() )
- free( keys_[index] );
- }
- else
- break;
- }
-}
-
-
-
-ValueMapAllocator::~ValueMapAllocator()
-{
-}
-
-#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-class DefaultValueMapAllocator : public ValueMapAllocator
-{
-public: // overridden from ValueMapAllocator
- virtual ValueInternalMap *newMap()
- {
- return new ValueInternalMap();
- }
-
- virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )
- {
- return new ValueInternalMap( other );
- }
-
- virtual void destructMap( ValueInternalMap *map )
- {
- delete map;
- }
-
- virtual ValueInternalLink *allocateMapBuckets( unsigned int size )
- {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets( ValueInternalLink *links )
- {
- delete [] links;
- }
-
- virtual ValueInternalLink *allocateMapLink()
- {
- return new ValueInternalLink();
- }
-
- virtual void releaseMapLink( ValueInternalLink *link )
- {
- delete link;
- }
-};
-#else
-/// @todo make this thread-safe (lock when accessign batch allocator)
-class DefaultValueMapAllocator : public ValueMapAllocator
-{
-public: // overridden from ValueMapAllocator
- virtual ValueInternalMap *newMap()
- {
- ValueInternalMap *map = mapsAllocator_.allocate();
- new (map) ValueInternalMap(); // placement new
- return map;
- }
-
- virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )
- {
- ValueInternalMap *map = mapsAllocator_.allocate();
- new (map) ValueInternalMap( other ); // placement new
- return map;
- }
-
- virtual void destructMap( ValueInternalMap *map )
- {
- if ( map )
- {
- map->~ValueInternalMap();
- mapsAllocator_.release( map );
- }
- }
-
- virtual ValueInternalLink *allocateMapBuckets( unsigned int size )
- {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets( ValueInternalLink *links )
- {
- delete [] links;
- }
-
- virtual ValueInternalLink *allocateMapLink()
- {
- ValueInternalLink *link = linksAllocator_.allocate();
- memset( link, 0, sizeof(ValueInternalLink) );
- return link;
- }
-
- virtual void releaseMapLink( ValueInternalLink *link )
- {
- link->~ValueInternalLink();
- linksAllocator_.release( link );
- }
-private:
- BatchAllocator<ValueInternalMap,1> mapsAllocator_;
- BatchAllocator<ValueInternalLink,1> linksAllocator_;
-};
-#endif
-
-static ValueMapAllocator *&mapAllocator()
-{
- static DefaultValueMapAllocator defaultAllocator;
- static ValueMapAllocator *mapAllocator = &defaultAllocator;
- return mapAllocator;
-}
-
-static struct DummyMapAllocatorInitializer {
- DummyMapAllocatorInitializer()
- {
- mapAllocator(); // ensure mapAllocator() statics are initialized before main().
- }
-} dummyMapAllocatorInitializer;
-
-
-
-// h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32.
-
-/*
-use linked list hash map.
-buckets array is a container.
-linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124)
-value have extra state: valid, available, deleted
-*/
-
-
-ValueInternalMap::ValueInternalMap()
- : buckets_( 0 )
- , tailLink_( 0 )
- , bucketsSize_( 0 )
- , itemCount_( 0 )
-{
-}
-
-
-ValueInternalMap::ValueInternalMap( const ValueInternalMap &other )
- : buckets_( 0 )
- , tailLink_( 0 )
- , bucketsSize_( 0 )
- , itemCount_( 0 )
-{
- reserve( other.itemCount_ );
- IteratorState it;
- IteratorState itEnd;
- other.makeBeginIterator( it );
- other.makeEndIterator( itEnd );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- bool isStatic;
- const char *memberName = key( it, isStatic );
- const Value &aValue = value( it );
- resolveReference(memberName, isStatic) = aValue;
- }
-}
-
-
-ValueInternalMap &
-ValueInternalMap::operator =( const ValueInternalMap &other )
-{
- ValueInternalMap dummy( other );
- swap( dummy );
- return *this;
-}
-
-
-ValueInternalMap::~ValueInternalMap()
-{
- if ( buckets_ )
- {
- for ( BucketIndex bucketIndex =0; bucketIndex < bucketsSize_; ++bucketIndex )
- {
- ValueInternalLink *link = buckets_[bucketIndex].next_;
- while ( link )
- {
- ValueInternalLink *linkToRelease = link;
- link = link->next_;
- mapAllocator()->releaseMapLink( linkToRelease );
- }
- }
- mapAllocator()->releaseMapBuckets( buckets_ );
- }
-}
-
-
-void
-ValueInternalMap::swap( ValueInternalMap &other )
-{
- ValueInternalLink *tempBuckets = buckets_;
- buckets_ = other.buckets_;
- other.buckets_ = tempBuckets;
- ValueInternalLink *tempTailLink = tailLink_;
- tailLink_ = other.tailLink_;
- other.tailLink_ = tempTailLink;
- BucketIndex tempBucketsSize = bucketsSize_;
- bucketsSize_ = other.bucketsSize_;
- other.bucketsSize_ = tempBucketsSize;
- BucketIndex tempItemCount = itemCount_;
- itemCount_ = other.itemCount_;
- other.itemCount_ = tempItemCount;
-}
-
-
-void
-ValueInternalMap::clear()
-{
- ValueInternalMap dummy;
- swap( dummy );
-}
-
-
-ValueInternalMap::BucketIndex
-ValueInternalMap::size() const
-{
- return itemCount_;
-}
-
-bool
-ValueInternalMap::reserveDelta( BucketIndex growth )
-{
- return reserve( itemCount_ + growth );
-}
-
-bool
-ValueInternalMap::reserve( BucketIndex newItemCount )
-{
- if ( !buckets_ && newItemCount > 0 )
- {
- buckets_ = mapAllocator()->allocateMapBuckets( 1 );
- bucketsSize_ = 1;
- tailLink_ = &buckets_[0];
- }
-// BucketIndex idealBucketCount = (newItemCount + ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink;
- return true;
-}
-
-
-const Value *
-ValueInternalMap::find( const char *key ) const
-{
- if ( !bucketsSize_ )
- return 0;
- HashKey hashedKey = hash( key );
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- for ( const ValueInternalLink *current = &buckets_[bucketIndex];
- current != 0;
- current = current->next_ )
- {
- for ( BucketIndex index=0; index < ValueInternalLink::itemPerLink; ++index )
- {
- if ( current->items_[index].isItemAvailable() )
- return 0;
- if ( strcmp( key, current->keys_[index] ) == 0 )
- return &current->items_[index];
- }
- }
- return 0;
-}
-
-
-Value *
-ValueInternalMap::find( const char *key )
-{
- const ValueInternalMap *constThis = this;
- return const_cast<Value *>( constThis->find( key ) );
-}
-
-
-Value &
-ValueInternalMap::resolveReference( const char *key,
- bool isStatic )
-{
- HashKey hashedKey = hash( key );
- if ( bucketsSize_ )
- {
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- ValueInternalLink **previous = 0;
- BucketIndex index;
- for ( ValueInternalLink *current = &buckets_[bucketIndex];
- current != 0;
- previous = &current->next_, current = current->next_ )
- {
- for ( index=0; index < ValueInternalLink::itemPerLink; ++index )
- {
- if ( current->items_[index].isItemAvailable() )
- return setNewItem( key, isStatic, current, index );
- if ( strcmp( key, current->keys_[index] ) == 0 )
- return current->items_[index];
- }
- }
- }
-
- reserveDelta( 1 );
- return unsafeAdd( key, isStatic, hashedKey );
-}
-
-
-void
-ValueInternalMap::remove( const char *key )
-{
- HashKey hashedKey = hash( key );
- if ( !bucketsSize_ )
- return;
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- for ( ValueInternalLink *link = &buckets_[bucketIndex];
- link != 0;
- link = link->next_ )
- {
- BucketIndex index;
- for ( index =0; index < ValueInternalLink::itemPerLink; ++index )
- {
- if ( link->items_[index].isItemAvailable() )
- return;
- if ( strcmp( key, link->keys_[index] ) == 0 )
- {
- doActualRemove( link, index, bucketIndex );
- return;
- }
- }
- }
-}
-
-void
-ValueInternalMap::doActualRemove( ValueInternalLink *link,
- BucketIndex index,
- BucketIndex bucketIndex )
-{
- // find last item of the bucket and swap it with the 'removed' one.
- // set removed items flags to 'available'.
- // if last page only contains 'available' items, then desallocate it (it's empty)
- ValueInternalLink *&lastLink = getLastLinkInBucket( index );
- BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1
- for ( ;
- lastItemIndex < ValueInternalLink::itemPerLink;
- ++lastItemIndex ) // may be optimized with dicotomic search
- {
- if ( lastLink->items_[lastItemIndex].isItemAvailable() )
- break;
- }
-
- BucketIndex lastUsedIndex = lastItemIndex - 1;
- Value *valueToDelete = &link->items_[index];
- Value *valueToPreserve = &lastLink->items_[lastUsedIndex];
- if ( valueToDelete != valueToPreserve )
- valueToDelete->swap( *valueToPreserve );
- if ( lastUsedIndex == 0 ) // page is now empty
- { // remove it from bucket linked list and delete it.
- ValueInternalLink *linkPreviousToLast = lastLink->previous_;
- if ( linkPreviousToLast != 0 ) // can not deleted bucket link.
- {
- mapAllocator()->releaseMapLink( lastLink );
- linkPreviousToLast->next_ = 0;
- lastLink = linkPreviousToLast;
- }
- }
- else
- {
- Value dummy;
- valueToPreserve->swap( dummy ); // restore deleted to default Value.
- valueToPreserve->setItemUsed( false );
- }
- --itemCount_;
-}
-
-
-ValueInternalLink *&
-ValueInternalMap::getLastLinkInBucket( BucketIndex bucketIndex )
-{
- if ( bucketIndex == bucketsSize_ - 1 )
- return tailLink_;
- ValueInternalLink *&previous = buckets_[bucketIndex+1].previous_;
- if ( !previous )
- previous = &buckets_[bucketIndex];
- return previous;
-}
-
-
-Value &
-ValueInternalMap::setNewItem( const char *key,
- bool isStatic,
- ValueInternalLink *link,
- BucketIndex index )
-{
- char *duplicatedKey = valueAllocator()->makeMemberName( key );
- ++itemCount_;
- link->keys_[index] = duplicatedKey;
- link->items_[index].setItemUsed();
- link->items_[index].setMemberNameIsStatic( isStatic );
- return link->items_[index]; // items already default constructed.
-}
-
-
-Value &
-ValueInternalMap::unsafeAdd( const char *key,
- bool isStatic,
- HashKey hashedKey )
-{
- JSON_ASSERT_MESSAGE( bucketsSize_ > 0, "ValueInternalMap::unsafeAdd(): internal logic error." );
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- ValueInternalLink *&previousLink = getLastLinkInBucket( bucketIndex );
- ValueInternalLink *link = previousLink;
- BucketIndex index;
- for ( index =0; index < ValueInternalLink::itemPerLink; ++index )
- {
- if ( link->items_[index].isItemAvailable() )
- break;
- }
- if ( index == ValueInternalLink::itemPerLink ) // need to add a new page
- {
- ValueInternalLink *newLink = mapAllocator()->allocateMapLink();
- index = 0;
- link->next_ = newLink;
- previousLink = newLink;
- link = newLink;
- }
- return setNewItem( key, isStatic, link, index );
-}
-
-
-ValueInternalMap::HashKey
-ValueInternalMap::hash( const char *key ) const
-{
- HashKey hash = 0;
- while ( *key )
- hash += *key++ * 37;
- return hash;
-}
-
-
-int
-ValueInternalMap::compare( const ValueInternalMap &other ) const
-{
- int sizeDiff( itemCount_ - other.itemCount_ );
- if ( sizeDiff != 0 )
- return sizeDiff;
- // Strict order guaranty is required. Compare all keys FIRST, then compare values.
- IteratorState it;
- IteratorState itEnd;
- makeBeginIterator( it );
- makeEndIterator( itEnd );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- if ( !other.find( key( it ) ) )
- return 1;
- }
-
- // All keys are equals, let's compare values
- makeBeginIterator( it );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- const Value *otherValue = other.find( key( it ) );
- int valueDiff = value(it).compare( *otherValue );
- if ( valueDiff != 0 )
- return valueDiff;
- }
- return 0;
-}
-
-
-void
-ValueInternalMap::makeBeginIterator( IteratorState &it ) const
-{
- it.map_ = const_cast<ValueInternalMap *>( this );
- it.bucketIndex_ = 0;
- it.itemIndex_ = 0;
- it.link_ = buckets_;
-}
-
-
-void
-ValueInternalMap::makeEndIterator( IteratorState &it ) const
-{
- it.map_ = const_cast<ValueInternalMap *>( this );
- it.bucketIndex_ = bucketsSize_;
- it.itemIndex_ = 0;
- it.link_ = 0;
-}
-
-
-bool
-ValueInternalMap::equals( const IteratorState &x, const IteratorState &other )
-{
- return x.map_ == other.map_
- && x.bucketIndex_ == other.bucketIndex_
- && x.link_ == other.link_
- && x.itemIndex_ == other.itemIndex_;
-}
-
-
-void
-ValueInternalMap::incrementBucket( IteratorState &iterator )
-{
- ++iterator.bucketIndex_;
- JSON_ASSERT_MESSAGE( iterator.bucketIndex_ <= iterator.map_->bucketsSize_,
- "ValueInternalMap::increment(): attempting to iterate beyond end." );
- if ( iterator.bucketIndex_ == iterator.map_->bucketsSize_ )
- iterator.link_ = 0;
- else
- iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]);
- iterator.itemIndex_ = 0;
-}
-
-
-void
-ValueInternalMap::increment( IteratorState &iterator )
-{
- JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterator using invalid iterator." );
- ++iterator.itemIndex_;
- if ( iterator.itemIndex_ == ValueInternalLink::itemPerLink )
- {
- JSON_ASSERT_MESSAGE( iterator.link_ != 0,
- "ValueInternalMap::increment(): attempting to iterate beyond end." );
- iterator.link_ = iterator.link_->next_;
- if ( iterator.link_ == 0 )
- incrementBucket( iterator );
- }
- else if ( iterator.link_->items_[iterator.itemIndex_].isItemAvailable() )
- {
- incrementBucket( iterator );
- }
-}
-
-
-void
-ValueInternalMap::decrement( IteratorState &iterator )
-{
- if ( iterator.itemIndex_ == 0 )
- {
- JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterate using invalid iterator." );
- if ( iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_] )
- {
- JSON_ASSERT_MESSAGE( iterator.bucketIndex_ > 0, "Attempting to iterate beyond beginning." );
- --(iterator.bucketIndex_);
- }
- iterator.link_ = iterator.link_->previous_;
- iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1;
- }
-}
-
-
-const char *
-ValueInternalMap::key( const IteratorState &iterator )
-{
- JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." );
- return iterator.link_->keys_[iterator.itemIndex_];
-}
-
-const char *
-ValueInternalMap::key( const IteratorState &iterator, bool &isStatic )
-{
- JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." );
- isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic();
- return iterator.link_->keys_[iterator.itemIndex_];
-}
-
-
-Value &
-ValueInternalMap::value( const IteratorState &iterator )
-{
- JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." );
- return iterator.link_->items_[iterator.itemIndex_];
-}
-
-
-int
-ValueInternalMap::distance( const IteratorState &x, const IteratorState &y )
-{
- int offset = 0;
- IteratorState it = x;
- while ( !equals( it, y ) )
- increment( it );
- return offset;
-}
diff --git a/lib/jsoncpp/src/lib_json/json_reader.cpp b/lib/jsoncpp/src/lib_json/json_reader.cpp
deleted file mode 100644
index fb8421de9..000000000
--- a/lib/jsoncpp/src/lib_json/json_reader.cpp
+++ /dev/null
@@ -1,885 +0,0 @@
-#include "../../include/json/reader.h"
-#include "../../include/json/value.h"
-#include <utility>
-#include <cstdio>
-#include <cassert>
-#include <cstring>
-#include <iostream>
-#include <stdexcept>
-
-#if _MSC_VER >= 1400 // VC++ 8.0
-#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated.
-#endif
-
-namespace Json {
-
-// Implementation of class Features
-// ////////////////////////////////
-
-Features::Features()
- : allowComments_( true )
- , strictRoot_( false )
-{
-}
-
-
-Features
-Features::all()
-{
- return Features();
-}
-
-
-Features
-Features::strictMode()
-{
- Features features;
- features.allowComments_ = false;
- features.strictRoot_ = true;
- return features;
-}
-
-// Implementation of class Reader
-// ////////////////////////////////
-
-
-static inline bool
-in( Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4 )
-{
- return c == c1 || c == c2 || c == c3 || c == c4;
-}
-
-static inline bool
-in( Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4, Reader::Char c5 )
-{
- return c == c1 || c == c2 || c == c3 || c == c4 || c == c5;
-}
-
-
-static bool
-containsNewLine( Reader::Location begin,
- Reader::Location end )
-{
- for ( ;begin < end; ++begin )
- if ( *begin == '\n' || *begin == '\r' )
- return true;
- return false;
-}
-
-static std::string codePointToUTF8(unsigned int cp)
-{
- std::string result;
-
- // based on description from http://en.wikipedia.org/wiki/UTF-8
-
- if (cp <= 0x7f)
- {
- result.resize(1);
- result[0] = static_cast<char>(cp);
- }
- else if (cp <= 0x7FF)
- {
- result.resize(2);
- result[1] = static_cast<char>(0x80 | (0x3f & cp));
- result[0] = static_cast<char>(0xC0 | (0x1f & (cp >> 6)));
- }
- else if (cp <= 0xFFFF)
- {
- result.resize(3);
- result[2] = static_cast<char>(0x80 | (0x3f & cp));
- result[1] = 0x80 | static_cast<char>((0x3f & (cp >> 6)));
- result[0] = 0xE0 | static_cast<char>((0xf & (cp >> 12)));
- }
- else if (cp <= 0x10FFFF)
- {
- result.resize(4);
- result[3] = static_cast<char>(0x80 | (0x3f & cp));
- result[2] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));
- result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 12)));
- result[0] = static_cast<char>(0xF0 | (0x7 & (cp >> 18)));
- }
-
- return result;
-}
-
-
-// Class Reader
-// //////////////////////////////////////////////////////////////////
-
-Reader::Reader()
- : features_( Features::all() )
-{
-}
-
-
-Reader::Reader( const Features &features )
- : features_( features )
-{
-}
-
-
-bool
-Reader::parse( const std::string &document,
- Value &root,
- bool collectComments )
-{
- document_ = document;
- const char *begin = document_.c_str();
- const char *end = begin + document_.length();
- return parse( begin, end, root, collectComments );
-}
-
-
-bool
-Reader::parse( std::istream& sin,
- Value &root,
- bool collectComments )
-{
- //std::istream_iterator<char> begin(sin);
- //std::istream_iterator<char> end;
- // Those would allow streamed input from a file, if parse() were a
- // template function.
-
- // Since std::string is reference-counted, this at least does not
- // create an extra copy.
- std::string doc;
- std::getline(sin, doc, (char)EOF);
- return parse( doc, root, collectComments );
-}
-
-bool
-Reader::parse( const char *beginDoc, const char *endDoc,
- Value &root,
- bool collectComments )
-{
- if ( !features_.allowComments_ )
- {
- collectComments = false;
- }
-
- begin_ = beginDoc;
- end_ = endDoc;
- collectComments_ = collectComments;
- current_ = begin_;
- lastValueEnd_ = 0;
- lastValue_ = 0;
- commentsBefore_ = "";
- errors_.clear();
- while ( !nodes_.empty() )
- nodes_.pop();
- nodes_.push( &root );
-
- bool successful = readValue();
- Token token;
- skipCommentTokens( token );
- if ( collectComments_ && !commentsBefore_.empty() )
- root.setComment( commentsBefore_, commentAfter );
- if ( features_.strictRoot_ )
- {
- if ( !root.isArray() && !root.isObject() )
- {
- // Set error location to start of doc, ideally should be first token found in doc
- token.type_ = tokenError;
- token.start_ = beginDoc;
- token.end_ = endDoc;
- addError( "A valid JSON document must be either an array or an object value.",
- token );
- return false;
- }
- }
- return successful;
-}
-
-
-bool
-Reader::readValue()
-{
- Token token;
- skipCommentTokens( token );
- bool successful = true;
-
- if ( collectComments_ && !commentsBefore_.empty() )
- {
- currentValue().setComment( commentsBefore_, commentBefore );
- commentsBefore_ = "";
- }
-
-
- switch ( token.type_ )
- {
- case tokenObjectBegin:
- successful = readObject( token );
- break;
- case tokenArrayBegin:
- successful = readArray( token );
- break;
- case tokenNumber:
- successful = decodeNumber( token );
- break;
- case tokenString:
- successful = decodeString( token );
- break;
- case tokenTrue:
- currentValue() = true;
- break;
- case tokenFalse:
- currentValue() = false;
- break;
- case tokenNull:
- currentValue() = Value();
- break;
- default:
- return addError( "Syntax error: value, object or array expected.", token );
- }
-
- if ( collectComments_ )
- {
- lastValueEnd_ = current_;
- lastValue_ = &currentValue();
- }
-
- return successful;
-}
-
-
-void
-Reader::skipCommentTokens( Token &token )
-{
- if ( features_.allowComments_ )
- {
- do
- {
- readToken( token );
- }
- while ( token.type_ == tokenComment );
- }
- else
- {
- readToken( token );
- }
-}
-
-
-bool
-Reader::expectToken( TokenType type, Token &token, const char *message )
-{
- readToken( token );
- if ( token.type_ != type )
- return addError( message, token );
- return true;
-}
-
-
-bool
-Reader::readToken( Token &token )
-{
- skipSpaces();
- token.start_ = current_;
- Char c = getNextChar();
- bool ok = true;
- switch ( c )
- {
- case '{':
- token.type_ = tokenObjectBegin;
- break;
- case '}':
- token.type_ = tokenObjectEnd;
- break;
- case '[':
- token.type_ = tokenArrayBegin;
- break;
- case ']':
- token.type_ = tokenArrayEnd;
- break;
- case '"':
- token.type_ = tokenString;
- ok = readString();
- break;
- case '/':
- token.type_ = tokenComment;
- ok = readComment();
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case '-':
- token.type_ = tokenNumber;
- readNumber();
- break;
- case 't':
- token.type_ = tokenTrue;
- ok = match( "rue", 3 );
- break;
- case 'f':
- token.type_ = tokenFalse;
- ok = match( "alse", 4 );
- break;
- case 'n':
- token.type_ = tokenNull;
- ok = match( "ull", 3 );
- break;
- case ',':
- token.type_ = tokenArraySeparator;
- break;
- case ':':
- token.type_ = tokenMemberSeparator;
- break;
- case 0:
- token.type_ = tokenEndOfStream;
- break;
- default:
- ok = false;
- break;
- }
- if ( !ok )
- token.type_ = tokenError;
- token.end_ = current_;
- return true;
-}
-
-
-void
-Reader::skipSpaces()
-{
- while ( current_ != end_ )
- {
- Char c = *current_;
- if ( c == ' ' || c == '\t' || c == '\r' || c == '\n' )
- ++current_;
- else
- break;
- }
-}
-
-
-bool
-Reader::match( Location pattern,
- int patternLength )
-{
- if ( end_ - current_ < patternLength )
- return false;
- int index = patternLength;
- while ( index-- )
- if ( current_[index] != pattern[index] )
- return false;
- current_ += patternLength;
- return true;
-}
-
-
-bool
-Reader::readComment()
-{
- Location commentBegin = current_ - 1;
- Char c = getNextChar();
- bool successful = false;
- if ( c == '*' )
- successful = readCStyleComment();
- else if ( c == '/' )
- successful = readCppStyleComment();
- if ( !successful )
- return false;
-
- if ( collectComments_ )
- {
- CommentPlacement placement = commentBefore;
- if ( lastValueEnd_ && !containsNewLine( lastValueEnd_, commentBegin ) )
- {
- if ( c != '*' || !containsNewLine( commentBegin, current_ ) )
- placement = commentAfterOnSameLine;
- }
-
- addComment( commentBegin, current_, placement );
- }
- return true;
-}
-
-
-void
-Reader::addComment( Location begin,
- Location end,
- CommentPlacement placement )
-{
- assert( collectComments_ );
- if ( placement == commentAfterOnSameLine )
- {
- assert( lastValue_ != 0 );
- lastValue_->setComment( std::string( begin, end ), placement );
- }
- else
- {
- if ( !commentsBefore_.empty() )
- commentsBefore_ += "\n";
- commentsBefore_ += std::string( begin, end );
- }
-}
-
-
-bool
-Reader::readCStyleComment()
-{
- while ( current_ != end_ )
- {
- Char c = getNextChar();
- if ( c == '*' && *current_ == '/' )
- break;
- }
- return getNextChar() == '/';
-}
-
-
-bool
-Reader::readCppStyleComment()
-{
- while ( current_ != end_ )
- {
- Char c = getNextChar();
- if ( c == '\r' || c == '\n' )
- break;
- }
- return true;
-}
-
-
-void
-Reader::readNumber()
-{
- while ( current_ != end_ )
- {
- if ( !(*current_ >= '0' && *current_ <= '9') &&
- !in( *current_, '.', 'e', 'E', '+', '-' ) )
- break;
- ++current_;
- }
-}
-
-bool
-Reader::readString()
-{
- Char c = 0;
- while ( current_ != end_ )
- {
- c = getNextChar();
- if ( c == '\\' )
- getNextChar();
- else if ( c == '"' )
- break;
- }
- return c == '"';
-}
-
-
-bool
-Reader::readObject( Token &tokenStart )
-{
- Token tokenName;
- std::string name;
- currentValue() = Value( objectValue );
- while ( readToken( tokenName ) )
- {
- bool initialTokenOk = true;
- while ( tokenName.type_ == tokenComment && initialTokenOk )
- initialTokenOk = readToken( tokenName );
- if ( !initialTokenOk )
- break;
- if ( tokenName.type_ == tokenObjectEnd && name.empty() ) // empty object
- return true;
- if ( tokenName.type_ != tokenString )
- break;
-
- name = "";
- if ( !decodeString( tokenName, name ) )
- return recoverFromError( tokenObjectEnd );
-
- Token colon;
- if ( !readToken( colon ) || colon.type_ != tokenMemberSeparator )
- {
- return addErrorAndRecover( "Missing ':' after object member name",
- colon,
- tokenObjectEnd );
- }
- Value &value = currentValue()[ name ];
- nodes_.push( &value );
- bool ok = readValue();
- nodes_.pop();
- if ( !ok ) // error already set
- return recoverFromError( tokenObjectEnd );
-
- Token comma;
- if ( !readToken( comma )
- || ( comma.type_ != tokenObjectEnd &&
- comma.type_ != tokenArraySeparator &&
- comma.type_ != tokenComment ) )
- {
- return addErrorAndRecover( "Missing ',' or '}' in object declaration",
- comma,
- tokenObjectEnd );
- }
- bool finalizeTokenOk = true;
- while ( comma.type_ == tokenComment &&
- finalizeTokenOk )
- finalizeTokenOk = readToken( comma );
- if ( comma.type_ == tokenObjectEnd )
- return true;
- }
- return addErrorAndRecover( "Missing '}' or object member name",
- tokenName,
- tokenObjectEnd );
-}
-
-
-bool
-Reader::readArray( Token &tokenStart )
-{
- currentValue() = Value( arrayValue );
- skipSpaces();
- if ( *current_ == ']' ) // empty array
- {
- Token endArray;
- readToken( endArray );
- return true;
- }
- int index = 0;
- while ( true )
- {
- Value &value = currentValue()[ index++ ];
- nodes_.push( &value );
- bool ok = readValue();
- nodes_.pop();
- if ( !ok ) // error already set
- return recoverFromError( tokenArrayEnd );
-
- Token token;
- // Accept Comment after last item in the array.
- ok = readToken( token );
- while ( token.type_ == tokenComment && ok )
- {
- ok = readToken( token );
- }
- bool badTokenType = ( token.type_ == tokenArraySeparator &&
- token.type_ == tokenArrayEnd );
- if ( !ok || badTokenType )
- {
- return addErrorAndRecover( "Missing ',' or ']' in array declaration",
- token,
- tokenArrayEnd );
- }
- if ( token.type_ == tokenArrayEnd )
- break;
- }
- return true;
-}
-
-
-bool
-Reader::decodeNumber( Token &token )
-{
- bool isDouble = false;
- for ( Location inspect = token.start_; inspect != token.end_; ++inspect )
- {
- isDouble = isDouble
- || in( *inspect, '.', 'e', 'E', '+' )
- || ( *inspect == '-' && inspect != token.start_ );
- }
- if ( isDouble )
- return decodeDouble( token );
- Location current = token.start_;
- bool isNegative = *current == '-';
- if ( isNegative )
- ++current;
- Value::UInt threshold = (isNegative ? Value::UInt(-Value::minInt)
- : Value::maxUInt) / 10;
- Value::UInt value = 0;
- while ( current < token.end_ )
- {
- Char c = *current++;
- if ( c < '0' || c > '9' )
- return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token );
- if ( value >= threshold )
- return decodeDouble( token );
- value = value * 10 + Value::UInt(c - '0');
- }
- if ( isNegative )
- currentValue() = -Value::Int( value );
- else if ( value <= Value::UInt(Value::maxInt) )
- currentValue() = Value::Int( value );
- else
- currentValue() = value;
- return true;
-}
-
-
-bool
-Reader::decodeDouble( Token &token )
-{
- double value = 0;
- const int bufferSize = 32;
- int count;
- int length = int(token.end_ - token.start_);
- if ( length < bufferSize )
- {
- Char buffer[bufferSize];
- memcpy( buffer, token.start_, length );
- buffer[length] = 0;
- count = sscanf( buffer, "%lf", &value );
- }
- else
- {
- std::string buffer( token.start_, token.end_ );
- count = sscanf( buffer.c_str(), "%lf", &value );
- }
-
- if ( count != 1 )
- return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token );
- currentValue() = value;
- return true;
-}
-
-
-bool
-Reader::decodeString( Token &token )
-{
- std::string decoded;
- if ( !decodeString( token, decoded ) )
- return false;
- currentValue() = decoded;
- return true;
-}
-
-
-bool
-Reader::decodeString( Token &token, std::string &decoded )
-{
- decoded.reserve( token.end_ - token.start_ - 2 );
- Location current = token.start_ + 1; // skip '"'
- Location end = token.end_ - 1; // do not include '"'
- while ( current != end )
- {
- Char c = *current++;
- if ( c == '"' )
- break;
- else if ( c == '\\' )
- {
- if ( current == end )
- return addError( "Empty escape sequence in string", token, current );
- Char escape = *current++;
- switch ( escape )
- {
- case '"': decoded += '"'; break;
- case '/': decoded += '/'; break;
- case '\\': decoded += '\\'; break;
- case 'b': decoded += '\b'; break;
- case 'f': decoded += '\f'; break;
- case 'n': decoded += '\n'; break;
- case 'r': decoded += '\r'; break;
- case 't': decoded += '\t'; break;
- case 'u':
- {
- unsigned int unicode;
- if ( !decodeUnicodeCodePoint( token, current, end, unicode ) )
- return false;
- decoded += codePointToUTF8(unicode);
- }
- break;
- default:
- return addError( "Bad escape sequence in string", token, current );
- }
- }
- else
- {
- decoded += c;
- }
- }
- return true;
-}
-
-bool
-Reader::decodeUnicodeCodePoint( Token &token,
- Location &current,
- Location end,
- unsigned int &unicode )
-{
-
- if ( !decodeUnicodeEscapeSequence( token, current, end, unicode ) )
- return false;
- if (unicode >= 0xD800 && unicode <= 0xDBFF)
- {
- // surrogate pairs
- if (end - current < 6)
- return addError( "additional six characters expected to parse unicode surrogate pair.", token, current );
- unsigned int surrogatePair;
- if (*(current++) == '\\' && *(current++)== 'u')
- {
- if (decodeUnicodeEscapeSequence( token, current, end, surrogatePair ))
- {
- unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
- }
- else
- return false;
- }
- else
- return addError( "expecting another \\u token to begin the second half of a unicode surrogate pair", token, current );
- }
- return true;
-}
-
-bool
-Reader::decodeUnicodeEscapeSequence( Token &token,
- Location &current,
- Location end,
- unsigned int &unicode )
-{
- if ( end - current < 4 )
- return addError( "Bad unicode escape sequence in string: four digits expected.", token, current );
- unicode = 0;
- for ( int index =0; index < 4; ++index )
- {
- Char c = *current++;
- unicode *= 16;
- if ( c >= '0' && c <= '9' )
- unicode += c - '0';
- else if ( c >= 'a' && c <= 'f' )
- unicode += c - 'a' + 10;
- else if ( c >= 'A' && c <= 'F' )
- unicode += c - 'A' + 10;
- else
- return addError( "Bad unicode escape sequence in string: hexadecimal digit expected.", token, current );
- }
- return true;
-}
-
-
-bool
-Reader::addError( const std::string &message,
- Token &token,
- Location extra )
-{
- ErrorInfo info;
- info.token_ = token;
- info.message_ = message;
- info.extra_ = extra;
- errors_.push_back( info );
- return false;
-}
-
-
-bool
-Reader::recoverFromError( TokenType skipUntilToken )
-{
- int errorCount = int(errors_.size());
- Token skip;
- while ( true )
- {
- if ( !readToken(skip) )
- errors_.resize( errorCount ); // discard errors caused by recovery
- if ( skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream )
- break;
- }
- errors_.resize( errorCount );
- return false;
-}
-
-
-bool
-Reader::addErrorAndRecover( const std::string &message,
- Token &token,
- TokenType skipUntilToken )
-{
- addError( message, token );
- return recoverFromError( skipUntilToken );
-}
-
-
-Value &
-Reader::currentValue()
-{
- return *(nodes_.top());
-}
-
-
-Reader::Char
-Reader::getNextChar()
-{
- if ( current_ == end_ )
- return 0;
- return *current_++;
-}
-
-
-void
-Reader::getLocationLineAndColumn( Location location,
- int &line,
- int &column ) const
-{
- Location current = begin_;
- Location lastLineStart = current;
- line = 0;
- while ( current < location && current != end_ )
- {
- Char c = *current++;
- if ( c == '\r' )
- {
- if ( *current == '\n' )
- ++current;
- lastLineStart = current;
- ++line;
- }
- else if ( c == '\n' )
- {
- lastLineStart = current;
- ++line;
- }
- }
- // column & line start at 1
- column = int(location - lastLineStart) + 1;
- ++line;
-}
-
-
-std::string
-Reader::getLocationLineAndColumn( Location location ) const
-{
- int line, column;
- getLocationLineAndColumn( location, line, column );
- char buffer[18+16+16+1];
- sprintf( buffer, "Line %d, Column %d", line, column );
- return buffer;
-}
-
-
-std::string
-Reader::getFormatedErrorMessages() const
-{
- std::string formattedMessage;
- for ( Errors::const_iterator itError = errors_.begin();
- itError != errors_.end();
- ++itError )
- {
- const ErrorInfo &error = *itError;
- formattedMessage += "* " + getLocationLineAndColumn( error.token_.start_ ) + "\n";
- formattedMessage += " " + error.message_ + "\n";
- if ( error.extra_ )
- formattedMessage += "See " + getLocationLineAndColumn( error.extra_ ) + " for detail.\n";
- }
- return formattedMessage;
-}
-
-#define JSON_ASSERT( condition ) assert( condition );
-std::istream& operator>>( std::istream &sin, Value &root )
-{
- Json::Reader reader;
- bool ok = reader.parse(sin, root, true);
- JSON_ASSERT( ok );
- //if (!ok) throw std::runtime_error(reader.getFormatedErrorMessages());
- return sin;
-}
-
-
-} // namespace Json
diff --git a/lib/jsoncpp/src/lib_json/json_value.cpp b/lib/jsoncpp/src/lib_json/json_value.cpp
deleted file mode 100644
index ea033c400..000000000
--- a/lib/jsoncpp/src/lib_json/json_value.cpp
+++ /dev/null
@@ -1,1727 +0,0 @@
-#include <iostream>
-#include "../../include/json/json.h"
-#include "../../include/json/writer.h"
-#include <utility>
-#include <stdexcept>
-#include <cstring>
-#include <cassert>
-#ifdef JSON_USE_CPPTL
-# include <cpptl/conststring.h>
-#endif
-#include <cstddef> // size_t
-#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-# include "json_batchallocator.h"
-#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-
-#define JSON_ASSERT_UNREACHABLE assert( false )
-#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw
-#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );
-
-namespace Json {
-
-const Value Value::null;
-const Int Value::minInt = Int( ~(UInt(-1)/2) );
-const Int Value::maxInt = Int( UInt(-1)/2 );
-const UInt Value::maxUInt = UInt(-1);
-
-// A "safe" implementation of strdup. Allow null pointer to be passed.
-// Also avoid warning on msvc80.
-//
-//inline char *safeStringDup( const char *czstring )
-//{
-// if ( czstring )
-// {
-// const size_t length = (unsigned int)( strlen(czstring) + 1 );
-// char *newString = static_cast<char *>( malloc( length ) );
-// memcpy( newString, czstring, length );
-// return newString;
-// }
-// return 0;
-//}
-//
-//inline char *safeStringDup( const std::string &str )
-//{
-// if ( !str.empty() )
-// {
-// const size_t length = str.length();
-// char *newString = static_cast<char *>( malloc( length + 1 ) );
-// memcpy( newString, str.c_str(), length );
-// newString[length] = 0;
-// return newString;
-// }
-// return 0;
-//}
-
-ValueAllocator::~ValueAllocator()
-{
-}
-
-class DefaultValueAllocator : public ValueAllocator
-{
-public:
- virtual ~DefaultValueAllocator()
- {
- }
-
- virtual char *makeMemberName( const char *memberName )
- {
- return duplicateStringValue( memberName );
- }
-
- virtual void releaseMemberName( char *memberName )
- {
- releaseStringValue( memberName );
- }
-
- virtual char *duplicateStringValue( const char *value,
- unsigned int length = unknown )
- {
- //@todo invesgate this old optimization
- //if ( !value || value[0] == 0 )
- // return 0;
-
- if ( length == unknown )
- length = (unsigned int)strlen(value);
- char *newString = static_cast<char *>( malloc( length + 1 ) );
- memcpy( newString, value, length );
- newString[length] = 0;
- return newString;
- }
-
- virtual void releaseStringValue( char *value )
- {
- if ( value )
- free( value );
- }
-};
-
-static ValueAllocator *&valueAllocator()
-{
- static DefaultValueAllocator defaultAllocator;
- static ValueAllocator *valueAllocator = &defaultAllocator;
- return valueAllocator;
-}
-
-static struct DummyValueAllocatorInitializer {
- DummyValueAllocatorInitializer()
- {
- valueAllocator(); // ensure valueAllocator() statics are initialized before main().
- }
-} dummyValueAllocatorInitializer;
-
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// ValueInternals...
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
-# include "json_internalarray.inl"
-# include "json_internalmap.inl"
-#endif // JSON_VALUE_USE_INTERNAL_MAP
-
-# include "json_valueiterator.inl"
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class Value::CommentInfo
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-
-Value::CommentInfo::CommentInfo()
- : comment_( 0 )
-{
-}
-
-Value::CommentInfo::~CommentInfo()
-{
- if ( comment_ )
- valueAllocator()->releaseStringValue( comment_ );
-}
-
-
-void
-Value::CommentInfo::setComment( const char *text )
-{
- if ( comment_ )
- valueAllocator()->releaseStringValue( comment_ );
- JSON_ASSERT( text );
- //JSON_ASSERT_MESSAGE( text[0]=='\0' || text[0]=='/', "Comments must start with /");
- JSON_ASSERT( text[0]=='\0' || text[0]=='/' );
- // It seems that /**/ style comments are acceptable as well.
- comment_ = valueAllocator()->duplicateStringValue( text );
-}
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class Value::CZString
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-# ifndef JSON_VALUE_USE_INTERNAL_MAP
-
-// Notes: index_ indicates if the string was allocated when
-// a string is stored.
-
-Value::CZString::CZString( int index )
- : cstr_( 0 )
- , index_( index )
-{
-}
-
-Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate )
- : cstr_( allocate == duplicate ? valueAllocator()->makeMemberName(cstr)
- : cstr )
- , index_( allocate )
-{
-}
-
-Value::CZString::CZString( const CZString &other )
-: cstr_( other.index_ != noDuplication && other.cstr_ != 0
- ? valueAllocator()->makeMemberName( other.cstr_ )
- : other.cstr_ )
- , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate)
- : other.index_ )
-{
-}
-
-Value::CZString::~CZString()
-{
- if ( cstr_ && index_ == duplicate )
- valueAllocator()->releaseMemberName( const_cast<char *>( cstr_ ) );
-}
-
-void
-Value::CZString::swap( CZString &other )
-{
- std::swap( cstr_, other.cstr_ );
- std::swap( index_, other.index_ );
-}
-
-Value::CZString &
-Value::CZString::operator =( const CZString &other )
-{
- CZString temp( other );
- swap( temp );
- return *this;
-}
-
-bool
-Value::CZString::operator<( const CZString &other ) const
-{
- if ( cstr_ )
- return strcmp( cstr_, other.cstr_ ) < 0;
- return index_ < other.index_;
-}
-
-bool
-Value::CZString::operator==( const CZString &other ) const
-{
- if ( cstr_ )
- return strcmp( cstr_, other.cstr_ ) == 0;
- return index_ == other.index_;
-}
-
-
-int
-Value::CZString::index() const
-{
- return index_;
-}
-
-
-const char *
-Value::CZString::c_str() const
-{
- return cstr_;
-}
-
-bool
-Value::CZString::isStaticString() const
-{
- return index_ == noDuplication;
-}
-
-#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class Value::Value
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-/*! \internal Default constructor initialization must be equivalent to:
- * memset( this, 0, sizeof(Value) )
- * This optimization is used in ValueInternalMap fast allocator.
- */
-Value::Value( ValueType type )
- : type_( type )
- , allocated_( 0 )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- switch ( type )
- {
- case nullValue:
- break;
- case intValue:
- case uintValue:
- value_.int_ = 0;
- break;
- case realValue:
- value_.real_ = 0.0;
- break;
- case stringValue:
- value_.string_ = 0;
- break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- value_.map_ = new ObjectValues();
- break;
-#else
- case arrayValue:
- value_.array_ = arrayAllocator()->newArray();
- break;
- case objectValue:
- value_.map_ = mapAllocator()->newMap();
- break;
-#endif
- case booleanValue:
- value_.bool_ = false;
- break;
- default:
- JSON_ASSERT_UNREACHABLE;
- }
-}
-
-
-Value::Value( Int value )
- : type_( intValue )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.int_ = value;
-}
-
-
-Value::Value( UInt value )
- : type_( uintValue )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.uint_ = value;
-}
-
-Value::Value( double value )
- : type_( realValue )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.real_ = value;
-}
-
-Value::Value( const char *value )
- : type_( stringValue )
- , allocated_( true )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.string_ = valueAllocator()->duplicateStringValue( value );
-}
-
-
-Value::Value( const char *beginValue,
- const char *endValue )
- : type_( stringValue )
- , allocated_( true )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.string_ = valueAllocator()->duplicateStringValue( beginValue,
- UInt(endValue - beginValue) );
-}
-
-
-Value::Value( const std::string &value )
- : type_( stringValue )
- , allocated_( true )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.string_ = valueAllocator()->duplicateStringValue( value.c_str(),
- (unsigned int)value.length() );
-
-}
-
-Value::Value( const StaticString &value )
- : type_( stringValue )
- , allocated_( false )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.string_ = const_cast<char *>( value.c_str() );
-}
-
-
-# ifdef JSON_USE_CPPTL
-Value::Value( const CppTL::ConstString &value )
- : type_( stringValue )
- , allocated_( true )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.string_ = valueAllocator()->duplicateStringValue( value, value.length() );
-}
-# endif
-
-Value::Value( bool value )
- : type_( booleanValue )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.bool_ = value;
-}
-
-
-Value::Value( const Value &other )
- : type_( other.type_ )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- switch ( type_ )
- {
- case nullValue:
- case intValue:
- case uintValue:
- case realValue:
- case booleanValue:
- value_ = other.value_;
- break;
- case stringValue:
- if ( other.value_.string_ )
- {
- value_.string_ = valueAllocator()->duplicateStringValue( other.value_.string_ );
- allocated_ = true;
- }
- else
- value_.string_ = 0;
- break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- value_.map_ = new ObjectValues( *other.value_.map_ );
- break;
-#else
- case arrayValue:
- value_.array_ = arrayAllocator()->newArrayCopy( *other.value_.array_ );
- break;
- case objectValue:
- value_.map_ = mapAllocator()->newMapCopy( *other.value_.map_ );
- break;
-#endif
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- if ( other.comments_ )
- {
- comments_ = new CommentInfo[numberOfCommentPlacement];
- for ( int comment =0; comment < numberOfCommentPlacement; ++comment )
- {
- const CommentInfo &otherComment = other.comments_[comment];
- if ( otherComment.comment_ )
- comments_[comment].setComment( otherComment.comment_ );
- }
- }
-}
-
-
-Value::~Value()
-{
- switch ( type_ )
- {
- case nullValue:
- case intValue:
- case uintValue:
- case realValue:
- case booleanValue:
- break;
- case stringValue:
- if ( allocated_ )
- valueAllocator()->releaseStringValue( value_.string_ );
- break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- delete value_.map_;
- break;
-#else
- case arrayValue:
- arrayAllocator()->destructArray( value_.array_ );
- break;
- case objectValue:
- mapAllocator()->destructMap( value_.map_ );
- break;
-#endif
- default:
- JSON_ASSERT_UNREACHABLE;
- }
-
- if ( comments_ )
- delete[] comments_;
-}
-
-Value &
-Value::operator=( const Value &other )
-{
- Value temp( other );
- swap( temp );
- return *this;
-}
-
-void
-Value::swap( Value &other )
-{
- ValueType temp = type_;
- type_ = other.type_;
- other.type_ = temp;
- std::swap( value_, other.value_ );
- int temp2 = allocated_;
- allocated_ = other.allocated_;
- other.allocated_ = temp2;
-}
-
-ValueType
-Value::type() const
-{
- return type_;
-}
-
-
-int
-Value::compare( const Value &other )
-{
- /*
- int typeDelta = other.type_ - type_;
- switch ( type_ )
- {
- case nullValue:
-
- return other.type_ == type_;
- case intValue:
- if ( other.type_.isNumeric()
- case uintValue:
- case realValue:
- case booleanValue:
- break;
- case stringValue,
- break;
- case arrayValue:
- delete value_.array_;
- break;
- case objectValue:
- delete value_.map_;
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- */
- return 0; // unreachable
-}
-
-bool
-Value::operator <( const Value &other ) const
-{
- int typeDelta = type_ - other.type_;
- if ( typeDelta )
- return typeDelta < 0 ? true : false;
- switch ( type_ )
- {
- case nullValue:
- return false;
- case intValue:
- return value_.int_ < other.value_.int_;
- case uintValue:
- return value_.uint_ < other.value_.uint_;
- case realValue:
- return value_.real_ < other.value_.real_;
- case booleanValue:
- return value_.bool_ < other.value_.bool_;
- case stringValue:
- return ( value_.string_ == 0 && other.value_.string_ )
- || ( other.value_.string_
- && value_.string_
- && strcmp( value_.string_, other.value_.string_ ) < 0 );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- {
- int delta = int( value_.map_->size() - other.value_.map_->size() );
- if ( delta )
- return delta < 0;
- return (*value_.map_) < (*other.value_.map_);
- }
-#else
- case arrayValue:
- return value_.array_->compare( *(other.value_.array_) ) < 0;
- case objectValue:
- return value_.map_->compare( *(other.value_.map_) ) < 0;
-#endif
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable
-}
-
-bool
-Value::operator <=( const Value &other ) const
-{
- return !(other > *this);
-}
-
-bool
-Value::operator >=( const Value &other ) const
-{
- return !(*this < other);
-}
-
-bool
-Value::operator >( const Value &other ) const
-{
- return other < *this;
-}
-
-bool
-Value::operator ==( const Value &other ) const
-{
- //if ( type_ != other.type_ )
- // GCC 2.95.3 says:
- // attempt to take address of bit-field structure member `Json::Value::type_'
- // Beats me, but a temp solves the problem.
- int temp = other.type_;
- if ( type_ != temp )
- return false;
- switch ( type_ )
- {
- case nullValue:
- return true;
- case intValue:
- return value_.int_ == other.value_.int_;
- case uintValue:
- return value_.uint_ == other.value_.uint_;
- case realValue:
- return value_.real_ == other.value_.real_;
- case booleanValue:
- return value_.bool_ == other.value_.bool_;
- case stringValue:
- return ( value_.string_ == other.value_.string_ )
- || ( other.value_.string_
- && value_.string_
- && strcmp( value_.string_, other.value_.string_ ) == 0 );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- return value_.map_->size() == other.value_.map_->size()
- && (*value_.map_) == (*other.value_.map_);
-#else
- case arrayValue:
- return value_.array_->compare( *(other.value_.array_) ) == 0;
- case objectValue:
- return value_.map_->compare( *(other.value_.map_) ) == 0;
-#endif
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable
-}
-
-bool
-Value::operator !=( const Value &other ) const
-{
- return !( *this == other );
-}
-
-const char *
-Value::asCString() const
-{
- JSON_ASSERT( type_ == stringValue );
- return value_.string_;
-}
-
-
-std::string
-Value::asString() const
-{
- switch ( type_ )
- {
- case nullValue:
- return "";
- case stringValue:
- return value_.string_ ? value_.string_ : "";
- case booleanValue:
- return value_.bool_ ? "true" : "false";
- case intValue:
- case uintValue:
- case realValue:
- case arrayValue:
- case objectValue:
- //JSON_ASSERT_MESSAGE( false, "Type is not convertible to string" );
- JSON_ASSERT( false );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return ""; // unreachable
-}
-
-# ifdef JSON_USE_CPPTL
-CppTL::ConstString
-Value::asConstString() const
-{
- return CppTL::ConstString( asString().c_str() );
-}
-# endif
-
-Value::Int
-Value::asInt() const
-{
- switch ( type_ )
- {
- case nullValue:
- return 0;
- case intValue:
- return value_.int_;
- case uintValue:
- //JSON_ASSERT_MESSAGE( value_.uint_ < (unsigned)maxInt, "integer out of signed integer range" );
- JSON_ASSERT( value_.uint_ < (unsigned)maxInt );
- return value_.uint_;
- case realValue:
- //JSON_ASSERT_MESSAGE( value_.real_ >= minInt && value_.real_ <= maxInt, "Real out of signed integer range" );
- JSON_ASSERT( value_.real_ >= minInt && value_.real_ <= maxInt );
- return Int( value_.real_ );
- case booleanValue:
- return value_.bool_ ? 1 : 0;
- case stringValue:
- case arrayValue:
- case objectValue:
- //JSON_ASSERT_MESSAGE( false, "Type is not convertible to int" );
- JSON_ASSERT( false );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable;
-}
-
-Value::UInt
-Value::asUInt() const
-{
- switch ( type_ )
- {
- case nullValue:
- return 0;
- case intValue:
- //JSON_ASSERT_MESSAGE( value_.int_ >= 0, "Negative integer can not be converted to unsigned integer" );
- JSON_ASSERT( value_.int_ >= 0 );
- return value_.int_;
- case uintValue:
- return value_.uint_;
- case realValue:
- //JSON_ASSERT_MESSAGE( value_.real_ >= 0 && value_.real_ <= maxUInt, "Real out of unsigned integer range" );
- JSON_ASSERT( value_.real_ >= 0 && value_.real_ <= maxUInt );
- return UInt( value_.real_ );
- case booleanValue:
- return value_.bool_ ? 1 : 0;
- case stringValue:
- case arrayValue:
- case objectValue:
- //JSON_ASSERT_MESSAGE( false, "Type is not convertible to uint" );
- JSON_ASSERT( false );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable;
-}
-
-double
-Value::asDouble() const
-{
- switch ( type_ )
- {
- case nullValue:
- return 0.0;
- case intValue:
- return value_.int_;
- case uintValue:
- return value_.uint_;
- case realValue:
- return value_.real_;
- case booleanValue:
- return value_.bool_ ? 1.0 : 0.0;
- case stringValue:
- case arrayValue:
- case objectValue:
- //JSON_ASSERT_MESSAGE( false, "Type is not convertible to double" );
- JSON_ASSERT( false );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable;
-}
-
-bool
-Value::asBool() const
-{
- switch ( type_ )
- {
- case nullValue:
- return false;
- case intValue:
- case uintValue:
- return value_.int_ != 0;
- case realValue:
- return value_.real_ != 0.0;
- case booleanValue:
- return value_.bool_;
- case stringValue:
- return value_.string_ && value_.string_[0] != 0;
- case arrayValue:
- case objectValue:
- return value_.map_->size() != 0;
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return false; // unreachable;
-}
-
-
-bool
-Value::isConvertibleTo( ValueType other ) const
-{
- switch ( type_ )
- {
- case nullValue:
- return true;
- case intValue:
- return ( other == nullValue && value_.int_ == 0 )
- || other == intValue
- || ( other == uintValue && value_.int_ >= 0 )
- || other == realValue
- || other == stringValue
- || other == booleanValue;
- case uintValue:
- return ( other == nullValue && value_.uint_ == 0 )
- || ( other == intValue && value_.uint_ <= (unsigned)maxInt )
- || other == uintValue
- || other == realValue
- || other == stringValue
- || other == booleanValue;
- case realValue:
- return ( other == nullValue && value_.real_ == 0.0 )
- || ( other == intValue && value_.real_ >= minInt && value_.real_ <= maxInt )
- || ( other == uintValue && value_.real_ >= 0 && value_.real_ <= maxUInt )
- || other == realValue
- || other == stringValue
- || other == booleanValue;
- case booleanValue:
- return ( other == nullValue && value_.bool_ == false )
- || other == intValue
- || other == uintValue
- || other == realValue
- || other == stringValue
- || other == booleanValue;
- case stringValue:
- return other == stringValue
- || ( other == nullValue && (!value_.string_ || value_.string_[0] == 0) );
- case arrayValue:
- return other == arrayValue
- || ( other == nullValue && value_.map_->size() == 0 );
- case objectValue:
- return other == objectValue
- || ( other == nullValue && value_.map_->size() == 0 );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return false; // unreachable;
-}
-
-
-/// Number of values in array or object
-Value::UInt
-Value::size() const
-{
- switch ( type_ )
- {
- case nullValue:
- case intValue:
- case uintValue:
- case realValue:
- case booleanValue:
- case stringValue:
- return 0;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue: // size of the array is highest index + 1
- if ( !value_.map_->empty() )
- {
- ObjectValues::const_iterator itLast = value_.map_->end();
- --itLast;
- return (*itLast).first.index()+1;
- }
- return 0;
- case objectValue:
- return Int( value_.map_->size() );
-#else
- case arrayValue:
- return Int( value_.array_->size() );
- case objectValue:
- return Int( value_.map_->size() );
-#endif
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable;
-}
-
-
-bool
-Value::empty() const
-{
- if ( isNull() || isArray() || isObject() )
- return size() == 0u;
- else
- return false;
-}
-
-
-bool
-Value::operator!() const
-{
- return isNull();
-}
-
-
-void
-Value::clear()
-{
- JSON_ASSERT( type_ == nullValue || type_ == arrayValue || type_ == objectValue );
-
- switch ( type_ )
- {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- value_.map_->clear();
- break;
-#else
- case arrayValue:
- value_.array_->clear();
- break;
- case objectValue:
- value_.map_->clear();
- break;
-#endif
- default:
- break;
- }
-}
-
-void
-Value::resize( UInt newSize )
-{
- JSON_ASSERT( type_ == nullValue || type_ == arrayValue );
- if ( type_ == nullValue )
- *this = Value( arrayValue );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- UInt oldSize = size();
- if ( newSize == 0 )
- clear();
- else if ( newSize > oldSize )
- (*this)[ newSize - 1 ];
- else
- {
- for ( UInt index = newSize; index < oldSize; ++index )
- value_.map_->erase( index );
- assert( size() == newSize );
- }
-#else
- value_.array_->resize( newSize );
-#endif
-}
-
-
-Value &
-Value::operator[]( UInt index )
-{
- JSON_ASSERT( type_ == nullValue || type_ == arrayValue );
- if ( type_ == nullValue )
- *this = Value( arrayValue );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString key( index );
- ObjectValues::iterator it = value_.map_->lower_bound( key );
- if ( it != value_.map_->end() && (*it).first == key )
- return (*it).second;
-
- ObjectValues::value_type defaultValue( key, null );
- it = value_.map_->insert( it, defaultValue );
- return (*it).second;
-#else
- return value_.array_->resolveReference( index );
-#endif
-}
-
-
-const Value &
-Value::operator[]( UInt index ) const
-{
- JSON_ASSERT( type_ == nullValue || type_ == arrayValue );
- if ( type_ == nullValue )
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString key( index );
- ObjectValues::const_iterator it = value_.map_->find( key );
- if ( it == value_.map_->end() )
- return null;
- return (*it).second;
-#else
- Value *value = value_.array_->find( index );
- return value ? *value : null;
-#endif
-}
-
-
-Value &
-Value::operator[]( const char *key )
-{
- return resolveReference( key, false );
-}
-
-
-Value &
-Value::resolveReference( const char *key,
- bool isStatic )
-{
- JSON_ASSERT( type_ == nullValue || type_ == objectValue );
- if ( type_ == nullValue )
- *this = Value( objectValue );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString actualKey( key, isStatic ? CZString::noDuplication
- : CZString::duplicateOnCopy );
- ObjectValues::iterator it = value_.map_->lower_bound( actualKey );
- if ( it != value_.map_->end() && (*it).first == actualKey )
- return (*it).second;
-
- ObjectValues::value_type defaultValue( actualKey, null );
- it = value_.map_->insert( it, defaultValue );
- Value &value = (*it).second;
- return value;
-#else
- return value_.map_->resolveReference( key, isStatic );
-#endif
-}
-
-
-Value
-Value::get( UInt index,
- const Value &defaultValue ) const
-{
- const Value *value = &((*this)[index]);
- return value == &null ? defaultValue : *value;
-}
-
-
-bool
-Value::isValidIndex( UInt index ) const
-{
- return index < size();
-}
-
-
-
-const Value &
-Value::operator[]( const char *key ) const
-{
- JSON_ASSERT( type_ == nullValue || type_ == objectValue );
- if ( type_ == nullValue )
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString actualKey( key, CZString::noDuplication );
- ObjectValues::const_iterator it = value_.map_->find( actualKey );
- if ( it == value_.map_->end() )
- return null;
- return (*it).second;
-#else
- const Value *value = value_.map_->find( key );
- return value ? *value : null;
-#endif
-}
-
-
-Value &
-Value::operator[]( const std::string &key )
-{
- return (*this)[ key.c_str() ];
-}
-
-
-const Value &
-Value::operator[]( const std::string &key ) const
-{
- return (*this)[ key.c_str() ];
-}
-
-Value &
-Value::operator[]( const StaticString &key )
-{
- return resolveReference( key, true );
-}
-
-
-# ifdef JSON_USE_CPPTL
-Value &
-Value::operator[]( const CppTL::ConstString &key )
-{
- return (*this)[ key.c_str() ];
-}
-
-
-const Value &
-Value::operator[]( const CppTL::ConstString &key ) const
-{
- return (*this)[ key.c_str() ];
-}
-# endif
-
-
-Value &
-Value::append( const Value &value )
-{
- return (*this)[size()] = value;
-}
-
-
-Value
-Value::get( const char *key,
- const Value &defaultValue ) const
-{
- const Value *value = &((*this)[key]);
- return value == &null ? defaultValue : *value;
-}
-
-
-Value
-Value::get( const std::string &key,
- const Value &defaultValue ) const
-{
- return get( key.c_str(), defaultValue );
-}
-
-Value
-Value::removeMember( const char* key )
-{
- JSON_ASSERT( type_ == nullValue || type_ == objectValue );
- if ( type_ == nullValue )
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString actualKey( key, CZString::noDuplication );
- ObjectValues::iterator it = value_.map_->find( actualKey );
- if ( it == value_.map_->end() )
- return null;
- Value old(it->second);
- value_.map_->erase(it);
- return old;
-#else
- Value *value = value_.map_->find( key );
- if (value){
- Value old(*value);
- value_.map_.remove( key );
- return old;
- } else {
- return null;
- }
-#endif
-}
-
-Value
-Value::removeMember( const std::string &key )
-{
- return removeMember( key.c_str() );
-}
-
-# ifdef JSON_USE_CPPTL
-Value
-Value::get( const CppTL::ConstString &key,
- const Value &defaultValue ) const
-{
- return get( key.c_str(), defaultValue );
-}
-# endif
-
-bool
-Value::isMember( const char *key ) const
-{
- const Value *value = &((*this)[key]);
- return value != &null;
-}
-
-
-bool
-Value::isMember( const std::string &key ) const
-{
- return isMember( key.c_str() );
-}
-
-
-# ifdef JSON_USE_CPPTL
-bool
-Value::isMember( const CppTL::ConstString &key ) const
-{
- return isMember( key.c_str() );
-}
-#endif
-
-Value::Members
-Value::getMemberNames() const
-{
- JSON_ASSERT( type_ == nullValue || type_ == objectValue );
- if ( type_ == nullValue )
- return Value::Members();
- Members members;
- members.reserve( value_.map_->size() );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- ObjectValues::const_iterator it = value_.map_->begin();
- ObjectValues::const_iterator itEnd = value_.map_->end();
- for ( ; it != itEnd; ++it )
- members.push_back( std::string( (*it).first.c_str() ) );
-#else
- ValueInternalMap::IteratorState it;
- ValueInternalMap::IteratorState itEnd;
- value_.map_->makeBeginIterator( it );
- value_.map_->makeEndIterator( itEnd );
- for ( ; !ValueInternalMap::equals( it, itEnd ); ValueInternalMap::increment(it) )
- members.push_back( std::string( ValueInternalMap::key( it ) ) );
-#endif
- return members;
-}
-//
-//# ifdef JSON_USE_CPPTL
-//EnumMemberNames
-//Value::enumMemberNames() const
-//{
-// if ( type_ == objectValue )
-// {
-// return CppTL::Enum::any( CppTL::Enum::transform(
-// CppTL::Enum::keys( *(value_.map_), CppTL::Type<const CZString &>() ),
-// MemberNamesTransform() ) );
-// }
-// return EnumMemberNames();
-//}
-//
-//
-//EnumValues
-//Value::enumValues() const
-//{
-// if ( type_ == objectValue || type_ == arrayValue )
-// return CppTL::Enum::anyValues( *(value_.map_),
-// CppTL::Type<const Value &>() );
-// return EnumValues();
-//}
-//
-//# endif
-
-
-bool
-Value::isNull() const
-{
- return type_ == nullValue;
-}
-
-
-bool
-Value::isBool() const
-{
- return type_ == booleanValue;
-}
-
-
-bool
-Value::isInt() const
-{
- return type_ == intValue;
-}
-
-
-bool
-Value::isUInt() const
-{
- return type_ == uintValue;
-}
-
-
-bool
-Value::isIntegral() const
-{
- return type_ == intValue
- || type_ == uintValue
- || type_ == booleanValue;
-}
-
-
-bool
-Value::isDouble() const
-{
- return type_ == realValue;
-}
-
-
-bool
-Value::isNumeric() const
-{
- return isIntegral() || isDouble();
-}
-
-
-bool
-Value::isString() const
-{
- return type_ == stringValue;
-}
-
-
-bool
-Value::isArray() const
-{
- return type_ == nullValue || type_ == arrayValue;
-}
-
-
-bool
-Value::isObject() const
-{
- return type_ == nullValue || type_ == objectValue;
-}
-
-
-void
-Value::setComment( const char *comment,
- CommentPlacement placement )
-{
- if ( !comments_ )
- comments_ = new CommentInfo[numberOfCommentPlacement];
- comments_[placement].setComment( comment );
-}
-
-
-void
-Value::setComment( const std::string &comment,
- CommentPlacement placement )
-{
- setComment( comment.c_str(), placement );
-}
-
-
-bool
-Value::hasComment( CommentPlacement placement ) const
-{
- return comments_ != 0 && comments_[placement].comment_ != 0;
-}
-
-std::string
-Value::getComment( CommentPlacement placement ) const
-{
- if ( hasComment(placement) )
- return comments_[placement].comment_;
- return "";
-}
-
-
-std::string
-Value::toStyledString() const
-{
- StyledWriter writer;
- return writer.write( *this );
-}
-
-
-Value::const_iterator
-Value::begin() const
-{
- switch ( type_ )
- {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if ( value_.array_ )
- {
- ValueInternalArray::IteratorState it;
- value_.array_->makeBeginIterator( it );
- return const_iterator( it );
- }
- break;
- case objectValue:
- if ( value_.map_ )
- {
- ValueInternalMap::IteratorState it;
- value_.map_->makeBeginIterator( it );
- return const_iterator( it );
- }
- break;
-#else
- case arrayValue:
- case objectValue:
- if ( value_.map_ )
- return const_iterator( value_.map_->begin() );
- break;
-#endif
- default:
- break;
- }
- return const_iterator();
-}
-
-Value::const_iterator
-Value::end() const
-{
- switch ( type_ )
- {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if ( value_.array_ )
- {
- ValueInternalArray::IteratorState it;
- value_.array_->makeEndIterator( it );
- return const_iterator( it );
- }
- break;
- case objectValue:
- if ( value_.map_ )
- {
- ValueInternalMap::IteratorState it;
- value_.map_->makeEndIterator( it );
- return const_iterator( it );
- }
- break;
-#else
- case arrayValue:
- case objectValue:
- if ( value_.map_ )
- return const_iterator( value_.map_->end() );
- break;
-#endif
- default:
- break;
- }
- return const_iterator();
-}
-
-
-Value::iterator
-Value::begin()
-{
- switch ( type_ )
- {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if ( value_.array_ )
- {
- ValueInternalArray::IteratorState it;
- value_.array_->makeBeginIterator( it );
- return iterator( it );
- }
- break;
- case objectValue:
- if ( value_.map_ )
- {
- ValueInternalMap::IteratorState it;
- value_.map_->makeBeginIterator( it );
- return iterator( it );
- }
- break;
-#else
- case arrayValue:
- case objectValue:
- if ( value_.map_ )
- return iterator( value_.map_->begin() );
- break;
-#endif
- default:
- break;
- }
- return iterator();
-}
-
-Value::iterator
-Value::end()
-{
- switch ( type_ )
- {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if ( value_.array_ )
- {
- ValueInternalArray::IteratorState it;
- value_.array_->makeEndIterator( it );
- return iterator( it );
- }
- break;
- case objectValue:
- if ( value_.map_ )
- {
- ValueInternalMap::IteratorState it;
- value_.map_->makeEndIterator( it );
- return iterator( it );
- }
- break;
-#else
- case arrayValue:
- case objectValue:
- if ( value_.map_ )
- return iterator( value_.map_->end() );
- break;
-#endif
- default:
- break;
- }
- return iterator();
-}
-
-
-// class PathArgument
-// //////////////////////////////////////////////////////////////////
-
-PathArgument::PathArgument()
- : kind_( kindNone )
-{
-}
-
-
-PathArgument::PathArgument( Value::UInt index )
- : index_( index )
- , kind_( kindIndex )
-{
-}
-
-
-PathArgument::PathArgument( const char *key )
- : key_( key )
- , kind_( kindKey )
-{
-}
-
-
-PathArgument::PathArgument( const std::string &key )
- : key_( key.c_str() )
- , kind_( kindKey )
-{
-}
-
-// class Path
-// //////////////////////////////////////////////////////////////////
-
-Path::Path( const std::string &path,
- const PathArgument &a1,
- const PathArgument &a2,
- const PathArgument &a3,
- const PathArgument &a4,
- const PathArgument &a5 )
-{
- InArgs in;
- in.push_back( &a1 );
- in.push_back( &a2 );
- in.push_back( &a3 );
- in.push_back( &a4 );
- in.push_back( &a5 );
- makePath( path, in );
-}
-
-
-void
-Path::makePath( const std::string &path,
- const InArgs &in )
-{
- const char *current = path.c_str();
- const char *end = current + path.length();
- InArgs::const_iterator itInArg = in.begin();
- while ( current != end )
- {
- if ( *current == '[' )
- {
- ++current;
- if ( *current == '%' )
- addPathInArg( path, in, itInArg, PathArgument::kindIndex );
- else
- {
- Value::UInt index = 0;
- for ( ; current != end && *current >= '0' && *current <= '9'; ++current )
- index = index * 10 + Value::UInt(*current - '0');
- args_.push_back( index );
- }
- if ( current == end || *current++ != ']' )
- invalidPath( path, int(current - path.c_str()) );
- }
- else if ( *current == '%' )
- {
- addPathInArg( path, in, itInArg, PathArgument::kindKey );
- ++current;
- }
- else if ( *current == '.' )
- {
- ++current;
- }
- else
- {
- const char *beginName = current;
- while ( current != end && !strchr( "[.", *current ) )
- ++current;
- args_.push_back( std::string( beginName, current ) );
- }
- }
-}
-
-
-void
-Path::addPathInArg( const std::string &path,
- const InArgs &in,
- InArgs::const_iterator &itInArg,
- PathArgument::Kind kind )
-{
- if ( itInArg == in.end() )
- {
- // Error: missing argument %d
- }
- else if ( (*itInArg)->kind_ != kind )
- {
- // Error: bad argument type
- }
- else
- {
- args_.push_back( **itInArg );
- }
-}
-
-
-void
-Path::invalidPath( const std::string &path,
- int location )
-{
- // Error: invalid path.
-}
-
-
-const Value &
-Path::resolve( const Value &root ) const
-{
- const Value *node = &root;
- for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it )
- {
- const PathArgument &arg = *it;
- if ( arg.kind_ == PathArgument::kindIndex )
- {
- if ( !node->isArray() || node->isValidIndex( arg.index_ ) )
- {
- // Error: unable to resolve path (array value expected at position...
- }
- node = &((*node)[arg.index_]);
- }
- else if ( arg.kind_ == PathArgument::kindKey )
- {
- if ( !node->isObject() )
- {
- // Error: unable to resolve path (object value expected at position...)
- }
- node = &((*node)[arg.key_]);
- if ( node == &Value::null )
- {
- // Error: unable to resolve path (object has no member named '' at position...)
- }
- }
- }
- return *node;
-}
-
-
-Value
-Path::resolve( const Value &root,
- const Value &defaultValue ) const
-{
- const Value *node = &root;
- for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it )
- {
- const PathArgument &arg = *it;
- if ( arg.kind_ == PathArgument::kindIndex )
- {
- if ( !node->isArray() || node->isValidIndex( arg.index_ ) )
- return defaultValue;
- node = &((*node)[arg.index_]);
- }
- else if ( arg.kind_ == PathArgument::kindKey )
- {
- if ( !node->isObject() )
- return defaultValue;
- node = &((*node)[arg.key_]);
- if ( node == &Value::null )
- return defaultValue;
- }
- }
- return *node;
-}
-
-
-Value &
-Path::make( Value &root ) const
-{
- Value *node = &root;
- for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it )
- {
- const PathArgument &arg = *it;
- if ( arg.kind_ == PathArgument::kindIndex )
- {
- if ( !node->isArray() )
- {
- // Error: node is not an array at position ...
- }
- node = &((*node)[arg.index_]);
- }
- else if ( arg.kind_ == PathArgument::kindKey )
- {
- if ( !node->isObject() )
- {
- // Error: node is not an object at position...
- }
- node = &((*node)[arg.key_]);
- }
- }
- return *node;
-}
-
-
-} // namespace Json
diff --git a/lib/jsoncpp/src/lib_json/json_valueiterator.inl b/lib/jsoncpp/src/lib_json/json_valueiterator.inl
deleted file mode 100644
index 736e260ea..000000000
--- a/lib/jsoncpp/src/lib_json/json_valueiterator.inl
+++ /dev/null
@@ -1,292 +0,0 @@
-// included by json_value.cpp
-// everything is within Json namespace
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueIteratorBase
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueIteratorBase::ValueIteratorBase()
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- : current_()
- , isNull_( true )
-{
-}
-#else
- : isArray_( true )
- , isNull_( true )
-{
- iterator_.array_ = ValueInternalArray::IteratorState();
-}
-#endif
-
-
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
-ValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator &current )
- : current_( current )
- , isNull_( false )
-{
-}
-#else
-ValueIteratorBase::ValueIteratorBase( const ValueInternalArray::IteratorState &state )
- : isArray_( true )
-{
- iterator_.array_ = state;
-}
-
-
-ValueIteratorBase::ValueIteratorBase( const ValueInternalMap::IteratorState &state )
- : isArray_( false )
-{
- iterator_.map_ = state;
-}
-#endif
-
-Value &
-ValueIteratorBase::deref() const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- return current_->second;
-#else
- if ( isArray_ )
- return ValueInternalArray::dereference( iterator_.array_ );
- return ValueInternalMap::value( iterator_.map_ );
-#endif
-}
-
-
-void
-ValueIteratorBase::increment()
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- ++current_;
-#else
- if ( isArray_ )
- ValueInternalArray::increment( iterator_.array_ );
- ValueInternalMap::increment( iterator_.map_ );
-#endif
-}
-
-
-void
-ValueIteratorBase::decrement()
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- --current_;
-#else
- if ( isArray_ )
- ValueInternalArray::decrement( iterator_.array_ );
- ValueInternalMap::decrement( iterator_.map_ );
-#endif
-}
-
-
-ValueIteratorBase::difference_type
-ValueIteratorBase::computeDistance( const SelfType &other ) const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
-# ifdef JSON_USE_CPPTL_SMALLMAP
- return current_ - other.current_;
-# else
- // Iterator for null value are initialized using the default
- // constructor, which initialize current_ to the default
- // std::map::iterator. As begin() and end() are two instance
- // of the default std::map::iterator, they can not be compared.
- // To allow this, we handle this comparison specifically.
- if ( isNull_ && other.isNull_ )
- {
- return 0;
- }
-
-
- // Usage of std::distance is not portable (does not compile with Sun Studio 12 RogueWave STL,
- // which is the one used by default).
- // Using a portable hand-made version for non random iterator instead:
- // return difference_type( std::distance( current_, other.current_ ) );
- difference_type myDistance = 0;
- for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it )
- {
- ++myDistance;
- }
- return myDistance;
-# endif
-#else
- if ( isArray_ )
- return ValueInternalArray::distance( iterator_.array_, other.iterator_.array_ );
- return ValueInternalMap::distance( iterator_.map_, other.iterator_.map_ );
-#endif
-}
-
-
-bool
-ValueIteratorBase::isEqual( const SelfType &other ) const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- if ( isNull_ )
- {
- return other.isNull_;
- }
- return current_ == other.current_;
-#else
- if ( isArray_ )
- return ValueInternalArray::equals( iterator_.array_, other.iterator_.array_ );
- return ValueInternalMap::equals( iterator_.map_, other.iterator_.map_ );
-#endif
-}
-
-
-void
-ValueIteratorBase::copy( const SelfType &other )
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- current_ = other.current_;
-#else
- if ( isArray_ )
- iterator_.array_ = other.iterator_.array_;
- iterator_.map_ = other.iterator_.map_;
-#endif
-}
-
-
-Value
-ValueIteratorBase::key() const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- const Value::CZString czstring = (*current_).first;
- if ( czstring.c_str() )
- {
- if ( czstring.isStaticString() )
- return Value( StaticString( czstring.c_str() ) );
- return Value( czstring.c_str() );
- }
- return Value( czstring.index() );
-#else
- if ( isArray_ )
- return Value( ValueInternalArray::indexOf( iterator_.array_ ) );
- bool isStatic;
- const char *memberName = ValueInternalMap::key( iterator_.map_, isStatic );
- if ( isStatic )
- return Value( StaticString( memberName ) );
- return Value( memberName );
-#endif
-}
-
-
-UInt
-ValueIteratorBase::index() const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- const Value::CZString czstring = (*current_).first;
- if ( !czstring.c_str() )
- return czstring.index();
- return Value::UInt( -1 );
-#else
- if ( isArray_ )
- return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) );
- return Value::UInt( -1 );
-#endif
-}
-
-
-const char *
-ValueIteratorBase::memberName() const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- const char *name = (*current_).first.c_str();
- return name ? name : "";
-#else
- if ( !isArray_ )
- return ValueInternalMap::key( iterator_.map_ );
- return "";
-#endif
-}
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueConstIterator
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueConstIterator::ValueConstIterator()
-{
-}
-
-
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
-ValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator &current )
- : ValueIteratorBase( current )
-{
-}
-#else
-ValueConstIterator::ValueConstIterator( const ValueInternalArray::IteratorState &state )
- : ValueIteratorBase( state )
-{
-}
-
-ValueConstIterator::ValueConstIterator( const ValueInternalMap::IteratorState &state )
- : ValueIteratorBase( state )
-{
-}
-#endif
-
-ValueConstIterator &
-ValueConstIterator::operator =( const ValueIteratorBase &other )
-{
- copy( other );
- return *this;
-}
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueIterator
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueIterator::ValueIterator()
-{
-}
-
-
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
-ValueIterator::ValueIterator( const Value::ObjectValues::iterator &current )
- : ValueIteratorBase( current )
-{
-}
-#else
-ValueIterator::ValueIterator( const ValueInternalArray::IteratorState &state )
- : ValueIteratorBase( state )
-{
-}
-
-ValueIterator::ValueIterator( const ValueInternalMap::IteratorState &state )
- : ValueIteratorBase( state )
-{
-}
-#endif
-
-ValueIterator::ValueIterator( const ValueConstIterator &other )
- : ValueIteratorBase( other )
-{
-}
-
-ValueIterator::ValueIterator( const ValueIterator &other )
- : ValueIteratorBase( other )
-{
-}
-
-ValueIterator &
-ValueIterator::operator =( const SelfType &other )
-{
- copy( other );
- return *this;
-}
diff --git a/lib/jsoncpp/src/lib_json/json_writer.cpp b/lib/jsoncpp/src/lib_json/json_writer.cpp
deleted file mode 100644
index eff3fabeb..000000000
--- a/lib/jsoncpp/src/lib_json/json_writer.cpp
+++ /dev/null
@@ -1,829 +0,0 @@
-#include "../../include/json/writer.h"
-#include <utility>
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <iostream>
-#include <sstream>
-#include <iomanip>
-
-#if _MSC_VER >= 1400 // VC++ 8.0
-#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated.
-#endif
-
-namespace Json {
-
-static bool isControlCharacter(char ch)
-{
- return ch > 0 && ch <= 0x1F;
-}
-
-static bool containsControlCharacter( const char* str )
-{
- while ( *str )
- {
- if ( isControlCharacter( *(str++) ) )
- return true;
- }
- return false;
-}
-static void uintToString( unsigned int value,
- char *&current )
-{
- *--current = 0;
- do
- {
- *--current = (value % 10) + '0';
- value /= 10;
- }
- while ( value != 0 );
-}
-
-std::string valueToString( Int value )
-{
- char buffer[32];
- char *current = buffer + sizeof(buffer);
- bool isNegative = value < 0;
- if ( isNegative )
- value = -value;
- uintToString( UInt(value), current );
- if ( isNegative )
- *--current = '-';
- assert( current >= buffer );
- return current;
-}
-
-
-std::string valueToString( UInt value )
-{
- char buffer[32];
- char *current = buffer + sizeof(buffer);
- uintToString( value, current );
- assert( current >= buffer );
- return current;
-}
-
-std::string valueToString( double value )
-{
- char buffer[32];
-#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with visual studio 2005 to avoid warning.
- sprintf_s(buffer, sizeof(buffer), "%#.16g", value);
-#else
- sprintf(buffer, "%#.16g", value);
-#endif
- char* ch = buffer + strlen(buffer) - 1;
- if (*ch != '0') return buffer; // nothing to truncate, so save time
- while(ch > buffer && *ch == '0'){
- --ch;
- }
- char* last_nonzero = ch;
- while(ch >= buffer){
- switch(*ch){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- --ch;
- continue;
- case '.':
- // Truncate zeroes to save bytes in output, but keep one.
- *(last_nonzero+2) = '\0';
- return buffer;
- default:
- return buffer;
- }
- }
- return buffer;
-}
-
-
-std::string valueToString( bool value )
-{
- return value ? "true" : "false";
-}
-
-std::string valueToQuotedString( const char *value )
-{
- // Not sure how to handle unicode...
- if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL && !containsControlCharacter( value ))
- return std::string("\"") + value + "\"";
- // We have to walk value and escape any special characters.
- // Appending to std::string is not efficient, but this should be rare.
- // (Note: forward slashes are *not* rare, but I am not escaping them.)
- unsigned maxsize = strlen(value)*2 + 3; // allescaped+quotes+NULL
- std::string result;
- result.reserve(maxsize); // to avoid lots of mallocs
- result += "\"";
- for (const char* c=value; *c != 0; ++c)
- {
- switch(*c)
- {
- case '\"':
- result += "\\\"";
- break;
- case '\\':
- result += "\\\\";
- break;
- case '\b':
- result += "\\b";
- break;
- case '\f':
- result += "\\f";
- break;
- case '\n':
- result += "\\n";
- break;
- case '\r':
- result += "\\r";
- break;
- case '\t':
- result += "\\t";
- break;
- //case '/':
- // Even though \/ is considered a legal escape in JSON, a bare
- // slash is also legal, so I see no reason to escape it.
- // (I hope I am not misunderstanding something.
- // blep notes: actually escaping \/ may be useful in javascript to avoid </
- // sequence.
- // Should add a flag to allow this compatibility mode and prevent this
- // sequence from occurring.
- default:
- if ( isControlCharacter( *c ) )
- {
- std::ostringstream oss;
- oss << "\\u" << std::hex << std::uppercase << std::setfill('0') << std::setw(4) << static_cast<int>(*c);
- result += oss.str();
- }
- else
- {
- result += *c;
- }
- break;
- }
- }
- result += "\"";
- return result;
-}
-
-// Class Writer
-// //////////////////////////////////////////////////////////////////
-Writer::~Writer()
-{
-}
-
-
-// Class FastWriter
-// //////////////////////////////////////////////////////////////////
-
-FastWriter::FastWriter()
- : yamlCompatiblityEnabled_( false )
-{
-}
-
-
-void
-FastWriter::enableYAMLCompatibility()
-{
- yamlCompatiblityEnabled_ = true;
-}
-
-
-std::string
-FastWriter::write( const Value &root )
-{
- document_ = "";
- writeValue( root );
- document_ += "\n";
- return document_;
-}
-
-
-void
-FastWriter::writeValue( const Value &value )
-{
- switch ( value.type() )
- {
- case nullValue:
- document_ += "null";
- break;
- case intValue:
- document_ += valueToString( value.asInt() );
- break;
- case uintValue:
- document_ += valueToString( value.asUInt() );
- break;
- case realValue:
- document_ += valueToString( value.asDouble() );
- break;
- case stringValue:
- document_ += valueToQuotedString( value.asCString() );
- break;
- case booleanValue:
- document_ += valueToString( value.asBool() );
- break;
- case arrayValue:
- {
- document_ += "[";
- int size = value.size();
- for ( int index =0; index < size; ++index )
- {
- if ( index > 0 )
- document_ += ",";
- writeValue( value[index] );
- }
- document_ += "]";
- }
- break;
- case objectValue:
- {
- Value::Members members( value.getMemberNames() );
- document_ += "{";
- for ( Value::Members::iterator it = members.begin();
- it != members.end();
- ++it )
- {
- const std::string &name = *it;
- if ( it != members.begin() )
- document_ += ",";
- document_ += valueToQuotedString( name.c_str() );
- document_ += yamlCompatiblityEnabled_ ? ": "
- : ":";
- writeValue( value[name] );
- }
- document_ += "}";
- }
- break;
- }
-}
-
-
-// Class StyledWriter
-// //////////////////////////////////////////////////////////////////
-
-StyledWriter::StyledWriter()
- : rightMargin_( 74 )
- , indentSize_( 3 )
-{
-}
-
-
-std::string
-StyledWriter::write( const Value &root )
-{
- document_ = "";
- addChildValues_ = false;
- indentString_ = "";
- writeCommentBeforeValue( root );
- writeValue( root );
- writeCommentAfterValueOnSameLine( root );
- document_ += "\n";
- return document_;
-}
-
-
-void
-StyledWriter::writeValue( const Value &value )
-{
- switch ( value.type() )
- {
- case nullValue:
- pushValue( "null" );
- break;
- case intValue:
- pushValue( valueToString( value.asInt() ) );
- break;
- case uintValue:
- pushValue( valueToString( value.asUInt() ) );
- break;
- case realValue:
- pushValue( valueToString( value.asDouble() ) );
- break;
- case stringValue:
- pushValue( valueToQuotedString( value.asCString() ) );
- break;
- case booleanValue:
- pushValue( valueToString( value.asBool() ) );
- break;
- case arrayValue:
- writeArrayValue( value);
- break;
- case objectValue:
- {
- Value::Members members( value.getMemberNames() );
- if ( members.empty() )
- pushValue( "{}" );
- else
- {
- writeWithIndent( "{" );
- indent();
- Value::Members::iterator it = members.begin();
- while ( true )
- {
- const std::string &name = *it;
- const Value &childValue = value[name];
- writeCommentBeforeValue( childValue );
- writeWithIndent( valueToQuotedString( name.c_str() ) );
- document_ += " : ";
- writeValue( childValue );
- if ( ++it == members.end() )
- {
- writeCommentAfterValueOnSameLine( childValue );
- break;
- }
- document_ += ",";
- writeCommentAfterValueOnSameLine( childValue );
- }
- unindent();
- writeWithIndent( "}" );
- }
- }
- break;
- }
-}
-
-
-void
-StyledWriter::writeArrayValue( const Value &value )
-{
- unsigned size = value.size();
- if ( size == 0 )
- pushValue( "[]" );
- else
- {
- bool isArrayMultiLine = isMultineArray( value );
- if ( isArrayMultiLine )
- {
- writeWithIndent( "[" );
- indent();
- bool hasChildValue = !childValues_.empty();
- unsigned index =0;
- while ( true )
- {
- const Value &childValue = value[index];
- writeCommentBeforeValue( childValue );
- if ( hasChildValue )
- writeWithIndent( childValues_[index] );
- else
- {
- writeIndent();
- writeValue( childValue );
- }
- if ( ++index == size )
- {
- writeCommentAfterValueOnSameLine( childValue );
- break;
- }
- document_ += ",";
- writeCommentAfterValueOnSameLine( childValue );
- }
- unindent();
- writeWithIndent( "]" );
- }
- else // output on a single line
- {
- assert( childValues_.size() == size );
- document_ += "[ ";
- for ( unsigned index =0; index < size; ++index )
- {
- if ( index > 0 )
- document_ += ", ";
- document_ += childValues_[index];
- }
- document_ += " ]";
- }
- }
-}
-
-
-bool
-StyledWriter::isMultineArray( const Value &value )
-{
- int size = value.size();
- bool isMultiLine = size*3 >= rightMargin_ ;
- childValues_.clear();
- for ( int index =0; index < size && !isMultiLine; ++index )
- {
- const Value &childValue = value[index];
- isMultiLine = isMultiLine ||
- ( (childValue.isArray() || childValue.isObject()) &&
- childValue.size() > 0 );
- }
- if ( !isMultiLine ) // check if line length > max line length
- {
- childValues_.reserve( size );
- addChildValues_ = true;
- int lineLength = 4 + (size-1)*2; // '[ ' + ', '*n + ' ]'
- for ( int index =0; index < size && !isMultiLine; ++index )
- {
- writeValue( value[index] );
- lineLength += int( childValues_[index].length() );
- isMultiLine = isMultiLine && hasCommentForValue( value[index] );
- }
- addChildValues_ = false;
- isMultiLine = isMultiLine || lineLength >= rightMargin_;
- }
- return isMultiLine;
-}
-
-
-void
-StyledWriter::pushValue( const std::string &value )
-{
- if ( addChildValues_ )
- childValues_.push_back( value );
- else
- document_ += value;
-}
-
-
-void
-StyledWriter::writeIndent()
-{
- if ( !document_.empty() )
- {
- char last = document_[document_.length()-1];
- if ( last == ' ' ) // already indented
- return;
- if ( last != '\n' ) // Comments may add new-line
- document_ += '\n';
- }
- document_ += indentString_;
-}
-
-
-void
-StyledWriter::writeWithIndent( const std::string &value )
-{
- writeIndent();
- document_ += value;
-}
-
-
-void
-StyledWriter::indent()
-{
- indentString_ += std::string( indentSize_, ' ' );
-}
-
-
-void
-StyledWriter::unindent()
-{
- assert( int(indentString_.size()) >= indentSize_ );
- indentString_.resize( indentString_.size() - indentSize_ );
-}
-
-
-void
-StyledWriter::writeCommentBeforeValue( const Value &root )
-{
- if ( !root.hasComment( commentBefore ) )
- return;
- document_ += normalizeEOL( root.getComment( commentBefore ) );
- document_ += "\n";
-}
-
-
-void
-StyledWriter::writeCommentAfterValueOnSameLine( const Value &root )
-{
- if ( root.hasComment( commentAfterOnSameLine ) )
- document_ += " " + normalizeEOL( root.getComment( commentAfterOnSameLine ) );
-
- if ( root.hasComment( commentAfter ) )
- {
- document_ += "\n";
- document_ += normalizeEOL( root.getComment( commentAfter ) );
- document_ += "\n";
- }
-}
-
-
-bool
-StyledWriter::hasCommentForValue( const Value &value )
-{
- return value.hasComment( commentBefore )
- || value.hasComment( commentAfterOnSameLine )
- || value.hasComment( commentAfter );
-}
-
-
-std::string
-StyledWriter::normalizeEOL( const std::string &text )
-{
- std::string normalized;
- normalized.reserve( text.length() );
- const char *begin = text.c_str();
- const char *end = begin + text.length();
- const char *current = begin;
- while ( current != end )
- {
- char c = *current++;
- if ( c == '\r' ) // mac or dos EOL
- {
- if ( *current == '\n' ) // convert dos EOL
- ++current;
- normalized += '\n';
- }
- else // handle unix EOL & other char
- normalized += c;
- }
- return normalized;
-}
-
-
-// Class StyledStreamWriter
-// //////////////////////////////////////////////////////////////////
-
-StyledStreamWriter::StyledStreamWriter( std::string indentation )
- : document_(NULL)
- , rightMargin_( 74 )
- , indentation_( indentation )
-{
-}
-
-
-void
-StyledStreamWriter::write( std::ostream &out, const Value &root )
-{
- document_ = &out;
- addChildValues_ = false;
- indentString_ = "";
- writeCommentBeforeValue( root );
- writeValue( root );
- writeCommentAfterValueOnSameLine( root );
- *document_ << "\n";
- document_ = NULL; // Forget the stream, for safety.
-}
-
-
-void
-StyledStreamWriter::writeValue( const Value &value )
-{
- switch ( value.type() )
- {
- case nullValue:
- pushValue( "null" );
- break;
- case intValue:
- pushValue( valueToString( value.asInt() ) );
- break;
- case uintValue:
- pushValue( valueToString( value.asUInt() ) );
- break;
- case realValue:
- pushValue( valueToString( value.asDouble() ) );
- break;
- case stringValue:
- pushValue( valueToQuotedString( value.asCString() ) );
- break;
- case booleanValue:
- pushValue( valueToString( value.asBool() ) );
- break;
- case arrayValue:
- writeArrayValue( value);
- break;
- case objectValue:
- {
- Value::Members members( value.getMemberNames() );
- if ( members.empty() )
- pushValue( "{}" );
- else
- {
- writeWithIndent( "{" );
- indent();
- Value::Members::iterator it = members.begin();
- while ( true )
- {
- const std::string &name = *it;
- const Value &childValue = value[name];
- writeCommentBeforeValue( childValue );
- writeWithIndent( valueToQuotedString( name.c_str() ) );
- *document_ << " : ";
- writeValue( childValue );
- if ( ++it == members.end() )
- {
- writeCommentAfterValueOnSameLine( childValue );
- break;
- }
- *document_ << ",";
- writeCommentAfterValueOnSameLine( childValue );
- }
- unindent();
- writeWithIndent( "}" );
- }
- }
- break;
- }
-}
-
-
-void
-StyledStreamWriter::writeArrayValue( const Value &value )
-{
- unsigned size = value.size();
- if ( size == 0 )
- pushValue( "[]" );
- else
- {
- bool isArrayMultiLine = isMultineArray( value );
- if ( isArrayMultiLine )
- {
- writeWithIndent( "[" );
- indent();
- bool hasChildValue = !childValues_.empty();
- unsigned index =0;
- while ( true )
- {
- const Value &childValue = value[index];
- writeCommentBeforeValue( childValue );
- if ( hasChildValue )
- writeWithIndent( childValues_[index] );
- else
- {
- writeIndent();
- writeValue( childValue );
- }
- if ( ++index == size )
- {
- writeCommentAfterValueOnSameLine( childValue );
- break;
- }
- *document_ << ",";
- writeCommentAfterValueOnSameLine( childValue );
- }
- unindent();
- writeWithIndent( "]" );
- }
- else // output on a single line
- {
- assert( childValues_.size() == size );
- *document_ << "[ ";
- for ( unsigned index =0; index < size; ++index )
- {
- if ( index > 0 )
- *document_ << ", ";
- *document_ << childValues_[index];
- }
- *document_ << " ]";
- }
- }
-}
-
-
-bool
-StyledStreamWriter::isMultineArray( const Value &value )
-{
- int size = value.size();
- bool isMultiLine = size*3 >= rightMargin_ ;
- childValues_.clear();
- for ( int index =0; index < size && !isMultiLine; ++index )
- {
- const Value &childValue = value[index];
- isMultiLine = isMultiLine ||
- ( (childValue.isArray() || childValue.isObject()) &&
- childValue.size() > 0 );
- }
- if ( !isMultiLine ) // check if line length > max line length
- {
- childValues_.reserve( size );
- addChildValues_ = true;
- int lineLength = 4 + (size-1)*2; // '[ ' + ', '*n + ' ]'
- for ( int index =0; index < size && !isMultiLine; ++index )
- {
- writeValue( value[index] );
- lineLength += int( childValues_[index].length() );
- isMultiLine = isMultiLine && hasCommentForValue( value[index] );
- }
- addChildValues_ = false;
- isMultiLine = isMultiLine || lineLength >= rightMargin_;
- }
- return isMultiLine;
-}
-
-
-void
-StyledStreamWriter::pushValue( const std::string &value )
-{
- if ( addChildValues_ )
- childValues_.push_back( value );
- else
- *document_ << value;
-}
-
-
-void
-StyledStreamWriter::writeIndent()
-{
- /*
- Some comments in this method would have been nice. ;-)
-
- if ( !document_.empty() )
- {
- char last = document_[document_.length()-1];
- if ( last == ' ' ) // already indented
- return;
- if ( last != '\n' ) // Comments may add new-line
- *document_ << '\n';
- }
- */
- *document_ << '\n' << indentString_;
-}
-
-
-void
-StyledStreamWriter::writeWithIndent( const std::string &value )
-{
- writeIndent();
- *document_ << value;
-}
-
-
-void
-StyledStreamWriter::indent()
-{
- indentString_ += indentation_;
-}
-
-
-void
-StyledStreamWriter::unindent()
-{
- assert( indentString_.size() >= indentation_.size() );
- indentString_.resize( indentString_.size() - indentation_.size() );
-}
-
-
-void
-StyledStreamWriter::writeCommentBeforeValue( const Value &root )
-{
- if ( !root.hasComment( commentBefore ) )
- return;
- *document_ << normalizeEOL( root.getComment( commentBefore ) );
- *document_ << "\n";
-}
-
-
-void
-StyledStreamWriter::writeCommentAfterValueOnSameLine( const Value &root )
-{
- if ( root.hasComment( commentAfterOnSameLine ) )
- *document_ << " " + normalizeEOL( root.getComment( commentAfterOnSameLine ) );
-
- if ( root.hasComment( commentAfter ) )
- {
- *document_ << "\n";
- *document_ << normalizeEOL( root.getComment( commentAfter ) );
- *document_ << "\n";
- }
-}
-
-
-bool
-StyledStreamWriter::hasCommentForValue( const Value &value )
-{
- return value.hasComment( commentBefore )
- || value.hasComment( commentAfterOnSameLine )
- || value.hasComment( commentAfter );
-}
-
-
-std::string
-StyledStreamWriter::normalizeEOL( const std::string &text )
-{
- std::string normalized;
- normalized.reserve( text.length() );
- const char *begin = text.c_str();
- const char *end = begin + text.length();
- const char *current = begin;
- while ( current != end )
- {
- char c = *current++;
- if ( c == '\r' ) // mac or dos EOL
- {
- if ( *current == '\n' ) // convert dos EOL
- ++current;
- normalized += '\n';
- }
- else // handle unix EOL & other char
- normalized += c;
- }
- return normalized;
-}
-
-
-std::ostream& operator<<( std::ostream &sout, const Value &root )
-{
- Json::StyledStreamWriter writer;
- writer.write(sout, root);
- return sout;
-}
-
-
-} // namespace Json
diff --git a/lib/jsoncpp/src/lib_json/sconscript b/lib/jsoncpp/src/lib_json/sconscript
deleted file mode 100644
index 6e7c6c8a0..000000000
--- a/lib/jsoncpp/src/lib_json/sconscript
+++ /dev/null
@@ -1,8 +0,0 @@
-Import( 'env buildLibrary' )
-
-buildLibrary( env, Split( """
- json_reader.cpp
- json_value.cpp
- json_writer.cpp
- """ ),
- 'json' )
diff --git a/lib/luaexpat/lxplib.c b/lib/luaexpat/lxplib.c
index 1a36104a8..ff62ed83e 100644
--- a/lib/luaexpat/lxplib.c
+++ b/lib/luaexpat/lxplib.c
@@ -38,6 +38,7 @@ struct lxp_userdata {
int tableref; /* table with callbacks for this parser */
enum XPState state;
luaL_Buffer *b; /* to concatenate sequences of cdata pieces */
+ int bufferCharData; /* whether to buffer cdata pieces */
};
typedef struct lxp_userdata lxp_userdata;
@@ -152,8 +153,13 @@ static void f_CharData (void *ud, const char *s, int len) {
lxp_userdata *xpu = (lxp_userdata *)ud;
if (xpu->state == XPSok) {
if (getHandle(xpu, CharDataKey) == 0) return; /* no handle */
- xpu->state = XPSstring;
- luaL_buffinit(xpu->L, xpu->b);
+ if(xpu->bufferCharData != 0) {
+ xpu->state = XPSstring;
+ luaL_buffinit(xpu->L, xpu->b);
+ } else {
+ lua_pushlstring(xpu->L, s, len);
+ docall(xpu, 1, 0);
+ }
}
if (xpu->state == XPSstring)
luaL_addlstring(xpu->b, s, len);
@@ -326,6 +332,16 @@ static void f_StartDoctypeDecl (void *ud, const XML_Char *doctypeName,
docall(xpu, 4, 0);
}
+static void f_XmlDecl (void *ud, const XML_Char *version,
+ const XML_Char *encoding,
+ int standalone) {
+ lxp_userdata *xpu = (lxp_userdata *)ud;
+ if (getHandle(xpu, XmlDeclKey) == 0) return; /* no handle */
+ lua_pushstring(xpu->L, version);
+ lua_pushstring(xpu->L, encoding);
+ lua_pushboolean(xpu->L, standalone);
+ docall(xpu, 3, 0);
+}
/* }====================================================== */
@@ -346,7 +362,7 @@ static void checkcallbacks (lua_State *L) {
"Default", "DefaultExpand", "StartElement", "EndElement",
"ExternalEntityRef", "StartNamespaceDecl", "EndNamespaceDecl",
"NotationDecl", "NotStandalone", "ProcessingInstruction",
- "UnparsedEntityDecl", "StartDoctypeDecl", NULL};
+ "UnparsedEntityDecl", "StartDoctypeDecl", "XmlDecl", NULL};
if (hasfield(L, "_nonstrict")) return;
lua_pushnil(L);
while (lua_next(L, 1)) {
@@ -364,8 +380,10 @@ static void checkcallbacks (lua_State *L) {
static int lxp_make_parser (lua_State *L) {
XML_Parser p;
+ int bufferCharData = (lua_type(L, 3) != LUA_TBOOLEAN) || (lua_toboolean(L, 3) != 0);
char sep = *luaL_optstring(L, 2, "");
lxp_userdata *xpu = createlxp(L);
+ xpu->bufferCharData = bufferCharData;
p = xpu->parser = (sep == '\0') ? XML_ParserCreate(NULL) :
XML_ParserCreateNS(NULL, sep);
if (!p)
@@ -401,6 +419,8 @@ static int lxp_make_parser (lua_State *L) {
XML_SetUnparsedEntityDeclHandler(p, f_UnparsedEntityDecl);
if (hasfield(L, StartDoctypeDeclKey))
XML_SetStartDoctypeDeclHandler(p, f_StartDoctypeDecl);
+ if (hasfield(L, XmlDeclKey))
+ XML_SetXmlDeclHandler(p, f_XmlDecl);
return 1;
}
@@ -524,11 +544,18 @@ static int lxp_stop (lua_State *L) {
#define luaL_Reg luaL_reg
#endif
+static int lxp_getcurrentbytecount (lua_State* L) {
+ lxp_userdata *xpu = checkparser(L, 1);
+ lua_pushinteger(L, XML_GetCurrentByteCount(xpu->parser));
+ return 1;
+}
+
static const struct luaL_Reg lxp_meths[] = {
{"parse", lxp_parse},
{"close", lxp_close},
{"__gc", parser_gc},
{"pos", lxp_pos},
+ {"getcurrentbytecount", lxp_getcurrentbytecount},
{"setencoding", lxp_setencoding},
{"getcallbacks", getcallbacks},
{"getbase", getbase},
@@ -588,12 +615,8 @@ int luaopen_lxp (lua_State *L) {
luaL_setfuncs (L, lxp_meths, 0);
lua_pop (L, 1); /* remove metatable */
- // _X 2013_04_09: Modified to allow embedding
- luaL_openlib (L, "lxp", lxp_funcs, 0);
- /*
lua_newtable (L);
luaL_setfuncs (L, lxp_funcs, 0);
- */
set_info (L);
return 1;
}
diff --git a/lib/luaexpat/lxplib.h b/lib/luaexpat/lxplib.h
index 9c0be4f78..4c7084c46 100644
--- a/lib/luaexpat/lxplib.h
+++ b/lib/luaexpat/lxplib.h
@@ -20,5 +20,6 @@
#define ProcessingInstructionKey "ProcessingInstruction"
#define UnparsedEntityDeclKey "UnparsedEntityDecl"
#define StartDoctypeDeclKey "StartDoctypeDecl"
+#define XmlDeclKey "XmlDecl"
int luaopen_lxp (lua_State *L);
diff --git a/lib/sqlite/CMakeLists.txt b/lib/sqlite/CMakeLists.txt
index 993dac146..b9471c1f2 100644
--- a/lib/sqlite/CMakeLists.txt
+++ b/lib/sqlite/CMakeLists.txt
@@ -25,7 +25,7 @@ endif()
# FreeBSD requires us to define this to get POSIX 2001 standard
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
- add_flags_cxx(-D__POSIX_VISIBLE=200112)
+ add_flags_cxx("-D_XOPEN_SOURCE=600")
endif()
add_library(sqlite ${SOURCE})
diff --git a/lib/tolua++/CMakeLists.txt b/lib/tolua++/CMakeLists.txt
index 12054323b..02883397e 100644
--- a/lib/tolua++/CMakeLists.txt
+++ b/lib/tolua++/CMakeLists.txt
@@ -53,4 +53,8 @@ if(UNIX)
target_link_libraries(tolua m ${DYNAMIC_LOADER})
endif()
+if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+ add_flags_lnk(-L/usr/local/lib)
+endif()
+
target_link_libraries(tolua tolualib lua)
diff --git a/lib/zlib/compress.c b/lib/zlib/compress.c
index ea4dfbe9d..6e9762676 100644
--- a/lib/zlib/compress.c
+++ b/lib/zlib/compress.c
@@ -29,7 +29,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
z_stream stream;
int err;
- stream.next_in = (Bytef*)source;
+ stream.next_in = (z_const Bytef *)source;
stream.avail_in = (uInt)sourceLen;
#ifdef MAXSEG_64K
/* Check for source > 64K on 16-bit machine: */
diff --git a/lib/zlib/deflate.c b/lib/zlib/deflate.c
index 9e4c2cbc8..696957705 100644
--- a/lib/zlib/deflate.c
+++ b/lib/zlib/deflate.c
@@ -1,5 +1,5 @@
/* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler
+ * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -52,7 +52,7 @@
#include "deflate.h"
const char deflate_copyright[] =
- " deflate 1.2.7 Copyright 1995-2012 Jean-loup Gailly and Mark Adler ";
+ " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -305,7 +305,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
s->pending_buf == Z_NULL) {
s->status = FINISH_STATE;
- strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
+ strm->msg = ERR_MSG(Z_MEM_ERROR);
deflateEnd (strm);
return Z_MEM_ERROR;
}
@@ -329,7 +329,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
uInt str, n;
int wrap;
unsigned avail;
- unsigned char *next;
+ z_const unsigned char *next;
if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL)
return Z_STREAM_ERROR;
@@ -359,7 +359,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
avail = strm->avail_in;
next = strm->next_in;
strm->avail_in = dictLength;
- strm->next_in = (Bytef *)dictionary;
+ strm->next_in = (z_const Bytef *)dictionary;
fill_window(s);
while (s->lookahead >= MIN_MATCH) {
str = s->strstart;
@@ -513,6 +513,8 @@ int ZEXPORT deflateParams(strm, level, strategy)
strm->total_in != 0) {
/* Flush the last buffer: */
err = deflate(strm, Z_BLOCK);
+ if (err == Z_BUF_ERROR && s->pending == 0)
+ err = Z_OK;
}
if (s->level != level) {
s->level = level;
diff --git a/lib/zlib/deflate.h b/lib/zlib/deflate.h
index fbac44d90..ce0299edd 100644
--- a/lib/zlib/deflate.h
+++ b/lib/zlib/deflate.h
@@ -104,7 +104,7 @@ typedef struct internal_state {
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
gz_headerp gzhead; /* gzip header information to write */
uInt gzindex; /* where in extra, name, or comment */
- Byte method; /* STORED (for zip only) or DEFLATED */
+ Byte method; /* can only be DEFLATED */
int last_flush; /* value of flush param for previous deflate call */
/* used by deflate.c: */
diff --git a/lib/zlib/gzguts.h b/lib/zlib/gzguts.h
index ee3f281aa..d87659d03 100644
--- a/lib/zlib/gzguts.h
+++ b/lib/zlib/gzguts.h
@@ -1,5 +1,5 @@
/* gzguts.h -- zlib internal header definitions for gz* operations
- * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -35,6 +35,13 @@
# include <io.h>
#endif
+#ifdef WINAPI_FAMILY
+# define open _open
+# define read _read
+# define write _write
+# define close _close
+#endif
+
#ifdef NO_DEFLATE /* for compatibility with old definition */
# define NO_GZCOMPRESS
#endif
@@ -60,7 +67,7 @@
#ifndef HAVE_VSNPRINTF
# ifdef MSDOS
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
- but for now we just assume it doesn't. */
+ but for now we just assume it doesn't. */
# define NO_vsnprintf
# endif
# ifdef __TURBOC__
@@ -88,6 +95,14 @@
# endif
#endif
+/* unlike snprintf (which is required in C99, yet still not supported by
+ Microsoft more than a decade later!), _snprintf does not guarantee null
+ termination of the result -- however this is only used in gzlib.c where
+ the result is assured to fit in the space provided */
+#ifdef _MSC_VER
+# define snprintf _snprintf
+#endif
+
#ifndef local
# define local static
#endif
@@ -127,7 +142,8 @@
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
#endif
-/* default i/o buffer size -- double this for output when reading */
+/* default i/o buffer size -- double this for output when reading (this and
+ twice this must be able to fit in an unsigned type) */
#define GZBUFSIZE 8192
/* gzip modes, also provide a little integrity check on the passed structure */
diff --git a/lib/zlib/gzlib.c b/lib/zlib/gzlib.c
index ca55c6ea9..fae202ef8 100644
--- a/lib/zlib/gzlib.c
+++ b/lib/zlib/gzlib.c
@@ -1,5 +1,5 @@
/* gzlib.c -- zlib functions common to reading and writing gzip files
- * Copyright (C) 2004, 2010, 2011, 2012 Mark Adler
+ * Copyright (C) 2004, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -108,7 +108,7 @@ local gzFile gz_open(path, fd, mode)
return NULL;
/* allocate gzFile structure to return */
- state = malloc(sizeof(gz_state));
+ state = (gz_statep)malloc(sizeof(gz_state));
if (state == NULL)
return NULL;
state->size = 0; /* no buffers allocated yet */
@@ -162,8 +162,10 @@ local gzFile gz_open(path, fd, mode)
break;
case 'F':
state->strategy = Z_FIXED;
+ break;
case 'T':
state->direct = 1;
+ break;
default: /* could consider as an error, but just ignore */
;
}
@@ -194,8 +196,8 @@ local gzFile gz_open(path, fd, mode)
}
else
#endif
- len = strlen(path);
- state->path = malloc(len + 1);
+ len = strlen((const char *)path);
+ state->path = (char *)malloc(len + 1);
if (state->path == NULL) {
free(state);
return NULL;
@@ -208,7 +210,11 @@ local gzFile gz_open(path, fd, mode)
*(state->path) = 0;
else
#endif
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(state->path, len + 1, "%s", (const char *)path);
+#else
strcpy(state->path, path);
+#endif
/* compute the flags for open() */
oflag =
@@ -236,7 +242,7 @@ local gzFile gz_open(path, fd, mode)
#ifdef _WIN32
fd == -2 ? _wopen(path, oflag, 0666) :
#endif
- open(path, oflag, 0666));
+ open((const char *)path, oflag, 0666));
if (state->fd == -1) {
free(state->path);
free(state);
@@ -282,9 +288,13 @@ gzFile ZEXPORT gzdopen(fd, mode)
char *path; /* identifier for error messages */
gzFile gz;
- if (fd == -1 || (path = malloc(7 + 3 * sizeof(int))) == NULL)
+ if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
return NULL;
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); /* for debugging */
+#else
sprintf(path, "<fd:%d>", fd); /* for debugging */
+#endif
gz = gz_open(path, fd, mode);
free(path);
return gz;
@@ -531,7 +541,8 @@ const char * ZEXPORT gzerror(file, errnum)
/* return error information */
if (errnum != NULL)
*errnum = state->err;
- return state->msg == NULL ? "" : state->msg;
+ return state->err == Z_MEM_ERROR ? "out of memory" :
+ (state->msg == NULL ? "" : state->msg);
}
/* -- see zlib.h -- */
@@ -582,21 +593,24 @@ void ZLIB_INTERNAL gz_error(state, err, msg)
if (msg == NULL)
return;
- /* for an out of memory error, save as static string */
- if (err == Z_MEM_ERROR) {
- state->msg = (char *)msg;
+ /* for an out of memory error, return literal string when requested */
+ if (err == Z_MEM_ERROR)
return;
- }
/* construct error message with path */
- if ((state->msg = malloc(strlen(state->path) + strlen(msg) + 3)) == NULL) {
+ if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
+ NULL) {
state->err = Z_MEM_ERROR;
- state->msg = (char *)"out of memory";
return;
}
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
+ "%s%s%s", state->path, ": ", msg);
+#else
strcpy(state->msg, state->path);
strcat(state->msg, ": ");
strcat(state->msg, msg);
+#endif
return;
}
diff --git a/lib/zlib/gzread.c b/lib/zlib/gzread.c
index 3493d34d4..bf4538eb2 100644
--- a/lib/zlib/gzread.c
+++ b/lib/zlib/gzread.c
@@ -1,5 +1,5 @@
/* gzread.c -- zlib functions for reading gzip files
- * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -58,7 +58,8 @@ local int gz_avail(state)
return -1;
if (state->eof == 0) {
if (strm->avail_in) { /* copy what's there to the start */
- unsigned char *p = state->in, *q = strm->next_in;
+ unsigned char *p = state->in;
+ unsigned const char *q = strm->next_in;
unsigned n = strm->avail_in;
do {
*p++ = *q++;
@@ -90,8 +91,8 @@ local int gz_look(state)
/* allocate read buffers and inflate memory */
if (state->size == 0) {
/* allocate buffers */
- state->in = malloc(state->want);
- state->out = malloc(state->want << 1);
+ state->in = (unsigned char *)malloc(state->want);
+ state->out = (unsigned char *)malloc(state->want << 1);
if (state->in == NULL || state->out == NULL) {
if (state->out != NULL)
free(state->out);
@@ -352,14 +353,14 @@ int ZEXPORT gzread(file, buf, len)
/* large len -- read directly into user buffer */
else if (state->how == COPY) { /* read directly */
- if (gz_load(state, buf, len, &n) == -1)
+ if (gz_load(state, (unsigned char *)buf, len, &n) == -1)
return -1;
}
/* large len -- decompress directly into user buffer */
else { /* state->how == GZIP */
strm->avail_out = len;
- strm->next_out = buf;
+ strm->next_out = (unsigned char *)buf;
if (gz_decomp(state) == -1)
return -1;
n = state->x.have;
@@ -378,7 +379,11 @@ int ZEXPORT gzread(file, buf, len)
}
/* -- see zlib.h -- */
-#undef gzgetc
+#ifdef Z_PREFIX_SET
+# undef z_gzgetc
+#else
+# undef gzgetc
+#endif
int ZEXPORT gzgetc(file)
gzFile file;
{
@@ -518,7 +523,7 @@ char * ZEXPORT gzgets(file, buf, len)
/* look for end-of-line in current output buffer */
n = state->x.have > left ? left : state->x.have;
- eol = memchr(state->x.next, '\n', n);
+ eol = (unsigned char *)memchr(state->x.next, '\n', n);
if (eol != NULL)
n = (unsigned)(eol - state->x.next) + 1;
diff --git a/lib/zlib/gzwrite.c b/lib/zlib/gzwrite.c
index 27cb3428e..aa767fbf6 100644
--- a/lib/zlib/gzwrite.c
+++ b/lib/zlib/gzwrite.c
@@ -1,5 +1,5 @@
/* gzwrite.c -- zlib functions for writing gzip files
- * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -19,7 +19,7 @@ local int gz_init(state)
z_streamp strm = &(state->strm);
/* allocate input buffer */
- state->in = malloc(state->want);
+ state->in = (unsigned char *)malloc(state->want);
if (state->in == NULL) {
gz_error(state, Z_MEM_ERROR, "out of memory");
return -1;
@@ -28,7 +28,7 @@ local int gz_init(state)
/* only need output buffer and deflate state if compressing */
if (!state->direct) {
/* allocate output buffer */
- state->out = malloc(state->want);
+ state->out = (unsigned char *)malloc(state->want);
if (state->out == NULL) {
free(state->in);
gz_error(state, Z_MEM_ERROR, "out of memory");
@@ -168,7 +168,6 @@ int ZEXPORT gzwrite(file, buf, len)
unsigned len;
{
unsigned put = len;
- unsigned n;
gz_statep state;
z_streamp strm;
@@ -208,16 +207,19 @@ int ZEXPORT gzwrite(file, buf, len)
if (len < state->size) {
/* copy to input buffer, compress when full */
do {
+ unsigned have, copy;
+
if (strm->avail_in == 0)
strm->next_in = state->in;
- n = state->size - strm->avail_in;
- if (n > len)
- n = len;
- memcpy(strm->next_in + strm->avail_in, buf, n);
- strm->avail_in += n;
- state->x.pos += n;
- buf = (char *)buf + n;
- len -= n;
+ have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
+ copy = state->size - have;
+ if (copy > len)
+ copy = len;
+ memcpy(state->in + have, buf, copy);
+ strm->avail_in += copy;
+ state->x.pos += copy;
+ buf = (const char *)buf + copy;
+ len -= copy;
if (len && gz_comp(state, Z_NO_FLUSH) == -1)
return 0;
} while (len);
@@ -229,7 +231,7 @@ int ZEXPORT gzwrite(file, buf, len)
/* directly compress user buffer to file */
strm->avail_in = len;
- strm->next_in = (voidp)buf;
+ strm->next_in = (z_const Bytef *)buf;
state->x.pos += len;
if (gz_comp(state, Z_NO_FLUSH) == -1)
return 0;
@@ -244,6 +246,7 @@ int ZEXPORT gzputc(file, c)
gzFile file;
int c;
{
+ unsigned have;
unsigned char buf[1];
gz_statep state;
z_streamp strm;
@@ -267,12 +270,16 @@ int ZEXPORT gzputc(file, c)
/* try writing to input buffer for speed (state->size == 0 if buffer not
initialized) */
- if (strm->avail_in < state->size) {
+ if (state->size) {
if (strm->avail_in == 0)
strm->next_in = state->in;
- strm->next_in[strm->avail_in++] = c;
- state->x.pos++;
- return c & 0xff;
+ have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
+ if (have < state->size) {
+ state->in[have] = c;
+ strm->avail_in++;
+ state->x.pos++;
+ return c & 0xff;
+ }
}
/* no room in buffer or not initialized, use gz_write() */
@@ -300,12 +307,11 @@ int ZEXPORT gzputs(file, str)
#include <stdarg.h>
/* -- see zlib.h -- */
-int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
+int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
{
int size, len;
gz_statep state;
z_streamp strm;
- va_list va;
/* get internal structure */
if (file == NULL)
@@ -335,25 +341,20 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
/* do the printf() into the input buffer, put length in len */
size = (int)(state->size);
state->in[size - 1] = 0;
- va_start(va, format);
#ifdef NO_vsnprintf
# ifdef HAS_vsprintf_void
(void)vsprintf((char *)(state->in), format, va);
- va_end(va);
for (len = 0; len < size; len++)
if (state->in[len] == 0) break;
# else
len = vsprintf((char *)(state->in), format, va);
- va_end(va);
# endif
#else
# ifdef HAS_vsnprintf_void
(void)vsnprintf((char *)(state->in), size, format, va);
- va_end(va);
len = strlen((char *)(state->in));
# else
len = vsnprintf((char *)(state->in), size, format, va);
- va_end(va);
# endif
#endif
@@ -368,6 +369,17 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
return len;
}
+int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
+{
+ va_list va;
+ int ret;
+
+ va_start(va, format);
+ ret = gzvprintf(file, format, va);
+ va_end(va);
+ return ret;
+}
+
#else /* !STDC && !Z_HAVE_STDARG_H */
/* -- see zlib.h -- */
@@ -547,9 +559,9 @@ int ZEXPORT gzclose_w(file)
}
/* flush, free memory, and close file */
+ if (gz_comp(state, Z_FINISH) == -1)
+ ret = state->err;
if (state->size) {
- if (gz_comp(state, Z_FINISH) == -1)
- ret = state->err;
if (!state->direct) {
(void)deflateEnd(&(state->strm));
free(state->out);
diff --git a/lib/zlib/infback.c b/lib/zlib/infback.c
index 981aff17c..f3833c2e4 100644
--- a/lib/zlib/infback.c
+++ b/lib/zlib/infback.c
@@ -255,7 +255,7 @@ out_func out;
void FAR *out_desc;
{
struct inflate_state FAR *state;
- unsigned char FAR *next; /* next input */
+ z_const unsigned char FAR *next; /* next input */
unsigned char FAR *put; /* next output */
unsigned have, left; /* available input and output */
unsigned long hold; /* bit buffer */
diff --git a/lib/zlib/inffast.c b/lib/zlib/inffast.c
index 2f1d60b43..bda59ceb6 100644
--- a/lib/zlib/inffast.c
+++ b/lib/zlib/inffast.c
@@ -1,5 +1,5 @@
/* inffast.c -- fast decoding
- * Copyright (C) 1995-2008, 2010 Mark Adler
+ * Copyright (C) 1995-2008, 2010, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -69,8 +69,8 @@ z_streamp strm;
unsigned start; /* inflate()'s starting value for strm->avail_out */
{
struct inflate_state FAR *state;
- unsigned char FAR *in; /* local strm->next_in */
- unsigned char FAR *last; /* while in < last, enough input available */
+ z_const unsigned char FAR *in; /* local strm->next_in */
+ z_const unsigned char FAR *last; /* have enough input while in < last */
unsigned char FAR *out; /* local strm->next_out */
unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
unsigned char FAR *end; /* while out < end, enough space available */
diff --git a/lib/zlib/inflate.c b/lib/zlib/inflate.c
index 47418a1e1..870f89bb4 100644
--- a/lib/zlib/inflate.c
+++ b/lib/zlib/inflate.c
@@ -93,11 +93,12 @@
/* function prototypes */
local void fixedtables OF((struct inflate_state FAR *state));
-local int updatewindow OF((z_streamp strm, unsigned out));
+local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
+ unsigned copy));
#ifdef BUILDFIXED
void makefixed OF((void));
#endif
-local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf,
+local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
unsigned len));
int ZEXPORT inflateResetKeep(strm)
@@ -375,12 +376,13 @@ void makefixed()
output will fall in the output data, making match copies simpler and faster.
The advantage may be dependent on the size of the processor's data caches.
*/
-local int updatewindow(strm, out)
+local int updatewindow(strm, end, copy)
z_streamp strm;
-unsigned out;
+const Bytef *end;
+unsigned copy;
{
struct inflate_state FAR *state;
- unsigned copy, dist;
+ unsigned dist;
state = (struct inflate_state FAR *)strm->state;
@@ -400,19 +402,18 @@ unsigned out;
}
/* copy state->wsize or less output bytes into the circular window */
- copy = out - strm->avail_out;
if (copy >= state->wsize) {
- zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
+ zmemcpy(state->window, end - state->wsize, state->wsize);
state->wnext = 0;
state->whave = state->wsize;
}
else {
dist = state->wsize - state->wnext;
if (dist > copy) dist = copy;
- zmemcpy(state->window + state->wnext, strm->next_out - copy, dist);
+ zmemcpy(state->window + state->wnext, end - copy, dist);
copy -= dist;
if (copy) {
- zmemcpy(state->window, strm->next_out - copy, copy);
+ zmemcpy(state->window, end - copy, copy);
state->wnext = copy;
state->whave = state->wsize;
}
@@ -606,7 +607,7 @@ z_streamp strm;
int flush;
{
struct inflate_state FAR *state;
- unsigned char FAR *next; /* next input */
+ z_const unsigned char FAR *next; /* next input */
unsigned char FAR *put; /* next output */
unsigned have, left; /* available input and output */
unsigned long hold; /* bit buffer */
@@ -920,7 +921,7 @@ int flush;
while (state->have < 19)
state->lens[order[state->have++]] = 0;
state->next = state->codes;
- state->lencode = (code const FAR *)(state->next);
+ state->lencode = (const code FAR *)(state->next);
state->lenbits = 7;
ret = inflate_table(CODES, state->lens, 19, &(state->next),
&(state->lenbits), state->work);
@@ -994,7 +995,7 @@ int flush;
values here (9 and 6) without reading the comments in inftrees.h
concerning the ENOUGH constants, which depend on those values */
state->next = state->codes;
- state->lencode = (code const FAR *)(state->next);
+ state->lencode = (const code FAR *)(state->next);
state->lenbits = 9;
ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
&(state->lenbits), state->work);
@@ -1003,7 +1004,7 @@ int flush;
state->mode = BAD;
break;
}
- state->distcode = (code const FAR *)(state->next);
+ state->distcode = (const code FAR *)(state->next);
state->distbits = 6;
ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
&(state->next), &(state->distbits), state->work);
@@ -1230,7 +1231,7 @@ int flush;
RESTORE();
if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
(state->mode < CHECK || flush != Z_FINISH)))
- if (updatewindow(strm, out)) {
+ if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
state->mode = MEM;
return Z_MEM_ERROR;
}
@@ -1264,6 +1265,29 @@ z_streamp strm;
return Z_OK;
}
+int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
+z_streamp strm;
+Bytef *dictionary;
+uInt *dictLength;
+{
+ struct inflate_state FAR *state;
+
+ /* check state */
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+
+ /* copy dictionary */
+ if (state->whave && dictionary != Z_NULL) {
+ zmemcpy(dictionary, state->window + state->wnext,
+ state->whave - state->wnext);
+ zmemcpy(dictionary + state->whave - state->wnext,
+ state->window, state->wnext);
+ }
+ if (dictLength != Z_NULL)
+ *dictLength = state->whave;
+ return Z_OK;
+}
+
int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
z_streamp strm;
const Bytef *dictionary;
@@ -1271,8 +1295,6 @@ uInt dictLength;
{
struct inflate_state FAR *state;
unsigned long dictid;
- unsigned char *next;
- unsigned avail;
int ret;
/* check state */
@@ -1291,13 +1313,7 @@ uInt dictLength;
/* copy dictionary to window using updatewindow(), which will amend the
existing dictionary if appropriate */
- next = strm->next_out;
- avail = strm->avail_out;
- strm->next_out = (Bytef *)dictionary + dictLength;
- strm->avail_out = 0;
- ret = updatewindow(strm, dictLength);
- strm->avail_out = avail;
- strm->next_out = next;
+ ret = updatewindow(strm, dictionary + dictLength, dictLength);
if (ret) {
state->mode = MEM;
return Z_MEM_ERROR;
@@ -1337,7 +1353,7 @@ gz_headerp head;
*/
local unsigned syncsearch(have, buf, len)
unsigned FAR *have;
-unsigned char FAR *buf;
+const unsigned char FAR *buf;
unsigned len;
{
unsigned got;
diff --git a/lib/zlib/inftrees.c b/lib/zlib/inftrees.c
index abcd7c45e..44d89cf24 100644
--- a/lib/zlib/inftrees.c
+++ b/lib/zlib/inftrees.c
@@ -1,5 +1,5 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2012 Mark Adler
+ * Copyright (C) 1995-2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate_copyright[] =
- " inflate 1.2.7 Copyright 1995-2012 Mark Adler ";
+ " inflate 1.2.8 Copyright 1995-2013 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -62,7 +62,7 @@ unsigned short FAR *work;
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 78, 68};
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
@@ -208,8 +208,8 @@ unsigned short FAR *work;
mask = used - 1; /* mask for comparing low */
/* check available table space */
- if ((type == LENS && used >= ENOUGH_LENS) ||
- (type == DISTS && used >= ENOUGH_DISTS))
+ if ((type == LENS && used > ENOUGH_LENS) ||
+ (type == DISTS && used > ENOUGH_DISTS))
return 1;
/* process all codes and make table entries */
@@ -277,8 +277,8 @@ unsigned short FAR *work;
/* check for enough space */
used += 1U << curr;
- if ((type == LENS && used >= ENOUGH_LENS) ||
- (type == DISTS && used >= ENOUGH_DISTS))
+ if ((type == LENS && used > ENOUGH_LENS) ||
+ (type == DISTS && used > ENOUGH_DISTS))
return 1;
/* point entry in root table to sub-table */
diff --git a/lib/zlib/trees.c b/lib/zlib/trees.c
index 8c32b214b..1fd7759ef 100644
--- a/lib/zlib/trees.c
+++ b/lib/zlib/trees.c
@@ -146,8 +146,8 @@ local void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
local int build_bl_tree OF((deflate_state *s));
local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
int blcodes));
-local void compress_block OF((deflate_state *s, ct_data *ltree,
- ct_data *dtree));
+local void compress_block OF((deflate_state *s, const ct_data *ltree,
+ const ct_data *dtree));
local int detect_data_type OF((deflate_state *s));
local unsigned bi_reverse OF((unsigned value, int length));
local void bi_windup OF((deflate_state *s));
@@ -972,7 +972,8 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
} else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
#endif
send_bits(s, (STATIC_TREES<<1)+last, 3);
- compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
+ compress_block(s, (const ct_data *)static_ltree,
+ (const ct_data *)static_dtree);
#ifdef DEBUG
s->compressed_len += 3 + s->static_len;
#endif
@@ -980,7 +981,8 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
send_bits(s, (DYN_TREES<<1)+last, 3);
send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
max_blindex+1);
- compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
+ compress_block(s, (const ct_data *)s->dyn_ltree,
+ (const ct_data *)s->dyn_dtree);
#ifdef DEBUG
s->compressed_len += 3 + s->opt_len;
#endif
@@ -1057,8 +1059,8 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc)
*/
local void compress_block(s, ltree, dtree)
deflate_state *s;
- ct_data *ltree; /* literal tree */
- ct_data *dtree; /* distance tree */
+ const ct_data *ltree; /* literal tree */
+ const ct_data *dtree; /* distance tree */
{
unsigned dist; /* distance of matched string */
int lc; /* match length or unmatched char (if dist == 0) */
diff --git a/lib/zlib/uncompr.c b/lib/zlib/uncompr.c
index ad98be3a5..242e9493d 100644
--- a/lib/zlib/uncompr.c
+++ b/lib/zlib/uncompr.c
@@ -30,7 +30,7 @@ int ZEXPORT uncompress (dest, destLen, source, sourceLen)
z_stream stream;
int err;
- stream.next_in = (Bytef*)source;
+ stream.next_in = (z_const Bytef *)source;
stream.avail_in = (uInt)sourceLen;
/* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
diff --git a/lib/zlib/zconf.h b/lib/zlib/zconf.h
index 8a46a58b3..9987a7755 100644
--- a/lib/zlib/zconf.h
+++ b/lib/zlib/zconf.h
@@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2012 Jean-loup Gailly.
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -21,6 +21,7 @@
# define _dist_code z__dist_code
# define _length_code z__length_code
# define _tr_align z__tr_align
+# define _tr_flush_bits z__tr_flush_bits
# define _tr_flush_block z__tr_flush_block
# define _tr_init z__tr_init
# define _tr_stored_block z__tr_stored_block
@@ -77,6 +78,7 @@
# define gzopen_w z_gzopen_w
# endif
# define gzprintf z_gzprintf
+# define gzvprintf z_gzvprintf
# define gzputc z_gzputc
# define gzputs z_gzputs
# define gzread z_gzread
@@ -103,6 +105,7 @@
# define inflateReset z_inflateReset
# define inflateReset2 z_inflateReset2
# define inflateSetDictionary z_inflateSetDictionary
+# define inflateGetDictionary z_inflateGetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateUndermine z_inflateUndermine
@@ -388,20 +391,14 @@ typedef uLong FAR uLongf;
typedef Byte *voidp;
#endif
-/* ./configure may #define Z_U4 here */
-
#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
# include <limits.h>
# if (UINT_MAX == 0xffffffffUL)
# define Z_U4 unsigned
-# else
-# if (ULONG_MAX == 0xffffffffUL)
-# define Z_U4 unsigned long
-# else
-# if (USHRT_MAX == 0xffffffffUL)
-# define Z_U4 unsigned short
-# endif
-# endif
+# elif (ULONG_MAX == 0xffffffffUL)
+# define Z_U4 unsigned long
+# elif (USHRT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned short
# endif
#endif
@@ -425,8 +422,16 @@ typedef uLong FAR uLongf;
# endif
#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifndef Z_SOLO
+# include <stdarg.h> /* for va_list */
+# endif
+#endif
+
#ifdef _WIN32
-# include <stddef.h> /* for wchar_t */
+# ifndef Z_SOLO
+# include <stddef.h> /* for wchar_t */
+# endif
#endif
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
@@ -435,7 +440,7 @@ typedef uLong FAR uLongf;
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
* equivalently requesting no 64-bit operations
*/
-#if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
# undef _LARGEFILE64_SOURCE
#endif
@@ -443,7 +448,7 @@ typedef uLong FAR uLongf;
# define Z_HAVE_UNISTD_H
#endif
#ifndef Z_SOLO
-# if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE)
+# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include <unixio.h> /* for off_t */
diff --git a/lib/zlib/zlib.h b/lib/zlib/zlib.h
index 3edf3acdb..3e0c7672a 100644
--- a/lib/zlib/zlib.h
+++ b/lib/zlib/zlib.h
@@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.7, May 2nd, 2012
+ version 1.2.8, April 28th, 2013
- Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler
+ Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -37,11 +37,11 @@
extern "C" {
#endif
-#define ZLIB_VERSION "1.2.7"
-#define ZLIB_VERNUM 0x1270
+#define ZLIB_VERSION "1.2.8"
+#define ZLIB_VERNUM 0x1280
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 7
+#define ZLIB_VER_REVISION 8
#define ZLIB_VER_SUBREVISION 0
/*
@@ -839,6 +839,21 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
inflate().
*/
+ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
+ Bytef *dictionary,
+ uInt *dictLength));
+/*
+ Returns the sliding dictionary being maintained by inflate. dictLength is
+ set to the number of bytes in the dictionary, and that many bytes are copied
+ to dictionary. dictionary must have enough space, where 32768 bytes is
+ always enough. If inflateGetDictionary() is called with dictionary equal to
+ Z_NULL, then only the dictionary length is returned, and nothing is copied.
+ Similary, if dictLength is Z_NULL, then it is not set.
+
+ inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
+ stream state is inconsistent.
+*/
+
ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
/*
Skips invalid compressed data until a possible full flush point (see above
@@ -846,7 +861,7 @@ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
available input is skipped. No output is provided.
inflateSync searches for a 00 00 FF FF pattern in the compressed data.
- All full flush points have this pattern, but not all occurences of this
+ All full flush points have this pattern, but not all occurrences of this
pattern are full flush points.
inflateSync returns Z_OK if a possible full flush point has been found,
@@ -1007,7 +1022,8 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
the version of the header file.
*/
-typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef unsigned (*in_func) OF((void FAR *,
+ z_const unsigned char FAR * FAR *));
typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
@@ -1015,11 +1031,12 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
out_func out, void FAR *out_desc));
/*
inflateBack() does a raw inflate with a single call using a call-back
- interface for input and output. This is more efficient than inflate() for
- file i/o applications in that it avoids copying between the output and the
- sliding window by simply making the window itself the output buffer. This
- function trusts the application to not change the output buffer passed by
- the output function, at least until inflateBack() returns.
+ interface for input and output. This is potentially more efficient than
+ inflate() for file i/o applications, in that it avoids copying between the
+ output and the sliding window by simply making the window itself the output
+ buffer. inflate() can be faster on modern CPUs when used with large
+ buffers. inflateBack() trusts the application to not change the output
+ buffer passed by the output function, at least until inflateBack() returns.
inflateBackInit() must be called first to allocate the internal state
and to initialize the state with the user-provided window buffer.
@@ -1736,6 +1753,13 @@ ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
const char *mode));
#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifndef Z_SOLO
+ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
+ const char *format,
+ va_list va));
+# endif
+#endif
#ifdef __cplusplus
}
diff --git a/lib/zlib/zutil.c b/lib/zlib/zutil.c
index 65e0d3b72..23d2ebef0 100644
--- a/lib/zlib/zutil.c
+++ b/lib/zlib/zutil.c
@@ -14,7 +14,7 @@
struct internal_state {int dummy;}; /* for buggy compilers */
#endif
-const char * const z_errmsg[10] = {
+z_const char * const z_errmsg[10] = {
"need dictionary", /* Z_NEED_DICT 2 */
"stream end", /* Z_STREAM_END 1 */
"", /* Z_OK 0 */
diff --git a/lib/zlib/zutil.h b/lib/zlib/zutil.h
index 4e3dcc6ae..24ab06b1c 100644
--- a/lib/zlib/zutil.h
+++ b/lib/zlib/zutil.h
@@ -1,5 +1,5 @@
/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2012 Jean-loup Gailly.
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -44,13 +44,13 @@ typedef unsigned short ush;
typedef ush FAR ushf;
typedef unsigned long ulg;
-extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* (size given to avoid silly warnings with Visual C++) */
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
#define ERR_RETURN(strm,err) \
- return (strm->msg = (char*)ERR_MSG(err), (err))
+ return (strm->msg = ERR_MSG(err), (err))
/* To be used only when the state is known to be valid */
/* common constants */
@@ -168,7 +168,8 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
/* provide prototypes for these when building zlib without LFS */
-#if !defined(_WIN32) && (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
+#if !defined(_WIN32) && \
+ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
#endif
diff --git a/src/AllocationPool.h b/src/AllocationPool.h
index 7c358cc84..e82f9807e 100644
--- a/src/AllocationPool.h
+++ b/src/AllocationPool.h
@@ -39,8 +39,8 @@ class cListAllocationPool : public cAllocationPool<T>
{
public:
- cListAllocationPool(std::auto_ptr<typename cAllocationPool<T>::cStarvationCallbacks> a_Callbacks) :
- m_Callbacks(a_Callbacks)
+ cListAllocationPool(std::unique_ptr<typename cAllocationPool<T>::cStarvationCallbacks> a_Callbacks) :
+ m_Callbacks(std::move(a_Callbacks))
{
for (size_t i = 0; i < NumElementsInReserve; i++)
{
@@ -105,7 +105,7 @@ class cListAllocationPool : public cAllocationPool<T>
private:
std::list<void *> m_FreeList;
- std::auto_ptr<typename cAllocationPool<T>::cStarvationCallbacks> m_Callbacks;
+ std::unique_ptr<typename cAllocationPool<T>::cStarvationCallbacks> m_Callbacks;
};
diff --git a/src/Bindings/BindingsProcessor.lua b/src/Bindings/BindingsProcessor.lua
index f86be6c6d..a398f5026 100644
--- a/src/Bindings/BindingsProcessor.lua
+++ b/src/Bindings/BindingsProcessor.lua
@@ -98,10 +98,12 @@ local function OutputLuaStateHelpers(a_Package)
f:write("// This file expects to be included form inside the cLuaState class definition\n")
f:write("\n\n\n\n\n")
for _, item in ipairs(types) do
- f:write("void Push(" .. item.name .. " * a_Value);\n")
+ if not(g_HasCustomPushImplementation[item.name]) then
+ f:write("void Push(" .. item.name .. " * a_Value);\n")
+ end
end
for _, item in ipairs(types) do
- f:write("void GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal);\n")
+ f:write("bool GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal);\n")
end
f:write("\n\n\n\n\n")
f:close()
@@ -125,15 +127,17 @@ local function OutputLuaStateHelpers(a_Package)
end
end
for _, item in ipairs(types) do
- f:write("void cLuaState::GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal)\n{\n\tASSERT(IsValid());\n")
+ f:write("bool cLuaState::GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal)\n{\n\tASSERT(IsValid());\n")
f:write("\tif (lua_isnil(m_LuaState, a_StackPos))\n\t{\n")
- f:write("\t a_ReturnedVal = nullptr;\n")
- f:write("\t return;\n\t}\n")
+ f:write("\t\ta_ReturnedVal = nullptr;\n")
+ f:write("\t\treturn false;\n\t}\n")
f:write("\ttolua_Error err;\n")
f:write("\tif (tolua_isusertype(m_LuaState, a_StackPos, \"" .. item.name .. "\", false, &err))\n")
f:write("\t{\n")
- f:write("\t a_ReturnedVal = *(reinterpret_cast<" .. item.name .. " **>(lua_touserdata(m_LuaState, a_StackPos)));\n")
+ f:write("\t\ta_ReturnedVal = *(reinterpret_cast<" .. item.name .. " **>(lua_touserdata(m_LuaState, a_StackPos)));\n")
+ f:write("\t\treturn true;\n");
f:write("\t}\n")
+ f:write("\treturn false;\n")
f:write("}\n\n\n\n\n\n")
end
f:close()
diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt
index 133c2224d..0a069ad85 100644
--- a/src/Bindings/CMakeLists.txt
+++ b/src/Bindings/CMakeLists.txt
@@ -145,6 +145,15 @@ set_source_files_properties(${BINDING_OUTPUTS} PROPERTIES GENERATED TRUE)
set_source_files_properties(${CMAKE_SOURCE_DIR}/src/Bindings/Bindings.cpp PROPERTIES COMPILE_FLAGS -Wno-error)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(DeprecatedBindings.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(LuaState.cpp COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(LuaWindow.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum")
+ set_source_files_properties(ManualBindings.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(ManualBindings_World.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(PluginLua.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+endif()
+
if(NOT MSVC)
add_library(Bindings ${SRCS} ${HDRS})
diff --git a/src/Bindings/LuaChunkStay.cpp b/src/Bindings/LuaChunkStay.cpp
index e50ffb75b..1afd09d11 100644
--- a/src/Bindings/LuaChunkStay.cpp
+++ b/src/Bindings/LuaChunkStay.cpp
@@ -41,7 +41,7 @@ bool cLuaChunkStay::AddChunks(int a_ChunkCoordTableStackPos)
// Add each set of coords:
int NumChunks = luaL_getn(L, a_ChunkCoordTableStackPos);
- m_Chunks.reserve((size_t)NumChunks);
+ m_Chunks.reserve(static_cast<size_t>(NumChunks));
for (int idx = 1; idx <= NumChunks; idx++)
{
// Push the idx-th element of the array onto stack top, check that it's a table:
@@ -133,7 +133,7 @@ void cLuaChunkStay::OnChunkAvailable(int a_ChunkX, int a_ChunkZ)
if (m_OnChunkAvailable.IsValid())
{
cPluginLua::cOperation Op(m_Plugin);
- Op().Call((int)m_OnChunkAvailable, a_ChunkX, a_ChunkZ);
+ Op().Call(static_cast<int>(m_OnChunkAvailable), a_ChunkX, a_ChunkZ);
}
}
@@ -147,7 +147,7 @@ bool cLuaChunkStay::OnAllChunksAvailable(void)
{
// Call the callback:
cPluginLua::cOperation Op(m_Plugin);
- Op().Call((int)m_OnAllChunksAvailable);
+ Op().Call(static_cast<int>(m_OnAllChunksAvailable));
// Remove the callback references - they won't be needed anymore
m_OnChunkAvailable.UnRef();
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index ccf812417..a0fdecb8b 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -211,23 +211,31 @@ void cLuaState::AddPackagePath(const AString & a_PathVariable, const AString & a
-bool cLuaState::LoadFile(const AString & a_FileName)
+bool cLuaState::LoadFile(const AString & a_FileName, bool a_LogWarnings)
{
ASSERT(IsValid());
// Load the file:
int s = luaL_loadfile(m_LuaState, a_FileName.c_str());
- if (ReportErrors(s))
+ if (s != 0)
{
- LOGWARNING("Can't load %s because of an error in file %s", m_SubsystemName.c_str(), a_FileName.c_str());
+ if (a_LogWarnings)
+ {
+ LOGWARNING("Can't load %s because of a load error in file %s: %d (%s)", m_SubsystemName.c_str(), a_FileName.c_str(), s, lua_tostring(m_LuaState, -1));
+ }
+ lua_pop(m_LuaState, 1);
return false;
}
// Execute the globals:
s = lua_pcall(m_LuaState, 0, LUA_MULTRET, 0);
- if (ReportErrors(s))
+ if (s != 0)
{
- LOGWARNING("Error in %s in file %s", m_SubsystemName.c_str(), a_FileName.c_str());
+ if (a_LogWarnings)
+ {
+ LOGWARNING("Can't load %s because of an initialization error in file %s: %d (%s)", m_SubsystemName.c_str(), a_FileName.c_str(), s, lua_tostring(m_LuaState, -1));
+ }
+ lua_pop(m_LuaState, 1);
return false;
}
@@ -446,6 +454,18 @@ void cLuaState::Push(const cPlayer * a_Player)
+void cLuaState::Push(const cLuaState::cRef & a_Ref)
+{
+ ASSERT(IsValid());
+
+ lua_rawgeti(m_LuaState, LUA_REGISTRYINDEX, static_cast<int>(a_Ref));
+ m_NumCurrentFunctionArgs += 1;
+}
+
+
+
+
+
void cLuaState::Push(const HTTPRequest * a_Request)
{
ASSERT(IsValid());
@@ -701,108 +721,142 @@ void cLuaState::PushUserType(void * a_Object, const char * a_Type)
-void cLuaState::GetStackValue(int a_StackPos, AString & a_Value)
+bool cLuaState::GetStackValue(int a_StackPos, AString & a_Value)
{
size_t len = 0;
const char * data = lua_tolstring(m_LuaState, a_StackPos, &len);
if (data != nullptr)
{
a_Value.assign(data, len);
+ return true;
}
+ return false;
}
-void cLuaState::GetStackValue(int a_StackPos, BLOCKTYPE & a_ReturnedVal)
-{
- if (lua_isnumber(m_LuaState, a_StackPos))
- {
- a_ReturnedVal = static_cast<BLOCKTYPE>(tolua_tonumber(m_LuaState, a_StackPos, a_ReturnedVal));
- }
-}
-
-
-
-
-
-void cLuaState::GetStackValue(int a_StackPos, bool & a_ReturnedVal)
+bool cLuaState::GetStackValue(int a_StackPos, bool & a_ReturnedVal)
{
a_ReturnedVal = (tolua_toboolean(m_LuaState, a_StackPos, a_ReturnedVal ? 1 : 0) > 0);
+ return true;
}
-void cLuaState::GetStackValue(int a_StackPos, cPluginManager::CommandResult & a_Result)
+bool cLuaState::GetStackValue(int a_StackPos, cPluginManager::CommandResult & a_Result)
{
if (lua_isnumber(m_LuaState, a_StackPos))
{
a_Result = static_cast<cPluginManager::CommandResult>(static_cast<int>((tolua_tonumber(m_LuaState, a_StackPos, a_Result))));
+ return true;
}
+ return false;
}
-void cLuaState::GetStackValue(int a_StackPos, cRef & a_Ref)
+bool cLuaState::GetStackValue(int a_StackPos, cRef & a_Ref)
{
a_Ref.RefStack(*this, a_StackPos);
+ return true;
}
-void cLuaState::GetStackValue(int a_StackPos, double & a_ReturnedVal)
+bool cLuaState::GetStackValue(int a_StackPos, double & a_ReturnedVal)
{
if (lua_isnumber(m_LuaState, a_StackPos))
{
a_ReturnedVal = tolua_tonumber(m_LuaState, a_StackPos, a_ReturnedVal);
+ return true;
}
+ return false;
}
-void cLuaState::GetStackValue(int a_StackPos, float & a_ReturnedVal)
+bool cLuaState::GetStackValue(int a_StackPos, eBlockFace & a_ReturnedVal)
{
- if (lua_isnumber(m_LuaState, a_StackPos))
+ if (!lua_isnumber(m_LuaState, a_StackPos))
{
- a_ReturnedVal = static_cast<float>(tolua_tonumber(m_LuaState, a_StackPos, a_ReturnedVal));
+ return false;
}
+ a_ReturnedVal = static_cast<eBlockFace>(Clamp(
+ static_cast<int>(tolua_tonumber(m_LuaState, a_StackPos, a_ReturnedVal)),
+ static_cast<int>(BLOCK_FACE_MIN), static_cast<int>(BLOCK_FACE_MAX))
+ );
+ return true;
}
-void cLuaState::GetStackValue(int a_StackPos, eWeather & a_ReturnedVal)
+bool cLuaState::GetStackValue(int a_StackPos, eWeather & a_ReturnedVal)
{
if (!lua_isnumber(m_LuaState, a_StackPos))
{
- return;
+ return false;
}
a_ReturnedVal = static_cast<eWeather>(Clamp(
static_cast<int>(tolua_tonumber(m_LuaState, a_StackPos, a_ReturnedVal)),
static_cast<int>(wSunny), static_cast<int>(wThunderstorm))
);
+ return true;
}
-void cLuaState::GetStackValue(int a_StackPos, int & a_ReturnedVal)
+bool cLuaState::GetStackValue(int a_StackPos, float & a_ReturnedVal)
{
if (lua_isnumber(m_LuaState, a_StackPos))
{
- a_ReturnedVal = static_cast<int>(tolua_tonumber(m_LuaState, a_StackPos, a_ReturnedVal));
+ a_ReturnedVal = static_cast<float>(tolua_tonumber(m_LuaState, a_StackPos, a_ReturnedVal));
+ return true;
}
+ return false;
+}
+
+
+
+
+
+cLuaState::cStackValue cLuaState::WalkToValue(const AString & a_Name)
+{
+ // There needs to be at least one value on the stack:
+ ASSERT(lua_gettop(m_LuaState) > 0);
+
+ // Iterate over path and replace the top of the stack with the walked element
+ lua_pushvalue(m_LuaState, -1); // Copy the stack value into the "working area"
+ auto path = StringSplit(a_Name, ".");
+ for (const auto & elem: path)
+ {
+ // If the value is not a table, bail out (error):
+ if (!lua_istable(m_LuaState, -1))
+ {
+ lua_pop(m_LuaState, 1);
+ return cStackValue();
+ }
+
+ // Get the next part of the path:
+ lua_getfield(m_LuaState, -1, elem.c_str());
+
+ // Remove the previous value from the stack (keep only the new one):
+ lua_remove(m_LuaState, -2);
+ } // for elem - path[]
+ return std::move(cStackValue(*this));
}
@@ -927,6 +981,9 @@ bool cLuaState::CheckParamTable(int a_StartParam, int a_EndParam)
VERIFY(lua_getstack(m_LuaState, 0, &entry));
VERIFY(lua_getinfo (m_LuaState, "n", &entry));
AString ErrMsg = Printf("#ferror in function '%s'.", (entry.name != nullptr) ? entry.name : "?");
+
+ BreakIntoDebugger(m_LuaState);
+
tolua_error(m_LuaState, ErrMsg.c_str(), &tolua_err);
return false;
} // for i - Param
@@ -1366,6 +1423,7 @@ int cLuaState::ReportFnCallErrors(lua_State * a_LuaState)
{
LOGWARNING("LUA: %s", lua_tostring(a_LuaState, -1));
LogStackTrace(a_LuaState, 1);
+ BreakIntoDebugger(a_LuaState);
return 1; // We left the error message on the stack as the return value
}
@@ -1373,6 +1431,28 @@ int cLuaState::ReportFnCallErrors(lua_State * a_LuaState)
+int cLuaState::BreakIntoDebugger(lua_State * a_LuaState)
+{
+ // Call the BreakIntoDebugger function, if available:
+ lua_getglobal(a_LuaState, "BreakIntoDebugger");
+ if (!lua_isfunction(a_LuaState, -1))
+ {
+ LOGD("LUA: BreakIntoDebugger() not found / not a function");
+ lua_pop(a_LuaState, 1);
+ return 1;
+ }
+ lua_insert(a_LuaState, -2); // Copy the string that has been passed to us
+ LOGD("Calling BreakIntoDebugger()...");
+ lua_call(a_LuaState, 1, 0);
+ LOGD("Returned from BreakIntoDebugger().");
+
+ return 0;
+}
+
+
+
+
+
////////////////////////////////////////////////////////////////////////////////
// cLuaState::cRef:
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h
index b38401fd8..cc8214646 100644
--- a/src/Bindings/LuaState.h
+++ b/src/Bindings/LuaState.h
@@ -78,11 +78,14 @@ public:
bool IsValid(void) const {return (m_Ref != LUA_REFNIL); }
/** Allows to use this class wherever an int (i. e. ref) is to be used */
- operator int(void) const { return m_Ref; }
-
+ explicit operator int(void) const { return m_Ref; }
+
protected:
cLuaState * m_LuaState;
int m_Ref;
+
+ // Remove the copy-constructor:
+ cRef(const cRef &) = delete;
} ;
@@ -98,6 +101,12 @@ public:
{
}
+ cTableRef(const cRef & a_TableRef, const char * a_FnName) :
+ m_TableRef(static_cast<int>(a_TableRef)),
+ m_FnName(a_FnName)
+ {
+ }
+
int GetTableRef(void) const { return m_TableRef; }
const char * GetFnName(void) const { return m_FnName; }
} ;
@@ -111,6 +120,61 @@ public:
static const cRet Return; // Use this constant to delimit function args from return values for cLuaState::Call()
+ /** A RAII class for values pushed onto the Lua stack.
+ Will pop the value off the stack in the destructor. */
+ class cStackValue
+ {
+ public:
+ cStackValue(void):
+ m_LuaState(nullptr)
+ {
+ }
+
+ cStackValue(cLuaState & a_LuaState):
+ m_LuaState(a_LuaState)
+ {
+ m_StackLen = lua_gettop(a_LuaState);
+ }
+
+ cStackValue(cStackValue && a_Src):
+ m_LuaState(nullptr),
+ m_StackLen(-1)
+ {
+ std::swap(m_LuaState, a_Src.m_LuaState);
+ std::swap(m_StackLen, a_Src.m_StackLen);
+ }
+
+ ~cStackValue()
+ {
+ if (m_LuaState != nullptr)
+ {
+ auto top = lua_gettop(m_LuaState);
+ ASSERT(m_StackLen == top);
+ lua_pop(m_LuaState, 1);
+ }
+ }
+
+ void Set(cLuaState & a_LuaState)
+ {
+ m_LuaState = a_LuaState;
+ m_StackLen = lua_gettop(a_LuaState);
+ }
+
+ bool IsValid(void) const
+ {
+ return (m_LuaState != nullptr);
+ }
+
+ protected:
+ lua_State * m_LuaState;
+
+ int m_StackLen;
+
+ // Remove the copy-constructor:
+ cStackValue(const cStackValue &) = delete;
+ };
+
+
/** Creates a new instance. The LuaState is not initialized.
a_SubsystemName is used for reporting problems in the console, it is "plugin %s" for plugins,
or "LuaScript" for the cLuaScript template
@@ -151,10 +215,9 @@ public:
void AddPackagePath(const AString & a_PathVariable, const AString & a_Path);
/** Loads the specified file
- Returns false and logs a warning to the console if not successful (but the LuaState is kept open).
- m_SubsystemName is displayed in the warning log message.
- */
- bool LoadFile(const AString & a_FileName);
+ Returns false and optionally logs a warning to the console if not successful (but the LuaState is kept open).
+ m_SubsystemName is displayed in the warning log message. */
+ bool LoadFile(const AString & a_FileName, bool a_LogWarnings = true);
/** Returns true if a_FunctionName is a valid Lua function that can be called */
bool HasFunction(const char * a_FunctionName);
@@ -169,6 +232,7 @@ public:
void Push(const char * a_Value);
void Push(const cItems & a_Items);
void Push(const cPlayer * a_Player);
+ void Push(const cRef & a_Ref);
void Push(const HTTPRequest * a_Request);
void Push(const HTTPTemplateRequest * a_Request);
void Push(const Vector3d & a_Vector);
@@ -178,25 +242,80 @@ public:
// Push a simple value onto the stack (keep alpha-sorted):
void Push(bool a_Value);
+ void Push(cEntity * a_Entity);
+ void Push(cLuaServerHandle * a_ServerHandle);
+ void Push(cLuaTCPLink * a_TCPLink);
+ void Push(cLuaUDPEndpoint * a_UDPEndpoint);
void Push(double a_Value);
void Push(int a_Value);
void Push(void * a_Ptr);
void Push(std::chrono::milliseconds a_time);
- void Push(cLuaServerHandle * a_ServerHandle);
- void Push(cLuaTCPLink * a_TCPLink);
- void Push(cLuaUDPEndpoint * a_UDPEndpoint);
// GetStackValue() retrieves the value at a_StackPos, if it is a valid type. If not, a_Value is unchanged.
- // Enum values are clamped to their allowed range.
- void GetStackValue(int a_StackPos, AString & a_Value);
- void GetStackValue(int a_StackPos, BLOCKTYPE & a_Value);
- void GetStackValue(int a_StackPos, bool & a_Value);
- void GetStackValue(int a_StackPos, cPluginManager::CommandResult & a_Result);
- void GetStackValue(int a_StackPos, cRef & a_Ref);
- void GetStackValue(int a_StackPos, double & a_Value);
- void GetStackValue(int a_StackPos, eWeather & a_Value);
- void GetStackValue(int a_StackPos, float & a_ReturnedVal);
- void GetStackValue(int a_StackPos, int & a_Value);
+ // Returns whether value was changed
+ // Enum values are checked for their allowed values and fail if the value is not assigned.
+ bool GetStackValue(int a_StackPos, AString & a_Value);
+ bool GetStackValue(int a_StackPos, bool & a_Value);
+ bool GetStackValue(int a_StackPos, cPluginManager::CommandResult & a_Result);
+ bool GetStackValue(int a_StackPos, cRef & a_Ref);
+ bool GetStackValue(int a_StackPos, double & a_Value);
+ bool GetStackValue(int a_StackPos, eBlockFace & a_Value);
+ bool GetStackValue(int a_StackPos, eWeather & a_Value);
+ bool GetStackValue(int a_StackPos, float & a_ReturnedVal);
+
+ // template to catch all of the various c++ integral types without overload conflicts
+ template <class T>
+ bool GetStackValue(int a_StackPos, T & a_ReturnedVal, typename std::enable_if<std::is_integral<T>::value>::type * unused = nullptr)
+ {
+ UNUSED(unused);
+ if (!lua_isnumber(m_LuaState, a_StackPos)) // Also accepts strings representing a number: http://pgl.yoyo.org/luai/i/lua_isnumber
+ {
+ return false;
+ }
+ lua_Number Val = lua_tonumber(m_LuaState, a_StackPos);
+ if (Val > std::numeric_limits<T>::max())
+ {
+ return false;
+ }
+ if (Val < std::numeric_limits<T>::min())
+ {
+ return false;
+ }
+ a_ReturnedVal = static_cast<T>(Val);
+ return true;
+ }
+
+ /** Pushes the named value in the table at the top of the stack.
+ a_Name may be a path containing multiple table levels, such as "_G.cChatColor.Blue".
+ If the value is found, it is pushed on top of the stack and the returned cStackValue is valid.
+ If the value is not found, the stack is unchanged and the returned cStackValue is invalid. */
+ cStackValue WalkToValue(const AString & a_Name);
+
+ /** Retrieves the named value in the table at the top of the Lua stack.
+ a_Name may be a path containing multiple table levels, such as "_G.cChatColor.Blue".
+ Returns true if the value was successfully retrieved, false on error. */
+ template <typename T> bool GetNamedValue(const AString & a_Name, T & a_Value)
+ {
+ auto stk = WalkToValue(a_Name);
+ if (!stk.IsValid())
+ {
+ // Name not found
+ return false;
+ }
+ return GetStackValue(-1, a_Value);
+ }
+
+ /** Retrieves the named global value. a_Name may be a path containing multiple table levels, such as "_G.cChatColor.Blue".
+ Returns true if the value was successfully retrieved, false on error. */
+ template <typename T> bool GetNamedGlobal(const AString & a_Name, T & a_Value)
+ {
+ // Push the globals table onto the stack and make it RAII-removed:
+ lua_getglobal(m_LuaState, "_G");
+ cStackValue stk(*this);
+
+ // Get the named global:
+ return GetNamedValue(a_Name, a_Value);
+ }
// Include the auto-generated Push and GetStackValue() functions:
#include "LuaState_Declaration.inc"
@@ -208,20 +327,23 @@ public:
template <typename FnT, typename... Args>
bool Call(const FnT & a_Function, Args &&... args)
{
- if (!PushFunction(a_Function))
+ if (!PushFunction(std::forward<const FnT &>(a_Function)))
{
// Pushing the function failed
return false;
}
- return PushCallPop(args...);
+ return PushCallPop(std::forward<Args>(args)...);
}
/** Retrieves a list of values from the Lua stack, starting at the specified index. */
template <typename T, typename... Args>
- inline void GetStackValues(int a_StartStackPos, T & a_Ret, Args &&... args)
+ inline bool GetStackValues(int a_StartStackPos, T & a_Ret, Args &&... args)
{
- GetStackValue(a_StartStackPos, a_Ret);
- GetStackValues(a_StartStackPos + 1, args...);
+ if (!GetStackValue(a_StartStackPos, a_Ret))
+ {
+ return false;
+ }
+ return GetStackValues(a_StartStackPos + 1, args...);
}
/** Returns true if the specified parameters on the stack are of the specified usertable type; also logs warning if not. Used for static functions */
@@ -319,10 +441,10 @@ protected:
/** Variadic template recursor: More params to push. Push them and recurse. */
template <typename T, typename... Args>
- inline bool PushCallPop(T a_Param, Args &&... args)
+ inline bool PushCallPop(T && a_Param, Args &&... args)
{
- Push(a_Param);
- return PushCallPop(args...);
+ Push(std::forward<T>(a_Param));
+ return PushCallPop(std::forward<Args>(args)...);
}
/** Variadic template terminator: If there's nothing more to push, but return values to collect, call the function and collect the returns. */
@@ -339,7 +461,7 @@ protected:
}
// Collect the return values:
- GetStackValues(-NumReturns, args...);
+ GetStackValues(-NumReturns, std::forward<Args>(args)...);
lua_pop(m_LuaState, NumReturns);
// All successful:
@@ -349,9 +471,9 @@ protected:
/** Variadic template terminator: If there are no more values to get, bail out.
This function is not available in the public API, because it's an error to request no values directly; only internal functions can do that.
If you get a compile error saying this function is not accessible, check your calling code, you aren't reading any stack values. */
- void GetStackValues(int a_StartingStackPos)
+ bool GetStackValues(int a_StartingStackPos)
{
- // Do nothing
+ return true;
}
/** Pushes the function of the specified name onto the stack.
@@ -369,7 +491,7 @@ protected:
*/
bool PushFunction(const cRef & a_FnRef)
{
- return PushFunction((int)a_FnRef);
+ return PushFunction(static_cast<int>(a_FnRef));
}
/** Pushes a function that is stored in a referenced table by name
@@ -389,6 +511,9 @@ protected:
/** Used as the error reporting function for function calls */
static int ReportFnCallErrors(lua_State * a_LuaState);
+
+ /** Tries to break into the MobDebug debugger, if it is installed. */
+ static int BreakIntoDebugger(lua_State * a_LuaState);
} ;
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index ff904d74a..7655d8c83 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -34,6 +34,7 @@
#include "../CompositeChat.h"
#include "../StringCompression.h"
#include "../CommandOutput.h"
+#include "../BuildInfo.h"
@@ -158,7 +159,7 @@ static int tolua_UncompressStringZLIB(lua_State * tolua_S)
// Get the params:
AString ToUncompress;
- int UncompressedSize;
+ size_t UncompressedSize;
S.GetStackValues(1, ToUncompress, UncompressedSize);
// Compress the string:
@@ -1801,7 +1802,7 @@ static int tolua_cMojangAPI_GetUUIDsFromPlayerNames(lua_State * L)
// Convert the input table into AStringVector:
AStringVector PlayerNames;
int NumNames = luaL_getn(L, 2);
- PlayerNames.reserve(NumNames);
+ PlayerNames.reserve(static_cast<size_t>(NumNames));
for (int i = 1; i <= NumNames; i++)
{
lua_rawgeti(L, 2, i);
@@ -2079,6 +2080,50 @@ static int tolua_cLineBlockTracer_Trace(lua_State * tolua_S)
+static int tolua_cRoot_GetBuildCommitID(lua_State * tolua_S)
+{
+ cLuaState L(tolua_S);
+ L.Push(BUILD_COMMIT_ID);
+ return 1;
+}
+
+
+
+
+
+static int tolua_cRoot_GetBuildDateTime(lua_State * tolua_S)
+{
+ cLuaState L(tolua_S);
+ L.Push(BUILD_DATETIME);
+ return 1;
+}
+
+
+
+
+
+static int tolua_cRoot_GetBuildID(lua_State * tolua_S)
+{
+ cLuaState L(tolua_S);
+ L.Push(BUILD_ID);
+ return 1;
+}
+
+
+
+
+
+static int tolua_cRoot_GetBuildSeriesName(lua_State * tolua_S)
+{
+ cLuaState L(tolua_S);
+ L.Push(BUILD_SERIES_NAME);
+ return 1;
+}
+
+
+
+
+
static int tolua_cRoot_GetFurnaceRecipe(lua_State * tolua_S)
{
cLuaState L(tolua_S);
@@ -2092,7 +2137,8 @@ static int tolua_cRoot_GetFurnaceRecipe(lua_State * tolua_S)
}
// Check the input param:
- cItem * Input = (cItem *)tolua_tousertype(L, 2, nullptr);
+ cItem * Input = nullptr;
+ L.GetStackValue(2, Input);
if (Input == nullptr)
{
LOGWARNING("cRoot:GetFurnaceRecipe: the Input parameter is nil or missing.");
@@ -2109,9 +2155,9 @@ static int tolua_cRoot_GetFurnaceRecipe(lua_State * tolua_S)
}
// Push the output, number of ticks and input as the three return values:
- tolua_pushusertype(L, Recipe->Out, "const cItem");
- tolua_pushnumber (L, (lua_Number)(Recipe->CookTime));
- tolua_pushusertype(L, Recipe->In, "const cItem");
+ L.Push(Recipe->Out);
+ L.Push(Recipe->CookTime);
+ L.Push(Recipe->In);
return 3;
}
@@ -2868,6 +2914,10 @@ void cManualBindings::Bind(lua_State * tolua_S)
tolua_function(tolua_S, "DoWithPlayerByUUID", DoWith <cRoot, cPlayer, &cRoot::DoWithPlayerByUUID>);
tolua_function(tolua_S, "ForEachPlayer", ForEach<cRoot, cPlayer, &cRoot::ForEachPlayer>);
tolua_function(tolua_S, "ForEachWorld", ForEach<cRoot, cWorld, &cRoot::ForEachWorld>);
+ tolua_function(tolua_S, "GetBuildCommitID", tolua_cRoot_GetBuildCommitID);
+ tolua_function(tolua_S, "GetBuildDateTime", tolua_cRoot_GetBuildDateTime);
+ tolua_function(tolua_S, "GetBuildID", tolua_cRoot_GetBuildID);
+ tolua_function(tolua_S, "GetBuildSeriesName", tolua_cRoot_GetBuildSeriesName);
tolua_function(tolua_S, "GetFurnaceRecipe", tolua_cRoot_GetFurnaceRecipe);
tolua_endmodule(tolua_S);
diff --git a/src/Bindings/ManualBindings.h b/src/Bindings/ManualBindings.h
index e7a576588..f8c9b96de 100644
--- a/src/Bindings/ManualBindings.h
+++ b/src/Bindings/ManualBindings.h
@@ -199,7 +199,7 @@ public:
// Get parameters:
Ty1 * Self = nullptr;
- int ItemID;
+ UInt32 ItemID;
cLuaState::cRef FnRef;
L.GetStackValues(1, Self, ItemID, FnRef);
if (Self == nullptr)
@@ -253,8 +253,9 @@ public:
// Check params:
cLuaState L(tolua_S);
if (
- !L.CheckParamNumber(2, 5) ||
- !L.CheckParamFunction(6)
+ !L.CheckParamNumber(2, 4) ||
+ !L.CheckParamFunction(5) ||
+ !L.CheckParamEnd(6)
)
{
return 0;
@@ -316,8 +317,9 @@ public:
// Check params:
cLuaState L(tolua_S);
if (
- !L.CheckParamNumber(2, 4) ||
- !L.CheckParamFunction(5)
+ !L.CheckParamNumber(2, 3) ||
+ !L.CheckParamFunction(4) ||
+ !L.CheckParamEnd(5)
)
{
return 0;
diff --git a/src/Bindings/ManualBindings_Network.cpp b/src/Bindings/ManualBindings_Network.cpp
index df97d60b3..b5fb5b046 100644
--- a/src/Bindings/ManualBindings_Network.cpp
+++ b/src/Bindings/ManualBindings_Network.cpp
@@ -101,13 +101,12 @@ static int tolua_cNetwork_CreateUDPEndpoint(lua_State * L)
}
// Read the params:
- int Port;
- S.GetStackValues(2, Port);
+ UInt16 Port;
// Check validity:
- if ((Port < 0) || (Port > 65535))
+ if (!S.GetStackValues(2, Port))
{
- LOGWARNING("cNetwork:CreateUDPEndpoint() called with invalid port (%d), failing the request.", Port);
+ LOGWARNING("cNetwork:CreateUDPEndpoint() called with invalid port, failing the request.");
S.Push(false);
return 1;
}
diff --git a/src/Bindings/ManualBindings_World.cpp b/src/Bindings/ManualBindings_World.cpp
index 3ee5ca498..d9590de33 100644
--- a/src/Bindings/ManualBindings_World.cpp
+++ b/src/Bindings/ManualBindings_World.cpp
@@ -50,7 +50,7 @@ static int tolua_cWorld_BroadcastParticleEffect(lua_State * tolua_S)
std::array<int, 2> data;
for (int i = 0; (i < 2) && L.IsParamNumber(11 + i); i++)
{
- L.GetStackValue(11 + i, data[i]);
+ L.GetStackValue(11 + i, data[static_cast<size_t>(i)]);
}
World->GetBroadcaster().BroadcastParticleEffect(Name, Vector3f(PosX, PosY, PosZ), Vector3f(OffX, OffY, OffZ), ParticleData, ParticleAmmount, ExcludeClient);
@@ -303,10 +303,9 @@ static int tolua_cWorld_PrepareChunk(lua_State * tolua_S)
cLuaState m_LuaState;
cLuaState::cRef m_Callback;
};
- cCallback * callback = new cCallback(tolua_S);
// Call the chunk preparation:
- world->PrepareChunk(chunkX, chunkZ, callback);
+ world->PrepareChunk(chunkX, chunkZ, cpp14::make_unique<cCallback>(tolua_S));
return 0;
}
@@ -491,7 +490,7 @@ static int tolua_cWorld_ScheduleTask(lua_State * tolua_S)
auto task = std::make_shared<cLuaScheduledWorldTask>(*Plugin, FnRef);
Plugin->AddResettable(task);
- World->ScheduleTask(DelayTicks, task);
+ World->ScheduleTask(DelayTicks, static_cast<cWorld::cTaskPtr>(task));
return 0;
}
@@ -530,7 +529,7 @@ static int tolua_cWorld_TryGetHeight(lua_State * tolua_S)
// Call the implementation:
int Height = 0;
bool res = self->TryGetHeight(BlockX, BlockZ, Height);
- L.Push(res ? 1 : 0);
+ L.Push(res);
if (res)
{
L.Push(Height);
diff --git a/src/Bindings/Plugin.h b/src/Bindings/Plugin.h
index d0c2bcefa..2fdf73a65 100644
--- a/src/Bindings/Plugin.h
+++ b/src/Bindings/Plugin.h
@@ -56,12 +56,15 @@ public:
virtual bool OnDisconnect (cClientHandle & a_Client, const AString & a_Reason) = 0;
virtual bool OnEntityAddEffect (cEntity & a_Entity, int a_EffectType, int a_EffectDurationTicks, int a_EffectIntensity, double a_DistanceModifier) = 0;
virtual bool OnEntityTeleport (cEntity & a_Entity, const Vector3d & a_OldPosition, const Vector3d & a_NewPosition) = 0;
+ virtual bool OnEntityChangingWorld (cEntity & a_Entity, cWorld & a_World) = 0;
+ virtual bool OnEntityChangedWorld (cEntity & a_Entity, cWorld & a_World) = 0;
virtual bool OnExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, cPluginManager::CommandResult & a_Result) = 0;
virtual bool OnExploded (cWorld & a_World, double a_ExplosionSize, bool a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void * a_SourceData) = 0;
virtual bool OnExploding (cWorld & a_World, double & a_ExplosionSize, bool & a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void * a_SourceData) = 0;
virtual bool OnHandshake (cClientHandle & a_Client, const AString & a_Username) = 0;
virtual bool OnHopperPullingItem (cWorld & a_World, cHopperEntity & a_Hopper, int a_DstSlotNum, cBlockEntityWithItems & a_SrcEntity, int a_SrcSlotNum) = 0;
virtual bool OnHopperPushingItem (cWorld & a_World, cHopperEntity & a_Hopper, int a_SrcSlotNum, cBlockEntityWithItems & a_DstEntity, int a_DstSlotNum) = 0;
+ virtual bool OnKilled (cEntity & a_Victim, TakeDamageInfo & a_TDI, AString & a_DeathMessage) = 0;
virtual bool OnKilling (cEntity & a_Victim, cEntity * a_Killer, TakeDamageInfo & a_TDI) = 0;
virtual bool OnLogin (cClientHandle & a_Client, int a_ProtocolVersion, const AString & a_Username) = 0;
virtual bool OnPlayerAnimation (cPlayer & a_Player, int a_Animation) = 0;
diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp
index 76d3557a4..9be4e0eb4 100644
--- a/src/Bindings/PluginLua.cpp
+++ b/src/Bindings/PluginLua.cpp
@@ -534,6 +534,54 @@ bool cPluginLua::OnEntityAddEffect(cEntity & a_Entity, int a_EffectType, int a_E
+bool cPluginLua::OnEntityChangingWorld(cEntity & a_Entity, cWorld & a_World)
+{
+ cCSLock Lock(m_CriticalSection);
+ if (!m_LuaState.IsValid())
+ {
+ return false;
+ }
+ bool res = false;
+ cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_ENTITY_CHANGING_WORLD];
+ for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr)
+ {
+ m_LuaState.Call((int)(**itr), &a_Entity, &a_World, cLuaState::Return, res);
+ if (res)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
+bool cPluginLua::OnEntityChangedWorld(cEntity & a_Entity, cWorld & a_World)
+{
+ cCSLock Lock(m_CriticalSection);
+ if (!m_LuaState.IsValid())
+ {
+ return false;
+ }
+ bool res = false;
+ cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_ENTITY_CHANGED_WORLD];
+ for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr)
+ {
+ m_LuaState.Call((int)(**itr), &a_Entity, &a_World, res);
+ if (res)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
bool cPluginLua::OnExecuteCommand(cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, cPluginManager::CommandResult & a_Result)
{
cCSLock Lock(m_CriticalSection);
@@ -581,11 +629,6 @@ bool cPluginLua::OnExploded(cWorld & a_World, double a_ExplosionSize, bool a_Can
case esWitherSkullBlue: m_LuaState.Call((int)(**itr), &a_World, a_ExplosionSize, a_CanCauseFire, a_X, a_Y, a_Z, a_Source, a_SourceData, cLuaState::Return, res); break;
case esWitherBirth: m_LuaState.Call((int)(**itr), &a_World, a_ExplosionSize, a_CanCauseFire, a_X, a_Y, a_Z, a_Source, a_SourceData, cLuaState::Return, res); break;
case esPlugin: m_LuaState.Call((int)(**itr), &a_World, a_ExplosionSize, a_CanCauseFire, a_X, a_Y, a_Z, a_Source, a_SourceData, cLuaState::Return, res); break;
- default:
- {
- ASSERT(!"Unhandled ExplosionSource");
- return false;
- }
}
if (res)
{
@@ -622,11 +665,6 @@ bool cPluginLua::OnExploding(cWorld & a_World, double & a_ExplosionSize, bool &
case esWitherSkullBlue: m_LuaState.Call((int)(**itr), &a_World, a_ExplosionSize, a_CanCauseFire, a_X, a_Y, a_Z, a_Source, a_SourceData, cLuaState::Return, res, a_CanCauseFire, a_ExplosionSize); break;
case esWitherBirth: m_LuaState.Call((int)(**itr), &a_World, a_ExplosionSize, a_CanCauseFire, a_X, a_Y, a_Z, a_Source, a_SourceData, cLuaState::Return, res, a_CanCauseFire, a_ExplosionSize); break;
case esPlugin: m_LuaState.Call((int)(**itr), &a_World, a_ExplosionSize, a_CanCauseFire, a_X, a_Y, a_Z, a_Source, a_SourceData, cLuaState::Return, res, a_CanCauseFire, a_ExplosionSize); break;
- default:
- {
- ASSERT(!"Unhandled ExplosionSource");
- return false;
- }
}
if (res)
{
@@ -712,6 +750,30 @@ bool cPluginLua::OnHopperPushingItem(cWorld & a_World, cHopperEntity & a_Hopper,
+bool cPluginLua::OnKilled(cEntity & a_Victim, TakeDamageInfo & a_TDI, AString & a_DeathMessage)
+{
+ cCSLock Lock(m_CriticalSection);
+ if (!m_LuaState.IsValid())
+ {
+ return false;
+ }
+ bool res = false;
+ cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_KILLED];
+ for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr)
+ {
+ m_LuaState.Call((int)(**itr), &a_Victim, &a_TDI, a_DeathMessage, cLuaState::Return, res, a_DeathMessage);
+ if (res)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
bool cPluginLua::OnKilling(cEntity & a_Victim, cEntity * a_Killer, TakeDamageInfo & a_TDI)
{
cCSLock Lock(m_CriticalSection);
@@ -1884,6 +1946,8 @@ const char * cPluginLua::GetHookFnName(int a_HookType)
case cPluginManager::HOOK_DISCONNECT: return "OnDisconnect";
case cPluginManager::HOOK_PLAYER_ANIMATION: return "OnPlayerAnimation";
case cPluginManager::HOOK_ENTITY_ADD_EFFECT: return "OnEntityAddEffect";
+ case cPluginManager::HOOK_ENTITY_CHANGING_WORLD: return "OnEntityChangingWorld";
+ case cPluginManager::HOOK_ENTITY_CHANGED_WORLD: return "OnEntityChangedWorld";
case cPluginManager::HOOK_ENTITY_TELEPORT: return "OnEntityTeleport";
case cPluginManager::HOOK_EXECUTE_COMMAND: return "OnExecuteCommand";
case cPluginManager::HOOK_HANDSHAKE: return "OnHandshake";
diff --git a/src/Bindings/PluginLua.h b/src/Bindings/PluginLua.h
index 524c249b0..7de70ef1f 100644
--- a/src/Bindings/PluginLua.h
+++ b/src/Bindings/PluginLua.h
@@ -115,12 +115,15 @@ public:
virtual bool OnCraftingNoRecipe (cPlayer & a_Player, cCraftingGrid & a_Grid, cCraftingRecipe & a_Recipe) override;
virtual bool OnDisconnect (cClientHandle & a_Client, const AString & a_Reason) override;
virtual bool OnEntityAddEffect (cEntity & a_Entity, int a_EffectType, int a_EffectDurationTicks, int a_EffectIntensity, double a_DistanceModifier) override;
+ virtual bool OnEntityChangingWorld (cEntity & a_Entity, cWorld & a_World) override;
+ virtual bool OnEntityChangedWorld (cEntity & a_Entity, cWorld & a_World) override;
virtual bool OnExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, cPluginManager::CommandResult & a_Result) override;
virtual bool OnExploded (cWorld & a_World, double a_ExplosionSize, bool a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void * a_SourceData) override;
virtual bool OnExploding (cWorld & a_World, double & a_ExplosionSize, bool & a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void * a_SourceData) override;
virtual bool OnHandshake (cClientHandle & a_Client, const AString & a_Username) override;
virtual bool OnHopperPullingItem (cWorld & a_World, cHopperEntity & a_Hopper, int a_DstSlotNum, cBlockEntityWithItems & a_SrcEntity, int a_SrcSlotNum) override;
virtual bool OnHopperPushingItem (cWorld & a_World, cHopperEntity & a_Hopper, int a_SrcSlotNum, cBlockEntityWithItems & a_DstEntity, int a_DstSlotNum) override;
+ virtual bool OnKilled (cEntity & a_Victim, TakeDamageInfo & a_TDI, AString & a_DeathMessage) override;
virtual bool OnKilling (cEntity & a_Victim, cEntity * a_Killer, TakeDamageInfo & a_TDI) override;
virtual bool OnLogin (cClientHandle & a_Client, int a_ProtocolVersion, const AString & a_Username) override;
virtual bool OnPlayerAnimation (cPlayer & a_Player, int a_Animation) override;
@@ -177,7 +180,7 @@ public:
bool CanAddOldStyleHook(int a_HookType);
// cWebPlugin overrides
- virtual const AString GetWebTitle(void) const {return GetName(); }
+ virtual const AString GetWebTitle(void) const override {return GetName(); }
virtual AString HandleWebRequest(const HTTPRequest & a_Request) override;
/** Adds a new web tab to webadmin.
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp
index db2493955..712c385c7 100644
--- a/src/Bindings/PluginManager.cpp
+++ b/src/Bindings/PluginManager.cpp
@@ -118,7 +118,7 @@ void cPluginManager::ReloadPluginsNow(void)
-void cPluginManager::ReloadPluginsNow(cIniFile & a_SettingsIni)
+void cPluginManager::ReloadPluginsNow(cSettingsRepositoryInterface & a_Settings)
{
LOG("-- Loading Plugins --");
@@ -130,7 +130,7 @@ void cPluginManager::ReloadPluginsNow(cIniFile & a_SettingsIni)
RefreshPluginList();
// Load the plugins:
- AStringVector ToLoad = GetFoldersToLoad(a_SettingsIni);
+ AStringVector ToLoad = GetFoldersToLoad(a_Settings);
for (auto & pluginFolder: ToLoad)
{
LoadPlugin(pluginFolder);
@@ -157,16 +157,16 @@ void cPluginManager::ReloadPluginsNow(cIniFile & a_SettingsIni)
-void cPluginManager::InsertDefaultPlugins(cIniFile & a_SettingsIni)
+void cPluginManager::InsertDefaultPlugins(cSettingsRepositoryInterface & a_Settings)
{
- a_SettingsIni.AddKeyName("Plugins");
- a_SettingsIni.AddKeyComment("Plugins", " Plugin=Debuggers");
- a_SettingsIni.AddKeyComment("Plugins", " Plugin=HookNotify");
- a_SettingsIni.AddKeyComment("Plugins", " Plugin=ChunkWorx");
- a_SettingsIni.AddKeyComment("Plugins", " Plugin=APIDump");
- a_SettingsIni.AddValue("Plugins", "Plugin", "Core");
- a_SettingsIni.AddValue("Plugins", "Plugin", "TransAPI");
- a_SettingsIni.AddValue("Plugins", "Plugin", "ChatLog");
+ a_Settings.AddKeyName("Plugins");
+ a_Settings.AddKeyComment("Plugins", " Plugin=Debuggers");
+ a_Settings.AddKeyComment("Plugins", " Plugin=HookNotify");
+ a_Settings.AddKeyComment("Plugins", " Plugin=ChunkWorx");
+ a_Settings.AddKeyComment("Plugins", " Plugin=APIDump");
+ a_Settings.AddValue("Plugins", "Plugin", "Core");
+ a_Settings.AddValue("Plugins", "Plugin", "TransAPI");
+ a_Settings.AddValue("Plugins", "Plugin", "ChatLog");
}
@@ -525,6 +525,42 @@ bool cPluginManager::CallHookEntityTeleport(cEntity & a_Entity, const Vector3d &
+bool cPluginManager::CallHookEntityChangingWorld(cEntity & a_Entity, cWorld & a_World)
+{
+ FIND_HOOK(HOOK_ENTITY_CHANGING_WORLD);
+ VERIFY_HOOK;
+
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnEntityChangingWorld(a_Entity, a_World))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+bool cPluginManager::CallHookEntityChangedWorld(cEntity & a_Entity, cWorld & a_World)
+{
+ FIND_HOOK(HOOK_ENTITY_CHANGED_WORLD);
+ VERIFY_HOOK;
+
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnEntityChangedWorld(a_Entity, a_World))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
bool cPluginManager::CallHookExecuteCommand(cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, CommandResult & a_Result)
{
FIND_HOOK(HOOK_EXECUTE_COMMAND);
@@ -639,6 +675,25 @@ bool cPluginManager::CallHookHopperPushingItem(cWorld & a_World, cHopperEntity &
+bool cPluginManager::CallHookKilled(cEntity & a_Victim, TakeDamageInfo & a_TDI, AString & a_DeathMessage)
+{
+ FIND_HOOK(HOOK_KILLED);
+ VERIFY_HOOK;
+
+ for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
+ {
+ if ((*itr)->OnKilled(a_Victim, a_TDI, a_DeathMessage))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+
+
+
bool cPluginManager::CallHookKilling(cEntity & a_Victim, cEntity * a_Killer, TakeDamageInfo & a_TDI)
{
FIND_HOOK(HOOK_KILLING);
@@ -1896,25 +1951,23 @@ size_t cPluginManager::GetNumLoadedPlugins(void) const
-AStringVector cPluginManager::GetFoldersToLoad(cIniFile & a_SettingsIni)
+AStringVector cPluginManager::GetFoldersToLoad(cSettingsRepositoryInterface & a_Settings)
{
// Check if the Plugins section exists.
- int KeyNum = a_SettingsIni.FindKey("Plugins");
- if (KeyNum == -1)
+ if (!a_Settings.KeyExists("Plugins"))
{
- InsertDefaultPlugins(a_SettingsIni);
- KeyNum = a_SettingsIni.FindKey("Plugins");
+ InsertDefaultPlugins(a_Settings);
}
// Get the list of plugins to load:
AStringVector res;
- int NumPlugins = a_SettingsIni.GetNumValues(KeyNum);
- for (int i = 0; i < NumPlugins; i++)
+ auto Values = a_Settings.GetValues("Plugins");
+ for (auto NameValue : Values)
{
- AString ValueName = a_SettingsIni.GetValueName(KeyNum, i);
+ AString ValueName = NameValue.first;
if (ValueName.compare("Plugin") == 0)
{
- AString PluginFile = a_SettingsIni.GetValue(KeyNum, i);
+ AString PluginFile = NameValue.second;
if (!PluginFile.empty())
{
res.push_back(PluginFile);
diff --git a/src/Bindings/PluginManager.h b/src/Bindings/PluginManager.h
index d8c886b62..153f4996d 100644
--- a/src/Bindings/PluginManager.h
+++ b/src/Bindings/PluginManager.h
@@ -24,6 +24,7 @@ class cPlayer;
class cPlugin;
class cProjectileEntity;
class cWorld;
+class cSettingsRepositoryInterface;
struct TakeDamageInfo;
typedef SharedPtr<cPlugin> cPluginPtr;
@@ -85,12 +86,15 @@ public:
HOOK_DISCONNECT,
HOOK_PLAYER_ANIMATION,
HOOK_ENTITY_ADD_EFFECT,
+ HOOK_ENTITY_CHANGING_WORLD,
+ HOOK_ENTITY_CHANGED_WORLD,
HOOK_EXECUTE_COMMAND,
HOOK_EXPLODED,
HOOK_EXPLODING,
HOOK_HANDSHAKE,
HOOK_HOPPER_PULLING_ITEM,
HOOK_HOPPER_PUSHING_ITEM,
+ HOOK_KILLED,
HOOK_KILLING,
HOOK_LOGIN,
HOOK_PLAYER_BREAKING_BLOCK,
@@ -200,12 +204,15 @@ public:
bool CallHookDisconnect (cClientHandle & a_Client, const AString & a_Reason);
bool CallHookEntityAddEffect (cEntity & a_Entity, int a_EffectType, int a_EffectDurationTicks, int a_EffectIntensity, double a_DistanceModifier);
bool CallHookEntityTeleport (cEntity & a_Entity, const Vector3d & a_OldPosition, const Vector3d & a_NewPosition);
+ bool CallHookEntityChangingWorld (cEntity & a_Entity, cWorld & a_World);
+ bool CallHookEntityChangedWorld (cEntity & a_Entity, cWorld & a_World);
bool CallHookExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, CommandResult & a_Result); // If a_Player == nullptr, it is a console cmd
bool CallHookExploded (cWorld & a_World, double a_ExplosionSize, bool a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void * a_SourceData);
bool CallHookExploding (cWorld & a_World, double & a_ExplosionSize, bool & a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void * a_SourceData);
bool CallHookHandshake (cClientHandle & a_ClientHandle, const AString & a_Username);
bool CallHookHopperPullingItem (cWorld & a_World, cHopperEntity & a_Hopper, int a_DstSlotNum, cBlockEntityWithItems & a_SrcEntity, int a_SrcSlotNum);
bool CallHookHopperPushingItem (cWorld & a_World, cHopperEntity & a_Hopper, int a_SrcSlotNum, cBlockEntityWithItems & a_DstEntity, int a_DstSlotNum);
+ bool CallHookKilled (cEntity & a_Victim, TakeDamageInfo & a_TDI, AString & a_DeathMessage);
bool CallHookKilling (cEntity & a_Victim, cEntity * a_Killer, TakeDamageInfo & a_TDI);
bool CallHookLogin (cClientHandle & a_Client, int a_ProtocolVersion, const AString & a_Username);
bool CallHookPlayerAnimation (cPlayer & a_Player, int a_Animation);
@@ -364,20 +371,20 @@ private:
/** Reloads all plugins, defaulting to settings.ini for settings location */
void ReloadPluginsNow(void);
- /** Reloads all plugins with a cIniFile object expected to be initialised to settings.ini */
- void ReloadPluginsNow(cIniFile & a_SettingsIni);
+ /** Reloads all plugins with a settings repo expected to be initialised to settings.ini */
+ void ReloadPluginsNow(cSettingsRepositoryInterface & a_Settings);
/** Unloads all plugins */
void UnloadPluginsNow(void);
- /** Handles writing default plugins if 'Plugins' key not found using a cIniFile object expected to be intialised to settings.ini */
- void InsertDefaultPlugins(cIniFile & a_SettingsIni);
+ /** Handles writing default plugins if 'Plugins' key not found using a settings repo expected to be intialised to settings.ini */
+ void InsertDefaultPlugins(cSettingsRepositoryInterface & a_Settings);
/** Tries to match a_Command to the internal table of commands, if a match is found, the corresponding plugin is called. Returns crExecuted if the command is executed. */
CommandResult HandleCommand(cPlayer & a_Player, const AString & a_Command, bool a_ShouldCheckPermissions);
/** Returns the folders that are specified in the settings ini to load plugins from. */
- AStringVector GetFoldersToLoad(cIniFile & a_SettingsIni);
+ AStringVector GetFoldersToLoad(cSettingsRepositoryInterface & a_Settings);
} ; // tolua_export
diff --git a/src/BiomeDef.cpp b/src/BiomeDef.cpp
index a2a06f10c..9dbdf05a2 100644
--- a/src/BiomeDef.cpp
+++ b/src/BiomeDef.cpp
@@ -98,11 +98,11 @@ EMCSBiome StringToBiome(const AString & a_BiomeString)
{
if ((res >= biFirstBiome) && (res < biNumBiomes))
{
- return (EMCSBiome)res;
+ return static_cast<EMCSBiome>(res);
}
else if ((res >= biFirstVariantBiome) && (res < biNumVariantBiomes))
{
- return (EMCSBiome)res;
+ return static_cast<EMCSBiome>(res);
}
// It was an invalid number
return biInvalidBiome;
diff --git a/src/BiomeDef.h b/src/BiomeDef.h
index cda12556a..32d3a5cfd 100644
--- a/src/BiomeDef.h
+++ b/src/BiomeDef.h
@@ -104,6 +104,28 @@ enum EMCSBiome
biMaxVariantBiome = biNumVariantBiomes - 1, // The maximum biome value
} ;
+// tolua_end
+
+
+
+
+
+/** Hash for EMCSBiome, so that it can be used in std::unordered_map etc. */
+struct BiomeHasher
+{
+public:
+ std::size_t operator() (const EMCSBiome a_Biome) const
+ {
+ return static_cast<std::size_t>(a_Biome);
+ }
+};
+
+
+
+
+
+// tolua_begin
+
/** Translates a biome string to biome enum. Takes either a number or a biome alias (built-in). Returns biInvalidBiome on failure. */
extern EMCSBiome StringToBiome(const AString & a_BiomeString);
diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp
index 89cf18d4a..eb25d624d 100644
--- a/src/BlockArea.cpp
+++ b/src/BlockArea.cpp
@@ -60,7 +60,7 @@ void InternalMergeBlocks(
else
{
NIBBLETYPE FakeDestMeta = 0;
- Combinator(a_DstTypes[DstIdx], a_SrcTypes[SrcIdx], FakeDestMeta, (NIBBLETYPE)0);
+ Combinator(a_DstTypes[DstIdx], a_SrcTypes[SrcIdx], FakeDestMeta, static_cast<NIBBLETYPE>(0));
}
++DstIdx;
++SrcIdx;
@@ -336,6 +336,12 @@ void cBlockArea::Create(int a_SizeX, int a_SizeY, int a_SizeZ, int a_DataTypes)
);
return;
}
+
+ // Warn if the height is too much, but proceed with the creation:
+ if (a_SizeY > cChunkDef::Height)
+ {
+ LOGWARNING("Creating a cBlockArea with height larger than world height (%d). Continuing, but the area may misbehave.", a_SizeY);
+ }
Clear();
int BlockCount = a_SizeX * a_SizeY * a_SizeZ;
@@ -540,7 +546,7 @@ bool cBlockArea::Write(cForEachChunkProvider * a_ForEachChunkProvider, int a_Min
else if (a_MinBlockY > cChunkDef::Height - m_Size.y)
{
LOGWARNING("%s: MinBlockY + m_SizeY more than chunk height, adjusting to chunk height", __FUNCTION__);
- a_MinBlockY = cChunkDef::Height - m_Size.y;
+ a_MinBlockY = std::max(cChunkDef::Height - m_Size.y, 0);
}
return a_ForEachChunkProvider->WriteBlockArea(*this, a_MinBlockX, a_MinBlockY, a_MinBlockZ, a_DataTypes);
@@ -620,7 +626,7 @@ void cBlockArea::DumpToRawFile(const AString & a_FileName)
f.Write(&SizeX, 4);
f.Write(&SizeY, 4);
f.Write(&SizeZ, 4);
- unsigned char DataTypes = (unsigned char)GetDataTypes();
+ unsigned char DataTypes = static_cast<unsigned char>(GetDataTypes());
f.Write(&DataTypes, 1);
size_t NumBlocks = GetBlockCount();
if (HasBlockTypes())
@@ -1665,6 +1671,65 @@ size_t cBlockArea::CountNonAirBlocks(void) const
+size_t cBlockArea::CountSpecificBlocks(BLOCKTYPE a_BlockType) const
+{
+ // If blocktypes are not valid, log a warning and return zero occurences:
+ if (m_BlockTypes == nullptr)
+ {
+ LOGWARNING("%s: BlockTypes not available!", __FUNCTION__);
+ return 0;
+ }
+
+ // Count the blocks:
+ size_t num = GetBlockCount();
+ size_t res = 0;
+ for (size_t i = 0; i < num; i++)
+ {
+ if (m_BlockTypes[i] == a_BlockType)
+ {
+ res++;
+ }
+ }
+ return res;
+}
+
+
+
+
+
+size_t cBlockArea::CountSpecificBlocks(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) const
+{
+ // If blocktypes are not valid, log a warning and return zero occurences:
+ if (m_BlockTypes == nullptr)
+ {
+ LOGWARNING("%s: BlockTypes not available!", __FUNCTION__);
+ return 0;
+ }
+
+ // If blockmetas are not valid, log a warning and count only blocktypes:
+ if (m_BlockMetas == nullptr)
+ {
+ LOGWARNING("%s: BlockMetas not available, comparing blocktypes only!", __FUNCTION__);
+ return CountSpecificBlocks(a_BlockType);
+ }
+
+ // Count the blocks:
+ size_t num = GetBlockCount();
+ size_t res = 0;
+ for (size_t i = 0; i < num; i++)
+ {
+ if ((m_BlockTypes[i] == a_BlockType) && (m_BlockMetas[i] == a_BlockMeta))
+ {
+ res++;
+ }
+ }
+ return res;
+}
+
+
+
+
+
void cBlockArea::GetNonAirCropRelCoords(int & a_MinRelX, int & a_MinRelY, int & a_MinRelZ, int & a_MaxRelX, int & a_MaxRelY, int & a_MaxRelZ, BLOCKTYPE a_IgnoreBlockType)
{
// Check if blocktypes are valid:
@@ -2157,7 +2222,7 @@ void cBlockArea::ExpandBlockTypes(int a_SubMinX, int a_AddMaxX, int a_SubMinY, i
int NewSizeX = m_Size.x + a_SubMinX + a_AddMaxX;
int NewSizeY = m_Size.y + a_SubMinY + a_AddMaxY;
int NewSizeZ = m_Size.z + a_SubMinZ + a_AddMaxZ;
- size_t BlockCount = (size_t)(NewSizeX * NewSizeY * NewSizeZ);
+ size_t BlockCount = static_cast<size_t>(NewSizeX * NewSizeY * NewSizeZ);
BLOCKTYPE * NewBlockTypes = new BLOCKTYPE[BlockCount];
memset(NewBlockTypes, 0, BlockCount * sizeof(BLOCKTYPE));
int OldIndex = 0;
@@ -2187,7 +2252,7 @@ void cBlockArea::ExpandNibbles(NIBBLEARRAY & a_Array, int a_SubMinX, int a_AddMa
int NewSizeX = m_Size.x + a_SubMinX + a_AddMaxX;
int NewSizeY = m_Size.y + a_SubMinY + a_AddMaxY;
int NewSizeZ = m_Size.z + a_SubMinZ + a_AddMaxZ;
- size_t BlockCount = (size_t)(NewSizeX * NewSizeY * NewSizeZ);
+ size_t BlockCount = static_cast<size_t>(NewSizeX * NewSizeY * NewSizeZ);
NIBBLETYPE * NewNibbles = new NIBBLETYPE[BlockCount];
memset(NewNibbles, 0, BlockCount * sizeof(NIBBLETYPE));
int OldIndex = 0;
diff --git a/src/BlockArea.h b/src/BlockArea.h
index 856df542f..a9963b4ef 100644
--- a/src/BlockArea.h
+++ b/src/BlockArea.h
@@ -308,6 +308,15 @@ public:
Returns 0 if blocktypes not available. Block metas are ignored (if present, air with any meta is still considered air). */
size_t CountNonAirBlocks(void) const;
+ /** Returns how many times the specified block is contained in the area.
+ The blocks' meta values are ignored, only the blocktype is compared. */
+ size_t CountSpecificBlocks(BLOCKTYPE a_BlockType) const;
+
+ /** Returns how many times the specified block is contained in the area.
+ Both the block's type and meta must match in order to be counted in.
+ If the block metas aren't present in the area, logs a warning and ignores the meta specification. */
+ size_t CountSpecificBlocks(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) const;
+
// tolua_end
/** Returns the minimum and maximum coords in each direction for the first non-ignored block in each direction.
@@ -321,7 +330,7 @@ public:
NIBBLETYPE * GetBlockMetas (void) const { return m_BlockMetas; } // NOTE: one byte per block!
NIBBLETYPE * GetBlockLight (void) const { return m_BlockLight; } // NOTE: one byte per block!
NIBBLETYPE * GetBlockSkyLight(void) const { return m_BlockSkyLight; } // NOTE: one byte per block!
- size_t GetBlockCount(void) const { return (size_t)(m_Size.x * m_Size.y * m_Size.z); }
+ size_t GetBlockCount(void) const { return static_cast<size_t>(m_Size.x * m_Size.y * m_Size.z); }
int MakeIndex(int a_RelX, int a_RelY, int a_RelZ) const;
protected:
diff --git a/src/BlockEntities/BeaconEntity.cpp b/src/BlockEntities/BeaconEntity.cpp
index fb3940ce9..a945c6ea9 100644
--- a/src/BlockEntities/BeaconEntity.cpp
+++ b/src/BlockEntities/BeaconEntity.cpp
@@ -77,7 +77,7 @@ bool cBeaconEntity::IsValidEffect(cEntityEffect::eType a_Effect, char a_BeaconLe
default:
{
- LOGD("%s: Invalid beacon effect: %d", __FUNCTION__, (int)a_Effect);
+ LOGD("%s: Invalid beacon effect: %d", __FUNCTION__, static_cast<int>(a_Effect));
return false;
}
}
@@ -228,9 +228,9 @@ void cBeaconEntity::GiveEffects(void)
virtual bool Item(cPlayer * a_Player)
{
Vector3d PlayerPosition = Vector3d(a_Player->GetPosition());
- if (PlayerPosition.y > (double)m_PosY)
+ if (PlayerPosition.y > static_cast<double>(m_PosY))
{
- PlayerPosition.y = (double)m_PosY;
+ PlayerPosition.y = static_cast<double>(m_PosY);
}
// TODO: Vanilla minecraft uses an AABB check instead of a radius one
diff --git a/src/BlockEntities/BlockEntity.h b/src/BlockEntities/BlockEntity.h
index 85f75a523..785ee978a 100644
--- a/src/BlockEntities/BlockEntity.h
+++ b/src/BlockEntities/BlockEntity.h
@@ -85,13 +85,14 @@ public:
// tolua_begin
// Position, in absolute block coordinates:
+ Vector3i GetPos(void) const { return Vector3i{m_PosX, m_PosY, m_PosZ}; }
int GetPosX(void) const { return m_PosX; }
int GetPosY(void) const { return m_PosY; }
int GetPosZ(void) const { return m_PosZ; }
BLOCKTYPE GetBlockType(void) const { return m_BlockType; }
- cWorld * GetWorld(void) const {return m_World; }
+ cWorld * GetWorld(void) const { return m_World; }
int GetChunkX(void) const { return FAST_FLOOR_DIV(m_PosX, cChunkDef::Width); }
int GetChunkZ(void) const { return FAST_FLOOR_DIV(m_PosZ, cChunkDef::Width); }
diff --git a/src/BlockEntities/BlockEntityWithItems.h b/src/BlockEntities/BlockEntityWithItems.h
index 740dbca51..30a09bc02 100644
--- a/src/BlockEntities/BlockEntityWithItems.h
+++ b/src/BlockEntities/BlockEntityWithItems.h
@@ -76,7 +76,7 @@ protected:
cItemGrid m_Contents;
// cItemGrid::cListener overrides:
- virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum)
+ virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum) override
{
UNUSED(a_SlotNum);
ASSERT(a_Grid == &m_Contents);
diff --git a/src/BlockEntities/CMakeLists.txt b/src/BlockEntities/CMakeLists.txt
index 5f4af288d..b0bfca5e4 100644
--- a/src/BlockEntities/CMakeLists.txt
+++ b/src/BlockEntities/CMakeLists.txt
@@ -41,6 +41,11 @@ SET (HDRS
NoteEntity.h
SignEntity.h)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(BeaconEntity.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=switch-enum")
+ set_source_files_properties(NoteEntity.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=sign-conversion")
+endif()
+
if(NOT MSVC)
add_library(BlockEntities ${SRCS} ${HDRS})
endif()
diff --git a/src/BlockEntities/ChestEntity.cpp b/src/BlockEntities/ChestEntity.cpp
index 1c186310c..21baac977 100644
--- a/src/BlockEntities/ChestEntity.cpp
+++ b/src/BlockEntities/ChestEntity.cpp
@@ -37,7 +37,7 @@ void cChestEntity::SendTo(cClientHandle & a_Client)
{
// The chest entity doesn't need anything sent to the client when it's created / gets in the viewdistance
// All the actual handling is in the cWindow UI code that gets called when the chest is rclked
-
+
UNUSED(a_Client);
}
@@ -54,7 +54,7 @@ void cChestEntity::UsedBy(cPlayer * a_Player)
OpenNewWindow();
Window = GetWindow();
}
-
+
// Open the window for the player:
if (Window != nullptr)
{
@@ -80,7 +80,7 @@ void cChestEntity::UsedBy(cPlayer * a_Player)
void cChestEntity::OpenNewWindow(void)
{
// TODO: cats are an obstruction
- if ((GetPosY() < cChunkDef::Height - 1) && cBlockInfo::IsSolid(GetWorld()->GetBlock(GetPosX(), GetPosY() + 1, GetPosZ())))
+ if ((GetPosY() < cChunkDef::Height - 1) && !cBlockInfo::IsTransparent(GetWorld()->GetBlock(GetPosX(), GetPosY() + 1, GetPosZ())))
{
// Obstruction, don't open
return;
@@ -96,10 +96,10 @@ void cChestEntity::OpenNewWindow(void)
m_ThisChest(a_ThisChest)
{
}
-
+
virtual bool Item(cChestEntity * a_Chest) override
{
- if ((a_Chest->GetPosY() < cChunkDef::Height - 1) && cBlockInfo::IsSolid(a_Chest->GetWorld()->GetBlock(a_Chest->GetPosX(), a_Chest->GetPosY() + 1, a_Chest->GetPosZ())))
+ if ((a_Chest->GetPosY() < cChunkDef::Height - 1) && !cBlockInfo::IsTransparent(a_Chest->GetWorld()->GetBlock(a_Chest->GetPosX(), a_Chest->GetPosY() + 1, a_Chest->GetPosZ())))
{
// Obstruction, don't open
return false;
@@ -119,7 +119,7 @@ void cChestEntity::OpenNewWindow(void)
return false;
}
} ;
-
+
// Scan neighbors for adjacent chests:
cOpenDouble OpenDbl(this);
if (
@@ -136,7 +136,3 @@ void cChestEntity::OpenNewWindow(void)
// There is no chest neighbor, open a single-chest window:
OpenWindow(new cChestWindow(this));
}
-
-
-
-
diff --git a/src/BlockEntities/ChestEntity.h b/src/BlockEntities/ChestEntity.h
index 645dbf4bc..6eb72fc77 100644
--- a/src/BlockEntities/ChestEntity.h
+++ b/src/BlockEntities/ChestEntity.h
@@ -53,6 +53,24 @@ private:
/** Number of players who currently have this chest open */
int m_NumActivePlayers;
+
+ /** cItemGrid::cListener overrides: */
+ virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum) override
+ {
+ UNUSED(a_SlotNum);
+ ASSERT(a_Grid == &m_Contents);
+ if (m_World != nullptr)
+ {
+ if (GetWindow() != nullptr)
+ {
+ GetWindow()->BroadcastWholeWindow();
+ }
+
+ m_World->MarkChunkDirty(GetChunkX(), GetChunkZ());
+ m_World->MarkRedstoneDirty(GetChunkX(), GetChunkZ());
+ }
+ }
+
} ; // tolua_export
diff --git a/src/BlockEntities/DropSpenserEntity.cpp b/src/BlockEntities/DropSpenserEntity.cpp
index 039f5d360..3a93e85a1 100644
--- a/src/BlockEntities/DropSpenserEntity.cpp
+++ b/src/BlockEntities/DropSpenserEntity.cpp
@@ -75,7 +75,7 @@ void cDropSpenserEntity::DropSpense(cChunk & a_Chunk)
if (SlotsCnt == 0)
{
// Nothing in the dropspenser, play the click sound
- m_World->BroadcastSoundEffect("random.click", m_PosX * 8, m_PosY * 8, m_PosZ * 8, 1.0f, 1.2f);
+ m_World->BroadcastSoundEffect("random.click", static_cast<double>(m_PosX), static_cast<double>(m_PosY), static_cast<double>(m_PosZ), 1.0f, 1.2f);
return;
}
@@ -97,7 +97,7 @@ void cDropSpenserEntity::DropSpense(cChunk & a_Chunk)
case E_META_DROPSPENSER_FACING_ZP: SmokeDir = 7; break;
}
m_World->BroadcastSoundParticleEffect(2000, m_PosX, m_PosY, m_PosZ, SmokeDir);
- m_World->BroadcastSoundEffect("random.click", m_PosX * 8, m_PosY * 8, m_PosZ * 8, 1.0f, 1.0f);
+ m_World->BroadcastSoundEffect("random.click", static_cast<double>(m_PosX), static_cast<double>(m_PosY), static_cast<double>(m_PosZ), 1.0f, 1.0f);
}
diff --git a/src/BlockEntities/EnderChestEntity.cpp b/src/BlockEntities/EnderChestEntity.cpp
index ab5c5a2de..00e203520 100644
--- a/src/BlockEntities/EnderChestEntity.cpp
+++ b/src/BlockEntities/EnderChestEntity.cpp
@@ -35,6 +35,12 @@ cEnderChestEntity::~cEnderChestEntity()
void cEnderChestEntity::UsedBy(cPlayer * a_Player)
{
+ // TODO: cats are an obstruction
+ if ((GetPosY() < cChunkDef::Height - 1) && !cBlockInfo::IsTransparent(GetWorld()->GetBlock(GetPosX(), GetPosY() + 1, GetPosZ())))
+ {
+ // Obstruction, don't open
+ return;
+ }
// If the window is not created, open it anew:
cWindow * Window = GetWindow();
if (Window == nullptr)
@@ -42,7 +48,7 @@ void cEnderChestEntity::UsedBy(cPlayer * a_Player)
OpenNewWindow();
Window = GetWindow();
}
-
+
// Open the window for the player:
if (Window != nullptr)
{
@@ -91,7 +97,3 @@ void cEnderChestEntity::SaveToJson(Json::Value & a_Value, const cItemGrid & a_Gr
a_Value.append(Slot);
}
}
-
-
-
-
diff --git a/src/BlockEntities/FurnaceEntity.cpp b/src/BlockEntities/FurnaceEntity.cpp
index 2621b560b..d1588160d 100644
--- a/src/BlockEntities/FurnaceEntity.cpp
+++ b/src/BlockEntities/FurnaceEntity.cpp
@@ -32,7 +32,8 @@ cFurnaceEntity::cFurnaceEntity(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTY
m_NeedCookTime(0),
m_TimeCooked(0),
m_FuelBurnTime(0),
- m_TimeBurned(0)
+ m_TimeBurned(0),
+ m_IsLoading(false)
{
m_Contents.AddListener(*this);
}
@@ -178,20 +179,15 @@ void cFurnaceEntity::BurnNewFuel(void)
{
cFurnaceRecipe * FR = cRoot::Get()->GetFurnaceRecipe();
int NewTime = FR->GetBurnTime(m_Contents.GetSlot(fsFuel));
- if (NewTime == 0)
+ if ((NewTime == 0) || !CanCookInputToOutput())
{
// The item in the fuel slot is not suitable
+ // or the input and output isn't available for cooking
SetBurnTimes(0, 0);
SetIsCooking(false);
return;
}
- // Is the input and output ready for cooking?
- if (!CanCookInputToOutput())
- {
- return;
- }
-
// Burn one new fuel:
SetBurnTimes(NewTime, 0);
SetIsCooking(true);
@@ -218,6 +214,11 @@ void cFurnaceEntity::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum)
return;
}
+ if (m_IsLoading)
+ {
+ return;
+ }
+
ASSERT(a_ItemGrid == &m_Contents);
switch (a_SlotNum)
{
@@ -238,7 +239,10 @@ void cFurnaceEntity::UpdateInput(void)
if (!m_Contents.GetSlot(fsInput).IsEqual(m_LastInput))
{
// The input is different from what we had before, reset the cooking time
- m_TimeCooked = 0;
+ if (!m_IsLoading)
+ {
+ m_TimeCooked = 0;
+ }
}
m_LastInput = m_Contents.GetSlot(fsInput);
@@ -253,13 +257,17 @@ void cFurnaceEntity::UpdateInput(void)
else
{
m_NeedCookTime = m_CurrentRecipe->CookTime;
- SetIsCooking(true);
// Start burning new fuel if there's no flame now:
if (GetFuelBurnTimeLeft() <= 0)
{
BurnNewFuel();
}
+ // Already burning, set cooking to ensure that cooking is occuring
+ else
+ {
+ SetIsCooking(true);
+ }
}
}
@@ -293,11 +301,19 @@ void cFurnaceEntity::UpdateOutput(void)
return;
}
- // No need to burn new fuel, the Tick() function will take care of that
-
// Can cook, start cooking if not already underway:
m_NeedCookTime = m_CurrentRecipe->CookTime;
- SetIsCooking(m_FuelBurnTime > 0);
+
+ // Check if fuel needs to start a burn
+ if (GetFuelBurnTimeLeft() <= 0)
+ {
+ BurnNewFuel();
+ }
+ // Already burning, set cooking to ensure that cooking is occuring
+ else
+ {
+ SetIsCooking(true);
+ }
}
diff --git a/src/BlockEntities/FurnaceEntity.h b/src/BlockEntities/FurnaceEntity.h
index 8b3ba3e36..8734d763c 100644
--- a/src/BlockEntities/FurnaceEntity.h
+++ b/src/BlockEntities/FurnaceEntity.h
@@ -101,6 +101,11 @@ public:
m_TimeCooked = a_TimeCooked;
}
+ void SetLoading(bool a_IsLoading)
+ {
+ m_IsLoading = a_IsLoading;
+ }
+
protected:
/** Block meta of the block currently represented by this entity */
@@ -129,6 +134,9 @@ protected:
/** Amount of ticks that the current fuel has been burning */
int m_TimeBurned;
+
+ /** Is the block currently being loaded into the world? */
+ bool m_IsLoading;
/** Sends the specified progressbar value to all clients of the window */
void BroadcastProgress(short a_ProgressbarID, short a_Value);
diff --git a/src/BlockEntities/HopperEntity.cpp b/src/BlockEntities/HopperEntity.cpp
index 203f47534..662212c4d 100644
--- a/src/BlockEntities/HopperEntity.cpp
+++ b/src/BlockEntities/HopperEntity.cpp
@@ -507,7 +507,7 @@ bool cHopperEntity::MoveItemsFromSlot(cBlockEntityWithItems & a_Entity, int a_Sl
auto PreviousCount = m_Contents.GetSlot(i).m_ItemCount;
m_Contents.ChangeSlotCount(i, 1);
- if (PreviousCount == m_Contents.GetSlot(i).m_ItemCount + 1)
+ if (PreviousCount + 1 == m_Contents.GetSlot(i).m_ItemCount)
{
// Successfully added a new item. (Failure condition consistutes: stack full)
return true;
diff --git a/src/BlockEntities/MobSpawnerEntity.cpp b/src/BlockEntities/MobSpawnerEntity.cpp
index 764d7af84..1a0ce5b22 100644
--- a/src/BlockEntities/MobSpawnerEntity.cpp
+++ b/src/BlockEntities/MobSpawnerEntity.cpp
@@ -145,9 +145,9 @@ void cMobSpawnerEntity::SpawnEntity(void)
break;
}
- int RelX = (int) (m_RelX + (double)(Random.NextFloat() - Random.NextFloat()) * 4.0);
+ int RelX = static_cast<int>(m_RelX + static_cast<double>(Random.NextFloat() - Random.NextFloat()) * 4.0);
int RelY = m_RelY + Random.NextInt(3) - 1;
- int RelZ = (int) (m_RelZ + (double)(Random.NextFloat() - Random.NextFloat()) * 4.0);
+ int RelZ = static_cast<int>(m_RelZ + static_cast<double>(Random.NextFloat() - Random.NextFloat()) * 4.0);
cChunk * Chunk = a_Chunk->GetRelNeighborChunkAdjustCoords(RelX, RelZ);
if ((Chunk == nullptr) || !Chunk->IsValid())
@@ -172,7 +172,13 @@ void cMobSpawnerEntity::SpawnEntity(void)
if (Chunk->GetWorld()->SpawnMobFinalize(Monster) != cEntity::INVALID_ID)
{
EntitiesSpawned = true;
- Chunk->BroadcastSoundParticleEffect(2004, (int)(PosX * 8.0), (int)(RelY * 8.0), (int)(PosZ * 8.0), 0);
+ Chunk->BroadcastSoundParticleEffect(
+ 2004,
+ static_cast<int>(PosX * 8.0),
+ static_cast<int>(RelY * 8.0),
+ static_cast<int>(PosZ * 8.0),
+ 0
+ );
m_NearbyEntitiesNum++;
}
}
@@ -246,9 +252,9 @@ int cMobSpawnerEntity::GetNearbyMonsterNum(eMonsterType a_EntityType)
class cCallback : public cChunkDataCallback
{
public:
- cCallback(Vector3d a_SpawnerPos, eMonsterType a_EntityType, int & a_NumEntities) :
+ cCallback(Vector3d a_SpawnerPos, eMonsterType a_CallbackEntityType, int & a_NumEntities) :
m_SpawnerPos(a_SpawnerPos),
- m_EntityType(a_EntityType),
+ m_EntityType(a_CallbackEntityType),
m_NumEntities(a_NumEntities)
{
}
@@ -260,7 +266,7 @@ int cMobSpawnerEntity::GetNearbyMonsterNum(eMonsterType a_EntityType)
return;
}
- cMonster * Mob = (cMonster *)a_Entity;
+ cMonster * Mob = static_cast<cMonster *>(a_Entity);
if (Mob->GetMobType() != m_EntityType)
{
return;
diff --git a/src/BlockEntities/NoteEntity.cpp b/src/BlockEntities/NoteEntity.cpp
index a9af13c55..29839bae1 100644
--- a/src/BlockEntities/NoteEntity.cpp
+++ b/src/BlockEntities/NoteEntity.cpp
@@ -90,8 +90,15 @@ void cNoteEntity::MakeSound(void)
m_World->BroadcastBlockAction(m_PosX, m_PosY, m_PosZ, instrument, m_Pitch, E_BLOCK_NOTE_BLOCK);
// TODO: instead of calculating the power function over and over, make a precalculated table - there's only 24 pitches after all
- float calcPitch = pow(2.0f, ((float)m_Pitch - 12.0f) / 12.0f);
- m_World->BroadcastSoundEffect(sampleName, (double)m_PosX, (double)m_PosY, (double)m_PosZ, 3.0f, calcPitch);
+ float calcPitch = pow(2.0f, static_cast<float>(m_Pitch - 12.0f) / 12.0f);
+ m_World->BroadcastSoundEffect(
+ sampleName,
+ static_cast<double>(m_PosX),
+ static_cast<double>(m_PosY),
+ static_cast<double>(m_PosZ),
+ 3.0f,
+ calcPitch
+ );
}
diff --git a/src/BlockEntities/NoteEntity.h b/src/BlockEntities/NoteEntity.h
index d3f85e9d2..f350ef4c4 100644
--- a/src/BlockEntities/NoteEntity.h
+++ b/src/BlockEntities/NoteEntity.h
@@ -52,7 +52,7 @@ public:
virtual void UsedBy(cPlayer * a_Player) override;
virtual void SendTo(cClientHandle &) override {}
- virtual void SetRedstonePower(bool a_Value)
+ virtual void SetRedstonePower(bool a_Value) override
{
if (a_Value)
{
diff --git a/src/BlockID.cpp b/src/BlockID.cpp
index 7f0db3cfc..c598df0aa 100644
--- a/src/BlockID.cpp
+++ b/src/BlockID.cpp
@@ -96,8 +96,7 @@ public:
else
{
// Not a resolvable string, try pure numbers: "45:6", "45^6" etc.
- a_Item.m_ItemType = (short)atoi(Split[0].c_str());
- if ((a_Item.m_ItemType == 0) && (Split[0] != "0"))
+ if (!StringToInteger(Split[0], a_Item.m_ItemType))
{
// Parsing the number failed
return false;
@@ -111,9 +110,8 @@ public:
a_Item.m_ItemCount = 1;
return true;
}
-
- a_Item.m_ItemDamage = (short)atoi(Split[1].c_str());
- if ((a_Item.m_ItemDamage == 0) && (Split[1] != "0"))
+
+ if (!StringToInteger(Split[1], a_Item.m_ItemDamage))
{
// Parsing the number failed
return false;
@@ -175,8 +173,16 @@ protected:
{
return;
}
- short ItemType = (short)atoi(Split[0].c_str());
- short ItemDamage = (Split.size() > 1) ? (short)atoi(Split[1].c_str()) : -1;
+ short ItemType;
+ if (!StringToInteger(Split[0], ItemType))
+ {
+ ASSERT(!"Invalid item type");
+ }
+ short ItemDamage = -1;
+ if (Split.size() > 1 && !StringToInteger(Split[1], ItemDamage))
+ {
+ ASSERT(!"Invalid item damage");
+ }
m_Map[a_Name] = std::make_pair(ItemType, ItemDamage);
}
} ;
@@ -288,11 +294,11 @@ AString ItemToFullString(const cItem & a_Item)
eDimension StringToDimension(const AString & a_DimensionString)
{
// First try decoding as a number
- int res = atoi(a_DimensionString.c_str());
- if ((res != 0) || (a_DimensionString == "0"))
+ int res;
+ if (StringToInteger(a_DimensionString, res))
{
// It was a valid number
- return (eDimension)res;
+ return static_cast<eDimension>(res);
}
// Decode using a built-in map:
@@ -350,7 +356,7 @@ AString DimensionToString(eDimension a_Dimension)
} // for i - DimensionMap[]
// Not found
- LOGWARNING("Unknown dimension: \"%i\". Setting to Overworld", (int)a_Dimension);
+ LOGWARNING("Unknown dimension: \"%i\". Setting to Overworld", static_cast<int>(a_Dimension));
return "Overworld";
}
@@ -386,7 +392,7 @@ AString DamageTypeToString(eDamageType a_DamageType)
// Unknown damage type:
ASSERT(!"Unknown DamageType");
- return Printf("dtUnknown_%d", (int)a_DamageType);
+ return Printf("dtUnknown_%d", static_cast<int>(a_DamageType));
}
@@ -397,11 +403,11 @@ AString DamageTypeToString(eDamageType a_DamageType)
eDamageType StringToDamageType(const AString & a_DamageTypeString)
{
// First try decoding as a number:
- int res = atoi(a_DamageTypeString.c_str());
- if ((res != 0) || (a_DamageTypeString == "0"))
+ int res;
+ if (!StringToInteger(a_DamageTypeString, res))
{
// It was a valid number
- return (eDamageType)res;
+ return static_cast<eDamageType>(res);
}
// Decode using a built-in map:
@@ -462,7 +468,7 @@ eDamageType StringToDamageType(const AString & a_DamageTypeString)
} // for i - DamageTypeMap[]
// Not found:
- return (eDamageType)-1;
+ return static_cast<eDamageType>(-1);
}
diff --git a/src/BlockInfo.cpp b/src/BlockInfo.cpp
index 3c5e8d7b7..c0ae5e945 100644
--- a/src/BlockInfo.cpp
+++ b/src/BlockInfo.cpp
@@ -19,7 +19,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info)
{
if (a_Info[i].m_Handler == nullptr)
{
- a_Info[i].m_Handler = cBlockHandler::CreateBlockHandler((BLOCKTYPE) i);
+ a_Info[i].m_Handler = cBlockHandler::CreateBlockHandler(static_cast<BLOCKTYPE>(i));
}
}
@@ -204,7 +204,6 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info)
a_Info[E_BLOCK_ENDER_CHEST ].m_Transparent = true;
a_Info[E_BLOCK_END_PORTAL ].m_Transparent = true;
a_Info[E_BLOCK_END_PORTAL_FRAME ].m_Transparent = true;
- a_Info[E_BLOCK_FARMLAND ].m_Transparent = true;
a_Info[E_BLOCK_FENCE ].m_Transparent = true;
a_Info[E_BLOCK_FENCE_GATE ].m_Transparent = true;
a_Info[E_BLOCK_FIRE ].m_Transparent = true;
diff --git a/src/Blocks/BlockAnvil.h b/src/Blocks/BlockAnvil.h
index abfa0f782..154394550 100644
--- a/src/Blocks/BlockAnvil.h
+++ b/src/Blocks/BlockAnvil.h
@@ -46,10 +46,10 @@ public:
switch (Direction)
{
- case 0: a_BlockMeta = 0x2 | Meta << 2; break;
- case 1: a_BlockMeta = 0x3 | Meta << 2; break;
- case 2: a_BlockMeta = 0x0 | Meta << 2; break;
- case 3: a_BlockMeta = 0x1 | Meta << 2; break;
+ case 0: a_BlockMeta = static_cast<NIBBLETYPE>(0x2 | Meta << 2); break;
+ case 1: a_BlockMeta = static_cast<NIBBLETYPE>(0x3 | Meta << 2); break;
+ case 2: a_BlockMeta = static_cast<NIBBLETYPE>(0x0 | Meta << 2); break;
+ case 3: a_BlockMeta = static_cast<NIBBLETYPE>(0x1 | Meta << 2); break;
default:
{
return false;
diff --git a/src/Blocks/BlockBed.h b/src/Blocks/BlockBed.h
index 46f361686..905c0ea76 100644
--- a/src/Blocks/BlockBed.h
+++ b/src/Blocks/BlockBed.h
@@ -36,11 +36,6 @@ public:
a_Pickups.push_back(cItem(E_ITEM_BED, 1, 0));
}
- virtual bool CanDirtGrowGrass(NIBBLETYPE a_Meta) override
- {
- return true;
- }
-
// Bed specific helper functions
static NIBBLETYPE RotationToMetaData(double a_Rotation)
@@ -53,7 +48,7 @@ public:
a_Rotation = (a_Rotation / 360) * 4;
- return ((char)a_Rotation + 2) % 4;
+ return (static_cast<NIBBLETYPE>(a_Rotation + 2)) % 4;
}
static Vector3i MetaDataToDirection(NIBBLETYPE a_MetaData)
diff --git a/src/Blocks/BlockButton.h b/src/Blocks/BlockButton.h
index d24c7d952..3558729bb 100644
--- a/src/Blocks/BlockButton.h
+++ b/src/Blocks/BlockButton.h
@@ -19,15 +19,35 @@ public:
virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override
{
+ NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
+
+ double x(a_BlockX);
+ double y(a_BlockY);
+ double z(a_BlockZ);
+
+ // If button is already on do nothing
+ if (Meta & 0x08)
+ {
+ return;
+ }
+
// Set p the ON bit to on
- NIBBLETYPE Meta = (a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ) | 0x08);
+ Meta |= 0x08;
a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta);
a_WorldInterface.WakeUpSimulators(a_BlockX, a_BlockY, a_BlockZ);
- a_WorldInterface.GetBroadcastManager().BroadcastSoundEffect("random.click", (double)a_BlockX, (double)a_BlockY, (double)a_BlockZ, 0.5f, (Meta & 0x08) ? 0.6f : 0.5f);
+ a_WorldInterface.GetBroadcastManager().BroadcastSoundEffect("random.click", x, y, z, 0.5f, 0.6f);
// Queue a button reset (unpress)
- a_ChunkInterface.QueueSetBlock(a_BlockX, a_BlockY, a_BlockZ, m_BlockType, (a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ) & 0x07), m_BlockType == E_BLOCK_STONE_BUTTON ? 20 : 30, m_BlockType, a_WorldInterface);
+ int delay = (m_BlockType == E_BLOCK_STONE_BUTTON) ? 20 : 30;
+
+ a_ChunkInterface.QueueSetBlock(a_BlockX, a_BlockY, a_BlockZ, m_BlockType, (a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ) & 0x07), delay, m_BlockType, a_WorldInterface);
+
+ a_Player->GetWorld()->ScheduleTask(delay, [x, y, z](cWorld & a_World)
+ {
+ a_World.BroadcastSoundEffect("random.click", x, y, z, 0.5f, 0.5f);
+ });
+
}
@@ -67,14 +87,19 @@ public:
case BLOCK_FACE_XM: return 0x2;
case BLOCK_FACE_XP: return 0x1;
case BLOCK_FACE_YM: return 0x0;
- default:
+ case BLOCK_FACE_NONE:
{
ASSERT(!"Unhandled block face!");
return 0x0;
}
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return 0;
+ #endif
}
+
inline static eBlockFace BlockMetaDataToBlockFace(NIBBLETYPE a_Meta)
{
switch (a_Meta & 0x7)
@@ -93,6 +118,7 @@ public:
}
}
+
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
NIBBLETYPE Meta;
diff --git a/src/Blocks/BlockCocoaPod.h b/src/Blocks/BlockCocoaPod.h
index 1b659d48f..4d16d2552 100644
--- a/src/Blocks/BlockCocoaPod.h
+++ b/src/Blocks/BlockCocoaPod.h
@@ -81,12 +81,18 @@ public:
case BLOCK_FACE_XM: return 3;
case BLOCK_FACE_XP: return 1;
case BLOCK_FACE_ZP: return 2;
- default:
+ case BLOCK_FACE_NONE:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_YP:
{
ASSERT(!"Unknown face");
return 0;
}
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return 0;
+ #endif
}
} ;
diff --git a/src/Blocks/BlockComparator.h b/src/Blocks/BlockComparator.h
index ed73a162e..3babeddad 100644
--- a/src/Blocks/BlockComparator.h
+++ b/src/Blocks/BlockComparator.h
@@ -64,6 +64,85 @@ public:
a_BlockMeta = cBlockRedstoneRepeaterHandler::RepeaterRotationToMetaData(a_Player->GetYaw());
return true;
}
+
+
+ inline static Vector3i GetSideCoordinate(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_Meta, bool a_bInverse)
+ {
+ if (!a_bInverse)
+ {
+ switch (a_Meta)
+ {
+ case 0x0: a_BlockX++; break;
+ case 0x1: a_BlockZ--; break;
+ case 0x2: a_BlockX--; break;
+ case 0x3: a_BlockZ++; break;
+ default:
+ {
+ LOGWARNING("%s: Unknown metadata: %d", __FUNCTION__, a_Meta);
+ ASSERT(!"Unknown metadata while determining orientation of comparator!");
+ break;
+ }
+ }
+ }
+ else
+ {
+ switch (a_Meta)
+ {
+ case 0x0: a_BlockX--; break;
+ case 0x1: a_BlockZ++; break;
+ case 0x2: a_BlockX++; break;
+ case 0x3: a_BlockZ--; break;
+ default:
+ {
+ LOGWARNING("%s: Unknown metadata: %d", __FUNCTION__, a_Meta);
+ ASSERT(!"Unknown metadata while determining orientation of comparator!");
+ break;
+ }
+ }
+ }
+
+ return Vector3i(a_BlockX, a_BlockY, a_BlockZ);
+ }
+
+
+ inline static Vector3i GetRearCoordinate(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_Meta)
+ {
+ switch (a_Meta)
+ {
+ case 0x0: a_BlockZ++; break;
+ case 0x1: a_BlockX--; break;
+ case 0x2: a_BlockZ--; break;
+ case 0x3: a_BlockX++; break;
+ default:
+ {
+ LOGWARNING("%s: Unknown metadata: %d", __FUNCTION__, a_Meta);
+ ASSERT(!"Unknown metadata while determining orientation of comparator!");
+ break;
+ }
+ }
+
+ return Vector3i(a_BlockX, a_BlockY, a_BlockZ);
+ }
+
+
+ inline static Vector3i GetFrontCoordinate(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_Meta)
+ {
+ switch (a_Meta)
+ {
+ case 0x0: a_BlockZ--; break;
+ case 0x1: a_BlockX++; break;
+ case 0x2: a_BlockZ++; break;
+ case 0x3: a_BlockX--; break;
+ default:
+ {
+ LOGWARNING("%s: Unknown metadata: %d", __FUNCTION__, a_Meta);
+ ASSERT(!"Unknown metadata while determining orientation of comparator!");
+ break;
+ }
+ }
+
+ return Vector3i(a_BlockX, a_BlockY, a_BlockZ);
+ }
} ;
diff --git a/src/Blocks/BlockDirt.h b/src/Blocks/BlockDirt.h
index 32512a2ef..3d671d218 100644
--- a/src/Blocks/BlockDirt.h
+++ b/src/Blocks/BlockDirt.h
@@ -3,6 +3,7 @@
#include "BlockHandler.h"
#include "../FastRandom.h"
+#include "../BlockInfo.h"
#include "Root.h"
#include "Bindings/PluginManager.h"
@@ -39,19 +40,6 @@ public:
{
return;
}
-
- // Grass becomes dirt if there is something on top of it:
- if (a_RelY < cChunkDef::Height - 1)
- {
- BLOCKTYPE Above;
- NIBBLETYPE AboveMeta;
- a_Chunk.GetBlockTypeMeta(a_RelX, a_RelY + 1, a_RelZ, Above, AboveMeta);
- if (!cBlockInfo::GetHandler(Above)->CanDirtGrowGrass(AboveMeta))
- {
- a_Chunk.FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL);
- return;
- }
- }
// Make sure that there is enough light at the source block to spread
if (!a_Chunk.GetWorld()->IsChunkLighted(a_Chunk.GetPosX(), a_Chunk.GetPosZ()))
@@ -59,10 +47,24 @@ public:
a_Chunk.GetWorld()->QueueLightChunk(a_Chunk.GetPosX(), a_Chunk.GetPosZ());
return;
}
- else if ((a_RelY < cChunkDef::Height - 1) && std::max(a_Chunk.GetBlockLight(a_RelX, a_RelY + 1, a_RelZ), a_Chunk.GetTimeAlteredLight(a_Chunk.GetSkyLight(a_RelX, a_RelY + 1, a_RelZ))) < 9)
+ else if ((a_RelY < cChunkDef::Height - 1))
{
+ BLOCKTYPE above = a_Chunk.GetBlock(a_RelX, a_RelY + 1, a_RelZ);
+
+ // Grass turns back to dirt when the block above is not transparent
+ if (!cBlockInfo::IsTransparent(above))
+ {
+ a_Chunk.FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL);
+ return;
+ }
+
+ NIBBLETYPE light = std::max(a_Chunk.GetBlockLight(a_RelX, a_RelY + 1, a_RelZ), a_Chunk.GetTimeAlteredLight(a_Chunk.GetSkyLight(a_RelX, a_RelY + 1, a_RelZ)));
// Source block is not bright enough to spread
- return;
+ if (light < 9)
+ {
+ return;
+ }
+
}
// Grass spreads to adjacent dirt blocks:
@@ -95,11 +97,10 @@ public:
// Not a regular dirt block
continue;
}
-
- BLOCKTYPE AboveDest;
- NIBBLETYPE AboveMeta;
- Chunk->GetBlockTypeMeta(BlockX, BlockY + 1, BlockZ, AboveDest, AboveMeta);
- if (cBlockInfo::GetHandler(AboveDest)->CanDirtGrowGrass(AboveMeta))
+ BLOCKTYPE above = a_Chunk.GetBlock(BlockX, BlockY + 1, BlockZ);
+ NIBBLETYPE light = std::max(a_Chunk.GetBlockLight(BlockX, BlockY + 1, BlockZ), a_Chunk.GetTimeAlteredLight(a_Chunk.GetSkyLight(BlockX, BlockY + 1, BlockZ)));
+ // Grass does not spread to blocks with a light level less than 5
+ if ((light > 4) && cBlockInfo::IsTransparent(above))
{
if (!cRoot::Get()->GetPluginManager()->CallHookBlockSpread(*Chunk->GetWorld(), Chunk->GetPosX() * cChunkDef::Width + BlockX, BlockY, Chunk->GetPosZ() * cChunkDef::Width + BlockZ, ssGrassSpread))
{
diff --git a/src/Blocks/BlockDoor.cpp b/src/Blocks/BlockDoor.cpp
index d13c8d657..a4e375cf0 100644
--- a/src/Blocks/BlockDoor.cpp
+++ b/src/Blocks/BlockDoor.cpp
@@ -50,10 +50,24 @@ void cBlockDoorHandler::OnUse(cChunkInterface & a_ChunkInterface, cWorldInterfac
UNUSED(a_CursorY);
UNUSED(a_CursorZ);
- if (a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ) == E_BLOCK_WOODEN_DOOR)
+ switch (a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ))
{
- ChangeDoor(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ);
- a_Player->GetWorld()->BroadcastSoundParticleEffect(1003, a_BlockX, a_BlockY, a_BlockZ, 0, a_Player->GetClientHandle());
+ default:
+ {
+ ASSERT(!"Unhandled door block type");
+ }
+ case E_BLOCK_ACACIA_DOOR:
+ case E_BLOCK_BIRCH_DOOR:
+ case E_BLOCK_DARK_OAK_DOOR:
+ case E_BLOCK_JUNGLE_DOOR:
+ case E_BLOCK_SPRUCE_DOOR:
+ case E_BLOCK_IRON_DOOR:
+ case E_BLOCK_WOODEN_DOOR:
+ {
+ ChangeDoor(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ);
+ a_Player->GetWorld()->BroadcastSoundParticleEffect(1003, a_BlockX, a_BlockY, a_BlockZ, 0, a_Player->GetClientHandle());
+ break;
+ }
}
}
diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h
index 445383e7c..79ed4f723 100644
--- a/src/Blocks/BlockDoor.h
+++ b/src/Blocks/BlockDoor.h
@@ -55,6 +55,10 @@ public:
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
+ if ((a_BlockMeta & 0x08) != 0) // is top part of door
+ {
+ return;
+ }
switch (m_BlockType)
{
case E_BLOCK_WOODEN_DOOR:
@@ -242,13 +246,13 @@ public:
if ((Meta & 0x08) != 0)
{
// The coords are pointing at the top part of the door
- if (a_BlockX > 0)
+ if (a_BlockY > 0)
{
NIBBLETYPE DownMeta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY - 1, a_BlockZ);
- return (NIBBLETYPE) ((DownMeta & 0x07) | 0x08 | (Meta << 4));
+ return static_cast<NIBBLETYPE>((DownMeta & 0x07) | 0x08 | (Meta << 4));
}
// This is the top part of the door at the bottommost layer of the world, there's no bottom:
- return (NIBBLETYPE) (0x08 | (Meta << 4));
+ return static_cast<NIBBLETYPE>(0x08 | (Meta << 4));
}
else
{
@@ -256,7 +260,7 @@ public:
if (a_BlockY < cChunkDef::Height - 1)
{
NIBBLETYPE UpMeta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY + 1, a_BlockZ);
- return (NIBBLETYPE) (Meta | (UpMeta << 4));
+ return static_cast<NIBBLETYPE>(Meta | (UpMeta << 4));
}
// This is the bottom part of the door at the topmost layer of the world, there's no top:
return Meta;
diff --git a/src/Blocks/BlockFarmland.h b/src/Blocks/BlockFarmland.h
index 23a7392da..8d43632ff 100644
--- a/src/Blocks/BlockFarmland.h
+++ b/src/Blocks/BlockFarmland.h
@@ -65,13 +65,22 @@ public:
}
}
- virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override
+
+ virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_WhichNeighbor) override
{
+ // Don't care about any neighbor but the one above us (fix recursion loop in #2213):
+ if (a_WhichNeighbor != BLOCK_FACE_YP)
+ {
+ return;
+ }
+
+ // Don't care about anything if we're at the top of the world:
if (a_BlockY >= cChunkDef::Height)
{
return;
}
+ // Check whether we should revert to dirt:
BLOCKTYPE UpperBlock = a_ChunkInterface.GetBlock(a_BlockX, a_BlockY + 1, a_BlockZ);
if (cBlockInfo::FullyOccupiesVoxel(UpperBlock))
{
@@ -79,11 +88,13 @@ public:
}
}
+
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
a_Pickups.Add(E_BLOCK_DIRT, 1, 0); // Reset meta
}
+
bool IsWaterInNear(cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ)
{
if (a_Chunk.GetWorld()->IsWeatherWetAt(a_RelX, a_RelZ))
diff --git a/src/Blocks/BlockFire.h b/src/Blocks/BlockFire.h
index 2038df94b..3f75455da 100644
--- a/src/Blocks/BlockFire.h
+++ b/src/Blocks/BlockFire.h
@@ -121,6 +121,20 @@ public:
}
}
+ int PortalHeight = MaxY - Y - 1;
+ int PortalWidth = XZP - XZM + 1;
+ if ((PortalHeight < a_WorldInterface.GetMinNetherPortalHeight()) || (PortalHeight > a_WorldInterface.GetMaxNetherPortalHeight()))
+ {
+ // The portal isn't high enough, or is too high
+ return;
+ }
+
+ if ((PortalWidth < a_WorldInterface.GetMinNetherPortalWidth()) || (PortalWidth > a_WorldInterface.GetMaxNetherPortalWidth()))
+ {
+ // The portal isn't wide enough, or is too wide
+ return;
+ }
+
for (int Height = Y + 1; Height <= MaxY - 1; Height++) // Loop through boundary to set portal blocks
{
for (int Width = XZM; Width <= XZP; Width++)
@@ -217,6 +231,11 @@ public:
return (FoundFrameZP && FoundFrameZM);
}
+
+ virtual bool DoesIgnoreBuildCollision(cPlayer * a_Player, NIBBLETYPE a_Meta) override
+ {
+ return true;
+ }
};
diff --git a/src/Blocks/BlockFluid.h b/src/Blocks/BlockFluid.h
index 2823baedc..58b3ce042 100644
--- a/src/Blocks/BlockFluid.h
+++ b/src/Blocks/BlockFluid.h
@@ -49,12 +49,6 @@ public:
}
super::Check(a_ChunkInterface, a_PluginInterface, a_RelX, a_RelY, a_RelZ, a_Chunk);
}
-
-
- virtual bool CanDirtGrowGrass(NIBBLETYPE a_Meta) override
- {
- return false;
- }
} ;
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp
index 452cc94a5..412fc3aeb 100644
--- a/src/Blocks/BlockHandler.cpp
+++ b/src/Blocks/BlockHandler.cpp
@@ -389,12 +389,12 @@ void cBlockHandler::OnDestroyedByPlayer(cChunkInterface & a_ChunkInterface, cWor
void cBlockHandler::OnPlaced(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
// Notify the neighbors
- NeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ - 1);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ + 1);
+ NeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY, a_BlockZ, BLOCK_FACE_XP);
+ NeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY, a_BlockZ, BLOCK_FACE_XM);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ, BLOCK_FACE_YP);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ, BLOCK_FACE_YM);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ - 1, BLOCK_FACE_ZP);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ + 1, BLOCK_FACE_ZM);
}
@@ -404,29 +404,30 @@ void cBlockHandler::OnPlaced(cChunkInterface & a_ChunkInterface, cWorldInterface
void cBlockHandler::OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ)
{
// Notify the neighbors
- NeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ - 1);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ + 1);
+ NeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY, a_BlockZ, BLOCK_FACE_XP);
+ NeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY, a_BlockZ, BLOCK_FACE_XM);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ, BLOCK_FACE_YP);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ, BLOCK_FACE_YM);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ - 1, BLOCK_FACE_ZP);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ + 1, BLOCK_FACE_ZM);
}
-void cBlockHandler::NeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ)
+void cBlockHandler::NeighborChanged(cChunkInterface & a_ChunkInterface, int a_NeighborX, int a_NeighborY, int a_NeighborZ, eBlockFace a_WhichNeighbor)
{
- if ((a_BlockY >= 0) && (a_BlockY < cChunkDef::Height))
+ if ((a_NeighborY >= 0) && (a_NeighborY < cChunkDef::Height))
{
- cBlockInfo::GetHandler(a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ))->OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ);
+ cBlockInfo::GetHandler(a_ChunkInterface.GetBlock(a_NeighborX, a_NeighborY, a_NeighborZ))->OnNeighborChanged(a_ChunkInterface, a_NeighborX, a_NeighborY, a_NeighborZ, a_WhichNeighbor);
}
}
+
void cBlockHandler::ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta)
{
// Setting the meta to a_BlockMeta keeps most textures. The few other blocks have to override this.
@@ -512,15 +513,6 @@ bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, int a_BlockX, in
-bool cBlockHandler::CanDirtGrowGrass(NIBBLETYPE a_Meta)
-{
- return ((cBlockInfo::IsTransparent(m_BlockType)) || (cBlockInfo::IsOneHitDig(m_BlockType)));
-}
-
-
-
-
-
bool cBlockHandler::IsUseable()
{
return false;
diff --git a/src/Blocks/BlockHandler.h b/src/Blocks/BlockHandler.h
index 4dec0dc95..1b357c3f1 100644
--- a/src/Blocks/BlockHandler.h
+++ b/src/Blocks/BlockHandler.h
@@ -56,13 +56,19 @@ public:
/// Called before a block gets destroyed / replaced with air
virtual void OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ);
- /// Called when a direct neighbor of this block has been changed (The position is the own position, not the neighbor position)
- virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) {}
-
- /// Notifies all neighbors of the given block about a change
- static void NeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ);
-
- /// Called while the player diggs the block.
+ /** Called when a direct neighbor of this block has been changed (The position is the block's own position, not the changing neighbor's position)
+ a_WhichNeighbor indicates which neighbor has changed. For example, BLOCK_FACE_YP meant the neighbor above has changed.
+ BLOCK_FACE_NONE means that it is a neighbor not directly adjacent (diagonal, etc.) */
+ virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_WhichNeighbor) {}
+
+ /** Notifies the specified neighbor that the current block has changed.
+ a_NeighborXYZ coords are the coords of the neighbor
+ a_WhichNeighbor specifies which neighbor (relative to a_NeighborXYZ) has changed.
+ For example BLOCK_FACE_YP means that the block at {a_NeighborX, a_NeighborY + 1, a_NeighborZ} has changed.
+ BLOCK_FACE_NONE means that it is a neighbor not directly adjacent (diagonal, etc.) */
+ static void NeighborChanged(cChunkInterface & a_ChunkInterface, int a_NeighborX, int a_NeighborY, int a_NeighborZ, eBlockFace a_WhichNeighbor);
+
+ /** Called when the player starts digging the block. */
virtual void OnDigging(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) {}
/// Called if the user right clicks the block and the block is useable
@@ -83,9 +89,6 @@ public:
/// Checks if the block can stay at the specified relative coords in the chunk
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk);
-
- /** Can the dirt under this block grow to grass? */
- virtual bool CanDirtGrowGrass(NIBBLETYPE a_Meta);
/** Checks if the block can be placed at this point.
Default: CanBeAt(...)
diff --git a/src/Blocks/BlockHopper.h b/src/Blocks/BlockHopper.h
index 4a5d32dd5..06e2b0e9f 100644
--- a/src/Blocks/BlockHopper.h
+++ b/src/Blocks/BlockHopper.h
@@ -35,7 +35,7 @@ public:
case BLOCK_FACE_NORTH: a_BlockMeta = E_META_HOPPER_FACING_ZP; break;
case BLOCK_FACE_SOUTH: a_BlockMeta = E_META_HOPPER_FACING_ZM; break;
case BLOCK_FACE_WEST: a_BlockMeta = E_META_HOPPER_FACING_XP; break;
- default: a_BlockMeta = E_META_HOPPER_UNATTACHED; break;
+ case BLOCK_FACE_NONE: a_BlockMeta = E_META_HOPPER_UNATTACHED; break;
}
return true;
}
diff --git a/src/Blocks/BlockLadder.h b/src/Blocks/BlockLadder.h
index ab3f55439..d727f8f8e 100644
--- a/src/Blocks/BlockLadder.h
+++ b/src/Blocks/BlockLadder.h
@@ -57,8 +57,17 @@ public:
case BLOCK_FACE_ZP: return 0x3;
case BLOCK_FACE_XM: return 0x4;
case BLOCK_FACE_XP: return 0x5;
- default: return 0x2;
+ case BLOCK_FACE_NONE:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_YP:
+ {
+ return 0x2;
+ }
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return 0;
+ #endif
}
diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h
index bd9a7414e..2368eab7b 100644
--- a/src/Blocks/BlockLeaves.h
+++ b/src/Blocks/BlockLeaves.h
@@ -40,33 +40,49 @@ public:
{
cFastRandom rand;
- // Old leaves - 3 bits contain display; new leaves - 1st bit, shifted left two for saplings to understand
- if (rand.NextInt(6) == 0)
+ // There is a chance to drop a sapling that varies depending on the type of leaf broken.
+ // TODO: Take into account fortune for sapling drops.
+ int chance;
+ if ((m_BlockType == E_BLOCK_LEAVES) && ((a_BlockMeta & 0x03) == E_META_LEAVES_JUNGLE))
+ {
+ // Jungle leaves have a 2.5% chance of dropping a sapling.
+ chance = rand.NextInt(40);
+ }
+ else
+ {
+ // Other leaves have a 5% chance of dropping a sapling.
+ chance = rand.NextInt(20);
+ }
+ if (chance == 0)
{
a_Pickups.push_back(
cItem(
E_BLOCK_SAPLING,
1,
- (m_BlockType == E_BLOCK_LEAVES) ? (a_BlockMeta & 0x03) : (2 << (a_BlockMeta & 0x01))
+ (m_BlockType == E_BLOCK_LEAVES) ? (a_BlockMeta & 0x03) : static_cast<short>(4 + (a_BlockMeta & 0x01))
)
);
}
-
- // 1 % chance of dropping an apple, if the leaves' type is Apple Leaves
+
+ // 0.5 % chance of dropping an apple, if the leaves' type is Apple Leaves
if ((m_BlockType == E_BLOCK_LEAVES) && ((a_BlockMeta & 0x03) == E_META_LEAVES_APPLE))
{
- if (rand.NextInt(101) == 0)
+ if (rand.NextInt(200) == 0)
{
a_Pickups.push_back(cItem(E_ITEM_RED_APPLE, 1, 0));
}
}
}
-
-
- virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override
+
+
+ virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_WhichNeighbor) override
{
+ // Unset 0x8 bit so this block gets checked for decay:
NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
- a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta & 0x7); // Unset 0x8 bit so it gets checked for decay
+ if ((Meta & 0x08) != 0)
+ {
+ a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta & 0x7);
+ }
}
diff --git a/src/Blocks/BlockLever.h b/src/Blocks/BlockLever.h
index 2da138e5f..8d676b56f 100644
--- a/src/Blocks/BlockLever.h
+++ b/src/Blocks/BlockLever.h
@@ -59,14 +59,18 @@ public:
// Determine lever direction:
switch (a_Dir)
{
- case BLOCK_FACE_YP: return 0x6;
- case BLOCK_FACE_XP: return 0x1;
- case BLOCK_FACE_XM: return 0x2;
- case BLOCK_FACE_ZP: return 0x3;
- case BLOCK_FACE_ZM: return 0x4;
- case BLOCK_FACE_YM: return 0x0;
- default: return 0x6;
+ case BLOCK_FACE_YP: return 0x6;
+ case BLOCK_FACE_XP: return 0x1;
+ case BLOCK_FACE_XM: return 0x2;
+ case BLOCK_FACE_ZP: return 0x3;
+ case BLOCK_FACE_ZM: return 0x4;
+ case BLOCK_FACE_YM: return 0x0;
+ case BLOCK_FACE_NONE: return 0x6;
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return 0;
+ #endif
}
diff --git a/src/Blocks/BlockPiston.cpp b/src/Blocks/BlockPiston.cpp
index d9f4913d8..75f8621a7 100644
--- a/src/Blocks/BlockPiston.cpp
+++ b/src/Blocks/BlockPiston.cpp
@@ -179,7 +179,7 @@ void cBlockPistonHandler::ExtendPiston(int a_BlockX, int a_BlockY, int a_BlockZ,
a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, pistonBlock, pistonMeta | 0x8);
a_World->SetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, pistonMeta | (IsSticky(pistonBlock) ? 8 : 0), false);
- a_World->ScheduleTask(PISTON_TICK_DELAY, std::make_shared<cWorld::cTaskSendBlockToAllPlayers>(ScheduledBlocks));
+ a_World->ScheduleTask(PISTON_TICK_DELAY, static_cast<cWorld::cTaskPtr>(std::make_shared<cWorld::cTaskSendBlockToAllPlayers>(ScheduledBlocks)));
}
@@ -229,7 +229,7 @@ void cBlockPistonHandler::RetractPiston(int a_BlockX, int a_BlockY, int a_BlockZ
std::vector<Vector3i> ScheduledBlocks;
ScheduledBlocks.push_back(Vector3i(a_BlockX, a_BlockY, a_BlockZ));
ScheduledBlocks.push_back(Vector3i(tempx, tempy, tempz));
- a_World->ScheduleTask(PISTON_TICK_DELAY + 1, std::make_shared<cWorld::cTaskSendBlockToAllPlayers>(ScheduledBlocks));
+ a_World->ScheduleTask(PISTON_TICK_DELAY + 1, static_cast<cWorld::cTaskPtr>(std::make_shared<cWorld::cTaskSendBlockToAllPlayers>(ScheduledBlocks)));
return;
}
}
@@ -239,7 +239,7 @@ void cBlockPistonHandler::RetractPiston(int a_BlockX, int a_BlockY, int a_BlockZ
std::vector<Vector3i> ScheduledBlocks;
ScheduledBlocks.push_back(Vector3i(a_BlockX, a_BlockY, a_BlockZ));
- a_World->ScheduleTask(PISTON_TICK_DELAY + 1, std::make_shared<cWorld::cTaskSendBlockToAllPlayers>(ScheduledBlocks));
+ a_World->ScheduleTask(PISTON_TICK_DELAY + 1, static_cast<cWorld::cTaskPtr>(std::make_shared<cWorld::cTaskSendBlockToAllPlayers>(ScheduledBlocks)));
}
diff --git a/src/Blocks/BlockQuartz.h b/src/Blocks/BlockQuartz.h
index edc4fb9c5..b936a7e4a 100644
--- a/src/Blocks/BlockQuartz.h
+++ b/src/Blocks/BlockQuartz.h
@@ -36,6 +36,7 @@ public:
return true;
}
+
inline static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace, NIBBLETYPE a_QuartzMeta)
{
switch (a_BlockFace)
@@ -58,11 +59,15 @@ public:
return 0x3; // East or west
}
- default:
+ case BLOCK_FACE_NONE:
{
ASSERT(!"Unhandled block face!");
return a_QuartzMeta; // No idea, give a special meta (all sides the same)
}
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return 0;
+ #endif
}
} ;
diff --git a/src/Blocks/BlockRail.h b/src/Blocks/BlockRail.h
index a2e27a351..7fb910e8c 100644
--- a/src/Blocks/BlockRail.h
+++ b/src/Blocks/BlockRail.h
@@ -47,15 +47,14 @@ public:
super::OnPlaced(a_ChunkInterface, a_WorldInterface, a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta);
// Alert diagonal rails
- OnNeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY + 1, a_BlockZ);
- OnNeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY + 1, a_BlockZ);
- OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ + 1);
- OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ - 1);
-
- OnNeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY - 1, a_BlockZ);
- OnNeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY - 1, a_BlockZ);
- OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ + 1);
- OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ - 1);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY + 1, a_BlockZ, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY + 1, a_BlockZ, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ + 1, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ - 1, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY - 1, a_BlockZ, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY - 1, a_BlockZ, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ + 1, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ - 1, BLOCK_FACE_NONE);
}
@@ -64,19 +63,18 @@ public:
super::OnDestroyed(a_ChunkInterface, a_WorldInterface, a_BlockX, a_BlockY, a_BlockZ);
// Alert diagonal rails
- OnNeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY + 1, a_BlockZ);
- OnNeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY + 1, a_BlockZ);
- OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ + 1);
- OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ - 1);
-
- OnNeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY - 1, a_BlockZ);
- OnNeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY - 1, a_BlockZ);
- OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ + 1);
- OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ - 1);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY + 1, a_BlockZ, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY + 1, a_BlockZ, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ + 1, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ - 1, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY - 1, a_BlockZ, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY - 1, a_BlockZ, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ + 1, BLOCK_FACE_NONE);
+ OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ - 1, BLOCK_FACE_NONE);
}
- virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override
+ virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_WhichNeighbor) override
{
NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
if (IsUnstable(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ) && (Meta != FindMeta(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ)))
@@ -487,7 +485,12 @@ public:
}
break;
}
- default: break;
+ case BLOCK_FACE_NONE:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_YP:
+ {
+ break;
+ }
}
return true;
}
diff --git a/src/Blocks/BlockSapling.h b/src/Blocks/BlockSapling.h
index bec79c6f3..c15e0a195 100644
--- a/src/Blocks/BlockSapling.h
+++ b/src/Blocks/BlockSapling.h
@@ -3,6 +3,7 @@
#include "BlockHandler.h"
#include "../World.h"
+#include "../FastRandom.h"
@@ -34,17 +35,144 @@ public:
virtual void OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
{
NIBBLETYPE Meta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ);
-
- if ((Meta & 0x08) != 0)
+ NIBBLETYPE Light = std::max(a_Chunk.GetBlockLight(a_RelX, a_RelY, a_RelZ), a_Chunk.GetTimeAlteredLight(a_Chunk.GetSkyLight(a_RelX, a_RelY, a_RelZ)));
+
+ // Only grow if we have the right amount of light
+ if (Light > 8)
+ {
+ cFastRandom random;
+ // Only grow if we are in the right growth stage and have the right amount of space around them.
+ if (((Meta & 0x08) != 0) && (random.NextInt(99) < 45) && CanGrowAt(a_Chunk, a_RelX, a_RelY, a_RelZ, Meta))
+ {
+ int BlockX = a_RelX + a_Chunk.GetPosX() * cChunkDef::Width;
+ int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width;
+ a_Chunk.GetWorld()->GrowTree(BlockX, a_RelY, BlockZ);
+ }
+ // Only move to the next growth stage if we haven't gone there yet
+ else if (((Meta & 0x08) == 0) && (random.NextInt(99) < 45))
+ {
+ a_Chunk.SetMeta(a_RelX, a_RelY, a_RelZ, Meta | 0x08);
+ }
+ }
+ }
+
+ bool CanGrowAt(cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta)
+ {
+ a_Meta = a_Meta & 0x07;
+ int CheckHeight = 0;
+ bool LargeTree = false;
+
+ // Get the height to check against
+ switch (a_Meta)
{
- int BlockX = a_RelX + a_Chunk.GetPosX() * cChunkDef::Width;
- int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width;
- a_Chunk.GetWorld()->GrowTree(BlockX, a_RelY, BlockZ);
+ case E_META_SAPLING_APPLE:
+ {
+ CheckHeight = 5;
+ break;
+ }
+ case E_META_SAPLING_CONIFER:
+ {
+ CheckHeight = 7;
+ if (IsLargeTree(a_Chunk, a_RelX, a_RelY, a_RelZ, a_Meta))
+ {
+ CheckHeight = 16;
+ LargeTree = true;
+ }
+ break;
+ }
+ case E_META_SAPLING_BIRCH:
+ {
+ CheckHeight = 6;
+ break;
+ }
+ case E_META_SAPLING_JUNGLE:
+ {
+ CheckHeight = 7;
+ if (IsLargeTree(a_Chunk, a_RelX, a_RelY, a_RelZ, a_Meta))
+ {
+ CheckHeight = 13;
+ LargeTree = true;
+ }
+ break;
+ }
+ // Dark Oaks only grow in a 2x2 area
+ case E_META_SAPLING_DARK_OAK:
+ {
+ if (!IsLargeTree(a_Chunk, a_RelX, a_RelY, a_RelZ, a_Meta))
+ {
+ return false;
+ }
+ CheckHeight = 7;
+ LargeTree = true;
+ break;
+ }
}
- else
+ // We should always get a valid CheckHeight
+ ASSERT(CheckHeight != 0);
+
+ // Don't grow a tree if we don't have enough space left above it in the chunk
+ if ((a_RelY + CheckHeight) > cChunkDef::Height)
+ {
+ return false;
+ }
+ bool CanGrow = true;
+
+ // Validate the neighbor blocks. They cannot be solid.
+ BLOCKTYPE check = E_BLOCK_AIR;
+ a_Chunk.UnboundedRelGetBlockType(a_RelX - 1, a_RelY, a_RelZ, check);
+ CanGrow = CanGrow && cBlockInfo::IsTransparent(check);
+
+ a_Chunk.UnboundedRelGetBlockType(a_RelX + 1, a_RelY, a_RelZ, check);
+ CanGrow = CanGrow && cBlockInfo::IsTransparent(check);
+
+ a_Chunk.UnboundedRelGetBlockType(a_RelX, a_RelY, a_RelZ - 1, check);
+ CanGrow = CanGrow && cBlockInfo::IsTransparent(check);
+
+ a_Chunk.UnboundedRelGetBlockType(a_RelX, a_RelY, a_RelZ + 1, check);
+ CanGrow = CanGrow && cBlockInfo::IsTransparent(check);
+
+
+
+ while (CheckHeight && CanGrow)
{
- a_Chunk.SetMeta(a_RelX, a_RelY, a_RelZ, Meta | 0x08);
+ check = a_Chunk.GetBlock(a_RelX, a_RelY + CheckHeight, a_RelZ);
+ CanGrow = CanGrow && ((check == E_BLOCK_AIR) || (check == E_BLOCK_LEAVES));
+
+ // We have to check above the neighboring saplings as well
+ if (LargeTree)
+ {
+ a_Chunk.UnboundedRelGetBlockType(a_RelX + 1, a_RelY + CheckHeight, a_RelZ, check);
+ CanGrow = CanGrow && ((check == E_BLOCK_AIR) || (check == E_BLOCK_LEAVES));
+
+ a_Chunk.UnboundedRelGetBlockType(a_RelX, a_RelY + CheckHeight, a_RelZ + 1, check);
+ CanGrow = CanGrow && ((check == E_BLOCK_AIR) || (check == E_BLOCK_LEAVES));
+
+ a_Chunk.UnboundedRelGetBlockType(a_RelX + 1, a_RelY + CheckHeight, a_RelZ + 1, check);
+ CanGrow = CanGrow && ((check == E_BLOCK_AIR) || (check == E_BLOCK_LEAVES));
+ }
+
+ --CheckHeight;
}
+
+ return CanGrow;
+ }
+
+private:
+ bool IsLargeTree(cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta)
+ {
+ BLOCKTYPE type;
+ NIBBLETYPE meta;
+ bool LargeTree = true;
+ a_Chunk.UnboundedRelGetBlock(a_RelX + 1, a_RelY, a_RelZ, type, meta);
+ LargeTree = LargeTree && (type == E_BLOCK_SAPLING) && ((a_Meta & meta) == a_Meta);
+
+ a_Chunk.UnboundedRelGetBlock(a_RelX + 1, a_RelY, a_RelZ + 1, type, meta);
+ LargeTree = LargeTree && (type == E_BLOCK_SAPLING) && ((a_Meta & meta) == a_Meta);
+
+ a_Chunk.UnboundedRelGetBlock(a_RelX, a_RelY, a_RelZ + 1, type, meta);
+ LargeTree = LargeTree && (type == E_BLOCK_SAPLING) && ((a_Meta & meta) == a_Meta);
+
+ return LargeTree;
}
} ;
diff --git a/src/Blocks/BlockSideways.h b/src/Blocks/BlockSideways.h
index 4b1e38d6d..e52fbaa2f 100644
--- a/src/Blocks/BlockSideways.h
+++ b/src/Blocks/BlockSideways.h
@@ -58,12 +58,16 @@ public:
return a_Meta | 0x4; // East or west
}
- default:
+ case BLOCK_FACE_NONE:
{
ASSERT(!"Unhandled block face!");
return a_Meta | 0xC; // No idea, give a special meta
}
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return 0;
+ #endif
}
} ;
diff --git a/src/Blocks/BlockSlab.h b/src/Blocks/BlockSlab.h
index d762154df..58e85013e 100644
--- a/src/Blocks/BlockSlab.h
+++ b/src/Blocks/BlockSlab.h
@@ -41,7 +41,7 @@ public:
) override
{
a_BlockType = m_BlockType;
- NIBBLETYPE Meta = (NIBBLETYPE) a_Player->GetEquippedItem().m_ItemDamage;
+ NIBBLETYPE Meta = static_cast<NIBBLETYPE>(a_Player->GetEquippedItem().m_ItemDamage);
// Set the correct metadata based on player equipped item (i.e. a_BlockMeta not initialised yet)
switch (a_BlockFace)
@@ -88,12 +88,6 @@ public:
return true;
}
-
- virtual bool CanDirtGrowGrass(NIBBLETYPE a_Meta) override
- {
- return ((a_Meta & 0x8) != 0);
- }
-
/// Returns true if the specified blocktype is one of the slabs handled by this handler
static bool IsAnySlabType(BLOCKTYPE a_BlockType)
@@ -104,7 +98,7 @@ public:
virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override
{
- if ((a_BlockFace == BLOCK_FACE_NONE) || (a_Player->GetEquippedItem().m_ItemType != (short)m_BlockType))
+ if ((a_BlockFace == BLOCK_FACE_NONE) || (a_Player->GetEquippedItem().m_ItemType != static_cast<short>(m_BlockType)))
{
return;
}
diff --git a/src/Blocks/BlockStairs.h b/src/Blocks/BlockStairs.h
index d396204e0..7ef69d2ec 100644
--- a/src/Blocks/BlockStairs.h
+++ b/src/Blocks/BlockStairs.h
@@ -62,12 +62,6 @@ public:
}
- virtual bool CanDirtGrowGrass(NIBBLETYPE a_Meta) override
- {
- return true;
- }
-
-
static NIBBLETYPE RotationToMetaData(double a_Rotation)
{
a_Rotation += 90 + 45; // So its not aligned with axis
diff --git a/src/Blocks/BlockTorch.h b/src/Blocks/BlockTorch.h
index d63df94cf..0a834d13d 100644
--- a/src/Blocks/BlockTorch.h
+++ b/src/Blocks/BlockTorch.h
@@ -59,7 +59,7 @@ public:
case BLOCK_FACE_WEST: return E_META_TORCH_WEST;
case BLOCK_FACE_NORTH: return E_META_TORCH_NORTH;
case BLOCK_FACE_SOUTH: return E_META_TORCH_SOUTH;
- default:
+ case BLOCK_FACE_NONE:
{
ASSERT(!"Unhandled torch direction!");
break;
@@ -103,6 +103,11 @@ public:
case E_BLOCK_STAINED_GLASS:
case E_BLOCK_FENCE:
case E_BLOCK_NETHER_BRICK_FENCE:
+ case E_BLOCK_SPRUCE_FENCE:
+ case E_BLOCK_BIRCH_FENCE:
+ case E_BLOCK_JUNGLE_FENCE:
+ case E_BLOCK_DARK_OAK_FENCE:
+ case E_BLOCK_ACACIA_FENCE:
case E_BLOCK_COBBLESTONE_WALL:
{
// Torches can only be placed on top of these blocks
@@ -114,6 +119,22 @@ public:
// Toches can be placed on the top of these slabs only if the occupy the top half of the voxel
return ((a_BlockFace == BLOCK_FACE_YP) && ((a_BlockMeta & 0x08) == 0x08));
}
+ case E_BLOCK_WOODEN_STAIRS:
+ case E_BLOCK_COBBLESTONE_STAIRS:
+ case E_BLOCK_BRICK_STAIRS:
+ case E_BLOCK_STONE_BRICK_STAIRS:
+ case E_BLOCK_NETHER_BRICK_STAIRS:
+ case E_BLOCK_SANDSTONE_STAIRS:
+ case E_BLOCK_SPRUCE_WOOD_STAIRS:
+ case E_BLOCK_BIRCH_WOOD_STAIRS:
+ case E_BLOCK_JUNGLE_WOOD_STAIRS:
+ case E_BLOCK_QUARTZ_STAIRS:
+ case E_BLOCK_ACACIA_WOOD_STAIRS:
+ case E_BLOCK_DARK_OAK_WOOD_STAIRS:
+ case E_BLOCK_RED_SANDSTONE_STAIRS:
+ {
+ return (a_BlockFace == BLOCK_FACE_TOP) && (a_BlockMeta & E_BLOCK_STAIRS_UPSIDE_DOWN);
+ }
default:
{
if (cBlockInfo::FullyOccupiesVoxel(a_BlockType))
diff --git a/src/Blocks/BlockTrapdoor.h b/src/Blocks/BlockTrapdoor.h
index dbb0b5a5b..a1d2dff6f 100644
--- a/src/Blocks/BlockTrapdoor.h
+++ b/src/Blocks/BlockTrapdoor.h
@@ -66,6 +66,7 @@ public:
return true;
}
+
inline static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace)
{
switch (a_BlockFace)
@@ -74,14 +75,21 @@ public:
case BLOCK_FACE_ZM: return 0x0;
case BLOCK_FACE_XP: return 0x3;
case BLOCK_FACE_XM: return 0x2;
- default:
+ case BLOCK_FACE_NONE:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_YP:
{
ASSERT(!"Unhandled block face!");
return 0;
}
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return 0;
+ #endif
}
+
inline static eBlockFace BlockMetaDataToBlockFace(NIBBLETYPE a_Meta)
{
switch (a_Meta & 0x3)
@@ -98,6 +106,7 @@ public:
}
}
+
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
NIBBLETYPE Meta;
diff --git a/src/Blocks/BlockTripwireHook.h b/src/Blocks/BlockTripwireHook.h
index 88d389711..39892af5a 100644
--- a/src/Blocks/BlockTripwireHook.h
+++ b/src/Blocks/BlockTripwireHook.h
@@ -16,6 +16,7 @@ public:
{
}
+
virtual bool GetPlacementBlockTypeMeta(
cChunkInterface & a_ChunkInterface, cPlayer * a_Player,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
@@ -29,6 +30,7 @@ public:
return true;
}
+
inline static NIBBLETYPE DirectionToMetadata(eBlockFace a_Direction)
{
switch (a_Direction)
@@ -37,10 +39,21 @@ public:
case BLOCK_FACE_XP: return 0x3;
case BLOCK_FACE_ZM: return 0x2;
case BLOCK_FACE_ZP: return 0x0;
- default: ASSERT(!"Unhandled tripwire hook direction!"); return 0x0;
+ case BLOCK_FACE_NONE:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_YP:
+ {
+ ASSERT(!"Unhandled tripwire hook direction!");
+ return 0x0;
+ }
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return 0;
+ #endif
}
+
inline static eBlockFace MetadataToDirection(NIBBLETYPE a_Meta)
{
switch (a_Meta & 0x03)
@@ -53,6 +66,7 @@ public:
}
}
+
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
// Reset meta to zero
diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVine.h
index 00d7a69b8..3d06a8223 100644
--- a/src/Blocks/BlockVine.h
+++ b/src/Blocks/BlockVine.h
@@ -177,7 +177,7 @@ public:
}
- virtual void OnUpdate(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_BlockPluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ)
+ virtual void OnUpdate(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_BlockPluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
{
UNUSED(a_ChunkInterface);
UNUSED(a_WorldInterface);
diff --git a/src/Blocks/BlockWallSign.h b/src/Blocks/BlockWallSign.h
index b6599d033..9b90b78bf 100644
--- a/src/Blocks/BlockWallSign.h
+++ b/src/Blocks/BlockWallSign.h
@@ -55,11 +55,13 @@ public:
{
switch (a_Direction)
{
- case 0x2: return 0x2;
- case 0x3: return 0x3;
- case 0x4: return 0x4;
- case 0x5: return 0x5;
- default:
+ case BLOCK_FACE_ZM: return 0x2;
+ case BLOCK_FACE_ZP: return 0x3;
+ case BLOCK_FACE_XM: return 0x4;
+ case BLOCK_FACE_XP: return 0x5;
+ case BLOCK_FACE_NONE:
+ case BLOCK_FACE_YP:
+ case BLOCK_FACE_YM:
{
break;
}
diff --git a/src/Blocks/CMakeLists.txt b/src/Blocks/CMakeLists.txt
index ed3e321d4..d8affd9cf 100644
--- a/src/Blocks/CMakeLists.txt
+++ b/src/Blocks/CMakeLists.txt
@@ -95,6 +95,11 @@ SET (HDRS
MetaRotator.h
WorldInterface.h)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(BlockHandler.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(BlockPiston.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+endif()
+
if(NOT MSVC)
add_library(Blocks ${SRCS} ${HDRS})
endif()
diff --git a/src/Blocks/WorldInterface.h b/src/Blocks/WorldInterface.h
index 44c118195..826df7034 100644
--- a/src/Blocks/WorldInterface.h
+++ b/src/Blocks/WorldInterface.h
@@ -55,6 +55,18 @@ public:
/** Returns true if it is raining, stormy or snowing at the specified location. This takes into account biomes. */
virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) = 0;
+ /** Returns or sets the minumim or maximum netherportal width */
+ virtual int GetMinNetherPortalWidth(void) const = 0;
+ virtual int GetMaxNetherPortalWidth(void) const = 0;
+ virtual void SetMinNetherPortalWidth(int a_NewMinWidth) = 0;
+ virtual void SetMaxNetherPortalWidth(int a_NewMaxWidth) = 0;
+
+ /** Returns or sets the minumim or maximum netherportal height */
+ virtual int GetMinNetherPortalHeight(void) const = 0;
+ virtual int GetMaxNetherPortalHeight(void) const = 0;
+ virtual void SetMinNetherPortalHeight(int a_NewMinHeight) = 0;
+ virtual void SetMaxNetherPortalHeight(int a_NewMaxHeight) = 0;
+
/** Returns the world height at the specified coords; waits for the chunk to get loaded / generated */
virtual int GetHeight(int a_BlockX, int a_BlockZ) = 0;
diff --git a/src/BoundingBox.cpp b/src/BoundingBox.cpp
index 6b163b01e..64e3c02d2 100644
--- a/src/BoundingBox.cpp
+++ b/src/BoundingBox.cpp
@@ -5,6 +5,7 @@
#include "Globals.h"
#include "BoundingBox.h"
#include "Defines.h"
+#include "SelfTests.h"
@@ -18,6 +19,11 @@ static class SelfTest_BoundingBox
public:
SelfTest_BoundingBox(void)
{
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&Test), "Bounding box intersections");
+ }
+
+ static void Test(void)
+ {
Vector3d Min(1, 1, 1);
Vector3d Max(2, 2, 2);
Vector3d LineDefs[] =
@@ -41,7 +47,7 @@ public:
bool res = cBoundingBox::CalcLineIntersection(Min, Max, Line1, Line2, LineCoeff, Face);
if (res != Results[i])
{
- fprintf(stderr, "LineIntersection({%.02f, %.02f, %.02f}, {%.02f, %.02f, %.02f}) -> %d, %.05f, %d\n",
+ LOGERROR("LineIntersection({%.02f, %.02f, %.02f}, {%.02f, %.02f, %.02f}) -> %d, %.05f, %d",
Line1.x, Line1.y, Line1.z,
Line2.x, Line2.y, Line2.z,
res ? 1 : 0, LineCoeff, Face
@@ -52,7 +58,7 @@ public:
{
if (LineCoeff != LineCoeffs[i])
{
- fprintf(stderr, "LineIntersection({%.02f, %.02f, %.02f}, {%.02f, %.02f, %.02f}) -> %d, %.05f, %d\n",
+ LOGERROR("LineIntersection({%.02f, %.02f, %.02f}, {%.02f, %.02f, %.02f}) -> %d, %.05f, %d",
Line1.x, Line1.y, Line1.z,
Line2.x, Line2.y, Line2.z,
res ? 1 : 0, LineCoeff, Face
@@ -61,9 +67,8 @@ public:
}
}
} // for i - LineDefs[]
- fprintf(stderr, "BoundingBox selftest complete.\n");
}
-} gTest;
+} g_BoundingBoxTest;
#endif
diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp
index dc757d8f6..f50e3845b 100644
--- a/src/ByteBuffer.cpp
+++ b/src/ByteBuffer.cpp
@@ -8,6 +8,7 @@
#include "ByteBuffer.h"
#include "Endianness.h"
#include "OSSupport/IsThread.h"
+#include "SelfTests.h"
@@ -55,18 +56,18 @@ Unfortunately it is very slow, so it is disabled even for regular DEBUG builds.
#ifdef SELF_TEST
-/// Self-test of the VarInt-reading and writing code
+/** Self-test of the VarInt-reading and writing code */
static class cByteBufferSelfTest
{
public:
cByteBufferSelfTest(void)
{
- TestRead();
- TestWrite();
- TestWrap();
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestRead), "ByteBuffer read");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestWrite), "ByteBuffer write");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestWrap), "ByteBuffer wraparound");
}
- void TestRead(void)
+ static void TestRead(void)
{
cByteBuffer buf(50);
buf.Write("\x05\xac\x02\x00", 4);
@@ -78,7 +79,7 @@ public:
assert_test(buf.ReadVarInt(v3) && (v3 == 0));
}
- void TestWrite(void)
+ static void TestWrite(void)
{
cByteBuffer buf(50);
buf.WriteVarInt32(5);
@@ -90,7 +91,7 @@ public:
assert_test(memcmp(All.data(), "\x05\xac\x02\x00", All.size()) == 0);
}
- void TestWrap(void)
+ static void TestWrap(void)
{
cByteBuffer buf(3);
for (int i = 0; i < 1000; i++)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2e367bcf5..6c8fe7d0c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -48,18 +48,23 @@ SET (SRCS
Logger.cpp
Map.cpp
MapManager.cpp
+ MemorySettingsRepository.cpp
MobCensus.cpp
MobFamilyCollecter.cpp
MobProximityCounter.cpp
MobSpawner.cpp
MonsterConfig.cpp
+ NetherPortalScanner.cpp
+ OverridesSettingsRepository.cpp
ProbabDistrib.cpp
RankManager.cpp
RCONServer.cpp
Root.cpp
Scoreboard.cpp
+ SelfTests.cpp
Server.cpp
SetChunkData.cpp
+ SpawnPrepare.cpp
Statistics.cpp
StringCompression.cpp
StringUtils.cpp
@@ -80,6 +85,7 @@ SET (HDRS
BlockTracer.h
Broadcaster.h
BoundingBox.h
+ BuildInfo.h
BuildInfo.h.cmake
ByteBuffer.h
ChatColor.h
@@ -116,18 +122,24 @@ SET (HDRS
Map.h
MapManager.h
Matrix4.h
+ MemorySettingsRepository.h
MobCensus.h
MobFamilyCollecter.h
MobProximityCounter.h
MobSpawner.h
MonsterConfig.h
+ NetherPortalScanner.h
+ OverridesSettingsRepository.h
ProbabDistrib.h
RankManager.h
RCONServer.h
Root.h
Scoreboard.h
+ SelfTests.h
Server.h
SetChunkData.h
+ SettingsRepositoryInterface.h
+ SpawnPrepare.h
Statistics.h
StringCompression.h
StringUtils.h
@@ -142,9 +154,42 @@ SET (HDRS
include_directories(".")
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../lib/sqlite")
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../lib/SQLiteCpp/include")
+include_directories (SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/../lib/TCLAP/include")
configure_file("BuildInfo.h.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/BuildInfo.h")
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(BiomeDef.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum")
+ set_source_files_properties(BlockArea.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion")
+ set_source_files_properties(BlockID.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors")
+ set_source_files_properties(BoundingBox.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors -Wno-error=float-equal")
+ set_source_files_properties(ByteBuffer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=old-style-cast -Wno-error=global-constructors")
+ set_source_files_properties(Chunk.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(ChunkData.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=old-style-cast")
+ set_source_files_properties(ChunkMap.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=shadow -Wno-error=sign-conversion -Wno-error=old-style-cast")
+ set_source_files_properties(ClientHandle.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=sign-conversion -Wno-error=global-constructors -Wno-error=old-style-cast")
+ set_source_files_properties(CompositeChat.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors -Wno-error=missing-variable-declarations")
+ set_source_files_properties(Enchantments.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(IniFile.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=old-style-cast")
+ set_source_files_properties(Inventory.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion")
+ set_source_files_properties(Item.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=old-style-cast")
+ set_source_files_properties(ItemGrid.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion")
+ set_source_files_properties(LightingThread.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=sign-conversion")
+ set_source_files_properties(LinearInterpolation.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(Map.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=old-style-cast")
+ set_source_files_properties(MobProximityCounter.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=float-equal")
+ set_source_files_properties(MobSpawner.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum")
+ set_source_files_properties(RCONServer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion")
+ set_source_files_properties(Root.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=shadow -Wno-error=old-style-cast")
+ set_source_files_properties(Server.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(Statistics.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors")
+ set_source_files_properties(StringCompression.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(StringUtils.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=old-style-cast")
+ set_source_files_properties(Tracer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion")
+ set_source_files_properties(World.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=old-style-cast")
+ set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=missing-variable-declarations -Wno-error=missing-prototypes")
+endif()
+
if (NOT MSVC)
# Bindings need to reference other folders, so they are done here instead
# lib dependencies are not included
@@ -326,4 +371,9 @@ endif ()
if (WIN32)
target_link_libraries(${EXECUTABLE} expat tolualib ws2_32.lib Psapi.lib)
endif()
-target_link_libraries(${EXECUTABLE} luaexpat jsoncpp mbedtls zlib sqlite lua SQLiteCpp event_core event_extra)
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+ add_flags_lnk(-L/usr/local/lib)
+endif()
+
+target_link_libraries(${EXECUTABLE} luaexpat jsoncpp_lib_static mbedtls zlib sqlite lua SQLiteCpp event_core event_extra)
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 7d5f54373..b6ec39294 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -411,7 +411,7 @@ void cChunk::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlock
int OffZ = BlockStartZ - m_PosZ * cChunkDef::Width;
int BaseX = BlockStartX - a_MinBlockX;
int BaseZ = BlockStartZ - a_MinBlockZ;
- int SizeY = a_Area.GetSizeY();
+ int SizeY = std::min(a_Area.GetSizeY(), cChunkDef::Height - a_MinBlockY);
// TODO: Improve this by not calling FastSetBlock() and doing the processing here
// so that the heightmap is touched only once for each column.
@@ -640,6 +640,7 @@ void cChunk::Tick(std::chrono::milliseconds a_Dt)
else if ((*itr)->IsWorldTravellingFrom(m_World))
{
// Remove all entities that are travelling to another world
+ LOGD("Removing entity from [%d, %d] that's travelling between worlds.", m_PosX, m_PosZ);
MarkDirty();
(*itr)->SetWorldTravellingFrom(nullptr);
itr = m_Entities.erase(itr);
@@ -695,7 +696,6 @@ void cChunk::MoveEntityToNewChunk(cEntity * a_Entity)
}
ASSERT(Neighbor != this); // Moving into the same chunk? wtf?
-
Neighbor->AddEntity(a_Entity);
class cMover :
@@ -714,8 +714,8 @@ void cChunk::MoveEntityToNewChunk(cEntity * a_Entity)
cEntity * m_Entity;
public:
- cMover(cEntity * a_Entity) :
- m_Entity(a_Entity)
+ cMover(cEntity * a_CallbackEntity) :
+ m_Entity(a_CallbackEntity)
{}
} Mover(a_Entity);
@@ -1018,20 +1018,26 @@ void cChunk::GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Bl
// Check if there's soil under the neighbor. We already know the neighbors are valid. Place produce if ok
BLOCKTYPE Soil;
- UnboundedRelGetBlock(a_RelX + x, a_RelY - 1, a_RelZ + z, Soil, BlockMeta);
+ VERIFY(UnboundedRelGetBlock(a_RelX + x, a_RelY - 1, a_RelZ + z, Soil, BlockMeta));
switch (Soil)
{
case E_BLOCK_DIRT:
case E_BLOCK_GRASS:
case E_BLOCK_FARMLAND:
{
- // DEBUG: This is here to catch FS #349 - melons growing over other crops.
- LOG("Growing melon / pumpkin overwriting %s, growing on %s",
+ // Place a randomly-facing produce:
+ NIBBLETYPE Meta = (ProduceType == E_BLOCK_MELON) ? 0 : static_cast<NIBBLETYPE>(a_TickRandom.randInt(4) % 4);
+ LOGD("Growing melon / pumpkin at {%d, %d, %d} (<%d, %d> from stem), overwriting %s, growing on top of %s, meta %d",
+ a_RelX + x + m_PosX * cChunkDef::Width, a_RelY, a_RelZ + z + m_PosZ * cChunkDef::Width,
+ x, z,
ItemTypeToString(BlockType[CheckType]).c_str(),
- ItemTypeToString(Soil).c_str()
+ ItemTypeToString(Soil).c_str(),
+ Meta
);
- // Place a randomly-facing produce:
- UnboundedRelFastSetBlock(a_RelX + x, a_RelY, a_RelZ + z, ProduceType, (NIBBLETYPE)(a_TickRandom.randInt(4) % 4));
+ VERIFY(UnboundedRelFastSetBlock(a_RelX + x, a_RelY, a_RelZ + z, ProduceType, Meta));
+ auto Absolute = RelativeToAbsolute(Vector3i{a_RelX + x, a_RelY, a_RelZ + z}, m_PosX, m_PosZ);
+ cChunkInterface ChunkInterface(this->GetWorld()->GetChunkMap());
+ cBlockHandler::NeighborChanged(ChunkInterface, Absolute.x, Absolute.y - 1, Absolute.z, BLOCK_FACE_YP);
break;
}
}
@@ -2852,22 +2858,6 @@ void cChunk::BroadcastBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cons
-void cChunk::BroadcastChunkData(cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude)
-{
- for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr)
- {
- if (*itr == a_Exclude)
- {
- continue;
- }
- (*itr)->SendChunkData(m_PosX, m_PosZ, a_Serializer);
- } // for itr - LoadedByClient[]
-}
-
-
-
-
-
void cChunk::BroadcastCollectEntity(const cEntity & a_Entity, const cPlayer & a_Player, const cClientHandle * a_Exclude)
{
for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr)
diff --git a/src/Chunk.h b/src/Chunk.h
index f57769107..fd9ea0b0c 100644
--- a/src/Chunk.h
+++ b/src/Chunk.h
@@ -319,7 +319,6 @@ public:
void BroadcastBlockAction (int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle * a_Exclude = nullptr);
void BroadcastBlockBreakAnimation(UInt32 a_EntityID, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Stage, const cClientHandle * a_Exclude = nullptr);
void BroadcastBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, const cClientHandle * a_Exclude = nullptr);
- void BroadcastChunkData (cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude = nullptr);
void BroadcastCollectEntity (const cEntity & a_Entity, const cPlayer & a_Player, const cClientHandle * a_Exclude = nullptr);
void BroadcastDestroyEntity (const cEntity & a_Entity, const cClientHandle * a_Exclude = nullptr);
void BroadcastEntityEffect (const cEntity & a_Entity, int a_EffectID, int a_Amplifier, short a_Duration, const cClientHandle * a_Exclude = nullptr);
diff --git a/src/ChunkDef.h b/src/ChunkDef.h
index 2bfa2949c..57c4e6918 100644
--- a/src/ChunkDef.h
+++ b/src/ChunkDef.h
@@ -96,6 +96,25 @@ public:
a_Z = a_Z - a_ChunkZ * Width;
}
+ inline static Vector3i AbsoluteToRelative(Vector3i a_BlockPosition)
+ {
+ int ChunkX, ChunkZ;
+ BlockToChunk(a_BlockPosition.x, a_BlockPosition.z, ChunkX, ChunkZ);
+
+ return {a_BlockPosition.x - ChunkX * Width, a_BlockPosition.y, a_BlockPosition.z - ChunkZ * Width};
+ }
+
+ inline static Vector3i AbsoluteToRelative(Vector3i a_BlockPosition, int a_ChunkX, int a_ChunkZ)
+ {
+ return {a_BlockPosition.x - a_ChunkX * Width, a_BlockPosition.y, a_BlockPosition.z - a_ChunkZ * Width};
+ }
+
+ /** Converts relative block coordinates into absolute coordinates with a known chunk location */
+ inline static Vector3i RelativeToAbsolute(const Vector3i & a_RelBlockPosition, int a_ChunkX, int a_ChunkZ)
+ {
+ return Vector3i(a_RelBlockPosition.x + a_ChunkX * Width, a_RelBlockPosition.y, a_RelBlockPosition.z + a_ChunkZ * Width);
+ }
+
/// Converts absolute block coords to chunk coords:
inline static void BlockToChunk(int a_X, int a_Z, int & a_ChunkX, int & a_ChunkZ)
@@ -190,7 +209,7 @@ public:
}
- inline static int GetHeight(const HeightMap & a_HeightMap, int a_X, int a_Z)
+ inline static HEIGHTTYPE GetHeight(const HeightMap & a_HeightMap, int a_X, int a_Z)
{
ASSERT((a_X >= 0) && (a_X < Width));
ASSERT((a_Z >= 0) && (a_Z < Width));
@@ -198,7 +217,7 @@ public:
}
- inline static void SetHeight(HeightMap & a_HeightMap, int a_X, int a_Z, unsigned char a_Height)
+ inline static void SetHeight(HeightMap & a_HeightMap, int a_X, int a_Z, HEIGHTTYPE a_Height)
{
ASSERT((a_X >= 0) && (a_X < Width));
ASSERT((a_Z >= 0) && (a_Z < Width));
@@ -495,32 +514,3 @@ typedef cCoordWithData<BLOCKTYPE> cCoordWithBlock;
typedef std::list<cCoordWithInt> cCoordWithIntList;
typedef std::vector<cCoordWithInt> cCoordWithIntVector;
-
-
-
-
-
-/** Generic template that can store two types of any kind of data together with a triplet of 3 coords */
-template <typename X, typename Z> class cCoordWithDoubleData
-{
-public:
- int x;
- int y;
- int z;
- X Data;
- Z DataTwo;
-
- cCoordWithDoubleData(int a_X, int a_Y, int a_Z) :
- x(a_X), y(a_Y), z(a_Z)
- {
- }
-
- cCoordWithDoubleData(int a_X, int a_Y, int a_Z, const X & a_Data, const Z & a_DataTwo) :
- x(a_X), y(a_Y), z(a_Z), Data(a_Data), DataTwo(a_DataTwo)
- {
- }
-};
-
-typedef cCoordWithDoubleData <BLOCKTYPE, bool> cCoordWithBlockAndBool;
-
-typedef std::vector<cCoordWithBlockAndBool> cCoordWithBlockAndBoolVector;
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index 44acc2013..4db73971c 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -409,22 +409,6 @@ void cChunkMap::BroadcastBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, c
-void cChunkMap::BroadcastChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude)
-{
- cCSLock Lock(m_CSLayers);
- cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, a_ChunkZ);
- if (Chunk == nullptr)
- {
- return;
- }
- // It's perfectly legal to broadcast packets even to invalid chunks!
- Chunk->BroadcastChunkData(a_Serializer, a_Exclude);
-}
-
-
-
-
-
void cChunkMap::BroadcastCollectEntity(const cEntity & a_Entity, const cPlayer & a_Player, const cClientHandle * a_Exclude)
{
cCSLock Lock(m_CSLayers);
@@ -2401,7 +2385,7 @@ void cChunkMap::TouchChunk(int a_ChunkX, int a_ChunkZ)
-void cChunkMap::PrepareChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_Callback)
+void cChunkMap::PrepareChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr<cChunkCoordCallback> a_Callback)
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoLoad(a_ChunkX, a_ChunkZ);
@@ -2409,7 +2393,7 @@ void cChunkMap::PrepareChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a
// If the chunk is not prepared, queue it in the lighting thread, that will do all the needed processing:
if ((Chunk == nullptr) || !Chunk->IsValid() || !Chunk->IsLightValid())
{
- m_World->GetLightingThread().QueueChunk(a_ChunkX, a_ChunkZ, a_Callback);
+ m_World->GetLightingThread().QueueChunk(a_ChunkX, a_ChunkZ, std::move(a_Callback));
return;
}
diff --git a/src/ChunkMap.h b/src/ChunkMap.h
index 35f66f339..916a3433d 100644
--- a/src/ChunkMap.h
+++ b/src/ChunkMap.h
@@ -73,7 +73,6 @@ public:
void BroadcastBlockAction(int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle * a_Exclude = nullptr);
void BroadcastBlockBreakAnimation(UInt32 a_EntityID, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Stage, const cClientHandle * a_Exclude = nullptr);
void BroadcastBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, const cClientHandle * a_Exclude);
- void BroadcastChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude = nullptr);
void BroadcastCollectEntity(const cEntity & a_Entity, const cPlayer & a_Player, const cClientHandle * a_Exclude = nullptr);
void BroadcastCollectPickup(const cPickup & a_Pickup, const cPlayer & a_Player, const cClientHandle * a_Exclude = nullptr);
void BroadcastDestroyEntity(const cEntity & a_Entity, const cClientHandle * a_Exclude = nullptr);
@@ -322,7 +321,7 @@ public:
The specified chunk is queued to be loaded or generated, and lit if needed.
The specified callback is called after the chunk has been prepared. If there's no preparation to do, only the callback is called.
It is legal to call without the callback. */
- void PrepareChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_CallAfter = nullptr); // Lua-accessible
+ void PrepareChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr<cChunkCoordCallback> a_CallAfter = {}); // Lua-accessible
/** Queues the chunk for generating.
First attempts to load the chunk from the storage. If that fails, queues the chunk for generating.
diff --git a/src/ChunkSender.cpp b/src/ChunkSender.cpp
index 83d82884e..de886b497 100644
--- a/src/ChunkSender.cpp
+++ b/src/ChunkSender.cpp
@@ -13,6 +13,7 @@
#include "BlockEntities/BlockEntity.h"
#include "Protocol/ChunkDataSerializer.h"
#include "ClientHandle.h"
+#include "Chunk.h"
@@ -21,25 +22,37 @@
////////////////////////////////////////////////////////////////////////////////
// cNotifyChunkSender:
-void cNotifyChunkSender::Call(int a_ChunkX, int a_ChunkZ)
-{
- m_ChunkSender->ChunkReady(a_ChunkX, a_ChunkZ);
-}
+/// Callback that can be used to notify chunk sender upon another chunkcoord notification
+class cNotifyChunkSender :
+ public cChunkCoordCallback
+{
+ virtual void Call(int a_ChunkX, int a_ChunkZ) override
+ {
+ cChunkSender & ChunkSender = m_ChunkSender;
+ m_World.DoWithChunk(
+ a_ChunkX, a_ChunkZ,
+ [&ChunkSender] (cChunk & a_Chunk) -> bool
+ {
+ ChunkSender.QueueSendChunkTo(a_Chunk.GetPosX(), a_Chunk.GetPosZ(), cChunkSender::E_CHUNK_PRIORITY_MIDHIGH, a_Chunk.GetAllClients());
+ return true;
+ }
+ );
+ }
+ cChunkSender & m_ChunkSender;
+ cWorld & m_World;
+public:
+ cNotifyChunkSender(cChunkSender & a_ChunkSender, cWorld & a_World) : m_ChunkSender(a_ChunkSender), m_World(a_World) {}
-////////////////////////////////////////////////////////////////////////////////
-// cChunkSender:
+};
-cChunkSender::cChunkSender(void) :
+cChunkSender::cChunkSender(cWorld & a_World) :
super("ChunkSender"),
- m_World(nullptr),
- m_RemoveCount(0),
- m_Notify(nullptr)
+ m_World(a_World)
{
- m_Notify.SetChunkSender(this);
}
@@ -55,10 +68,9 @@ cChunkSender::~cChunkSender()
-bool cChunkSender::Start(cWorld * a_World)
+bool cChunkSender::Start()
{
m_ShouldTerminate = false;
- m_World = a_World;
return super::Start();
}
@@ -77,12 +89,30 @@ void cChunkSender::Stop(void)
-void cChunkSender::ChunkReady(int a_ChunkX, int a_ChunkZ)
+void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, cClientHandle * a_Client)
{
- // This is probably never gonna be called twice for the same chunk, and if it is, we don't mind, so we don't check
+ ASSERT(a_Client != nullptr);
{
+ cChunkCoords Chunk{a_ChunkX, a_ChunkZ};
cCSLock Lock(m_CS);
- m_ChunksReady.push_back(cChunkCoords(a_ChunkX, a_ChunkZ));
+ auto iter = m_ChunkInfo.find(Chunk);
+ if (iter != m_ChunkInfo.end())
+ {
+ auto & info = iter->second;
+ if (info.m_Priority > a_Priority)
+ {
+ m_SendChunks.push(sChunkQueue{a_Priority, Chunk});
+ info.m_Priority = a_Priority;
+ }
+ info.m_Clients.insert(a_Client);
+ }
+ else
+ {
+ m_SendChunks.push(sChunkQueue{a_Priority, Chunk});
+ auto info = sSendChunk{Chunk, a_Priority};
+ info.m_Clients.insert(a_Client);
+ m_ChunkInfo.emplace(Chunk, info);
+ }
}
m_evtQueue.Set();
}
@@ -91,44 +121,29 @@ void cChunkSender::ChunkReady(int a_ChunkX, int a_ChunkZ)
-void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, cClientHandle * a_Client)
+
+void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, std::list<cClientHandle *> a_Clients)
{
- ASSERT(a_Client != nullptr);
{
- sSendChunk Chunk(a_ChunkX, a_ChunkZ, a_Client);
-
+ cChunkCoords Chunk{a_ChunkX, a_ChunkZ};
cCSLock Lock(m_CS);
- if (
- std::find(m_SendChunksLowPriority.begin(), m_SendChunksLowPriority.end(), Chunk) != m_SendChunksLowPriority.end() ||
- std::find(m_SendChunksMediumPriority.begin(), m_SendChunksMediumPriority.end(), Chunk) != m_SendChunksMediumPriority.end() ||
- std::find(m_SendChunksHighPriority.begin(), m_SendChunksHighPriority.end(), Chunk) != m_SendChunksHighPriority.end()
- )
- {
- // Already queued, bail out
- return;
- }
-
- switch (a_Priority)
+ auto iter = m_ChunkInfo.find(Chunk);
+ if (iter != m_ChunkInfo.end())
{
- case E_CHUNK_PRIORITY_LOW:
+ auto & info = iter->second;
+ if (info.m_Priority > a_Priority)
{
- m_SendChunksLowPriority.push_back(Chunk);
- break;
- }
- case E_CHUNK_PRIORITY_MEDIUM:
- {
- m_SendChunksMediumPriority.push_back(Chunk);
- break;
- }
- case E_CHUNK_PRIORITY_HIGH:
- {
- m_SendChunksHighPriority.push_back(Chunk);
- break;
- }
- default:
- {
- ASSERT(!"Unknown chunk priority!");
+ m_SendChunks.push(sChunkQueue{a_Priority, Chunk});
+ info.m_Priority = a_Priority;
}
+ info.m_Clients.insert(a_Clients.begin(), a_Clients.end());
+ }
+ else
+ {
+ m_SendChunks.push(sChunkQueue{a_Priority, Chunk});
+ auto info = sSendChunk{Chunk, a_Priority};
+ info.m_Clients.insert(a_Clients.begin(), a_Clients.end());
+ m_ChunkInfo.emplace(Chunk, info);
}
}
m_evtQueue.Set();
@@ -142,37 +157,14 @@ void cChunkSender::RemoveClient(cClientHandle * a_Client)
{
{
cCSLock Lock(m_CS);
- for (sSendChunkList::iterator itr = m_SendChunksLowPriority.begin(); itr != m_SendChunksLowPriority.end();)
+ for (auto && pair : m_ChunkInfo)
{
- if (itr->m_Client == a_Client)
- {
- itr = m_SendChunksLowPriority.erase(itr);
- continue;
- }
- ++itr;
- } // for itr - m_SendChunksLowPriority[]
- for (sSendChunkList::iterator itr = m_SendChunksMediumPriority.begin(); itr != m_SendChunksMediumPriority.end();)
- {
- if (itr->m_Client == a_Client)
- {
- itr = m_SendChunksMediumPriority.erase(itr);
- continue;
- }
- ++itr;
- } // for itr - m_SendChunksMediumPriority[]
- for (sSendChunkList::iterator itr = m_SendChunksHighPriority.begin(); itr != m_SendChunksHighPriority.end();)
- {
- if (itr->m_Client == a_Client)
- {
- itr = m_SendChunksHighPriority.erase(itr);
- continue;
- }
- ++itr;
- } // for itr - m_SendChunksHighPriority[]
- m_RemoveCount++;
+ auto && clients = pair.second.m_Clients;
+ clients.erase(a_Client); // nop for sets that do not contain a_Client
+ }
}
m_evtQueue.Set();
- m_evtRemoved.Wait(); // Wait for removal confirmation
+ m_evtRemoved.Wait(); // Wait for all remaining instances of a_Client to be processed (Execute() makes a copy of m_ChunkInfo)
}
@@ -183,132 +175,91 @@ void cChunkSender::Execute(void)
{
while (!m_ShouldTerminate)
{
- cCSLock Lock(m_CS);
- while (m_ChunksReady.empty() && m_SendChunksLowPriority.empty() && m_SendChunksMediumPriority.empty() && m_SendChunksHighPriority.empty())
+ m_evtQueue.Wait();
+
{
- int RemoveCount = m_RemoveCount;
- m_RemoveCount = 0;
- cCSUnlock Unlock(Lock);
- for (int i = 0; i < RemoveCount; i++)
- {
- m_evtRemoved.Set(); // Notify that the removed clients are safe to be deleted
- }
- m_evtQueue.Wait();
- if (m_ShouldTerminate)
+ cCSLock Lock(m_CS);
+ while (!m_SendChunks.empty())
{
- return;
+ // Take one from the queue:
+ auto Chunk = m_SendChunks.top().m_Chunk;
+ m_SendChunks.pop();
+ auto itr = m_ChunkInfo.find(Chunk);
+ if (itr == m_ChunkInfo.end())
+ {
+ continue;
+ }
+
+ std::unordered_set<cClientHandle *> clients;
+ std::swap(itr->second.m_Clients, clients);
+ m_ChunkInfo.erase(itr);
+
+ cCSUnlock Unlock(Lock);
+ SendChunk(Chunk.m_ChunkX, Chunk.m_ChunkZ, clients);
}
- } // while (empty)
-
- if (!m_SendChunksHighPriority.empty())
- {
- // Take one from the queue:
- sSendChunk Chunk(m_SendChunksHighPriority.front());
- m_SendChunksHighPriority.pop_front();
- Lock.Unlock();
-
- SendChunk(Chunk.m_ChunkX, Chunk.m_ChunkZ, Chunk.m_Client);
- }
- else if (!m_ChunksReady.empty())
- {
- // Take one from the queue:
- cChunkCoords Coords(m_ChunksReady.front());
- m_ChunksReady.pop_front();
- Lock.Unlock();
-
- SendChunk(Coords.m_ChunkX, Coords.m_ChunkZ, nullptr);
}
- else if (!m_SendChunksMediumPriority.empty())
- {
- // Take one from the queue:
- sSendChunk Chunk(m_SendChunksMediumPriority.front());
- m_SendChunksMediumPriority.pop_front();
- Lock.Unlock();
- SendChunk(Chunk.m_ChunkX, Chunk.m_ChunkZ, Chunk.m_Client);
- }
- else
- {
- // Take one from the queue:
- sSendChunk Chunk(m_SendChunksLowPriority.front());
- m_SendChunksLowPriority.pop_front();
- Lock.Unlock();
-
- SendChunk(Chunk.m_ChunkX, Chunk.m_ChunkZ, Chunk.m_Client);
- }
- Lock.Lock();
- int RemoveCount = m_RemoveCount;
- m_RemoveCount = 0;
- Lock.Unlock();
- for (int i = 0; i < RemoveCount; i++)
- {
- m_evtRemoved.Set(); // Notify that the removed clients are safe to be deleted
- }
- } // while (!mShouldTerminate)
+ m_evtRemoved.SetAll(); // Notify all waiting threads that all clients are processed and thus safe to destroy
+ } // while (!m_ShouldTerminate)
}
-void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Client)
+void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkZ, std::unordered_set<cClientHandle *> a_Clients)
{
- ASSERT(m_World != nullptr);
-
// Ask the client if it still wants the chunk:
- if ((a_Client != nullptr) && !a_Client->WantsSendChunk(a_ChunkX, a_ChunkZ))
+ for (auto itr = a_Clients.begin(); itr != a_Clients.end();)
{
- return;
+ if (!(*itr)->WantsSendChunk(a_ChunkX, a_ChunkZ))
+ {
+ itr = a_Clients.erase(itr);
+ }
+ else
+ {
+ itr++;
+ }
}
// If the chunk has no clients, no need to packetize it:
- if (!m_World->HasChunkAnyClients(a_ChunkX, a_ChunkZ))
+ if (!m_World.HasChunkAnyClients(a_ChunkX, a_ChunkZ))
{
return;
}
// If the chunk is not valid, do nothing - whoever needs it has queued it for loading / generating
- if (!m_World->IsChunkValid(a_ChunkX, a_ChunkZ))
+ if (!m_World.IsChunkValid(a_ChunkX, a_ChunkZ))
{
return;
}
// If the chunk is not lighted, queue it for relighting and get notified when it's ready:
- if (!m_World->IsChunkLighted(a_ChunkX, a_ChunkZ))
+ if (!m_World.IsChunkLighted(a_ChunkX, a_ChunkZ))
{
- m_World->QueueLightChunk(a_ChunkX, a_ChunkZ, &m_Notify);
+ m_World.QueueLightChunk(a_ChunkX, a_ChunkZ, cpp14::make_unique<cNotifyChunkSender>(*this, m_World));
return;
}
// Query and prepare chunk data:
- if (!m_World->GetChunkData(a_ChunkX, a_ChunkZ, *this))
+ if (!m_World.GetChunkData(a_ChunkX, a_ChunkZ, *this))
{
return;
}
cChunkDataSerializer Data(m_BlockTypes, m_BlockMetas, m_BlockLight, m_BlockSkyLight, m_BiomeMap);
- // Send:
- if (a_Client == nullptr)
- {
- m_World->BroadcastChunkData(a_ChunkX, a_ChunkZ, Data);
- }
- else
+ for (const auto client : a_Clients)
{
- a_Client->SendChunkData(a_ChunkX, a_ChunkZ, Data);
- }
+ // Send:
+ client->SendChunkData(a_ChunkX, a_ChunkZ, Data);
- // Send block-entity packets:
- for (sBlockCoords::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end(); ++itr)
- {
- if (a_Client == nullptr)
+ // Send block-entity packets:
+ for (const auto & Pos : m_BlockEntities)
{
- m_World->BroadcastBlockEntity(itr->m_BlockX, itr->m_BlockY, itr->m_BlockZ);
- }
- else
- {
- m_World->SendBlockEntity(itr->m_BlockX, itr->m_BlockY, itr->m_BlockZ, *a_Client);
- }
- } // for itr - m_Packets[]
+ m_World.SendBlockEntity(Pos.x, Pos.y, Pos.z, *client);
+ } // for itr - m_Packets[]
+
+ }
m_BlockEntities.clear();
// TODO: Send entity spawn packets
@@ -320,7 +271,7 @@ void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Clien
void cChunkSender::BlockEntity(cBlockEntity * a_Entity)
{
- m_BlockEntities.push_back(sBlockCoord(a_Entity->GetPosX(), a_Entity->GetPosY(), a_Entity->GetPosZ()));
+ m_BlockEntities.push_back(a_Entity->GetPos());
}
@@ -342,7 +293,7 @@ void cChunkSender::BiomeData(const cChunkDef::BiomeMap * a_BiomeMap)
if ((*a_BiomeMap)[i] < 255)
{
// Normal MC biome, copy as-is:
- m_BiomeMap[i] = (unsigned char)((*a_BiomeMap)[i]);
+ m_BiomeMap[i] = static_cast<unsigned char>((*a_BiomeMap)[i]);
}
else
{
diff --git a/src/ChunkSender.h b/src/ChunkSender.h
index 8b187c5f9..fd9275794 100644
--- a/src/ChunkSender.h
+++ b/src/ChunkSender.h
@@ -1,4 +1,4 @@
-
+
// ChunkSender.h
// Interfaces to the cChunkSender class representing the thread that waits for chunks becoming ready (loaded / generated) and sends them to clients
@@ -29,6 +29,9 @@ Note that it may be called by world's BroadcastToChunk() if the client is still
#include "ChunkDef.h"
#include "ChunkDataCallback.h"
+#include <unordered_set>
+#include <unordered_map>
+
@@ -47,115 +50,79 @@ class cChunkSender;
-/// Callback that can be used to notify chunk sender upon another chunkcoord notification
-class cNotifyChunkSender :
- public cChunkCoordCallback
-{
- virtual void Call(int a_ChunkX, int a_ChunkZ) override;
-
- cChunkSender * m_ChunkSender;
-public:
- cNotifyChunkSender(cChunkSender * a_ChunkSender) : m_ChunkSender(a_ChunkSender) {}
-
- void SetChunkSender(cChunkSender * a_ChunkSender)
- {
- m_ChunkSender = a_ChunkSender;
- }
-} ;
-
-
-
-
-
class cChunkSender:
public cIsThread,
public cChunkDataSeparateCollector
{
typedef cIsThread super;
public:
- cChunkSender(void);
+ cChunkSender(cWorld & a_World);
~cChunkSender();
enum eChunkPriority
{
- E_CHUNK_PRIORITY_HIGH = 0,
- E_CHUNK_PRIORITY_MEDIUM = 1,
- E_CHUNK_PRIORITY_LOW = 2,
+ E_CHUNK_PRIORITY_HIGH = 0,
+ E_CHUNK_PRIORITY_MIDHIGH,
+ E_CHUNK_PRIORITY_MEDIUM,
+ E_CHUNK_PRIORITY_LOW,
+
};
- bool Start(cWorld * a_World);
+ bool Start();
void Stop(void);
- /// Notifies that a chunk has become ready and it should be sent to all its clients
- void ChunkReady(int a_ChunkX, int a_ChunkZ);
-
/// Queues a chunk to be sent to a specific client
void QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, cClientHandle * a_Client);
+ void QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, std::list<cClientHandle *> a_Client);
/// Removes the a_Client from all waiting chunk send operations
void RemoveClient(cClientHandle * a_Client);
protected:
-
- /// Used for sending chunks to specific clients
- struct sSendChunk
+
+ struct sChunkQueue
{
- int m_ChunkX;
- int m_ChunkZ;
- cClientHandle * m_Client;
-
- sSendChunk(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Client) :
- m_ChunkX(a_ChunkX),
- m_ChunkZ(a_ChunkZ),
- m_Client(a_Client)
- {
- }
-
- bool operator ==(const sSendChunk & a_Other)
+ eChunkPriority m_Priority;
+ cChunkCoords m_Chunk;
+
+ bool operator <(const sChunkQueue & a_Other) const
{
- return (
- (a_Other.m_ChunkX == m_ChunkX) &&
- (a_Other.m_ChunkZ == m_ChunkZ) &&
- (a_Other.m_Client == m_Client)
- );
+ /* The Standard Priority Queue sorts from biggest to smallest
+ return true here means you are smaller than the other object, and you get pushed down.
+
+ The priorities go from HIGH (0) to LOW (2), so a smaller priority should mean further up the list
+ therefore, return true (affirm we're "smaller", and get pushed down) only if our priority is bigger than theirs (they're more urgent)
+ */
+ return this->m_Priority > a_Other.m_Priority;
}
- } ;
- typedef std::list<sSendChunk> sSendChunkList;
+ };
- struct sBlockCoord
+ /// Used for sending chunks to specific clients
+ struct sSendChunk
{
- int m_BlockX;
- int m_BlockY;
- int m_BlockZ;
-
- sBlockCoord(int a_BlockX, int a_BlockY, int a_BlockZ) :
- m_BlockX(a_BlockX),
- m_BlockY(a_BlockY),
- m_BlockZ(a_BlockZ)
+ cChunkCoords m_Chunk;
+ std::unordered_set<cClientHandle *> m_Clients;
+ eChunkPriority m_Priority;
+ sSendChunk(cChunkCoords a_Chunk, eChunkPriority a_Priority) :
+ m_Chunk(a_Chunk),
+ m_Priority(a_Priority)
{
}
- } ;
-
- typedef std::vector<sBlockCoord> sBlockCoords;
+ };
- cWorld * m_World;
+ cWorld & m_World;
cCriticalSection m_CS;
- cChunkCoordsList m_ChunksReady;
- sSendChunkList m_SendChunksLowPriority;
- sSendChunkList m_SendChunksMediumPriority;
- sSendChunkList m_SendChunksHighPriority;
- cEvent m_evtQueue; // Set when anything is added to m_ChunksReady
- cEvent m_evtRemoved; // Set when removed clients are safe to be deleted
- int m_RemoveCount; // Number of threads waiting for a client removal (m_evtRemoved needs to be set this many times)
-
- cNotifyChunkSender m_Notify; // Used for chunks that don't have a valid lighting - they will be re-queued after lightcalc
-
+ std::priority_queue<sChunkQueue> m_SendChunks;
+ std::unordered_map<cChunkCoords, sSendChunk, cChunkCoordsHash> m_ChunkInfo;
+ cEvent m_evtQueue; // Set when anything is added to m_ChunksReady
+ cEvent m_evtRemoved; // Set when removed clients are safe to be deleted
+
// Data about the chunk that is being sent:
// NOTE that m_BlockData[] is inherited from the cChunkDataCollector
unsigned char m_BiomeMap[cChunkDef::Width * cChunkDef::Width];
- sBlockCoords m_BlockEntities; // Coords of the block entities to send
+ std::vector<Vector3i> m_BlockEntities; // Coords of the block entities to send
// TODO: sEntityIDs m_Entities; // Entity-IDs of the entities to send
// cIsThread override:
@@ -168,9 +135,8 @@ protected:
virtual void BlockEntity (cBlockEntity * a_Entity) override;
/// Sends the specified chunk to a_Client, or to all chunk clients if a_Client == nullptr
- void SendChunk(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Client);
+ void SendChunk(int a_ChunkX, int a_ChunkZ, std::unordered_set<cClientHandle *> a_Clients);
} ;
-
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index c8ccc1cf5..6ca43da6f 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -381,8 +381,8 @@ void cClientHandle::Authenticate(const AString & a_Name, const AString & a_UUID,
// Send player list items
SendPlayerListAddPlayer(*m_Player);
- World->BroadcastPlayerListAddPlayer(*m_Player);
- World->SendPlayerList(m_Player);
+ cRoot::Get()->BroadcastPlayerListsAddPlayer(*m_Player);
+ cRoot::Get()->SendPlayerLists(m_Player);
m_Player->Initialize(*World);
m_State = csAuthenticated;
@@ -440,9 +440,9 @@ bool cClientHandle::StreamNextChunk(void)
int RangeX, RangeZ = 0;
cChunkDef::BlockToChunk(FloorC(Vector.x), FloorC(Vector.z), RangeX, RangeZ);
- for (size_t X = 0; X < 7; X++)
+ for (int X = 0; X < 7; X++)
{
- for (size_t Z = 0; Z < 7; Z++)
+ for (int Z = 0; Z < 7; Z++)
{
int ChunkX = RangeX + ((X >= 4) ? (3 - X) : X);
int ChunkZ = RangeZ + ((Z >= 4) ? (3 - Z) : Z);
@@ -456,7 +456,7 @@ bool cClientHandle::StreamNextChunk(void)
// If the chunk already loading / loaded -> skip
if (
- (std::find(m_ChunksToSend.begin(), m_ChunksToSend.end(), Coords) != m_ChunksToSend.end()) ||
+ (m_ChunksToSend.find(Coords) != m_ChunksToSend.end()) ||
(std::find(m_LoadedChunks.begin(), m_LoadedChunks.end(), Coords) != m_LoadedChunks.end())
)
{
@@ -494,7 +494,7 @@ bool cClientHandle::StreamNextChunk(void)
// If the chunk already loading / loaded -> skip
if (
- (std::find(m_ChunksToSend.begin(), m_ChunksToSend.end(), Coords) != m_ChunksToSend.end()) ||
+ (m_ChunksToSend.find(Coords) != m_ChunksToSend.end()) ||
(std::find(m_LoadedChunks.begin(), m_LoadedChunks.end(), Coords) != m_LoadedChunks.end())
)
{
@@ -541,7 +541,7 @@ void cClientHandle::UnloadOutOfRangeChunks(void)
}
}
- for (cChunkCoordsList::iterator itr = m_ChunksToSend.begin(); itr != m_ChunksToSend.end();)
+ for (auto itr = m_ChunksToSend.begin(); itr != m_ChunksToSend.end();)
{
int DiffX = Diff((*itr).m_ChunkX, ChunkPosX);
int DiffZ = Diff((*itr).m_ChunkZ, ChunkPosZ);
@@ -583,7 +583,7 @@ void cClientHandle::StreamChunk(int a_ChunkX, int a_ChunkZ, cChunkSender::eChunk
{
cCSLock Lock(m_CSChunkLists);
m_LoadedChunks.push_back(cChunkCoords(a_ChunkX, a_ChunkZ));
- m_ChunksToSend.push_back(cChunkCoords(a_ChunkX, a_ChunkZ));
+ m_ChunksToSend.emplace(a_ChunkX, a_ChunkZ);
}
World->SendChunkTo(a_ChunkX, a_ChunkZ, a_Priority, this);
}
@@ -1475,7 +1475,7 @@ void cClientHandle::HandleChat(const AString & a_Message)
Msg.AddTextPart(AString("<") + m_Player->GetName() + "> ", Color);
Msg.ParseText(Message);
Msg.UnderlineUrls();
- m_Player->GetWorld()->BroadcastChat(Msg);
+ cRoot::Get()->BroadcastChat(Msg);
}
@@ -1902,7 +1902,7 @@ void cClientHandle::Tick(float a_Dt)
if (m_TicksSinceLastPacket > 600) // 30 seconds time-out
{
SendDisconnect("Nooooo!! You timed out! D: Come back!");
- Destroy();
+ return;
}
if (m_Player == nullptr)
@@ -2013,7 +2013,6 @@ void cClientHandle::ServerTick(float a_Dt)
if (m_TicksSinceLastPacket > 600) // 30 seconds
{
SendDisconnect("Nooooo!! You timed out! D: Come back!");
- Destroy();
}
}
@@ -2114,6 +2113,64 @@ void cClientHandle::SendChat(const cCompositeChat & a_Message)
+void cClientHandle::SendChatAboveActionBar(const AString & a_Message, eMessageType a_ChatPrefix, const AString & a_AdditionalData)
+{
+ cWorld * World = GetPlayer()->GetWorld();
+ if (World == nullptr)
+ {
+ World = cRoot::Get()->GetWorld(GetPlayer()->GetLoadedWorldName());
+ if (World == nullptr)
+ {
+ World = cRoot::Get()->GetDefaultWorld();
+ }
+ }
+
+ AString Message = FormatMessageType(World->ShouldUseChatPrefixes(), a_ChatPrefix, a_AdditionalData);
+ m_Protocol->SendChatAboveActionBar(Message.append(a_Message));
+}
+
+
+
+
+
+void cClientHandle::SendChatAboveActionBar(const cCompositeChat & a_Message)
+{
+ m_Protocol->SendChatAboveActionBar(a_Message);
+}
+
+
+
+
+
+void cClientHandle::SendChatSystem(const AString & a_Message, eMessageType a_ChatPrefix, const AString & a_AdditionalData)
+{
+ cWorld * World = GetPlayer()->GetWorld();
+ if (World == nullptr)
+ {
+ World = cRoot::Get()->GetWorld(GetPlayer()->GetLoadedWorldName());
+ if (World == nullptr)
+ {
+ World = cRoot::Get()->GetDefaultWorld();
+ }
+ }
+
+ AString Message = FormatMessageType(World->ShouldUseChatPrefixes(), a_ChatPrefix, a_AdditionalData);
+ m_Protocol->SendChatSystem(Message.append(a_Message));
+}
+
+
+
+
+
+void cClientHandle::SendChatSystem(const cCompositeChat & a_Message)
+{
+ m_Protocol->SendChatSystem(a_Message);
+}
+
+
+
+
+
void cClientHandle::SendChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer)
{
ASSERT(m_Player != nullptr);
@@ -2122,15 +2179,12 @@ void cClientHandle::SendChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializ
bool Found = false;
{
cCSLock Lock(m_CSChunkLists);
- for (cChunkCoordsList::iterator itr = m_ChunksToSend.begin(); itr != m_ChunksToSend.end(); ++itr)
+ auto itr = m_ChunksToSend.find(cChunkCoords{a_ChunkX, a_ChunkZ});
+ if (itr != m_ChunksToSend.end())
{
- if ((itr->m_ChunkX == a_ChunkX) && (itr->m_ChunkZ == a_ChunkZ))
- {
- m_ChunksToSend.erase(itr);
- Found = true;
- break;
- }
- } // for itr - m_ChunksToSend[]
+ m_ChunksToSend.erase(itr);
+ Found = true;
+ }
}
if (!Found)
{
@@ -2182,6 +2236,8 @@ void cClientHandle::SendDestroyEntity(const cEntity & a_Entity)
void cClientHandle::SendDisconnect(const AString & a_Reason)
{
+ // Destruction (Destroy()) is called when the client disconnects, not when a disconnect packet (or anything else) is sent
+ // Otherwise, the cClientHandle instance is can be unexpectedly removed from the associated player - Core/#142
if (!m_HasSentDC)
{
LOGD("Sending a DC: \"%s\"", StripColorCodes(a_Reason).c_str());
@@ -2329,6 +2385,15 @@ void cClientHandle::SendHealth(void)
+void cClientHandle::SendHideTitle(void)
+{
+ m_Protocol->SendHideTitle();
+}
+
+
+
+
+
void cClientHandle::SendInventorySlot(char a_WindowID, short a_SlotNum, const cItem & a_Item)
{
m_Protocol->SendInventorySlot(a_WindowID, a_SlotNum, a_Item);
@@ -2532,6 +2597,15 @@ void cClientHandle::SendRemoveEntityEffect(const cEntity & a_Entity, int a_Effec
+void cClientHandle::SendResetTitle()
+{
+ m_Protocol->SendResetTitle();
+}
+
+
+
+
+
void cClientHandle::SendRespawn(eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks)
{
m_Protocol->SendRespawn(a_Dimension, a_ShouldIgnoreDimensionChecks);
@@ -2586,6 +2660,42 @@ void cClientHandle::SendDisplayObjective(const AString & a_Objective, cScoreboar
+void cClientHandle::SendSetSubTitle(const cCompositeChat & a_SubTitle)
+{
+ m_Protocol->SendSetSubTitle(a_SubTitle);
+}
+
+
+
+
+
+void cClientHandle::SendSetRawSubTitle(const AString & a_SubTitle)
+{
+ m_Protocol->SendSetRawSubTitle(a_SubTitle);
+}
+
+
+
+
+
+void cClientHandle::SendSetTitle(const cCompositeChat & a_Title)
+{
+ m_Protocol->SendSetTitle(a_Title);
+}
+
+
+
+
+
+void cClientHandle::SendSetRawTitle(const AString & a_Title)
+{
+ m_Protocol->SendSetRawTitle(a_Title);
+}
+
+
+
+
+
void cClientHandle::SendSoundEffect(const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch)
{
m_Protocol->SendSoundEffect(a_SoundName, a_X, a_Y, a_Z, a_Volume, a_Pitch);
@@ -2676,6 +2786,15 @@ void cClientHandle::SendThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ)
+void cClientHandle::SendTitleTimes(int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks)
+{
+ m_Protocol->SendTitleTimes(a_FadeInTicks, a_DisplayTicks, a_FadeOutTicks);
+}
+
+
+
+
+
void cClientHandle::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle)
{
m_Protocol->SendTimeUpdate(a_WorldAge, a_TimeOfDay, a_DoDaylightCycle);
@@ -2828,7 +2947,7 @@ bool cClientHandle::WantsSendChunk(int a_ChunkX, int a_ChunkZ)
}
cCSLock Lock(m_CSChunkLists);
- return (std::find(m_ChunksToSend.begin(), m_ChunksToSend.end(), cChunkCoords(a_ChunkX, a_ChunkZ)) != m_ChunksToSend.end());
+ return m_ChunksToSend.find(cChunkCoords(a_ChunkX, a_ChunkZ)) != m_ChunksToSend.end();
}
@@ -2844,9 +2963,9 @@ void cClientHandle::AddWantedChunk(int a_ChunkX, int a_ChunkZ)
LOGD("Adding chunk [%d, %d] to wanted chunks for client %p", a_ChunkX, a_ChunkZ, this);
cCSLock Lock(m_CSChunkLists);
- if (std::find(m_ChunksToSend.begin(), m_ChunksToSend.end(), cChunkCoords(a_ChunkX, a_ChunkZ)) == m_ChunksToSend.end())
+ if (m_ChunksToSend.find(cChunkCoords(a_ChunkX, a_ChunkZ)) == m_ChunksToSend.end())
{
- m_ChunksToSend.push_back(cChunkCoords(a_ChunkX, a_ChunkZ));
+ m_ChunksToSend.emplace(a_ChunkX, a_ChunkZ);
}
}
@@ -2859,7 +2978,6 @@ void cClientHandle::PacketBufferFull(void)
// Too much data in the incoming queue, the server is probably too busy, kick the client:
LOGERROR("Too much data in queue for client \"%s\" @ %s, kicking them.", m_Username.c_str(), m_IPString.c_str());
SendDisconnect("Server busy");
- Destroy();
}
@@ -2873,7 +2991,6 @@ void cClientHandle::PacketUnknown(UInt32 a_PacketType)
AString Reason;
Printf(Reason, "Unknown [C->S] PacketType: 0x%x", a_PacketType);
SendDisconnect(Reason);
- Destroy();
}
@@ -2884,7 +3001,6 @@ void cClientHandle::PacketError(UInt32 a_PacketType)
{
LOGERROR("Protocol error while parsing packet type 0x%02x; disconnecting client \"%s\"", a_PacketType, m_Username.c_str());
SendDisconnect("Protocol error");
- Destroy();
}
@@ -2894,13 +3010,20 @@ void cClientHandle::PacketError(UInt32 a_PacketType)
void cClientHandle::SocketClosed(void)
{
// The socket has been closed for any reason
-
+
if (!m_Username.empty()) // Ignore client pings
{
LOGD("Client %s @ %s disconnected", m_Username.c_str(), m_IPString.c_str());
cRoot::Get()->GetPluginManager()->CallHookDisconnect(*this, "Player disconnected");
}
-
+ if ((m_State < csDestroying) && (m_Player != nullptr))
+ {
+ cWorld * World = m_Player->GetWorld();
+ if (World != nullptr)
+ {
+ World->RemovePlayer(m_Player, true); // Must be called before cPlayer::Destroy() as otherwise cChunk tries to delete the player, and then we do it again
+ }
+ }
Destroy();
}
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index 61f29b57c..302de5a77 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -23,7 +23,7 @@
#include <array>
-
+#include <atomic>
// fwd:
@@ -150,6 +150,10 @@ public: // tolua_export
void SendBlockChanges (int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes);
void SendChat (const AString & a_Message, eMessageType a_ChatPrefix, const AString & a_AdditionalData = "");
void SendChat (const cCompositeChat & a_Message);
+ void SendChatAboveActionBar (const AString & a_Message, eMessageType a_ChatPrefix, const AString & a_AdditionalData = "");
+ void SendChatAboveActionBar (const cCompositeChat & a_Message);
+ void SendChatSystem (const AString & a_Message, eMessageType a_ChatPrefix, const AString & a_AdditionalData = "");
+ void SendChatSystem (const cCompositeChat & a_Message);
void SendChunkData (int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer);
void SendCollectEntity (const cEntity & a_Entity, const cPlayer & a_Player);
void SendDestroyEntity (const cEntity & a_Entity);
@@ -172,6 +176,7 @@ public: // tolua_export
void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion);
void SendGameMode (eGameMode a_GameMode);
void SendHealth (void);
+ void SendHideTitle (void);
void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item);
void SendMapColumn (int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length, unsigned int m_Scale);
void SendMapDecorators (int a_ID, const cMapDecoratorList & a_Decorators, unsigned int m_Scale);
@@ -192,9 +197,14 @@ public: // tolua_export
void SendPlayerSpawn (const cPlayer & a_Player);
void SendPluginMessage (const AString & a_Channel, const AString & a_Message); // Exported in ManualBindings.cpp
void SendRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID);
+ void SendResetTitle (void);
void SendRespawn (eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks = false);
void SendScoreUpdate (const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode);
void SendScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode);
+ void SendSetSubTitle (const cCompositeChat & a_SubTitle);
+ void SendSetRawSubTitle (const AString & a_SubTitle);
+ void SendSetTitle (const cCompositeChat & a_Title);
+ void SendSetRawTitle (const AString & a_Title);
void SendSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch); // tolua_export
void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data);
void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock);
@@ -205,6 +215,7 @@ public: // tolua_export
void SendTabCompletionResults (const AStringVector & a_Results);
void SendTeleportEntity (const cEntity & a_Entity);
void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ);
+ void SendTitleTimes (int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks);
void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle); // tolua_export
void SendUnloadChunk (int a_ChunkX, int a_ChunkZ);
void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity);
@@ -366,10 +377,10 @@ private:
AString m_Password;
Json::Value m_Properties;
- cCriticalSection m_CSChunkLists;
- cChunkCoordsList m_LoadedChunks; // Chunks that the player belongs to
- cChunkCoordsList m_ChunksToSend; // Chunks that need to be sent to the player (queued because they weren't generated yet or there's not enough time to send them)
- cChunkCoordsList m_SentChunks; // Chunks that are currently sent to the client
+ cCriticalSection m_CSChunkLists;
+ cChunkCoordsList m_LoadedChunks; // Chunks that the player belongs to
+ std::unordered_set<cChunkCoords, cChunkCoordsHash> m_ChunksToSend; // Chunks that need to be sent to the player (queued because they weren't generated yet or there's not enough time to send them)
+ cChunkCoordsList m_SentChunks; // Chunks that are currently sent to the client
cProtocol * m_Protocol;
@@ -436,7 +447,7 @@ private:
// TODO: Add Kicking here as well
} ;
- eState m_State;
+ std::atomic<eState> m_State;
/** m_State needs to be locked in the Destroy() function so that the destruction code doesn't run twice on two different threads */
cCriticalSection m_CSDestroyingState;
diff --git a/src/CompositeChat.cpp b/src/CompositeChat.cpp
index d1eb0b852..353835039 100644
--- a/src/CompositeChat.cpp
+++ b/src/CompositeChat.cpp
@@ -6,6 +6,7 @@
#include "Globals.h"
#include "CompositeChat.h"
#include "ClientHandle.h"
+#include "SelfTests.h"
@@ -19,16 +20,14 @@ class SelfTest_CompositeChat
public:
SelfTest_CompositeChat(void)
{
- fprintf(stderr, "cCompositeChat self test...\n");
- TestParser1();
- TestParser2();
- TestParser3();
- TestParser4();
- TestParser5();
- fprintf(stderr, "cCompositeChat self test finished.\n");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser1), "CompositeChat parser test 1");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser2), "CompositeChat parser test 2");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser3), "CompositeChat parser test 3");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser4), "CompositeChat parser test 4");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser5), "CompositeChat parser test 5");
}
- void TestParser1(void)
+ static void TestParser1(void)
{
cCompositeChat Msg;
Msg.ParseText("Testing @2color codes and http://links parser");
@@ -44,7 +43,7 @@ public:
assert_test(Parts[3]->m_Style == "@2");
}
- void TestParser2(void)
+ static void TestParser2(void)
{
cCompositeChat Msg;
Msg.ParseText("@3Advanced stuff: @5overriding color codes and http://links.with/@4color-in-them handling");
@@ -60,7 +59,7 @@ public:
assert_test(Parts[3]->m_Style == "@5");
}
- void TestParser3(void)
+ static void TestParser3(void)
{
cCompositeChat Msg;
Msg.ParseText("http://links.starting the text");
@@ -72,7 +71,7 @@ public:
assert_test(Parts[1]->m_Style == "");
}
- void TestParser4(void)
+ static void TestParser4(void)
{
cCompositeChat Msg;
Msg.ParseText("links finishing the text: http://some.server");
@@ -84,7 +83,7 @@ public:
assert_test(Parts[1]->m_Style == "");
}
- void TestParser5(void)
+ static void TestParser5(void)
{
cCompositeChat Msg;
Msg.ParseText("http://only.links");
@@ -342,7 +341,11 @@ AString cCompositeChat::ExtractText(void) const
}
case ptUrl:
{
- Msg.append(((cUrlPart *)(*itr))->m_Url);
+ Msg.append((static_cast<cUrlPart *>(*itr))->m_Url);
+ break;
+ }
+ case ptShowAchievement:
+ {
break;
}
} // switch (PartType)
@@ -419,7 +422,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
case cCompositeChat::ptClientTranslated:
{
- const cCompositeChat::cClientTranslatedPart & p = (const cCompositeChat::cClientTranslatedPart &)**itr;
+ const cCompositeChat::cClientTranslatedPart & p = static_cast<const cCompositeChat::cClientTranslatedPart &>(**itr);
Part["translate"] = p.m_Text;
Json::Value With;
for (AStringVector::const_iterator itrW = p.m_Parameters.begin(), endW = p.m_Parameters.end(); itrW != endW; ++itr)
@@ -436,7 +439,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
case cCompositeChat::ptUrl:
{
- const cCompositeChat::cUrlPart & p = (const cCompositeChat::cUrlPart &)**itr;
+ const cCompositeChat::cUrlPart & p = static_cast<const cCompositeChat::cUrlPart &>(**itr);
Part["text"] = p.m_Text;
Json::Value Url;
Url["action"] = "open_url";
@@ -449,7 +452,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
case cCompositeChat::ptSuggestCommand:
case cCompositeChat::ptRunCommand:
{
- const cCompositeChat::cCommandPart & p = (const cCompositeChat::cCommandPart &)**itr;
+ const cCompositeChat::cCommandPart & p = static_cast<const cCompositeChat::cCommandPart &>(**itr);
Part["text"] = p.m_Text;
Json::Value Cmd;
Cmd["action"] = (p.m_PartType == cCompositeChat::ptRunCommand) ? "run_command" : "suggest_command";
@@ -461,7 +464,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
case cCompositeChat::ptShowAchievement:
{
- const cCompositeChat::cShowAchievementPart & p = (const cCompositeChat::cShowAchievementPart &)**itr;
+ const cCompositeChat::cShowAchievementPart & p = static_cast<const cCompositeChat::cShowAchievementPart &>(**itr);
Part["translate"] = "chat.type.achievement";
Json::Value Ach;
diff --git a/src/CraftingRecipes.cpp b/src/CraftingRecipes.cpp
index 472044fa3..0bb77d341 100644
--- a/src/CraftingRecipes.cpp
+++ b/src/CraftingRecipes.cpp
@@ -168,7 +168,14 @@ void cCraftingGrid::ConsumeGrid(const cCraftingGrid & a_Grid)
m_Items[ThisIdx].m_ItemCount -= NumWantedItems;
if (m_Items[ThisIdx].m_ItemCount == 0)
{
- m_Items[ThisIdx].Clear();
+ if ((m_Items[ThisIdx].m_ItemType == E_ITEM_MILK) || (m_Items[ThisIdx].m_ItemType == E_ITEM_WATER_BUCKET) || (m_Items[ThisIdx].m_ItemType == E_ITEM_LAVA_BUCKET))
+ {
+ m_Items[ThisIdx] = cItem(E_ITEM_BUCKET, m_Items[ThisIdx].m_ItemCount);
+ }
+ else
+ {
+ m_Items[ThisIdx].Clear();
+ }
}
} // for x, for y
}
@@ -373,12 +380,12 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine
AStringVector Sides = StringSplit(RecipeLine, "=");
if (Sides.size() != 2)
{
- LOGWARNING("crafting.txt: line %d: A single '=' was expected, got %d", a_LineNum, (int)Sides.size() - 1);
+ LOGWARNING("crafting.txt: line %d: A single '=' was expected, got " SIZE_T_FMT, a_LineNum, Sides.size() - 1);
LOGINFO("Offending line: \"%s\"", a_RecipeLine.c_str());
return;
}
- std::unique_ptr<cCraftingRecipes::cRecipe> Recipe(new cCraftingRecipes::cRecipe);
+ std::unique_ptr<cCraftingRecipes::cRecipe> Recipe = cpp14::make_unique<cCraftingRecipes::cRecipe>();
// Parse the result:
AStringVector ResultSplit = StringSplit(Sides[0], ",");
@@ -759,7 +766,7 @@ cCraftingRecipes::cRecipe * cCraftingRecipes::MatchRecipe(const cItem * a_Crafti
} // for y, for x
// The recipe has matched. Create a copy of the recipe and set its coords to match the crafting grid:
- std::unique_ptr<cRecipe> Recipe(new cRecipe);
+ std::unique_ptr<cRecipe> Recipe = cpp14::make_unique<cRecipe>();
Recipe->m_Result = a_Recipe->m_Result;
Recipe->m_Width = a_Recipe->m_Width;
Recipe->m_Height = a_Recipe->m_Height;
@@ -771,9 +778,12 @@ cCraftingRecipes::cRecipe * cCraftingRecipes::MatchRecipe(const cItem * a_Crafti
continue;
}
Recipe->m_Ingredients.push_back(*itrS);
+ Recipe->m_Ingredients.back().x += a_OffsetX;
+ Recipe->m_Ingredients.back().y += a_OffsetY;
}
Recipe->m_Ingredients.insert(Recipe->m_Ingredients.end(), MatchedSlots.begin(), MatchedSlots.end());
+ // Handle the fireworks-related effects:
// We use Recipe instead of a_Recipe because we want the wildcard ingredients' slot numbers as well, which was just added previously
HandleFireworks(a_CraftingGrid, Recipe.get(), a_GridStride, a_OffsetX, a_OffsetY);
@@ -833,7 +843,7 @@ void cCraftingRecipes::HandleFireworks(const cItem * a_CraftingGrid, cCraftingRe
case E_ITEM_DYE:
{
int GridID = (itr->x + a_OffsetX) + a_GridStride * (itr->y + a_OffsetY);
- DyeColours.push_back(cFireworkItem::GetVanillaColourCodeFromDye((NIBBLETYPE)(a_CraftingGrid[GridID].m_ItemDamage & 0x0f)));
+ DyeColours.push_back(cFireworkItem::GetVanillaColourCodeFromDye(static_cast<NIBBLETYPE>(a_CraftingGrid[GridID].m_ItemDamage & 0x0f)));
break;
}
case E_ITEM_GUNPOWDER: break;
diff --git a/src/Defines.h b/src/Defines.h
index 787eacab8..f3b742e09 100644
--- a/src/Defines.h
+++ b/src/Defines.h
@@ -29,16 +29,16 @@ enum
-/// Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc
+/** Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc */
enum eBlockFace
{
BLOCK_FACE_NONE = -1, // Interacting with no block face - swinging the item in the air
- BLOCK_FACE_XM = 4, // Interacting with the X- face of the block
- BLOCK_FACE_XP = 5, // Interacting with the X+ face of the block
- BLOCK_FACE_YM = 0, // Interacting with the Y- face of the block
- BLOCK_FACE_YP = 1, // Interacting with the Y+ face of the block
- BLOCK_FACE_ZM = 2, // Interacting with the Z- face of the block
- BLOCK_FACE_ZP = 3, // Interacting with the Z+ face of the block
+ BLOCK_FACE_XM = 4, // Interacting with the X- face of the block
+ BLOCK_FACE_XP = 5, // Interacting with the X+ face of the block
+ BLOCK_FACE_YM = 0, // Interacting with the Y- face of the block
+ BLOCK_FACE_YP = 1, // Interacting with the Y+ face of the block
+ BLOCK_FACE_ZM = 2, // Interacting with the Z- face of the block
+ BLOCK_FACE_ZP = 3, // Interacting with the Z+ face of the block
// Synonyms using the (deprecated) world directions:
BLOCK_FACE_BOTTOM = BLOCK_FACE_YM, // Interacting with the bottom face of the block
@@ -47,6 +47,10 @@ enum eBlockFace
BLOCK_FACE_SOUTH = BLOCK_FACE_ZP, // Interacting with the southern face of the block
BLOCK_FACE_WEST = BLOCK_FACE_XM, // Interacting with the western face of the block
BLOCK_FACE_EAST = BLOCK_FACE_XP, // Interacting with the eastern face of the block
+
+ // Bounds, used for range-checking:
+ BLOCK_FACE_MIN = -1,
+ BLOCK_FACE_MAX = 5,
} ;
@@ -133,6 +137,17 @@ enum eGameMode
+enum eChatType
+{
+ ctChatBox = 0,
+ ctSystem = 1,
+ ctAboveActionBar = 2,
+} ;
+
+
+
+
+
enum eWeather
{
eWeather_Sunny = 0,
@@ -238,8 +253,17 @@ inline eBlockFace MirrorBlockFaceY(eBlockFace a_BlockFace)
case BLOCK_FACE_XP: return BLOCK_FACE_XM;
case BLOCK_FACE_ZM: return BLOCK_FACE_ZP;
case BLOCK_FACE_ZP: return BLOCK_FACE_ZM;
- default: return a_BlockFace;
+ case BLOCK_FACE_NONE:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_YP:
+ {
+ return a_BlockFace;
+ };
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return a_BlockFace;
+ #endif
}
@@ -255,8 +279,17 @@ inline eBlockFace RotateBlockFaceCCW(eBlockFace a_BlockFace)
case BLOCK_FACE_XP: return BLOCK_FACE_ZM;
case BLOCK_FACE_ZM: return BLOCK_FACE_XM;
case BLOCK_FACE_ZP: return BLOCK_FACE_XP;
- default: return a_BlockFace;
+ case BLOCK_FACE_NONE:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_YP:
+ {
+ return a_BlockFace;
+ }
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return a_BlockFace;
+ #endif
}
@@ -271,25 +304,45 @@ inline eBlockFace RotateBlockFaceCW(eBlockFace a_BlockFace)
case BLOCK_FACE_XP: return BLOCK_FACE_ZP;
case BLOCK_FACE_ZM: return BLOCK_FACE_XP;
case BLOCK_FACE_ZP: return BLOCK_FACE_XM;
- default: return a_BlockFace;
+ case BLOCK_FACE_NONE:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_YP:
+ {
+ return a_BlockFace;
+ };
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return a_BlockFace;
+ #endif
}
+
+
+
+
inline eBlockFace ReverseBlockFace(eBlockFace a_BlockFace)
{
switch (a_BlockFace)
{
- case BLOCK_FACE_YP: return BLOCK_FACE_YM;
- case BLOCK_FACE_XP: return BLOCK_FACE_XM;
- case BLOCK_FACE_ZP: return BLOCK_FACE_ZM;
- case BLOCK_FACE_YM: return BLOCK_FACE_YP;
- case BLOCK_FACE_XM: return BLOCK_FACE_XP;
- case BLOCK_FACE_ZM: return BLOCK_FACE_ZP;
- default: return a_BlockFace;
+ case BLOCK_FACE_YP: return BLOCK_FACE_YM;
+ case BLOCK_FACE_XP: return BLOCK_FACE_XM;
+ case BLOCK_FACE_ZP: return BLOCK_FACE_ZM;
+ case BLOCK_FACE_YM: return BLOCK_FACE_YP;
+ case BLOCK_FACE_XM: return BLOCK_FACE_XP;
+ case BLOCK_FACE_ZM: return BLOCK_FACE_ZP;
+ case BLOCK_FACE_NONE: return a_BlockFace;
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown BLOCK_FACE");
+ return a_BlockFace;
+ #endif
}
+
+
+
/** Returns the textual representation of the BlockFace constant. */
inline AString BlockFaceToString(eBlockFace a_BlockFace)
{
@@ -305,7 +358,7 @@ inline AString BlockFaceToString(eBlockFace a_BlockFace)
}
// clang optimisises this line away then warns that it has done so.
#if !defined(__clang__)
- return Printf("Unknown BLOCK_FACE: %d", a_BlockFace);
+ return Printf("Unknown BLOCK_FACE: %d", a_BlockFace);
#endif
}
@@ -436,7 +489,7 @@ inline void AddFaceDirection(int & a_BlockX, int & a_BlockY, int & a_BlockZ, eBl
case BLOCK_FACE_ZP: a_BlockZ++; break;
case BLOCK_FACE_XP: a_BlockX++; break;
case BLOCK_FACE_XM: a_BlockX--; break;
- default:
+ case BLOCK_FACE_NONE:
{
LOGWARNING("%s: Unknown face: %d", __FUNCTION__, a_BlockFace);
ASSERT(!"AddFaceDirection(): Unknown face");
@@ -454,7 +507,7 @@ inline void AddFaceDirection(int & a_BlockX, int & a_BlockY, int & a_BlockZ, eBl
case BLOCK_FACE_ZP: a_BlockZ--; break;
case BLOCK_FACE_XP: a_BlockX--; break;
case BLOCK_FACE_XM: a_BlockX++; break;
- default:
+ case BLOCK_FACE_NONE:
{
LOGWARNING("%s: Unknown inv face: %d", __FUNCTION__, a_BlockFace);
ASSERT(!"AddFaceDirection(): Unknown face");
diff --git a/src/Enchantments.cpp b/src/Enchantments.cpp
index 5ed18de6b..17c77dd93 100644
--- a/src/Enchantments.cpp
+++ b/src/Enchantments.cpp
@@ -69,8 +69,8 @@ void cEnchantments::AddFromString(const AString & a_StringSpec)
LOG("%s: Failed to parse enchantment \"%s\", skipping.", __FUNCTION__, Split[0].c_str());
continue;
}
- int lvl = atoi(Split[1].c_str());
- if ((lvl == 0) && (Split[1] != "0"))
+ unsigned int lvl;
+ if (!StringToInteger(Split[1], lvl))
{
// Level failed to parse
LOG("%s: Failed to parse enchantment level \"%s\", skipping.", __FUNCTION__, Split[1].c_str());
@@ -108,7 +108,7 @@ AString cEnchantments::ToString(void) const
-int cEnchantments::GetLevel(int a_EnchantmentID) const
+unsigned int cEnchantments::GetLevel(int a_EnchantmentID) const
{
// Return the level for the specified enchantment; 0 if not stored
cMap::const_iterator itr = m_Enchantments.find(a_EnchantmentID);
@@ -125,7 +125,7 @@ int cEnchantments::GetLevel(int a_EnchantmentID) const
-void cEnchantments::SetLevel(int a_EnchantmentID, int a_Level)
+void cEnchantments::SetLevel(int a_EnchantmentID, unsigned int a_Level)
{
// Sets the level for the specified enchantment, adding it if not stored before or removing it if level <= 0
if (a_Level == 0)
@@ -908,7 +908,7 @@ void cEnchantments::AddItemEnchantmentWeights(cWeightedEnchantments & a_Enchantm
-void cEnchantments::AddEnchantmentWeightToVector(cWeightedEnchantments & a_Enchantments, int a_Weight, int a_EnchantmentID, int a_EnchantmentLevel)
+void cEnchantments::AddEnchantmentWeightToVector(cWeightedEnchantments & a_Enchantments, int a_Weight, int a_EnchantmentID, unsigned int a_EnchantmentLevel)
{
cWeightedEnchantment weightedenchantment;
weightedenchantment.m_Weight = a_Weight;
diff --git a/src/Enchantments.h b/src/Enchantments.h
index 9d3f342d4..8c08e7a93 100644
--- a/src/Enchantments.h
+++ b/src/Enchantments.h
@@ -92,10 +92,10 @@ public:
AString ToString(void) const;
/** Returns the level for the specified enchantment; 0 if not stored */
- int GetLevel(int a_EnchantmentID) const;
+ unsigned int GetLevel(int a_EnchantmentID) const;
/** Sets the level for the specified enchantment, adding it if not stored before or removing it if level <= 0 */
- void SetLevel(int a_EnchantmentID, int a_Level);
+ void SetLevel(int a_EnchantmentID, unsigned int a_Level);
/** Removes all enchantments */
void Clear(void);
@@ -115,7 +115,7 @@ public:
static void AddItemEnchantmentWeights(cWeightedEnchantments & a_Enchantments, short a_ItemType, int a_EnchantmentLevel);
/** Add a enchantment with weight to the vector */
- static void AddEnchantmentWeightToVector(cWeightedEnchantments & a_Enchantments, int a_Weight, int a_EnchantmentID, int a_EnchantmentLevel);
+ static void AddEnchantmentWeightToVector(cWeightedEnchantments & a_Enchantments, int a_Weight, int a_EnchantmentID, unsigned int a_EnchantmentLevel);
/** Remove the entire enchantment (with weight) from the vector */
static void RemoveEnchantmentWeightFromVector(cWeightedEnchantments & a_Enchantments, int a_EnchantmentID);
@@ -145,7 +145,7 @@ public:
protected:
/** Maps enchantment ID -> enchantment level */
- typedef std::map<int, int> cMap;
+ typedef std::map<int, unsigned int> cMap;
/** Currently stored enchantments */
cMap m_Enchantments;
diff --git a/src/Endianness.h b/src/Endianness.h
index a415903a5..0e8bc8e99 100644
--- a/src/Endianness.h
+++ b/src/Endianness.h
@@ -2,7 +2,7 @@
#pragma once
#undef ntohll
-#define ntohll(x) ((((UInt64)ntohl((UInt32)x)) << 32) + ntohl(x >> 32))
+#define ntohll(x) (((static_cast<UInt64>(ntohl(static_cast<UInt32>(x)))) << 32) + ntohl(x >> 32))
@@ -13,7 +13,7 @@ inline UInt64 HostToNetwork8(const void * a_Value)
{
UInt64 buf;
memcpy( &buf, a_Value, sizeof( buf));
- buf = (( ( (UInt64)htonl((UInt32)buf)) << 32) + htonl(buf >> 32));
+ buf = (( ( static_cast<UInt64>(htonl(static_cast<UInt32>(buf)))) << 32) + htonl(buf >> 32));
return buf;
}
diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp
index 32952100c..492cf2a56 100644
--- a/src/Entities/ArrowEntity.cpp
+++ b/src/Entities/ArrowEntity.cpp
@@ -84,7 +84,7 @@ void cArrowEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFa
int X = BlockHit.x, Y = BlockHit.y, Z = BlockHit.z;
m_HitBlockPos = Vector3i(X, Y, Z);
-
+
// Broadcast arrow hit sound
m_World->BroadcastSoundEffect("random.bowhit", (double)X, (double)Y, (double)Z, 0.5f, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64));
@@ -108,15 +108,15 @@ void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
Damage += m_World->GetTickRandomNumber(Damage / 2 + 2);
}
- int PowerLevel = m_CreatorData.m_Enchantments.GetLevel(cEnchantments::enchPower);
+ unsigned int PowerLevel = m_CreatorData.m_Enchantments.GetLevel(cEnchantments::enchPower);
if (PowerLevel > 0)
{
int ExtraDamage = (int)ceil(0.25 * (PowerLevel + 1));
Damage += ExtraDamage;
}
- int KnockbackAmount = 1;
- int PunchLevel = m_CreatorData.m_Enchantments.GetLevel(cEnchantments::enchPunch);
+ // int KnockbackAmount = 1;
+ unsigned int PunchLevel = m_CreatorData.m_Enchantments.GetLevel(cEnchantments::enchPunch);
if (PunchLevel > 0)
{
Vector3d LookVector = GetLookVector();
@@ -130,8 +130,9 @@ void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
a_EntityHit.SetSpeed(FinalSpeed);
}
- a_EntityHit.TakeDamage(dtRangedAttack, this, Damage, KnockbackAmount);
-
+ // a_EntityHit.TakeDamage(dtRangedAttack, this, Damage, KnockbackAmount); // TODO fix knockback.
+ a_EntityHit.TakeDamage(dtRangedAttack, this, Damage, 0); // Until knockback is fixed.
+
if (IsOnFire() && !a_EntityHit.IsSubmerged() && !a_EntityHit.IsSwimming())
{
a_EntityHit.StartBurning(100);
diff --git a/src/Entities/CMakeLists.txt b/src/Entities/CMakeLists.txt
index 5d10e1680..7261e85c0 100644
--- a/src/Entities/CMakeLists.txt
+++ b/src/Entities/CMakeLists.txt
@@ -60,6 +60,14 @@ SET (HDRS
ThrownSnowballEntity.h
WitherSkullEntity.h)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(ArrowEntity.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(Entity.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=global-constructors -Wno-error=switch-enum -Wno-error=old-style-cast")
+ set_source_files_properties(EntityEffect.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum -Wno-error=old-style-cast")
+ set_source_files_properties(Floater.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=old-style-cast")
+ set_source_files_properties(Player.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=switch-enum -Wno-error=conversion -Wno-error=old-style-cast")
+endif()
+
if(NOT MSVC)
add_library(Entities ${SRCS} ${HDRS})
diff --git a/src/Entities/EnderCrystal.cpp b/src/Entities/EnderCrystal.cpp
index 7a911d4db..b71d70bdd 100644
--- a/src/Entities/EnderCrystal.cpp
+++ b/src/Entities/EnderCrystal.cpp
@@ -22,7 +22,7 @@ cEnderCrystal::cEnderCrystal(double a_X, double a_Y, double a_Z)
void cEnderCrystal::SpawnOn(cClientHandle & a_ClientHandle)
{
- a_ClientHandle.SendSpawnObject(*this, 51, 0, (Byte)GetYaw(), (Byte)GetPitch());
+ a_ClientHandle.SendSpawnObject(*this, 51, 0, static_cast<Byte>(GetYaw()), static_cast<Byte>(GetPitch()));
}
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 4a909a1fd..bb9d3c44b 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -13,6 +13,7 @@
#include "Player.h"
#include "Items/ItemHandler.h"
#include "../FastRandom.h"
+#include "../NetherPortalScanner.h"
@@ -42,6 +43,7 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, d
m_WorldTravellingFrom(nullptr),
m_EntityType(a_EntityType),
m_World(nullptr),
+ m_IsWorldChangeScheduled(false),
m_IsFireproof(false),
m_TicksSinceLastBurnDamage(0),
m_TicksSinceLastLavaDamage(0),
@@ -396,7 +398,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
}
}
- int ThornsLevel = 0;
+ unsigned int ThornsLevel = 0;
const cItem ArmorItems[] = { GetEquippedHelmet(), GetEquippedChestplate(), GetEquippedLeggings(), GetEquippedBoots() };
for (size_t i = 0; i < ARRAYCOUNT(ArmorItems); i++)
{
@@ -742,6 +744,13 @@ void cEntity::KilledBy(TakeDamageInfo & a_TDI)
return;
}
+ // If the victim is a player the hook is handled by the cPlayer class
+ if (!IsPlayer())
+ {
+ AString emptystring = AString("");
+ cRoot::Get()->GetPluginManager()->CallHookKilled(*this, a_TDI, emptystring);
+ }
+
// Drop loot:
cItems Drops;
GetDrops(Drops, a_TDI.Attacker);
@@ -1260,9 +1269,35 @@ void cEntity::DetectCacti(void)
+void cEntity::ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool a_SetPortalCooldown)
+{
+ m_NewWorld = a_World;
+ m_NewWorldPosition = a_NewPosition;
+ m_IsWorldChangeScheduled = true;
+ m_WorldChangeSetPortalCooldown = a_SetPortalCooldown;
+}
+
+
+
bool cEntity::DetectPortal()
{
+ // If somebody scheduled a world change with ScheduleMoveToWorld, change worlds now.
+ if (m_IsWorldChangeScheduled)
+ {
+ m_IsWorldChangeScheduled = false;
+
+ if (m_WorldChangeSetPortalCooldown)
+ {
+ // Delay the portal check.
+ m_PortalCooldownData.m_TicksDelayed = 0;
+ m_PortalCooldownData.m_ShouldPreventTeleportation = true;
+ }
+
+ MoveToWorld(m_NewWorld, false, m_NewWorldPosition);
+ return true;
+ }
+
if (GetWorld()->GetDimension() == dimOverworld)
{
if (GetWorld()->GetLinkedNetherWorldName().empty() && GetWorld()->GetLinkedEndWorldName().empty())
@@ -1312,8 +1347,15 @@ bool cEntity::DetectPortal()
// Send a respawn packet before world is loaded / generated so the client isn't left in limbo
((cPlayer *)this)->GetClientHandle()->SendRespawn(dimOverworld);
}
-
- return MoveToWorld(cRoot::Get()->CreateAndInitializeWorld(GetWorld()->GetLinkedOverworldName()), false);
+
+ Vector3d TargetPos = GetPosition();
+ TargetPos.x *= 8.0;
+ TargetPos.z *= 8.0;
+
+ cWorld * TargetWorld = cRoot::Get()->CreateAndInitializeWorld(GetWorld()->GetLinkedOverworldName(), dimNether, GetWorld()->GetName(), false);
+ LOGD("Jumping nether -> overworld");
+ new cNetherPortalScanner(this, TargetWorld, TargetPos, 256);
+ return true;
}
else
{
@@ -1329,8 +1371,15 @@ bool cEntity::DetectPortal()
((cPlayer *)this)->AwardAchievement(achEnterPortal);
((cPlayer *)this)->GetClientHandle()->SendRespawn(dimNether);
}
-
- return MoveToWorld(cRoot::Get()->CreateAndInitializeWorld(GetWorld()->GetLinkedNetherWorldName(), dimNether, GetWorld()->GetName()), false);
+
+ Vector3d TargetPos = GetPosition();
+ TargetPos.x /= 8.0;
+ TargetPos.z /= 8.0;
+
+ cWorld * TargetWorld = cRoot::Get()->CreateAndInitializeWorld(GetWorld()->GetLinkedNetherWorldName(), dimNether, GetWorld()->GetName(), false);
+ LOGD("Jumping overworld -> nether");
+ new cNetherPortalScanner(this, TargetWorld, TargetPos, 128);
+ return true;
}
}
case E_BLOCK_END_PORTAL:
@@ -1392,7 +1441,7 @@ bool cEntity::DetectPortal()
-bool cEntity::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
+bool cEntity::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition)
{
UNUSED(a_ShouldSendRespawn);
ASSERT(a_World != nullptr);
@@ -1403,14 +1452,27 @@ bool cEntity::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
return false;
}
+ // Ask the plugins if the entity is allowed to changing the world
+ if (cRoot::Get()->GetPluginManager()->CallHookEntityChangingWorld(*this, *a_World))
+ {
+ // A Plugin doesn't allow the entity to changing the world
+ return false;
+ }
+
// Remove all links to the old world
SetWorldTravellingFrom(GetWorld()); // cChunk::Tick() handles entity removal
GetWorld()->BroadcastDestroyEntity(*this);
+ SetPosition(a_NewPosition);
+
// Queue add to new world
a_World->AddEntity(this);
+ cWorld * OldWorld = cRoot::Get()->GetWorld(GetWorld()->GetName()); // Required for the hook HOOK_ENTITY_CHANGED_WORLD
SetWorld(a_World);
+ // Entity changed the world, call the hook
+ cRoot::Get()->GetPluginManager()->CallHookEntityChangedWorld(*this, *OldWorld);
+
return true;
}
@@ -1427,7 +1489,7 @@ bool cEntity::MoveToWorld(const AString & a_WorldName, bool a_ShouldSendRespawn)
return false;
}
- return DoMoveToWorld(World, a_ShouldSendRespawn);
+ return DoMoveToWorld(World, a_ShouldSendRespawn, GetPosition());
}
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index fecbb9bf5..f54e130eb 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -205,8 +205,8 @@ public:
double GetSpeedZ (void) const { return m_Speed.z; }
double GetWidth (void) const { return m_Width; }
- int GetChunkX(void) const {return (int)floor(m_Pos.x / cChunkDef::Width); }
- int GetChunkZ(void) const {return (int)floor(m_Pos.z / cChunkDef::Width); }
+ int GetChunkX(void) const {return static_cast<int>(floor(m_Pos.x / cChunkDef::Width)); }
+ int GetChunkZ(void) const {return static_cast<int>(floor(m_Pos.z / cChunkDef::Width)); }
void SetHeadYaw (double a_HeadYaw);
void SetHeight (double a_Height);
@@ -350,31 +350,31 @@ public:
*/
virtual bool DetectPortal(void);
- /// Handles when the entity is in the void
+ /** Handles when the entity is in the void */
virtual void TickInVoid(cChunk & a_Chunk);
- /// Called when the entity starts burning
+ /** Called when the entity starts burning */
virtual void OnStartedBurning(void);
- /// Called when the entity finishes burning
+ /** Called when the entity finishes burning */
virtual void OnFinishedBurning(void);
// tolua_begin
- /// Sets the maximum value for the health
+ /** Sets the maximum value for the health */
void SetMaxHealth(int a_MaxHealth);
int GetMaxHealth(void) const { return m_MaxHealth; }
- /// Sets whether the entity is fireproof
+ /** Sets whether the entity is fireproof */
void SetIsFireproof(bool a_IsFireproof);
bool IsFireproof(void) const { return m_IsFireproof; }
- /// Puts the entity on fire for the specified amount of ticks
+ /** Puts the entity on fire for the specified amount of ticks */
void StartBurning(int a_TicksLeftBurning);
- /// Stops the entity from burning, resets all burning timers
+ /** Stops the entity from burning, resets all burning timers */
void StopBurning(void);
// tolua_end
@@ -386,21 +386,26 @@ public:
// tolua_begin
- /// Teleports to the entity specified
+ /** Teleports to the entity specified */
virtual void TeleportToEntity(cEntity & a_Entity);
- /// Teleports to the coordinates specified
+ /** Teleports to the coordinates specified */
virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ);
+ /** Schedules a MoveToWorld call to occur on the next Tick of the entity */
+ void ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool a_SetPortalCooldown = false);
+
+ bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition) { return DoMoveToWorld(a_World, a_ShouldSendRespawn, a_NewPosition); }
+
/** Moves entity to specified world, taking a world pointer */
- bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn = true) { return DoMoveToWorld(a_World, a_ShouldSendRespawn); }
+ bool MoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn = true) { return MoveToWorld(a_World, a_ShouldSendRespawn, GetPosition()); }
/** Moves entity to specified world, taking a world name */
bool MoveToWorld(const AString & a_WorldName, bool a_ShouldSendRespawn = true);
// tolua_end
- virtual bool DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn);
+ virtual bool DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition);
/** Returns if the entity is travelling away from a specified world */
bool IsWorldTravellingFrom(cWorld * a_World) const { return (m_WorldTravellingFrom == a_World); }
@@ -530,23 +535,29 @@ protected:
eEntityType m_EntityType;
cWorld * m_World;
+
+ /** State variables for ScheduleMoveToWorld. */
+ bool m_IsWorldChangeScheduled;
+ bool m_WorldChangeSetPortalCooldown;
+ cWorld * m_NewWorld;
+ Vector3d m_NewWorldPosition;
- /// Whether the entity is capable of taking fire or lava damage.
+ /** Whether the entity is capable of taking fire or lava damage. */
bool m_IsFireproof;
- /// Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire())
+ /** Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire()) */
int m_TicksSinceLastBurnDamage;
- /// Time, in ticks, since the last damage dealt by standing in lava. Reset to zero when moving out of lava.
+ /** Time, in ticks, since the last damage dealt by standing in lava. Reset to zero when moving out of lava. */
int m_TicksSinceLastLavaDamage;
- /// Time, in ticks, since the last damage dealt by standing in fire. Reset to zero when moving out of fire.
+ /** Time, in ticks, since the last damage dealt by standing in fire. Reset to zero when moving out of fire. */
int m_TicksSinceLastFireDamage;
- /// Time, in ticks, until the entity extinguishes its fire
+ /** Time, in ticks, until the entity extinguishes its fire */
int m_TicksLeftBurning;
- /// Time, in ticks, since the last damage dealt by the void. Reset to zero when moving out of the void.
+ /** Time, in ticks, since the last damage dealt by the void. Reset to zero when moving out of the void. */
int m_TicksSinceLastVoidDamage;
/** Does the actual speed-setting. The default implementation just sets the member variable value;
diff --git a/src/Entities/ExpOrb.cpp b/src/Entities/ExpOrb.cpp
index db7f6f2c8..676370508 100644
--- a/src/Entities/ExpOrb.cpp
+++ b/src/Entities/ExpOrb.cpp
@@ -56,12 +56,12 @@ void cExpOrb::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
LOGD("Player %s picked up an ExpOrb. His reward is %i", a_ClosestPlayer->GetName().c_str(), m_Reward);
a_ClosestPlayer->DeltaExperience(m_Reward);
- m_World->BroadcastSoundEffect("random.orb", GetPosX(), GetPosY(), GetPosZ(), 0.5f, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64));
+ m_World->BroadcastSoundEffect("random.orb", GetPosX(), GetPosY(), GetPosZ(), 0.5f, (0.75f + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64));
Destroy();
}
a_Distance.Normalize();
- a_Distance *= ((float) (5.5 - Distance));
+ a_Distance *= (static_cast<float>(5.5 - Distance));
SetSpeedX( a_Distance.x);
SetSpeedY( a_Distance.y);
SetSpeedZ( a_Distance.z);
diff --git a/src/Entities/FallingBlock.cpp b/src/Entities/FallingBlock.cpp
index 4a165909a..bae13ea66 100644
--- a/src/Entities/FallingBlock.cpp
+++ b/src/Entities/FallingBlock.cpp
@@ -38,7 +38,7 @@ void cFallingBlock::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
// GetWorld()->BroadcastTeleportEntity(*this); // Test position
int BlockX = POSX_TOINT;
- int BlockY = (int)(GetPosY() - 0.5);
+ int BlockY = static_cast<int>(GetPosY() - 0.5);
int BlockZ = POSZ_TOINT;
if (BlockY < 0)
diff --git a/src/Entities/FireChargeEntity.cpp b/src/Entities/FireChargeEntity.cpp
index f6c665156..10d83b8dd 100644
--- a/src/Entities/FireChargeEntity.cpp
+++ b/src/Entities/FireChargeEntity.cpp
@@ -19,11 +19,11 @@ cFireChargeEntity::cFireChargeEntity(cEntity * a_Creator, double a_X, double a_Y
-void cFireChargeEntity::Explode(int a_BlockX, int a_BlockY, int a_BlockZ)
+void cFireChargeEntity::Explode(Vector3i a_Block)
{
- if (m_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ) == E_BLOCK_AIR)
+ if (m_World->GetBlock(a_Block) == E_BLOCK_AIR)
{
- m_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_FIRE, 1);
+ m_World->SetBlock(a_Block.x, a_Block.y, a_Block.z, E_BLOCK_FIRE, 1);
}
}
@@ -34,7 +34,7 @@ void cFireChargeEntity::Explode(int a_BlockX, int a_BlockY, int a_BlockZ)
void cFireChargeEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
Destroy();
- Explode((int)floor(a_HitPos.x), (int)floor(a_HitPos.y), (int)floor(a_HitPos.z));
+ Explode(a_HitPos.Floor());
}
@@ -44,7 +44,7 @@ void cFireChargeEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_
void cFireChargeEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
{
Destroy();
- Explode((int)floor(a_HitPos.x), (int)floor(a_HitPos.y), (int)floor(a_HitPos.z));
+ Explode(a_HitPos.Floor());
// TODO: Some entities are immune to hits
a_EntityHit.StartBurning(5 * 20); // 5 seconds of burning
diff --git a/src/Entities/FireChargeEntity.h b/src/Entities/FireChargeEntity.h
index eb08f5324..25f04cb7c 100644
--- a/src/Entities/FireChargeEntity.h
+++ b/src/Entities/FireChargeEntity.h
@@ -32,7 +32,7 @@ public:
protected:
- void Explode(int a_BlockX, int a_BlockY, int a_BlockZ);
+ void Explode(Vector3i a_Block);
// cProjectileEntity overrides:
virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
diff --git a/src/Entities/GhastFireballEntity.cpp b/src/Entities/GhastFireballEntity.cpp
index c64fb2a17..1adfd1bc0 100644
--- a/src/Entities/GhastFireballEntity.cpp
+++ b/src/Entities/GhastFireballEntity.cpp
@@ -19,9 +19,9 @@ cGhastFireballEntity::cGhastFireballEntity(cEntity * a_Creator, double a_X, doub
-void cGhastFireballEntity::Explode(int a_BlockX, int a_BlockY, int a_BlockZ)
+void cGhastFireballEntity::Explode(Vector3i a_Block)
{
- m_World->DoExplosionAt(1, a_BlockX, a_BlockY, a_BlockZ, true, esGhastFireball, this);
+ m_World->DoExplosionAt(1, a_Block.x, a_Block.y, a_Block.z, true, esGhastFireball, this);
}
@@ -31,7 +31,7 @@ void cGhastFireballEntity::Explode(int a_BlockX, int a_BlockY, int a_BlockZ)
void cGhastFireballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
Destroy();
- Explode((int)floor(a_HitPos.x), (int)floor(a_HitPos.y), (int)floor(a_HitPos.z));
+ Explode(a_HitPos.Floor());
}
@@ -41,5 +41,5 @@ void cGhastFireballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace
void cGhastFireballEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
{
Destroy();
- Explode((int)floor(a_HitPos.x), (int)floor(a_HitPos.y), (int)floor(a_HitPos.z));
+ Explode(a_HitPos.Floor());
}
diff --git a/src/Entities/GhastFireballEntity.h b/src/Entities/GhastFireballEntity.h
index bbce89d31..dc136dfc2 100644
--- a/src/Entities/GhastFireballEntity.h
+++ b/src/Entities/GhastFireballEntity.h
@@ -32,7 +32,7 @@ public:
protected:
- void Explode(int a_BlockX, int a_BlockY, int a_BlockZ);
+ void Explode(Vector3i a_Block);
// cProjectileEntity overrides:
virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
diff --git a/src/Entities/HangingEntity.h b/src/Entities/HangingEntity.h
index 9d783006c..003c22082 100644
--- a/src/Entities/HangingEntity.h
+++ b/src/Entities/HangingEntity.h
@@ -46,6 +46,9 @@ public:
protected:
+ Byte m_Facing;
+
+
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override
{
@@ -53,6 +56,7 @@ protected:
UNUSED(a_Chunk);
}
+
/** Converts protocol hanging item facing to eBlockFace values */
inline static eBlockFace ProtocolFaceToBlockFace(Byte a_ProtocolFace)
{
@@ -77,6 +81,7 @@ protected:
return Dir;
}
+
/** Converts eBlockFace values to protocol hanging item faces */
inline static Byte BlockFaceToProtocolFace(eBlockFace a_BlockFace)
{
@@ -89,21 +94,28 @@ protected:
case BLOCK_FACE_ZM: Dir = 2; break;
case BLOCK_FACE_XM: Dir = 1; break;
case BLOCK_FACE_XP: Dir = 3; break;
- default:
+ case BLOCK_FACE_YP:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_NONE:
{
// Uncomment when entities are initialised with their real data, instead of dummy values:
// LOGINFO("Invalid facing (%d) in a cHangingEntity, adjusting to BLOCK_FACE_XP.", a_BlockFace);
// ASSERT(!"Tried to convert a bad facing!");
Dir = cHangingEntity::BlockFaceToProtocolFace(BLOCK_FACE_XP);
+ break;
}
+ #if !defined(__clang__)
+ default:
+ {
+ ASSERT(!"Unknown BLOCK_FACE");
+ return 0;
+ }
+ #endif
}
return Dir;
}
-
- Byte m_Facing;
-
}; // tolua_export
diff --git a/src/Entities/ItemFrame.cpp b/src/Entities/ItemFrame.cpp
index 4e6e38f1f..6317eba85 100644
--- a/src/Entities/ItemFrame.cpp
+++ b/src/Entities/ItemFrame.cpp
@@ -62,7 +62,7 @@ void cItemFrame::KilledBy(TakeDamageInfo & a_TDI)
return;
}
- if ((a_TDI.Attacker != nullptr) && a_TDI.Attacker->IsPlayer() && !((cPlayer *)a_TDI.Attacker)->IsGameModeCreative())
+ if ((a_TDI.Attacker != nullptr) && a_TDI.Attacker->IsPlayer() && !static_cast<cPlayer *>(a_TDI.Attacker)->IsGameModeCreative())
{
cItems Item;
Item.push_back(m_Item);
@@ -83,7 +83,7 @@ void cItemFrame::KilledBy(TakeDamageInfo & a_TDI)
void cItemFrame::GetDrops(cItems & a_Items, cEntity * a_Killer)
{
- if ((a_Killer != nullptr) && a_Killer->IsPlayer() && !((cPlayer *)a_Killer)->IsGameModeCreative())
+ if ((a_Killer != nullptr) && a_Killer->IsPlayer() && !static_cast<cPlayer *>(a_Killer)->IsGameModeCreative())
{
a_Items.push_back(cItem(E_ITEM_ITEM_FRAME));
}
@@ -96,7 +96,7 @@ void cItemFrame::GetDrops(cItems & a_Items, cEntity * a_Killer)
void cItemFrame::SpawnOn(cClientHandle & a_ClientHandle)
{
super::SpawnOn(a_ClientHandle);
- a_ClientHandle.SendSpawnObject(*this, 71, GetProtocolFacing(), (Byte)GetYaw(), (Byte)GetPitch());
+ a_ClientHandle.SendSpawnObject(*this, 71, GetProtocolFacing(), static_cast<Byte>(GetYaw()), static_cast<Byte>(GetPitch()));
a_ClientHandle.SendEntityMetadata(*this);
}
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp
index b80759d24..7274a7a41 100644
--- a/src/Entities/Minecart.cpp
+++ b/src/Entities/Minecart.cpp
@@ -106,7 +106,7 @@ cMinecart::cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z) :
void cMinecart::SpawnOn(cClientHandle & a_ClientHandle)
{
- a_ClientHandle.SendSpawnVehicle(*this, 10, (char)m_Payload); // 10 = Minecarts
+ a_ClientHandle.SendSpawnVehicle(*this, 10, static_cast<char>(m_Payload)); // 10 = Minecarts
a_ClientHandle.SendEntityMetadata(*this);
}
@@ -725,11 +725,11 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta)
{
if (GetSpeedZ() > 0)
{
- BLOCKTYPE Block = m_World->GetBlock(POSX_TOINT, POSY_TOINT, (int)ceil(GetPosZ()));
+ BLOCKTYPE Block = m_World->GetBlock(POSX_TOINT, POSY_TOINT, static_cast<int>(ceil(GetPosZ())));
if (!IsBlockRail(Block) && cBlockInfo::IsSolid(Block))
{
// We could try to detect a block in front based purely on coordinates, but xoft made a bounding box system - why not use? :P
- cBoundingBox bbBlock(Vector3d(POSX_TOINT, POSY_TOINT, (int)ceil(GetPosZ())), 0.5, 1);
+ cBoundingBox bbBlock(Vector3d(POSX_TOINT, POSY_TOINT, static_cast<int>(ceil(GetPosZ()))), 0.5, 1);
cBoundingBox bbMinecart(Vector3d(GetPosX(), floor(GetPosY()), GetPosZ()), GetWidth() / 2, GetHeight());
if (bbBlock.DoesIntersect(bbMinecart))
@@ -762,10 +762,10 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta)
{
if (GetSpeedX() > 0)
{
- BLOCKTYPE Block = m_World->GetBlock((int)ceil(GetPosX()), POSY_TOINT, POSZ_TOINT);
+ BLOCKTYPE Block = m_World->GetBlock(static_cast<int>(ceil(GetPosX())), POSY_TOINT, POSZ_TOINT);
if (!IsBlockRail(Block) && cBlockInfo::IsSolid(Block))
{
- cBoundingBox bbBlock(Vector3d((int)ceil(GetPosX()), POSY_TOINT, POSZ_TOINT), 0.5, 1);
+ cBoundingBox bbBlock(Vector3d(static_cast<int>(ceil(GetPosX())), POSY_TOINT, POSZ_TOINT), 0.5, 1);
cBoundingBox bbMinecart(Vector3d(GetPosX(), floor(GetPosY()), GetPosZ()), GetWidth() / 2, GetHeight());
if (bbBlock.DoesIntersect(bbMinecart))
@@ -1003,7 +1003,7 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
bool cMinecart::DoTakeDamage(TakeDamageInfo & TDI)
{
- if ((TDI.Attacker != nullptr) && TDI.Attacker->IsPlayer() && ((cPlayer *)TDI.Attacker)->IsGameModeCreative())
+ if ((TDI.Attacker != nullptr) && TDI.Attacker->IsPlayer() && static_cast<cPlayer *>(TDI.Attacker)->IsGameModeCreative())
{
Destroy();
TDI.FinalDamage = GetMaxHealth(); // Instant hit for creative
@@ -1051,11 +1051,6 @@ bool cMinecart::DoTakeDamage(TakeDamageInfo & TDI)
Drops.push_back(cItem(E_ITEM_MINECART_WITH_HOPPER, 1, 0));
break;
}
- default:
- {
- ASSERT(!"Unhandled minecart type when spawning pickup!");
- return true;
- }
}
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ());
diff --git a/src/Entities/Minecart.h b/src/Entities/Minecart.h
index d1736e9b9..05eaf16e9 100644
--- a/src/Entities/Minecart.h
+++ b/src/Entities/Minecart.h
@@ -135,7 +135,7 @@ protected:
virtual void Destroyed() override;
// cItemGrid::cListener overrides:
- virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum)
+ virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum) override
{
UNUSED(a_SlotNum);
ASSERT(a_Grid == &m_Contents);
diff --git a/src/Entities/Painting.cpp b/src/Entities/Painting.cpp
index 02a8f6ed0..d73c2a245 100644
--- a/src/Entities/Painting.cpp
+++ b/src/Entities/Painting.cpp
@@ -33,7 +33,7 @@ void cPainting::SpawnOn(cClientHandle & a_Client)
void cPainting::GetDrops(cItems & a_Items, cEntity * a_Killer)
{
- if ((a_Killer != nullptr) && a_Killer->IsPlayer() && !((cPlayer *)a_Killer)->IsGameModeCreative())
+ if ((a_Killer != nullptr) && a_Killer->IsPlayer() && !static_cast<cPlayer *>(a_Killer)->IsGameModeCreative())
{
a_Items.push_back(cItem(E_ITEM_PAINTING));
}
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index fcb686e28..2cd0f2f0e 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -75,10 +75,10 @@ void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, int a_Duration, s
{
return;
}
- a_Duration = (int)(a_Duration * a_DistanceModifier);
+ a_Duration = static_cast<int>(a_Duration * a_DistanceModifier);
m_EntityEffects[a_EffectType] = cEntityEffect::CreateEntityEffect(a_EffectType, a_Duration, a_Intensity, a_DistanceModifier);
- m_World->BroadcastEntityEffect(*this, a_EffectType, a_Intensity, a_Duration);
+ m_World->BroadcastEntityEffect(*this, a_EffectType, a_Intensity, static_cast<short>(a_Duration));
m_EntityEffects[a_EffectType]->OnActivate(*this);
}
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index f2f76dbf9..e4576a8f2 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -38,7 +38,7 @@ public:
Vector3d EntityPos = a_Entity->GetPosition();
double Distance = (EntityPos - m_Position).Length();
- cItem & Item = ((cPickup *)a_Entity)->GetItem();
+ cItem & Item = static_cast<cPickup *>(a_Entity)->GetItem();
if ((Distance < 1.2) && Item.IsEqual(m_Pickup->GetItem()))
{
short CombineCount = Item.m_ItemCount;
@@ -52,7 +52,7 @@ public:
return false;
}
- m_Pickup->GetItem().AddCount((char)CombineCount);
+ m_Pickup->GetItem().AddCount(static_cast<char>(CombineCount));
Item.m_ItemCount -= CombineCount;
if (Item.m_ItemCount <= 0)
@@ -228,8 +228,9 @@ bool cPickup::CollectedBy(cPlayer & a_Dest)
m_Item.m_ItemCount -= NumAdded;
m_World->BroadcastCollectEntity(*this, a_Dest);
+
// Also send the "pop" sound effect with a somewhat random pitch (fast-random using EntityID ;)
- m_World->BroadcastSoundEffect("random.pop", GetPosX(), GetPosY(), GetPosZ(), 0.5, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64));
+ m_World->BroadcastSoundEffect("random.pop", GetPosX(), GetPosY(), GetPosZ(), 0.5, (0.75f + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64));
if (m_Item.m_ItemCount <= 0)
{
// All of the pickup has been collected, schedule the pickup for destroying
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 607a663de..3e1e2b7ea 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -16,6 +16,7 @@
#include "../Items/ItemHandler.h"
#include "../Vector3.h"
#include "../FastRandom.h"
+#include <cmath>
#include "../WorldStorage/StatSerializer.h"
#include "../CompositeChat.h"
@@ -94,7 +95,7 @@ cPlayer::cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName) :
SetMaxHealth(MAX_HEALTH);
m_Health = MAX_HEALTH;
-
+
m_LastPlayerListTime = std::chrono::steady_clock::now();
m_PlayerName = a_PlayerName;
@@ -106,7 +107,7 @@ cPlayer::cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName) :
SetPosY(World->GetSpawnY());
SetPosZ(World->GetSpawnZ());
SetBedPos(Vector3i(static_cast<int>(World->GetSpawnX()), static_cast<int>(World->GetSpawnY()), static_cast<int>(World->GetSpawnZ())));
-
+
LOGD("Player \"%s\" is connecting for the first time, spawning at default world spawn {%.2f, %.2f, %.2f}",
a_PlayerName.c_str(), GetPosX(), GetPosY(), GetPosZ()
);
@@ -128,7 +129,14 @@ cPlayer::cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName) :
m_IsFlying = true;
}
}
-
+
+ if (m_GameMode == gmSpectator) // If player is reconnecting to the server in spectator mode
+ {
+ m_CanFly = true;
+ m_IsFlying = true;
+ m_bVisible = false;
+ }
+
cRoot::Get()->GetServer()->PlayerCreated(this);
}
@@ -145,17 +153,17 @@ cPlayer::~cPlayer(void)
}
LOGD("Deleting cPlayer \"%s\" at %p, ID %d", GetName().c_str(), this, GetUniqueID());
-
+
// Notify the server that the player is being destroyed
cRoot::Get()->GetServer()->PlayerDestroying(this);
SaveToDisk();
m_ClientHandle = nullptr;
-
+
delete m_InventoryWindow;
m_InventoryWindow = nullptr;
-
+
LOGD("Player %p deleted", this);
}
@@ -201,7 +209,7 @@ void cPlayer::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
m_ClientHandle = nullptr;
return;
}
-
+
if (!m_ClientHandle->IsPlaying())
{
// We're not yet in the game, ignore everything
@@ -210,21 +218,21 @@ void cPlayer::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
}
m_Stats.AddValue(statMinutesPlayed, 1);
-
+
if (!a_Chunk.IsValid())
{
// This may happen if the cPlayer is created before the chunks have the chance of being loaded / generated (#83)
return;
}
-
+
super::Tick(a_Dt, a_Chunk);
-
+
// Handle charging the bow:
if (m_IsChargingBow)
{
m_BowCharge += 1;
}
-
+
// Handle updating experience
if (m_bDirtyExperience)
{
@@ -236,7 +244,7 @@ void cPlayer::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
// Apply food exhaustion from movement:
ApplyFoodExhaustionFromMovement();
-
+
if (cRoot::Get()->GetPluginManager()->CallHookPlayerMoving(*this, m_LastPos, GetPosition()))
{
CanMove = false;
@@ -257,10 +265,10 @@ void cPlayer::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
FinishEating();
}
-
+
HandleFood();
}
-
+
if (m_IsFishing)
{
HandleFloater();
@@ -460,7 +468,7 @@ void cPlayer::SetTouchGround(bool a_bTouchGround)
{
return;
}
-
+
m_bTouchGround = a_bTouchGround;
if (!m_bTouchGround)
@@ -509,7 +517,7 @@ void cPlayer::SetTouchGround(bool a_bTouchGround)
{
// cPlayer makes sure damage isn't applied in creative, no need to check here
TakeDamage(dtFalling, nullptr, Damage, Damage, 0);
-
+
// Fall particles
GetWorld()->BroadcastSoundParticleEffect(2006, POSX_TOINT, static_cast<int>(GetPosY()) - 1, POSZ_TOINT, Damage /* Used as particle effect speed modifier */);
}
@@ -541,7 +549,7 @@ void cPlayer::SetFoodLevel(int a_FoodLevel)
m_FoodSaturationLevel = 5.0;
return;
}
-
+
m_FoodLevel = FoodLevel;
SendHealth();
}
@@ -609,7 +617,7 @@ void cPlayer::StartEating(void)
{
// Set the timer:
m_EatingFinishTick = m_World->GetWorldAge() + EATING_TICKS;
-
+
// Send the packets:
m_World->BroadcastEntityAnimation(*this, 3);
m_World->BroadcastEntityMetadata(*this);
@@ -623,7 +631,7 @@ void cPlayer::FinishEating(void)
{
// Reset the timer:
m_EatingFinishTick = -1;
-
+
// Send the packets:
m_ClientHandle->SendEntityStatus(*this, esPlayerEatingAccepted);
m_World->BroadcastEntityMetadata(*this);
@@ -757,7 +765,7 @@ void cPlayer::SetSprintingMaxSpeed(double a_Speed)
void cPlayer::SetFlyingMaxSpeed(double a_Speed)
{
m_FlyingMaxSpeed = a_Speed;
-
+
// Update the flying speed, always:
m_ClientHandle->SendPlayerAbilities();
}
@@ -769,7 +777,7 @@ void cPlayer::SetFlyingMaxSpeed(double a_Speed)
void cPlayer::SetCrouch(bool a_IsCrouched)
{
// Set the crouch status, broadcast to all visible players
-
+
if (a_IsCrouched == m_IsCrouched)
{
// No change
@@ -790,7 +798,7 @@ void cPlayer::SetSprint(bool a_IsSprinting)
// No change
return;
}
-
+
m_IsSprinting = a_IsSprinting;
m_ClientHandle->SendPlayerMaxSpeed();
}
@@ -876,7 +884,7 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI)
}
}
}
-
+
if (super::DoTakeDamage(a_TDI))
{
// Any kind of damage adds food exhaustion
@@ -913,11 +921,11 @@ void cPlayer::KilledBy(TakeDamageInfo & a_TDI)
{
Pickups.Add(cItem(E_ITEM_RED_APPLE));
}
-
m_Stats.AddValue(statItemsDropped, (StatValue)Pickups.Size());
m_World->SpawnItemPickups(Pickups, GetPosX(), GetPosY(), GetPosZ(), 10);
SaveToDisk(); // Save it, yeah the world is a tough place !
+ cPluginManager * PluginManager = cRoot::Get()->GetPluginManager();
if ((a_TDI.Attacker == nullptr) && m_World->ShouldBroadcastDeathMessages())
{
@@ -943,7 +951,12 @@ void cPlayer::KilledBy(TakeDamageInfo & a_TDI)
case dtExplosion: DamageText = "blew up"; break;
default: DamageText = "died, somehow; we've no idea how though"; break;
}
- GetWorld()->BroadcastChatDeath(Printf("%s %s", GetName().c_str(), DamageText.c_str()));
+ AString DeathMessage = Printf("%s %s", GetName().c_str(), DamageText.c_str());
+ PluginManager->CallHookKilled(*this, a_TDI, DeathMessage);
+ if (DeathMessage != AString(""))
+ {
+ GetWorld()->BroadcastChatDeath(DeathMessage);
+ }
}
else if (a_TDI.Attacker == nullptr) // && !m_World->ShouldBroadcastDeathMessages() by fallthrough
{
@@ -952,15 +965,23 @@ void cPlayer::KilledBy(TakeDamageInfo & a_TDI)
else if (a_TDI.Attacker->IsPlayer())
{
cPlayer * Killer = (cPlayer *)a_TDI.Attacker;
-
- GetWorld()->BroadcastChatDeath(Printf("%s was killed by %s", GetName().c_str(), Killer->GetName().c_str()));
+ AString DeathMessage = Printf("%s was killed by %s", GetName().c_str(), Killer->GetName().c_str());
+ PluginManager->CallHookKilled(*this, a_TDI, DeathMessage);
+ if (DeathMessage != AString(""))
+ {
+ GetWorld()->BroadcastChatDeath(DeathMessage);
+ }
}
else
{
AString KillerClass = a_TDI.Attacker->GetClass();
KillerClass.erase(KillerClass.begin()); // Erase the 'c' of the class (e.g. "cWitch" -> "Witch")
-
- GetWorld()->BroadcastChatDeath(Printf("%s was killed by a %s", GetName().c_str(), KillerClass.c_str()));
+ AString DeathMessage = Printf("%s was killed by a %s", GetName().c_str(), KillerClass.c_str());
+ PluginManager->CallHookKilled(*this, a_TDI, DeathMessage);
+ if (DeathMessage != AString(""))
+ {
+ GetWorld()->BroadcastChatDeath(DeathMessage);
+ }
}
m_Stats.AddValue(statDeaths);
@@ -1005,7 +1026,7 @@ void cPlayer::Respawn(void)
m_Health = GetMaxHealth();
SetInvulnerableTicks(20);
-
+
// Reset food level:
m_FoodLevel = MAX_FOOD_LEVEL;
m_FoodSaturationLevel = 5.0;
@@ -1017,7 +1038,7 @@ void cPlayer::Respawn(void)
// ToDo: send score to client? How?
m_ClientHandle->SendRespawn(GetWorld()->GetDimension(), true);
-
+
// Extinguish the fire:
StopBurning();
@@ -1151,7 +1172,7 @@ void cPlayer::CloseWindow(bool a_CanRefuse)
m_CurrentWindow = m_InventoryWindow;
return;
}
-
+
if (m_CurrentWindow->ClosedByPlayer(*this, a_CanRefuse) || !a_CanRefuse)
{
// Close accepted, go back to inventory window (the default):
@@ -1189,21 +1210,17 @@ void cPlayer::SetGameMode(eGameMode a_GameMode)
LOGWARNING("%s: Setting invalid gamemode: %d", GetName().c_str(), a_GameMode);
return;
}
-
+
if (m_GameMode == a_GameMode)
{
// Gamemode already set
return;
}
-
+
m_GameMode = a_GameMode;
m_ClientHandle->SendGameMode(a_GameMode);
- if (!(IsGameModeCreative() || IsGameModeSpectator()))
- {
- SetFlying(false);
- SetCanFly(false);
- }
+ SetCapabilities();
m_World->BroadcastPlayerListUpdateGameMode(*this);
}
@@ -1215,6 +1232,30 @@ void cPlayer::SetGameMode(eGameMode a_GameMode)
void cPlayer::LoginSetGameMode( eGameMode a_GameMode)
{
m_GameMode = a_GameMode;
+
+ SetCapabilities();
+}
+
+
+
+
+
+void cPlayer::SetCapabilities()
+{
+ if (!IsGameModeCreative() || IsGameModeSpectator())
+ {
+ SetFlying(false);
+ SetCanFly(false);
+ }
+
+ if (IsGameModeSpectator())
+ {
+ SetVisible(false);
+ }
+ else
+ {
+ SetVisible(true);
+ }
}
@@ -1306,12 +1347,12 @@ void cPlayer::SendRotation(double a_YawDegrees, double a_PitchDegrees)
Vector3d cPlayer::GetThrowStartPos(void) const
{
Vector3d res = GetEyePosition();
-
+
// Adjust the position to be just outside the player's bounding box:
res.x += 0.16 * cos(GetPitch());
res.y += -0.1;
res.z += 0.16 * sin(GetPitch());
-
+
return res;
}
@@ -1323,9 +1364,9 @@ Vector3d cPlayer::GetThrowSpeed(double a_SpeedCoeff) const
{
Vector3d res = GetLookVector();
res.Normalize();
-
+
// TODO: Add a slight random change (+-0.0075 in each direction)
-
+
return res * a_SpeedCoeff;
}
@@ -1370,13 +1411,13 @@ void cPlayer::MoveTo( const Vector3d & a_NewPos)
}
return;
}
-
+
// TODO: should do some checks to see if player is not moving through terrain
// TODO: Official server refuses position packets too far away from each other, kicking "hacked" clients; we should, too
Vector3d DeltaPos = a_NewPos - GetPosition();
UpdateMovementStats(DeltaPos);
-
+
SetPosition( a_NewPos);
SetStance(a_NewPos.y + 1.62);
}
@@ -1411,7 +1452,7 @@ bool cPlayer::HasPermission(const AString & a_Permission)
// Empty permission request is always granted
return true;
}
-
+
AStringVector Split = StringSplit(a_Permission, ".");
// Iterate over all restrictions; if any matches, then return failure:
@@ -1583,7 +1624,7 @@ void cPlayer::TossItems(const cItems & a_Items)
{
return;
}
-
+
m_Stats.AddValue(statItemsDropped, (StatValue)a_Items.Size());
double vX = 0, vY = 0, vZ = 0;
@@ -1593,10 +1634,7 @@ void cPlayer::TossItems(const cItems & a_Items)
}
-
-
-
-bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
+bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition)
{
ASSERT(a_World != nullptr);
@@ -1605,7 +1643,14 @@ bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
// Don't move to same world
return false;
}
-
+
+ // Ask the plugins if the player is allowed to changing the world
+ if (cRoot::Get()->GetPluginManager()->CallHookEntityChangingWorld(*this, *a_World))
+ {
+ // A Plugin doesn't allow the player to changing the world
+ return false;
+ }
+
// Send the respawn packet:
if (a_ShouldSendRespawn && (m_ClientHandle != nullptr))
{
@@ -1619,8 +1664,11 @@ bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
SetWorldTravellingFrom(GetWorld()); // cChunk handles entity removal
GetWorld()->RemovePlayer(this, false);
+ SetPosition(a_NewPosition);
+
// Queue adding player to the new world, including all the necessary adjustments to the object
a_World->AddPlayer(this);
+ cWorld * OldWorld = cRoot::Get()->GetWorld(GetWorld()->GetName()); // Required for the hook HOOK_ENTITY_CHANGED_WORLD
SetWorld(a_World); // Chunks may be streamed before cWorld::AddPlayer() sets the world to the new value
// Update the view distance.
@@ -1634,7 +1682,10 @@ bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn)
// Broadcast the player into the new world.
a_World->BroadcastSpawnEntity(*this);
-
+
+ // Player changed the world, call the hook
+ cRoot::Get()->GetPluginManager()->CallHookEntityChangedWorld(*this, *OldWorld);
+
return true;
}
@@ -1651,7 +1702,7 @@ bool cPlayer::LoadFromDisk(cWorldPtr & a_World)
{
return true;
}
-
+
// Load from the offline UUID file, if allowed:
AString OfflineUUID = cClientHandle::GenerateOfflineUUID(GetName());
const char * OfflineUsage = " (unused)";
@@ -1663,7 +1714,7 @@ bool cPlayer::LoadFromDisk(cWorldPtr & a_World)
return true;
}
}
-
+
// Load from the old-style name-based file, if allowed:
if (cRoot::Get()->GetServer()->ShouldLoadNamedPlayerData())
{
@@ -1678,7 +1729,7 @@ bool cPlayer::LoadFromDisk(cWorldPtr & a_World)
return true;
}
}
-
+
// None of the files loaded successfully
LOG("Player data file not found for %s (%s, offline %s%s), will be reset to defaults.",
GetName().c_str(), m_UUID.c_str(), OfflineUUID.c_str(), OfflineUsage
@@ -1755,7 +1806,7 @@ bool cPlayer::LoadFromFile(const AString & a_FileName, cWorldPtr & a_World)
{
m_CanFly = true;
}
-
+
m_Inventory.LoadFromJson(root["inventory"]);
cEnderChestEntity::LoadFromJson(root["enderchestinventory"], m_EnderChestContents);
@@ -1774,11 +1825,11 @@ bool cPlayer::LoadFromFile(const AString & a_FileName, cWorldPtr & a_World)
// We use the default world name (like bukkit) because stats are shared between dimensions / worlds.
cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats);
StatSerializer.Load();
-
+
LOGD("Player %s was read from file \"%s\", spawning at {%.2f, %.2f, %.2f} in world \"%s\"",
GetName().c_str(), a_FileName.c_str(), GetPosX(), GetPosY(), GetPosZ(), a_World->GetName().c_str()
);
-
+
return true;
}
@@ -2128,20 +2179,18 @@ void cPlayer::ApplyFoodExhaustionFromMovement()
return;
}
- // Process exhaustion every two ticks as that is how frequently m_LastPos is updated
- // Otherwise, we apply exhaustion for a 'movement' every tick, one of which is an already processed value
- if (GetWorld()->GetWorldAge() % 2 != 0)
- {
- return;
- }
-
// Calculate the distance travelled, update the last pos:
- Vector3d Movement(GetPosition() - m_LastPos);
- Movement.y = 0; // Only take XZ movement into account
+ double SpeedX = m_Speed.x;
+ double SpeedZ = m_Speed.z;
+ double BaseExhaustion(sqrt((SpeedX * SpeedX) + (SpeedZ * SpeedZ)));
// Apply the exhaustion based on distance travelled:
- double BaseExhaustion = Movement.Length();
- if (IsSprinting())
+ if (IsFlying() || IsClimbing())
+ {
+ // Apply no exhaustion when flying or climbing.
+ BaseExhaustion = 0;
+ }
+ else if (IsSprinting())
{
// 0.1 pt per meter sprinted
BaseExhaustion = BaseExhaustion * 0.1;
@@ -2337,7 +2386,7 @@ AString cPlayer::GetUUIDFileName(const AString & a_UUID)
{
AString UUID = cMojangAPI::MakeUUIDDashed(a_UUID);
ASSERT(UUID.length() == 36);
-
+
AString res("players/");
res.append(UUID, 0, 2);
res.push_back('/');
@@ -2345,7 +2394,3 @@ AString cPlayer::GetUUIDFileName(const AString & a_UUID)
res.append(".json");
return res;
}
-
-
-
-
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index a0cd9b1d6..dffb61677 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -26,42 +26,42 @@ class cPlayer :
public cPawn
{
typedef cPawn super;
-
+
public:
static const int MAX_HEALTH;
-
+
static const int MAX_FOOD_LEVEL;
-
+
/** Number of ticks it takes to eat an item */
static const int EATING_TICKS;
-
+
// tolua_end
-
+
CLASS_PROTODEF(cPlayer)
-
+
cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName);
-
+
virtual ~cPlayer();
virtual void SpawnOn(cClientHandle & a_Client) override;
-
+
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk &) override { UNUSED(a_Dt); }
/** Returns the curently equipped weapon; empty item if none */
virtual cItem GetEquippedWeapon(void) const override { return m_Inventory.GetEquippedItem(); }
-
+
/** Returns the currently equipped helmet; empty item if none */
virtual cItem GetEquippedHelmet(void) const override { return m_Inventory.GetEquippedHelmet(); }
-
+
/** Returns the currently equipped chestplate; empty item if none */
virtual cItem GetEquippedChestplate(void) const override { return m_Inventory.GetEquippedChestplate(); }
/** Returns the currently equipped leggings; empty item if none */
virtual cItem GetEquippedLeggings(void) const override { return m_Inventory.GetEquippedLeggings(); }
-
+
/** Returns the currently equipped boots; empty item if none */
virtual cItem GetEquippedBoots(void) const override { return m_Inventory.GetEquippedBoots(); }
@@ -104,16 +104,16 @@ public:
static int CalcLevelFromXp(int a_CurrentXp);
// tolua_end
-
+
/** Starts charging the equipped bow */
void StartChargingBow(void);
-
+
/** Finishes charging the current bow. Returns the number of ticks for which the bow has been charged */
int FinishChargingBow(void);
-
+
/** Cancels the current bow charging */
void CancelChargingBow(void);
-
+
/** Returns true if the player is currently charging the bow */
bool IsChargingBow(void) const { return m_IsChargingBow; }
@@ -128,7 +128,7 @@ public:
/** Gets the contents of the player's associated enderchest */
cItemGrid & GetEnderChestContents(void) { return m_EnderChestContents; }
-
+
inline const cItem & GetEquippedItem(void) const { return GetInventory().GetEquippedItem(); } // tolua_export
/** Returns whether the player is climbing (ladders, vines etc.) */
@@ -137,43 +137,49 @@ public:
virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) override;
// tolua_begin
-
+
/** Sends the "look" packet to the player, forcing them to set their rotation to the specified values.
a_YawDegrees is clipped to range [-180, +180),
a_PitchDegrees is clipped to range [-180, +180) but the client only uses [-90, +90]
*/
void SendRotation(double a_YawDegrees, double a_PitchDegrees);
-
+
/** Returns the position where projectiles thrown by this player should start, player eye position + adjustment */
Vector3d GetThrowStartPos(void) const;
-
+
/** Returns the initial speed vector of a throw, with a 3D length of a_SpeedCoeff. */
Vector3d GetThrowSpeed(double a_SpeedCoeff) const;
-
+
/** Returns the current gamemode. Partly OBSOLETE, you should use IsGameModeXXX() functions wherever applicable */
eGameMode GetGameMode(void) const { return m_GameMode; }
-
+
/** Returns the current effective gamemode (inherited gamemode is resolved before returning) */
eGameMode GetEffectiveGameMode(void) const { return (m_GameMode == gmNotSet) ? m_World->GetGameMode() : m_GameMode; }
-
+
/** Sets the gamemode for the player.
The gamemode may be gmNotSet, in that case the player inherits the world's gamemode.
Updates the gamemode on the client (sends the packet)
*/
void SetGameMode(eGameMode a_GameMode);
+ // Sets the current gamemode, doesn't check validity, doesn't send update packets to client
+ void LoginSetGameMode(eGameMode a_GameMode);
+
+ // Updates player's capabilities - flying, visibility, etc. from their gamemode.
+ void SetCapabilities();
+
/** Returns true if the player is in Creative mode, either explicitly, or by inheriting from current world */
bool IsGameModeCreative(void) const;
-
+
/** Returns true if the player is in Survival mode, either explicitly, or by inheriting from current world */
bool IsGameModeSurvival(void) const;
-
+
/** Returns true if the player is in Adventure mode, either explicitly, or by inheriting from current world */
bool IsGameModeAdventure(void) const;
-
+
/** Returns true if the player is in Spectator mode, either explicitly, or by inheriting from current world */
bool IsGameModeSpectator(void) const;
-
+
AString GetIP(void) const { return m_IP; } // tolua_export
/** Returns the associated team, nullptr if none */
@@ -195,11 +201,8 @@ public:
If the achievement has been already awarded to the player, this method will just increment the stat counter.
Returns the _new_ stat value. (0 = Could not award achievement) */
unsigned int AwardAchievement(const eStatistic a_Ach);
-
+
void SetIP(const AString & a_IP);
-
- // Sets the current gamemode, doesn't check validity, doesn't send update packets to client
- void LoginSetGameMode(eGameMode a_GameMode);
/** Forces the player to move in the given direction.
@deprecated Use SetSpeed instead. */
@@ -210,15 +213,15 @@ public:
cWindow * GetWindow(void) { return m_CurrentWindow; } // tolua_export
const cWindow * GetWindow(void) const { return m_CurrentWindow; }
-
+
/** Opens the specified window; closes the current one first using CloseWindow() */
void OpenWindow(cWindow * a_Window); // Exported in ManualBindings.cpp
-
+
// tolua_begin
-
+
/** Closes the current window, resets current window to m_InventoryWindow. A plugin may refuse the closing if a_CanRefuse is true */
void CloseWindow(bool a_CanRefuse = true);
-
+
/** Closes the current window if it matches the specified ID, resets current window to m_InventoryWindow */
void CloseWindowIfID(char a_WindowID, bool a_CanRefuse = true);
@@ -232,18 +235,23 @@ public:
// tolua_begin
- void SendMessage (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtCustom); }
- void SendMessageInfo (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtInformation); }
- void SendMessageFailure (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtFailure); }
- void SendMessageSuccess (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtSuccess); }
- void SendMessageWarning (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtWarning); }
- void SendMessageFatal (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtFailure); }
- void SendMessagePrivateMsg(const AString & a_Message, const AString & a_Sender) { m_ClientHandle->SendChat(a_Message, mtPrivateMessage, a_Sender); }
- void SendMessage (const cCompositeChat & a_Message) { m_ClientHandle->SendChat(a_Message); }
+ void SendMessage (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtCustom); }
+ void SendMessageInfo (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtInformation); }
+ void SendMessageFailure (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtFailure); }
+ void SendMessageSuccess (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtSuccess); }
+ void SendMessageWarning (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtWarning); }
+ void SendMessageFatal (const AString & a_Message) { m_ClientHandle->SendChat(a_Message, mtFailure); }
+ void SendMessagePrivateMsg (const AString & a_Message, const AString & a_Sender) { m_ClientHandle->SendChat(a_Message, mtPrivateMessage, a_Sender); }
+ void SendMessage (const cCompositeChat & a_Message) { m_ClientHandle->SendChat(a_Message); }
+
+ void SendSystemMessage (const AString & a_Message) { m_ClientHandle->SendChatSystem(a_Message, mtCustom); }
+ void SendAboveActionBarMessage(const AString & a_Message) { m_ClientHandle->SendChatAboveActionBar(a_Message, mtCustom); }
+ void SendSystemMessage (const cCompositeChat & a_Message) { m_ClientHandle->SendChatSystem(a_Message); }
+ void SendAboveActionBarMessage(const cCompositeChat & a_Message) { m_ClientHandle->SendChatAboveActionBar(a_Message); }
const AString & GetName(void) const { return m_PlayerName; }
void SetName(const AString & a_Name) { m_PlayerName = a_Name; }
-
+
// tolua_end
bool HasPermission(const AString & a_Permission); // tolua_export
@@ -260,7 +268,7 @@ public:
const AStringVector & GetRestrictions(void) const { return m_Restrictions; } // Exported in ManualBindings.cpp
// tolua_begin
-
+
/** Returns the full color code to use for this player, based on their rank.
The returned value either is empty, or includes the cChatColor::Delimiter. */
AString GetColor(void) const;
@@ -279,15 +287,15 @@ public:
/** Heals the player by the specified amount of HPs (positive only); sends health update */
virtual void Heal(int a_Health) override;
-
+
int GetFoodLevel (void) const { return m_FoodLevel; }
double GetFoodSaturationLevel (void) const { return m_FoodSaturationLevel; }
int GetFoodTickTimer (void) const { return m_FoodTickTimer; }
double GetFoodExhaustionLevel (void) const { return m_FoodExhaustionLevel; }
-
+
/** Returns true if the player is satiated, i. e. their foodlevel is at the max and they cannot eat anymore */
bool IsSatiated(void) const { return (m_FoodLevel >= MAX_FOOD_LEVEL); }
-
+
void SetFoodLevel (int a_FoodLevel);
void SetFoodSaturationLevel (double a_FoodSaturationLevel);
void SetFoodTickTimer (int a_FoodTickTimer);
@@ -298,10 +306,10 @@ public:
/** Adds the specified exhaustion to m_FoodExhaustion. Expects only positive values. */
void AddFoodExhaustion(double a_Exhaustion);
-
+
/** Returns true if the player is currently in the process of eating the currently equipped item */
bool IsEating(void) const { return (m_EatingFinishTick >= 0); }
-
+
/** Returns true if the player is currently flying. */
bool IsFlying(void) const { return m_IsFlying; }
@@ -329,16 +337,16 @@ public:
GetWorld()->BroadcastEntityAnimation(*this, 2);
}
}
-
+
/** Starts eating the currently equipped item. Resets the eating timer and sends the proper animation packet */
void StartEating(void);
-
+
/** Finishes eating the currently equipped item. Consumes the item, updates health and broadcasts the packets */
void FinishEating(void);
-
+
/** Aborts the current eating operation */
void AbortEating(void);
-
+
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
virtual void Killed(cEntity * a_Victim) override;
@@ -350,75 +358,75 @@ public:
/** Moves the player to the specified world.
Returns true if successful, false on failure (world not found). */
- virtual bool DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn) override;
+ virtual bool DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition) override;
/** Saves all player data, such as inventory, to JSON */
bool SaveToDisk(void);
typedef cWorld * cWorldPtr;
-
+
/** Loads the player data from the disk file
Sets a_World to the world where the player will spawn, based on the stored world name or the default world by calling LoadFromFile()
Returns true on success, false on failure
*/
bool LoadFromDisk(cWorldPtr & a_World);
-
+
/** Loads the player data from the specified file
Sets a_World to the world where the player will spawn, based on the stored world name or the default world
Returns true on success, false on failure
*/
bool LoadFromFile(const AString & a_FileName, cWorldPtr & a_World);
-
+
const AString & GetLoadedWorldName() { return m_LoadedWorldName; }
void UseEquippedItem(int a_Amount = 1);
-
+
void SendHealth(void);
void SendExperience(void);
-
+
/** In UI windows, get the item that the player is dragging */
cItem & GetDraggingItem(void) {return m_DraggingItem; }
-
+
// In UI windows, when inventory-painting:
/** Clears the list of slots that are being inventory-painted. To be used by cWindow only */
void ClearInventoryPaintSlots(void);
-
+
/** Adds a slot to the list for inventory painting. To be used by cWindow only */
void AddInventoryPaintSlot(int a_SlotNum);
-
+
/** Returns the list of slots currently stored for inventory painting. To be used by cWindow only */
const cSlotNums & GetInventoryPaintSlots(void) const;
-
+
// tolua_begin
-
+
/** Returns the current relative maximum speed (takes current sprinting / flying state into account) */
double GetMaxSpeed(void) const;
-
+
/** Gets the normal relative maximum speed */
double GetNormalMaxSpeed(void) const { return m_NormalMaxSpeed; }
-
+
/** Gets the sprinting relative maximum speed */
double GetSprintingMaxSpeed(void) const { return m_SprintingMaxSpeed; }
-
+
/** Gets the flying relative maximum speed */
double GetFlyingMaxSpeed(void) const { return m_FlyingMaxSpeed; }
-
+
/** Sets the normal relative maximum speed. Sends the update to player, if needed. */
void SetNormalMaxSpeed(double a_Speed);
-
+
/** Sets the sprinting relative maximum speed. Sends the update to player, if needed. */
void SetSprintingMaxSpeed(double a_Speed);
-
+
/** Sets the flying relative maximum speed. Sends the update to player, if needed. */
void SetFlyingMaxSpeed(double a_Speed);
-
+
/** Sets the crouch status, broadcasts to all visible players */
void SetCrouch(bool a_IsCrouched);
-
+
/** Starts or stops sprinting, sends the max speed update to the client, if needed */
void SetSprint(bool a_IsSprinting);
-
+
/** Flags the player as flying */
void SetFlying(bool a_IsFlying);
@@ -442,17 +450,17 @@ public:
/** Sets the player's bed (home) position */
void SetBedPos(const Vector3i & a_Pos) { m_LastBedPos = a_Pos; }
-
+
// tolua_end
/** Update movement-related statistics. */
void UpdateMovementStats(const Vector3d & a_DeltaPos);
-
+
// tolua_begin
/** Returns wheter the player can fly or not. */
virtual bool CanFly(void) const { return m_CanFly; }
-
+
/** Returns the UUID (short format) that has been read from the client, or empty string if not available. */
const AString & GetUUID(void) const { return m_UUID; }
@@ -483,16 +491,16 @@ public:
bool PlaceBlocks(const sSetBlockVector & a_Blocks);
// cEntity overrides:
- virtual bool IsCrouched (void) const { return m_IsCrouched; }
- virtual bool IsSprinting(void) const { return m_IsSprinting; }
- virtual bool IsRclking (void) const { return IsEating() || IsChargingBow(); }
+ virtual bool IsCrouched (void) const override { return m_IsCrouched; }
+ virtual bool IsSprinting(void) const override { return m_IsSprinting; }
+ virtual bool IsRclking (void) const override { return IsEating() || IsChargingBow(); }
- virtual void Detach(void);
+ virtual void Detach(void) override;
/** Called by cClientHandle when the client is being destroyed.
The player removes its m_ClientHandle ownership so that the ClientHandle gets deleted. */
void RemoveClientHandle(void);
-
+
protected:
typedef std::vector<std::vector<AString> > AStringVectorVector;
@@ -535,16 +543,16 @@ protected:
// Food-related variables:
/** Represents the food bar, one point equals half a "drumstick" */
int m_FoodLevel;
-
+
/** "Overcharge" for the m_FoodLevel; is depleted before m_FoodLevel */
double m_FoodSaturationLevel;
-
+
/** Count-up to the healing or damaging action, based on m_FoodLevel */
int m_FoodTickTimer;
-
+
/** A "buffer" which adds up hunger before it is substracted from m_FoodSaturationLevel or m_FoodLevel. Each action adds a little */
double m_FoodExhaustionLevel;
-
+
float m_LastJumpHeight;
float m_LastGroundHeight;
bool m_bTouchGround;
@@ -564,31 +572,31 @@ protected:
eGameMode m_GameMode;
AString m_IP;
-
+
/** The item being dragged by the cursor while in a UI window */
cItem m_DraggingItem;
std::chrono::steady_clock::time_point m_LastPlayerListTime;
cClientHandlePtr m_ClientHandle;
-
+
cSlotNums m_InventoryPaintSlots;
-
+
/** Max speed, relative to the game default.
1 means regular speed, 2 means twice as fast, 0.5 means half-speed.
Default value is 1. */
double m_NormalMaxSpeed;
-
+
/** Max speed, relative to the game default max speed, when sprinting.
1 means regular speed, 2 means twice as fast, 0.5 means half-speed.
Default value is 1.3. */
double m_SprintingMaxSpeed;
-
+
/** Max speed, relative to the game default flying max speed, when flying.
1 means regular speed, 2 means twice as fast, 0.5 means half-speed.
Default value is 1. */
double m_FlyingMaxSpeed;
-
+
bool m_IsCrouched;
bool m_IsSprinting;
bool m_IsFlying;
@@ -629,7 +637,7 @@ protected:
Will not apply food penalties if found to be true; will set to false after processing
*/
bool m_bIsTeleporting;
-
+
/** The short UUID (no dashes) of the player, as read from the ClientHandle.
If no ClientHandle is given, the UUID is initialized to empty. */
AString m_UUID;
@@ -642,14 +650,14 @@ protected:
void ResolvePermissions(void);
void ResolveGroups(void);
- virtual void Destroyed(void);
+ virtual void Destroyed(void) override;
/** Filters out damage for creative mode / friendly fire */
virtual bool DoTakeDamage(TakeDamageInfo & TDI) override;
/** Stops players from burning in creative mode */
virtual void TickBurning(cChunk & a_Chunk) override;
-
+
/** Called in each tick to handle food-related processing */
void HandleFood(void);
@@ -666,7 +674,3 @@ protected:
This can be used both for online and offline UUIDs. */
AString GetUUIDFileName(const AString & a_UUID);
} ; // tolua_export
-
-
-
-
diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp
index 05b7669cd..8e2e412dd 100644
--- a/src/Entities/ProjectileEntity.cpp
+++ b/src/Entities/ProjectileEntity.cpp
@@ -30,7 +30,7 @@
/// Converts an angle in radians into a byte representation used by the network protocol
-#define ANGLE_TO_PROTO(X) (Byte)(X * 255 / 360)
+#define ANGLE_TO_PROTO(X) static_cast<Byte>(X * 255 / 360)
@@ -222,7 +222,7 @@ cProjectileEntity::cProjectileEntity(eKind a_Kind, cEntity * a_Creator, double a
m_ProjectileKind(a_Kind),
m_CreatorData(
((a_Creator != nullptr) ? a_Creator->GetUniqueID() : cEntity::INVALID_ID),
- ((a_Creator != nullptr) ? (a_Creator->IsPlayer() ? ((cPlayer *)a_Creator)->GetName() : "") : ""),
+ ((a_Creator != nullptr) ? (a_Creator->IsPlayer() ? static_cast<cPlayer *>(a_Creator)->GetName() : "") : ""),
((a_Creator != nullptr) ? a_Creator->GetEquippedWeapon().m_Enchantments : cEnchantments())
),
m_IsInGround(false)
@@ -238,7 +238,7 @@ cProjectileEntity::cProjectileEntity(eKind a_Kind, cEntity * a_Creator, double a
cProjectileEntity::cProjectileEntity(eKind a_Kind, cEntity * a_Creator, const Vector3d & a_Pos, const Vector3d & a_Speed, double a_Width, double a_Height) :
super(etProjectile, a_Pos.x, a_Pos.y, a_Pos.z, a_Width, a_Height),
m_ProjectileKind(a_Kind),
- m_CreatorData(a_Creator->GetUniqueID(), a_Creator->IsPlayer() ? ((cPlayer *)a_Creator)->GetName() : "", a_Creator->GetEquippedWeapon().m_Enchantments),
+ m_CreatorData(a_Creator->GetUniqueID(), a_Creator->IsPlayer() ? static_cast<cPlayer *>(a_Creator)->GetName() : "", a_Creator->GetEquippedWeapon().m_Enchantments),
m_IsInGround(false)
{
SetSpeed(a_Speed);
@@ -281,6 +281,7 @@ cProjectileEntity * cProjectileEntity::Create(eKind a_Kind, cEntity * a_Creator,
return new cFireworkEntity(a_Creator, a_X, a_Y, a_Z, *a_Item);
}
+ case pkFishingFloat: break;
}
LOGWARNING("%s: Unknown projectile kind: %d", __FUNCTION__, a_Kind);
diff --git a/src/Entities/SplashPotionEntity.cpp b/src/Entities/SplashPotionEntity.cpp
index fd1a0179b..926fd1abe 100644
--- a/src/Entities/SplashPotionEntity.cpp
+++ b/src/Entities/SplashPotionEntity.cpp
@@ -9,7 +9,7 @@
/// Converts an angle in radians into a byte representation used by the network protocol
-#define ANGLE_TO_PROTO(X) (Byte)(X * 255 / 360)
+#define ANGLE_TO_PROTO(X) static_cast<Byte>(X * 255 / 360)
////////////////////////////////////////////////////////////////////////////////
// cSplashPotionEntityCallback:
@@ -51,7 +51,7 @@ public:
double Reduction = -0.25 * SplashDistance + 1.0;
Reduction = std::max(Reduction, 0.0);
- ((cPawn *) a_Entity)->AddEntityEffect(m_EntityEffectType, m_EntityEffect.GetDuration(), m_EntityEffect.GetIntensity(), Reduction);
+ static_cast<cPawn *>(a_Entity)->AddEntityEffect(m_EntityEffectType, m_EntityEffect.GetDuration(), m_EntityEffect.GetIntensity(), Reduction);
return false;
}
@@ -116,7 +116,13 @@ void cSplashPotionEntity::Splash(const Vector3d & a_HitPos)
cSplashPotionCallback Callback(a_HitPos, m_EntityEffectType, m_EntityEffect);
m_World->ForEachEntity(Callback);
- m_World->BroadcastSoundParticleEffect(2002, (int)floor(a_HitPos.x), (int)floor(a_HitPos.y), (int)floor(a_HitPos.z), m_PotionColor);
+ m_World->BroadcastSoundParticleEffect(
+ 2002,
+ FloorC(a_HitPos.x),
+ FloorC(a_HitPos.y),
+ FloorC(a_HitPos.z),
+ m_PotionColor
+ );
}
diff --git a/src/Entities/ThrownEnderPearlEntity.cpp b/src/Entities/ThrownEnderPearlEntity.cpp
index f01cdc18c..12d826042 100644
--- a/src/Entities/ThrownEnderPearlEntity.cpp
+++ b/src/Entities/ThrownEnderPearlEntity.cpp
@@ -77,9 +77,9 @@ void cThrownEnderPearlEntity::TeleportCreator(const Vector3d & a_HitPos)
class cProjectileCreatorCallbackForPlayers : public cPlayerListCallback
{
public:
- cProjectileCreatorCallbackForPlayers(cEntity * a_Attacker, Vector3i a_HitPos) :
+ cProjectileCreatorCallbackForPlayers(cEntity * a_Attacker, Vector3i a_CallbackHitPos) :
m_Attacker(a_Attacker),
- m_HitPos(a_HitPos)
+ m_HitPos(a_CallbackHitPos)
{
}
diff --git a/src/Entities/ThrownSnowballEntity.cpp b/src/Entities/ThrownSnowballEntity.cpp
index 24db1e7ee..b28205d44 100644
--- a/src/Entities/ThrownSnowballEntity.cpp
+++ b/src/Entities/ThrownSnowballEntity.cpp
@@ -32,7 +32,7 @@ void cThrownSnowballEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d &
int TotalDamage = 0;
if (a_EntityHit.IsMob())
{
- eMonsterType MobType = ((cMonster &) a_EntityHit).GetMobType();
+ eMonsterType MobType = static_cast<cMonster &>(a_EntityHit).GetMobType();
if (MobType == mtBlaze)
{
TotalDamage = 3;
diff --git a/src/FastRandom.cpp b/src/FastRandom.cpp
index 737b13535..c1716f026 100644
--- a/src/FastRandom.cpp
+++ b/src/FastRandom.cpp
@@ -6,12 +6,28 @@
#include "Globals.h"
#include "FastRandom.h"
+#include <random>
+
#ifdef _WIN32
- #define thread_local __declspec(thread)
+ #define thread_local static __declspec(thread)
+#elif defined __APPLE__
+ #define thread_local static __thread
#endif
-thread_local unsigned int m_Counter = 0;
-
+static unsigned int GetRandomSeed()
+{
+ thread_local bool SeedCounterInitialized = 0;
+ thread_local unsigned int SeedCounter = 0;
+
+ if (!SeedCounterInitialized)
+ {
+ std::random_device rd;
+ std::uniform_int_distribution<unsigned int> dist;
+ SeedCounter = dist(rd);
+ SeedCounterInitialized = true;
+ }
+ return ++SeedCounter;
+}
@@ -92,7 +108,7 @@ public:
cFastRandom::cFastRandom(void) :
- m_LinearRand(m_Counter++)
+ m_LinearRand(GetRandomSeed())
{
}
@@ -136,7 +152,7 @@ int cFastRandom::GenerateRandomInteger(int a_Begin, int a_End)
// MTRand:
MTRand::MTRand() :
- m_MersenneRand(m_Counter++)
+ m_MersenneRand(GetRandomSeed())
{
}
diff --git a/src/FurnaceRecipe.cpp b/src/FurnaceRecipe.cpp
index ea952a852..a0c8560f1 100644
--- a/src/FurnaceRecipe.cpp
+++ b/src/FurnaceRecipe.cpp
@@ -77,7 +77,7 @@ void cFurnaceRecipe::ReloadRecipes(void)
size_t FirstCommentSymbol = ParsingLine.find('#');
if ((FirstCommentSymbol != AString::npos) && (FirstCommentSymbol != 0))
{
- ParsingLine.erase(ParsingLine.begin() + (const long)FirstCommentSymbol, ParsingLine.end());
+ ParsingLine.erase(ParsingLine.begin() + static_cast<const long>(FirstCommentSymbol), ParsingLine.end());
}
switch (ParsingLine[0])
@@ -115,13 +115,13 @@ void cFurnaceRecipe::AddFuelFromLine(const AString & a_Line, unsigned int a_Line
Line.erase(Line.begin()); // Remove the beginning "!"
Line.erase(std::remove_if(Line.begin(), Line.end(), isspace), Line.end());
- std::unique_ptr<cItem> Item(new cItem);
+ std::unique_ptr<cItem> Item = cpp14::make_unique<cItem>();
int BurnTime;
const AStringVector & Sides = StringSplit(Line, "=");
if (Sides.size() != 2)
{
- LOGWARNING("furnace.txt: line %d: A single '=' was expected, got %d", a_LineNum, (int)Sides.size() - 1);
+ LOGWARNING("furnace.txt: line %d: A single '=' was expected, got " SIZE_T_FMT, a_LineNum, Sides.size() - 1);
LOGINFO("Offending line: \"%s\"", a_Line.c_str());
return;
}
@@ -157,13 +157,13 @@ void cFurnaceRecipe::AddRecipeFromLine(const AString & a_Line, unsigned int a_Li
Line.erase(std::remove_if(Line.begin(), Line.end(), isspace), Line.end());
int CookTime = 200;
- std::unique_ptr<cItem> InputItem(new cItem());
- std::unique_ptr<cItem> OutputItem(new cItem());
+ std::unique_ptr<cItem> InputItem = cpp14::make_unique<cItem>();
+ std::unique_ptr<cItem> OutputItem = cpp14::make_unique<cItem>();
const AStringVector & Sides = StringSplit(Line, "=");
if (Sides.size() != 2)
{
- LOGWARNING("furnace.txt: line %d: A single '=' was expected, got %d", a_LineNum, (int)Sides.size() - 1);
+ LOGWARNING("furnace.txt: line %d: A single '=' was expected, got " SIZE_T_FMT, a_LineNum, Sides.size() - 1);
LOGINFO("Offending line: \"%s\"", a_Line.c_str());
return;
}
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp
index 867155ad2..ff8827511 100644
--- a/src/Generating/BioGen.cpp
+++ b/src/Generating/BioGen.cpp
@@ -49,16 +49,16 @@ void cBioGenConstant::InitializeBiomeGen(cIniFile & a_IniFile)
////////////////////////////////////////////////////////////////////////////////
// cBioGenCache:
-cBioGenCache::cBioGenCache(cBiomeGenPtr a_BioGenToCache, int a_CacheSize) :
+cBioGenCache::cBioGenCache(cBiomeGenPtr a_BioGenToCache, size_t a_CacheSize) :
m_BioGenToCache(a_BioGenToCache),
m_CacheSize(a_CacheSize),
- m_CacheOrder(new int[a_CacheSize]),
+ m_CacheOrder(new size_t[a_CacheSize]),
m_CacheData(new sCacheData[a_CacheSize]),
m_NumHits(0),
m_NumMisses(0),
m_TotalChain(0)
{
- for (int i = 0; i < m_CacheSize; i++)
+ for (size_t i = 0; i < m_CacheSize; i++)
{
m_CacheOrder[i] = i;
m_CacheData[i].m_ChunkX = 0x7fffffff;
@@ -86,11 +86,11 @@ void cBioGenCache::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a
{
if (((m_NumHits + m_NumMisses) % 1024) == 10)
{
- LOGD("BioGenCache: %d hits, %d misses, saved %.2f %%", m_NumHits, m_NumMisses, 100.0 * m_NumHits / (m_NumHits + m_NumMisses));
- LOGD("BioGenCache: Avg cache chain length: %.2f", (float)m_TotalChain / m_NumHits);
+ LOGD("BioGenCache: %u hits, %u misses, saved %.2f %%", static_cast<unsigned>(m_NumHits), static_cast<unsigned>(m_NumMisses), 100.0 * m_NumHits / (m_NumHits + m_NumMisses));
+ LOGD("BioGenCache: Avg cache chain length: %.2f", static_cast<double>(m_TotalChain) / m_NumHits);
}
- for (int i = 0; i < m_CacheSize; i++)
+ for (size_t i = 0; i < m_CacheSize; i++)
{
if (
(m_CacheData[m_CacheOrder[i]].m_ChunkX != a_ChunkX) ||
@@ -100,10 +100,10 @@ void cBioGenCache::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a
continue;
}
// Found it in the cache
- int Idx = m_CacheOrder[i];
+ size_t Idx = m_CacheOrder[i];
// Move to front:
- for (int j = i; j > 0; j--)
+ for (size_t j = i; j > 0; j--)
{
m_CacheOrder[j] = m_CacheOrder[j - 1];
}
@@ -122,8 +122,8 @@ void cBioGenCache::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a
m_BioGenToCache->GenBiomes(a_ChunkX, a_ChunkZ, a_BiomeMap);
// Insert it as the first item in the MRU order:
- int Idx = m_CacheOrder[m_CacheSize - 1];
- for (int i = m_CacheSize - 1; i > 0; i--)
+ size_t Idx = m_CacheOrder[m_CacheSize - 1];
+ for (size_t i = m_CacheSize - 1; i > 0; i--)
{
m_CacheOrder[i] = m_CacheOrder[i - 1];
} // for i - m_CacheOrder[]
@@ -166,7 +166,7 @@ cBioGenMulticache::cBioGenMulticache(cBiomeGenPtr a_BioGenToCache, size_t a_SubC
void cBioGenMulticache::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap)
{
const size_t coefficient = 3;
- const size_t cacheIdx = ((size_t)a_ChunkX + coefficient * (size_t)a_ChunkZ) % m_NumSubCaches;
+ const size_t cacheIdx = (static_cast<size_t>(a_ChunkX) + coefficient * static_cast<size_t>(a_ChunkZ)) % m_NumSubCaches;
m_Caches[cacheIdx]->GenBiomes(a_ChunkX, a_ChunkZ, a_BiomeMap);
}
@@ -226,7 +226,7 @@ void cBiomeGenList::InitializeBiomes(const AString & a_Biomes)
} // for itr - Split[]
if (!m_Biomes.empty())
{
- m_BiomesCount = (int)m_Biomes.size();
+ m_BiomesCount = static_cast<int>(m_Biomes.size());
return;
}
@@ -260,7 +260,7 @@ void cBiomeGenList::InitializeBiomes(const AString & a_Biomes)
{
m_Biomes.push_back(Biomes[i]);
}
- m_BiomesCount = (int)m_Biomes.size();
+ m_BiomesCount = static_cast<int>(m_Biomes.size());
}
@@ -278,7 +278,7 @@ void cBioGenCheckerboard::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::Biome
for (int x = 0; x < cChunkDef::Width; x++)
{
int Add = cChunkDef::Width * a_ChunkX + x;
- int BiomeIdx = (((Base + Add / m_BiomeSize) % m_BiomesCount) + m_BiomesCount) % m_BiomesCount; // Need to add and modulo twice because of negative numbers
+ size_t BiomeIdx = static_cast<size_t>((((Base + Add / m_BiomeSize) % m_BiomesCount) + m_BiomesCount) % m_BiomesCount); // Need to add and modulo twice because of negative numbers
a_BiomeMap[x + cChunkDef::Width * z] = m_Biomes[BiomeIdx];
}
}
@@ -314,7 +314,7 @@ void cBioGenVoronoi::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap &
for (int x = 0; x < cChunkDef::Width; x++)
{
int VoronoiCellValue = m_Voronoi.GetValueAt(BaseX + x, AbsoluteZ) / 8;
- cChunkDef::SetBiome(a_BiomeMap, x, z, m_Biomes[VoronoiCellValue % m_BiomesCount]);
+ cChunkDef::SetBiome(a_BiomeMap, x, z, m_Biomes[static_cast<size_t>(VoronoiCellValue % m_BiomesCount)]);
} // for x
} // for z
}
@@ -363,7 +363,7 @@ void cBioGenDistortedVoronoi::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::B
for (int x = 0; x < cChunkDef::Width; x++)
{
int VoronoiCellValue = m_Voronoi.GetValueAt(DistortX[x][z], DistortZ[x][z]) / 8;
- cChunkDef::SetBiome(a_BiomeMap, x, z, m_Biomes[VoronoiCellValue % m_BiomesCount]);
+ cChunkDef::SetBiome(a_BiomeMap, x, z, m_Biomes[static_cast<size_t>(VoronoiCellValue % m_BiomesCount)]);
} // for x
} // for z
}
@@ -385,15 +385,15 @@ void cBioGenDistortedVoronoi::InitializeBiomeGen(cIniFile & a_IniFile)
void cBioGenDistortedVoronoi::Distort(int a_BlockX, int a_BlockZ, int & a_DistortedX, int & a_DistortedZ)
{
- double NoiseX = m_Noise.CubicNoise3D((float)a_BlockX / m_CellSize, (float)a_BlockZ / m_CellSize, 1000);
- NoiseX += 0.5 * m_Noise.CubicNoise3D(2 * (float)a_BlockX / m_CellSize, 2 * (float)a_BlockZ / m_CellSize, 2000);
- NoiseX += 0.08 * m_Noise.CubicNoise3D(16 * (float)a_BlockX / m_CellSize, 16 * (float)a_BlockZ / m_CellSize, 3000);
- double NoiseZ = m_Noise.CubicNoise3D((float)a_BlockX / m_CellSize, (float)a_BlockZ / m_CellSize, 4000);
- NoiseZ += 0.5 * m_Noise.CubicNoise3D(2 * (float)a_BlockX / m_CellSize, 2 * (float)a_BlockZ / m_CellSize, 5000);
- NoiseZ += 0.08 * m_Noise.CubicNoise3D(16 * (float)a_BlockX / m_CellSize, 16 * (float)a_BlockZ / m_CellSize, 6000);
+ double NoiseX = m_Noise.CubicNoise3D(static_cast<float>(a_BlockX / m_CellSize), static_cast<float>(a_BlockZ / m_CellSize), 1000);
+ NoiseX += 0.5 * m_Noise.CubicNoise3D(2 * static_cast<float>(a_BlockX / m_CellSize), 2 * static_cast<float>(a_BlockZ / m_CellSize), 2000);
+ NoiseX += 0.08 * m_Noise.CubicNoise3D(16 * static_cast<float>(a_BlockX / m_CellSize), 16 * static_cast<float>(a_BlockZ / m_CellSize), 3000);
+ double NoiseZ = m_Noise.CubicNoise3D(static_cast<float>(a_BlockX / m_CellSize), static_cast<float>(a_BlockZ / m_CellSize), 4000);
+ NoiseZ += 0.5 * m_Noise.CubicNoise3D(2 * static_cast<float>(a_BlockX / m_CellSize), 2 * static_cast<float>(a_BlockZ / m_CellSize), 5000);
+ NoiseZ += 0.08 * m_Noise.CubicNoise3D(16 * static_cast<float>(a_BlockX / m_CellSize), 16 * static_cast<float>(a_BlockZ / m_CellSize), 6000);
- a_DistortedX = a_BlockX + (int)(m_CellSize * 0.5 * NoiseX);
- a_DistortedZ = a_BlockZ + (int)(m_CellSize * 0.5 * NoiseZ);
+ a_DistortedX = a_BlockX + static_cast<int>(m_CellSize * 0.5 * NoiseX);
+ a_DistortedZ = a_BlockZ + static_cast<int>(m_CellSize * 0.5 * NoiseZ);
}
@@ -429,7 +429,7 @@ void cBioGenMultiStepMap::InitializeBiomeGen(cIniFile & a_IniFile)
m_MushroomIslandSize = a_IniFile.GetValueSetI("Generator", "MultiStepMapMushroomIslandSize", m_MushroomIslandSize);
m_RiverCellSize = a_IniFile.GetValueSetI("Generator", "MultiStepMapRiverCellSize", m_RiverCellSize);
m_RiverWidthThreshold = a_IniFile.GetValueSetF("Generator", "MultiStepMapRiverWidth", m_RiverWidthThreshold);
- m_LandBiomesSize = (float)a_IniFile.GetValueSetI("Generator", "MultiStepMapLandBiomeSize", (int)m_LandBiomesSize);
+ m_LandBiomesSize = static_cast<float>(a_IniFile.GetValueSetI("Generator", "MultiStepMapLandBiomeSize", static_cast<int>(m_LandBiomesSize)));
}
@@ -554,7 +554,7 @@ void cBioGenMultiStepMap::AddRivers(int a_ChunkX, int a_ChunkZ, cChunkDef::Biome
{
for (int z = 0; z < cChunkDef::Width; z++)
{
- float NoiseCoordZ = (float)(a_ChunkZ * cChunkDef::Width + z) / m_RiverCellSize;
+ float NoiseCoordZ = static_cast<float>(a_ChunkZ * cChunkDef::Width + z) / m_RiverCellSize;
for (int x = 0; x < cChunkDef::Width; x++)
{
if (cChunkDef::GetBiome(a_BiomeMap, x, z) != biInvalidBiome)
@@ -563,7 +563,7 @@ void cBioGenMultiStepMap::AddRivers(int a_ChunkX, int a_ChunkZ, cChunkDef::Biome
continue;
}
- float NoiseCoordX = (float)(a_ChunkX * cChunkDef::Width + x) / m_RiverCellSize;
+ float NoiseCoordX = static_cast<float>(a_ChunkX * cChunkDef::Width + x) / m_RiverCellSize;
double Noise = m_Noise1.CubicNoise2D( NoiseCoordX, NoiseCoordZ);
Noise += 0.5 * m_Noise3.CubicNoise2D(2 * NoiseCoordX, 2 * NoiseCoordZ);
@@ -597,15 +597,15 @@ void cBioGenMultiStepMap::ApplyTemperatureHumidity(int a_ChunkX, int a_ChunkZ, c
void cBioGenMultiStepMap::Distort(int a_BlockX, int a_BlockZ, int & a_DistortedX, int & a_DistortedZ, int a_CellSize)
{
- double NoiseX = m_Noise3.CubicNoise2D( (float)a_BlockX / a_CellSize, (float)a_BlockZ / a_CellSize);
- NoiseX += 0.5 * m_Noise2.CubicNoise2D(2 * (float)a_BlockX / a_CellSize, 2 * (float)a_BlockZ / a_CellSize);
- NoiseX += 0.1 * m_Noise1.CubicNoise2D(16 * (float)a_BlockX / a_CellSize, 16 * (float)a_BlockZ / a_CellSize);
- double NoiseZ = m_Noise6.CubicNoise2D( (float)a_BlockX / a_CellSize, (float)a_BlockZ / a_CellSize);
- NoiseZ += 0.5 * m_Noise5.CubicNoise2D(2 * (float)a_BlockX / a_CellSize, 2 * (float)a_BlockZ / a_CellSize);
- NoiseZ += 0.1 * m_Noise4.CubicNoise2D(16 * (float)a_BlockX / a_CellSize, 16 * (float)a_BlockZ / a_CellSize);
+ double NoiseX = m_Noise3.CubicNoise2D( static_cast<float>(a_BlockX / a_CellSize), static_cast<float>(a_BlockZ / a_CellSize));
+ NoiseX += 0.5 * m_Noise2.CubicNoise2D(2 * static_cast<float>(a_BlockX / a_CellSize), 2 * static_cast<float>(a_BlockZ / a_CellSize));
+ NoiseX += 0.1 * m_Noise1.CubicNoise2D(16 * static_cast<float>(a_BlockX / a_CellSize), 16 * static_cast<float>(a_BlockZ / a_CellSize));
+ double NoiseZ = m_Noise6.CubicNoise2D( static_cast<float>(a_BlockX / a_CellSize), static_cast<float>(a_BlockZ / a_CellSize));
+ NoiseZ += 0.5 * m_Noise5.CubicNoise2D(2 * static_cast<float>(a_BlockX / a_CellSize), 2 * static_cast<float>(a_BlockZ / a_CellSize));
+ NoiseZ += 0.1 * m_Noise4.CubicNoise2D(16 * static_cast<float>(a_BlockX / a_CellSize), 16 * static_cast<float>(a_BlockZ / a_CellSize));
- a_DistortedX = a_BlockX + (int)(a_CellSize * 0.5 * NoiseX);
- a_DistortedZ = a_BlockZ + (int)(a_CellSize * 0.5 * NoiseZ);
+ a_DistortedX = a_BlockX + static_cast<int>(a_CellSize * 0.5 * NoiseX);
+ a_DistortedZ = a_BlockZ + static_cast<int>(a_CellSize * 0.5 * NoiseZ);
}
@@ -619,10 +619,10 @@ void cBioGenMultiStepMap::BuildTemperatureHumidityMaps(int a_ChunkX, int a_Chunk
DblMap HumidityMap;
for (int z = 0; z < 17; z += 8)
{
- float NoiseCoordZ = (float)(a_ChunkZ * cChunkDef::Width + z) / m_LandBiomesSize;
+ float NoiseCoordZ = static_cast<float>(a_ChunkZ * cChunkDef::Width + z) / m_LandBiomesSize;
for (int x = 0; x < 17; x += 8)
{
- float NoiseCoordX = (float)(a_ChunkX * cChunkDef::Width + x) / m_LandBiomesSize;
+ float NoiseCoordX = static_cast<float>(a_ChunkX * cChunkDef::Width + x) / m_LandBiomesSize;
double NoiseT = m_Noise1.CubicNoise2D( NoiseCoordX, NoiseCoordZ);
NoiseT += 0.5 * m_Noise2.CubicNoise2D(2 * NoiseCoordX, 2 * NoiseCoordZ);
@@ -641,8 +641,8 @@ void cBioGenMultiStepMap::BuildTemperatureHumidityMaps(int a_ChunkX, int a_Chunk
// Re-map into integral values in [0 .. 255] range:
for (size_t idx = 0; idx < ARRAYCOUNT(a_TemperatureMap); idx++)
{
- a_TemperatureMap[idx] = std::max(0, std::min(255, (int)(128 + TemperatureMap[idx] * 128)));
- a_HumidityMap[idx] = std::max(0, std::min(255, (int)(128 + HumidityMap[idx] * 128)));
+ a_TemperatureMap[idx] = Clamp(static_cast<int>(128 + TemperatureMap[idx] * 128), 0, 255);
+ a_HumidityMap[idx] = Clamp(static_cast<int>(128 + HumidityMap[idx] * 128), 0, 255);
}
}
@@ -771,8 +771,8 @@ void cBioGenTwoLevel::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap
NoiseZ += m_AmpZ2 * m_Noise5.CubicNoise2D(BlockX * m_FreqZ2, BlockZ * m_FreqZ2);
NoiseZ += m_AmpZ3 * m_Noise6.CubicNoise2D(BlockX * m_FreqZ3, BlockZ * m_FreqZ3);
- DistortX[4 * x][4 * z] = (int)(BlockX + NoiseX);
- DistortZ[4 * x][4 * z] = (int)(BlockZ + NoiseZ);
+ DistortX[4 * x][4 * z] = static_cast<int>(BlockX + NoiseX);
+ DistortZ[4 * x][4 * z] = static_cast<int>(BlockZ + NoiseZ);
}
LinearUpscale2DArrayInPlace<cChunkDef::Width + 1, cChunkDef::Width + 1, 4, 4>(&DistortX[0][0]);
@@ -785,7 +785,7 @@ void cBioGenTwoLevel::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap
{
int SeedX, SeedZ, MinDist2;
int BiomeGroup = m_VoronoiLarge.GetValueAt(DistortX[x][z], DistortZ[x][z], SeedX, SeedZ, MinDist2) / 7;
- int BiomeIdx = m_VoronoiSmall.GetValueAt(DistortX[x][z], DistortZ[x][z], SeedX, SeedZ, MinDist2) / 11;
+ size_t BiomeIdx = static_cast<size_t>(m_VoronoiSmall.GetValueAt(DistortX[x][z], DistortZ[x][z], SeedX, SeedZ, MinDist2) / 11);
int MinDist1 = (DistortX[x][z] - SeedX) * (DistortX[x][z] - SeedX) + (DistortZ[x][z] - SeedZ) * (DistortZ[x][z] - SeedZ);
cChunkDef::SetBiome(a_BiomeMap, x, z, SelectBiome(BiomeGroup, BiomeIdx, (MinDist1 < MinDist2 / 4) ? 1 : 0));
}
@@ -796,7 +796,7 @@ void cBioGenTwoLevel::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap
-EMCSBiome cBioGenTwoLevel::SelectBiome(int a_BiomeGroup, int a_BiomeIdx, int a_DistLevel)
+EMCSBiome cBioGenTwoLevel::SelectBiome(int a_BiomeGroup, size_t a_BiomeIdx, int a_DistLevel)
{
// TODO: Move this into settings
struct BiomeLevels
@@ -900,7 +900,7 @@ EMCSBiome cBioGenTwoLevel::SelectBiome(int a_BiomeGroup, int a_BiomeIdx, int a_D
{ bgMesa, ARRAYCOUNT(bgMesa), },
{ bgDenseTrees, ARRAYCOUNT(bgDenseTrees), },
} ;
- size_t Group = a_BiomeGroup % ARRAYCOUNT(BiomeGroups);
+ size_t Group = static_cast<size_t>(a_BiomeGroup) % ARRAYCOUNT(BiomeGroups);
size_t Index = a_BiomeIdx % BiomeGroups[Group].Count;
return (a_DistLevel > 0) ? BiomeGroups[Group].Biomes[Index].InnerBiome : BiomeGroups[Group].Biomes[Index].OuterBiome;
}
@@ -913,18 +913,18 @@ void cBioGenTwoLevel::InitializeBiomeGen(cIniFile & a_IniFile)
{
m_VoronoiLarge.SetCellSize(a_IniFile.GetValueSetI("Generator", "TwoLevelLargeCellSize", 1024));
m_VoronoiSmall.SetCellSize(a_IniFile.GetValueSetI("Generator", "TwoLevelSmallCellSize", 128));
- m_FreqX1 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave1Freq", 0.01);
- m_AmpX1 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave1Amp", 80);
- m_FreqX2 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave2Freq", 0.05);
- m_AmpX2 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave2Amp", 20);
- m_FreqX3 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave3Freq", 0.1),
- m_AmpX3 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave3Amp", 8);
- m_FreqZ1 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave1Freq", 0.01);
- m_AmpZ1 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave1Amp", 80);
- m_FreqZ2 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave2Freq", 0.05);
- m_AmpZ2 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave2Amp", 20);
- m_FreqZ3 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave3Freq", 0.1);
- m_AmpZ3 = (float)a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave3Amp", 8);
+ m_FreqX1 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave1Freq", 0.01));
+ m_AmpX1 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave1Amp", 80));
+ m_FreqX2 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave2Freq", 0.05));
+ m_AmpX2 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave2Amp", 20));
+ m_FreqX3 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave3Freq", 0.1)),
+ m_AmpX3 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortXOctave3Amp", 8));
+ m_FreqZ1 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave1Freq", 0.01));
+ m_AmpZ1 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave1Amp", 80));
+ m_FreqZ2 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave2Freq", 0.05));
+ m_AmpZ2 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave2Amp", 20));
+ m_FreqZ3 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave3Freq", 0.1));
+ m_AmpZ3 = static_cast<float>(a_IniFile.GetValueSetF("Generator", "TwoLevelDistortZOctave3Amp", 8));
}
@@ -1022,7 +1022,7 @@ public:
{
for (int x = 0; x < cChunkDef::Width; x++)
{
- cChunkDef::SetBiome(a_Biomes, x, z, (EMCSBiome)vals[x + cChunkDef::Width * z]);
+ cChunkDef::SetBiome(a_Biomes, x, z, static_cast<EMCSBiome>(vals[x + cChunkDef::Width * z]));
}
}
}
@@ -1126,7 +1126,7 @@ public:
{
for (int x = 0; x < cChunkDef::Width; x++)
{
- cChunkDef::SetBiome(a_Biomes, x, z, (EMCSBiome)vals[x + cChunkDef::Width * z]);
+ cChunkDef::SetBiome(a_Biomes, x, z, static_cast<EMCSBiome>(vals[x + cChunkDef::Width * z]));
}
}
}
diff --git a/src/Generating/BioGen.h b/src/Generating/BioGen.h
index 13fb40c5f..44f1dfd2a 100644
--- a/src/Generating/BioGen.h
+++ b/src/Generating/BioGen.h
@@ -48,7 +48,7 @@ class cBioGenCache :
typedef cBiomeGen super;
public:
- cBioGenCache(cBiomeGenPtr a_BioGenToCache, int a_CacheSize);
+ cBioGenCache(cBiomeGenPtr a_BioGenToCache, size_t a_CacheSize);
virtual ~cBioGenCache();
protected:
@@ -63,14 +63,14 @@ protected:
} ;
// To avoid moving large amounts of data for the MRU behavior, we MRU-ize indices to an array of the actual data
- int m_CacheSize;
- int * m_CacheOrder; // MRU-ized order, indices into m_CacheData array
+ size_t m_CacheSize;
+ size_t * m_CacheOrder; // MRU-ized order, indices into m_CacheData array
sCacheData * m_CacheData; // m_CacheData[m_CacheOrder[0]] is the most recently used
// Cache statistics
- int m_NumHits;
- int m_NumMisses;
- int m_TotalChain; // Number of cache items walked to get to a hit (only added for hits)
+ size_t m_NumHits;
+ size_t m_NumMisses;
+ size_t m_TotalChain; // Number of cache items walked to get to a hit (only added for hits)
virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
virtual void InitializeBiomeGen(cIniFile & a_IniFile) override;
@@ -311,7 +311,7 @@ protected:
/// Selects biome from the specified biome group, based on the specified index.
/// Note that both params may overflow
/// a_DistLevel is either 0 or 1; zero when it is at the edge of the small Voronoi cell, 1 near the center
- EMCSBiome SelectBiome(int a_BiomeGroup, int a_BiomeIdx, int a_DistLevel);
+ EMCSBiome SelectBiome(int a_BiomeGroup, size_t a_BiomeIdx, int a_DistLevel);
} ;
diff --git a/src/Generating/CMakeLists.txt b/src/Generating/CMakeLists.txt
index a28510d40..de74f8734 100644
--- a/src/Generating/CMakeLists.txt
+++ b/src/Generating/CMakeLists.txt
@@ -72,8 +72,34 @@ SET (HDRS
VillageGen.h
)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(BioGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum")
+ set_source_files_properties(Caves.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(ChunkGenerator.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(CompoGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(CompoGenBiomal.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors -Wno-error=old-style-cast")
+ set_source_files_properties(ComposableGenerator.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum -Wno-error=old-style-cast")
+ set_source_files_properties(DistortedHeightmap.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(EndGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(FinishGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum -Wno-error=switch")
+ set_source_files_properties(HeiGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(NetherFortGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors")
+ set_source_files_properties(Noise3DGenerator.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(PieceGenerator.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors")
+ set_source_files_properties(Prefab.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors")
+ set_source_files_properties(RainbowRoadsGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors")
+ set_source_files_properties(Ravines.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(RoughRavines.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=float-equal -Wno-error=old-style-cast")
+ set_source_files_properties(StructGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum -Wno-error=switch -Wno-error=old-style-cast")
+ set_source_files_properties(ShapeGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(TestRailsGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors")
+ set_source_files_properties(TwoHeights.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(UnderwaterBaseGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors -Wno-error=switch-enum")
+ set_source_files_properties(VillageGen.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors -Wno-error=switch-enum")
+endif()
+
if(NOT MSVC)
add_library(Generating ${SRCS} ${HDRS})
- target_link_libraries(Generating OSSupport Blocks)
+ target_link_libraries(Generating OSSupport Blocks Bindings)
endif()
diff --git a/src/Generating/ChunkDesc.cpp b/src/Generating/ChunkDesc.cpp
index 4a5ac5a18..07855b1d0 100644
--- a/src/Generating/ChunkDesc.cpp
+++ b/src/Generating/ChunkDesc.cpp
@@ -134,7 +134,7 @@ EMCSBiome cChunkDesc::GetBiome(int a_RelX, int a_RelZ)
-void cChunkDesc::SetHeight(int a_RelX, int a_RelZ, int a_Height)
+void cChunkDesc::SetHeight(int a_RelX, int a_RelZ, HEIGHTTYPE a_Height)
{
cChunkDef::SetHeight(m_HeightMap, a_RelX, a_RelZ, a_Height);
}
@@ -143,7 +143,7 @@ void cChunkDesc::SetHeight(int a_RelX, int a_RelZ, int a_Height)
-int cChunkDesc::GetHeight(int a_RelX, int a_RelZ)
+HEIGHTTYPE cChunkDesc::GetHeight(int a_RelX, int a_RelZ)
{
return cChunkDef::GetHeight(m_HeightMap, a_RelX, a_RelZ);
}
@@ -158,7 +158,7 @@ void cChunkDesc::SetHeightFromShape(const Shape & a_Shape)
{
for (int x = 0; x < cChunkDef::Width; x++)
{
- for (int y = cChunkDef::Height - 1; y > 0; y--)
+ for (HEIGHTTYPE y = cChunkDef::Height - 1; y > 0; y--)
{
if (a_Shape[y + x * 256 + z * 16 * 256] != 0)
{
@@ -612,8 +612,8 @@ void cChunkDesc::UpdateHeightmap(void)
{
for (int z = 0; z < cChunkDef::Width; z++)
{
- int Height = 0;
- for (int y = cChunkDef::Height - 1; y > 0; y--)
+ HEIGHTTYPE Height = 0;
+ for (HEIGHTTYPE y = cChunkDef::Height - 1; y > 0; y--)
{
BLOCKTYPE BlockType = GetBlockType(x, y, z);
if (BlockType != E_BLOCK_AIR)
@@ -636,7 +636,7 @@ void cChunkDesc::CompressBlockMetas(cChunkDef::BlockNibbles & a_DestMetas)
const NIBBLETYPE * AreaMetas = m_BlockArea.GetBlockMetas();
for (size_t i = 0; i < ARRAYCOUNT(a_DestMetas); i++)
{
- a_DestMetas[i] = AreaMetas[2 * i] | (AreaMetas[2 * i + 1] << 4);
+ a_DestMetas[i] = static_cast<NIBBLETYPE>(AreaMetas[2 * i] | (AreaMetas[2 * i + 1] << 4));
}
}
diff --git a/src/Generating/ChunkDesc.h b/src/Generating/ChunkDesc.h
index 480106fb5..1033242f8 100644
--- a/src/Generating/ChunkDesc.h
+++ b/src/Generating/ChunkDesc.h
@@ -65,8 +65,8 @@ public:
// These operate on the heightmap, so they could get out of sync with the data
// Use UpdateHeightmap() to re-calculate heightmap from the block data
- void SetHeight(int a_RelX, int a_RelZ, int a_Height);
- int GetHeight(int a_RelX, int a_RelZ);
+ void SetHeight(int a_RelX, int a_RelZ, HEIGHTTYPE a_Height);
+ HEIGHTTYPE GetHeight(int a_RelX, int a_RelZ);
// tolua_end
@@ -204,10 +204,10 @@ public:
// Accessors used by cChunkGenerator::Generator descendants:
inline cChunkDef::BiomeMap & GetBiomeMap (void) { return m_BiomeMap; }
- inline cChunkDef::BlockTypes & GetBlockTypes (void) { return *((cChunkDef::BlockTypes *)m_BlockArea.GetBlockTypes()); }
+ inline cChunkDef::BlockTypes & GetBlockTypes (void) { return *(reinterpret_cast<cChunkDef::BlockTypes *>(m_BlockArea.GetBlockTypes())); }
// CANNOT, different compression!
// inline cChunkDef::BlockNibbles & GetBlockMetas (void) { return *((cChunkDef::BlockNibbles *)m_BlockArea.GetBlockMetas()); }
- inline BlockNibbleBytes & GetBlockMetasUncompressed(void) { return *((BlockNibbleBytes *)m_BlockArea.GetBlockMetas()); }
+ inline BlockNibbleBytes & GetBlockMetasUncompressed(void) { return *(reinterpret_cast<BlockNibbleBytes *>(m_BlockArea.GetBlockMetas())); }
inline cChunkDef::HeightMap & GetHeightMap (void) { return m_HeightMap; }
inline cEntityList & GetEntities (void) { return m_Entities; }
inline cBlockEntityList & GetBlockEntities (void) { return m_BlockEntities; }
diff --git a/src/Generating/CompoGenBiomal.cpp b/src/Generating/CompoGenBiomal.cpp
index 3140bd754..60f7e7520 100644
--- a/src/Generating/CompoGenBiomal.cpp
+++ b/src/Generating/CompoGenBiomal.cpp
@@ -4,6 +4,9 @@
// Implements the cCompoGenBiomal class representing the biome-aware composition generator
#include "Globals.h"
+
+#include "CompoGenBiomal.h"
+
#include "ComposableGenerator.h"
#include "../IniFile.h"
#include "../Noise/Noise.h"
@@ -192,7 +195,7 @@ public:
protected:
/** The block height at which water is generated instead of air. */
- int m_SeaLevel;
+ HEIGHTTYPE m_SeaLevel;
/** The pattern used for mesa biomes. Initialized by seed on generator creation. */
cPattern::BlockInfo m_MesaPattern[2 * cChunkDef::Height];
@@ -221,7 +224,7 @@ protected:
virtual void InitializeCompoGen(cIniFile & a_IniFile) override
{
- m_SeaLevel = a_IniFile.GetValueSetI("Generator", "SeaLevel", m_SeaLevel);
+ m_SeaLevel = static_cast<HEIGHTTYPE>(a_IniFile.GetValueSetI("Generator", "SeaLevel", m_SeaLevel));
}
@@ -231,7 +234,7 @@ protected:
{
// In a loop, choose whether to use one, two or three layers of stained clay, then choose a color and width for each layer
// Separate each group with another layer of hardened clay
- cNoise patternNoise((unsigned)a_Seed);
+ cNoise patternNoise(a_Seed);
static NIBBLETYPE allowedColors[] =
{
E_META_STAINED_CLAY_YELLOW,
@@ -265,8 +268,8 @@ protected:
rnd /= 2;
for (int lay = 0; lay < numLayers; lay++)
{
- int numBlocks = layerSizes[(rnd % ARRAYCOUNT(layerSizes))];
- NIBBLETYPE Color = allowedColors[(rnd / 4) % ARRAYCOUNT(allowedColors)];
+ int numBlocks = layerSizes[(static_cast<size_t>(rnd) % ARRAYCOUNT(layerSizes))];
+ NIBBLETYPE Color = allowedColors[static_cast<size_t>(rnd / 4) % ARRAYCOUNT(allowedColors)];
if (
((numBlocks == 3) && (numLayers == 2)) || // In two-layer mode disallow the 3-high layers:
(Color == E_META_STAINED_CLAY_WHITE)) // White stained clay can ever be only 1 block high
@@ -411,7 +414,12 @@ protected:
FillColumnPattern(a_ChunkDesc, a_RelX, a_RelZ, Pattern, a_ShapeColumn);
return;
}
- default:
+ case biInvalidBiome:
+ case biHell:
+ case biSky:
+ case biNumBiomes:
+ case biVariant:
+ case biNumVariantBiomes:
{
ASSERT(!"Unhandled biome");
return;
@@ -427,7 +435,7 @@ protected:
{
bool HasHadWater = false;
int PatternIdx = 0;
- int top = std::max(m_SeaLevel, a_ChunkDesc.GetHeight(a_RelX, a_RelZ));
+ HEIGHTTYPE top = std::max(m_SeaLevel, a_ChunkDesc.GetHeight(a_RelX, a_RelZ));
for (int y = top; y > 0; y--)
{
if (a_ShapeColumn[y] > 0)
diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp
index 6b7643ddb..4eee8b707 100644
--- a/src/Generating/ComposableGenerator.cpp
+++ b/src/Generating/ComposableGenerator.cpp
@@ -221,11 +221,11 @@ void cComposableGenerator::InitBiomeGen(cIniFile & a_IniFile)
if (MultiCacheLength > 0)
{
LOGD("Enabling multicache for biomegen of length %d.", MultiCacheLength);
- m_BiomeGen = cBiomeGenPtr(new cBioGenMulticache(m_BiomeGen, CacheSize, MultiCacheLength));
+ m_BiomeGen = cBiomeGenPtr(new cBioGenMulticache(m_BiomeGen, static_cast<size_t>(CacheSize), static_cast<size_t>(MultiCacheLength)));
}
else
{
- m_BiomeGen = cBiomeGenPtr(new cBioGenCache(m_BiomeGen, CacheSize));
+ m_BiomeGen = cBiomeGenPtr(new cBioGenCache(m_BiomeGen, static_cast<size_t>(CacheSize)));
}
}
@@ -274,7 +274,7 @@ void cComposableGenerator::InitCompositionGen(cIniFile & a_IniFile)
}
// Create a cache of the composited heightmaps, so that finishers may use it:
- m_CompositedHeightCache = std::make_shared<cHeiGenMultiCache>(std::make_shared<cCompositedHeiGen>(m_ShapeGen, m_CompositionGen), 16, 24);
+ m_CompositedHeightCache = std::make_shared<cHeiGenMultiCache>(std::make_shared<cCompositedHeiGen>(m_BiomeGen, m_ShapeGen, m_CompositionGen), 16, 24);
// 24 subcaches of depth 16 each = 96 KiB of RAM. Acceptable, for the amount of work this saves.
}
@@ -618,7 +618,9 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
int MaxSize = a_IniFile.GetValueSetI("Generator", "VillageMaxSize", 128);
int MinDensity = a_IniFile.GetValueSetI("Generator", "VillageMinDensity", 50);
int MaxDensity = a_IniFile.GetValueSetI("Generator", "VillageMaxDensity", 80);
- m_FinishGens.push_back(std::make_shared<cVillageGen>(Seed, GridSize, MaxOffset, MaxDepth, MaxSize, MinDensity, MaxDensity, m_BiomeGen, m_CompositedHeightCache));
+ AString PrefabList = a_IniFile.GetValueSet("Generator", "VillagePrefabs", "PlainsVillage, SandVillage");
+ auto Prefabs = StringSplitAndTrim(PrefabList, ",");
+ m_FinishGens.push_back(std::make_shared<cVillageGen>(Seed, GridSize, MaxOffset, MaxDepth, MaxSize, MinDensity, MaxDensity, m_BiomeGen, m_CompositedHeightCache, Prefabs));
}
else if (NoCaseCompare(*itr, "Vines") == 0)
{
diff --git a/src/Generating/CompositedHeiGen.h b/src/Generating/CompositedHeiGen.h
index fa33a7861..c4e6ce77d 100644
--- a/src/Generating/CompositedHeiGen.h
+++ b/src/Generating/CompositedHeiGen.h
@@ -20,7 +20,8 @@ class cCompositedHeiGen:
public cTerrainHeightGen
{
public:
- cCompositedHeiGen(cTerrainShapeGenPtr a_ShapeGen, cTerrainCompositionGenPtr a_CompositionGen):
+ cCompositedHeiGen(cBiomeGenPtr a_BiomeGen, cTerrainShapeGenPtr a_ShapeGen, cTerrainCompositionGenPtr a_CompositionGen):
+ m_BiomeGen(a_BiomeGen),
m_ShapeGen(a_ShapeGen),
m_CompositionGen(a_CompositionGen)
{
@@ -28,18 +29,20 @@ public:
- // cTerrainheightGen overrides:
+ // cTerrainHeightGen overrides:
virtual void GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap) override
{
cChunkDesc::Shape shape;
m_ShapeGen->GenShape(a_ChunkX, a_ChunkZ, shape);
cChunkDesc desc(a_ChunkX, a_ChunkZ);
+ m_BiomeGen->GenBiomes(a_ChunkX, a_ChunkZ, desc.GetBiomeMap()); // Need to initialize biomes for the composition gen
desc.SetHeightFromShape(shape);
m_CompositionGen->ComposeTerrain(desc, shape);
memcpy(a_HeightMap, desc.GetHeightMap(), sizeof(a_HeightMap));
}
protected:
+ cBiomeGenPtr m_BiomeGen;
cTerrainShapeGenPtr m_ShapeGen;
cTerrainCompositionGenPtr m_CompositionGen;
};
diff --git a/src/Generating/DungeonRoomsFinisher.cpp b/src/Generating/DungeonRoomsFinisher.cpp
index c4bf8839e..c62da7492 100644
--- a/src/Generating/DungeonRoomsFinisher.cpp
+++ b/src/Generating/DungeonRoomsFinisher.cpp
@@ -194,7 +194,7 @@ protected:
{
return;
}
- a_ChunkDesc.SetBlockTypeMeta(RelX, m_FloorHeight + 1, RelZ, E_BLOCK_CHEST, (NIBBLETYPE)a_Chest.y);
+ a_ChunkDesc.SetBlockTypeMeta(RelX, m_FloorHeight + 1, RelZ, E_BLOCK_CHEST, static_cast<NIBBLETYPE>(a_Chest.y));
// Fill the chest with random loot
static const cLootProbab LootProbab[] =
@@ -217,7 +217,7 @@ protected:
{ cItem(E_ITEM_NAME_TAG), 1, 1, 10 },
} ;
- cChestEntity * ChestEntity = (cChestEntity *)a_ChunkDesc.GetBlockEntity(RelX, m_FloorHeight + 1, RelZ);
+ cChestEntity * ChestEntity = static_cast<cChestEntity *>(a_ChunkDesc.GetBlockEntity(RelX, m_FloorHeight + 1, RelZ));
ASSERT((ChestEntity != nullptr) && (ChestEntity->GetBlockType() == E_BLOCK_CHEST));
cNoise Noise(a_ChunkDesc.GetChunkX() ^ a_ChunkDesc.GetChunkZ());
int NumSlots = 3 + ((Noise.IntNoise3DInt(a_Chest.x, a_Chest.y, a_Chest.z) / 11) % 4);
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 00b34bddd..59af0fd63 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -69,7 +69,7 @@ void cFinishGenNetherClumpFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
}
// Choose what block to use.
- NOISE_DATATYPE BlockType = m_Noise.IntNoise3D((int) ChunkX, y, (int) ChunkZ);
+ NOISE_DATATYPE BlockType = m_Noise.IntNoise3D(static_cast<int>(ChunkX), y, static_cast<int>(ChunkZ));
if (BlockType < -0.7)
{
TryPlaceClump(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_BROWN_MUSHROOM);
@@ -260,13 +260,13 @@ void cFinishGenGlowStone::TryPlaceGlowstone(cChunkDesc & a_ChunkDesc, int a_RelX
for (int j = 0; j < a_Size; j++)
{
- Vector3i Direction = AvailableDirections[m_Noise.IntNoise3DInt(CurrentPos.x, CurrentPos.y * i, CurrentPos.z) % ARRAYCOUNT(AvailableDirections)];
+ Vector3i Direction = AvailableDirections[static_cast<size_t>(m_Noise.IntNoise3DInt(CurrentPos.x, CurrentPos.y * i, CurrentPos.z)) % ARRAYCOUNT(AvailableDirections)];
int Attempts = 2; // multiply by 1 would make no difference, so multiply by 2 instead
while (Direction.Equals(PreviousDirection))
{
// To make the glowstone branches look better we want to make the direction change every time.
- Direction = AvailableDirections[m_Noise.IntNoise3DInt(CurrentPos.x, CurrentPos.y * i * Attempts, CurrentPos.z) % ARRAYCOUNT(AvailableDirections)];
+ Direction = AvailableDirections[static_cast<size_t>(m_Noise.IntNoise3DInt(CurrentPos.x, CurrentPos.y * i * Attempts, CurrentPos.z)) % ARRAYCOUNT(AvailableDirections)];
Attempts++;
}
@@ -438,7 +438,7 @@ void cFinishGenVines::GenFinish(cChunkDesc & a_ChunkDesc)
continue;
}
- NIBBLETYPE Meta = Places[m_Noise.IntNoise3DInt(xx, y, zz) % Places.size()];
+ NIBBLETYPE Meta = Places[static_cast<size_t>(m_Noise.IntNoise3DInt(xx, y, zz)) % Places.size()];
a_ChunkDesc.SetBlockTypeMeta(x, y, z, E_BLOCK_VINES, Meta);
}
}
@@ -507,7 +507,7 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
for (int z = 0; z < cChunkDef::Width; z++)
{
int BlockZ = a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z;
- const float zz = (float)BlockZ;
+ const float zz = static_cast<float>(BlockZ);
for (int x = 0; x < cChunkDef::Width; x++)
{
int BlockX = a_ChunkDesc.GetChunkX() * cChunkDef::Width + x;
@@ -515,7 +515,7 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
{
continue;
}
- int Top = a_ChunkDesc.GetHeight(x, z);
+ HEIGHTTYPE Top = a_ChunkDesc.GetHeight(x, z);
if (Top > 250)
{
// Nothing grows above Y=250
@@ -528,7 +528,7 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
continue;
}
- const float xx = (float)BlockX;
+ const float xx = static_cast<float>(BlockX);
float val1 = m_Noise.CubicNoise2D(xx * 0.1f, zz * 0.1f);
float val2 = m_Noise.CubicNoise2D(xx * 0.01f, zz * 0.01f);
switch (a_ChunkDesc.GetBlockType(x, Top, z))
@@ -563,7 +563,7 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
}
else if ((val1 > 0.5) && (val2 < -0.5))
{
- a_ChunkDesc.SetBlockTypeMeta(x, ++Top, z, E_BLOCK_PUMPKIN, (int)(val3 * 8) % 4);
+ a_ChunkDesc.SetBlockTypeMeta(x, ++Top, z, E_BLOCK_PUMPKIN, static_cast<int>(val3 * 8) % 4);
}
break;
} // case E_BLOCK_GRASS
@@ -650,9 +650,9 @@ void cFinishGenSoulsandRims::GenFinish(cChunkDesc & a_ChunkDesc)
continue;
}
- NOISE_DATATYPE NoiseX = ((NOISE_DATATYPE)(xx)) / 32;
- NOISE_DATATYPE NoiseY = ((NOISE_DATATYPE)(zz)) / 32;
- NOISE_DATATYPE CompBlock = m_Noise.CubicNoise3D(NoiseX, (float) (y) / 4, NoiseY);
+ NOISE_DATATYPE NoiseX = (static_cast<NOISE_DATATYPE>(xx)) / 32;
+ NOISE_DATATYPE NoiseY = (static_cast<NOISE_DATATYPE>(zz)) / 32;
+ NOISE_DATATYPE CompBlock = m_Noise.CubicNoise3D(NoiseX, static_cast<float>(y) / 4, NoiseY);
if (CompBlock < 0)
{
a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_SOULSAND);
@@ -676,7 +676,7 @@ void cFinishGenSnow::GenFinish(cChunkDesc & a_ChunkDesc)
{
for (int x = 0; x < cChunkDef::Width; x++)
{
- int Height = a_ChunkDesc.GetHeight(x, z);
+ HEIGHTTYPE Height = a_ChunkDesc.GetHeight(x, z);
if (GetSnowStartHeight(a_ChunkDesc.GetBiome(x, z)) > Height)
{
// Height isn't high enough for snow to start forming.
@@ -775,7 +775,7 @@ void cFinishGenSingleTopBlock::GenFinish(cChunkDesc & a_ChunkDesc)
continue;
}
- int Height = a_ChunkDesc.GetHeight(x, z);
+ HEIGHTTYPE Height = a_ChunkDesc.GetHeight(x, z);
if (Height >= cChunkDef::Height - 1)
{
// Too high up
@@ -918,7 +918,7 @@ void cFinishGenPreSimulator::CollapseSandGravel(
}
} // switch (GetBlock)
} // for y
- cChunkDef::SetHeight(a_HeightMap, x, z, HeightY);
+ cChunkDef::SetHeight(a_HeightMap, x, z, static_cast<HEIGHTTYPE>(HeightY));
} // for x
} // for z
}
@@ -1259,7 +1259,7 @@ bool cFinishGenPassiveMobs::TrySpawnAnimals(cChunkDesc & a_ChunkDesc, int a_RelX
}
if (
(BlockUnderFeet != E_BLOCK_GRASS) &&
- ((AnimalToSpawn == mtSheep) || (AnimalToSpawn == mtChicken) || (AnimalToSpawn == mtPig))
+ ((AnimalToSpawn == mtWolf) || (AnimalToSpawn == mtRabbit) || (AnimalToSpawn == mtCow) || (AnimalToSpawn == mtSheep) || (AnimalToSpawn == mtChicken) || (AnimalToSpawn == mtPig))
)
{
return false;
@@ -1274,6 +1274,7 @@ bool cFinishGenPassiveMobs::TrySpawnAnimals(cChunkDesc & a_ChunkDesc, int a_RelX
double AnimalZ = static_cast<double>(a_ChunkDesc.GetChunkZ() * cChunkDef::Width + a_RelZ + 0.5);
cMonster * NewMob = cMonster::NewMonsterFromType(AnimalToSpawn);
+ NewMob->SetHealth(NewMob->GetMaxHealth());
NewMob->SetPosition(AnimalX, AnimalY, AnimalZ);
a_ChunkDesc.GetEntities().push_back(NewMob);
LOGD("Spawning %s #%i at {%.02f, %.02f, %.02f}", NewMob->GetClass(), NewMob->GetUniqueID(), AnimalX, AnimalY, AnimalZ);
@@ -1374,8 +1375,12 @@ eMonsterType cFinishGenPassiveMobs::GetRandomMob(cChunkDesc & a_ChunkDesc)
return mtInvalidType;
}
- int RandMob = (m_Noise.IntNoise2DInt(chunkX - chunkZ + 2, chunkX + 5) / 7) % ListOfSpawnables.size();
auto MobIter = ListOfSpawnables.begin();
+ using diff_type =
+ std::iterator_traits<decltype(MobIter)>::difference_type;
+ diff_type RandMob = static_cast<diff_type>
+ (static_cast<size_t>(m_Noise.IntNoise2DInt(chunkX - chunkZ + 2, chunkX + 5) / 7)
+ % ListOfSpawnables.size());
std::advance(MobIter, RandMob);
return *MobIter;
diff --git a/src/Generating/GridStructGen.cpp b/src/Generating/GridStructGen.cpp
index 3c08c1a39..5adc60c4f 100644
--- a/src/Generating/GridStructGen.cpp
+++ b/src/Generating/GridStructGen.cpp
@@ -64,13 +64,13 @@ cGridStructGen::cGridStructGen(
LOG("Grid Size cannot be zero, setting to 1");
m_GridSizeZ = 1;
}
- size_t NumStructuresPerQuery = (size_t)(((m_MaxStructureSizeX + m_MaxOffsetX) / m_GridSizeX + 1) * ((m_MaxStructureSizeZ + m_MaxOffsetZ) / m_GridSizeZ + 1));
+ size_t NumStructuresPerQuery = static_cast<size_t>(((m_MaxStructureSizeX + m_MaxOffsetX) / m_GridSizeX + 1) * ((m_MaxStructureSizeZ + m_MaxOffsetZ) / m_GridSizeZ + 1));
if (NumStructuresPerQuery > m_MaxCacheSize)
{
m_MaxCacheSize = NumStructuresPerQuery * 4;
LOGINFO(
"cGridStructGen: The cache size is too small (%u), increasing the cache size to %u to avoid inefficiency.",
- (unsigned)a_MaxCacheSize, (unsigned)m_MaxCacheSize
+ static_cast<unsigned>(a_MaxCacheSize), static_cast<unsigned>(m_MaxCacheSize)
);
}
}
diff --git a/src/Generating/HeiGen.cpp b/src/Generating/HeiGen.cpp
index e34ffc57c..6cfd53837 100644
--- a/src/Generating/HeiGen.cpp
+++ b/src/Generating/HeiGen.cpp
@@ -58,7 +58,7 @@ public:
virtual void GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap) override
{
int heights[cChunkDef::Width * cChunkDef::Width];
- m_Gen->GetInts(a_ChunkX * cChunkDef::Width, a_ChunkZ * cChunkDef::Width, cChunkDef::Width, cChunkDef::Width, heights);
+ m_Gen->GetInts(a_ChunkX * cChunkDef::Width, a_ChunkZ * cChunkDef::Width, static_cast<size_t>(cChunkDef::Width), static_cast<size_t>(cChunkDef::Width), heights);
for (size_t i = 0; i < ARRAYCOUNT(heights); i++)
{
a_HeightMap[i] = static_cast<HEIGHTTYPE>(std::max(std::min(60 + heights[i], cChunkDef::Height - 60), 40));
@@ -92,7 +92,7 @@ void cHeiGenFlat::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap
void cHeiGenFlat::InitializeHeightGen(cIniFile & a_IniFile)
{
- m_Height = a_IniFile.GetValueSetI("Generator", "FlatHeight", m_Height);
+ m_Height = static_cast<HEIGHTTYPE>(a_IniFile.GetValueSetI("Generator", "FlatHeight", m_Height));
}
@@ -102,16 +102,16 @@ void cHeiGenFlat::InitializeHeightGen(cIniFile & a_IniFile)
////////////////////////////////////////////////////////////////////////////////
// cHeiGenCache:
-cHeiGenCache::cHeiGenCache(cTerrainHeightGenPtr a_HeiGenToCache, int a_CacheSize) :
+cHeiGenCache::cHeiGenCache(cTerrainHeightGenPtr a_HeiGenToCache, size_t a_CacheSize) :
m_HeiGenToCache(a_HeiGenToCache),
m_CacheSize(a_CacheSize),
- m_CacheOrder(new int[a_CacheSize]),
+ m_CacheOrder(new size_t[a_CacheSize]),
m_CacheData(new sCacheData[a_CacheSize]),
m_NumHits(0),
m_NumMisses(0),
m_TotalChain(0)
{
- for (int i = 0; i < m_CacheSize; i++)
+ for (size_t i = 0; i < m_CacheSize; i++)
{
m_CacheOrder[i] = i;
m_CacheData[i].m_ChunkX = 0x7fffffff;
@@ -141,11 +141,11 @@ void cHeiGenCache::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap
if (((m_NumHits + m_NumMisses) % 1024) == 10)
{
LOGD("HeiGenCache: %d hits, %d misses, saved %.2f %%", m_NumHits, m_NumMisses, 100.0 * m_NumHits / (m_NumHits + m_NumMisses));
- LOGD("HeiGenCache: Avg cache chain length: %.2f", (float)m_TotalChain / m_NumHits);
+ LOGD("HeiGenCache: Avg cache chain length: %.2f", static_cast<double>(m_TotalChain) / m_NumHits);
}
//*/
- for (int i = 0; i < m_CacheSize; i++)
+ for (size_t i = 0; i < m_CacheSize; i++)
{
if (
(m_CacheData[m_CacheOrder[i]].m_ChunkX != a_ChunkX) ||
@@ -155,10 +155,10 @@ void cHeiGenCache::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap
continue;
}
// Found it in the cache
- int Idx = m_CacheOrder[i];
+ auto Idx = m_CacheOrder[i];
// Move to front:
- for (int j = i; j > 0; j--)
+ for (size_t j = i; j > 0; j--)
{
m_CacheOrder[j] = m_CacheOrder[j - 1];
}
@@ -177,8 +177,8 @@ void cHeiGenCache::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap
m_HeiGenToCache->GenHeightMap(a_ChunkX, a_ChunkZ, a_HeightMap);
// Insert it as the first item in the MRU order:
- int Idx = m_CacheOrder[m_CacheSize - 1];
- for (int i = m_CacheSize - 1; i > 0; i--)
+ auto Idx = m_CacheOrder[m_CacheSize - 1];
+ for (auto i = m_CacheSize - 1; i > 0; i--)
{
m_CacheOrder[i] = m_CacheOrder[i - 1];
} // for i - m_CacheOrder[]
@@ -194,7 +194,7 @@ void cHeiGenCache::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap
bool cHeiGenCache::GetHeightAt(int a_ChunkX, int a_ChunkZ, int a_RelX, int a_RelZ, HEIGHTTYPE & a_Height)
{
- for (int i = 0; i < m_CacheSize; i++)
+ for (size_t i = 0; i < m_CacheSize; i++)
{
if ((m_CacheData[i].m_ChunkX == a_ChunkX) && (m_CacheData[i].m_ChunkZ == a_ChunkZ))
{
@@ -300,15 +300,7 @@ void cHeiGenClassic::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightM
{
const float xx = (float)(a_ChunkX * cChunkDef::Width + x);
- int hei = 64 + (int)(GetNoise(xx * 0.05f, zz * 0.05f) * 16);
- if (hei < 10)
- {
- hei = 10;
- }
- if (hei > 250)
- {
- hei = 250;
- }
+ HEIGHTTYPE hei = static_cast<HEIGHTTYPE>(Clamp(static_cast<int>(64 + (GetNoise(xx * 0.05f, zz * 0.05f) * 16)), 10, 250));
cChunkDef::SetHeight(a_HeightMap, x, z, hei);
} // for x
} // for z
@@ -366,15 +358,7 @@ void cHeiGenMountains::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::Heigh
for (int x = 0; x < cChunkDef::Width; x++)
{
int idx = IdxZ + x;
- int hei = 100 - (int)((MountainNoise[idx] - DitchNoise[idx] + PerlinNoise[idx]) * 15);
- if (hei < 10)
- {
- hei = 10;
- }
- if (hei > 250)
- {
- hei = 250;
- }
+ HEIGHTTYPE hei = static_cast<HEIGHTTYPE>(Clamp(100 - static_cast<int>((MountainNoise[idx] - DitchNoise[idx] + PerlinNoise[idx]) * 15), 10, 250));
cChunkDef::SetHeight(a_HeightMap, x, z, hei);
} // for x
} // for z
@@ -536,7 +520,7 @@ void cHeiGenBiomal::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMa
{
for (int x = 0; x < cChunkDef::Width; x++)
{
- cChunkDef::SetHeight(a_HeightMap, x, z, (int)Height[x + 17 * z]);
+ cChunkDef::SetHeight(a_HeightMap, x, z, static_cast<HEIGHTTYPE>(Height[x + 17 * z]));
}
}
//*/
@@ -817,7 +801,10 @@ protected:
case biTaiga: a_Min = 63; a_Max = 75; break;
case biTaigaHills: a_Min = 63; a_Max = 90; break;
case biTaigaM: a_Min = 63; a_Max = 80; break;
- default:
+ case biInvalidBiome:
+ case biNumBiomes:
+ case biVariant:
+ case biNumVariantBiomes:
{
ASSERT(!"Unknown biome");
a_Min = 10;
diff --git a/src/Generating/HeiGen.h b/src/Generating/HeiGen.h
index 62bb227c6..0dc9c814b 100644
--- a/src/Generating/HeiGen.h
+++ b/src/Generating/HeiGen.h
@@ -28,7 +28,7 @@ class cHeiGenCache :
public cTerrainHeightGen
{
public:
- cHeiGenCache(cTerrainHeightGenPtr a_HeiGenToCache, int a_CacheSize);
+ cHeiGenCache(cTerrainHeightGenPtr a_HeiGenToCache, size_t a_CacheSize);
~cHeiGenCache();
// cTerrainHeightGen overrides:
@@ -49,14 +49,14 @@ protected:
cTerrainHeightGenPtr m_HeiGenToCache;
// To avoid moving large amounts of data for the MRU behavior, we MRU-ize indices to an array of the actual data
- int m_CacheSize;
- int * m_CacheOrder; // MRU-ized order, indices into m_CacheData array
+ size_t m_CacheSize;
+ size_t * m_CacheOrder; // MRU-ized order, indices into m_CacheData array
sCacheData * m_CacheData; // m_CacheData[m_CacheOrder[0]] is the most recently used
// Cache statistics
- int m_NumHits;
- int m_NumMisses;
- int m_TotalChain; // Number of cache items walked to get to a hit (only added for hits)
+ size_t m_NumHits;
+ size_t m_NumMisses;
+ size_t m_TotalChain; // Number of cache items walked to get to a hit (only added for hits)
} ;
@@ -103,7 +103,7 @@ public:
protected:
- int m_Height;
+ HEIGHTTYPE m_Height;
// cTerrainHeightGen overrides:
virtual void GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap) override;
diff --git a/src/Generating/IntGen.h b/src/Generating/IntGen.h
index 9cc881639..3f94ec3d0 100644
--- a/src/Generating/IntGen.h
+++ b/src/Generating/IntGen.h
@@ -754,7 +754,7 @@ public:
int IdxZ = z * SizeX;
for (int x = 0; x < SizeX; x++)
{
- size_t val = (size_t)a_Values[x + IdxZ];
+ size_t val = static_cast<size_t>(a_Values[x + IdxZ]);
const cBiomesInGroups & Biomes = (val > bgfRare) ?
rareBiomesInGroups[(val & (bgfRare - 1)) % ARRAYCOUNT(rareBiomesInGroups)] :
biomesInGroups[val % ARRAYCOUNT(biomesInGroups)];
@@ -891,7 +891,7 @@ public:
}
// There's a river, change the output to a river or a frozen river, based on the original biome:
- if (IsBiomeVeryCold((EMCSBiome)a_Values[idx]))
+ if (IsBiomeVeryCold(static_cast<EMCSBiome>(a_Values[idx])))
{
a_Values[idx] = biFrozenRiver;
}
diff --git a/src/Generating/MineShafts.cpp b/src/Generating/MineShafts.cpp
index 65588ce4b..4ba896ef6 100644
--- a/src/Generating/MineShafts.cpp
+++ b/src/Generating/MineShafts.cpp
@@ -542,7 +542,7 @@ cMineShaft * cMineShaftCorridor::CreateAndFit(
{
cCuboid BoundingBox(a_PivotX, a_PivotY - 1, a_PivotZ);
BoundingBox.p2.y += 3;
- int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + (int)a_ParentSystem.m_MineShafts.size(), a_PivotZ) / 7;
+ int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + static_cast<int>(a_ParentSystem.m_MineShafts.size()), a_PivotZ) / 7;
int NumSegments = 2 + (rnd) % (MAX_SEGMENTS - 1); // 2 .. MAX_SEGMENTS
switch (a_Direction)
{
@@ -564,14 +564,14 @@ cMineShaft * cMineShaftCorridor::CreateAndFit(
void cMineShaftCorridor::AppendBranches(int a_RecursionLevel, cNoise & a_Noise)
{
- int rnd = a_Noise.IntNoise3DInt(m_BoundingBox.p1.x, m_BoundingBox.p1.y + a_RecursionLevel, m_BoundingBox.p1.z) / 7;
+ int Outerrnd = a_Noise.IntNoise3DInt(m_BoundingBox.p1.x, m_BoundingBox.p1.y + a_RecursionLevel, m_BoundingBox.p1.z) / 7;
// Prefer the same height, but allow for up to one block height displacement:
- int Height = m_BoundingBox.p1.y + ((rnd % 4) + ((rnd >> 3) % 3)) / 2;
+ int OuterHeight = m_BoundingBox.p1.y + ((Outerrnd % 4) + ((Outerrnd >> 3) % 3)) / 2;
switch (m_Direction)
{
case dirXM:
{
- m_ParentSystem.AppendBranch(m_BoundingBox.p1.x - 1, Height, m_BoundingBox.p1.z + 1, dirXM, a_Noise, a_RecursionLevel);
+ m_ParentSystem.AppendBranch(m_BoundingBox.p1.x - 1, OuterHeight, m_BoundingBox.p1.z + 1, dirXM, a_Noise, a_RecursionLevel);
for (int i = m_NumSegments; i >= 0; i--)
{
int rnd = a_Noise.IntNoise3DInt(m_BoundingBox.p1.x + i + 10, m_BoundingBox.p1.y + a_RecursionLevel, m_BoundingBox.p1.z) / 11;
@@ -586,7 +586,7 @@ void cMineShaftCorridor::AppendBranches(int a_RecursionLevel, cNoise & a_Noise)
case dirXP:
{
- m_ParentSystem.AppendBranch(m_BoundingBox.p2.x + 1, Height, m_BoundingBox.p1.z + 1, dirXP, a_Noise, a_RecursionLevel);
+ m_ParentSystem.AppendBranch(m_BoundingBox.p2.x + 1, OuterHeight, m_BoundingBox.p1.z + 1, dirXP, a_Noise, a_RecursionLevel);
for (int i = m_NumSegments; i >= 0; i--)
{
int rnd = a_Noise.IntNoise3DInt(m_BoundingBox.p1.x + i + 10, m_BoundingBox.p1.y + a_RecursionLevel, m_BoundingBox.p1.z) / 11;
@@ -601,7 +601,7 @@ void cMineShaftCorridor::AppendBranches(int a_RecursionLevel, cNoise & a_Noise)
case dirZM:
{
- m_ParentSystem.AppendBranch(m_BoundingBox.p1.x + 1, Height, m_BoundingBox.p1.z - 1, dirZM, a_Noise, a_RecursionLevel);
+ m_ParentSystem.AppendBranch(m_BoundingBox.p1.x + 1, OuterHeight, m_BoundingBox.p1.z - 1, dirZM, a_Noise, a_RecursionLevel);
for (int i = m_NumSegments; i >= 0; i--)
{
int rnd = a_Noise.IntNoise3DInt(m_BoundingBox.p1.x + i + 10, m_BoundingBox.p1.y + a_RecursionLevel, m_BoundingBox.p1.z) / 11;
@@ -616,7 +616,7 @@ void cMineShaftCorridor::AppendBranches(int a_RecursionLevel, cNoise & a_Noise)
case dirZP:
{
- m_ParentSystem.AppendBranch(m_BoundingBox.p1.x + 1, Height, m_BoundingBox.p2.z + 1, dirZP, a_Noise, a_RecursionLevel);
+ m_ParentSystem.AppendBranch(m_BoundingBox.p1.x + 1, OuterHeight, m_BoundingBox.p2.z + 1, dirZP, a_Noise, a_RecursionLevel);
for (int i = m_NumSegments; i >= 0; i--)
{
int rnd = a_Noise.IntNoise3DInt(m_BoundingBox.p1.x + i + 10, m_BoundingBox.p1.y + a_RecursionLevel, m_BoundingBox.p1.z) / 11;
@@ -781,13 +781,19 @@ void cMineShaftCorridor::PlaceChest(cChunkDesc & a_ChunkDesc)
case dirZM:
case dirZP:
- default:
{
x = m_BoundingBox.p1.x - BlockX;
z = m_BoundingBox.p1.z + m_ChestPosition - BlockZ;
Meta = E_META_CHEST_FACING_XP;
break;
}
+ #if !defined(__clang__)
+ default:
+ {
+ ASSERT(!"Unknown direction");
+ return;
+ }
+ #endif
} // switch (Dir)
if (
@@ -796,7 +802,7 @@ void cMineShaftCorridor::PlaceChest(cChunkDesc & a_ChunkDesc)
)
{
a_ChunkDesc.SetBlockTypeMeta(x, m_BoundingBox.p1.y + 1, z, E_BLOCK_CHEST, Meta);
- cChestEntity * ChestEntity = (cChestEntity *)a_ChunkDesc.GetBlockEntity(x, m_BoundingBox.p1.y + 1, z);
+ cChestEntity * ChestEntity = static_cast<cChestEntity *>(a_ChunkDesc.GetBlockEntity(x, m_BoundingBox.p1.y + 1, z));
ASSERT((ChestEntity != nullptr) && (ChestEntity->GetBlockType() == E_BLOCK_CHEST));
cNoise Noise(a_ChunkDesc.GetChunkX() ^ a_ChunkDesc.GetChunkZ());
int NumSlots = 3 + ((Noise.IntNoise3DInt(x, m_BoundingBox.p1.y, z) / 11) % 4);
@@ -986,7 +992,7 @@ cMineShaft * cMineShaftCrossing::CreateAndFit(
)
{
cCuboid BoundingBox(a_PivotX, a_PivotY - 1, a_PivotZ);
- int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + (int)a_ParentSystem.m_MineShafts.size(), a_PivotZ) / 7;
+ int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + static_cast<int>(a_ParentSystem.m_MineShafts.size()), a_PivotZ) / 7;
BoundingBox.p2.y += 3;
if ((rnd % 4) < 2)
{
@@ -1127,7 +1133,7 @@ cMineShaft * cMineShaftStaircase::CreateAndFit(
cNoise & a_Noise
)
{
- int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + (int)a_ParentSystem.m_MineShafts.size(), a_PivotZ) / 7;
+ int rnd = a_Noise.IntNoise3DInt(a_PivotX, a_PivotY + static_cast<int>(a_ParentSystem.m_MineShafts.size()), a_PivotZ) / 7;
cCuboid Box;
switch (a_Direction)
{
diff --git a/src/Generating/NetherFortGen.cpp b/src/Generating/NetherFortGen.cpp
index f35555efd..d29ab8cd1 100644
--- a/src/Generating/NetherFortGen.cpp
+++ b/src/Generating/NetherFortGen.cpp
@@ -36,7 +36,7 @@ public:
int BlockY = 64;
// Generate pieces:
- for (int i = 0; m_Pieces.size() < (size_t)(a_MaxDepth * a_MaxDepth / 8 + a_MaxDepth); i++)
+ for (int i = 0; m_Pieces.size() < static_cast<size_t>(a_MaxDepth * a_MaxDepth / 8 + a_MaxDepth); i++)
{
cBFSPieceGenerator pg(cNetherFortGen::m_PiecePool, a_Seed + i);
pg.PlacePieces(a_OriginX, BlockY, a_OriginZ, a_MaxDepth, m_Pieces);
@@ -55,7 +55,7 @@ public:
{
for (cPlacedPieces::const_iterator itr = m_Pieces.begin(), end = m_Pieces.end(); itr != end; ++itr)
{
- const cPrefab & Prefab = (const cPrefab &)((*itr)->GetPiece());
+ const cPrefab & Prefab = static_cast<const cPrefab &>((*itr)->GetPiece());
Prefab.Draw(a_Chunk, *itr);
} // for itr - m_PlacedPieces[]
}
diff --git a/src/Generating/Noise3DGenerator.cpp b/src/Generating/Noise3DGenerator.cpp
index 63e88c2a8..8163746f8 100644
--- a/src/Generating/Noise3DGenerator.cpp
+++ b/src/Generating/Noise3DGenerator.cpp
@@ -305,7 +305,7 @@ void cNoise3DGenerator::UpdateHeightmap(cChunkDesc & a_ChunkDesc)
{
for (int x = 0; x < cChunkDef::Width; x++)
{
- for (int y = cChunkDef::Height - 1; y > 0; y--)
+ for (HEIGHTTYPE y = cChunkDef::Height - 1; y > 0; y--)
{
if (a_ChunkDesc.GetBlockType(x, y, z) != E_BLOCK_AIR)
{
@@ -790,7 +790,10 @@ void cBiomalNoise3DComposable::GetBiomeParams(EMCSBiome a_Biome, NOISE_DATATYPE
case biTaiga: a_HeightAmp = 0.1f; a_MidPoint = 64; break;
case biTaigaM: a_HeightAmp = 0.1f; a_MidPoint = 70; break;
case biTaigaHills: a_HeightAmp = 0.075f; a_MidPoint = 68; break;
- default:
+ case biInvalidBiome:
+ case biNumBiomes:
+ case biVariant:
+ case biNumVariantBiomes:
{
// Make a crazy terrain so that it stands out
a_HeightAmp = 0.001f;
diff --git a/src/Generating/POCPieceGenerator.cpp b/src/Generating/POCPieceGenerator.cpp
index 6e7e74d7a..834e3887f 100644
--- a/src/Generating/POCPieceGenerator.cpp
+++ b/src/Generating/POCPieceGenerator.cpp
@@ -32,7 +32,7 @@ public:
/** Imprints the piece in the specified chunk. Assumes they intersect. */
- void ImprintInChunk(cChunkDesc & a_ChunkDesc, const Vector3i & a_Pos, int a_NumCCWRotations)
+ void ImprintInChunk(cChunkDesc & a_ChunkDesc, const Vector3i & a_Pos, int a_NumCCWRotations) const
{
int BlockX = a_ChunkDesc.GetChunkX() * cChunkDef::Width;
int BlockZ = a_ChunkDesc.GetChunkZ() * cChunkDef::Width;
@@ -227,7 +227,7 @@ void cPOCPieceGenerator::GenFinish(cChunkDesc & a_ChunkDesc)
continue;
}
- ((cPOCPiece &)(*itr)->GetPiece()).ImprintInChunk(a_ChunkDesc, Pos, (*itr)->GetNumCCWRotations());
+ (static_cast<const cPOCPiece &>((*itr)->GetPiece())).ImprintInChunk(a_ChunkDesc, Pos, (*itr)->GetNumCCWRotations());
} // for itr - m_Pieces[]
a_ChunkDesc.UpdateHeightmap();
}
diff --git a/src/Generating/PieceGenerator.cpp b/src/Generating/PieceGenerator.cpp
index 97aa646fc..93e7179e2 100644
--- a/src/Generating/PieceGenerator.cpp
+++ b/src/Generating/PieceGenerator.cpp
@@ -6,6 +6,7 @@
#include "Globals.h"
#include "PieceGenerator.h"
+#include "../SelfTests.h"
@@ -22,6 +23,11 @@ static class cPieceGeneratorSelfTest :
public:
cPieceGeneratorSelfTest(void)
{
+ cSelfTests::Get().Register(std::bind(&cPieceGeneratorSelfTest::Test, this), "PieceGenerator");
+ }
+
+ void Test(void)
+ {
// Prepare the internal state:
InitializePieces();
@@ -31,14 +37,14 @@ public:
Gen.PlacePieces(500, 50, 500, 3, OutPieces);
// Print out the pieces:
- printf("OutPieces.size() = " SIZE_T_FMT "\n", OutPieces.size());
+ LOG("OutPieces.size() = " SIZE_T_FMT, OutPieces.size());
size_t idx = 0;
for (cPlacedPieces::const_iterator itr = OutPieces.begin(), end = OutPieces.end(); itr != end; ++itr, ++idx)
{
const Vector3i & Coords = (*itr)->GetCoords();
cCuboid Hitbox = (*itr)->GetHitBox();
Hitbox.Sort();
- printf(SIZE_T_FMT ": {%d, %d, %d}, rot %d, hitbox {%d, %d, %d} - {%d, %d, %d} (%d * %d * %d)\n", idx,
+ LOG(SIZE_T_FMT ": {%d, %d, %d}, rot %d, hitbox {%d, %d, %d} - {%d, %d, %d} (%d * %d * %d)", idx,
Coords.x, Coords.y, Coords.z,
(*itr)->GetNumCCWRotations(),
Hitbox.p1.x, Hitbox.p1.y, Hitbox.p1.z,
@@ -46,7 +52,7 @@ public:
Hitbox.DifX() + 1, Hitbox.DifY() + 1, Hitbox.DifZ() + 1
);
} // itr - OutPieces[]
- printf("Done.\n");
+ LOG("Done.");
// Free the placed pieces properly:
Gen.FreePieces(OutPieces);
@@ -385,7 +391,7 @@ cPlacedPiece * cPieceGenerator::PlaceStartingPiece(int a_BlockX, int a_BlockY, i
else
{
// All pieces returned zero weight, but we need one to start. Choose with equal chance:
- StartingPiece = StartingPieces[rnd % StartingPieces.size()];
+ StartingPiece = StartingPieces[static_cast<size_t>(rnd) % StartingPieces.size()];
}
rnd = rnd >> 16;
@@ -394,9 +400,9 @@ cPlacedPiece * cPieceGenerator::PlaceStartingPiece(int a_BlockX, int a_BlockY, i
int NumRotations = 1;
for (size_t i = 1; i < ARRAYCOUNT(Rotations); i++)
{
- if (StartingPiece->CanRotateCCW((int)i))
+ if (StartingPiece->CanRotateCCW(static_cast<int>(i)))
{
- Rotations[NumRotations] = (int)i;
+ Rotations[NumRotations] = static_cast<int>(i);
NumRotations += 1;
}
}
@@ -561,7 +567,10 @@ void cPieceGenerator::DebugConnectorPool(const cPieceGenerator::cFreeConnectors
{
printf(" Connector pool: " SIZE_T_FMT " items\n", a_ConnectorPool.size() - a_NumProcessed);
size_t idx = 0;
- for (cPieceGenerator::cFreeConnectors::const_iterator itr = a_ConnectorPool.begin() + a_NumProcessed, end = a_ConnectorPool.end(); itr != end; ++itr, ++idx)
+
+ typedef cPieceGenerator::cFreeConnectors::difference_type difType;
+
+ for (auto itr = a_ConnectorPool.cbegin() + static_cast<difType>(a_NumProcessed), end = a_ConnectorPool.cend(); itr != end; ++itr, ++idx)
{
printf(" " SIZE_T_FMT ": {%d, %d, %d}, type %d, direction %s, depth %d\n",
idx,
@@ -672,7 +681,10 @@ void cBFSPieceGenerator::PlacePieces(int a_BlockX, int a_BlockY, int a_BlockZ, i
NumProcessed++;
if (NumProcessed > 1000)
{
- ConnectorPool.erase(ConnectorPool.begin(), ConnectorPool.begin() + NumProcessed);
+
+ typedef cPieceGenerator::cFreeConnectors::difference_type difType;
+
+ ConnectorPool.erase(ConnectorPool.begin(), ConnectorPool.begin() + static_cast<difType>(NumProcessed));
NumProcessed = 0;
}
}
diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp
index 761986690..e5e6a1e06 100644
--- a/src/Generating/Prefab.cpp
+++ b/src/Generating/Prefab.cpp
@@ -166,6 +166,45 @@ cPrefab::cPrefab(const cBlockArea & a_Image, int a_AllowedRotations) :
+cPrefab::cPrefab(const cBlockArea & a_Image) :
+ m_Size(a_Image.GetSize()),
+ m_AllowedRotations(0),
+ m_MergeStrategy(cBlockArea::msOverwrite),
+ m_ShouldExtendFloor(false),
+ m_DefaultWeight(1),
+ m_AddWeightIfSame(0),
+ m_MoveToGround(false)
+{
+ m_HitBox.p1.Set(0, 0, 0);
+ m_HitBox.p2.Set(m_Size.x - 1, m_Size.y - 1, m_Size.z - 1);
+ m_BlockArea[0].CopyFrom(a_Image);
+}
+
+
+
+
+
+cPrefab::cPrefab(const AString & a_BlockDefinitions, const AString & a_BlockData, int a_SizeX, int a_SizeY, int a_SizeZ) :
+ m_Size(a_SizeX, a_SizeY, a_SizeZ),
+ m_AllowedRotations(0),
+ m_MergeStrategy(cBlockArea::msOverwrite),
+ m_ShouldExtendFloor(false),
+ m_DefaultWeight(1),
+ m_AddWeightIfSame(0),
+ m_MoveToGround(false)
+{
+ m_HitBox.p1.Set(0, 0, 0);
+ m_HitBox.p2.Set(m_Size.x - 1, m_Size.y - 1, m_Size.z - 1);
+ m_BlockArea[0].Create(m_Size);
+ CharMap cm;
+ ParseCharMap(cm, a_BlockDefinitions.c_str());
+ ParseBlockImage(cm, a_BlockData.c_str());
+}
+
+
+
+
+
void cPrefab::AddRotatedBlockAreas(void)
{
// 1 CCW rotation:
@@ -326,6 +365,16 @@ void cPrefab::AddConnector(int a_RelX, int a_RelY, int a_RelZ, eBlockFace a_Dire
+void cPrefab::SetAllowedRotations(int a_AllowedRotations)
+{
+ m_AllowedRotations = a_AllowedRotations;
+ AddRotatedBlockAreas();
+}
+
+
+
+
+
void cPrefab::ParseCharMap(CharMap & a_CharMapOut, const char * a_CharMapDef)
{
ASSERT(a_CharMapDef != nullptr);
@@ -348,13 +397,13 @@ void cPrefab::ParseCharMap(CharMap & a_CharMapOut, const char * a_CharMapDef)
LOGWARNING("Bad prefab CharMap definition line: \"%s\", skipping.", itr->c_str());
continue;
}
- unsigned char Src = (unsigned char)CharDef[0][0];
+ unsigned char Src = static_cast<unsigned char>(CharDef[0][0]);
ASSERT(a_CharMapOut[Src].m_BlockMeta == 16); // This letter has not been assigned yet?
- a_CharMapOut[Src].m_BlockType = (BLOCKTYPE)atoi(CharDef[1].c_str());
+ a_CharMapOut[Src].m_BlockType = static_cast<BLOCKTYPE>(atoi(CharDef[1].c_str()));
NIBBLETYPE BlockMeta = 0;
if ((NumElements >= 3) && !CharDef[2].empty())
{
- BlockMeta = (NIBBLETYPE)atoi(CharDef[2].c_str());
+ BlockMeta = static_cast<NIBBLETYPE>(atoi(CharDef[2].c_str()));
ASSERT((BlockMeta <= 15));
}
a_CharMapOut[Src].m_BlockMeta = BlockMeta;
@@ -372,7 +421,7 @@ void cPrefab::ParseBlockImage(const CharMap & a_CharMap, const char * a_BlockIma
{
for (int z = 0; z < m_Size.z; z++)
{
- const unsigned char * BlockImage = (const unsigned char *)a_BlockImage + y * m_Size.x * m_Size.z + z * m_Size.x;
+ const unsigned char * BlockImage = reinterpret_cast<const unsigned char *>(a_BlockImage + y * m_Size.x * m_Size.z + z * m_Size.x);
for (int x = 0; x < m_Size.x; x++)
{
const sBlockTypeDef & MappedValue = a_CharMap[BlockImage[x]];
@@ -424,7 +473,7 @@ void cPrefab::ParseConnectors(const char * a_ConnectorsDef)
m_Connectors.push_back(cPiece::cConnector(
atoi(Coords[0].c_str()), atoi(Coords[1].c_str()), atoi(Coords[2].c_str()), // Connector pos
atoi(Defs[0].c_str()), // Connector type
- (eBlockFace)BlockFace
+ static_cast<eBlockFace>(BlockFace)
));
} // for itr - Lines[]
}
diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h
index eb905e78e..45af4b282 100644
--- a/src/Generating/Prefab.h
+++ b/src/Generating/Prefab.h
@@ -95,6 +95,13 @@ public:
/** Creates a prefab based on the given BlockArea and allowed rotations. */
cPrefab(const cBlockArea & a_Image, int a_AllowedRotations);
+ /** Creates a prefab based on the given BlockArea. Allowed rotations can be added later on using SetAllowedRotations(). */
+ cPrefab(const cBlockArea & a_Image);
+
+ /** Creates a prefab based on the specified block data, using the char-to-block map in a_BlockDefinitions.
+ Allowed rotations can be added later on using SetAllowedRotations(). */
+ cPrefab(const AString & a_BlockDefinitions, const AString & a_BlockData, int a_SizeX, int a_SizeY, int a_SizeZ);
+
/** Draws the prefab into the specified chunk, according to the placement stored in the PlacedPiece. */
void Draw(cChunkDesc & a_Dest, const cPlacedPiece * a_Placement) const;
@@ -124,6 +131,21 @@ public:
at the coords governed by the connectors. */
bool ShouldMoveToGround(void) const { return m_MoveToGround; }
+ /** Sets the m_AllowedRotations bitmask and fills the m_BlockArea[] with rotated versions of m_BlockArea[0]. */
+ void SetAllowedRotations(int a_AllowedRotations);
+
+ /** Parses the per-depth weight into m_DepthWeight member. */
+ void ParseDepthWeight(const char * a_DepthWeightDef);
+
+ /** Sets the merge strategy to be used when drawing the piece. */
+ void SetMergeStrategy(cBlockArea::eMergeStrategy a_MergeStrategy) { m_MergeStrategy = a_MergeStrategy; }
+
+ /** Sets the flag whether the prefab should be moved to ground level before being drawn. */
+ void SetMoveToGround(bool a_MoveToGround) { m_MoveToGround = a_MoveToGround; }
+
+ /** Sets the flag whether the lowest layer of the prefab should be repeated downwards until it hits a solid block. */
+ void SetExtendFloor(bool a_ShouldExtendFloor) { m_ShouldExtendFloor = a_ShouldExtendFloor; }
+
protected:
/** Packs complete definition of a single block, for per-letter assignment. */
struct sBlockTypeDef
@@ -201,9 +223,6 @@ protected:
/** Parses the connectors definition text into m_Connectors member. */
void ParseConnectors(const char * a_ConnectorsDef);
-
- /** Parses the per-depth weight into m_DepthWeight member. */
- void ParseDepthWeight(const char * a_DepthWeightDef);
};
diff --git a/src/Generating/PrefabPiecePool.cpp b/src/Generating/PrefabPiecePool.cpp
index 895555ef8..e2273aed3 100644
--- a/src/Generating/PrefabPiecePool.cpp
+++ b/src/Generating/PrefabPiecePool.cpp
@@ -5,6 +5,54 @@
#include "Globals.h"
#include "PrefabPiecePool.h"
+#include "../Bindings/LuaState.h"
+#include "SelfTests.h"
+#include "WorldStorage/SchematicFileSerializer.h"
+
+
+
+
+
+// Conditionally log a warning
+#define CONDWARNING(ShouldLog, ...) \
+ if (ShouldLog) \
+ { \
+ LOGWARNING(__VA_ARGS__); \
+ }
+
+
+
+
+
+/** Returns the map of string => eMergeStrategy used when translating cubeset file merge strategies. */
+static std::map<AString, cBlockArea::eMergeStrategy> & GetMergeStrategyMap(void)
+{
+ static std::map<AString, cBlockArea::eMergeStrategy> msmap;
+ if (msmap.empty())
+ {
+ // This is the first use, initialize the map:
+ msmap["msOverwrite"] = cBlockArea::msOverwrite;
+ msmap["msFillAir"] = cBlockArea::msFillAir;
+ msmap["msImprint"] = cBlockArea::msImprint;
+ msmap["msLake"] = cBlockArea::msLake;
+ msmap["msSpongePrint"] = cBlockArea::msSpongePrint;
+ msmap["msDifference"] = cBlockArea::msDifference;
+ msmap["msSimpleCompare"] = cBlockArea::msSimpleCompare;
+ msmap["msMask"] = cBlockArea::msMask;
+ }
+ return msmap;
+}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// cPrefabPiecePool:
+
+cPrefabPiecePool::cPrefabPiecePool(void)
+{
+}
@@ -26,6 +74,15 @@ cPrefabPiecePool::cPrefabPiecePool(
+cPrefabPiecePool::cPrefabPiecePool(const AString & a_FileName, bool a_LogWarnings)
+{
+ LoadFromFile(a_FileName, a_LogWarnings);
+}
+
+
+
+
+
cPrefabPiecePool::~cPrefabPiecePool()
{
Clear();
@@ -83,9 +140,69 @@ void cPrefabPiecePool::AddStartingPieceDefs(const cPrefab::sDef * a_StartingPiec
+bool cPrefabPiecePool::LoadFromFile(const AString & a_FileName, bool a_LogWarnings)
+{
+ // Read the first 4 KiB of the file in order to auto-detect format:
+ cFile f;
+ if (!f.Open(a_FileName, cFile::fmRead))
+ {
+ CONDWARNING(a_LogWarnings, "Cannot open file %s for reading", a_FileName.c_str());
+ return false;
+ }
+ char buf[4096];
+ auto len = f.Read(buf, sizeof(buf));
+ f.Close();
+ AString Header(buf, static_cast<size_t>(len));
+
+ if (Header.find("CubesetFormatVersion =") != AString::npos)
+ {
+ return LoadFromCubesetFile(a_FileName, a_LogWarnings);
+ }
+ CONDWARNING(a_LogWarnings, "Cannot load prefabs from file %s, unknown file format", a_FileName.c_str());
+ return false;
+}
+
+
+
+
+
+bool cPrefabPiecePool::LoadFromCubesetFile(const AString & a_FileName, bool a_LogWarnings)
+{
+ // Load the file in the Lua interpreter:
+ cLuaState Lua(Printf("LoadablePiecePool %s", a_FileName.c_str()));
+ Lua.Create();
+ if (!Lua.LoadFile(a_FileName, a_LogWarnings))
+ {
+ // Reason for failure has already been logged in LoadFile()
+ return false;
+ }
+
+ // Check the version:
+ int Version = 0;
+ if (!Lua.GetNamedGlobal("Cubeset.Metadata.CubesetFormatVersion", Version))
+ {
+ CONDWARNING(a_LogWarnings, "Cannot load cubeset %s, it doesn't contain version information.", a_FileName.c_str());
+ return false;
+ }
+
+ // Load the data, using the correct version loader:
+ if (Version == 1)
+ {
+ return LoadFromCubesetFileVer1(a_FileName, Lua, a_LogWarnings);
+ }
+
+ // Unknown version:
+ CONDWARNING(a_LogWarnings, "Cannot load cubeset %s, version (%d) not supported.", a_FileName.c_str(), Version);
+ return false;
+}
+
+
+
+
+
void cPrefabPiecePool::AddToPerConnectorMap(cPrefab * a_Prefab)
{
- cPiece::cConnectors Connectors = ((const cPiece *)a_Prefab)->GetConnectors();
+ cPiece::cConnectors Connectors = (static_cast<const cPiece *>(a_Prefab))->GetConnectors();
for (cPiece::cConnectors::const_iterator itr = Connectors.begin(), end = Connectors.end(); itr != end; ++itr)
{
m_PiecesByConnector[itr->m_Type].push_back(a_Prefab);
@@ -95,6 +212,377 @@ void cPrefabPiecePool::AddToPerConnectorMap(cPrefab * a_Prefab)
+
+bool cPrefabPiecePool::LoadFromCubesetFileVer1(const AString & a_FileName, cLuaState & a_LuaState, bool a_LogWarnings)
+{
+ // Load the metadata:
+ ApplyPoolMetadataCubesetVer1(a_FileName, a_LuaState, a_LogWarnings);
+
+ // Push the Cubeset.Pieces global value on the stack:
+ lua_getglobal(a_LuaState, "_G");
+ cLuaState::cStackValue stk(a_LuaState);
+ auto pieces = a_LuaState.WalkToValue("Cubeset.Pieces");
+ if (!pieces.IsValid() || !lua_istable(a_LuaState, -1))
+ {
+ CONDWARNING(a_LogWarnings, "The cubeset file %s doesn't contain any pieces", a_FileName.c_str());
+ return false;
+ }
+
+ // Iterate over all items in the Cubeset.Pieces value:
+ int idx = 1;
+ bool res = true;
+ while (true)
+ {
+ lua_pushinteger(a_LuaState, idx); // stk: [Pieces] [idx]
+ lua_gettable(a_LuaState, -2); // stk: [Pieces] [PieceItem]
+ if (!lua_istable(a_LuaState, -1))
+ {
+ // The PieceItem is not present, we've iterated over all items
+ lua_pop(a_LuaState, 1); // stk: [Pieces]
+ break;
+ }
+ if (!LoadCubesetPieceVer1(a_FileName, a_LuaState, idx, a_LogWarnings))
+ {
+ res = false;
+ }
+ lua_pop(a_LuaState, 1); // stk: [Pieces]
+ idx += 1;
+ }
+ return res;
+}
+
+
+
+
+
+bool cPrefabPiecePool::LoadCubesetPieceVer1(const AString & a_FileName, cLuaState & a_LuaState, int a_PieceIndex, bool a_LogWarnings)
+{
+ ASSERT(lua_istable(a_LuaState, -1));
+
+ // The piece name is optional, but useful for debugging messages:
+ AString PieceName;
+ if (!a_LuaState.GetNamedValue("OriginData.ExportName", PieceName))
+ {
+ Printf(PieceName, "Piece #%d", a_PieceIndex);
+ }
+
+ // Read the hitbox dimensions:
+ cCuboid Hitbox;
+ if (
+ !a_LuaState.GetNamedValue("Hitbox.MinX", Hitbox.p1.x) ||
+ !a_LuaState.GetNamedValue("Hitbox.MinY", Hitbox.p1.y) ||
+ !a_LuaState.GetNamedValue("Hitbox.MinZ", Hitbox.p1.z) ||
+ !a_LuaState.GetNamedValue("Hitbox.MaxX", Hitbox.p2.x) ||
+ !a_LuaState.GetNamedValue("Hitbox.MaxY", Hitbox.p2.y) ||
+ !a_LuaState.GetNamedValue("Hitbox.MaxZ", Hitbox.p2.z)
+ )
+ {
+ CONDWARNING(a_LogWarnings, "Cannot load piece %s from file %s, it's missing hitbox information", PieceName.c_str(), a_FileName.c_str());
+ return false;
+ }
+
+ // Load the prefab data:
+ auto prefab = LoadPrefabFromCubesetVer1(a_FileName, a_LuaState, PieceName, a_LogWarnings);
+ if (prefab == nullptr)
+ {
+ return false;
+ }
+
+ // Read the connectors
+ if (!ReadConnectorsCubesetVer1(a_FileName, a_LuaState, PieceName, prefab.get(), a_LogWarnings))
+ {
+ return false;
+ }
+
+ // Read the allowed rotations. It is an optional metadata value, default to 0:
+ int AllowedRotations = 0;
+ a_LuaState.GetNamedValue("Metadata.AllowedRotations", AllowedRotations);
+ prefab->SetAllowedRotations(AllowedRotations);
+
+ // Apply the relevant metadata:
+ if (!ApplyPieceMetadataCubesetVer1(a_FileName, a_LuaState, PieceName, prefab.get(), a_LogWarnings))
+ {
+ return false;
+ }
+
+ // Add the prefab into the list of pieces:
+ int IsStartingPiece = 0;
+ a_LuaState.GetNamedValue("Metadata.IsStarting", IsStartingPiece);
+ if (IsStartingPiece != 0)
+ {
+ m_StartingPieces.push_back(prefab.release());
+ }
+ else
+ {
+ auto p = prefab.release();
+ m_AllPieces.push_back(p);
+ AddToPerConnectorMap(p);
+ }
+ return true;
+}
+
+
+
+
+
+UniquePtr<cPrefab> cPrefabPiecePool::LoadPrefabFromCubesetVer1(
+ const AString & a_FileName,
+ cLuaState & a_LuaState,
+ const AString & a_PieceName,
+ bool a_LogWarnings
+)
+{
+ // First try loading a referenced schematic file, if any:
+ AString SchematicFileName;
+ if (a_LuaState.GetNamedValue("SchematicFileName", SchematicFileName))
+ {
+ auto PathEnd = a_FileName.find_last_of("/\\"); // Find the last path separator
+ if (PathEnd != AString::npos)
+ {
+ SchematicFileName = a_FileName.substr(0, PathEnd) + SchematicFileName;
+ }
+ cBlockArea area;
+ if (!cSchematicFileSerializer::LoadFromSchematicFile(area, SchematicFileName))
+ {
+ CONDWARNING(a_LogWarnings, "Cannot load schematic file \"%s\" for piece %s in cubeset %s.",
+ SchematicFileName.c_str(), a_PieceName.c_str(), a_FileName.c_str()
+ );
+ return nullptr;
+ }
+ return cpp14::make_unique<cPrefab>(area);
+ } // if (SchematicFileName)
+
+ // There's no referenced schematic file, load from BlockDefinitions / BlockData.
+ // Get references to the data and the table.concat function:
+ cLuaState::cRef TableConcat, BlockDefinitions, BlockData;
+ if (
+ !a_LuaState.GetNamedGlobal("table.concat", TableConcat) ||
+ !a_LuaState.GetNamedValue("BlockDefinitions", BlockDefinitions) ||
+ !a_LuaState.GetNamedValue("BlockData", BlockData)
+ )
+ {
+ CONDWARNING(a_LogWarnings, "Cannot parse block data for piece %s in cubeset %s", a_PieceName.c_str(), a_FileName.c_str());
+ return nullptr;
+ }
+
+ // Call table.concat() on the BlockDefinitions:
+ AString BlockDefStr;
+ if (!a_LuaState.Call(TableConcat, BlockDefinitions, "\n", cLuaState::Return, BlockDefStr))
+ {
+ CONDWARNING(a_LogWarnings, "Cannot concat block definitions for piece %s in cubeset %s", a_PieceName.c_str(), a_FileName.c_str());
+ return nullptr;
+ }
+
+ // Call table.concat() on the BlockData:
+ AString BlockDataStr;
+ if (!a_LuaState.Call(TableConcat, BlockData, "", cLuaState::Return, BlockDataStr))
+ {
+ CONDWARNING(a_LogWarnings, "Cannot concat block data for piece %s in cubeset %s", a_PieceName.c_str(), a_FileName.c_str());
+ return nullptr;
+ }
+
+ // Read the size:
+ int SizeX = 0, SizeY = 0, SizeZ = 0;
+ if (
+ !a_LuaState.GetNamedValue("Size.x", SizeX) ||
+ !a_LuaState.GetNamedValue("Size.y", SizeY) ||
+ !a_LuaState.GetNamedValue("Size.z", SizeZ)
+ )
+ {
+ CONDWARNING(a_LogWarnings, "Cannot load piece %s from file %s, its size information is missing", a_PieceName.c_str(), a_FileName.c_str());
+ return nullptr;
+ }
+
+ // Check that the size matches the data length:
+ if (static_cast<size_t>(SizeX * SizeY * SizeZ) != BlockDataStr.size())
+ {
+ CONDWARNING(a_LogWarnings, "Cannot create piece %s from file %s, its size (%d) doesn't match the blockdata length (%u)",
+ a_PieceName.c_str(), a_FileName.c_str(),
+ SizeX * SizeY * SizeZ, static_cast<unsigned>(BlockDataStr.size())
+ );
+ return nullptr;
+ }
+
+ return cpp14::make_unique<cPrefab>(BlockDefStr, BlockDataStr, SizeX, SizeY, SizeZ);
+}
+
+
+
+
+
+bool cPrefabPiecePool::ReadConnectorsCubesetVer1(
+ const AString & a_FileName,
+ cLuaState & a_LuaState,
+ const AString & a_PieceName,
+ cPrefab * a_Prefab,
+ bool a_LogWarnings
+)
+{
+ // Get the Connectors subtable:
+ auto conns = a_LuaState.WalkToValue("Connectors");
+ if (!conns.IsValid())
+ {
+ CONDWARNING(a_LogWarnings, "Cannot load piece %s from file %s, it has no connectors definition.", a_PieceName.c_str(), a_FileName.c_str());
+ return false;
+ }
+
+ // Iterate over all items in the Connectors table:
+ int idx = 1;
+ bool res = true;
+ while (true)
+ {
+ lua_pushinteger(a_LuaState, idx); // stk: [Connectors] [idx]
+ lua_gettable(a_LuaState, -2); // stk: [Connectors] [conn]
+ if (!lua_istable(a_LuaState, -1))
+ {
+ // The connector is not present, we've iterated over all items
+ lua_pop(a_LuaState, 1); // stk: [Connectors]
+ break;
+ }
+ int Type = 0, RelX = 0, RelY = 0, RelZ = 0;
+ eBlockFace Direction = BLOCK_FACE_NONE;
+ if (
+ !a_LuaState.GetNamedValue("Type", Type) ||
+ !a_LuaState.GetNamedValue("RelX", RelX) ||
+ !a_LuaState.GetNamedValue("RelY", RelY) ||
+ !a_LuaState.GetNamedValue("RelZ", RelZ) ||
+ !a_LuaState.GetNamedValue("Direction", Direction)
+ )
+ {
+ CONDWARNING(a_LogWarnings, "Piece %s in file %s has a malformed Connector at index %d. Skipping the connector.", a_PieceName.c_str(), a_FileName.c_str(), idx);
+ res = false;
+ continue;
+ }
+ a_Prefab->AddConnector(RelX, RelY, RelZ, Direction, Type);
+ lua_pop(a_LuaState, 1); // stk: [Connectors]
+ idx += 1;
+ }
+ return res;
+}
+
+
+
+
+
+bool cPrefabPiecePool::ApplyPieceMetadataCubesetVer1(
+ const AString & a_FileName,
+ cLuaState & a_LuaState,
+ const AString & a_PieceName,
+ cPrefab * a_Prefab,
+ bool a_LogWarnings
+)
+{
+ // Push the Metadata table on top of the Lua stack:
+ auto md = a_LuaState.WalkToValue("Metadata");
+ if (!md.IsValid())
+ {
+ return false;
+ }
+
+ // Get the values:
+ int AddWeightIfSame = 0, DefaultWeight = 100, MoveToGround = 0, ShouldExpandFloor = 0;
+ AString DepthWeight, MergeStrategy;
+ a_LuaState.GetNamedValue("AddWeightIfSame", AddWeightIfSame);
+ a_LuaState.GetNamedValue("DefaultWeight", DefaultWeight);
+ a_LuaState.GetNamedValue("DepthWeight", DepthWeight);
+ a_LuaState.GetNamedValue("MergeStrategy", MergeStrategy);
+ a_LuaState.GetNamedValue("MoveToGround", MoveToGround);
+ a_LuaState.GetNamedValue("ShouldExpandFloor", ShouldExpandFloor);
+
+ // Apply the values:
+ a_Prefab->SetAddWeightIfSame(AddWeightIfSame);
+ a_Prefab->SetDefaultWeight(DefaultWeight);
+ a_Prefab->ParseDepthWeight(DepthWeight.c_str());
+ auto msmap = GetMergeStrategyMap();
+ auto strategy = msmap.find(MergeStrategy);
+ if (strategy == msmap.end())
+ {
+ CONDWARNING(a_LogWarnings, "Unknown merge strategy (\"%s\") specified for piece %s in file %s. Using msSpongePrint instead.",
+ MergeStrategy.c_str(), a_PieceName.c_str(), a_FileName.c_str()
+ );
+ a_Prefab->SetMergeStrategy(cBlockArea::msSpongePrint);
+ }
+ else
+ {
+ a_Prefab->SetMergeStrategy(strategy->second);
+ }
+ a_Prefab->SetMoveToGround(MoveToGround != 0);
+ a_Prefab->SetExtendFloor(ShouldExpandFloor != 0);
+
+ return true;
+}
+
+
+
+
+
+bool cPrefabPiecePool::ApplyPoolMetadataCubesetVer1(
+ const AString & a_FileName,
+ cLuaState & a_LuaState,
+ bool a_LogWarnings
+)
+{
+ // Push the Cubeset.Metadata table on top of the Lua stack:
+ lua_getglobal(a_LuaState, "_G");
+ auto md = a_LuaState.WalkToValue("Cubeset.Metadata");
+ if (!md.IsValid())
+ {
+ CONDWARNING(a_LogWarnings, "Cannot load cubeset from file %s: Cubeset.Metadata table is missing", a_FileName.c_str());
+ return false;
+ }
+
+ // Set the metadata values to defaults:
+ m_MinDensity = 100;
+ m_MaxDensity = 100;
+ m_VillageRoadBlockType = E_BLOCK_GRAVEL;
+ m_VillageRoadBlockMeta = 0;
+ m_VillageWaterRoadBlockType = E_BLOCK_PLANKS;
+ m_VillageWaterRoadBlockMeta = 0;
+
+ // Read the metadata values:
+ a_LuaState.GetNamedValue("IntendedUse", m_IntendedUse);
+ a_LuaState.GetNamedValue("MaxDensity", m_MaxDensity);
+ a_LuaState.GetNamedValue("MinDensity", m_MinDensity);
+ a_LuaState.GetNamedValue("VillageRoadBlockType", m_VillageRoadBlockType);
+ a_LuaState.GetNamedValue("VillageRoadBlockMeta", m_VillageRoadBlockMeta);
+ a_LuaState.GetNamedValue("VillageWaterRoadBlockType", m_VillageWaterRoadBlockType);
+ a_LuaState.GetNamedValue("VillageWaterRoadBlockMeta", m_VillageWaterRoadBlockMeta);
+ AString allowedBiomes;
+ if (a_LuaState.GetNamedValue("AllowedBiomes", allowedBiomes))
+ {
+ auto biomes = StringSplitAndTrim(allowedBiomes, ",");
+ for (const auto & biome: biomes)
+ {
+ EMCSBiome b = StringToBiome(biome);
+ if (b == biInvalidBiome)
+ {
+ CONDWARNING(a_LogWarnings, "Invalid biome (\"%s\") specified in AllowedBiomes in cubeset file %s. Skipping the biome.",
+ biome.c_str(), a_FileName.c_str()
+ );
+ continue;
+ }
+ m_AllowedBiomes.insert(b);
+ }
+ }
+ else
+ {
+ // All biomes are allowed:
+ for (int b = biFirstBiome; b <= biMaxBiome; b++)
+ {
+ m_AllowedBiomes.insert(static_cast<EMCSBiome>(b));
+ }
+ for (int b = biFirstVariantBiome; b <= biMaxVariantBiome; b++)
+ {
+ m_AllowedBiomes.insert(static_cast<EMCSBiome>(b));
+ }
+ }
+ return true;
+}
+
+
+
+
+
cPieces cPrefabPiecePool::GetPiecesWithConnector(int a_ConnectorType)
{
return m_PiecesByConnector[a_ConnectorType];
@@ -122,7 +610,7 @@ cPieces cPrefabPiecePool::GetStartingPieces(void)
int cPrefabPiecePool::GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector, const cPiece & a_NewPiece)
{
- return ((const cPrefab &)a_NewPiece).GetPieceWeight(a_PlacedPiece, a_ExistingConnector);
+ return (static_cast<const cPrefab &>(a_NewPiece)).GetPieceWeight(a_PlacedPiece, a_ExistingConnector);
}
@@ -131,7 +619,7 @@ int cPrefabPiecePool::GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const c
int cPrefabPiecePool::GetStartingPieceWeight(const cPiece & a_NewPiece)
{
- return ((const cPrefab &)a_NewPiece).GetDefaultWeight();
+ return (static_cast<const cPrefab &>(a_NewPiece)).GetDefaultWeight();
}
diff --git a/src/Generating/PrefabPiecePool.h b/src/Generating/PrefabPiecePool.h
index b9c1f0483..f7bf41994 100644
--- a/src/Generating/PrefabPiecePool.h
+++ b/src/Generating/PrefabPiecePool.h
@@ -9,6 +9,7 @@
#pragma once
+#include <unordered_set>
#include "PieceGenerator.h"
#include "Prefab.h"
@@ -16,6 +17,13 @@
+// fwd:
+class cLuaState;
+
+
+
+
+
class cPrefabPiecePool :
public cPiecePool
{
@@ -34,6 +42,10 @@ public:
const cPrefab::sDef * a_StartingPieceDefs, size_t a_NumStartingPieceDefs
);
+ /** Creates a pool and loads the contents of the specified file into it.
+ If a_LogWarnings is true, logs a warning to console when loading fails. */
+ cPrefabPiecePool(const AString & a_FileName, bool a_LogWarnings);
+
/** Destroys the pool, freeing all pieces. */
~cPrefabPiecePool();
@@ -50,6 +62,40 @@ public:
May be called multiple times with different PieceDefs, will add all such pieces. */
void AddStartingPieceDefs(const cPrefab::sDef * a_StartingPieceDefs, size_t a_NumStartingPieceDefs);
+ /** Loads the pieces from the specified file. Returns true if successful, false on error.
+ If a_LogWarnings is true, logs a warning to console when loading fails. */
+ bool LoadFromFile(const AString & a_FileName, bool a_LogWarnings);
+
+ /** Loads the pieces from the specified Cubeset file. Returns true if successful, false on error.
+ If a_LogWarnings is true, logs a warning to console when loading fails. */
+ bool LoadFromCubesetFile(const AString & a_FileName, bool a_LogWarnings);
+
+ /** Returns the number of regular (non-starting) pieces. */
+ size_t GetAllPiecesCount(void) const { return m_AllPieces.size(); }
+
+ /** Returns the number of starting pieces. */
+ size_t GetStartingPiecesCount(void) const { return m_StartingPieces.size(); }
+
+ // Metadata accessors:
+ const AString & GetIntendedUse(void) const { return m_IntendedUse; }
+ int GetMinDensity(void) const { return m_MinDensity; }
+ int GetMaxDensity(void) const { return m_MaxDensity; }
+ BLOCKTYPE GetVillageRoadBlockType (void) const { return m_VillageRoadBlockType; }
+ NIBBLETYPE GetVillageRoadBlockMeta (void) const { return m_VillageRoadBlockMeta; }
+ BLOCKTYPE GetVillageWaterRoadBlockType(void) const { return m_VillageWaterRoadBlockType; }
+ NIBBLETYPE GetVillageWaterRoadBlockMeta(void) const { return m_VillageWaterRoadBlockMeta; }
+
+ /** Returns true if a_Biome is among the accepted biomes in the m_AcceptedBiomes metadata member. */
+ bool IsBiomeAllowed(EMCSBiome a_Biome) const { return (m_AllowedBiomes.find(a_Biome) != m_AllowedBiomes.end()); }
+
+ // cPiecePool overrides:
+ virtual cPieces GetPiecesWithConnector(int a_ConnectorType) override;
+ virtual cPieces GetStartingPieces(void) override;
+ virtual int GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector, const cPiece & a_NewPiece) override;
+ virtual int GetStartingPieceWeight(const cPiece & a_NewPiece) override;
+ virtual void PiecePlaced(const cPiece & a_Piece) override;
+ virtual void Reset(void) override;
+
protected:
/** The type used to map a connector type to the list of pieces with that connector */
@@ -67,17 +113,97 @@ protected:
The pieces are copies out of m_AllPieces and shouldn't be ever delete-d. */
cPiecesMap m_PiecesByConnector;
+ /** The intended use of this piece pool, as specified by the pool's metadata. */
+ AString m_IntendedUse;
+
+ /** The minimum density, as read from the metadata. */
+ int m_MinDensity;
+
+ /** The maximum density, as read from the metadata. */
+ int m_MaxDensity;
+
+ /** The block type to use for the village roads. */
+ BLOCKTYPE m_VillageRoadBlockType;
+
+ /** The block meta to use for the village roads. */
+ NIBBLETYPE m_VillageRoadBlockMeta;
+
+ /** The block type used for the village roads if the road is on water. */
+ BLOCKTYPE m_VillageWaterRoadBlockType;
+
+ /** The block meta used for the village roads if the road is on water. */
+ NIBBLETYPE m_VillageWaterRoadBlockMeta;
+
+ /** A set of allowed biomes for the pool. The pool will only be used within the specified biomes. */
+ std::unordered_set<EMCSBiome, BiomeHasher> m_AllowedBiomes;
+
/** Adds the prefab to the m_PiecesByConnector map for all its connectors. */
void AddToPerConnectorMap(cPrefab * a_Prefab);
+
+ /** Loads the pieces from the cubeset file parsed into the specified Lua state.
+ Returns true on success, false on error.
+ If a_LogWarnings is true, logs a warning to console when loading fails. */
+ bool LoadFromCubesetFileVer1(const AString & a_FileName, cLuaState & a_LuaState, bool a_LogWarnings);
+
+ /** Loads a single piece from the cubeset file parsed into the specified Lua state.
+ The piece's definition table is expected to be at the top of the Lua stack.
+ Returns true on success, false on error.
+ a_PieceIndex is the index of the piece, in the Pieces table. It is used for logging only.
+ If a_LogWarnings is true, logs a warning to console when loading fails. */
+ bool LoadCubesetPieceVer1(const AString & a_FileName, cLuaState & a_LuaState, int a_PieceIndex, bool a_LogWarnings);
+
+ /** Loads a single piece's prefab from the cubeset file parsed into the specified Lua state.
+ The piece's definition table is expected to be at the top of the Lua stack.
+ Returns the prefab on success, nullptr on failure.
+ a_PieceName is the identification of the piece, used for logging only.
+ If a_LogWarnings is true, logs a warning to console when loading fails. */
+ UniquePtr<cPrefab> LoadPrefabFromCubesetVer1(
+ const AString & a_FileName,
+ cLuaState & a_LuaState,
+ const AString & a_PieceName,
+ bool a_LogWarnings
+ );
- // cPiecePool overrides:
- virtual cPieces GetPiecesWithConnector(int a_ConnectorType) override;
- virtual cPieces GetStartingPieces(void) override;
- virtual int GetPieceWeight(const cPlacedPiece & a_PlacedPiece, const cPiece::cConnector & a_ExistingConnector, const cPiece & a_NewPiece) override;
- virtual int GetStartingPieceWeight(const cPiece & a_NewPiece) override;
- virtual void PiecePlaced(const cPiece & a_Piece) override;
- virtual void Reset(void) override;
+ /** Reads a single piece's connectors from the cubeset file parsed into the specified Lua state.
+ The piece's definition table is expected to be at the top of the Lua stack.
+ Returns true on success, false on failure.
+ The connectors are added into the a_Prefab object.
+ No Connectors table is considered a failure, empty Connectors table is considered a success.
+ If any of the connectors are malformed, it is considered a failure, although the rest of the connectors will still load.
+ a_PieceName is the identification of the piece, used for logging only.
+ If a_LogWarnings is true, logs a warning to console when loading fails. */
+ bool ReadConnectorsCubesetVer1(
+ const AString & a_FileName,
+ cLuaState & a_LuaState,
+ const AString & a_PieceName,
+ cPrefab * a_Prefab,
+ bool a_LogWarnings
+ );
+
+ /** Reads a single piece's metadata from the cubeset file parsed into the specified Lua state.
+ The piece's definition table is expected to be at the top of the Lua stack.
+ Returns true on success, false on failure.
+ The metadata is applied into the a_Prefab object.
+ a_PieceName is the identification of the piece, used for logging only.
+ If a_LogWarnings is true, logs a warning to console when loading fails. */
+ bool ApplyPieceMetadataCubesetVer1(
+ const AString & a_FileName,
+ cLuaState & a_LuaState,
+ const AString & a_PieceName,
+ cPrefab * a_Prefab,
+ bool a_LogWarnings
+ );
+
+ /** Reads the metadata for the entire pool from the cubeset file parsed into the specified Lua state.
+ Returns true on success, false on failure.
+ The metadata is applied into "this".
+ If a_LogWarnings is true, logs a warning to console when loading fails. */
+ bool ApplyPoolMetadataCubesetVer1(
+ const AString & a_FileName,
+ cLuaState & a_LuaState,
+ bool a_LogWarnings
+ );
} ;
diff --git a/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp b/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp
deleted file mode 100644
index c08e53ef6..000000000
--- a/src/Generating/Prefabs/AlchemistVillagePrefabs.cpp
+++ /dev/null
@@ -1,3590 +0,0 @@
-
-// AlchemistVillagePrefabs.cpp
-
-// 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!
-
-#include "Globals.h"
-#include "AlchemistVillagePrefabs.h"
-
-
-
-
-
-const cPrefab::sDef g_AlchemistVillagePrefabs[] =
-{
- ////////////////////////////////////////////////////////////////////////////////
- // BarWithBasement:
- // The data has been exported from the gallery Desert, area index 82, ID 598, created by STR_Warrior
- {
- // Size:
- 11, 12, 10, // SizeX = 11, SizeY = 12, SizeZ = 10
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 11, 10, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "A: 65: 3\n" /* ladder */
- "B: 50: 3\n" /* torch */
- "C:171: 8\n" /* carpet */
- "D:101: 0\n" /* ironbars */
- "E: 64: 8\n" /* wooddoorblock */
- "F:128: 2\n" /* sandstonestairs */
- "G: 24: 1\n" /* sandstone */
- "H: 44: 9\n" /* step */
- "I:126: 8\n" /* woodenslab */
- "J:128: 7\n" /* sandstonestairs */
- "K: 44: 1\n" /* step */
- "L: 64: 3\n" /* wooddoorblock */
- "M:128: 6\n" /* sandstonestairs */
- "a: 24: 2\n" /* sandstone */
- "b: 1: 0\n" /* stone */
- "c: 24: 0\n" /* sandstone */
- "d: 12: 0\n" /* sand */
- "e:134: 4\n" /* 134 */
- "f: 5: 1\n" /* wood */
- "g:134: 5\n" /* 134 */
- "h: 65: 5\n" /* ladder */
- "i: 17: 3\n" /* tree */
- "j: 69:11\n" /* lever */
- "k: 4: 0\n" /* cobblestone */
- "l:134: 0\n" /* 134 */
- "m: 19: 0\n" /* sponge */
- "n:134: 1\n" /* 134 */
- "o: 50: 4\n" /* torch */
- "p: 13: 0\n" /* gravel */
- "q: 5: 0\n" /* wood */
- "r: 96: 8\n" /* trapdoor */
- "s:128: 5\n" /* sandstonestairs */
- "t:107: 2\n" /* fencegate */
- "u:128: 4\n" /* sandstonestairs */
- "v:134: 3\n" /* 134 */
- "w: 85: 0\n" /* fence */
- "x:134: 7\n" /* 134 */
- "y:107: 5\n" /* fencegate */
- "z: 64: 1\n" /* wooddoorblock */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmabbbammm"
- /* 1 */ "mcccccccccm"
- /* 2 */ "abcccccccba"
- /* 3 */ "cbcccccccbc"
- /* 4 */ "cbcccccccbc"
- /* 5 */ "cbcccccccbc"
- /* 6 */ "cbcccccccbc"
- /* 7 */ "cbcccccccbc"
- /* 8 */ "abbbbbbbbba"
- /* 9 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmadddammm"
- /* 1 */ "mcccccccccm"
- /* 2 */ "acefg.efgca"
- /* 3 */ "ccefg.efgcc"
- /* 4 */ "ccefg.efgcc"
- /* 5 */ "cc.......cc"
- /* 6 */ "cc.......cc"
- /* 7 */ "cch......cc"
- /* 8 */ "accccccccca"
- /* 9 */ "mmmmmmmmmmm"
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmadddammm"
- /* 1 */ "mcccccccccm"
- /* 2 */ "acfff.fffca"
- /* 3 */ "ccfff.fffcc"
- /* 4 */ "ccfif.fifcc"
- /* 5 */ "cc.j...j.cc"
- /* 6 */ "cc.......cc"
- /* 7 */ "cch......cc"
- /* 8 */ "accccccccca"
- /* 9 */ "mmmmmmmmmmm"
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmakkkammm"
- /* 1 */ "mcccccccccm"
- /* 2 */ "aclfn.lfnca"
- /* 3 */ "cclfn.lfncc"
- /* 4 */ "cclfn.lfncc"
- /* 5 */ "cc.......cc"
- /* 6 */ "cc.......cc"
- /* 7 */ "cch..o...cc"
- /* 8 */ "accccccccca"
- /* 9 */ "mmmmmmmmmmm"
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmapppammm"
- /* 1 */ "mmmmpppmmmm"
- /* 2 */ "acccqqqccca"
- /* 3 */ "cqqqqqqqqqc"
- /* 4 */ "cqqqqqqqqqc"
- /* 5 */ "cqqqqqqqqqc"
- /* 6 */ "cqqqqqqqqqc"
- /* 7 */ "cqrqqqqqqqc"
- /* 8 */ "aqcccccccca"
- /* 9 */ "mmmmmmmmmmm"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmma...ammm"
- /* 1 */ "mmm.....mmm"
- /* 2 */ "acccstuccca"
- /* 3 */ "cnv.....vvc"
- /* 4 */ "cnw.....wlc"
- /* 5 */ "c.........c"
- /* 6 */ "cgxxe.....c"
- /* 7 */ "c...y..nwlc"
- /* 8 */ "azcccccccca"
- /* 9 */ "mmAmmmmmmmm"
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmma...ammm"
- /* 1 */ "mmm.....mmm"
- /* 2 */ "accc...ccca"
- /* 3 */ "c..B...B..c"
- /* 4 */ "c.C.....C.c"
- /* 5 */ "D.........D"
- /* 6 */ "c.........c"
- /* 7 */ "c.......C.c"
- /* 8 */ "aEccDDDccca"
- /* 9 */ "mmAmmmmmmmm"
-
- // Level 7
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmF...Fmmm"
- /* 1 */ "mmmG...cmmm"
- /* 2 */ "acccsHuccca"
- /* 3 */ "cIIIIIIIIIc"
- /* 4 */ "cIIIIIIIIIc"
- /* 5 */ "uIIIIIIIIIs"
- /* 6 */ "cIIIIIIIIIc"
- /* 7 */ "cIIIIIIIIIc"
- /* 8 */ "acccJJJccca"
- /* 9 */ "mmAmmmmmmmm"
-
- // Level 8
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmm.....mmm"
- /* 1 */ "mmm.....mmm"
- /* 2 */ "cKKKKcKKKKc"
- /* 3 */ "KacccccccaK"
- /* 4 */ "Kc.......cK"
- /* 5 */ "cc.......cc"
- /* 6 */ "Kc.......cK"
- /* 7 */ "KaLccccccaK"
- /* 8 */ "cK.KKcKKKKc"
- /* 9 */ "mmmmmmmmmmm"
-
- // Level 9
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ ".accDDDcca."
- /* 4 */ ".c.......c."
- /* 5 */ ".D.......D."
- /* 6 */ ".c.......c."
- /* 7 */ ".aEcDDDcca."
- /* 8 */ "..........."
- /* 9 */ "..........."
-
- // Level 10
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ ".accMMMcca."
- /* 4 */ ".cIIIIIIIc."
- /* 5 */ ".uIIIIIIIs."
- /* 6 */ ".cIIIIIIIc."
- /* 7 */ ".accJJJcca."
- /* 8 */ "..........."
- /* 9 */ "..........."
-
- // Level 11
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ ".cKKKcKKKc."
- /* 4 */ ".K.......K."
- /* 5 */ ".c.......c."
- /* 6 */ ".K.......K."
- /* 7 */ ".cKKKcKKKc."
- /* 8 */ "..........."
- /* 9 */ "...........",
-
- // Connectors:
- "-1: 5, 5, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 70,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // BarWithBasement
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // BarWithoutBasement:
- // The data has been exported from the gallery Desert, area index 81, ID 597, created by STR_Warrior
- {
- // Size:
- 11, 9, 10, // SizeX = 11, SizeY = 9, SizeZ = 10
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 8, 10, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "A:126: 8\n" /* woodenslab */
- "B:128: 7\n" /* sandstonestairs */
- "C: 44: 1\n" /* step */
- "D: 64: 3\n" /* wooddoorblock */
- "E:128: 6\n" /* sandstonestairs */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f:128: 5\n" /* sandstonestairs */
- "g:107: 2\n" /* fencegate */
- "h:128: 4\n" /* sandstonestairs */
- "i:134: 1\n" /* 134 */
- "j:134: 3\n" /* 134 */
- "k: 85: 0\n" /* fence */
- "l:134: 0\n" /* 134 */
- "m: 19: 0\n" /* sponge */
- "n:134: 5\n" /* 134 */
- "o:134: 7\n" /* 134 */
- "p:134: 4\n" /* 134 */
- "q:107: 1\n" /* fencegate */
- "r: 64: 1\n" /* wooddoorblock */
- "s: 65: 3\n" /* ladder */
- "t: 50: 3\n" /* torch */
- "u:171: 8\n" /* carpet */
- "v:101: 0\n" /* ironbars */
- "w: 64: 8\n" /* wooddoorblock */
- "x:128: 2\n" /* sandstonestairs */
- "y: 24: 1\n" /* sandstone */
- "z: 44: 9\n" /* step */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmabbbammm"
- /* 1 */ "mmmmbbbmmmm"
- /* 2 */ "accccccccca"
- /* 3 */ "ccccccccccc"
- /* 4 */ "ccccccccccc"
- /* 5 */ "ccccccccccc"
- /* 6 */ "ccccccccccc"
- /* 7 */ "ccccccccccc"
- /* 8 */ "accccccccca"
- /* 9 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmadddammm"
- /* 1 */ "mmmmdddmmmm"
- /* 2 */ "accceeeccca"
- /* 3 */ "ceeeeeeeeec"
- /* 4 */ "ceeeeeeeeec"
- /* 5 */ "ceeeeeeeeec"
- /* 6 */ "ceeeeeeeeec"
- /* 7 */ "ceeeeeeeeec"
- /* 8 */ "aecccccccca"
- /* 9 */ "mmmmmmmmmmm"
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmma...ammm"
- /* 1 */ "mmm.....mmm"
- /* 2 */ "acccfghccca"
- /* 3 */ "cij.....jjc"
- /* 4 */ "cik.....klc"
- /* 5 */ "c.........c"
- /* 6 */ "cnoop.....c"
- /* 7 */ "c...q..iklc"
- /* 8 */ "arcccccccca"
- /* 9 */ "mmsmmmmmmmm"
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmma...ammm"
- /* 1 */ "mmm.....mmm"
- /* 2 */ "accc...ccca"
- /* 3 */ "c..t...t..c"
- /* 4 */ "c.u.....u.c"
- /* 5 */ "v.........v"
- /* 6 */ "c.........c"
- /* 7 */ "c.......u.c"
- /* 8 */ "awccvvvccca"
- /* 9 */ "mmsmmmmmmmm"
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmx...xmmm"
- /* 1 */ "mmmy...cmmm"
- /* 2 */ "acccfzhccca"
- /* 3 */ "cAAAAAAAAAc"
- /* 4 */ "cAAAAAAAAAc"
- /* 5 */ "hAAAAAAAAAf"
- /* 6 */ "cAAAAAAAAAc"
- /* 7 */ "cAAAAAAAAAc"
- /* 8 */ "acccBBBccca"
- /* 9 */ "mmsmmmmmmmm"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmm.....mmm"
- /* 1 */ "mmm.....mmm"
- /* 2 */ "cCCCCcCCCCc"
- /* 3 */ "CacccccccaC"
- /* 4 */ "Cc.......cC"
- /* 5 */ "cc.......cc"
- /* 6 */ "Cc.......cC"
- /* 7 */ "CaDccccccaC"
- /* 8 */ "cC.CCcCCCCc"
- /* 9 */ "mmmmmmmmmmm"
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ ".accvvvcca."
- /* 4 */ ".c.......c."
- /* 5 */ ".v.......v."
- /* 6 */ ".c.......c."
- /* 7 */ ".awcvvvcca."
- /* 8 */ "..........."
- /* 9 */ "..........."
-
- // Level 7
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ ".accEEEcca."
- /* 4 */ ".cAAAAAAAc."
- /* 5 */ ".hAAAAAAAf."
- /* 6 */ ".cAAAAAAAc."
- /* 7 */ ".accBBBcca."
- /* 8 */ "..........."
- /* 9 */ "..........."
-
- // Level 8
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ ".cCCCcCCCc."
- /* 4 */ ".C.......C."
- /* 5 */ ".c.......c."
- /* 6 */ ".C.......C."
- /* 7 */ ".cCCCcCCCc."
- /* 8 */ "..........."
- /* 9 */ "...........",
-
- // Connectors:
- "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 80,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // BarWithoutBasement
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // BlackSmith:
- // The data has been exported from the gallery Desert, area index 97, ID 642, created by STR_Warrior
- {
- // Size:
- 11, 6, 13, // SizeX = 11, SizeY = 6, SizeZ = 13
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 5, 13, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 12: 0\n" /* sand */
- "g: 64: 3\n" /* wooddoorblock */
- "h: 43: 0\n" /* doubleslab */
- "i: 53: 5\n" /* woodstairs */
- "j: 53: 4\n" /* woodstairs */
- "k: 10: 0\n" /* lava */
- "l: 54: 5\n" /* chest */
- "m: 19: 0\n" /* sponge */
- "n: 64: 8\n" /* wooddoorblock */
- "o: 50: 3\n" /* torch */
- "p:101: 0\n" /* ironbars */
- "q: 50: 1\n" /* torch */
- "r: 50: 2\n" /* torch */
- "s:128: 2\n" /* sandstonestairs */
- "t: 44: 9\n" /* step */
- "u:126: 8\n" /* woodenslab */
- "v:128: 4\n" /* sandstonestairs */
- "w:128: 5\n" /* sandstonestairs */
- "x:128: 7\n" /* sandstonestairs */
- "y: 44: 1\n" /* step */
- "z: 43: 1\n" /* doubleslab */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmabbba"
- /* 1 */ "mmmmmmbbbbm"
- /* 2 */ "mmmmmmaccca"
- /* 3 */ "maccccccccc"
- /* 4 */ "mcccccccccc"
- /* 5 */ "mcccccccccc"
- /* 6 */ "mcccccacccc"
- /* 7 */ "mcccccacccc"
- /* 8 */ "acccaaacccc"
- /* 9 */ "ccccccccccc"
- /* 10 */ "ccccccccccc"
- /* 11 */ "ccccccccccc"
- /* 12 */ "accccccccca"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmaddda"
- /* 1 */ "mmmmmmddddm"
- /* 2 */ "mmmmmmaceca"
- /* 3 */ "mafcfcceeec"
- /* 4 */ "mcfccfceeec"
- /* 5 */ "mcccccceeec"
- /* 6 */ "mcffaaaeeec"
- /* 7 */ "mffcaaaeeec"
- /* 8 */ "acccaaaeeec"
- /* 9 */ "ceeeeeeeeec"
- /* 10 */ "ceeeeeeeeec"
- /* 11 */ "ceeeeeeeeec"
- /* 12 */ "accccccccca"
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmma...a"
- /* 1 */ "mmmmmm....."
- /* 2 */ "mmmmmmacgca"
- /* 3 */ "ma....c...c"
- /* 4 */ "m.h...c...c"
- /* 5 */ "m.....c...c"
- /* 6 */ "m...aac...c"
- /* 7 */ "mij.akc...c"
- /* 8 */ "accccca...c"
- /* 9 */ "cl........c"
- /* 10 */ "c.........c"
- /* 11 */ "c.........c"
- /* 12 */ "accccccccca"
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmma...a"
- /* 1 */ "mmmmmm....."
- /* 2 */ "mmmmmmacnca"
- /* 3 */ "ma....c..oc"
- /* 4 */ "m.....p...c"
- /* 5 */ "m.....c...c"
- /* 6 */ "m...ppc...p"
- /* 7 */ "m...p.c...p"
- /* 8 */ "accccca...p"
- /* 9 */ "cq........c"
- /* 10 */ "p.........c"
- /* 11 */ "c........rc"
- /* 12 */ "acccpppccca"
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmms...s"
- /* 1 */ "mmmmmmc...c"
- /* 2 */ "mmmmmmaccca"
- /* 3 */ "mattttcuuuc"
- /* 4 */ "mtuuuuvuuuc"
- /* 5 */ "mtuuuucuuuc"
- /* 6 */ "mtuuaacuuuw"
- /* 7 */ "mtuua.cuuuw"
- /* 8 */ "acccccauuuw"
- /* 9 */ "cuuuuuuuuuc"
- /* 10 */ "vuuuuuuuuuc"
- /* 11 */ "cuuuuuuuuuc"
- /* 12 */ "acccxxxccca"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmm....."
- /* 1 */ "mmmmmm....."
- /* 2 */ "mmmmmmcyyyc"
- /* 3 */ "my.y.yy...y"
- /* 4 */ "m.....y...y"
- /* 5 */ "my....y...y"
- /* 6 */ "m...zyz...y"
- /* 7 */ "my..y.y...c"
- /* 8 */ "cyyyzyc...y"
- /* 9 */ "y.........y"
- /* 10 */ "y.........y"
- /* 11 */ "y.........y"
- /* 12 */ "cyyyycyyyyc",
-
- // Connectors:
- "-1: 8, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 50,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- false,
- }, // BlackSmith
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LargeHouse1:
- // The data has been exported from the gallery Desert, area index 77, ID 577, created by STR_Warrior
- {
- // Size:
- 15, 14, 11, // SizeX = 15, SizeY = 14, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- -1, 0, -1, // MinX, MinY, MinZ
- 14, 13, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "A: 96:10\n" /* trapdoor */
- "B:128: 4\n" /* sandstonestairs */
- "C:128: 5\n" /* sandstonestairs */
- "D:128: 7\n" /* sandstonestairs */
- "E: 44: 1\n" /* step */
- "F:128: 2\n" /* sandstonestairs */
- "G:128: 0\n" /* sandstonestairs */
- "H: 87: 0\n" /* netherstone */
- "I:128: 3\n" /* sandstonestairs */
- "J: 51: 0\n" /* fire */
- "K: 44: 9\n" /* step */
- "a: 24: 2\n" /* sandstone */
- "b: 24: 0\n" /* sandstone */
- "c: 12: 0\n" /* sand */
- "d: 4: 0\n" /* cobblestone */
- "e: 5: 0\n" /* wood */
- "f: 13: 0\n" /* gravel */
- "g: 85: 0\n" /* fence */
- "h: 5: 1\n" /* wood */
- "i: 64: 2\n" /* wooddoorblock */
- "j: 64: 0\n" /* wooddoorblock */
- "k: 61: 2\n" /* furnace */
- "l:118: 0\n" /* cauldronblock */
- "m: 19: 0\n" /* sponge */
- "n:134: 4\n" /* 134 */
- "o: 65: 2\n" /* ladder */
- "p:101: 0\n" /* ironbars */
- "q: 50: 1\n" /* torch */
- "r:140: 0\n" /* flowerpotblock */
- "s: 64: 8\n" /* wooddoorblock */
- "t: 50: 3\n" /* torch */
- "u: 69:12\n" /* lever */
- "v: 50: 4\n" /* torch */
- "w:128: 6\n" /* sandstonestairs */
- "x: 44:10\n" /* step */
- "y:128: 1\n" /* sandstonestairs */
- "z: 47: 0\n" /* bookshelf */,
-
- // Block data:
- // Level 0
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmmabbbbbbbamm"
- /* 1 */ "ccccbbbbbbbbbma"
- /* 2 */ "ccccbbbbbbbbbdd"
- /* 3 */ "ccccbbbbbbbbbdd"
- /* 4 */ "ccccbbbbbbbbbdd"
- /* 5 */ "ccccbbbbbbbbbma"
- /* 6 */ "ccccbbbbbbbbbmm"
- /* 7 */ "mmmmbbbbbbbbbmm"
- /* 8 */ "mmmmbbbbbbbbbmm"
- /* 9 */ "mmmmbbbbbbbbbmm"
- /* 10 */ "mmmmabbbbbbbamm"
-
- // Level 1
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmmabbbbbbbamm"
- /* 1 */ "ccccbeeeeeeebma"
- /* 2 */ "cccceeeeeeeebff"
- /* 3 */ "ccccbeeeeeeeeff"
- /* 4 */ "ccccbeeeeeeebff"
- /* 5 */ "ccccbeeeeeeebma"
- /* 6 */ "ccccbeeeeeeebmm"
- /* 7 */ "mmmmbeeeeeeebmm"
- /* 8 */ "mmmmbeeeeeeebmm"
- /* 9 */ "mmmmbeeeeeeebmm"
- /* 10 */ "mmmmabbbbbbbamm"
-
- // Level 2
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmmabbbbbbbamm"
- /* 1 */ "ggggb......hb.a"
- /* 2 */ "g...i.......b.."
- /* 3 */ "g...b.......j.."
- /* 4 */ "g...bkln..o.b.."
- /* 5 */ "g...bbbb.bbbb.a"
- /* 6 */ "ggggb.......bmm"
- /* 7 */ "mmmmb.......bmm"
- /* 8 */ "mmmmb.......bmm"
- /* 9 */ "mmmmb.......bmm"
- /* 10 */ "mmmmabbbbbbbamm"
-
- // Level 3
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmmabbpppbbamm"
- /* 1 */ "....bq.....rb.a"
- /* 2 */ "....s.......b.t"
- /* 3 */ "....b.......s.."
- /* 4 */ "....b.u...o.b.v"
- /* 5 */ "....bbbb.bbbb.a"
- /* 6 */ "....p..t.t..pmm"
- /* 7 */ "mmmmp.......pmm"
- /* 8 */ "mmmmp.......pmm"
- /* 9 */ "mmmmb.......bmm"
- /* 10 */ "mmmmabbpppbbamm"
-
- // Level 4
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmmabbwwwbbamm"
- /* 1 */ "....bxxxxxxxbby"
- /* 2 */ "....bxxxxxxxb.."
- /* 3 */ "....bxxxxxxxb.."
- /* 4 */ "....bzzzxxAxb.."
- /* 5 */ "....bbbbbbbbbby"
- /* 6 */ "....BxxxxxxxCmm"
- /* 7 */ "mmmmBxxxxxxxCmm"
- /* 8 */ "mmmmBxxxxxxxCmm"
- /* 9 */ "mmmmbxxxxxxxbmm"
- /* 10 */ "mmmmabbDDDbbamm"
-
- // Level 5
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmmbEEEbEEEbmm"
- /* 1 */ "....EabbbbbaE.."
- /* 2 */ "....Eb.....bE.."
- /* 3 */ "....Eb.....bE.."
- /* 4 */ "....Eb.....bE.."
- /* 5 */ "....babb.bbab.."
- /* 6 */ "....E.......Emm"
- /* 7 */ "mmmmE.......Emm"
- /* 8 */ "mmmmE.......Emm"
- /* 9 */ "mmmmE.......Emm"
- /* 10 */ "mmmmbEEEbEEEbmm"
-
- // Level 6
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".....abbpbba..."
- /* 2 */ ".....p.....p..."
- /* 3 */ ".....p.....p..."
- /* 4 */ ".....p.....p..."
- /* 5 */ ".....abb.bba..."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
-
- // Level 7
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".....abbwbba..."
- /* 2 */ ".....BxxxxxC..."
- /* 3 */ ".....BxxxxxC..."
- /* 4 */ ".....BxxxxxC..."
- /* 5 */ ".....abbbbba..."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
-
- // Level 8
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".....bEEbEEb..."
- /* 2 */ ".....E.bbb.E..."
- /* 3 */ ".....b.bbb.b..."
- /* 4 */ ".....E.bbb.E..."
- /* 5 */ ".....bEEbEEb..."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
-
- // Level 9
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ ".......aFa....."
- /* 3 */ ".......GHy....."
- /* 4 */ ".......aIa....."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
-
- // Level 10
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ ".......a.a....."
- /* 3 */ "........J......"
- /* 4 */ ".......a.a....."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
-
- // Level 11
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ ".......awa....."
- /* 3 */ ".......B.C....."
- /* 4 */ ".......aDa....."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
-
- // Level 12
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ ".......bbb....."
- /* 3 */ ".......bKb....."
- /* 4 */ ".......bbb....."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
-
- // Level 13
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ ".......E.E....."
- /* 3 */ "..............."
- /* 4 */ ".......E.E....."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "...............",
-
- // Connectors:
- "-1: 14, 2, 3: 5\n" /* Type -1, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 60,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LargeHouse1
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LargeTower:
- // The data has been exported from the gallery Desert, area index 80, ID 596, created by STR_Warrior
- {
- // Size:
- 7, 12, 7, // SizeX = 7, SizeY = 12, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 7, 11, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 12: 0\n" /* sand */
- "d: 5: 0\n" /* wood */
- "e: 13: 0\n" /* gravel */
- "f:128: 2\n" /* sandstonestairs */
- "g:128: 0\n" /* sandstonestairs */
- "h: 24: 2\n" /* sandstone */
- "i: 71: 3\n" /* irondoorblock */
- "j:128: 1\n" /* sandstonestairs */
- "k:128: 3\n" /* sandstonestairs */
- "l: 77: 4\n" /* stonebutton */
- "m: 19: 0\n" /* sponge */
- "n: 71: 8\n" /* irondoorblock */
- "o: 77: 3\n" /* stonebutton */
- "p:128: 6\n" /* sandstonestairs */
- "q:128: 4\n" /* sandstonestairs */
- "r:128: 5\n" /* sandstonestairs */
- "s: 50: 4\n" /* torch */
- "t:128: 7\n" /* sandstonestairs */
- "u: 85: 0\n" /* fence */
- "v: 24: 1\n" /* sandstone */
- "w: 44: 1\n" /* step */
- "x: 89: 0\n" /* lightstone */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mabbbam"
- /* 1 */ "aacdcaa"
- /* 2 */ "madddam"
- /* 3 */ "madddam"
- /* 4 */ "madddam"
- /* 5 */ "aaaaaaa"
- /* 6 */ "mammmam"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "maeeeam"
- /* 1 */ "aacdcaa"
- /* 2 */ "madddam"
- /* 3 */ "madddam"
- /* 4 */ "madddam"
- /* 5 */ "aaaaaaa"
- /* 6 */ "mammmam"
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "mf...fm"
- /* 1 */ "ghaiahj"
- /* 2 */ "ma...am"
- /* 3 */ "ma...am"
- /* 4 */ "ma...am"
- /* 5 */ "ghaaahj"
- /* 6 */ "mkmmmkm"
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "m.l...m"
- /* 1 */ ".hanah."
- /* 2 */ ".ao..a."
- /* 3 */ ".a...a."
- /* 4 */ ".a...a."
- /* 5 */ ".haaah."
- /* 6 */ "m.....m"
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "..pap.."
- /* 2 */ ".q...r."
- /* 3 */ ".a...a."
- /* 4 */ ".q.s.r."
- /* 5 */ "..tat.."
- /* 6 */ "......."
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "..aua.."
- /* 2 */ ".a...a."
- /* 3 */ ".u...u."
- /* 4 */ ".a...a."
- /* 5 */ "..aua.."
- /* 6 */ "......."
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "..aua.."
- /* 2 */ ".a...a."
- /* 3 */ ".u...u."
- /* 4 */ ".a...a."
- /* 5 */ "..aua.."
- /* 6 */ "......."
-
- // Level 7
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "..aua.."
- /* 2 */ ".a...a."
- /* 3 */ ".u...u."
- /* 4 */ ".a...a."
- /* 5 */ "..aua.."
- /* 6 */ "......."
-
- // Level 8
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "..faf.."
- /* 2 */ ".g...j."
- /* 3 */ ".a...a."
- /* 4 */ ".g...j."
- /* 5 */ "..kak.."
- /* 6 */ "......."
-
- // Level 9
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".aavaa."
- /* 2 */ ".a...a."
- /* 3 */ ".v...v."
- /* 4 */ ".a...a."
- /* 5 */ ".aavaa."
- /* 6 */ "......."
-
- // Level 10
- /* z\x* 0123456 */
- /* 0 */ "...p..."
- /* 1 */ ".haaah."
- /* 2 */ ".awwwa."
- /* 3 */ "qawawar"
- /* 4 */ ".awwwa."
- /* 5 */ ".haaah."
- /* 6 */ "...t..."
-
- // Level 11
- /* z\x* 0123456 */
- /* 0 */ "...w..."
- /* 1 */ ".w...w."
- /* 2 */ "......."
- /* 3 */ "w..x..w"
- /* 4 */ "......."
- /* 5 */ ".w...w."
- /* 6 */ "...w...",
-
- // Connectors:
- "-1: 3, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LargeTower
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LittleHouse:
- // The data has been exported from the gallery Desert, area index 65, ID 551, created by STR_Warrior
- {
- // Size:
- 5, 6, 7, // SizeX = 5, SizeY = 6, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 5, 5, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 64: 3\n" /* wooddoorblock */
- "g: 61: 2\n" /* furnace */
- "h: 65: 2\n" /* ladder */
- "i: 64: 8\n" /* wooddoorblock */
- "j:101: 0\n" /* ironbars */
- "k: 50: 4\n" /* torch */
- "l:128: 2\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */
- "n:126: 8\n" /* woodenslab */
- "o:128: 4\n" /* sandstonestairs */
- "p:128: 5\n" /* sandstonestairs */
- "q:128: 7\n" /* sandstonestairs */
- "r: 44: 1\n" /* step */
- "s: 96: 2\n" /* trapdoor */,
-
- // Block data:
- // Level 0
- /* z\x* 01234 */
- /* 0 */ "abbba"
- /* 1 */ "mbbbm"
- /* 2 */ "accca"
- /* 3 */ "ccccc"
- /* 4 */ "ccccc"
- /* 5 */ "ccccc"
- /* 6 */ "accca"
-
- // Level 1
- /* z\x* 01234 */
- /* 0 */ "addda"
- /* 1 */ "mdddm"
- /* 2 */ "aceca"
- /* 3 */ "ceeec"
- /* 4 */ "ceeec"
- /* 5 */ "ceeec"
- /* 6 */ "accca"
-
- // Level 2
- /* z\x* 01234 */
- /* 0 */ "a...a"
- /* 1 */ "....."
- /* 2 */ "acfca"
- /* 3 */ "c...c"
- /* 4 */ "c...c"
- /* 5 */ "cg.hc"
- /* 6 */ "accca"
-
- // Level 3
- /* z\x* 01234 */
- /* 0 */ "a...a"
- /* 1 */ "....."
- /* 2 */ "acica"
- /* 3 */ "c...c"
- /* 4 */ "j...j"
- /* 5 */ "ck.hc"
- /* 6 */ "acjca"
-
- // Level 4
- /* z\x* 01234 */
- /* 0 */ "l...l"
- /* 1 */ "c...c"
- /* 2 */ "accca"
- /* 3 */ "cnnnc"
- /* 4 */ "onnnp"
- /* 5 */ "cnnhc"
- /* 6 */ "acqca"
-
- // Level 5
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "....."
- /* 2 */ "crcrc"
- /* 3 */ "r...r"
- /* 4 */ "c...c"
- /* 5 */ "r..sr"
- /* 6 */ "crcrc",
-
- // Connectors:
- "-1: 2, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LittleHouse
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LittleHouse2:
- // The data has been exported from the gallery Desert, area index 72, ID 562, created by STR_Warrior
- {
- // Size:
- 7, 6, 11, // SizeX = 7, SizeY = 6, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 7, 5, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 12: 0\n" /* sand */
- "e: 13: 0\n" /* gravel */
- "f: 5: 0\n" /* wood */
- "g: 64: 3\n" /* wooddoorblock */
- "h: 65: 5\n" /* ladder */
- "i: 85: 0\n" /* fence */
- "j:101: 0\n" /* ironbars */
- "k: 64: 8\n" /* wooddoorblock */
- "l: 50: 3\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n:128: 2\n" /* sandstonestairs */
- "o:128: 6\n" /* sandstonestairs */
- "p:126: 8\n" /* woodenslab */
- "q:128: 4\n" /* sandstonestairs */
- "r:128: 5\n" /* sandstonestairs */
- "s:128: 7\n" /* sandstonestairs */
- "t: 44: 1\n" /* step */
- "u: 96: 0\n" /* trapdoor */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mabbbam"
- /* 1 */ "mmbbbmm"
- /* 2 */ "accccca"
- /* 3 */ "ccccccc"
- /* 4 */ "ccccccc"
- /* 5 */ "ccccccc"
- /* 6 */ "accccca"
- /* 7 */ "ddddddd"
- /* 8 */ "ddddddd"
- /* 9 */ "ddddddd"
- /* 10 */ "ddddddd"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "maeeeam"
- /* 1 */ "mmeeemm"
- /* 2 */ "acccfca"
- /* 3 */ "cfffffc"
- /* 4 */ "cfffffc"
- /* 5 */ "cfffffc"
- /* 6 */ "acfccca"
- /* 7 */ "ddddddd"
- /* 8 */ "ddddddd"
- /* 9 */ "ddddddd"
- /* 10 */ "ddddddd"
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "ma...am"
- /* 1 */ "m.....m"
- /* 2 */ "acccgca"
- /* 3 */ "c.....c"
- /* 4 */ "c.....c"
- /* 5 */ "ch....c"
- /* 6 */ "ac.ccca"
- /* 7 */ "i.....i"
- /* 8 */ "i.....i"
- /* 9 */ "i.....i"
- /* 10 */ "iiiiiii"
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "ma...am"
- /* 1 */ "m.....m"
- /* 2 */ "acjckca"
- /* 3 */ "c..l..c"
- /* 4 */ "j.....j"
- /* 5 */ "ch....c"
- /* 6 */ "ac.cjca"
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ "......."
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "mn...nm"
- /* 1 */ "mc...cm"
- /* 2 */ "acoccca"
- /* 3 */ "cpppppc"
- /* 4 */ "qpppppr"
- /* 5 */ "chppppc"
- /* 6 */ "acccsca"
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ "......."
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "m.....m"
- /* 1 */ "m.....m"
- /* 2 */ "cttcttc"
- /* 3 */ "t.....t"
- /* 4 */ "c.....c"
- /* 5 */ "tu....t"
- /* 6 */ "cttcttc"
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ ".......",
-
- // Connectors:
- "-1: 3, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LittleHouse2
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LittleHouse3:
- // The data has been exported from the gallery Desert, area index 66, ID 553, created by STR_Warrior
- {
- // Size:
- 9, 6, 7, // SizeX = 9, SizeY = 6, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 9, 5, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 64: 3\n" /* wooddoorblock */
- "g: 65: 2\n" /* ladder */
- "h: 64: 8\n" /* wooddoorblock */
- "i:101: 0\n" /* ironbars */
- "j: 50: 4\n" /* torch */
- "k:128: 2\n" /* sandstonestairs */
- "l:126: 8\n" /* woodenslab */
- "m: 19: 0\n" /* sponge */
- "n:128: 4\n" /* sandstonestairs */
- "o:128: 5\n" /* sandstonestairs */
- "p:128: 7\n" /* sandstonestairs */
- "q: 44: 1\n" /* step */
- "r: 96: 2\n" /* trapdoor */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "mmabbbamm"
- /* 1 */ "mmmbbbmmm"
- /* 2 */ "accccccca"
- /* 3 */ "ccccccccc"
- /* 4 */ "ccccccccc"
- /* 5 */ "ccccccccc"
- /* 6 */ "accccccca"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "mmadddamm"
- /* 1 */ "mmmdddmmm"
- /* 2 */ "accceccca"
- /* 3 */ "ceeeeeeec"
- /* 4 */ "ceeeeeeec"
- /* 5 */ "ceeeeeeec"
- /* 6 */ "accccccca"
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "mma...amm"
- /* 1 */ "mm.....mm"
- /* 2 */ "acccfccca"
- /* 3 */ "c.......c"
- /* 4 */ "c.......c"
- /* 5 */ "c......gc"
- /* 6 */ "accccccca"
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "mma...amm"
- /* 1 */ "mm.....mm"
- /* 2 */ "accchccca"
- /* 3 */ "c.......c"
- /* 4 */ "i.......i"
- /* 5 */ "c.j....gc"
- /* 6 */ "acciiicca"
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "mmk...kmm"
- /* 1 */ "mmc...cmm"
- /* 2 */ "accccccca"
- /* 3 */ "clllllllc"
- /* 4 */ "nlllllllo"
- /* 5 */ "cllllllgc"
- /* 6 */ "accpppcca"
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "mm.....mm"
- /* 1 */ "mm.....mm"
- /* 2 */ "cqqqcqqqc"
- /* 3 */ "q.......q"
- /* 4 */ "c.......c"
- /* 5 */ "q......rq"
- /* 6 */ "cqqqcqqqc",
-
- // Connectors:
- "-1: 4, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LittleHouse3
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LittleHouse4:
- // The data has been exported from the gallery Desert, area index 70, ID 560, created by STR_Warrior
- {
- // Size:
- 5, 6, 11, // SizeX = 5, SizeY = 6, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 5, 5, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 64: 3\n" /* wooddoorblock */
- "g: 65: 5\n" /* ladder */
- "h:134: 3\n" /* 134 */
- "i: 85: 0\n" /* fence */
- "j:134: 2\n" /* 134 */
- "k: 61: 2\n" /* furnace */
- "l:134: 6\n" /* 134 */
- "m: 19: 0\n" /* sponge */
- "n:134: 4\n" /* 134 */
- "o: 64: 8\n" /* wooddoorblock */
- "p: 50: 2\n" /* torch */
- "q:101: 0\n" /* ironbars */
- "r:171: 8\n" /* carpet */
- "s:128: 2\n" /* sandstonestairs */
- "t:126: 8\n" /* woodenslab */
- "u:128: 4\n" /* sandstonestairs */
- "v:128: 5\n" /* sandstonestairs */
- "w:128: 7\n" /* sandstonestairs */
- "x: 44: 1\n" /* step */
- "y: 96: 1\n" /* trapdoor */,
-
- // Block data:
- // Level 0
- /* z\x* 01234 */
- /* 0 */ "abbba"
- /* 1 */ "mbbbm"
- /* 2 */ "accca"
- /* 3 */ "ccccc"
- /* 4 */ "ccccc"
- /* 5 */ "ccccc"
- /* 6 */ "ccccc"
- /* 7 */ "ccccc"
- /* 8 */ "ccccc"
- /* 9 */ "ccccc"
- /* 10 */ "accca"
-
- // Level 1
- /* z\x* 01234 */
- /* 0 */ "addda"
- /* 1 */ "mdddm"
- /* 2 */ "aceca"
- /* 3 */ "ceeec"
- /* 4 */ "ceeec"
- /* 5 */ "ceeec"
- /* 6 */ "ceeec"
- /* 7 */ "ceeec"
- /* 8 */ "ceeec"
- /* 9 */ "ceeec"
- /* 10 */ "accca"
-
- // Level 2
- /* z\x* 01234 */
- /* 0 */ "a...a"
- /* 1 */ "....."
- /* 2 */ "acfca"
- /* 3 */ "cg..c"
- /* 4 */ "c...c"
- /* 5 */ "c..hc"
- /* 6 */ "c..ic"
- /* 7 */ "c..jc"
- /* 8 */ "c...c"
- /* 9 */ "cklnc"
- /* 10 */ "accca"
-
- // Level 3
- /* z\x* 01234 */
- /* 0 */ "a...a"
- /* 1 */ "....."
- /* 2 */ "acoca"
- /* 3 */ "cg..c"
- /* 4 */ "c..pc"
- /* 5 */ "q...q"
- /* 6 */ "q..rq"
- /* 7 */ "q...q"
- /* 8 */ "c...c"
- /* 9 */ "c...c"
- /* 10 */ "acqca"
-
- // Level 4
- /* z\x* 01234 */
- /* 0 */ "s...s"
- /* 1 */ "c...c"
- /* 2 */ "accca"
- /* 3 */ "cgttc"
- /* 4 */ "ctttc"
- /* 5 */ "utttv"
- /* 6 */ "utttv"
- /* 7 */ "utttv"
- /* 8 */ "ctttc"
- /* 9 */ "ctttc"
- /* 10 */ "acwca"
-
- // Level 5
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "....."
- /* 2 */ "cxcxc"
- /* 3 */ "xy..x"
- /* 4 */ "x...x"
- /* 5 */ "x...x"
- /* 6 */ "c...c"
- /* 7 */ "x...x"
- /* 8 */ "x...x"
- /* 9 */ "x...x"
- /* 10 */ "cxcxc",
-
- // Connectors:
- "-1: 2, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LittleHouse4
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LittleHouse5:
- // The data has been exported from the gallery Desert, area index 68, ID 558, created by STR_Warrior
- {
- // Size:
- 9, 6, 9, // SizeX = 9, SizeY = 6, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 9, 5, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 64: 3\n" /* wooddoorblock */
- "g: 65: 2\n" /* ladder */
- "h: 64: 8\n" /* wooddoorblock */
- "i:101: 0\n" /* ironbars */
- "j: 50: 1\n" /* torch */
- "k: 50: 4\n" /* torch */
- "l:128: 2\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */
- "n:126: 8\n" /* woodenslab */
- "o:128: 6\n" /* sandstonestairs */
- "p:128: 5\n" /* sandstonestairs */
- "q:128: 4\n" /* sandstonestairs */
- "r:128: 7\n" /* sandstonestairs */
- "s: 44: 1\n" /* step */
- "t: 96: 2\n" /* trapdoor */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "mmmmabbba"
- /* 1 */ "mmmmmbbbm"
- /* 2 */ "mmmmaccca"
- /* 3 */ "mmmmccccc"
- /* 4 */ "acccacccc"
- /* 5 */ "ccccccccc"
- /* 6 */ "ccccccccc"
- /* 7 */ "ccccccccc"
- /* 8 */ "accccccca"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "mmmmaddda"
- /* 1 */ "mmmmmdddm"
- /* 2 */ "mmmmaceca"
- /* 3 */ "mmmmceeec"
- /* 4 */ "acccaeeec"
- /* 5 */ "ceeeeeeec"
- /* 6 */ "ceeeeeeec"
- /* 7 */ "ceeeeeeec"
- /* 8 */ "accccccca"
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "mmmma...a"
- /* 1 */ "mmmm....."
- /* 2 */ "mmmmacfca"
- /* 3 */ "mmmmc...c"
- /* 4 */ "accca...c"
- /* 5 */ "c.......c"
- /* 6 */ "c.......c"
- /* 7 */ "c......gc"
- /* 8 */ "accccccca"
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "mmmma...a"
- /* 1 */ "mmmm....."
- /* 2 */ "mmmmachca"
- /* 3 */ "mmmmc...c"
- /* 4 */ "acica...i"
- /* 5 */ "c.......i"
- /* 6 */ "i.......i"
- /* 7 */ "cj....kgc"
- /* 8 */ "acciiicca"
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "mmmml...l"
- /* 1 */ "mmmmc...c"
- /* 2 */ "mmmmaccca"
- /* 3 */ "mmmmcnnnc"
- /* 4 */ "acocannnp"
- /* 5 */ "cnnnnnnnp"
- /* 6 */ "qnnnnnnnp"
- /* 7 */ "cnnnnnngc"
- /* 8 */ "accrrrcca"
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "mmmm....."
- /* 1 */ "mmmm....."
- /* 2 */ "mmmmcscsc"
- /* 3 */ "mmmms...s"
- /* 4 */ "csssc...c"
- /* 5 */ "s.......s"
- /* 6 */ "s.......s"
- /* 7 */ "s......ts"
- /* 8 */ "cssscsssc",
-
- // Connectors:
- "-1: 6, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LittleHouse5
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LittleHouse6:
- // The data has been exported from the gallery Desert, area index 69, ID 559, created by STR_Warrior
- {
- // Size:
- 9, 6, 9, // SizeX = 9, SizeY = 6, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 9, 5, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "A: 96: 2\n" /* trapdoor */
- "a: 12: 0\n" /* sand */
- "b: 24: 2\n" /* sandstone */
- "c: 4: 0\n" /* cobblestone */
- "d: 3: 0\n" /* dirt */
- "e: 24: 0\n" /* sandstone */
- "f: 13: 0\n" /* gravel */
- "g: 2: 0\n" /* grass */
- "h: 5: 0\n" /* wood */
- "i: 85: 0\n" /* fence */
- "j: 64: 3\n" /* wooddoorblock */
- "k: 38: 1\n" /* rose */
- "l: 38: 2\n" /* rose */
- "m: 19: 0\n" /* sponge */
- "n: 38: 5\n" /* rose */
- "o: 65: 2\n" /* ladder */
- "p: 64: 8\n" /* wooddoorblock */
- "q:101: 0\n" /* ironbars */
- "r: 50: 1\n" /* torch */
- "s: 50: 4\n" /* torch */
- "t:128: 2\n" /* sandstonestairs */
- "u:126: 8\n" /* woodenslab */
- "v:128: 6\n" /* sandstonestairs */
- "w:128: 5\n" /* sandstonestairs */
- "x:128: 4\n" /* sandstonestairs */
- "y:128: 7\n" /* sandstonestairs */
- "z: 44: 1\n" /* step */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "aaaabcccb"
- /* 1 */ "adddccccm"
- /* 2 */ "adddbeeeb"
- /* 3 */ "adddeeeee"
- /* 4 */ "beeebeeee"
- /* 5 */ "eeeeeeeee"
- /* 6 */ "eeeeeeeee"
- /* 7 */ "eeeeeeeee"
- /* 8 */ "beeeeeeeb"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "aaaabfffb"
- /* 1 */ "agggffffm"
- /* 2 */ "agggbeheb"
- /* 3 */ "agggehhhe"
- /* 4 */ "beeebhhhe"
- /* 5 */ "ehhhhhhhe"
- /* 6 */ "ehhhhhhhe"
- /* 7 */ "ehhhhhhhe"
- /* 8 */ "beeeeeeeb"
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "iiiib...b"
- /* 1 */ "i........"
- /* 2 */ "i...bejeb"
- /* 3 */ "iklne...e"
- /* 4 */ "beeeb...e"
- /* 5 */ "e.......e"
- /* 6 */ "e.......e"
- /* 7 */ "e......oe"
- /* 8 */ "beeeeeeeb"
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "....b...b"
- /* 1 */ "........."
- /* 2 */ "....bepeb"
- /* 3 */ "....e...e"
- /* 4 */ "beqeb...q"
- /* 5 */ "e.......q"
- /* 6 */ "q.......q"
- /* 7 */ "er....soe"
- /* 8 */ "beeqqqeeb"
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "....t...t"
- /* 1 */ "....e...e"
- /* 2 */ "....beeeb"
- /* 3 */ "....euuue"
- /* 4 */ "bevebuuuw"
- /* 5 */ "euuuuuuuw"
- /* 6 */ "xuuuuuuuw"
- /* 7 */ "euuuuuuoe"
- /* 8 */ "beeyyyeeb"
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ "........."
- /* 2 */ "....ezeze"
- /* 3 */ "....z...z"
- /* 4 */ "ezzze...e"
- /* 5 */ "z.......z"
- /* 6 */ "z.......z"
- /* 7 */ "z......Az"
- /* 8 */ "ezzzezzze",
-
- // Connectors:
- "-1: 6, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LittleHouse6
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LittleHouse7:
- // The data has been exported from the gallery Desert, area index 73, ID 563, created by xoft
- {
- // Size:
- 9, 6, 11, // SizeX = 9, SizeY = 6, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 9, 5, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 64: 3\n" /* wooddoorblock */
- "g: 65: 2\n" /* ladder */
- "h:101: 0\n" /* ironbars */
- "i: 64: 8\n" /* wooddoorblock */
- "j: 50: 1\n" /* torch */
- "k: 50: 2\n" /* torch */
- "l:128: 2\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */
- "n:128: 6\n" /* sandstonestairs */
- "o:126: 8\n" /* woodenslab */
- "p:128: 4\n" /* sandstonestairs */
- "q:128: 5\n" /* sandstonestairs */
- "r:128: 7\n" /* sandstonestairs */
- "s: 44: 1\n" /* step */
- "t: 96: 2\n" /* trapdoor */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "mmmmabbba"
- /* 1 */ "mmmmmbbbm"
- /* 2 */ "accccccca"
- /* 3 */ "ccccccccc"
- /* 4 */ "ccccccccc"
- /* 5 */ "ccccccccc"
- /* 6 */ "acccacccc"
- /* 7 */ "mmmmccccc"
- /* 8 */ "mmmmccccc"
- /* 9 */ "mmmmccccc"
- /* 10 */ "mmmmaccca"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "mmmmaddda"
- /* 1 */ "mmmmmdddm"
- /* 2 */ "accccceca"
- /* 3 */ "ceeeeeeec"
- /* 4 */ "ceeeeeeec"
- /* 5 */ "ceeeeeeec"
- /* 6 */ "acccaeeec"
- /* 7 */ "mmmmceeec"
- /* 8 */ "mmmmceeec"
- /* 9 */ "mmmmceeec"
- /* 10 */ "mmmmaccca"
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "mmmma...a"
- /* 1 */ "mmmm....."
- /* 2 */ "acccccfca"
- /* 3 */ "c.......c"
- /* 4 */ "c.......c"
- /* 5 */ "c.......c"
- /* 6 */ "accca...c"
- /* 7 */ "mmmmc...c"
- /* 8 */ "mmmmc...c"
- /* 9 */ "mmmmc..gc"
- /* 10 */ "mmmmaccca"
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "mmmma...a"
- /* 1 */ "mmmm....."
- /* 2 */ "achcccica"
- /* 3 */ "c.......c"
- /* 4 */ "h.......c"
- /* 5 */ "cj......h"
- /* 6 */ "achca...h"
- /* 7 */ "mmmmc...h"
- /* 8 */ "mmmmh..kc"
- /* 9 */ "mmmmc..gc"
- /* 10 */ "mmmmachca"
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "mmmml...l"
- /* 1 */ "mmmmc...c"
- /* 2 */ "acnccccca"
- /* 3 */ "coooooooc"
- /* 4 */ "poooooooc"
- /* 5 */ "coooooooq"
- /* 6 */ "acrcaoooq"
- /* 7 */ "mmmmcoooq"
- /* 8 */ "mmmmpoooc"
- /* 9 */ "mmmmcoogc"
- /* 10 */ "mmmmacrca"
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "mmmm....."
- /* 1 */ "mmmm....."
- /* 2 */ "cssscscsc"
- /* 3 */ "s.......s"
- /* 4 */ "s.......s"
- /* 5 */ "s.......s"
- /* 6 */ "csssc...c"
- /* 7 */ "mmmms...s"
- /* 8 */ "mmmms...s"
- /* 9 */ "mmmms..ts"
- /* 10 */ "mmmmcsssc",
-
- // Connectors:
- "-1: 6, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LittleHouse7
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LittleHouse8:
- // The data has been exported from the gallery Desert, area index 99, ID 739, created by STR_Warrior
- {
- // Size:
- 9, 6, 9, // SizeX = 9, SizeY = 6, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- 0, 0, -1, // MinX, MinY, MinZ
- 9, 5, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 24: 0\n" /* sandstone */
- "c: 4: 0\n" /* cobblestone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 64: 2\n" /* wooddoorblock */
- "g: 65: 2\n" /* ladder */
- "h:101: 0\n" /* ironbars */
- "i: 64: 8\n" /* wooddoorblock */
- "j: 50: 1\n" /* torch */
- "k:128: 6\n" /* sandstonestairs */
- "l:126: 8\n" /* woodenslab */
- "m: 19: 0\n" /* sponge */
- "n:128: 5\n" /* sandstonestairs */
- "o:128: 4\n" /* sandstonestairs */
- "p:128: 7\n" /* sandstonestairs */
- "q: 44: 1\n" /* step */
- "r: 96: 2\n" /* trapdoor */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "mmmmabbba"
- /* 1 */ "ccccbbbbb"
- /* 2 */ "ccccbbbbb"
- /* 3 */ "ccccbbbbb"
- /* 4 */ "abbbabbbb"
- /* 5 */ "bbbbbbbbb"
- /* 6 */ "bbbbbbbbb"
- /* 7 */ "bbbbbbbbb"
- /* 8 */ "abbbbbbba"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "mmmmabbba"
- /* 1 */ "ddddbeeeb"
- /* 2 */ "ddddeeeeb"
- /* 3 */ "ddddbeeeb"
- /* 4 */ "abbbaeeeb"
- /* 5 */ "beeeeeeeb"
- /* 6 */ "beeeeeeeb"
- /* 7 */ "beeeeeeeb"
- /* 8 */ "abbbbbbba"
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "mmmmabbba"
- /* 1 */ "....b...b"
- /* 2 */ "....f...b"
- /* 3 */ "....b...b"
- /* 4 */ "abbba...b"
- /* 5 */ "b.......b"
- /* 6 */ "b.......b"
- /* 7 */ "b......gb"
- /* 8 */ "abbbbbbba"
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "mmmmabhba"
- /* 1 */ "....b...b"
- /* 2 */ "....i...b"
- /* 3 */ "....b...h"
- /* 4 */ "abhbaj..h"
- /* 5 */ "b.......h"
- /* 6 */ "h.......b"
- /* 7 */ "b......gb"
- /* 8 */ "abbhhhbba"
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "mmmmabkba"
- /* 1 */ "....blllb"
- /* 2 */ "....blllb"
- /* 3 */ "....bllln"
- /* 4 */ "abkballln"
- /* 5 */ "bllllllln"
- /* 6 */ "olllllllb"
- /* 7 */ "bllllllgb"
- /* 8 */ "abbpppbba"
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "mmmmbqbqb"
- /* 1 */ "....q...q"
- /* 2 */ "....q...q"
- /* 3 */ "....q...q"
- /* 4 */ "bqqqb...b"
- /* 5 */ "q.......q"
- /* 6 */ "b.......q"
- /* 7 */ "q......rq"
- /* 8 */ "bqqqbqqqb",
-
- // Connectors:
- "-1: 0, 2, 2: 4\n" /* Type -1, direction X- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LittleHouse8
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LittleTower:
- // The data has been exported from the gallery Desert, area index 79, ID 595, created by STR_Warrior
- {
- // Size:
- 5, 9, 7, // SizeX = 5, SizeY = 9, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 5, 8, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 64: 3\n" /* wooddoorblock */
- "g: 65: 5\n" /* ladder */
- "h: 64: 8\n" /* wooddoorblock */
- "i:101: 0\n" /* ironbars */
- "j: 50: 4\n" /* torch */
- "k:128: 2\n" /* sandstonestairs */
- "l:126: 8\n" /* woodenslab */
- "m: 19: 0\n" /* sponge */
- "n:128: 4\n" /* sandstonestairs */
- "o:128: 5\n" /* sandstonestairs */
- "p:128: 7\n" /* sandstonestairs */
- "q:128: 6\n" /* sandstonestairs */
- "r: 44: 1\n" /* step */
- "s: 96: 1\n" /* trapdoor */,
-
- // Block data:
- // Level 0
- /* z\x* 01234 */
- /* 0 */ "abbba"
- /* 1 */ "mbbbm"
- /* 2 */ "accca"
- /* 3 */ "ccccc"
- /* 4 */ "ccccc"
- /* 5 */ "ccccc"
- /* 6 */ "accca"
-
- // Level 1
- /* z\x* 01234 */
- /* 0 */ "addda"
- /* 1 */ "mdddm"
- /* 2 */ "aceca"
- /* 3 */ "ceeec"
- /* 4 */ "ceeec"
- /* 5 */ "ceeec"
- /* 6 */ "accca"
-
- // Level 2
- /* z\x* 01234 */
- /* 0 */ "a...a"
- /* 1 */ "....."
- /* 2 */ "acfca"
- /* 3 */ "cg..c"
- /* 4 */ "c...c"
- /* 5 */ "c...c"
- /* 6 */ "accca"
-
- // Level 3
- /* z\x* 01234 */
- /* 0 */ "a...a"
- /* 1 */ "....."
- /* 2 */ "achca"
- /* 3 */ "cg..c"
- /* 4 */ "i...i"
- /* 5 */ "c..jc"
- /* 6 */ "acica"
-
- // Level 4
- /* z\x* 01234 */
- /* 0 */ "k...k"
- /* 1 */ "c...c"
- /* 2 */ "accca"
- /* 3 */ "cgllc"
- /* 4 */ "nlllo"
- /* 5 */ "clllc"
- /* 6 */ "acpca"
-
- // Level 5
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "....."
- /* 2 */ "accca"
- /* 3 */ "cg..c"
- /* 4 */ "c...c"
- /* 5 */ "c...c"
- /* 6 */ "accca"
-
- // Level 6
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "....."
- /* 2 */ "acica"
- /* 3 */ "cg..c"
- /* 4 */ "i...i"
- /* 5 */ "c..jc"
- /* 6 */ "acica"
-
- // Level 7
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "....."
- /* 2 */ "acqca"
- /* 3 */ "cgllc"
- /* 4 */ "nlllo"
- /* 5 */ "clllc"
- /* 6 */ "acpca"
-
- // Level 8
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "....."
- /* 2 */ "crcrc"
- /* 3 */ "rs..r"
- /* 4 */ "c...c"
- /* 5 */ "r...r"
- /* 6 */ "crcrc",
-
- // Connectors:
- "-1: 2, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LittleTower
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MediumHouse1:
- // The data has been exported from the gallery Desert, area index 71, ID 561, created by STR_Warrior
- {
- // Size:
- 15, 9, 9, // SizeX = 15, SizeY = 9, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 15, 8, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 12: 0\n" /* sand */
- "g: 64: 3\n" /* wooddoorblock */
- "h: 85: 0\n" /* fence */
- "i: 64: 0\n" /* wooddoorblock */
- "j: 65: 5\n" /* ladder */
- "k: 64: 8\n" /* wooddoorblock */
- "l:101: 0\n" /* ironbars */
- "m: 19: 0\n" /* sponge */
- "n: 50: 4\n" /* torch */
- "o:128: 2\n" /* sandstonestairs */
- "p:126: 8\n" /* woodenslab */
- "q:128: 4\n" /* sandstonestairs */
- "r:128: 7\n" /* sandstonestairs */
- "s: 44: 1\n" /* step */
- "t: 50: 3\n" /* torch */
- "u:128: 6\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmabbbammmmmmm"
- /* 1 */ "mmmmbbbmmmmmmmm"
- /* 2 */ "acccccccccacccc"
- /* 3 */ "ccccccccccccccc"
- /* 4 */ "ccccccccccccccc"
- /* 5 */ "ccccccccccccccc"
- /* 6 */ "ccccccccccccccc"
- /* 7 */ "ccccccccccccccc"
- /* 8 */ "acccccccccacccc"
-
- // Level 1
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmadddammmmmmm"
- /* 1 */ "mmmmdddmmmmmmmm"
- /* 2 */ "acccceccccaffff"
- /* 3 */ "ceeeeeeeeecffff"
- /* 4 */ "ceeeeeeeeecffff"
- /* 5 */ "ceeeeeeeeeeffff"
- /* 6 */ "ceeeeeeeeecffff"
- /* 7 */ "ceeeeeeeeecffff"
- /* 8 */ "acccccccccaffff"
-
- // Level 2
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmma...ammmmmmm"
- /* 1 */ "mmm.....mmmmmmm"
- /* 2 */ "accccgccccahhhh"
- /* 3 */ "c.........c...h"
- /* 4 */ "c.........c...h"
- /* 5 */ "c.........i...h"
- /* 6 */ "c.........c...h"
- /* 7 */ "c.........cj..h"
- /* 8 */ "acccccccccahhhh"
-
- // Level 3
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmma...ammmmmmm"
- /* 1 */ "mmm.....mmmmmmm"
- /* 2 */ "acccckcccca...."
- /* 3 */ "c.........c...."
- /* 4 */ "l.........c...."
- /* 5 */ "l.........k...."
- /* 6 */ "l.........c...."
- /* 7 */ "c..n...n..cj..."
- /* 8 */ "accclllccca...."
-
- // Level 4
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmo...ommmmmmm"
- /* 1 */ "mmmc...cmmmmmmm"
- /* 2 */ "accccccccca...."
- /* 3 */ "cpppppppppc...."
- /* 4 */ "qpppppppppc...."
- /* 5 */ "qpppppppppc...."
- /* 6 */ "qpppppppppc...."
- /* 7 */ "cpppppppppcj..."
- /* 8 */ "acccrrrccca...."
-
- // Level 5
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmm.....mmmmmmm"
- /* 1 */ "mmm.....mmmmmmm"
- /* 2 */ "csssscssssc...."
- /* 3 */ "s..accca..s...."
- /* 4 */ "s..c...c..s...."
- /* 5 */ "c.........c...."
- /* 6 */ "s..c...c..s...."
- /* 7 */ "s..accca..s...."
- /* 8 */ "csssscssssc...."
-
- // Level 6
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "...aclca......."
- /* 4 */ "...ct..c......."
- /* 5 */ "..............."
- /* 6 */ "...c...c......."
- /* 7 */ "...aclca......."
- /* 8 */ "..............."
-
- // Level 7
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "...acuca......."
- /* 4 */ "...cpppc......."
- /* 5 */ "...cpppc......."
- /* 6 */ "...cpppc......."
- /* 7 */ "...acrca......."
- /* 8 */ "..............."
-
- // Level 8
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "...cscsc......."
- /* 4 */ "...s...s......."
- /* 5 */ "...c...c......."
- /* 6 */ "...s...s......."
- /* 7 */ "...cscsc......."
- /* 8 */ "...............",
-
- // Connectors:
- "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 80,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // MediumHouse1
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MediumHouse2:
- // The data has been exported from the gallery Desert, area index 74, ID 573, created by STR_Warrior
- {
- // Size:
- 11, 10, 9, // SizeX = 11, SizeY = 10, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 9, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "A:128: 7\n" /* sandstonestairs */
- "B: 44: 1\n" /* step */
- "C: 96: 3\n" /* trapdoor */
- "D: 96: 2\n" /* trapdoor */
- "E:128: 2\n" /* sandstonestairs */
- "F:128: 0\n" /* sandstonestairs */
- "G: 87: 0\n" /* netherstone */
- "H:128: 1\n" /* sandstonestairs */
- "I:128: 3\n" /* sandstonestairs */
- "J: 51: 0\n" /* fire */
- "K: 44: 9\n" /* step */
- "a: 24: 2\n" /* sandstone */
- "b: 24: 0\n" /* sandstone */
- "c: 4: 0\n" /* cobblestone */
- "d: 12: 0\n" /* sand */
- "e: 13: 0\n" /* gravel */
- "f: 5: 0\n" /* wood */
- "g: 65: 3\n" /* ladder */
- "h: 85: 0\n" /* fence */
- "i: 64: 3\n" /* wooddoorblock */
- "j:134: 1\n" /* 134 */
- "k:134: 2\n" /* 134 */
- "l: 61: 2\n" /* furnace */
- "m: 19: 0\n" /* sponge */
- "n:134: 6\n" /* 134 */
- "o:134: 4\n" /* 134 */
- "p: 65: 2\n" /* ladder */
- "q:101: 0\n" /* ironbars */
- "r: 50: 2\n" /* torch */
- "s: 47: 0\n" /* bookshelf */
- "t: 64: 8\n" /* wooddoorblock */
- "u: 50: 3\n" /* torch */
- "v:171: 8\n" /* carpet */
- "w:128: 6\n" /* sandstonestairs */
- "x:126: 8\n" /* woodenslab */
- "y:128: 5\n" /* sandstonestairs */
- "z:128: 4\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "abbbammmcmm"
- /* 1 */ "bbbbbdddcdm"
- /* 2 */ "bbbbbmmmcdm"
- /* 3 */ "bbbbbmmmcdm"
- /* 4 */ "bbbbabbbbba"
- /* 5 */ "bbbbbbbbbbb"
- /* 6 */ "bbbbbbbbbbb"
- /* 7 */ "bbbbbbbbbbb"
- /* 8 */ "abbbbbbbbba"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "abbbammmemm"
- /* 1 */ "bfffbdddedm"
- /* 2 */ "bfffbmmmedm"
- /* 3 */ "bfffbmmmedm"
- /* 4 */ "bfffabbbfba"
- /* 5 */ "bfffffffffb"
- /* 6 */ "bfffffffffb"
- /* 7 */ "bfffffffffb"
- /* 8 */ "abbbbbbbbba"
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "abbba......"
- /* 1 */ "bg..bhhh.h."
- /* 2 */ "b...b....h."
- /* 3 */ "b...b....h."
- /* 4 */ "b...abbbiba"
- /* 5 */ "b.........b"
- /* 6 */ "bjh.......b"
- /* 7 */ "bjk.lno..pb"
- /* 8 */ "abbbbbbbbba"
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "abqba......"
- /* 1 */ "bg..q......"
- /* 2 */ "b...q......"
- /* 3 */ "q..rb......"
- /* 4 */ "q...sbqbtba"
- /* 5 */ "q......u..b"
- /* 6 */ "b.v.......q"
- /* 7 */ "b........pb"
- /* 8 */ "abbbqqqbbba"
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "abwba......"
- /* 1 */ "bgxxy......"
- /* 2 */ "bxxxy......"
- /* 3 */ "zxxxb......"
- /* 4 */ "zxxxabwbbba"
- /* 5 */ "zxxxxxxxxxb"
- /* 6 */ "bxxxxxxxxxy"
- /* 7 */ "bxxxsssxxpb"
- /* 8 */ "abbbAAAbbba"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "bBBBb......"
- /* 1 */ "BC..B......"
- /* 2 */ "B...B......"
- /* 3 */ "B...B......"
- /* 4 */ "b...bBBBBBb"
- /* 5 */ "Bbbb......B"
- /* 6 */ "Bbbb......B"
- /* 7 */ "Bbbb.....DB"
- /* 8 */ "bBBBBbBBBBb"
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "..........."
- /* 4 */ "..........."
- /* 5 */ ".aEa......."
- /* 6 */ ".FGH......."
- /* 7 */ ".aIa......."
- /* 8 */ "..........."
-
- // Level 7
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "..........."
- /* 4 */ "..........."
- /* 5 */ ".a.a......."
- /* 6 */ "..J........"
- /* 7 */ ".a.a......."
- /* 8 */ "..........."
-
- // Level 8
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "..........."
- /* 4 */ "..........."
- /* 5 */ ".bbb......."
- /* 6 */ ".bKb......."
- /* 7 */ ".bbb......."
- /* 8 */ "..........."
-
- // Level 9
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "..........."
- /* 4 */ "..........."
- /* 5 */ ".B.B......."
- /* 6 */ "..........."
- /* 7 */ ".B.B......."
- /* 8 */ "...........",
-
- // Connectors:
- "-1: 8, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 80,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // MediumHouse2
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MediumHouse3:
- // The data has been exported from the gallery Desert, area index 76, ID 575, created by STR_Warrior
- {
- // Size:
- 12, 10, 11, // SizeX = 12, SizeY = 10, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 12, 9, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 3: 0\n" /* dirt */
- "d: 24: 0\n" /* sandstone */
- "e: 13: 0\n" /* gravel */
- "f: 2: 0\n" /* grass */
- "g: 5: 0\n" /* wood */
- "h: 85: 0\n" /* fence */
- "i: 64: 3\n" /* wooddoorblock */
- "j: 64: 2\n" /* wooddoorblock */
- "k: 65: 4\n" /* ladder */
- "l: 65: 2\n" /* ladder */
- "m: 19: 0\n" /* sponge */
- "n: 50: 1\n" /* torch */
- "o: 50: 2\n" /* torch */
- "p:101: 0\n" /* ironbars */
- "q: 64: 8\n" /* wooddoorblock */
- "r:128: 2\n" /* sandstonestairs */
- "s:128: 6\n" /* sandstonestairs */
- "t:126: 8\n" /* woodenslab */
- "u:128: 5\n" /* sandstonestairs */
- "v:128: 7\n" /* sandstonestairs */
- "w: 44: 1\n" /* step */
- "x: 96: 0\n" /* trapdoor */
- "y:126: 0\n" /* woodenslab */
- "z:128: 4\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "mmmmmammbbba"
- /* 1 */ "mmmmmmmmbbbm"
- /* 2 */ "cccccaddddda"
- /* 3 */ "cccccddddddd"
- /* 4 */ "cccccddddddd"
- /* 5 */ "cccccddddddd"
- /* 6 */ "cccddddddddd"
- /* 7 */ "mmmddddddddd"
- /* 8 */ "mmmdddddddda"
- /* 9 */ "mmmdddddmmmm"
- /* 10 */ "mmmadddammmm"
-
- // Level 1
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "mmmmmammeeea"
- /* 1 */ "mmmmmmmmeeem"
- /* 2 */ "fffffadddgda"
- /* 3 */ "fffffdgggggd"
- /* 4 */ "fffffggggggd"
- /* 5 */ "fffffdgggggd"
- /* 6 */ "fffddggggggd"
- /* 7 */ "mmmdgggggggd"
- /* 8 */ "mmmdggggddda"
- /* 9 */ "mmmdgggdmmmm"
- /* 10 */ "mmmadddammmm"
-
- // Level 2
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "mmmmma.....a"
- /* 1 */ "mmmmm......."
- /* 2 */ "hhhhhadddida"
- /* 3 */ "h....d.....d"
- /* 4 */ "h....j.....d"
- /* 5 */ "h....d.....d"
- /* 6 */ "hhhad......d"
- /* 7 */ "mmmd......kd"
- /* 8 */ "mmmd....ddda"
- /* 9 */ "mmmd..ldmmmm"
- /* 10 */ "mmmadddammmm"
-
- // Level 3
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "mmmmman...oa"
- /* 1 */ "mmmmm......."
- /* 2 */ ".....appdqda"
- /* 3 */ ".....d.....d"
- /* 4 */ ".....q.....d"
- /* 5 */ ".....d.....p"
- /* 6 */ "...hd......d"
- /* 7 */ "mmmd......kd"
- /* 8 */ "mmmd....dppa"
- /* 9 */ "mmmd..ldmmmm"
- /* 10 */ "mmmhdddhmmmm"
-
- // Level 4
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "mmmmmr.....r"
- /* 1 */ "mmmmmd.....d"
- /* 2 */ ".....assddda"
- /* 3 */ ".....dtttttd"
- /* 4 */ ".....dtttttd"
- /* 5 */ ".....dtttttu"
- /* 6 */ "...hdatttttd"
- /* 7 */ "mmmdttttttkd"
- /* 8 */ "mmmdtttadvva"
- /* 9 */ "mmmdttldmmmm"
- /* 10 */ "mmmhdddhmmmm"
-
- // Level 5
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ ".....dwwdwwd"
- /* 3 */ ".....w.....w"
- /* 4 */ ".....w.....w"
- /* 5 */ ".....w.....d"
- /* 6 */ "...hdadh...w"
- /* 7 */ "mmmd...d..xw"
- /* 8 */ "mmmd...awwwd"
- /* 9 */ "mmmd..ldmmmm"
- /* 10 */ "mmmhdddhmmmm"
-
- // Level 6
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "............"
- /* 3 */ "............"
- /* 4 */ "............"
- /* 5 */ "............"
- /* 6 */ "...hd.dh...."
- /* 7 */ "mmmd...d...."
- /* 8 */ "mmmp........"
- /* 9 */ "mmmd..ldmmmm"
- /* 10 */ "mmmhdpdhmmmm"
-
- // Level 7
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "............"
- /* 3 */ "............"
- /* 4 */ "............"
- /* 5 */ "............"
- /* 6 */ "...hd.dh...."
- /* 7 */ "mmmd...d...."
- /* 8 */ "mmmp........"
- /* 9 */ "mmmdn.ldmmmm"
- /* 10 */ "mmmhdpdhmmmm"
-
- // Level 8
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "............"
- /* 3 */ "............"
- /* 4 */ "............"
- /* 5 */ "............"
- /* 6 */ "...adsda...."
- /* 7 */ "mmmdyyyd...."
- /* 8 */ "mmmzyyyu...."
- /* 9 */ "mmmdyyldmmmm"
- /* 10 */ "mmmadvdammmm"
-
- // Level 9
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "............"
- /* 3 */ "............"
- /* 4 */ "............"
- /* 5 */ "............"
- /* 6 */ "...w.w.w...."
- /* 7 */ "mmm........."
- /* 8 */ "mmmw...w...."
- /* 9 */ "mmm.....mmmm"
- /* 10 */ "mmmw.w.wmmmm",
-
- // Connectors:
- "-1: 9, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 80,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // MediumHouse3
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // SmallHouse9:
- // The data has been exported from the gallery Desert, area index 67, ID 556, created by STR_Warrior
- {
- // Size:
- 9, 6, 11, // SizeX = 9, SizeY = 6, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 9, 5, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 64: 3\n" /* wooddoorblock */
- "g: 65: 2\n" /* ladder */
- "h: 64: 8\n" /* wooddoorblock */
- "i:101: 0\n" /* ironbars */
- "j: 50: 2\n" /* torch */
- "k: 50: 1\n" /* torch */
- "l:128: 2\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */
- "n:126: 8\n" /* woodenslab */
- "o:128: 5\n" /* sandstonestairs */
- "p:128: 6\n" /* sandstonestairs */
- "q:128: 4\n" /* sandstonestairs */
- "r:128: 7\n" /* sandstonestairs */
- "s: 44: 1\n" /* step */
- "t: 96: 2\n" /* trapdoor */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "mmmmabbba"
- /* 1 */ "mmmmmbbbm"
- /* 2 */ "mmmmaccca"
- /* 3 */ "mmmmccccc"
- /* 4 */ "mmmmccccc"
- /* 5 */ "mmmmccccc"
- /* 6 */ "acccacccc"
- /* 7 */ "ccccccccc"
- /* 8 */ "ccccccccc"
- /* 9 */ "ccccccccc"
- /* 10 */ "accccccca"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "mmmmaddda"
- /* 1 */ "mmmmmdddm"
- /* 2 */ "mmmmaceca"
- /* 3 */ "mmmmceeec"
- /* 4 */ "mmmmceeec"
- /* 5 */ "mmmmceeec"
- /* 6 */ "acccaeeec"
- /* 7 */ "ceeeeeeec"
- /* 8 */ "ceeeeeeec"
- /* 9 */ "ceeeeeeec"
- /* 10 */ "accccccca"
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "mmmma...a"
- /* 1 */ "mmmm....."
- /* 2 */ "mmmmacfca"
- /* 3 */ "mmmmc...c"
- /* 4 */ "mmmmc...c"
- /* 5 */ "mmmmc...c"
- /* 6 */ "accca...c"
- /* 7 */ "c.......c"
- /* 8 */ "c.......c"
- /* 9 */ "c......gc"
- /* 10 */ "accccccca"
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "mmmma...a"
- /* 1 */ "mmmm....."
- /* 2 */ "mmmmachca"
- /* 3 */ "mmmmc...c"
- /* 4 */ "mmmmc...c"
- /* 5 */ "mmmmc...i"
- /* 6 */ "acica...i"
- /* 7 */ "c.......i"
- /* 8 */ "i......jc"
- /* 9 */ "ck.....gc"
- /* 10 */ "acciiicca"
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "mmmml...l"
- /* 1 */ "mmmmc...c"
- /* 2 */ "mmmmaccca"
- /* 3 */ "mmmmcnnnc"
- /* 4 */ "mmmmcnnnc"
- /* 5 */ "mmmmcnnno"
- /* 6 */ "acpcannno"
- /* 7 */ "cnnnnnnno"
- /* 8 */ "qnnnnnnnc"
- /* 9 */ "cnnnnnngc"
- /* 10 */ "accrrrcca"
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "mmmm....."
- /* 1 */ "mmmm....."
- /* 2 */ "mmmmcscsc"
- /* 3 */ "mmmms...s"
- /* 4 */ "mmmms...s"
- /* 5 */ "mmmms...s"
- /* 6 */ "csssc...c"
- /* 7 */ "s.......s"
- /* 8 */ "s.......s"
- /* 9 */ "s......ts"
- /* 10 */ "cssscsssc",
-
- // Connectors:
- "-1: 6, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // SmallHouse9
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Temple:
- // The data has been exported from the gallery Desert, area index 83, ID 599, created by STR_Warrior
- {
- // Size:
- 13, 10, 9, // SizeX = 13, SizeY = 10, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 13, 9, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "A: 51: 0\n" /* fire */
- "B: 44: 9\n" /* step */
- "a: 24: 2\n" /* sandstone */
- "b: 4: 0\n" /* cobblestone */
- "c: 24: 0\n" /* sandstone */
- "d: 13: 0\n" /* gravel */
- "e: 5: 0\n" /* wood */
- "f: 64: 3\n" /* wooddoorblock */
- "g: 17: 0\n" /* tree */
- "h:128: 5\n" /* sandstonestairs */
- "i:128: 4\n" /* sandstonestairs */
- "j:128: 7\n" /* sandstonestairs */
- "k:128: 6\n" /* sandstonestairs */
- "l:118: 3\n" /* cauldronblock */
- "m: 19: 0\n" /* sponge */
- "n:155: 1\n" /* quartzblock */
- "o: 64: 8\n" /* wooddoorblock */
- "p: 50: 3\n" /* torch */
- "q:101: 0\n" /* ironbars */
- "r:140: 0\n" /* flowerpotblock */
- "s: 24: 1\n" /* sandstone */
- "t:128: 2\n" /* sandstonestairs */
- "u:126: 8\n" /* woodenslab */
- "v: 44: 1\n" /* step */
- "w:128: 0\n" /* sandstonestairs */
- "x: 87: 0\n" /* netherstone */
- "y:128: 1\n" /* sandstonestairs */
- "z:128: 3\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "mmmmabbbammmm"
- /* 1 */ "mmmmmbbbmmmmm"
- /* 2 */ "accccccccccca"
- /* 3 */ "ccccccccccccc"
- /* 4 */ "ccccccccccccc"
- /* 5 */ "ccccccccccccc"
- /* 6 */ "ccccccccccccc"
- /* 7 */ "ccccccccccccc"
- /* 8 */ "accccccccccca"
-
- // Level 1
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "mmmmadddammmm"
- /* 1 */ "mmmmmdddmmmmm"
- /* 2 */ "accccceccccca"
- /* 3 */ "ceeeeeeeeeeec"
- /* 4 */ "ceeeeeeeeeeec"
- /* 5 */ "ceeeeeeeeeeec"
- /* 6 */ "ceeeeeeeeeeec"
- /* 7 */ "ceeeeeeeeeeec"
- /* 8 */ "accccccccccca"
-
- // Level 2
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "mmmma...ammmm"
- /* 1 */ "mmmm.....mmmm"
- /* 2 */ "acccccfccccca"
- /* 3 */ "cgh.......igc"
- /* 4 */ "cj.........jc"
- /* 5 */ "c...........c"
- /* 6 */ "ck.........kc"
- /* 7 */ "cgh.linhl.igc"
- /* 8 */ "accccccccccca"
-
- // Level 3
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "mmmma...ammmm"
- /* 1 */ "mmmm.....mmmm"
- /* 2 */ "acccccoccccca"
- /* 3 */ "cg...p.p...gc"
- /* 4 */ "c...........c"
- /* 5 */ "q...........q"
- /* 6 */ "c...........c"
- /* 7 */ "cg...rsr...gc"
- /* 8 */ "acqqqcccqqqca"
-
- // Level 4
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "mmmmt...tmmmm"
- /* 1 */ "mmmms...cmmmm"
- /* 2 */ "accccccccccca"
- /* 3 */ "cguuuuuuuuugc"
- /* 4 */ "cuuuuuuuuuuuc"
- /* 5 */ "iuuuuuuuuuuuh"
- /* 6 */ "cuuuuuuuuuuuc"
- /* 7 */ "cguuuuuuuuugc"
- /* 8 */ "acjjjcccjjjca"
-
- // Level 5
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "mmmm.....mmmm"
- /* 1 */ "mmmm.....mmmm"
- /* 2 */ "cvvvvvcvvvvvc"
- /* 3 */ "v...........v"
- /* 4 */ "v.ccc...ccc.v"
- /* 5 */ "c.ccc...ccc.c"
- /* 6 */ "v.ccc...ccc.v"
- /* 7 */ "v...........v"
- /* 8 */ "cvvvvvcvvvvvc"
-
- // Level 6
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "............."
- /* 3 */ "............."
- /* 4 */ "..ata...ata.."
- /* 5 */ "..wxy...wxy.."
- /* 6 */ "..aza...aza.."
- /* 7 */ "............."
- /* 8 */ "............."
-
- // Level 7
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "............."
- /* 3 */ "............."
- /* 4 */ "..a.a...a.a.."
- /* 5 */ "...A.....A..."
- /* 6 */ "..a.a...a.a.."
- /* 7 */ "............."
- /* 8 */ "............."
-
- // Level 8
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "............."
- /* 3 */ "............."
- /* 4 */ "..ccc...ccc.."
- /* 5 */ "..cBc...cBc.."
- /* 6 */ "..ccc...ccc.."
- /* 7 */ "............."
- /* 8 */ "............."
-
- // Level 9
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "............."
- /* 3 */ "............."
- /* 4 */ "..v.v...v.v.."
- /* 5 */ "............."
- /* 6 */ "..v.v...v.v.."
- /* 7 */ "............."
- /* 8 */ ".............",
-
- // Connectors:
- "-1: 6, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 50,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Temple
-}; // g_AlchemistVillagePrefabs
-
-
-
-
-
-
-const cPrefab::sDef g_AlchemistVillageStartingPrefabs[] =
-{
- ////////////////////////////////////////////////////////////////////////////////
- // Well:
- // The data has been exported from the gallery Desert, area index 90, ID 631, created by STR_Warrior
- {
- // Size:
- 7, 21, 7, // SizeX = 7, SizeY = 21, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 6, 20, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 1: 0\n" /* stone */
- "b: 24: 2\n" /* sandstone */
- "c: 24: 0\n" /* sandstone */
- "d: 8: 0\n" /* water */
- "e: 4: 0\n" /* cobblestone */
- "f: 13: 0\n" /* gravel */
- "g:128: 1\n" /* sandstonestairs */
- "h: 44: 1\n" /* step */
- "i:128: 0\n" /* sandstonestairs */
- "j:128: 3\n" /* sandstonestairs */
- "k:128: 2\n" /* sandstonestairs */
- "l: 44: 9\n" /* step */
- "m: 19: 0\n" /* sponge */
- "n:126: 0\n" /* woodenslab */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "maaaaam"
- /* 6 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 7
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 8
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 9
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 10
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 11
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 12
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 13
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "mcdddcm"
- /* 3 */ "mcdddcm"
- /* 4 */ "mcdddcm"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmmmmmm"
-
- // Level 14
- /* z\x* 0123456 */
- /* 0 */ "mmeeemm"
- /* 1 */ "mbcccbm"
- /* 2 */ "ecdddce"
- /* 3 */ "ecdddce"
- /* 4 */ "ecdddce"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmeeemm"
-
- // Level 15
- /* z\x* 0123456 */
- /* 0 */ "mmfffmm"
- /* 1 */ "mbcccbm"
- /* 2 */ "fcdddcf"
- /* 3 */ "fcdddcf"
- /* 4 */ "fcdddcf"
- /* 5 */ "mbcccbm"
- /* 6 */ "mmfffmm"
-
- // Level 16
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "mbghibm"
- /* 2 */ ".j...j."
- /* 3 */ ".h...h."
- /* 4 */ ".k...k."
- /* 5 */ "mbghibm"
- /* 6 */ "mm...mm"
-
- // Level 17
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "mb...bm"
- /* 2 */ "......."
- /* 3 */ "......."
- /* 4 */ "......."
- /* 5 */ "mb...bm"
- /* 6 */ "mm...mm"
-
- // Level 18
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "mblllbm"
- /* 2 */ ".l...l."
- /* 3 */ ".l...l."
- /* 4 */ ".l...l."
- /* 5 */ "mblllbm"
- /* 6 */ "mm...mm"
-
- // Level 19
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "mcccccm"
- /* 2 */ ".cnnnc."
- /* 3 */ ".cnnnc."
- /* 4 */ ".cnnnc."
- /* 5 */ "mcccccm"
- /* 6 */ "mm...mm"
-
- // Level 20
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "mh.h.hm"
- /* 2 */ "......."
- /* 3 */ ".h...h."
- /* 4 */ "......."
- /* 5 */ "mh.h.hm"
- /* 6 */ "mm...mm",
-
- // Connectors:
- "2: 3, 16, 6: 3\n" /* Type 2, direction Z+ */
- "2: 0, 16, 3: 4\n" /* Type 2, direction X- */
- "2: 3, 16, 0: 2\n" /* Type 2, direction Z- */
- "2: 6, 16, 3: 5\n" /* Type 2, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Well
-};
-
-
-
-
-
-// The prefab counts:
-
-const size_t g_AlchemistVillagePrefabsCount = ARRAYCOUNT(g_AlchemistVillagePrefabs);
-
-const size_t g_AlchemistVillageStartingPrefabsCount = ARRAYCOUNT(g_AlchemistVillageStartingPrefabs);
-
diff --git a/src/Generating/Prefabs/AlchemistVillagePrefabs.h b/src/Generating/Prefabs/AlchemistVillagePrefabs.h
deleted file mode 100644
index dddc5530a..000000000
--- a/src/Generating/Prefabs/AlchemistVillagePrefabs.h
+++ /dev/null
@@ -1,15 +0,0 @@
-
-// AlchemistVillagePrefabs.h
-
-// Declares the prefabs in the group AlchemistVillage
-
-#include "../Prefab.h"
-
-
-
-
-
-extern const cPrefab::sDef g_AlchemistVillagePrefabs[];
-extern const cPrefab::sDef g_AlchemistVillageStartingPrefabs[];
-extern const size_t g_AlchemistVillagePrefabsCount;
-extern const size_t g_AlchemistVillageStartingPrefabsCount;
diff --git a/src/Generating/Prefabs/CMakeLists.txt b/src/Generating/Prefabs/CMakeLists.txt
index 68f6491c4..1b130636f 100644
--- a/src/Generating/Prefabs/CMakeLists.txt
+++ b/src/Generating/Prefabs/CMakeLists.txt
@@ -5,26 +5,18 @@ project (MCServer)
include_directories ("${PROJECT_SOURCE_DIR}/../../")
SET (SRCS
- AlchemistVillagePrefabs.cpp
- JapaneseVillagePrefabs.cpp
NetherFortPrefabs.cpp
- PlainsVillagePrefabs.cpp
RainbowRoadPrefabs.cpp
- SandFlatRoofVillagePrefabs.cpp
- SandVillagePrefabs.cpp
TestRailsPrefabs.cpp
- UnderwaterBasePrefabs.cpp)
+ UnderwaterBasePrefabs.cpp
+)
SET (HDRS
- AlchemistVillagePrefabs.h
- JapaneseVillagePrefabs.h
NetherFortPrefabs.h
- PlainsVillagePrefabs.h
RainbowRoadPrefabs.h
- SandFlatRoofVillagePrefabs.h
- SandVillagePrefabs.h
TestRailsPrefabs.h
- UnderwaterBasePrefabs.h)
+ UnderwaterBasePrefabs.h
+)
if(NOT MSVC)
add_library(Generating_Prefabs ${SRCS} ${HDRS})
diff --git a/src/Generating/Prefabs/JapaneseVillagePrefabs.cpp b/src/Generating/Prefabs/JapaneseVillagePrefabs.cpp
deleted file mode 100644
index 0362c9406..000000000
--- a/src/Generating/Prefabs/JapaneseVillagePrefabs.cpp
+++ /dev/null
@@ -1,3386 +0,0 @@
-
-// JapaneseVillagePrefabs.cpp
-
-// 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!
-
-#include "Globals.h"
-#include "JapaneseVillagePrefabs.h"
-
-
-
-
-
-const cPrefab::sDef g_JapaneseVillagePrefabs[] =
-{
- ////////////////////////////////////////////////////////////////////////////////
- // Arch:
- // The data has been exported from the gallery Plains, area index 144, ID 488, created by Aloe_vera
- {
- // Size:
- 11, 7, 5, // SizeX = 11, SizeY = 7, SizeZ = 5
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 6, 4, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 2: 0\n" /* grass */
- "b: 13: 0\n" /* gravel */
- "c:113: 0\n" /* netherbrickfence */
- "d: 50: 5\n" /* torch */
- "e: 44: 8\n" /* step */
- "f: 44: 0\n" /* step */
- "g: 43: 0\n" /* doubleslab */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "aaaabbbaaaa"
- /* 1 */ "aaaabbbaaaa"
- /* 2 */ "aaaabbbaaaa"
- /* 3 */ "aaaabbbaaaa"
- /* 4 */ "aaaabbbaaaa"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..c.....c.."
- /* 1 */ "..c.....c.."
- /* 2 */ "..c.....c.."
- /* 3 */ "..c.....c.."
- /* 4 */ "..c.....c.."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..c.....c.."
- /* 1 */ "..........."
- /* 2 */ "..c.....c.."
- /* 3 */ "..........."
- /* 4 */ "..c.....c.."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..d.....d.."
- /* 1 */ "..........."
- /* 2 */ "..c.....c.."
- /* 3 */ "..........."
- /* 4 */ "..d.....d.."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "...eeeee..."
- /* 1 */ "..........."
- /* 2 */ "..c.....c.."
- /* 3 */ "..........."
- /* 4 */ "...eeeee..."
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..f.....f.."
- /* 1 */ ".egfffffge."
- /* 2 */ ".egeeeeege."
- /* 3 */ ".egfffffge."
- /* 4 */ "..f.....f.."
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "gf.......fg"
- /* 3 */ "..........."
- /* 4 */ "...........",
-
- // Connectors:
- "2: 5, 1, 4: 3\n" /* Type 2, direction Z+ */
- "2: 5, 1, 0: 2\n" /* Type 2, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Arch
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Farm:
- // The data has been exported from the gallery Plains, area index 166, ID 554, created by Aloe_vera
- {
- // Size:
- 11, 8, 13, // SizeX = 11, SizeY = 8, SizeZ = 13
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 10, 7, 12, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 60: 7\n" /* tilleddirt */
- "c: 8: 0\n" /* water */
- "d: 43: 0\n" /* doubleslab */
- "e: 44: 0\n" /* step */
- "f: 59: 7\n" /* crops */
- "g: 83: 0\n" /* reedblock */
- "h:113: 0\n" /* netherbrickfence */
- "i: 50: 5\n" /* torch */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "maaaaaaaaam"
- /* 7 */ "maaaaaaaaam"
- /* 8 */ "maaaaaaaaam"
- /* 9 */ "maaaaaaaaam"
- /* 10 */ "maaaaaaaaam"
- /* 11 */ "maaaaaaaaam"
- /* 12 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "mabbbbbbbam"
- /* 3 */ "mabbbbbbbam"
- /* 4 */ "mabbbbbbbam"
- /* 5 */ "mabbbbbbbam"
- /* 6 */ "mabcccccaam"
- /* 7 */ "mabbbbbbbam"
- /* 8 */ "mabbbbbbbam"
- /* 9 */ "mabbbbbbbam"
- /* 10 */ "mabbbbbbbam"
- /* 11 */ "maaaaaaaaam"
- /* 12 */ "mmmmmmmmmmm"
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".deeeeeeed."
- /* 2 */ ".efffffffe."
- /* 3 */ ".efffffffe."
- /* 4 */ ".efffffffe."
- /* 5 */ ".efgggggfe."
- /* 6 */ ".eg.....ge."
- /* 7 */ ".efgggggfe."
- /* 8 */ ".efffffffe."
- /* 9 */ ".efffffffe."
- /* 10 */ ".efffffffe."
- /* 11 */ ".deeeeeeed."
- /* 12 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".h.......h."
- /* 2 */ "..........."
- /* 3 */ "..........."
- /* 4 */ "..........."
- /* 5 */ "...ggggg..."
- /* 6 */ "..g.....g.."
- /* 7 */ "...ggggg..."
- /* 8 */ "..........."
- /* 9 */ "..........."
- /* 10 */ "..........."
- /* 11 */ ".h.......h."
- /* 12 */ "..........."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".h.......h."
- /* 2 */ "..........."
- /* 3 */ "..........."
- /* 4 */ "..........."
- /* 5 */ "...ggggg..."
- /* 6 */ "..g.....g.."
- /* 7 */ "...ggggg..."
- /* 8 */ "..........."
- /* 9 */ "..........."
- /* 10 */ "..........."
- /* 11 */ ".h.......h."
- /* 12 */ "..........."
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".h.......h."
- /* 2 */ "..........."
- /* 3 */ "..........."
- /* 4 */ "..........."
- /* 5 */ "..........."
- /* 6 */ "..........."
- /* 7 */ "..........."
- /* 8 */ "..........."
- /* 9 */ "..........."
- /* 10 */ "..........."
- /* 11 */ ".h.......h."
- /* 12 */ "..........."
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ ".h.......h."
- /* 1 */ "hhh.....hhh"
- /* 2 */ ".h.......h."
- /* 3 */ "..........."
- /* 4 */ "..........."
- /* 5 */ "..........."
- /* 6 */ "..........."
- /* 7 */ "..........."
- /* 8 */ "..........."
- /* 9 */ "..........."
- /* 10 */ ".h.......h."
- /* 11 */ "hhh.....hhh"
- /* 12 */ ".h.......h."
-
- // Level 7
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ ".i.......i."
- /* 1 */ "i.i.....i.i"
- /* 2 */ ".i.......i."
- /* 3 */ "..........."
- /* 4 */ "..........."
- /* 5 */ "..........."
- /* 6 */ "..........."
- /* 7 */ "..........."
- /* 8 */ "..........."
- /* 9 */ "..........."
- /* 10 */ ".i.......i."
- /* 11 */ "i.i.....i.i"
- /* 12 */ ".i.......i.",
-
- // Connectors:
- "-1: 10, 2, 6: 5\n" /* Type -1, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Farm
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Forge:
- // The data has been exported from the gallery Plains, area index 79, ID 145, created by Aloe_vera
- {
- // Size:
- 16, 11, 14, // SizeX = 16, SizeY = 11, SizeZ = 14
-
- // Hitbox (relative to bounding box):
- 0, 0, -1, // MinX, MinY, MinZ
- 16, 10, 14, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 17: 1\n" /* tree */
- "c: 67: 0\n" /* stairs */
- "d: 5: 2\n" /* wood */
- "e: 67: 2\n" /* stairs */
- "f:113: 0\n" /* netherbrickfence */
- "g:118: 2\n" /* cauldronblock */
- "h: 67: 6\n" /* stairs */
- "i: 67: 4\n" /* stairs */
- "j: 87: 0\n" /* netherstone */
- "k: 67: 7\n" /* stairs */
- "l: 54: 5\n" /* chest */
- "m: 19: 0\n" /* sponge */
- "n: 61: 2\n" /* furnace */
- "o:101: 0\n" /* ironbars */
- "p: 51: 0\n" /* fire */
- "q: 50: 4\n" /* torch */
- "r: 50: 2\n" /* torch */
- "s: 35: 0\n" /* wool */
- "t: 67: 3\n" /* stairs */
- "u: 50: 3\n" /* torch */
- "v: 44: 8\n" /* step */
- "w: 43: 0\n" /* doubleslab */
- "x: 44: 0\n" /* step */
- "y: 17: 5\n" /* tree */
- "z: 17: 9\n" /* tree */,
-
- // Block data:
- // Level 0
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "mmmmmmmmmmmmmmmm"
- /* 1 */ "mmmmmmmmmmmmmmmm"
- /* 2 */ "mmaaaaaaaaaaaamm"
- /* 3 */ "mmaaaaaaaaaaaamm"
- /* 4 */ "mmaaaaaaaaaaaamm"
- /* 5 */ "mmaaaaaaaaaaaamm"
- /* 6 */ "mmaaaaaaaaaaaamm"
- /* 7 */ "mmaaaaaaaaaaaamm"
- /* 8 */ "mmaaaaaaaaaaaamm"
- /* 9 */ "mmaaaaaaaaaaaamm"
- /* 10 */ "mmaaaaaaaaaaaamm"
- /* 11 */ "mmaaaaaaaaaaaamm"
- /* 12 */ "mmmmmmmmmmmmmmmm"
- /* 13 */ "mmmmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ ".....bbbbbbbbb.."
- /* 3 */ ".....cdddddddb.."
- /* 4 */ ".....cddaaaadb.."
- /* 5 */ "..beeedaaaaadb.."
- /* 6 */ "..bddddaaaaadb.."
- /* 7 */ "..bddddaaaaadb.."
- /* 8 */ "..bddddaaaaadb.."
- /* 9 */ "..bddddaaaaadb.."
- /* 10 */ "..bddddddddddb.."
- /* 11 */ "..bbbbbbbbbbbb.."
- /* 12 */ "................"
- /* 13 */ "................"
-
- // Level 2
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ ".....bfffbfffb.."
- /* 3 */ ".............a.."
- /* 4 */ ".............a.."
- /* 5 */ "..b.....ghh..a.."
- /* 6 */ "..f.....haa..b.."
- /* 7 */ "..f.....ija..b.."
- /* 8 */ "..f.....kaa..a.."
- /* 9 */ "..f..........a.."
- /* 10 */ "..fl.........a.."
- /* 11 */ "..bffffbbffffb.."
- /* 12 */ "................"
- /* 13 */ "................"
-
- // Level 3
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ ".....bfffbfffb.."
- /* 3 */ ".............a.."
- /* 4 */ ".............a.."
- /* 5 */ "..b......nn..a.."
- /* 6 */ "..f.....oaa..b.."
- /* 7 */ "..f.....opa..b.."
- /* 8 */ "..f.....oaa..a.."
- /* 9 */ "..f..........a.."
- /* 10 */ "..f..........a.."
- /* 11 */ "..bffffbbffffb.."
- /* 12 */ "................"
- /* 13 */ "................"
-
- // Level 4
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ ".........q...q.."
- /* 2 */ "....rbsssbsssb.."
- /* 3 */ ".............a.."
- /* 4 */ "..q..........a.."
- /* 5 */ "..b......ce..a.."
- /* 6 */ "..s......ea..b.."
- /* 7 */ "..s......aa..b.."
- /* 8 */ "..s......ta..a.."
- /* 9 */ "..s..........a.."
- /* 10 */ "..s..........a.."
- /* 11 */ ".rbssssbbssssb.."
- /* 12 */ "..u....uu....u.."
- /* 13 */ "................"
-
- // Level 5
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ ".vwxxxxxxxxxxwv."
- /* 1 */ "vvvvvvvvvvvvvvvv"
- /* 2 */ "wvbyybyyybbyybvw"
- /* 3 */ "xvz..........zvx"
- /* 4 */ "xvz..........zvx"
- /* 5 */ "xvb..........zvx"
- /* 6 */ "xvz.......a..bvx"
- /* 7 */ "xvz......ca..bvx"
- /* 8 */ "xvz.......a..zvx"
- /* 9 */ "xvz..........zvx"
- /* 10 */ "xvz..........zvx"
- /* 11 */ "wvbyyyyyyyyyybvw"
- /* 12 */ "vvvvvvvvvvvvvvvv"
- /* 13 */ ".vwxxxxxxxxxxwv."
-
- // Level 6
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "wx............xw"
- /* 1 */ "x..............x"
- /* 2 */ "..xxxxxxxxxxxx.."
- /* 3 */ "..xwwwwwwwwwwx.."
- /* 4 */ "..xwvvvvvvvvvx.."
- /* 5 */ "..xwv.......vx.."
- /* 6 */ "..xwv.....a.vx.."
- /* 7 */ "..xwv.....a.vx.."
- /* 8 */ "..xwv.....a.vx.."
- /* 9 */ "..xwvvvvvvvvvx.."
- /* 10 */ "..xwwwwwwwwwwx.."
- /* 11 */ "..xxxxxxxxxxxx.."
- /* 12 */ "x..............x"
- /* 13 */ "wx............xw"
-
- // Level 7
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "................"
- /* 3 */ "................"
- /* 4 */ "....xxxxxxxx...."
- /* 5 */ "....xxxxxxxx...."
- /* 6 */ "....xwwwwwax...."
- /* 7 */ "....xwvvvvax...."
- /* 8 */ "....xwwwwwax...."
- /* 9 */ "....xxxxxxxx...."
- /* 10 */ "................"
- /* 11 */ "................"
- /* 12 */ "................"
- /* 13 */ "................"
-
- // Level 8
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "................"
- /* 3 */ "................"
- /* 4 */ "................"
- /* 5 */ "................"
- /* 6 */ "..........a....."
- /* 7 */ ".......xx.a....."
- /* 8 */ "..........a....."
- /* 9 */ "................"
- /* 10 */ "................"
- /* 11 */ "................"
- /* 12 */ "................"
- /* 13 */ "................"
-
- // Level 9
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "................"
- /* 3 */ "................"
- /* 4 */ "................"
- /* 5 */ "................"
- /* 6 */ "..........a....."
- /* 7 */ "..........a....."
- /* 8 */ "..........a....."
- /* 9 */ "................"
- /* 10 */ "................"
- /* 11 */ "................"
- /* 12 */ "................"
- /* 13 */ "................"
-
- // Level 10
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "................"
- /* 3 */ "................"
- /* 4 */ "................"
- /* 5 */ "................"
- /* 6 */ "..........a....."
- /* 7 */ "..........a....."
- /* 8 */ "..........a....."
- /* 9 */ "................"
- /* 10 */ "................"
- /* 11 */ "................"
- /* 12 */ "................"
- /* 13 */ "................",
-
- // Connectors:
- "-1: 0, 1, 3: 4\n" /* Type -1, direction X- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Forge
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Garden2:
- // The data has been exported from the gallery Plains, area index 147, ID 491, created by Aloe_vera
- {
- // Size:
- 16, 5, 16, // SizeX = 16, SizeY = 5, SizeZ = 16
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 15, 4, 15, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 8: 0\n" /* water */
- "c: 2: 0\n" /* grass */
- "d: 17: 1\n" /* tree */
- "e: 13: 0\n" /* gravel */
- "f: 31: 2\n" /* tallgrass */
- "g: 18: 5\n" /* leaves */
- "h: 38: 7\n" /* rose */
- "i: 17: 9\n" /* tree */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 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 */ "aaaaaaaaaaaaaaaa"
-
- // Level 1
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "aaaaaaaaaaaaaaaa"
- /* 1 */ "aaaaaaaaaaaaaaaa"
- /* 2 */ "aaaaaaaaaaaaaaaa"
- /* 3 */ "aaaaaaaaaaaaaaaa"
- /* 4 */ "aaaaaaaaaaaaaaaa"
- /* 5 */ "aaaaaaaaaaaaaaaa"
- /* 6 */ "aaaabbaaaaaaaaaa"
- /* 7 */ "aaabbbaaaaaaaaaa"
- /* 8 */ "aaabbaaaaaaaaaaa"
- /* 9 */ "aaaabaaaaaaaaaaa"
- /* 10 */ "aaaaaaaaaaaaaaaa"
- /* 11 */ "aaaaaaaaaaaaaaaa"
- /* 12 */ "aaaaaaaaaaaaaaaa"
- /* 13 */ "aaaaaaaaaaaaaaaa"
- /* 14 */ "aaaaaaaaaaaaaaaa"
- /* 15 */ "aaaaaaaaaaaaaaaa"
-
- // Level 2
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "cccccccccccccccc"
- /* 1 */ "ccdccccccccdcccc"
- /* 2 */ "cccccceecccccdcc"
- /* 3 */ "ccccccceeccccccc"
- /* 4 */ "cccccccceccccccc"
- /* 5 */ "cccbbbbceccccccc"
- /* 6 */ "cccbbbbceecccccc"
- /* 7 */ "ccbbbbbcceeeeccc"
- /* 8 */ "ccbbbbbccccceecc"
- /* 9 */ "ccbbbbcccccccecc"
- /* 10 */ "ccccbcccccccceec"
- /* 11 */ "ccccccccccccccec"
- /* 12 */ "ccccccccaaacccec"
- /* 13 */ "cccccccccaccccec"
- /* 14 */ "ccccccccccccceec"
- /* 15 */ "cccccccccccceecc"
-
- // Level 3
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "......f...gg.g.."
- /* 1 */ "..gg.....gggggg."
- /* 2 */ "ffgg......ghgggg"
- /* 3 */ ".............gg."
- /* 4 */ "...........f...."
- /* 5 */ "...........h.ff."
- /* 6 */ ".............fh."
- /* 7 */ "...............f"
- /* 8 */ "................"
- /* 9 */ ".......ff.f....."
- /* 10 */ ".f.....ffggf...."
- /* 11 */ ".......gggg.f..."
- /* 12 */ ".f......iddg...."
- /* 13 */ ".....f..gdgg...."
- /* 14 */ "....ff...gg....."
- /* 15 */ "................"
-
- // Level 4
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "...........g.g.."
- /* 2 */ ".............gg."
- /* 3 */ "................"
- /* 4 */ "................"
- /* 5 */ "................"
- /* 6 */ "................"
- /* 7 */ "................"
- /* 8 */ "................"
- /* 9 */ "................"
- /* 10 */ ".........g......"
- /* 11 */ "........ggg....."
- /* 12 */ "........ggg....."
- /* 13 */ ".........g......"
- /* 14 */ "................"
- /* 15 */ "................",
-
- // Connectors:
- "-1: 12, 3, 15: 3\n" /* Type -1, direction Z+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Garden2
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseMid:
- // The data has been exported from the gallery Plains, area index 62, ID 119, created by Aloe_vera
- {
- // Size:
- 10, 9, 9, // SizeX = 10, SizeY = 9, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- 0, 0, -1, // MinX, MinY, MinZ
- 10, 8, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 2\n" /* wood */
- "b:135: 2\n" /* 135 */
- "c:135: 0\n" /* 135 */
- "d: 17: 9\n" /* tree */
- "e:135: 3\n" /* 135 */
- "f: 85: 0\n" /* fence */
- "g: 17: 1\n" /* tree */
- "h:171: 0\n" /* carpet */
- "i: 50: 5\n" /* torch */
- "j: 35: 0\n" /* wool */
- "k: 17: 5\n" /* tree */
- "l:124: 0\n" /* redstonelampon */
- "m: 19: 0\n" /* sponge */
- "n: 69: 9\n" /* lever */
- "o: 44: 8\n" /* step */
- "p: 43: 0\n" /* doubleslab */
- "q: 44: 0\n" /* step */,
-
- // Block data:
- // Level 0
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "maaaaaaaaa"
- /* 1 */ "maaaaaaaaa"
- /* 2 */ "aaaaaaaaaa"
- /* 3 */ "aaaaaaaaaa"
- /* 4 */ "aaaaaaaaaa"
- /* 5 */ "aaaaaaaaaa"
- /* 6 */ "aaaaaaaaaa"
- /* 7 */ "maaaaaaaaa"
- /* 8 */ "maaaaaaaaa"
-
- // Level 1
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".aaaaaaaaa"
- /* 1 */ ".aaaaaaaaa"
- /* 2 */ "baaaaaaaaa"
- /* 3 */ "caaaaaaaaa"
- /* 4 */ "caadaaaaaa"
- /* 5 */ "caaaaaaaaa"
- /* 6 */ "eaaaaaaaaa"
- /* 7 */ ".aaaaaaaaa"
- /* 8 */ ".aaaaaaaaa"
-
- // Level 2
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".fffffffff"
- /* 1 */ ".f.......f"
- /* 2 */ ".f.ggggg.f"
- /* 3 */ "...ghhhg.f"
- /* 4 */ "....hhhg.f"
- /* 5 */ "...ghhhg.f"
- /* 6 */ ".f.ggggg.f"
- /* 7 */ ".f.......f"
- /* 8 */ ".fffffffff"
-
- // Level 3
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".....i...i"
- /* 1 */ ".........."
- /* 2 */ ".i.jjgjj.."
- /* 3 */ "...g...j.."
- /* 4 */ ".......g.i"
- /* 5 */ "...g...j.."
- /* 6 */ ".i.jjgjj.."
- /* 7 */ ".........."
- /* 8 */ ".....i...i"
-
- // Level 4
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".........."
- /* 2 */ "...jjgjj.."
- /* 3 */ "...g...j.."
- /* 4 */ "...j...g.."
- /* 5 */ "...g...j.."
- /* 6 */ "...jjgjj.."
- /* 7 */ ".........."
- /* 8 */ ".........."
-
- // Level 5
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ "...f...f.."
- /* 2 */ "..fgkgkgf."
- /* 3 */ "..fd...d.."
- /* 4 */ "...d.lng.."
- /* 5 */ "..fd...d.."
- /* 6 */ "..fgkgkgf."
- /* 7 */ "...f...f.."
- /* 8 */ ".........."
-
- // Level 6
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "...ooooo.."
- /* 1 */ "..opppppo."
- /* 2 */ ".opgjjjgpo"
- /* 3 */ ".opjgggjpo"
- /* 4 */ ".opjgggjpo"
- /* 5 */ ".opjgggjpo"
- /* 6 */ ".opgjjjgpo"
- /* 7 */ "..opppppo."
- /* 8 */ "...ooooo.."
-
- // Level 7
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".opq...qpo"
- /* 1 */ ".pq.....qp"
- /* 2 */ ".q.qqqqq.q"
- /* 3 */ "...qpppq.."
- /* 4 */ "...qpppq.."
- /* 5 */ "...qpppq.."
- /* 6 */ ".q.qqqqq.q"
- /* 7 */ ".pq.....qp"
- /* 8 */ ".opq...qpo"
-
- // Level 8
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".q.......q"
- /* 1 */ ".........."
- /* 2 */ ".........."
- /* 3 */ ".........."
- /* 4 */ ".....q...."
- /* 5 */ ".........."
- /* 6 */ ".........."
- /* 7 */ ".........."
- /* 8 */ ".q.......q",
-
- // Connectors:
- "-1: 0, 1, 4: 4\n" /* Type -1, direction X- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseMid
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseSmall:
- // The data has been exported from the gallery Plains, area index 68, ID 131, created by Aloe_vera
- {
- // Size:
- 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 7, 5, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 2\n" /* wood */
- "b: 17: 1\n" /* tree */
- "c: 35: 0\n" /* wool */
- "d: 50: 4\n" /* torch */
- "e: 85: 0\n" /* fence */
- "f: 44: 8\n" /* step */
- "g: 43: 0\n" /* doubleslab */
- "h: 44: 0\n" /* step */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "maaaaam"
- /* 6 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".bcc.b."
- /* 2 */ ".c...c."
- /* 3 */ ".c...c."
- /* 4 */ ".c...c."
- /* 5 */ ".bcccb."
- /* 6 */ "......."
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ ".....d."
- /* 1 */ ".bee.b."
- /* 2 */ ".c...c."
- /* 3 */ ".e...e."
- /* 4 */ ".c...c."
- /* 5 */ ".beeeb."
- /* 6 */ "......."
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ ".fffff."
- /* 1 */ "fbcccbf"
- /* 2 */ "fc...cf"
- /* 3 */ "fc...cf"
- /* 4 */ "fc...cf"
- /* 5 */ "fbcccbf"
- /* 6 */ ".fffff."
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "gh...hg"
- /* 1 */ "hhhhhhh"
- /* 2 */ ".hgggh."
- /* 3 */ ".hgggh."
- /* 4 */ ".hgggh."
- /* 5 */ "hhhhhhh"
- /* 6 */ "gh...hg"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "......."
- /* 2 */ "......."
- /* 3 */ "...h..."
- /* 4 */ "......."
- /* 5 */ "......."
- /* 6 */ ".......",
-
- // Connectors:
- "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseSmall
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseSmallDblWithDoor:
- // The data has been exported from the gallery Plains, area index 113, ID 265, created by Aloe_vera
- {
- // Size:
- 11, 6, 7, // SizeX = 11, SizeY = 6, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 5, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 2\n" /* wood */
- "b: 17: 9\n" /* tree */
- "c: 17: 1\n" /* tree */
- "d: 35: 0\n" /* wool */
- "e: 64: 7\n" /* wooddoorblock */
- "f:171:12\n" /* carpet */
- "g:135: 1\n" /* 135 */
- "h:126: 2\n" /* woodenslab */
- "i:135: 2\n" /* 135 */
- "j: 50: 4\n" /* torch */
- "k: 64:12\n" /* wooddoorblock */
- "l: 85: 0\n" /* fence */
- "m: 19: 0\n" /* sponge */
- "n: 44: 8\n" /* step */
- "o: 43: 0\n" /* doubleslab */
- "p: 44: 0\n" /* step */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaabaaaam"
- /* 3 */ "maaaabaaaam"
- /* 4 */ "maaaabaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".cdedcdddc."
- /* 2 */ ".dfff.fffd."
- /* 3 */ ".dgffdfhfd."
- /* 4 */ ".diifdfffd."
- /* 5 */ ".cdddcdddc."
- /* 6 */ "..........."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ ".j...j...j."
- /* 1 */ ".cdkdclllc."
- /* 2 */ ".d.......l."
- /* 3 */ ".l...l...l."
- /* 4 */ ".d...l...l."
- /* 5 */ ".clllclllc."
- /* 6 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ ".nnnnnnnnn."
- /* 1 */ "ncdddcdddcn"
- /* 2 */ "nd...d...dn"
- /* 3 */ "nd...d...dn"
- /* 4 */ "nd...d...dn"
- /* 5 */ "ncdddcdddcn"
- /* 6 */ ".nnnnnnnnn."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "op.......po"
- /* 1 */ "ppppppppppp"
- /* 2 */ ".pooooooop."
- /* 3 */ ".ponndnnop."
- /* 4 */ ".pooooooop."
- /* 5 */ "ppppppppppp"
- /* 6 */ "op.......po"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "...ppppp..."
- /* 4 */ "..........."
- /* 5 */ "..........."
- /* 6 */ "...........",
-
- // Connectors:
- "-1: 3, 1, -1: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseSmallDblWithDoor
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseSmallDouble:
- // The data has been exported from the gallery Plains, area index 72, ID 135, created by Aloe_vera
- {
- // Size:
- 11, 6, 7, // SizeX = 11, SizeY = 6, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 5, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 2\n" /* wood */
- "b: 17: 1\n" /* tree */
- "c: 35: 0\n" /* wool */
- "d:171:12\n" /* carpet */
- "e:135: 1\n" /* 135 */
- "f:126: 2\n" /* woodenslab */
- "g:135: 2\n" /* 135 */
- "h: 50: 4\n" /* torch */
- "i: 85: 0\n" /* fence */
- "j: 44: 8\n" /* step */
- "k: 43: 0\n" /* doubleslab */
- "l: 44: 0\n" /* step */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".bcc.bcccb."
- /* 2 */ ".cddd.dddc."
- /* 3 */ ".ceddcdfdc."
- /* 4 */ ".cggdcdddc."
- /* 5 */ ".bcccbcccb."
- /* 6 */ "..........."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ ".h...h...h."
- /* 1 */ ".bii.biiib."
- /* 2 */ ".c.......c."
- /* 3 */ ".i...i...i."
- /* 4 */ ".c...i...c."
- /* 5 */ ".biiibiiib."
- /* 6 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ ".jjjjjjjjj."
- /* 1 */ "jbiiibiiibj"
- /* 2 */ "jc.......cj"
- /* 3 */ "jc...c...cj"
- /* 4 */ "jc...c...cj"
- /* 5 */ "jbcccbcccbj"
- /* 6 */ ".jjjjjjjjj."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "kl...l...lk"
- /* 1 */ "lllllllllll"
- /* 2 */ ".lkkklkkkl."
- /* 3 */ ".lkjklkkkl."
- /* 4 */ ".lkkklkkkl."
- /* 5 */ "lllllllllll"
- /* 6 */ "kl...l...lk"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "...l...l..."
- /* 4 */ "..........."
- /* 5 */ "..........."
- /* 6 */ "...........",
-
- // Connectors:
- "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseSmallDouble
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseSmallWithDoor:
- // The data has been exported from the gallery Plains, area index 112, ID 264, created by Aloe_vera
- {
- // Size:
- 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 7, 5, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 2\n" /* wood */
- "b: 17: 1\n" /* tree */
- "c: 35: 0\n" /* wool */
- "d: 64: 7\n" /* wooddoorblock */
- "e: 50: 4\n" /* torch */
- "f: 64:12\n" /* wooddoorblock */
- "g: 85: 0\n" /* fence */
- "h: 44: 8\n" /* step */
- "i: 43: 0\n" /* doubleslab */
- "j: 44: 0\n" /* step */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "maaaaam"
- /* 6 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".bcdcb."
- /* 2 */ ".c...c."
- /* 3 */ ".c...c."
- /* 4 */ ".c...c."
- /* 5 */ ".bcccb."
- /* 6 */ "......."
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ ".....e."
- /* 1 */ ".bcfcb."
- /* 2 */ ".g...g."
- /* 3 */ ".g...g."
- /* 4 */ ".g...g."
- /* 5 */ ".bgggb."
- /* 6 */ "......."
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ ".hhhhh."
- /* 1 */ "hbcccbh"
- /* 2 */ "hc...ch"
- /* 3 */ "hc...ch"
- /* 4 */ "hc...ch"
- /* 5 */ "hbcccbh"
- /* 6 */ ".hhhhh."
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "ij...ji"
- /* 1 */ "jjjjjjj"
- /* 2 */ ".jiiij."
- /* 3 */ ".jiiij."
- /* 4 */ ".jiiij."
- /* 5 */ "jjjjjjj"
- /* 6 */ "ij...ji"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "......."
- /* 2 */ "......."
- /* 3 */ "...j..."
- /* 4 */ "......."
- /* 5 */ "......."
- /* 6 */ ".......",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseSmallWithDoor
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseWide:
- // The data has been exported from the gallery Plains, area index 64, ID 121, created by STR_Warrior
- {
- // Size:
- 11, 6, 11, // SizeX = 11, SizeY = 6, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- -1, 0, -1, // MinX, MinY, MinZ
- 11, 5, 10, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 2\n" /* wood */
- "b: 17: 1\n" /* tree */
- "c: 35: 0\n" /* wool */
- "d:171: 0\n" /* carpet */
- "e:126: 1\n" /* woodenslab */
- "f: 64: 5\n" /* wooddoorblock */
- "g: 85: 0\n" /* fence */
- "h: 50: 1\n" /* torch */
- "i: 50: 2\n" /* torch */
- "j: 64:12\n" /* wooddoorblock */
- "k:126:11\n" /* woodenslab */
- "l: 17: 5\n" /* tree */
- "m: 19: 0\n" /* sponge */
- "n:126: 3\n" /* woodenslab */
- "o:125: 3\n" /* woodendoubleslab */
- "p: 5: 3\n" /* wood */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "mmaaaaaaamm"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "maaaaaaaaam"
- /* 7 */ "maaaaaaaaam"
- /* 8 */ "maaaaaaaaam"
- /* 9 */ "mmaaaaaaamm"
- /* 10 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..bcbcbcb.."
- /* 2 */ ".b.d.....b."
- /* 3 */ ".cded....c."
- /* 4 */ ".bded....b."
- /* 5 */ ".c.d.....c."
- /* 6 */ ".b.......b."
- /* 7 */ ".c.......c."
- /* 8 */ ".b.......b."
- /* 9 */ "..bcbfbcb.."
- /* 10 */ "..........."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..bgbgbgb.."
- /* 2 */ ".b.......b."
- /* 3 */ ".g.......g."
- /* 4 */ ".bh.....ib."
- /* 5 */ ".g.......g."
- /* 6 */ ".b.......b."
- /* 7 */ ".g.......g."
- /* 8 */ ".b.......b."
- /* 9 */ "..bgbjbgb.."
- /* 10 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "...kkkkk..."
- /* 1 */ "..bcbcbcb.."
- /* 2 */ ".b.......b."
- /* 3 */ "kc.......ck"
- /* 4 */ "kb.......bk"
- /* 5 */ "kc.......ck"
- /* 6 */ "kb.......bk"
- /* 7 */ "kc.......ck"
- /* 8 */ ".b.......b."
- /* 9 */ "..bcblbcb.."
- /* 10 */ "...kkkkk..."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ ".kn.....nk."
- /* 1 */ "konnnnnnnok"
- /* 2 */ "nnnnnnnnnnn"
- /* 3 */ ".nnpppppnn."
- /* 4 */ ".nnpkkkpnn."
- /* 5 */ ".nnpkkkpnn."
- /* 6 */ ".nnpkkkpnn."
- /* 7 */ ".nnpppppnn."
- /* 8 */ "nnnnnnnnnnn"
- /* 9 */ "kknnnnnnnok"
- /* 10 */ ".kn.....nk."
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "n.........n"
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "..........."
- /* 4 */ "....nnn...."
- /* 5 */ "....non...."
- /* 6 */ "....nnn...."
- /* 7 */ "..........."
- /* 8 */ "..........."
- /* 9 */ "..........."
- /* 10 */ "n.........n",
-
- // Connectors:
- "-1: 5, 1, 10: 3\n" /* Type -1, direction Z+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseWide
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseWithGarden:
- // The data has been exported from the gallery Plains, area index 67, ID 130, created by Aloe_vera
- {
- // Size:
- 16, 9, 16, // SizeX = 16, SizeY = 9, SizeZ = 16
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 16, 8, 16, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 5: 2\n" /* wood */
- "c: 2: 0\n" /* grass */
- "d:113: 0\n" /* netherbrickfence */
- "e: 17: 1\n" /* tree */
- "f: 35: 0\n" /* wool */
- "g:126: 2\n" /* woodenslab */
- "h: 31: 2\n" /* tallgrass */
- "i:125: 2\n" /* woodendoubleslab */
- "j: 38: 3\n" /* rose */
- "k: 38: 2\n" /* rose */
- "l: 38: 1\n" /* rose */
- "m: 19: 0\n" /* sponge */
- "n: 17: 2\n" /* tree */
- "o: 50: 4\n" /* torch */
- "p: 85: 0\n" /* fence */
- "q:140: 0\n" /* flowerpotblock */
- "r: 50: 3\n" /* torch */
- "s: 44: 8\n" /* step */
- "t: 50: 1\n" /* torch */
- "u: 50: 2\n" /* torch */
- "v: 43: 0\n" /* doubleslab */
- "w: 44: 0\n" /* step */
- "x: 18:10\n" /* leaves */,
-
- // Block data:
- // Level 0
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "mmmmmmmmmaammmmm"
- /* 1 */ "aabbbbbbbbbbaaam"
- /* 2 */ "aabbbbbbbbbbaaam"
- /* 3 */ "aabbbbbbbbbbaaam"
- /* 4 */ "aabbbbbbbbbbaaam"
- /* 5 */ "aabbbbbbbbbbaaam"
- /* 6 */ "aabbbbbbbbbbaaam"
- /* 7 */ "aabbbbbbbbbbaaam"
- /* 8 */ "aabbbbbbbbbbaaam"
- /* 9 */ "aabbbbbbbbbbaaam"
- /* 10 */ "aaaaaaaaaaaaaaam"
- /* 11 */ "aaaaaaaaaaaaaaam"
- /* 12 */ "aaaaaaaaaaaaaaam"
- /* 13 */ "aaaaaaaaaaaaaaam"
- /* 14 */ "aaaaaaaaaaaaaaam"
- /* 15 */ "mmmmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "mmmmmmmmmccmmmmm"
- /* 1 */ "ccbbbbbbbbbbcccm"
- /* 2 */ "ccbbbbbbbbbbcccm"
- /* 3 */ "ccbbbbbbbbbbcccm"
- /* 4 */ "ccbbbbbbbbbbcccm"
- /* 5 */ "ccbbbbbbbbbbcccm"
- /* 6 */ "ccbbbbbbbbbbcccm"
- /* 7 */ "ccbbbbbbbbbbcccm"
- /* 8 */ "ccbbbbbbbbbbcccm"
- /* 9 */ "ccbbbbbbbbbbcccm"
- /* 10 */ "cccccccccccccccm"
- /* 11 */ "cccccccccccccccm"
- /* 12 */ "cccccccccccccccm"
- /* 13 */ "cccccccccccccacm"
- /* 14 */ "cccccccccccccccm"
- /* 15 */ "mmmmmmmmmmmmmmmm"
-
- // Level 2
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "ddeffeffe..eddd."
- /* 2 */ "d.fbbgggg..f..d."
- /* 3 */ "d.fbgggggggf.hd."
- /* 4 */ "d.fbgggggggf..d."
- /* 5 */ "d.eggggggggehhd."
- /* 6 */ "d.fgiiggiigf.hd."
- /* 7 */ "d.fgiiggiigf..d."
- /* 8 */ "d.fggggggggf..d."
- /* 9 */ "d.efffeefffe.hd."
- /* 10 */ "d.............d."
- /* 11 */ "djhhk.jhh..hh.d."
- /* 12 */ "d.jlk.hj.h....d."
- /* 13 */ "d..jh.hh..h..nd."
- /* 14 */ "ddddddddddddddd."
- /* 15 */ "................"
-
- // Level 3
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "........o..o...."
- /* 1 */ "..eppeffe..e...."
- /* 2 */ "..pqq......p...."
- /* 3 */ "..pq.......p...."
- /* 4 */ "..pq.......p...."
- /* 5 */ "..e........e...."
- /* 6 */ "..p........p...."
- /* 7 */ "..p........p...."
- /* 8 */ "..p........p...."
- /* 9 */ "..epppeepppe...."
- /* 10 */ "......rr........"
- /* 11 */ "................"
- /* 12 */ "................"
- /* 13 */ ".............n.."
- /* 14 */ "................"
- /* 15 */ "................"
-
- // Level 4
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "..ssssssssss...."
- /* 1 */ ".seffeffeffes..."
- /* 2 */ ".sf..r.....fs..."
- /* 3 */ ".sf........fs..."
- /* 4 */ ".sf........fs..."
- /* 5 */ ".set......ues..."
- /* 6 */ ".sf........fs..."
- /* 7 */ ".sf........fs..."
- /* 8 */ ".sf........fs..."
- /* 9 */ ".sefffeefffes..."
- /* 10 */ "..ssssssssss...."
- /* 11 */ "................"
- /* 12 */ "................"
- /* 13 */ ".............n.."
- /* 14 */ "................"
- /* 15 */ "................"
-
- // Level 5
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ ".vw........wv..."
- /* 1 */ ".wwwwwwwwwwww..."
- /* 2 */ "..wvvvvvvvvw...."
- /* 3 */ "..wvvvvvvvvw...."
- /* 4 */ "..wvvvvvvvvw...."
- /* 5 */ "..wvvvvvvvvw...."
- /* 6 */ "..wvvvvvvvvw...."
- /* 7 */ "..wvvvvvvvvw...."
- /* 8 */ "..wvvvvvvvvw...."
- /* 9 */ ".wwwwwwwwwwww..."
- /* 10 */ ".vw........wv..."
- /* 11 */ "............xxx."
- /* 12 */ "...........xxxxx"
- /* 13 */ "...........xxnxx"
- /* 14 */ "...........xxxxx"
- /* 15 */ "............xxx."
-
- // Level 6
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "................"
- /* 3 */ "....wwwwww......"
- /* 4 */ "....wvvvvw......"
- /* 5 */ "....wvvvvw......"
- /* 6 */ "....wvvvvw......"
- /* 7 */ "....wwwwww......"
- /* 8 */ "................"
- /* 9 */ "................"
- /* 10 */ "................"
- /* 11 */ "............xxx."
- /* 12 */ "...........xxxxx"
- /* 13 */ "...........xxnxx"
- /* 14 */ "...........xxxxx"
- /* 15 */ "............xxx."
-
- // Level 7
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "................"
- /* 3 */ "................"
- /* 4 */ "................"
- /* 5 */ "......ww........"
- /* 6 */ "................"
- /* 7 */ "................"
- /* 8 */ "................"
- /* 9 */ "................"
- /* 10 */ "................"
- /* 11 */ "................"
- /* 12 */ "............xxx."
- /* 13 */ "............xnx."
- /* 14 */ "............xx.."
- /* 15 */ "................"
-
- // Level 8
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "................"
- /* 3 */ "................"
- /* 4 */ "................"
- /* 5 */ "................"
- /* 6 */ "................"
- /* 7 */ "................"
- /* 8 */ "................"
- /* 9 */ "................"
- /* 10 */ "................"
- /* 11 */ "................"
- /* 12 */ ".............x.."
- /* 13 */ "............xxx."
- /* 14 */ ".............x.."
- /* 15 */ "................",
-
- // Connectors:
- "-1: 9, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseWithGarden
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseWithSakura1:
- // The data has been exported from the gallery Plains, area index 75, ID 141, created by Aloe_vera
- {
- // Size:
- 13, 7, 15, // SizeX = 13, SizeY = 7, SizeZ = 15
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 13, 6, 15, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 2: 0\n" /* grass */
- "c: 17: 5\n" /* tree */
- "d: 5: 2\n" /* wood */
- "e: 17: 9\n" /* tree */
- "f:113: 0\n" /* netherbrickfence */
- "g: 17: 1\n" /* tree */
- "h: 35: 0\n" /* wool */
- "i: 31: 2\n" /* tallgrass */
- "j: 54: 2\n" /* chest */
- "k: 38: 6\n" /* rose */
- "l: 38: 2\n" /* rose */
- "m: 19: 0\n" /* sponge */
- "n: 50: 4\n" /* torch */
- "o: 85: 0\n" /* fence */
- "p: 44: 8\n" /* step */
- "q: 35: 6\n" /* wool */
- "r: 43: 0\n" /* doubleslab */
- "s: 44: 0\n" /* step */,
-
- // Block data:
- // Level 0
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 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 */ "aaaaaaaaaaaaa"
-
- // Level 1
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "bbbbbbbbbbbbb"
- /* 1 */ "bbbbbbbbbbbbb"
- /* 2 */ "bbbaccdabbbbb"
- /* 3 */ "bbbedddebbbbb"
- /* 4 */ "bbbedddebbbbb"
- /* 5 */ "bbbedddebbbbb"
- /* 6 */ "bbbacccabbbbb"
- /* 7 */ "bbbbbbbbbbbbb"
- /* 8 */ "bbbbbbbbbbbbb"
- /* 9 */ "bbbbbbbbbbbbb"
- /* 10 */ "bbbbbbbbbbabb"
- /* 11 */ "bbbbbbbbbbbbb"
- /* 12 */ "bbbbbbbbbbbbb"
- /* 13 */ "bbbbbbbbbbbbb"
- /* 14 */ "bbbbbbbbbbbbb"
-
- // Level 2
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "ffff...ffffff"
- /* 1 */ "f...........f"
- /* 2 */ "f..ghh.g..i.f"
- /* 3 */ "f..h...h..i.f"
- /* 4 */ "f..h...h....f"
- /* 5 */ "fi.h..jh..i.f"
- /* 6 */ "f..ghhhg....f"
- /* 7 */ "f.........i.f"
- /* 8 */ "fii.........f"
- /* 9 */ "f.k..k.i....f"
- /* 10 */ "fl.i..i...g.f"
- /* 11 */ "f.i..i.k....f"
- /* 12 */ "f.l.k.......f"
- /* 13 */ "f.....l.....f"
- /* 14 */ "fffffffffffff"
-
- // Level 3
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ ".......n....."
- /* 2 */ "...goo.g....."
- /* 3 */ "...h...h....."
- /* 4 */ "...o...o....."
- /* 5 */ "...h...h....."
- /* 6 */ "...gooog....."
- /* 7 */ "............."
- /* 8 */ "............."
- /* 9 */ "............."
- /* 10 */ "..........g.."
- /* 11 */ "............."
- /* 12 */ "............."
- /* 13 */ "............."
- /* 14 */ "............."
-
- // Level 4
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "...ppppp....."
- /* 2 */ "..pghhhgp...."
- /* 3 */ "..ph...hp...."
- /* 4 */ "..ph...hp...."
- /* 5 */ "..ph...hp...."
- /* 6 */ "..pghhhgp...."
- /* 7 */ "...ppppp....."
- /* 8 */ "............."
- /* 9 */ "..........q.."
- /* 10 */ ".........qgq."
- /* 11 */ "..........q.."
- /* 12 */ "............."
- /* 13 */ "............."
- /* 14 */ "............."
-
- // Level 5
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "..rs...sr...."
- /* 2 */ "..sssssss...."
- /* 3 */ "...srrrs....."
- /* 4 */ "...srrrs....."
- /* 5 */ "...srrrs....."
- /* 6 */ "..sssssss...."
- /* 7 */ "..rs...sr...."
- /* 8 */ "............."
- /* 9 */ ".........qqq."
- /* 10 */ ".........qqq."
- /* 11 */ ".........qqq."
- /* 12 */ "............."
- /* 13 */ "............."
- /* 14 */ "............."
-
- // Level 6
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "............."
- /* 3 */ "............."
- /* 4 */ ".....s......."
- /* 5 */ "............."
- /* 6 */ "............."
- /* 7 */ "............."
- /* 8 */ "............."
- /* 9 */ "............."
- /* 10 */ "..........q.."
- /* 11 */ "............."
- /* 12 */ "............."
- /* 13 */ "............."
- /* 14 */ ".............",
-
- // Connectors:
- "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseWithSakura1
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseWithSpa:
- // The data has been exported from the gallery Plains, area index 73, ID 139, created by Aloe_vera
- {
- // Size:
- 16, 8, 14, // SizeX = 16, SizeY = 8, SizeZ = 14
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 15, 7, 13, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 2\n" /* wood */
- "b: 3: 0\n" /* dirt */
- "c: 2: 0\n" /* grass */
- "d: 8: 0\n" /* water */
- "e:135: 3\n" /* 135 */
- "f:135: 1\n" /* 135 */
- "g:113: 0\n" /* netherbrickfence */
- "h: 17: 1\n" /* tree */
- "i: 35: 0\n" /* wool */
- "j:171:12\n" /* carpet */
- "k: 64: 6\n" /* wooddoorblock */
- "l:126: 2\n" /* woodenslab */
- "m: 19: 0\n" /* sponge */
- "n:135: 2\n" /* 135 */
- "o: 64: 7\n" /* wooddoorblock */
- "p: 50: 4\n" /* torch */
- "q: 85: 0\n" /* fence */
- "r: 64:12\n" /* wooddoorblock */
- "s: 50: 3\n" /* torch */
- "t: 44: 8\n" /* step */
- "u: 43: 0\n" /* doubleslab */
- "v: 44: 0\n" /* step */,
-
- // Block data:
- // Level 0
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ ".aaaaaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaaaaa."
- /* 6 */ ".aaaaaaaaaaaaaa."
- /* 7 */ ".aaaaaabbbbbbbbb"
- /* 8 */ ".aaaaaabbbbbbbbb"
- /* 9 */ ".aaaaaabbbbbbbbb"
- /* 10 */ ".aaaaaabbbbbbbbb"
- /* 11 */ ".aaaaaabbbbbbbbb"
- /* 12 */ ".aaaaaabbbbbbbbb"
- /* 13 */ ".......bbbbbbbbb"
-
- // Level 1
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "mmmmmmmmmmmmmmmm"
- /* 1 */ "maaaaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaaaaaam"
- /* 7 */ "maaaaaaaaaaccccc"
- /* 8 */ "maaaaaaacccccccc"
- /* 9 */ "maaaaaaacccccccc"
- /* 10 */ "maaaaaaacccccccc"
- /* 11 */ "maaaaaaccccccccc"
- /* 12 */ "maaaaaaccccccccc"
- /* 13 */ "mmmmmmmccccccccc"
-
- // Level 2
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ ".aaaaaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaaaaa."
- /* 6 */ ".aaddaaaaaaaaaa."
- /* 7 */ ".aaddaaeeef....."
- /* 8 */ ".aaddaaf........"
- /* 9 */ ".aaddaaf........"
- /* 10 */ ".aaddaae........"
- /* 11 */ ".aaddaa........."
- /* 12 */ ".aaaaaa........."
- /* 13 */ "................"
-
- // Level 3
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ ".ggggghiiihiiih."
- /* 2 */ ".geee.ijjjjjjji."
- /* 3 */ ".gf...kjjjijlji."
- /* 4 */ ".gf...innjijjji."
- /* 5 */ ".g....hiiohiiih."
- /* 6 */ ".g....g........."
- /* 7 */ ".g.............."
- /* 8 */ ".g.............."
- /* 9 */ ".g.............."
- /* 10 */ ".g....g........."
- /* 11 */ ".g....g........."
- /* 12 */ ".gggggg........."
- /* 13 */ "................"
-
- // Level 4
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "......p...p...p."
- /* 1 */ ".g....hqqqhqqqh."
- /* 2 */ "......i.......i."
- /* 3 */ "......r...q...q."
- /* 4 */ "......i...q...i."
- /* 5 */ "......hqqrhqqqh."
- /* 6 */ "......g...s....."
- /* 7 */ "................"
- /* 8 */ "................"
- /* 9 */ "................"
- /* 10 */ "................"
- /* 11 */ "................"
- /* 12 */ ".g....g........."
- /* 13 */ "................"
-
- // Level 5
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ ".tttttttttttttt."
- /* 1 */ "tggggghqqqhqqqht"
- /* 2 */ "tg....i.......it"
- /* 3 */ "tg....i...i...it"
- /* 4 */ "tg....i...i...it"
- /* 5 */ "tg....hiiihiiiht"
- /* 6 */ "tg....gtttttttt."
- /* 7 */ "tg....gt........"
- /* 8 */ "tg....gt........"
- /* 9 */ "tg....gt........"
- /* 10 */ "tg....gt........"
- /* 11 */ "tg....gt........"
- /* 12 */ "tggggggt........"
- /* 13 */ ".tttttt........."
-
- // Level 6
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "uv............vu"
- /* 1 */ "vvvvvvvvvvvvvvvv"
- /* 2 */ ".vuuuuuuuuuuuuv."
- /* 3 */ ".vuuuuuutuuuuuv."
- /* 4 */ ".vuuuuuuuuuuuuv."
- /* 5 */ ".vuuuuvvvvvvvvvv"
- /* 6 */ ".vuuuuv.......vu"
- /* 7 */ ".vuuuuv........."
- /* 8 */ ".vuuuuv........."
- /* 9 */ ".vuuuuv........."
- /* 10 */ ".vuuuuv........."
- /* 11 */ ".vuuuuv........."
- /* 12 */ "vvvvvvvv........"
- /* 13 */ "uv....vu........"
-
- // Level 7
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "................"
- /* 3 */ "...vvvvvvvvvv..."
- /* 4 */ "...vv..........."
- /* 5 */ "...vv..........."
- /* 6 */ "...vv..........."
- /* 7 */ "...vv..........."
- /* 8 */ "...vv..........."
- /* 9 */ "...vv..........."
- /* 10 */ "...vv..........."
- /* 11 */ "................"
- /* 12 */ "................"
- /* 13 */ "................",
-
- // Connectors:
- "",
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseWithSpa
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MediumSakuraTree:
- // The data has been exported from the gallery Plains, area index 146, ID 490, created by STR_Warrior
- {
- // Size:
- 7, 10, 7, // SizeX = 7, SizeY = 10, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 6, 9, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 2: 0\n" /* grass */
- "c: 31: 1\n" /* tallgrass */
- "d: 38: 7\n" /* rose */
- "e: 17: 1\n" /* tree */
- "f: 38: 0\n" /* rose */
- "g: 38: 8\n" /* rose */
- "h: 38: 5\n" /* rose */
- "i: 35: 6\n" /* wool */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "aaaaaaa"
- /* 2 */ "aaaaaaa"
- /* 3 */ "aaaaaaa"
- /* 4 */ "aaaaaaa"
- /* 5 */ "aaaaaaa"
- /* 6 */ "aaaaaaa"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "bbbbbbb"
- /* 1 */ "bbbbbbb"
- /* 2 */ "bbbbbbb"
- /* 3 */ "bbbabbb"
- /* 4 */ "bbbbbbb"
- /* 5 */ "bbbbbbb"
- /* 6 */ "bbbbbbb"
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "m.c...m"
- /* 2 */ ".dccdc."
- /* 3 */ "..cefc."
- /* 4 */ ".ccfgh."
- /* 5 */ "m.ccc.m"
- /* 6 */ "mm...mm"
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "m.....m"
- /* 1 */ "......."
- /* 2 */ "......."
- /* 3 */ "...e..."
- /* 4 */ "......."
- /* 5 */ "......."
- /* 6 */ "m.....m"
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "..i...."
- /* 2 */ "......."
- /* 3 */ "...e.i."
- /* 4 */ ".i....."
- /* 5 */ "......."
- /* 6 */ "......."
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "..i...."
- /* 2 */ "...i..."
- /* 3 */ "..ieii."
- /* 4 */ ".i.ii.."
- /* 5 */ "...i..."
- /* 6 */ "......."
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "..ii..."
- /* 2 */ "..iii.."
- /* 3 */ ".iieii."
- /* 4 */ ".iiii.."
- /* 5 */ "..iii.."
- /* 6 */ "......."
-
- // Level 7
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "..iii.."
- /* 2 */ ".iiiii."
- /* 3 */ ".iieii."
- /* 4 */ ".iiiii."
- /* 5 */ "..iii.."
- /* 6 */ "......."
-
- // Level 8
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "...i..."
- /* 2 */ "..iiii."
- /* 3 */ ".iiiii."
- /* 4 */ "..iii.."
- /* 5 */ "...i..."
- /* 6 */ "......."
-
- // Level 9
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "......."
- /* 2 */ "...i..."
- /* 3 */ "..iii.."
- /* 4 */ "...i..."
- /* 5 */ "......."
- /* 6 */ ".......",
-
- // Connectors:
- "-1: 3, 2, 0: 2\n" /* Type -1, direction Z- */
- "3: 6, 2, 3: 5\n" /* Type 3, direction X+ */
- "-3: 0, 2, 3: 4\n" /* Type -3, direction X- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // MediumSakuraTree
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Restaurant:
- // The data has been exported from the gallery Plains, area index 61, ID 117, created by Aloe_vera
- {
- // Size:
- 15, 10, 15, // SizeX = 15, SizeY = 10, SizeZ = 15
-
- // Hitbox (relative to bounding box):
- -1, 0, -1, // MinX, MinY, MinZ
- 14, 9, 15, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 2\n" /* wood */
- "b:135: 0\n" /* 135 */
- "c:135: 2\n" /* 135 */
- "d:135: 1\n" /* 135 */
- "e: 17: 9\n" /* tree */
- "f:135: 3\n" /* 135 */
- "g: 85: 0\n" /* fence */
- "h: 17: 1\n" /* tree */
- "i:171: 0\n" /* carpet */
- "j:171:12\n" /* carpet */
- "k:126: 1\n" /* woodenslab */
- "l: 50: 5\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n: 35: 0\n" /* wool */
- "o: 50: 3\n" /* torch */
- "p: 50: 1\n" /* torch */
- "q: 50: 4\n" /* torch */
- "r: 35:14\n" /* wool */
- "s: 44: 8\n" /* step */
- "t: 43: 0\n" /* doubleslab */
- "u: 44: 0\n" /* step */
- "v: 17: 5\n" /* tree */,
-
- // Block data:
- // Level 0
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmmaaaaaaammmm"
- /* 1 */ "maaaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaaam"
- /* 4 */ "aaaaaaaaaaaaaaa"
- /* 5 */ "aaaaaaaaaaaaaaa"
- /* 6 */ "aaaaaaaaaaaaaaa"
- /* 7 */ "aaaaaaaaaaaaaaa"
- /* 8 */ "aaaaaaaaaaaaaaa"
- /* 9 */ "aaaaaaaaaaaaaaa"
- /* 10 */ "aaaaaaaaaaaaaaa"
- /* 11 */ "maaaaaaaaaaaaam"
- /* 12 */ "maaaaaaaaaaaaam"
- /* 13 */ "maaaaaaaaaaaaam"
- /* 14 */ "mmmmaaaaaaammmm"
-
- // Level 1
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "....bcccccd...."
- /* 1 */ ".aaaaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaaaa."
- /* 4 */ "caaaaaaaaaaaaac"
- /* 5 */ "baaaaaaaaaaaaad"
- /* 6 */ "baaaaaaaaaaaaad"
- /* 7 */ "baaaaaaaaaaeaad"
- /* 8 */ "baaaaaaaaaaaaad"
- /* 9 */ "baaaaaaaaaaaaad"
- /* 10 */ "faaaaaaaaaaaaaf"
- /* 11 */ ".aaaaaaaaaaaaa."
- /* 12 */ ".aaaaaaaaaaaaa."
- /* 13 */ ".aaaaaaaaaaaaa."
- /* 14 */ "....bfffffd...."
-
- // Level 2
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".gggg.....gggg."
- /* 2 */ ".g...........g."
- /* 3 */ ".g.hhhhhhhhh.g."
- /* 4 */ ".g.hiiijiiih.g."
- /* 5 */ "...hikijikih..."
- /* 6 */ "...hiiijiiihg.."
- /* 7 */ "...hjjjjjjj...."
- /* 8 */ "...hiiijiiihg.."
- /* 9 */ "...hikijikih..."
- /* 10 */ ".g.hiiijiiih.g."
- /* 11 */ ".g.hhhhhhhhh.g."
- /* 12 */ ".g...........g."
- /* 13 */ ".gggg.....gggg."
- /* 14 */ "..............."
-
- // Level 3
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".l..g.....g..l."
- /* 2 */ "..............."
- /* 3 */ "...hnnnhnnnh..."
- /* 4 */ ".g.n.......n.g."
- /* 5 */ "...n.......n..."
- /* 6 */ "...n.......hl.."
- /* 7 */ "...h..........."
- /* 8 */ "...n.......hl.."
- /* 9 */ "...n.......n..."
- /* 10 */ ".g.n.......n.g."
- /* 11 */ "...hnnnhnnnh..."
- /* 12 */ "..............."
- /* 13 */ ".l..g.....g..l."
- /* 14 */ "..............."
-
- // Level 4
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "....g.....g...."
- /* 2 */ "..............."
- /* 3 */ "...hn.nhn.nh..."
- /* 4 */ ".g.n...o...n.g."
- /* 5 */ "...n.......n..."
- /* 6 */ "...n.......h..."
- /* 7 */ "...hp......e..."
- /* 8 */ "...n.......h..."
- /* 9 */ "...n.......n..."
- /* 10 */ ".g.n...q...n.g."
- /* 11 */ "...hn.nhn.nh..."
- /* 12 */ "..............."
- /* 13 */ "....g.....g...."
- /* 14 */ "..............."
-
- // Level 5
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "....g.....g...."
- /* 2 */ "....ggggggg...."
- /* 3 */ "...hnnnhnnnh..."
- /* 4 */ ".ggn.......ngg."
- /* 5 */ "..gn.......ng.."
- /* 6 */ "..gn.......hg.."
- /* 7 */ "..gh..r.r..ng.."
- /* 8 */ "..gn.......hg.."
- /* 9 */ "..gn.......ng.."
- /* 10 */ ".ggn.......ngg."
- /* 11 */ "...hnnnhnnnh..."
- /* 12 */ "....ggggggg...."
- /* 13 */ "....g.....g...."
- /* 14 */ "..............."
-
- // Level 6
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "...stuuuuuts..."
- /* 2 */ "..sttttttttts.."
- /* 3 */ ".sthvvvhvvvhts."
- /* 4 */ ".tte.......ett."
- /* 5 */ ".ute.......etu."
- /* 6 */ ".ute.......htu."
- /* 7 */ ".uth..g.g..etu."
- /* 8 */ ".ute.......htu."
- /* 9 */ ".ute.......etu."
- /* 10 */ ".tte.......ett."
- /* 11 */ ".sthvvvhvvvhts."
- /* 12 */ "..sttttttttts.."
- /* 13 */ "...stuuuuuts..."
- /* 14 */ "..............."
-
- // Level 7
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".stu.......uts."
- /* 2 */ ".tu.........ut."
- /* 3 */ ".u.uuuuuuuuu.u."
- /* 4 */ "...utttttttu..."
- /* 5 */ "...utttttttu..."
- /* 6 */ "...utttttttu..."
- /* 7 */ "...utttttttu..."
- /* 8 */ "...utttttttu..."
- /* 9 */ "...utttttttu..."
- /* 10 */ "...utttttttu..."
- /* 11 */ ".u.uuuuuuuuu.u."
- /* 12 */ ".tu.........ut."
- /* 13 */ ".stu.......uts."
- /* 14 */ "..............."
-
- // Level 8
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".u...........u."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "..............."
- /* 5 */ ".....uuuuu....."
- /* 6 */ ".....utttu....."
- /* 7 */ ".....utttu....."
- /* 8 */ ".....utttu....."
- /* 9 */ ".....uuuuu....."
- /* 10 */ "..............."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ ".u...........u."
- /* 14 */ "..............."
-
- // Level 9
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ ".......u......."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "...............",
-
- // Connectors:
- "-1: 14, 1, 7: 5\n" /* Type -1, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Restaurant
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // SakuraDouble:
- // The data has been exported from the gallery Plains, area index 76, ID 142, created by Aloe_vera
- {
- // Size:
- 12, 8, 6, // SizeX = 12, SizeY = 8, SizeZ = 6
-
- // Hitbox (relative to bounding box):
- -1, 0, -1, // MinX, MinY, MinZ
- 12, 7, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 2: 0\n" /* grass */
- "c: 17: 1\n" /* tree */
- "d: 35: 6\n" /* wool */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "aaaaaaaaaaaa"
- /* 1 */ "aaaaaaaaaaaa"
- /* 2 */ "aaaaaaaaaaaa"
- /* 3 */ "aaaaaaaaaaaa"
- /* 4 */ "aaaaaaaaaaaa"
- /* 5 */ "aaaaaaaaaaaa"
-
- // Level 1
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "bbbbbbbbbbbb"
- /* 1 */ "bbbbbbbbbbbb"
- /* 2 */ "bbabbbbbbbbb"
- /* 3 */ "bbbbbbbbbabb"
- /* 4 */ "bbbbbbbbbbbb"
- /* 5 */ "bbbbbbbbbbbb"
-
- // Level 2
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "..c........."
- /* 3 */ ".........c.."
- /* 4 */ "............"
- /* 5 */ "............"
-
- // Level 3
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "..c........."
- /* 3 */ ".........c.."
- /* 4 */ "............"
- /* 5 */ "............"
-
- // Level 4
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "..d........."
- /* 1 */ "ddddd......."
- /* 2 */ "ddcdd...ddd."
- /* 3 */ "ddddd...dcd."
- /* 4 */ "..d.....ddd."
- /* 5 */ "............"
-
- // Level 5
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ ".ddd........"
- /* 1 */ ".ddd....ddd."
- /* 2 */ "ddddd..ddddd"
- /* 3 */ ".ddd...ddcdd"
- /* 4 */ ".ddd...ddddd"
- /* 5 */ "........ddd."
-
- // Level 6
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "..d......d.."
- /* 2 */ ".ddd....ddd."
- /* 3 */ "..d....ddddd"
- /* 4 */ "........ddd."
- /* 5 */ ".........d.."
-
- // Level 7
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "............"
- /* 3 */ ".........d.."
- /* 4 */ "............"
- /* 5 */ "............",
-
- // Connectors:
- "-1: -1, 2, 2: 4\n" /* Type -1, direction X- */
- "3: 5, 2, 6: 3\n" /* Type 3, direction Z+ */
- "-3: 6, 2, -1: 2\n" /* Type -3, direction Z- */
- "-3: 12, 2, 2: 5\n" /* Type -3, direction X+ */
- "3: 12, 2, 2: 5\n" /* Type 3, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // SakuraDouble
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // SakuraSmall:
- // The data has been exported from the gallery Plains, area index 145, ID 489, created by Aloe_vera
- {
- // Size:
- 5, 7, 5, // SizeX = 5, SizeY = 7, SizeZ = 5
-
- // Hitbox (relative to bounding box):
- -1, 0, -1, // MinX, MinY, MinZ
- 5, 6, 5, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 2: 0\n" /* grass */
- "c: 17: 1\n" /* tree */
- "d: 35: 6\n" /* wool */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 01234 */
- /* 0 */ "aaaaa"
- /* 1 */ "aaaaa"
- /* 2 */ "aaaaa"
- /* 3 */ "aaaaa"
- /* 4 */ "aaaaa"
-
- // Level 1
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bbbbb"
- /* 2 */ "bbabb"
- /* 3 */ "bbbbb"
- /* 4 */ "bbbbb"
-
- // Level 2
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "....."
- /* 2 */ "..c.."
- /* 3 */ "....."
- /* 4 */ "....."
-
- // Level 3
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "....."
- /* 2 */ "..c.."
- /* 3 */ "....."
- /* 4 */ "....."
-
- // Level 4
- /* z\x* 01234 */
- /* 0 */ "..d.."
- /* 1 */ "ddddd"
- /* 2 */ "ddcdd"
- /* 3 */ "ddddd"
- /* 4 */ "..d.."
-
- // Level 5
- /* z\x* 01234 */
- /* 0 */ ".ddd."
- /* 1 */ ".ddd."
- /* 2 */ "ddddd"
- /* 3 */ ".ddd."
- /* 4 */ ".ddd."
-
- // Level 6
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "..d.."
- /* 2 */ ".ddd."
- /* 3 */ "..d.."
- /* 4 */ ".....",
-
- // Connectors:
- "-1: 2, 2, -1: 2\n" /* Type -1, direction Z- */
- "3: 5, 2, 2: 5\n" /* Type 3, direction X+ */
- "-3: -1, 2, 2: 4\n" /* Type -3, direction X- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // SakuraSmall
-}; // g_JapaneseVillagePrefabs
-
-
-
-
-
-
-const cPrefab::sDef g_JapaneseVillageStartingPrefabs[] =
-{
- ////////////////////////////////////////////////////////////////////////////////
- // HighTemple:
- // The data has been exported from the gallery Plains, area index 70, ID 133, created by Aloe_vera
- {
- // Size:
- 11, 19, 11, // SizeX = 11, SizeY = 19, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 10, 18, 10, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 2\n" /* wood */
- "b:135: 0\n" /* 135 */
- "c:135: 2\n" /* 135 */
- "d:135: 1\n" /* 135 */
- "e: 17: 9\n" /* tree */
- "f:135: 3\n" /* 135 */
- "g: 85: 0\n" /* fence */
- "h: 17: 1\n" /* tree */
- "i:171: 0\n" /* carpet */
- "j: 50: 5\n" /* torch */
- "k: 35: 0\n" /* wool */
- "l: 17: 5\n" /* tree */
- "m: 19: 0\n" /* sponge */
- "n:124: 0\n" /* redstonelampon */
- "o: 69: 9\n" /* lever */
- "p: 44: 8\n" /* step */
- "q: 43: 0\n" /* doubleslab */
- "r: 44: 0\n" /* step */
- "s: 50: 4\n" /* torch */
- "t: 50: 1\n" /* torch */
- "u: 50: 3\n" /* torch */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmaaaaammm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "aaaaaaaaaaa"
- /* 4 */ "aaaaaaaaaaa"
- /* 5 */ "aaaaaaaaaaa"
- /* 6 */ "aaaaaaaaaaa"
- /* 7 */ "aaaaaaaaaaa"
- /* 8 */ "maaaaaaaaam"
- /* 9 */ "maaaaaaaaam"
- /* 10 */ "mmmaaaaammm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "...bcccd..."
- /* 1 */ ".aaaaaaaaa."
- /* 2 */ ".aaaaaaaaa."
- /* 3 */ "caaaaaaaaac"
- /* 4 */ "baaaaaaaaad"
- /* 5 */ "baaeaaaaaad"
- /* 6 */ "baaaaaaaaad"
- /* 7 */ "faaaaaaaaaf"
- /* 8 */ ".aaaaaaaaa."
- /* 9 */ ".aaaaaaaaa."
- /* 10 */ "...bfffd..."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".ggg...ggg."
- /* 2 */ ".g.......g."
- /* 3 */ ".g.hhhhh.g."
- /* 4 */ "...hiiih..."
- /* 5 */ "....iiih..."
- /* 6 */ "...hiiih..."
- /* 7 */ ".g.hhhhh.g."
- /* 8 */ ".g.......g."
- /* 9 */ ".ggg...ggg."
- /* 10 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".j.g...g.j."
- /* 2 */ "..........."
- /* 3 */ ".g.kkhkk.g."
- /* 4 */ "...h...k..."
- /* 5 */ ".......h..."
- /* 6 */ "...h...k..."
- /* 7 */ ".g.kkhkk.g."
- /* 8 */ "..........."
- /* 9 */ ".j.g...g.j."
- /* 10 */ "..........."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "...g...g..."
- /* 2 */ "..........."
- /* 3 */ ".g.kkhkk.g."
- /* 4 */ "...h...k..."
- /* 5 */ "...k...h..."
- /* 6 */ "...h...k..."
- /* 7 */ ".g.kkhkk.g."
- /* 8 */ "..........."
- /* 9 */ "...g...g..."
- /* 10 */ "..........."
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "...g...g..."
- /* 2 */ "...ggggg..."
- /* 3 */ ".gghlhlhgg."
- /* 4 */ "..ge...eg.."
- /* 5 */ "..ge.nohg.."
- /* 6 */ "..ge...eg.."
- /* 7 */ ".gghlhlhgg."
- /* 8 */ "...ggggg..."
- /* 9 */ "...g...g..."
- /* 10 */ "..........."
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..pqrrrqp.."
- /* 2 */ ".pqqqqqqqp."
- /* 3 */ ".qqhkkkhqq."
- /* 4 */ ".rqkhhhkqr."
- /* 5 */ ".rqkhhhkqr."
- /* 6 */ ".rqkhhhkqr."
- /* 7 */ ".qqhkkkhqq."
- /* 8 */ ".pqqqqqqqp."
- /* 9 */ "..pqrrrqp.."
- /* 10 */ "..........."
-
- // Level 7
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".qr.....rq."
- /* 2 */ ".........r."
- /* 3 */ "...hhhhh..."
- /* 4 */ "...hiiih..."
- /* 5 */ "....iiih..."
- /* 6 */ "...hiiih..."
- /* 7 */ "...hhhhh..."
- /* 8 */ ".r.......r."
- /* 9 */ ".qr.....rq."
- /* 10 */ "..........."
-
- // Level 8
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "...kkhkk..."
- /* 4 */ "...h...k..."
- /* 5 */ ".......h..."
- /* 6 */ "...h...k..."
- /* 7 */ "...kkhkk..."
- /* 8 */ "..........."
- /* 9 */ "..........."
- /* 10 */ "..........."
-
- // Level 9
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ ".....s....."
- /* 3 */ "...kkhkk..."
- /* 4 */ "...h...k..."
- /* 5 */ "...k...ht.."
- /* 6 */ "...h...k..."
- /* 7 */ "...kkhkk..."
- /* 8 */ ".....u....."
- /* 9 */ "..........."
- /* 10 */ "..........."
-
- // Level 10
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "...ggggg..."
- /* 3 */ "..ghlhlhg.."
- /* 4 */ "..ge...eg.."
- /* 5 */ "..ge.nohg.."
- /* 6 */ "..ge...eg.."
- /* 7 */ "..ghlhlhg.."
- /* 8 */ "...ggggg..."
- /* 9 */ "..........."
- /* 10 */ "..........."
-
- // Level 11
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..prrrrrp.."
- /* 2 */ ".pqqqqqqqp."
- /* 3 */ ".qqhkkkhqq."
- /* 4 */ ".rqkhhhkqr."
- /* 5 */ ".rqkhhhkqr."
- /* 6 */ ".rqkhhhkqr."
- /* 7 */ ".qqhkkkhqr."
- /* 8 */ ".pqqqqqqqp."
- /* 9 */ "..pqrrrqp.."
- /* 10 */ "..........."
-
- // Level 12
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".qr.....rq."
- /* 2 */ ".r.......r."
- /* 3 */ "...hhhhh..."
- /* 4 */ "...hiiih..."
- /* 5 */ "....iiih..."
- /* 6 */ "...hiiih..."
- /* 7 */ "...hhhhh..."
- /* 8 */ ".r.......r."
- /* 9 */ ".qr.....rq."
- /* 10 */ "..........."
-
- // Level 13
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "...kkhkk..."
- /* 4 */ "...h...k..."
- /* 5 */ ".......h..."
- /* 6 */ "...h...k..."
- /* 7 */ "...kkhkk..."
- /* 8 */ "..........."
- /* 9 */ "..........."
- /* 10 */ "..........."
-
- // Level 14
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ ".....s....."
- /* 3 */ "...kkhkk..."
- /* 4 */ "...h...k..."
- /* 5 */ "...k...ht.."
- /* 6 */ "...h...k..."
- /* 7 */ "...kkhkk..."
- /* 8 */ ".....u....."
- /* 9 */ "..........."
- /* 10 */ "..........."
-
- // Level 15
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "...ggggg..."
- /* 3 */ "..ghlhlhg.."
- /* 4 */ "..ge...eg.."
- /* 5 */ "..ge.nohg.."
- /* 6 */ "..ge...eg.."
- /* 7 */ "..ghlhlhg.."
- /* 8 */ "...ggggg..."
- /* 9 */ "..........."
- /* 10 */ "..........."
-
- // Level 16
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..pqrrrqp.."
- /* 2 */ ".pqqqqqqqp."
- /* 3 */ ".qqrrrrrqq."
- /* 4 */ ".rqrrrrrqr."
- /* 5 */ ".rqrrrrrqr."
- /* 6 */ ".rqrrrrrqr."
- /* 7 */ ".qqrrrrrqq."
- /* 8 */ ".pqqqqqqqp."
- /* 9 */ "..pqrrrqp.."
- /* 10 */ "..........."
-
- // Level 17
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".qr.....rq."
- /* 2 */ ".rr.....rr."
- /* 3 */ "...rrrrr..."
- /* 4 */ "...rqqqr..."
- /* 5 */ "...rqqqr..."
- /* 6 */ "...rqqqr..."
- /* 7 */ "...rrrrr..."
- /* 8 */ ".rr.....rr."
- /* 9 */ ".qr.....rq."
- /* 10 */ "..........."
-
- // Level 18
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "..........."
- /* 4 */ "..........."
- /* 5 */ ".....r....."
- /* 6 */ "..........."
- /* 7 */ "..........."
- /* 8 */ "..........."
- /* 9 */ "..........."
- /* 10 */ "...........",
-
- // Connectors:
- "2: 0, 1, 5: 4\n" /* Type 2, direction X- */
- "2: 5, 1, 0: 2\n" /* Type 2, direction Z- */
- "2: 10, 1, 5: 5\n" /* Type 2, direction X+ */
- "2: 5, 1, 10: 3\n" /* Type 2, direction Z+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HighTemple
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Well:
- // The data has been exported from the gallery Plains, area index 143, ID 487, created by STR_Warrior
- {
- // Size:
- 7, 14, 7, // SizeX = 7, SizeY = 14, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 6, 13, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 1: 0\n" /* stone */
- "b: 4: 0\n" /* cobblestone */
- "c: 8: 0\n" /* water */
- "d: 13: 0\n" /* gravel */
- "e: 67: 1\n" /* stairs */
- "f: 67: 2\n" /* stairs */
- "g: 67: 0\n" /* stairs */
- "h: 67: 3\n" /* stairs */
- "i: 85: 0\n" /* fence */
- "j: 44: 8\n" /* step */
- "k: 44: 0\n" /* step */
- "l: 43: 0\n" /* doubleslab */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "maaaaam"
- /* 6 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbbbbbm"
- /* 2 */ "mbcc.bm"
- /* 3 */ "mbcccbm"
- /* 4 */ "mbcccbm"
- /* 5 */ "mbbbbbm"
- /* 6 */ "mmmmmmm"
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbbbbbm"
- /* 2 */ "mbcccbm"
- /* 3 */ "mbcccbm"
- /* 4 */ "mbcccbm"
- /* 5 */ "mbbbbbm"
- /* 6 */ "mmmmmmm"
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbbbbbm"
- /* 2 */ "mbcccbm"
- /* 3 */ "mbcccbm"
- /* 4 */ "mbcccbm"
- /* 5 */ "mbbbbbm"
- /* 6 */ "mmmmmmm"
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbbbbbm"
- /* 2 */ "mbcccbm"
- /* 3 */ "mbcccbm"
- /* 4 */ "mbcccbm"
- /* 5 */ "mbbbbbm"
- /* 6 */ "mmmmmmm"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbbbbbm"
- /* 2 */ "mbcccbm"
- /* 3 */ "mbcccbm"
- /* 4 */ "mbcccbm"
- /* 5 */ "mbbbbbm"
- /* 6 */ "mmmmmmm"
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mbbbbbm"
- /* 2 */ "mbcccbm"
- /* 3 */ "mbcccbm"
- /* 4 */ "mbcccbm"
- /* 5 */ "mbbbbbm"
- /* 6 */ "mmmmmmm"
-
- // Level 7
- /* z\x* 0123456 */
- /* 0 */ "mmbbbmm"
- /* 1 */ "mbbbbbm"
- /* 2 */ "bbcccbb"
- /* 3 */ "bbcccbb"
- /* 4 */ "bbcccbb"
- /* 5 */ "mbbbbbm"
- /* 6 */ "mmbbbmm"
-
- // Level 8
- /* z\x* 0123456 */
- /* 0 */ "mmdddmm"
- /* 1 */ "mbbbbbm"
- /* 2 */ "dbcccbd"
- /* 3 */ "dbcccbd"
- /* 4 */ "dbcccbd"
- /* 5 */ "mbbbbbm"
- /* 6 */ "mmdddmm"
-
- // Level 9
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "mbefgbm"
- /* 2 */ ".h...h."
- /* 3 */ ".g...e."
- /* 4 */ ".f...f."
- /* 5 */ "mbehgbm"
- /* 6 */ "mm...mm"
-
- // Level 10
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "mi...im"
- /* 2 */ "......."
- /* 3 */ "......."
- /* 4 */ "......."
- /* 5 */ "mi...im"
- /* 6 */ "mm...mm"
-
- // Level 11
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "mi...im"
- /* 2 */ "......."
- /* 3 */ "......."
- /* 4 */ "......."
- /* 5 */ "mi...im"
- /* 6 */ "mm...mm"
-
- // Level 12
- /* z\x* 0123456 */
- /* 0 */ "mjkkkjm"
- /* 1 */ "jlllllj"
- /* 2 */ "klllllk"
- /* 3 */ "klllllk"
- /* 4 */ "klllllk"
- /* 5 */ "jlllllj"
- /* 6 */ "mjkkkjm"
-
- // Level 13
- /* z\x* 0123456 */
- /* 0 */ "k.....k"
- /* 1 */ "......."
- /* 2 */ "..kkk.."
- /* 3 */ "..klk.."
- /* 4 */ "..kkk.."
- /* 5 */ "......."
- /* 6 */ "k.....k",
-
- // Connectors:
- "2: 0, 9, 3: 4\n" /* Type 2, direction X- */
- "2: 3, 9, 0: 2\n" /* Type 2, direction Z- */
- "2: 6, 9, 3: 5\n" /* Type 2, direction X+ */
- "2: 3, 9, 6: 3\n" /* Type 2, direction Z+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Well
-};
-
-
-
-
-
-// The prefab counts:
-
-const size_t g_JapaneseVillagePrefabsCount = ARRAYCOUNT(g_JapaneseVillagePrefabs);
-
-const size_t g_JapaneseVillageStartingPrefabsCount = ARRAYCOUNT(g_JapaneseVillageStartingPrefabs);
-
diff --git a/src/Generating/Prefabs/JapaneseVillagePrefabs.h b/src/Generating/Prefabs/JapaneseVillagePrefabs.h
deleted file mode 100644
index 501b6c1cd..000000000
--- a/src/Generating/Prefabs/JapaneseVillagePrefabs.h
+++ /dev/null
@@ -1,15 +0,0 @@
-
-// JapaneseVillagePrefabs.h
-
-// Declares the prefabs in the group JapaneseVillage
-
-#include "../Prefab.h"
-
-
-
-
-
-extern const cPrefab::sDef g_JapaneseVillagePrefabs[];
-extern const cPrefab::sDef g_JapaneseVillageStartingPrefabs[];
-extern const size_t g_JapaneseVillagePrefabsCount;
-extern const size_t g_JapaneseVillageStartingPrefabsCount;
diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp b/src/Generating/Prefabs/PlainsVillagePrefabs.cpp
deleted file mode 100644
index 4613f76e2..000000000
--- a/src/Generating/Prefabs/PlainsVillagePrefabs.cpp
+++ /dev/null
@@ -1,6118 +0,0 @@
-
-// PlainsVillagePrefabs.cpp
-
-// 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!
-
-#include "Globals.h"
-#include "PlainsVillagePrefabs.h"
-
-
-
-
-
-const cPrefab::sDef g_PlainsVillagePrefabs[] =
-{
- ////////////////////////////////////////////////////////////////////////////////
- // BigPlantBed:
- // The data has been exported from the gallery Plains, area index 26, ID 70, created by Taugrammaton
- {
- // Size:
- 13, 8, 12, // SizeX = 13, SizeY = 8, SizeZ = 12
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 12, 7, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 5: 0\n" /* wood */
- "c: 13: 0\n" /* gravel */
- "d: 17: 0\n" /* tree */
- "e: 60: 7\n" /* tilleddirt */
- "f: 8: 0\n" /* water */
- "g: 85: 0\n" /* fence */
- "h: 59: 7\n" /* crops */
- "i: 50: 5\n" /* torch */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "aaaaaaaaaaaaa"
- /* 1 */ "aaaaaaaaaaaaa"
- /* 2 */ "aaaaaaaaaaaaa"
- /* 3 */ "aaaaaaaaaaaaa"
- /* 4 */ "aaaaaaaaaaaaa"
- /* 5 */ "aaaaaaaaaaaaa"
- /* 6 */ "aaaaaaaaaaaaa"
- /* 7 */ "aaaaaaaaaaaaa"
- /* 8 */ "aaaaaaaaaaaaa"
- /* 9 */ "aaaaaaaaaaaaa"
- /* 10 */ "aaaaaaaaaaaaa"
- /* 11 */ "aaaaaaaaaaaaa"
-
- // Level 1
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "bbbbbbbbbbbbb"
- /* 1 */ "bcccccccccccb"
- /* 2 */ "bcccccccccccb"
- /* 3 */ "bcccccccccccb"
- /* 4 */ "bcccccccccccb"
- /* 5 */ "bcccccccccccb"
- /* 6 */ "bcccccccccccb"
- /* 7 */ "bcccccccccccb"
- /* 8 */ "bcccccccccccb"
- /* 9 */ "bcccccccccccb"
- /* 10 */ "bcccccccccccb"
- /* 11 */ "bbbbbbbbbbbbb"
-
- // Level 2
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "ddddddddddddd"
- /* 1 */ "deefeefeefeed"
- /* 2 */ "deefeefeefeed"
- /* 3 */ "deefeefeefeed"
- /* 4 */ "deefeefeefeed"
- /* 5 */ "deefeefeefeed"
- /* 6 */ "deefeefeefeed"
- /* 7 */ "deefeefeefeed"
- /* 8 */ "deefeefeefeed"
- /* 9 */ "deefeefeefeed"
- /* 10 */ "deefeefeefeed"
- /* 11 */ "ddddddddddddd"
-
- // Level 3
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "g..g..g..g..g"
- /* 1 */ "ghh.h..hh.hhg"
- /* 2 */ "ghh..h.hh.hhg"
- /* 3 */ "ghh.h..h..hhg"
- /* 4 */ "ghh.hh.h..hhg"
- /* 5 */ "ghh.h..hh.hhg"
- /* 6 */ "ghh.hh.hh.hhg"
- /* 7 */ "ghh....h..hhg"
- /* 8 */ "ghh..h....hhg"
- /* 9 */ "ghh.....h.hhg"
- /* 10 */ "ghh.hh.h..hhg"
- /* 11 */ "g..g..g..g..g"
-
- // Level 4
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "i..i..i..i..i"
- /* 1 */ "............."
- /* 2 */ "............."
- /* 3 */ "............."
- /* 4 */ "............."
- /* 5 */ "............."
- /* 6 */ "............."
- /* 7 */ "............."
- /* 8 */ "............."
- /* 9 */ "............."
- /* 10 */ "............."
- /* 11 */ "i..i..i..i..i"
-
- // Level 5
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "............."
- /* 3 */ "............."
- /* 4 */ "............."
- /* 5 */ "............."
- /* 6 */ "............."
- /* 7 */ "............."
- /* 8 */ "............."
- /* 9 */ "............."
- /* 10 */ "............."
- /* 11 */ "............."
-
- // Level 6
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "............."
- /* 3 */ "............."
- /* 4 */ "............."
- /* 5 */ "............."
- /* 6 */ "............."
- /* 7 */ "............."
- /* 8 */ "............."
- /* 9 */ "............."
- /* 10 */ "............."
- /* 11 */ "............."
-
- // Level 7
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "............."
- /* 3 */ "............."
- /* 4 */ "............."
- /* 5 */ "............."
- /* 6 */ "............."
- /* 7 */ "............."
- /* 8 */ "............."
- /* 9 */ "............."
- /* 10 */ "............."
- /* 11 */ ".............",
-
- // Connectors:
- "-1: 7, 1, 11: 3\n" /* Type -1, direction Z+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // BigPlantBed
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // CobbleHouse10x5Library:
- // The data has been exported from the gallery Plains, area index 23, ID 66, created by xoft
- {
- // Size:
- 12, 7, 7, // SizeX = 12, SizeY = 7, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 12, 6, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f: 53: 3\n" /* woodstairs */
- "g: 53: 1\n" /* woodstairs */
- "h: 85: 0\n" /* fence */
- "i: 53: 0\n" /* woodstairs */
- "j: 53: 2\n" /* woodstairs */
- "k:102: 0\n" /* glasspane */
- "l: 64:12\n" /* wooddoorblock */
- "m: 19: 0\n" /* sponge */
- "n: 50: 3\n" /* torch */
- "o: 72: 0\n" /* woodplate */
- "p: 50: 4\n" /* torch */
- "q: 53: 7\n" /* woodstairs */
- "r: 47: 0\n" /* bookshelf */
- "s: 50: 1\n" /* torch */
- "t: 50: 2\n" /* torch */
- "u: 53: 6\n" /* woodstairs */
- "v: 5: 0\n" /* wood */,
-
- // Block data:
- // Level 0
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "mmmmmmmaaamm"
- /* 1 */ "maaaaaaaaaam"
- /* 2 */ "maaaaaaaaaam"
- /* 3 */ "maaaaaaaaaam"
- /* 4 */ "maaaaaaaaaam"
- /* 5 */ "maaaaaaaaaam"
- /* 6 */ "mmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ ".......bcd.."
- /* 1 */ ".aaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaa."
- /* 6 */ "............"
-
- // Level 2
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ ".aaaaaaaeaa."
- /* 2 */ ".af.ghi...a."
- /* 3 */ ".ah.......a."
- /* 4 */ ".aj.ghighia."
- /* 5 */ ".aaaaaaaaaa."
- /* 6 */ "............"
-
- // Level 3
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ ".akkakkalaa."
- /* 2 */ ".k..no.n.nk."
- /* 3 */ ".ko.......k."
- /* 4 */ ".k..po.po.k."
- /* 5 */ ".akkakkakka."
- /* 6 */ "............"
-
- // Level 4
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "jjjjjjjjjjjj"
- /* 1 */ "qaaaaaaaaaaq"
- /* 2 */ ".arrrrrrrra."
- /* 3 */ ".as......ta."
- /* 4 */ ".arrrrrrrra."
- /* 5 */ "uaaaaaaaaaau"
- /* 6 */ "ffffffffffff"
-
- // Level 5
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "jjjjjjjjjjjj"
- /* 2 */ "qvvvvvvvvvvq"
- /* 3 */ ".vvvvvvvvvv."
- /* 4 */ "uvvvvvvvvvvu"
- /* 5 */ "ffffffffffff"
- /* 6 */ "............"
-
- // Level 6
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "jjjjjjjjjjjj"
- /* 3 */ "vvvvvvvvvvvv"
- /* 4 */ "ffffffffffff"
- /* 5 */ "............"
- /* 6 */ "............",
-
- // Connectors:
- "-1: 8, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // CobbleHouse10x5Library
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // DoublePlantBed:
- // The data has been exported from the gallery Plains, area index 5, ID 20, created by tonibm1999
- {
- // Size:
- 15, 8, 9, // SizeX = 15, SizeY = 8, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 14, 7, 8, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 2: 0\n" /* grass */
- "c: 17: 0\n" /* tree */
- "d: 60: 7\n" /* tilleddirt */
- "e: 8: 0\n" /* water */
- "f: 50: 5\n" /* torch */
- "g: 59: 7\n" /* crops */
- "h: 59: 3\n" /* crops */
- "i: 59: 5\n" /* crops */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "aaaaaaabaaaaaaa"
- /* 1 */ "aaaaaaaaaaaaaaa"
- /* 2 */ "aaaaaaaaaaaaaaa"
- /* 3 */ "aaaaaaaaaaaaaaa"
- /* 4 */ "aaaaaaabaaaaaaa"
- /* 5 */ "aaaaaaabaaaaaaa"
- /* 6 */ "aaaaaaabaaaaaaa"
- /* 7 */ "aaaaaaabaaaaaaa"
- /* 8 */ "aaaaaaabaaaaaaa"
-
- // Level 1
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "aaaaaaamaaaaaaa"
- /* 1 */ "aaaaaaamaaaaaaa"
- /* 2 */ "aaaaaaamaaaaaaa"
- /* 3 */ "aaaaaaamaaaaaaa"
- /* 4 */ "aaaaaaamaaaaaaa"
- /* 5 */ "aaaaaaamaaaaaaa"
- /* 6 */ "aaaaaaamaaaaaaa"
- /* 7 */ "aaaaaaamaaaaaaa"
- /* 8 */ "aaaaaaamaaaaaaa"
-
- // Level 2
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "ccccccc.ccccccc"
- /* 1 */ "cddeddc.cddeddc"
- /* 2 */ "cddeddc.cddeddc"
- /* 3 */ "cddeddc.cddeddc"
- /* 4 */ "cddeddc.cddeddc"
- /* 5 */ "cddeddc.cddeddc"
- /* 6 */ "cddeddc.cddeddc"
- /* 7 */ "cddeddc.cddeddc"
- /* 8 */ "ccccccc.ccccccc"
-
- // Level 3
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "f.....f.f.....f"
- /* 1 */ ".gg.gg...gg.gg."
- /* 2 */ ".gg.hg...gg.gg."
- /* 3 */ ".gg.gi...gg.gg."
- /* 4 */ ".gg.gg...gg.gg."
- /* 5 */ ".gg.gg...gg.gg."
- /* 6 */ ".gg.gg...gg.gg."
- /* 7 */ ".gg.gg...gg.gg."
- /* 8 */ "f.....f.f.....f"
-
- // Level 4
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
-
- // Level 5
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
-
- // Level 6
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
-
- // Level 7
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "...............",
-
- // Connectors:
- "-1: 7, 2, 8: 3\n" /* Type -1, direction Z+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // DoublePlantBed
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Forge:
- // The data has been exported from the gallery Plains, area index 51, ID 102, created by Aloe_vera
- {
- // Size:
- 12, 9, 11, // SizeX = 12, SizeY = 9, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 12, 8, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 64: 2\n" /* wooddoorblock */
- "h: 10: 0\n" /* lava */
- "i: 54: 2\n" /* chest */
- "j: 61: 2\n" /* furnace */
- "k:102: 0\n" /* glasspane */
- "l: 64: 8\n" /* wooddoorblock */
- "m: 19: 0\n" /* sponge */
- "n:139: 0\n" /* cobblestonewall */
- "o:101: 0\n" /* ironbars */
- "p: 53: 2\n" /* woodstairs */
- "q: 53: 7\n" /* woodstairs */
- "r: 50: 2\n" /* torch */
- "s: 50: 1\n" /* torch */
- "t: 53: 6\n" /* woodstairs */
- "u: 53: 3\n" /* woodstairs */
- "v: 43: 0\n" /* doubleslab */
- "w: 44: 0\n" /* step */,
-
- // Block data:
- // Level 0
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "mmmmmaaaaamm"
- /* 1 */ "maaaaaaaaamm"
- /* 2 */ "maaaaaaaaamm"
- /* 3 */ "maaaaaaaaaaa"
- /* 4 */ "maaaaaaaaaaa"
- /* 5 */ "maaaaaaaaaaa"
- /* 6 */ "maaaaaaaaaaa"
- /* 7 */ "maaaaaaaaaaa"
- /* 8 */ "maaaaammmmmm"
- /* 9 */ "maaaaammmmmm"
- /* 10 */ "mmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ ".....bcccd.."
- /* 1 */ ".aaaaaaaad.."
- /* 2 */ ".aaaaaaaad.."
- /* 3 */ ".aaaaaaaaaaa"
- /* 4 */ ".aaaaaaaaaaa"
- /* 5 */ ".aaaaaaaaaaa"
- /* 6 */ ".aaaaaaaaaaa"
- /* 7 */ ".aaaaaaaaaaa"
- /* 8 */ ".aaaaa......"
- /* 9 */ ".aaaaa......"
- /* 10 */ "............"
-
- // Level 2
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ ".efffe......"
- /* 2 */ ".f...g......"
- /* 3 */ ".f...ea..aaa"
- /* 4 */ ".f...f...aha"
- /* 5 */ ".f...f...aha"
- /* 6 */ ".f...fijjaha"
- /* 7 */ ".f...eaaaaaa"
- /* 8 */ ".f...f......"
- /* 9 */ ".efffe......"
- /* 10 */ "............"
-
- // Level 3
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ ".ekkke......"
- /* 2 */ ".k...l......"
- /* 3 */ ".k...en..n.a"
- /* 4 */ ".k...k.....o"
- /* 5 */ ".f...k.....o"
- /* 6 */ ".k...k.....o"
- /* 7 */ ".k...eaooooa"
- /* 8 */ ".k...f......"
- /* 9 */ ".ekkke......"
- /* 10 */ "............"
-
- // Level 4
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "ppppppp....."
- /* 1 */ "qfffffq....."
- /* 2 */ ".f...f......"
- /* 3 */ ".f..rfa..aoa"
- /* 4 */ ".f...f...o.a"
- /* 5 */ ".f...f...o.a"
- /* 6 */ ".fs..f...o.a"
- /* 7 */ ".f...faaaaaa"
- /* 8 */ ".f...f......"
- /* 9 */ "tffffft....."
- /* 10 */ "uuuuuuu....."
-
- // Level 5
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "ppppppp....."
- /* 2 */ "qfffffq....."
- /* 3 */ ".f...fvvvvvv"
- /* 4 */ ".f...fvwwwwv"
- /* 5 */ ".f...fvwwwwv"
- /* 6 */ ".f...fvwwwwv"
- /* 7 */ ".f...fvvvvvv"
- /* 8 */ "tffffft....."
- /* 9 */ "uuuuuuu....."
- /* 10 */ "............"
-
- // Level 6
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "ppppppp....."
- /* 3 */ "qfffffq....."
- /* 4 */ ".f...f......"
- /* 5 */ ".f...f......"
- /* 6 */ ".f...f......"
- /* 7 */ "tffffft....."
- /* 8 */ "uuuuuuu....."
- /* 9 */ "............"
- /* 10 */ "............"
-
- // Level 7
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "............"
- /* 3 */ "ppppppp....."
- /* 4 */ "qfffffq....."
- /* 5 */ ".f...f......"
- /* 6 */ "tffffft....."
- /* 7 */ "uuuuuuu....."
- /* 8 */ "............"
- /* 9 */ "............"
- /* 10 */ "............"
-
- // Level 8
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "............"
- /* 3 */ "............"
- /* 4 */ "ppppppp....."
- /* 5 */ "fffffff....."
- /* 6 */ "uuuuuuu....."
- /* 7 */ "............"
- /* 8 */ "............"
- /* 9 */ "............"
- /* 10 */ "............",
-
- // Connectors:
- "-1: 7, 1, -1: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Forge
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // LampPost:
- // The data has been exported from the gallery Plains, area index 28, ID 73, created by STR_Warrior
- {
- // Size:
- 3, 7, 3, // SizeX = 3, SizeY = 7, SizeZ = 3
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 2, 6, 2, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 43: 0\n" /* doubleslab */
- "c:139: 0\n" /* cobblestonewall */
- "d: 50: 4\n" /* torch */
- "e: 50: 2\n" /* torch */
- "f: 50: 1\n" /* torch */
- "g: 50: 3\n" /* torch */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 012 */
- /* 0 */ "mmm"
- /* 1 */ "mam"
- /* 2 */ "mmm"
-
- // Level 1
- /* z\x* 012 */
- /* 0 */ "..."
- /* 1 */ ".b."
- /* 2 */ "..."
-
- // Level 2
- /* z\x* 012 */
- /* 0 */ "..."
- /* 1 */ ".c."
- /* 2 */ "..."
-
- // Level 3
- /* z\x* 012 */
- /* 0 */ "..."
- /* 1 */ ".c."
- /* 2 */ "..."
-
- // Level 4
- /* z\x* 012 */
- /* 0 */ ".d."
- /* 1 */ "ebf"
- /* 2 */ ".g."
-
- // Level 5
- /* z\x* 012 */
- /* 0 */ "..."
- /* 1 */ "..."
- /* 2 */ "..."
-
- // Level 6
- /* z\x* 012 */
- /* 0 */ "..."
- /* 1 */ "..."
- /* 2 */ "...",
-
- // Connectors:
- "-1: 1, 1, 2: 3\n" /* Type -1, direction Z+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // LampPost
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MineshaftCorridor:
- // The data has been exported from the gallery Plains, area index 139, ID 447, created by STR_Warrior
- {
- // Size:
- 10, 4, 3, // SizeX = 10, SizeY = 4, SizeZ = 3
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 9, 3, 2, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 0\n" /* wood */
- "b: 85: 0\n" /* fence */
- "c: 66: 1\n" /* tracks */
- "d: 50: 2\n" /* torch */
- "e: 50: 1\n" /* torch */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "aaaaaaaaaa"
- /* 1 */ "aaaaaaaaaa"
- /* 2 */ "aaaaaaaaaa"
-
- // Level 1
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "..b....b.."
- /* 1 */ "cccccccccc"
- /* 2 */ "..b....b.."
-
- // Level 2
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "..b....b.."
- /* 1 */ ".........."
- /* 2 */ "..b....b.."
-
- // Level 3
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "..a....a.."
- /* 1 */ ".dae..dae."
- /* 2 */ "..a....a..",
-
- // Connectors:
- "-3: 0, 1, 1: 4\n" /* Type -3, direction X- */
- "3: 9, 1, 1: 5\n" /* Type 3, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- false,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 200,
-
- // MoveToGround:
- false,
- }, // MineshaftCorridor
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MineshaftCrossing:
- // The data has been exported from the gallery Plains, area index 171, ID 578, created by Aloe_vera
- {
- // Size:
- 5, 4, 5, // SizeX = 5, SizeY = 4, SizeZ = 5
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 4, 3, 4, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 0\n" /* wood */
- "b: 66: 0\n" /* tracks */
- "c: 66: 1\n" /* tracks */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 01234 */
- /* 0 */ "aaaaa"
- /* 1 */ "aaaaa"
- /* 2 */ "aaaaa"
- /* 3 */ "aaaaa"
- /* 4 */ "aaaaa"
-
- // Level 1
- /* z\x* 01234 */
- /* 0 */ "m.b.m"
- /* 1 */ ".aba."
- /* 2 */ "ccccc"
- /* 3 */ ".aba."
- /* 4 */ "m.b.m"
-
- // Level 2
- /* z\x* 01234 */
- /* 0 */ "m...m"
- /* 1 */ ".a.a."
- /* 2 */ "....."
- /* 3 */ ".a.a."
- /* 4 */ "m...m"
-
- // Level 3
- /* z\x* 01234 */
- /* 0 */ "m...m"
- /* 1 */ ".a.a."
- /* 2 */ "....."
- /* 3 */ ".a.a."
- /* 4 */ "m...m",
-
- // Connectors:
- "3: 4, 1, 2: 5\n" /* Type 3, direction X+ */
- "-3: 4, 1, 2: 5\n" /* Type -3, direction X+ */
- "-3: 2, 1, 4: 3\n" /* Type -3, direction Z+ */
- "3: 2, 1, 4: 3\n" /* Type 3, direction Z+ */
- "3: 0, 1, 2: 4\n" /* Type 3, direction X- */
- "-3: 0, 1, 2: 4\n" /* Type -3, direction X- */
- "3: 2, 1, 0: 2\n" /* Type 3, direction Z- */
- "-3: 2, 1, 0: 2\n" /* Type -3, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- false,
-
- // DefaultWeight:
- 1,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- false,
- }, // MineshaftCrossing
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MineshaftCrossing:
- // The data has been exported from the gallery Plains, area index 193, ID 657, created by Aloe_vera
- {
- // Size:
- 11, 4, 11, // SizeX = 11, SizeY = 4, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 10, 3, 10, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 0\n" /* wood */
- "b: 66: 0\n" /* tracks */
- "c: 85: 0\n" /* fence */
- "d: 66: 1\n" /* tracks */
- "e: 50: 4\n" /* torch */
- "f: 50: 3\n" /* torch */
- "g: 50: 2\n" /* torch */
- "h: 50: 1\n" /* torch */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmaaammmm"
- /* 1 */ "mmmmaaammmm"
- /* 2 */ "mmmmaaammmm"
- /* 3 */ "mmmmaaammmm"
- /* 4 */ "aaaaaaaaaaa"
- /* 5 */ "aaaaaaaaaaa"
- /* 6 */ "aaaaaaaaaaa"
- /* 7 */ "mmmmaaammmm"
- /* 8 */ "mmmmaaammmm"
- /* 9 */ "mmmmaaammmm"
- /* 10 */ "mmmmaaammmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmm.b.mmmm"
- /* 1 */ "mmmm.b.mmmm"
- /* 2 */ "mmmmcbcmmmm"
- /* 3 */ "mmmm.b.mmmm"
- /* 4 */ "..c..b..c.."
- /* 5 */ "ddddddddddd"
- /* 6 */ "..c..b..c.."
- /* 7 */ "mmmm.b.mmmm"
- /* 8 */ "mmmmcbcmmmm"
- /* 9 */ "mmmm.b.mmmm"
- /* 10 */ "mmmm.b.mmmm"
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmm...mmmm"
- /* 1 */ "mmmm...mmmm"
- /* 2 */ "mmmmc.cmmmm"
- /* 3 */ "mmmm...mmmm"
- /* 4 */ "..c.....c.."
- /* 5 */ "..........."
- /* 6 */ "..c.....c.."
- /* 7 */ "mmmm...mmmm"
- /* 8 */ "mmmmc.cmmmm"
- /* 9 */ "mmmm...mmmm"
- /* 10 */ "mmmm...mmmm"
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmm...mmmm"
- /* 1 */ "mmmm.e.mmmm"
- /* 2 */ "mmmmaaammmm"
- /* 3 */ "mmmm.f.mmmm"
- /* 4 */ "..a.....a.."
- /* 5 */ ".gah...gah."
- /* 6 */ "..a.....a.."
- /* 7 */ "mmmm.e.mmmm"
- /* 8 */ "mmmmaaammmm"
- /* 9 */ "mmmm.f.mmmm"
- /* 10 */ "mmmm...mmmm",
-
- // Connectors:
- "3: 5, 1, 0: 2\n" /* Type 3, direction Z- */
- "-3: 5, 1, 0: 2\n" /* Type -3, direction Z- */
- "3: 0, 1, 5: 4\n" /* Type 3, direction X- */
- "-3: 0, 1, 5: 4\n" /* Type -3, direction X- */
- "3: 5, 1, 10: 3\n" /* Type 3, direction Z+ */
- "-3: 5, 1, 10: 3\n" /* Type -3, direction Z+ */
- "3: 10, 1, 5: 5\n" /* Type 3, direction X+ */
- "-3: 10, 1, 5: 5\n" /* Type -3, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- false,
-
- // DefaultWeight:
- 10,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- false,
- }, // MineshaftCrossing
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MineshaftDoubleCrossing:
- // The data has been exported from the gallery Plains, area index 172, ID 579, created by Aloe_vera
- {
- // Size:
- 5, 8, 5, // SizeX = 5, SizeY = 8, SizeZ = 5
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 4, 7, 4, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 0\n" /* wood */
- "b: 66: 0\n" /* tracks */
- "c: 66: 1\n" /* tracks */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 01234 */
- /* 0 */ "aaaaa"
- /* 1 */ "aaaaa"
- /* 2 */ "aaaaa"
- /* 3 */ "aaaaa"
- /* 4 */ "aaaaa"
-
- // Level 1
- /* z\x* 01234 */
- /* 0 */ "m.b.m"
- /* 1 */ ".aba."
- /* 2 */ "ccccc"
- /* 3 */ ".aba."
- /* 4 */ "m.b.m"
-
- // Level 2
- /* z\x* 01234 */
- /* 0 */ "m...m"
- /* 1 */ ".a.a."
- /* 2 */ "....."
- /* 3 */ ".a.a."
- /* 4 */ "m...m"
-
- // Level 3
- /* z\x* 01234 */
- /* 0 */ "m...m"
- /* 1 */ ".a.a."
- /* 2 */ "....."
- /* 3 */ ".a.a."
- /* 4 */ "m...m"
-
- // Level 4
- /* z\x* 01234 */
- /* 0 */ "aaaaa"
- /* 1 */ "aa.aa"
- /* 2 */ "a...a"
- /* 3 */ "aa.aa"
- /* 4 */ "aaaaa"
-
- // Level 5
- /* z\x* 01234 */
- /* 0 */ "m...m"
- /* 1 */ ".a.a."
- /* 2 */ "....."
- /* 3 */ ".a.a."
- /* 4 */ "m...m"
-
- // Level 6
- /* z\x* 01234 */
- /* 0 */ "m...m"
- /* 1 */ ".a.a."
- /* 2 */ "....."
- /* 3 */ ".a.a."
- /* 4 */ "m...m"
-
- // Level 7
- /* z\x* 01234 */
- /* 0 */ "m...m"
- /* 1 */ ".a.a."
- /* 2 */ "....."
- /* 3 */ ".a.a."
- /* 4 */ "m...m",
-
- // Connectors:
- "-3: 4, 5, 2: 5\n" /* Type -3, direction X+ */
- "3: 4, 5, 2: 5\n" /* Type 3, direction X+ */
- "-3: 2, 1, 4: 3\n" /* Type -3, direction Z+ */
- "3: 2, 1, 4: 3\n" /* Type 3, direction Z+ */
- "-3: 0, 1, 2: 4\n" /* Type -3, direction X- */
- "3: 0, 1, 2: 4\n" /* Type 3, direction X- */
- "-3: 2, 1, 0: 2\n" /* Type -3, direction Z- */
- "3: 2, 1, 0: 2\n" /* Type 3, direction Z- */
- "-3: 4, 1, 2: 5\n" /* Type -3, direction X+ */
- "3: 4, 1, 2: 5\n" /* Type 3, direction X+ */
- "-3: 2, 5, 4: 3\n" /* Type -3, direction Z+ */
- "3: 2, 5, 4: 3\n" /* Type 3, direction Z+ */
- "-3: 0, 5, 2: 4\n" /* Type -3, direction X- */
- "3: 0, 5, 2: 4\n" /* Type 3, direction X- */
- "-3: 2, 5, 0: 2\n" /* Type -3, direction Z- */
- "3: 2, 5, 0: 2\n" /* Type 3, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- false,
-
- // DefaultWeight:
- 1,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- false,
- }, // MineshaftDoubleCrossing
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MineshaftSpiral:
- // The data has been exported from the gallery Plains, area index 198, ID 662, created by Aloe_vera
- {
- // Size:
- 7, 12, 7, // SizeX = 7, SizeY = 12, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 6, 11, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 0\n" /* wood */
- "b: 85: 0\n" /* fence */
- "c: 66: 4\n" /* tracks */
- "d: 66: 0\n" /* tracks */
- "e: 66: 6\n" /* tracks */
- "f: 66: 2\n" /* tracks */
- "g: 50: 1\n" /* torch */
- "h: 50: 3\n" /* torch */
- "i: 66: 1\n" /* tracks */
- "j: 66: 7\n" /* tracks */
- "k: 66: 5\n" /* tracks */
- "l: 50: 2\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n: 66: 3\n" /* tracks */
- "o: 66: 8\n" /* tracks */
- "p: 50: 4\n" /* torch */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmmmmm"
- /* 2 */ "mmmmmmm"
- /* 3 */ "aaabmmm"
- /* 4 */ "aaammmm"
- /* 5 */ "aaammmm"
- /* 6 */ "aaammmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmmmmm"
- /* 2 */ "aaammmm"
- /* 3 */ "aaabmmm"
- /* 4 */ ".c.mmmm"
- /* 5 */ ".d.mmmm"
- /* 6 */ ".d.mmmm"
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "aaaammm"
- /* 1 */ "aaaammm"
- /* 2 */ "aaaammm"
- /* 3 */ ".c.bmmm"
- /* 4 */ "...mmmm"
- /* 5 */ "...mmmm"
- /* 6 */ "...mmmm"
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "b..aamm"
- /* 1 */ ".efaamm"
- /* 2 */ ".d.aamm"
- /* 3 */ "...bmmm"
- /* 4 */ "...mmmm"
- /* 5 */ "...mmmm"
- /* 6 */ "...mmmm"
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "b...aaa"
- /* 1 */ "...faaa"
- /* 2 */ "....aaa"
- /* 3 */ "...baaa"
- /* 4 */ "...mmmm"
- /* 5 */ "mmmmmmm"
- /* 6 */ "mmmmmmm"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "ag....b"
- /* 1 */ "h...ij."
- /* 2 */ ".....k."
- /* 3 */ "...baaa"
- /* 4 */ "mmmmaaa"
- /* 5 */ "mmmmmmm"
- /* 6 */ "mmmmmmm"
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "mm....b"
- /* 1 */ "mm....."
- /* 2 */ "mm....."
- /* 3 */ "mmmb.k."
- /* 4 */ "mmmaaaa"
- /* 5 */ "mmmaaaa"
- /* 6 */ "mmmaaaa"
-
- // Level 7
- /* z\x* 0123456 */
- /* 0 */ "mmm..la"
- /* 1 */ "mmm...h"
- /* 2 */ "mmm...."
- /* 3 */ "mmmb..."
- /* 4 */ "mmaa.d."
- /* 5 */ "mmaano."
- /* 6 */ "mmaa..b"
-
- // Level 8
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmmmmm"
- /* 2 */ "mmmm..."
- /* 3 */ "mmmb..."
- /* 4 */ "aaa...."
- /* 5 */ "aaan..."
- /* 6 */ "aaa...b"
-
- // Level 9
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmmmmm"
- /* 2 */ "mmmmmmm"
- /* 3 */ "mmmb..."
- /* 4 */ "......."
- /* 5 */ "iii...p"
- /* 6 */ ".....la"
-
- // Level 10
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmmmmm"
- /* 2 */ "mmmmmmm"
- /* 3 */ "mmmbmmm"
- /* 4 */ ".....mm"
- /* 5 */ ".....mm"
- /* 6 */ ".....mm"
-
- // Level 11
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmmmmm"
- /* 2 */ "mmmmmmm"
- /* 3 */ "mmmbmmm"
- /* 4 */ "....mmm"
- /* 5 */ "....mmm"
- /* 6 */ "....mmm",
-
- // Connectors:
- "3: 1, 1, 6: 3\n" /* Type 3, direction Z+ */
- "-3: 1, 1, 6: 3\n" /* Type -3, direction Z+ */
- "3: 0, 9, 5: 4\n" /* Type 3, direction X- */
- "-3: 0, 9, 5: 4\n" /* Type -3, direction X- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- false,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- false,
- }, // MineshaftSpiral
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MineshaftStairs:
- // The data has been exported from the gallery Plains, area index 195, ID 659, created by Aloe_vera
- {
- // Size:
- 7, 8, 3, // SizeX = 7, SizeY = 8, SizeZ = 3
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 6, 7, 2, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 0\n" /* wood */
- "b: 66: 1\n" /* tracks */
- "c: 66: 2\n" /* tracks */
- "d: 85: 0\n" /* fence */
- "e: 50: 1\n" /* torch */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "aaammmm"
- /* 1 */ "aaammmm"
- /* 2 */ "aaammmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "..aammm"
- /* 1 */ "bcaammm"
- /* 2 */ "..aammm"
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "...aamm"
- /* 1 */ "..caamm"
- /* 2 */ "...aamm"
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "...daam"
- /* 1 */ "...caam"
- /* 2 */ "...daam"
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "m..d.aa"
- /* 1 */ "m...caa"
- /* 2 */ "m..d.aa"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "mm.d..."
- /* 1 */ "mm...bb"
- /* 2 */ "mm.d..."
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "mmmd..."
- /* 1 */ "mmm...."
- /* 2 */ "mmmd..."
-
- // Level 7
- /* z\x* 0123456 */
- /* 0 */ "mmma..."
- /* 1 */ "mmmae.."
- /* 2 */ "mmma...",
-
- // Connectors:
- "3: 0, 1, 1: 4\n" /* Type 3, direction X- */
- "-3: 0, 1, 1: 4\n" /* Type -3, direction X- */
- "3: 6, 5, 1: 5\n" /* Type 3, direction X+ */
- "-3: 6, 5, 1: 5\n" /* Type -3, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- false,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- false,
- }, // MineshaftStairs
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MineshaftStairsCrossing:
- // The data has been exported from the gallery Plains, area index 199, ID 663, created by Aloe_vera
- {
- // Size:
- 11, 12, 12, // SizeX = 11, SizeY = 12, SizeZ = 12
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 10, 11, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 0\n" /* wood */
- "b: 66: 0\n" /* tracks */
- "c: 66: 5\n" /* tracks */
- "d: 85: 0\n" /* fence */
- "e: 66: 1\n" /* tracks */
- "f: 50: 3\n" /* torch */
- "g: 50: 2\n" /* torch */
- "h: 50: 1\n" /* torch */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmaaammmm"
- /* 1 */ "mmmmaaammmm"
- /* 2 */ "mmmmaaammmm"
- /* 3 */ "mmmmmmmmmmm"
- /* 4 */ "mmmmmmmmmmm"
- /* 5 */ "mmmmmmmmmmm"
- /* 6 */ "mmmmmmmmmmm"
- /* 7 */ "mmmmmmmmmmm"
- /* 8 */ "mmmmmmmmmmm"
- /* 9 */ "mmmmmmmmmmm"
- /* 10 */ "mmmmmmmmmmm"
- /* 11 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmm.b.mmmm"
- /* 1 */ "mmmm.c.mmmm"
- /* 2 */ "mmmmaaammmm"
- /* 3 */ "mmmmaaammmm"
- /* 4 */ "mmmmmmmmmmm"
- /* 5 */ "mmmmmmmmmmm"
- /* 6 */ "mmmmmmmmmmm"
- /* 7 */ "mmmmmmmmmmm"
- /* 8 */ "mmmmmmmmmmm"
- /* 9 */ "mmmmmmmmmmm"
- /* 10 */ "mmmmmmmmmmm"
- /* 11 */ "mmmmmmmmmmm"
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmm...mmmm"
- /* 1 */ "mmmm...mmmm"
- /* 2 */ "mmmm.c.mmmm"
- /* 3 */ "mmmmaaammmm"
- /* 4 */ "mmmmaaammmm"
- /* 5 */ "mmmmmmmmmmm"
- /* 6 */ "mmmmmmmmmmm"
- /* 7 */ "mmmmmmmmmmm"
- /* 8 */ "mmmmmmmmmmm"
- /* 9 */ "mmmmmmmmmmm"
- /* 10 */ "mmmmmmmmmmm"
- /* 11 */ "mmmmmmmmmmm"
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmm...mmmm"
- /* 1 */ "mmmm...mmmm"
- /* 2 */ "mmmm...mmmm"
- /* 3 */ "mmmmdcdmmmm"
- /* 4 */ "mmmmaaammmm"
- /* 5 */ "mmmmaaammmm"
- /* 6 */ "mmmmmmmmmmm"
- /* 7 */ "mmmmmmmmmmm"
- /* 8 */ "mmmmmmmmmmm"
- /* 9 */ "mmmmmmmmmmm"
- /* 10 */ "mmmmmmmmmmm"
- /* 11 */ "mmmmmmmmmmm"
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "mmmm...mmmm"
- /* 2 */ "mmmm...mmmm"
- /* 3 */ "mmmmd.dmmmm"
- /* 4 */ "mmmm.c.mmmm"
- /* 5 */ "aaaaaaaaaaa"
- /* 6 */ "aaaaaaaaaaa"
- /* 7 */ "aaaaaaaaaaa"
- /* 8 */ "mmmmaaammmm"
- /* 9 */ "mmmmmmmmmmm"
- /* 10 */ "mmmmmmmmmmm"
- /* 11 */ "mmmmmmmmmmm"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "mmmmmmmmmmm"
- /* 2 */ "mmmm...mmmm"
- /* 3 */ "mmmmd.dmmmm"
- /* 4 */ "mmmm...mmmm"
- /* 5 */ "..d..b..d.."
- /* 6 */ "eeeeeeeeeee"
- /* 7 */ "..d..c..d.."
- /* 8 */ "mmmmaaammmm"
- /* 9 */ "mmmmaaammmm"
- /* 10 */ "mmmmmmmmmmm"
- /* 11 */ "mmmmmmmmmmm"
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "mmmmmmmmmmm"
- /* 2 */ "mmmmmmmmmmm"
- /* 3 */ "mmmmd.dmmmm"
- /* 4 */ "mmmm...mmmm"
- /* 5 */ "..d.....d.."
- /* 6 */ "..........."
- /* 7 */ "..d.....d.."
- /* 8 */ "mmmm.c.mmmm"
- /* 9 */ "mmmmaaammmm"
- /* 10 */ "mmmmaaammmm"
- /* 11 */ "mmmmmmmmmmm"
-
- // Level 7
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "mmmmmmmmmmm"
- /* 2 */ "mmmmmmmmmmm"
- /* 3 */ "mmmmaaammmm"
- /* 4 */ "mmmm.f.mmmm"
- /* 5 */ "..a.....a.."
- /* 6 */ ".gah...gah."
- /* 7 */ "..a.....a.."
- /* 8 */ "mmmm...mmmm"
- /* 9 */ "mmmmdcdmmmm"
- /* 10 */ "mmmmaaammmm"
- /* 11 */ "mmmmaaammmm"
-
- // Level 8
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "mmmmmmmmmmm"
- /* 2 */ "mmmmmmmmmmm"
- /* 3 */ "mmmmmmmmmmm"
- /* 4 */ "mmmmmmmmmmm"
- /* 5 */ "mmmmmmmmmmm"
- /* 6 */ "mmmmmmmmmmm"
- /* 7 */ "mmmm...mmmm"
- /* 8 */ "mmmm...mmmm"
- /* 9 */ "mmmmd.dmmmm"
- /* 10 */ "mmmm.c.mmmm"
- /* 11 */ "mmmmaaammmm"
-
- // Level 9
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "mmmmmmmmmmm"
- /* 2 */ "mmmmmmmmmmm"
- /* 3 */ "mmmmmmmmmmm"
- /* 4 */ "mmmmmmmmmmm"
- /* 5 */ "mmmmmmmmmmm"
- /* 6 */ "mmmmmmmmmmm"
- /* 7 */ "mmmmmmmmmmm"
- /* 8 */ "mmmm...mmmm"
- /* 9 */ "mmmmd.dmmmm"
- /* 10 */ "mmmm...mmmm"
- /* 11 */ "mmmm.b.mmmm"
-
- // Level 10
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "mmmmmmmmmmm"
- /* 2 */ "mmmmmmmmmmm"
- /* 3 */ "mmmmmmmmmmm"
- /* 4 */ "mmmmmmmmmmm"
- /* 5 */ "mmmmmmmmmmm"
- /* 6 */ "mmmmmmmmmmm"
- /* 7 */ "mmmmmmmmmmm"
- /* 8 */ "mmmmmmmmmmm"
- /* 9 */ "mmmmd.dmmmm"
- /* 10 */ "mmmm...mmmm"
- /* 11 */ "mmmm...mmmm"
-
- // Level 11
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmmmmmmmm"
- /* 1 */ "mmmmmmmmmmm"
- /* 2 */ "mmmmmmmmmmm"
- /* 3 */ "mmmmmmmmmmm"
- /* 4 */ "mmmmmmmmmmm"
- /* 5 */ "mmmmmmmmmmm"
- /* 6 */ "mmmmmmmmmmm"
- /* 7 */ "mmmmmmmmmmm"
- /* 8 */ "mmmmmmmmmmm"
- /* 9 */ "mmmmaaammmm"
- /* 10 */ "mmmm.f.mmmm"
- /* 11 */ "mmmm...mmmm",
-
- // Connectors:
- "3: 0, 5, 6: 4\n" /* Type 3, direction X- */
- "-3: 0, 5, 6: 4\n" /* Type -3, direction X- */
- "3: 10, 5, 6: 5\n" /* Type 3, direction X+ */
- "-3: 10, 5, 6: 5\n" /* Type -3, direction X+ */
- "3: 5, 9, 11: 3\n" /* Type 3, direction Z+ */
- "-3: 5, 9, 11: 3\n" /* Type -3, direction Z+ */
- "3: 5, 1, 1: 2\n" /* Type 3, direction Z- */
- "-3: 5, 1, 1: 2\n" /* Type -3, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- false,
-
- // DefaultWeight:
- 30,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- false,
- }, // MineshaftStairsCrossing
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MineshaftTee:
- // The data has been exported from the gallery Plains, area index 194, ID 658, created by Aloe_vera
- {
- // Size:
- 11, 4, 7, // SizeX = 11, SizeY = 4, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 10, 3, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 0\n" /* wood */
- "b: 66: 0\n" /* tracks */
- "c: 85: 0\n" /* fence */
- "d: 66: 1\n" /* tracks */
- "e: 50: 4\n" /* torch */
- "f: 50: 3\n" /* torch */
- "g: 50: 2\n" /* torch */
- "h: 50: 1\n" /* torch */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmaaammmm"
- /* 1 */ "mmmmaaammmm"
- /* 2 */ "mmmmaaammmm"
- /* 3 */ "mmmmaaammmm"
- /* 4 */ "aaaaaaaaaaa"
- /* 5 */ "aaaaaaaaaaa"
- /* 6 */ "aaaaaaaaaaa"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmm.b.mmmm"
- /* 1 */ "mmmm.b.mmmm"
- /* 2 */ "mmmmcbcmmmm"
- /* 3 */ "mmmm.b.mmmm"
- /* 4 */ "..c..b..c.."
- /* 5 */ "ddddddddddd"
- /* 6 */ "..c.....c.."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmm...mmmm"
- /* 1 */ "mmmm...mmmm"
- /* 2 */ "mmmmc.cmmmm"
- /* 3 */ "mmmm...mmmm"
- /* 4 */ "..c.....c.."
- /* 5 */ "..........."
- /* 6 */ "..c.....c.."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmm...mmmm"
- /* 1 */ "mmmm.e.mmmm"
- /* 2 */ "mmmmaaammmm"
- /* 3 */ "mmmm.f.mmmm"
- /* 4 */ "..a.....a.."
- /* 5 */ ".gah...gah."
- /* 6 */ "..a.....a..",
-
- // Connectors:
- "3: 0, 1, 5: 4\n" /* Type 3, direction X- */
- "-3: 0, 1, 5: 4\n" /* Type -3, direction X- */
- "3: 5, 1, 0: 2\n" /* Type 3, direction Z- */
- "-3: 5, 1, 0: 2\n" /* Type -3, direction Z- */
- "3: 10, 1, 5: 5\n" /* Type 3, direction X+ */
- "-3: 10, 1, 5: 5\n" /* Type -3, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- false,
-
- // DefaultWeight:
- 20,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- false,
- }, // MineshaftTee
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MineshaftsCorridor5:
- // The data has been exported from the gallery Plains, area index 200, ID 664, created by Aloe_vera
- {
- // Size:
- 11, 4, 3, // SizeX = 11, SizeY = 4, SizeZ = 3
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 10, 3, 2, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 0\n" /* wood */
- "b: 85: 0\n" /* fence */
- "c: 66: 1\n" /* tracks */
- "d: 50: 2\n" /* torch */
- "e: 50: 1\n" /* torch */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "aaaaaaaaaaa"
- /* 1 */ "aaaaaaaaaaa"
- /* 2 */ "aaaaaaaaaaa"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..b.....b.."
- /* 1 */ "ccccccccccc"
- /* 2 */ "..b.....b.."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..b.....b.."
- /* 1 */ "..........."
- /* 2 */ "..b.....b.."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..a.....a.."
- /* 1 */ ".dae...dae."
- /* 2 */ "..a.....a..",
-
- // Connectors:
- "3: 10, 1, 1: 5\n" /* Type 3, direction X+ */
- "-3: 10, 1, 1: 5\n" /* Type -3, direction X+ */
- "-3: 0, 1, 1: 4\n" /* Type -3, direction X- */
- "3: 0, 1, 1: 4\n" /* Type 3, direction X- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- false,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- false,
- }, // MineshaftsCorridor5
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Scarecrow:
- // The data has been exported from the gallery Plains, area index 150, ID 494, created by STR_Warrior
- {
- // Size:
- 1, 6, 3, // SizeX = 1, SizeY = 6, SizeZ = 3
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 0, 5, 2, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a:139: 0\n" /* cobblestonewall */
- "b: 85: 0\n" /* fence */
- "c:126: 4\n" /* woodenslab */
- "d: 86: 1\n" /* pumpkin */
- "e:139: 1\n" /* cobblestonewall */
- "f:163: 4\n" /* acaciawoodenstairs */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 0 */
- /* 0 */ "."
- /* 1 */ "a"
- /* 2 */ "."
-
- // Level 1
- /* z\x* 0 */
- /* 0 */ "."
- /* 1 */ "b"
- /* 2 */ "."
-
- // Level 2
- /* z\x* 0 */
- /* 0 */ "c"
- /* 1 */ "d"
- /* 2 */ "c"
-
- // Level 3
- /* z\x* 0 */
- /* 0 */ "."
- /* 1 */ "e"
- /* 2 */ "."
-
- // Level 4
- /* z\x* 0 */
- /* 0 */ "f"
- /* 1 */ "d"
- /* 2 */ "f"
-
- // Level 5
- /* z\x* 0 */
- /* 0 */ "."
- /* 1 */ "f"
- /* 2 */ ".",
-
- // Connectors:
- "-1: -1, 0, 1: 4\n" /* Type -1, direction X- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 10,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Scarecrow
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // SinglePlantBed:
- // The data has been exported from the gallery Plains, area index 17, ID 60, created by Aloe_vera
- {
- // Size:
- 10, 7, 7, // SizeX = 10, SizeY = 7, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 9, 6, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 17: 0\n" /* tree */
- "c: 60: 7\n" /* tilleddirt */
- "d: 8: 0\n" /* water */
- "e: 59: 7\n" /* crops */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "aaaaaaaaaa"
- /* 1 */ "aaaaaaaaaa"
- /* 2 */ "aaaaaaaaaa"
- /* 3 */ "aaaaaaaaaa"
- /* 4 */ "aaaaaaaaaa"
- /* 5 */ "aaaaaaaaaa"
- /* 6 */ "aaaaaaaaaa"
-
- // Level 1
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "bbbbbbbbbb"
- /* 1 */ "bccccccccb"
- /* 2 */ "bccccccccb"
- /* 3 */ "bddddddddb"
- /* 4 */ "bccccccccb"
- /* 5 */ "bccccccccb"
- /* 6 */ "bbbbbbbbbb"
-
- // Level 2
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".eeeeeeee."
- /* 2 */ ".eeeeeeee."
- /* 3 */ ".........."
- /* 4 */ ".eeeeeeee."
- /* 5 */ ".eeeeeeee."
- /* 6 */ ".........."
-
- // Level 3
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".........."
- /* 2 */ ".........."
- /* 3 */ ".........."
- /* 4 */ ".........."
- /* 5 */ ".........."
- /* 6 */ ".........."
-
- // Level 4
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".........."
- /* 2 */ ".........."
- /* 3 */ ".........."
- /* 4 */ ".........."
- /* 5 */ ".........."
- /* 6 */ ".........."
-
- // Level 5
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".........."
- /* 2 */ ".........."
- /* 3 */ ".........."
- /* 4 */ ".........."
- /* 5 */ ".........."
- /* 6 */ ".........."
-
- // Level 6
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".........."
- /* 2 */ ".........."
- /* 3 */ ".........."
- /* 4 */ ".........."
- /* 5 */ ".........."
- /* 6 */ "..........",
-
- // Connectors:
- "-1: 9, 1, 3: 5\n" /* Type -1, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // SinglePlantBed
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenChurchMid:
- // The data has been exported from the gallery Plains, area index 58, ID 109, created by Aloe_vera
- {
- // Size:
- 7, 15, 13, // SizeX = 7, SizeY = 15, SizeZ = 13
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 7, 14, 13, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "A: 85: 0\n" /* fence */
- "B:126: 8\n" /* woodenslab */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 64: 7\n" /* wooddoorblock */
- "h: 65: 3\n" /* ladder */
- "i: 53: 3\n" /* woodstairs */
- "j: 53: 7\n" /* woodstairs */
- "k: 64:12\n" /* wooddoorblock */
- "l:102: 0\n" /* glasspane */
- "m: 19: 0\n" /* sponge */
- "n: 50: 1\n" /* torch */
- "o: 50: 2\n" /* torch */
- "p:171:14\n" /* carpet */
- "q: 50: 3\n" /* torch */
- "r: 53: 2\n" /* woodstairs */
- "s: 53: 0\n" /* woodstairs */
- "t: 53: 1\n" /* woodstairs */
- "u: 53: 5\n" /* woodstairs */
- "v: 53: 4\n" /* woodstairs */
- "w: 17: 4\n" /* tree */
- "x: 17: 8\n" /* tree */
- "y: 54: 2\n" /* chest */
- "z: 50: 4\n" /* torch */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mmaaamm"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "maaaaam"
- /* 6 */ "maaaaam"
- /* 7 */ "maaaaam"
- /* 8 */ "maaaaam"
- /* 9 */ "maaaaam"
- /* 10 */ "maaaaam"
- /* 11 */ "maaaaam"
- /* 12 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "..bcd.."
- /* 1 */ ".aaaaa."
- /* 2 */ ".aaaaa."
- /* 3 */ ".aaaaa."
- /* 4 */ ".aaaaa."
- /* 5 */ ".aaaaa."
- /* 6 */ ".aaaaa."
- /* 7 */ ".aaaaa."
- /* 8 */ ".aaaaa."
- /* 9 */ ".aaaaa."
- /* 10 */ ".aaaaa."
- /* 11 */ ".aaaaa."
- /* 12 */ "......."
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".efgfe."
- /* 2 */ ".f..hf."
- /* 3 */ ".f...f."
- /* 4 */ ".f...f."
- /* 5 */ ".ei.ie."
- /* 6 */ ".f...f."
- /* 7 */ ".fi.if."
- /* 8 */ ".f...f."
- /* 9 */ ".f.j.f."
- /* 10 */ ".f...f."
- /* 11 */ ".efffe."
- /* 12 */ "......."
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".efkfe."
- /* 2 */ ".l..hl."
- /* 3 */ ".l...l."
- /* 4 */ ".l...l."
- /* 5 */ ".e...e."
- /* 6 */ ".l...l."
- /* 7 */ ".l...l."
- /* 8 */ ".fn.of."
- /* 9 */ ".l.p.l."
- /* 10 */ ".l...l."
- /* 11 */ ".ellle."
- /* 12 */ "......."
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".efffe."
- /* 2 */ ".f.qhf."
- /* 3 */ ".f...f."
- /* 4 */ ".f...f."
- /* 5 */ "re...er"
- /* 6 */ "sf...ft"
- /* 7 */ "sf...ft"
- /* 8 */ "sf...ft"
- /* 9 */ "sf...ft"
- /* 10 */ "sf...ft"
- /* 11 */ "sefffet"
- /* 12 */ "su...vt"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".ewwwe."
- /* 2 */ ".xffhx."
- /* 3 */ ".xfffx."
- /* 4 */ ".xfffx."
- /* 5 */ ".ewwwe."
- /* 6 */ ".sf.ft."
- /* 7 */ ".sf.ft."
- /* 8 */ ".sf.ft."
- /* 9 */ ".sf.ft."
- /* 10 */ ".sf.ft."
- /* 11 */ ".sffft."
- /* 12 */ ".su.vt."
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".eflfe."
- /* 2 */ ".f..hf."
- /* 3 */ ".f...f."
- /* 4 */ ".f.y.f."
- /* 5 */ ".efffe."
- /* 6 */ "..sft.."
- /* 7 */ "..sft.."
- /* 8 */ "..sft.."
- /* 9 */ "..sft.."
- /* 10 */ "..sft.."
- /* 11 */ "..sft.."
- /* 12 */ "..sft.."
-
- // Level 7
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".eflfe."
- /* 2 */ ".f..hf."
- /* 3 */ ".l...l."
- /* 4 */ ".f...f."
- /* 5 */ ".efffe."
- /* 6 */ "......."
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ "......."
- /* 11 */ "......."
- /* 12 */ "......."
-
- // Level 8
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".eflfe."
- /* 2 */ ".f..hf."
- /* 3 */ ".f...f."
- /* 4 */ ".f.z.f."
- /* 5 */ ".efffe."
- /* 6 */ "......."
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ "......."
- /* 11 */ "......."
- /* 12 */ "......."
-
- // Level 9
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".ewwwe."
- /* 2 */ ".xffhx."
- /* 3 */ ".xfffx."
- /* 4 */ ".xfffx."
- /* 5 */ ".ewwwe."
- /* 6 */ "......."
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ "......."
- /* 11 */ "......."
- /* 12 */ "......."
-
- // Level 10
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".eAAAe."
- /* 2 */ ".A...A."
- /* 3 */ ".A...A."
- /* 4 */ ".A...A."
- /* 5 */ ".eAAAe."
- /* 6 */ "......."
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ "......."
- /* 11 */ "......."
- /* 12 */ "......."
-
- // Level 11
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".e...e."
- /* 2 */ "......."
- /* 3 */ "......."
- /* 4 */ "......."
- /* 5 */ ".e...e."
- /* 6 */ "......."
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ "......."
- /* 11 */ "......."
- /* 12 */ "......."
-
- // Level 12
- /* z\x* 0123456 */
- /* 0 */ "su...vt"
- /* 1 */ "sefffet"
- /* 2 */ "sfBBBft"
- /* 3 */ "sfBBBft"
- /* 4 */ "sfBBBft"
- /* 5 */ "sefffet"
- /* 6 */ "su...vt"
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ "......."
- /* 11 */ "......."
- /* 12 */ "......."
-
- // Level 13
- /* z\x* 0123456 */
- /* 0 */ ".su.vt."
- /* 1 */ ".sffft."
- /* 2 */ ".sffft."
- /* 3 */ ".sffft."
- /* 4 */ ".sffft."
- /* 5 */ ".sffft."
- /* 6 */ ".su.vt."
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ "......."
- /* 11 */ "......."
- /* 12 */ "......."
-
- // Level 14
- /* z\x* 0123456 */
- /* 0 */ "..sft.."
- /* 1 */ "..sft.."
- /* 2 */ "..sft.."
- /* 3 */ "..sft.."
- /* 4 */ "..sft.."
- /* 5 */ "..sft.."
- /* 6 */ "..sft.."
- /* 7 */ "......."
- /* 8 */ "......."
- /* 9 */ "......."
- /* 10 */ "......."
- /* 11 */ "......."
- /* 12 */ ".......",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 20,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenChurchMid
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenGranary:
- // The data has been exported from the gallery Plains, area index 54, ID 105, created by Aloe_vera
- {
- // Size:
- 7, 7, 9, // SizeX = 7, SizeY = 7, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 7, 6, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b:170: 0\n" /* haybale */
- "c: 67: 0\n" /* stairs */
- "d: 67: 2\n" /* stairs */
- "e: 67: 1\n" /* stairs */
- "f: 17: 0\n" /* tree */
- "g: 5: 0\n" /* wood */
- "h:170: 4\n" /* haybale */
- "i:170: 8\n" /* haybale */
- "j: 54: 2\n" /* chest */
- "k: 50: 4\n" /* torch */
- "l: 53: 0\n" /* woodstairs */
- "m: 19: 0\n" /* sponge */
- "n: 53: 5\n" /* woodstairs */
- "o: 53: 4\n" /* woodstairs */
- "p: 53: 1\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "maaaaam"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "maaaaam"
- /* 6 */ "maaaaam"
- /* 7 */ "maaaaam"
- /* 8 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "bcddde."
- /* 1 */ ".aaaaa."
- /* 2 */ ".aaaaa."
- /* 3 */ ".aaaaa."
- /* 4 */ ".aaaaa."
- /* 5 */ ".aaaaa."
- /* 6 */ ".aaaaa."
- /* 7 */ ".aaaaa."
- /* 8 */ "......."
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".f..bf."
- /* 2 */ ".g...g."
- /* 3 */ ".gb.hg."
- /* 4 */ ".fihif."
- /* 5 */ ".gbbbg."
- /* 6 */ ".gijbg."
- /* 7 */ ".fgfgf."
- /* 8 */ "......."
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ ".k...k."
- /* 1 */ ".f...f."
- /* 2 */ ".g...g."
- /* 3 */ ".g...g."
- /* 4 */ ".fh..f."
- /* 5 */ ".ghibg."
- /* 6 */ ".ghiig."
- /* 7 */ ".fgfgf."
- /* 8 */ "......."
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "ln...op"
- /* 1 */ "lgggggp"
- /* 2 */ "lg...gp"
- /* 3 */ "lg...gp"
- /* 4 */ "lg...gp"
- /* 5 */ "lgbb.gp"
- /* 6 */ "lgibigp"
- /* 7 */ "lgggggp"
- /* 8 */ "ln...op"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ ".ln.op."
- /* 1 */ ".lgggp."
- /* 2 */ ".lg.gp."
- /* 3 */ ".lg.gp."
- /* 4 */ ".lg.gp."
- /* 5 */ ".lg.gp."
- /* 6 */ ".lg.gp."
- /* 7 */ ".lgggp."
- /* 8 */ ".ln.op."
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "..lgp.."
- /* 1 */ "..lgp.."
- /* 2 */ "..lgp.."
- /* 3 */ "..lgp.."
- /* 4 */ "..lgp.."
- /* 5 */ "..lgp.."
- /* 6 */ "..lgp.."
- /* 7 */ "..lgp.."
- /* 8 */ "..lgp..",
-
- // Connectors:
- "-1: 3, 1, -1: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 20,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenGranary
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouse10x7Library:
- // The data has been exported from the gallery Plains, area index 47, ID 98, created by Aloe_vera
- {
- // Size:
- 12, 8, 9, // SizeX = 12, SizeY = 8, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 12, 7, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 64: 7\n" /* wooddoorblock */
- "h: 64: 5\n" /* wooddoorblock */
- "i: 53: 3\n" /* woodstairs */
- "j: 85: 0\n" /* fence */
- "k: 53: 2\n" /* woodstairs */
- "l: 53: 1\n" /* woodstairs */
- "m: 19: 0\n" /* sponge */
- "n: 53: 0\n" /* woodstairs */
- "o:102: 0\n" /* glasspane */
- "p: 64:12\n" /* wooddoorblock */
- "q: 50: 3\n" /* torch */
- "r: 72: 0\n" /* woodplate */
- "s: 53: 7\n" /* woodstairs */
- "t: 47: 0\n" /* bookshelf */
- "u: 50: 1\n" /* torch */
- "v: 50: 2\n" /* torch */
- "w: 53: 6\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "mmmmaaaammmm"
- /* 1 */ "maaaaaaaaaam"
- /* 2 */ "maaaaaaaaaam"
- /* 3 */ "maaaaaaaaaam"
- /* 4 */ "maaaaaaaaaam"
- /* 5 */ "maaaaaaaaaam"
- /* 6 */ "maaaaaaaaaam"
- /* 7 */ "maaaaaaaaaam"
- /* 8 */ "mmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "....bccd...."
- /* 1 */ ".aaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaa."
- /* 6 */ ".aaaaaaaaaa."
- /* 7 */ ".aaaaaaaaaa."
- /* 8 */ "............"
-
- // Level 2
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ ".efffghfffe."
- /* 2 */ ".f........f."
- /* 3 */ ".fi......if."
- /* 4 */ ".fj......jf."
- /* 5 */ ".fk......kf."
- /* 6 */ ".f.ljnljn.f."
- /* 7 */ ".effffffffe."
- /* 8 */ "............"
-
- // Level 3
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ ".eoofppfooe."
- /* 2 */ ".o..q..q..o."
- /* 3 */ ".o........o."
- /* 4 */ ".fr......rf."
- /* 5 */ ".o........o."
- /* 6 */ ".o..r..r..o."
- /* 7 */ ".eoofoofooe."
- /* 8 */ "............"
-
- // Level 4
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "kkkkkkkkkkkk"
- /* 1 */ "sffffffffffs"
- /* 2 */ ".fttttttttf."
- /* 3 */ ".f........f."
- /* 4 */ ".fu......vf."
- /* 5 */ ".f........f."
- /* 6 */ ".fttttttttf."
- /* 7 */ "wffffffffffw"
- /* 8 */ "iiiiiiiiiiii"
-
- // Level 5
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "kkkkkkkkkkkk"
- /* 2 */ "sffffffffffs"
- /* 3 */ ".fttttttttf."
- /* 4 */ ".f........f."
- /* 5 */ ".fttttttttf."
- /* 6 */ "wffffffffffw"
- /* 7 */ "iiiiiiiiiiii"
- /* 8 */ "............"
-
- // Level 6
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "kkkkkkkkkkkk"
- /* 3 */ "sffffffffffs"
- /* 4 */ ".f........f."
- /* 5 */ "wffffffffffw"
- /* 6 */ "iiiiiiiiiiii"
- /* 7 */ "............"
- /* 8 */ "............"
-
- // Level 7
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ "............"
- /* 2 */ "............"
- /* 3 */ "kkkkkkkkkkkk"
- /* 4 */ "ffffffffffff"
- /* 5 */ "iiiiiiiiiiii"
- /* 6 */ "............"
- /* 7 */ "............"
- /* 8 */ "............",
-
- // Connectors:
- "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouse10x7Library
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouse5x5:
- // The data has been exported from the gallery Plains, area index 49, ID 100, created by Aloe_vera
- {
- // Size:
- 7, 7, 7, // SizeX = 7, SizeY = 7, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 7, 6, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 64: 3\n" /* wooddoorblock */
- "h: 64: 8\n" /* wooddoorblock */
- "i:102: 0\n" /* glasspane */
- "j: 53: 2\n" /* woodstairs */
- "k: 53: 7\n" /* woodstairs */
- "l: 50: 3\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n: 53: 6\n" /* woodstairs */
- "o: 53: 3\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mmaaamm"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "maaaaam"
- /* 6 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "..bcd.."
- /* 1 */ ".aaaaa."
- /* 2 */ ".aaaaa."
- /* 3 */ ".aaaaa."
- /* 4 */ ".aaaaa."
- /* 5 */ ".aaaaa."
- /* 6 */ "......."
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".efgfe."
- /* 2 */ ".f...f."
- /* 3 */ ".f...f."
- /* 4 */ ".f...f."
- /* 5 */ ".efffe."
- /* 6 */ "......."
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".efhfe."
- /* 2 */ ".i...i."
- /* 3 */ ".i...i."
- /* 4 */ ".i...i."
- /* 5 */ ".eiiie."
- /* 6 */ "......."
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "jjjjjjj"
- /* 1 */ "kfffffk"
- /* 2 */ ".fl.lf."
- /* 3 */ ".f...f."
- /* 4 */ ".f...f."
- /* 5 */ "nfffffn"
- /* 6 */ "ooooooo"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "jjjjjjj"
- /* 2 */ "kfffffk"
- /* 3 */ ".f...f."
- /* 4 */ "nfffffn"
- /* 5 */ "ooooooo"
- /* 6 */ "......."
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "......."
- /* 2 */ "jjjjjjj"
- /* 3 */ "fffffff"
- /* 4 */ "ooooooo"
- /* 5 */ "......."
- /* 6 */ ".......",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouse5x5
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouse7x5:
- // The data has been exported from the gallery Plains, area index 40, ID 91, created by xoft
- {
- // Size:
- 9, 7, 7, // SizeX = 9, SizeY = 7, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 9, 6, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 64: 7\n" /* wooddoorblock */
- "h:102: 0\n" /* glasspane */
- "i: 64:12\n" /* wooddoorblock */
- "j: 53: 2\n" /* woodstairs */
- "k: 53: 7\n" /* woodstairs */
- "l: 50: 3\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n: 53: 6\n" /* woodstairs */
- "o: 53: 3\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "mmmaaammm"
- /* 1 */ "maaaaaaam"
- /* 2 */ "maaaaaaam"
- /* 3 */ "maaaaaaam"
- /* 4 */ "maaaaaaam"
- /* 5 */ "maaaaaaam"
- /* 6 */ "mmmmmmmmm"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "...bcd..."
- /* 1 */ ".aaaaaaa."
- /* 2 */ ".aaaaaaa."
- /* 3 */ ".aaaaaaa."
- /* 4 */ ".aaaaaaa."
- /* 5 */ ".aaaaaaa."
- /* 6 */ "........."
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ ".effgffe."
- /* 2 */ ".f.....f."
- /* 3 */ ".f.....f."
- /* 4 */ ".f.....f."
- /* 5 */ ".efffffe."
- /* 6 */ "........."
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ ".ehfifhe."
- /* 2 */ ".h.....h."
- /* 3 */ ".h.....h."
- /* 4 */ ".h.....h."
- /* 5 */ ".ehhfhhe."
- /* 6 */ "........."
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "jjjjjjjjj"
- /* 1 */ "kefffffek"
- /* 2 */ ".f.l.l.f."
- /* 3 */ ".f.....f."
- /* 4 */ ".f.....f."
- /* 5 */ "nefffffen"
- /* 6 */ "ooooooooo"
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ "jjjjjjjjj"
- /* 2 */ "kfffffffk"
- /* 3 */ ".f.....f."
- /* 4 */ "nfffffffn"
- /* 5 */ "ooooooooo"
- /* 6 */ "........."
-
- // Level 6
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ "........."
- /* 2 */ "jjjjjjjjj"
- /* 3 */ "fffffffff"
- /* 4 */ "ooooooooo"
- /* 5 */ "........."
- /* 6 */ ".........",
-
- // Connectors:
- "-1: 4, 1, -1: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouse7x5
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouse9x5:
- // The data has been exported from the gallery Plains, area index 41, ID 92, created by xoft
- {
- // Size:
- 11, 7, 7, // SizeX = 11, SizeY = 7, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 11, 6, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 64: 3\n" /* wooddoorblock */
- "h:102: 0\n" /* glasspane */
- "i: 64: 8\n" /* wooddoorblock */
- "j: 53: 2\n" /* woodstairs */
- "k: 53: 7\n" /* woodstairs */
- "l: 50: 3\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n: 53: 6\n" /* woodstairs */
- "o: 53: 3\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmaaammmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "....bcd...."
- /* 1 */ ".aaaaaaaaa."
- /* 2 */ ".aaaaaaaaa."
- /* 3 */ ".aaaaaaaaa."
- /* 4 */ ".aaaaaaaaa."
- /* 5 */ ".aaaaaaaaa."
- /* 6 */ "..........."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".efffgfffe."
- /* 2 */ ".f.......f."
- /* 3 */ ".f.......f."
- /* 4 */ ".f.......f."
- /* 5 */ ".efffffffe."
- /* 6 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".ehhfifhhe."
- /* 2 */ ".h.......h."
- /* 3 */ ".h.......h."
- /* 4 */ ".h.......h."
- /* 5 */ ".ehhhfhhhe."
- /* 6 */ "..........."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "jjjjjjjjjjj"
- /* 1 */ "kfffffffffk"
- /* 2 */ ".f..l.l.ff."
- /* 3 */ ".f......ff."
- /* 4 */ ".f......ff."
- /* 5 */ "nfffffffffn"
- /* 6 */ "ooooooooooo"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "jjjjjjjjjjj"
- /* 2 */ "kfffffffffk"
- /* 3 */ ".fffffffff."
- /* 4 */ "nfffffffffn"
- /* 5 */ "ooooooooooo"
- /* 6 */ "..........."
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "jjjjjjjjjjj"
- /* 3 */ "fffffffffff"
- /* 4 */ "ooooooooooo"
- /* 5 */ "..........."
- /* 6 */ "...........",
-
- // Connectors:
- "-1: 5, 1, -1: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouse9x5
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouse9x5Fence:
- // The data has been exported from the gallery Plains, area index 9, ID 26, created by Aloe_vera
- {
- // Size:
- 10, 7, 11, // SizeX = 10, SizeY = 7, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- 0, -1, -1, // MinX, MinY, MinZ
- 10, 6, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 3: 0\n" /* dirt */
- "c: 5: 0\n" /* wood */
- "d: 2: 0\n" /* grass */
- "e: 67: 2\n" /* stairs */
- "f: 43: 0\n" /* doubleslab */
- "g: 67: 0\n" /* stairs */
- "h: 67: 3\n" /* stairs */
- "i: 17: 0\n" /* tree */
- "j: 53: 1\n" /* woodstairs */
- "k: 85: 0\n" /* fence */
- "l: 53: 0\n" /* woodstairs */
- "m: 19: 0\n" /* sponge */
- "n: 64: 2\n" /* wooddoorblock */
- "o: 64: 4\n" /* wooddoorblock */
- "p:102: 0\n" /* glasspane */
- "q: 72: 0\n" /* woodplate */
- "r: 64: 8\n" /* wooddoorblock */
- "s: 64:12\n" /* wooddoorblock */
- "t: 53: 5\n" /* woodstairs */
- "u: 53: 4\n" /* woodstairs */
- "v: 50: 1\n" /* torch */
- "w: 50: 2\n" /* torch */,
-
- // Block data:
- // Level 0
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "mmmmmmmmmm"
- /* 1 */ "maaaaammmm"
- /* 2 */ "maaaaammmm"
- /* 3 */ "maaaaabbbb"
- /* 4 */ "aaaaaabbbb"
- /* 5 */ "aaaaaabbbb"
- /* 6 */ "aaaaaabbbb"
- /* 7 */ "maaaaabbbb"
- /* 8 */ "maaaaabbbb"
- /* 9 */ "maaaaammmm"
- /* 10 */ "mmmmmmmmmm"
-
- // Level 1
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "......mmmm"
- /* 1 */ ".aaaaammmm"
- /* 2 */ ".acccammmm"
- /* 3 */ ".acccadddd"
- /* 4 */ "eafffadddd"
- /* 5 */ "gaffffdddd"
- /* 6 */ "hafffadddd"
- /* 7 */ ".afffadddd"
- /* 8 */ ".afffadddd"
- /* 9 */ ".aaaaammmm"
- /* 10 */ "......mmmm"
-
- // Level 2
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "......mmmm"
- /* 1 */ ".icccimmmm"
- /* 2 */ ".cjklcmmmm"
- /* 3 */ ".c...ckkkk"
- /* 4 */ ".c...c...k"
- /* 5 */ ".n...o...k"
- /* 6 */ ".c...c...k"
- /* 7 */ ".cff.c...k"
- /* 8 */ ".c...ckkkk"
- /* 9 */ ".icccimmmm"
- /* 10 */ "......mmmm"
-
- // Level 3
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "......mmmm"
- /* 1 */ ".ipppimmmm"
- /* 2 */ ".p.q.pmmmm"
- /* 3 */ ".p...p...."
- /* 4 */ ".c...c...."
- /* 5 */ ".r...s...."
- /* 6 */ ".c...c...."
- /* 7 */ ".p...p...."
- /* 8 */ ".p...p...."
- /* 9 */ ".ipppimmmm"
- /* 10 */ "......mmmm"
-
- // Level 4
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "lt...ujmmm"
- /* 1 */ "licccijmmm"
- /* 2 */ "lc...cjmmm"
- /* 3 */ "lc...cj..."
- /* 4 */ "lcv.wcj..."
- /* 5 */ "lc...cj..."
- /* 6 */ "lcv.wcj..."
- /* 7 */ "lc...cj..."
- /* 8 */ "lc...cj..."
- /* 9 */ "licccijmmm"
- /* 10 */ "lt...ujmmm"
-
- // Level 5
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".lt.uj.mmm"
- /* 1 */ ".lcccj.mmm"
- /* 2 */ ".lc.cj.mmm"
- /* 3 */ ".lc.cj...."
- /* 4 */ ".lc.cj...."
- /* 5 */ ".lc.cj...."
- /* 6 */ ".lc.cj...."
- /* 7 */ ".lc.cj...."
- /* 8 */ ".lc.cj...."
- /* 9 */ ".lcccj.mmm"
- /* 10 */ ".lt.uj.mmm"
-
- // Level 6
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "..lcj..mmm"
- /* 1 */ "..lcj..mmm"
- /* 2 */ "..lcj..mmm"
- /* 3 */ "..lcj....."
- /* 4 */ "..lcj....."
- /* 5 */ "..lcj....."
- /* 6 */ "..lcj....."
- /* 7 */ "..lcj....."
- /* 8 */ "..lcj....."
- /* 9 */ "..lcj..mmm"
- /* 10 */ "..lcj..mmm",
-
- // Connectors:
- "-1: 0, 1, 5: 4\n" /* Type -1, direction X- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouse9x5Fence
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouse9x5Library:
- // The data has been exported from the gallery Plains, area index 46, ID 97, created by Aloe_vera
- {
- // Size:
- 11, 7, 7, // SizeX = 11, SizeY = 7, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 11, 6, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 64: 7\n" /* wooddoorblock */
- "h: 53: 3\n" /* woodstairs */
- "i: 85: 0\n" /* fence */
- "j: 53: 2\n" /* woodstairs */
- "k: 53: 1\n" /* woodstairs */
- "l: 53: 0\n" /* woodstairs */
- "m: 19: 0\n" /* sponge */
- "n:102: 0\n" /* glasspane */
- "o: 64:12\n" /* wooddoorblock */
- "p: 50: 3\n" /* torch */
- "q: 72: 0\n" /* woodplate */
- "r: 53: 7\n" /* woodstairs */
- "s: 47: 0\n" /* bookshelf */
- "t: 50: 1\n" /* torch */
- "u: 50: 2\n" /* torch */
- "v: 53: 6\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmaaammmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "....bcd...."
- /* 1 */ ".aaaaaaaaa."
- /* 2 */ ".aaaaaaaaa."
- /* 3 */ ".aaaaaaaaa."
- /* 4 */ ".aaaaaaaaa."
- /* 5 */ ".aaaaaaaaa."
- /* 6 */ "..........."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".efffgfffe."
- /* 2 */ ".fh.....hf."
- /* 3 */ ".fi.....if."
- /* 4 */ ".fj.kil.jf."
- /* 5 */ ".efffffffe."
- /* 6 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".ennfofnne."
- /* 2 */ ".n..p.p..n."
- /* 3 */ ".nq.....qn."
- /* 4 */ ".n...q...n."
- /* 5 */ ".ennnfnnne."
- /* 6 */ "..........."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "jjjjjjjjjjj"
- /* 1 */ "rfffffffffr"
- /* 2 */ ".fsssssssf."
- /* 3 */ ".ft.....uf."
- /* 4 */ ".fsssssssf."
- /* 5 */ "vfffffffffv"
- /* 6 */ "hhhhhhhhhhh"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "jjjjjjjjjjj"
- /* 2 */ "rfffffffffr"
- /* 3 */ ".f.......f."
- /* 4 */ "vfffffffffv"
- /* 5 */ "hhhhhhhhhhh"
- /* 6 */ "..........."
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "jjjjjjjjjjj"
- /* 3 */ "fffffffffff"
- /* 4 */ "hhhhhhhhhhh"
- /* 5 */ "..........."
- /* 6 */ "...........",
-
- // Connectors:
- "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouse9x5Library
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouse9x7:
- // The data has been exported from the gallery Plains, area index 52, ID 103, created by Aloe_vera
- {
- // Size:
- 11, 8, 9, // SizeX = 11, SizeY = 8, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 11, 7, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 64: 7\n" /* wooddoorblock */
- "h:102: 0\n" /* glasspane */
- "i: 64:12\n" /* wooddoorblock */
- "j: 53: 2\n" /* woodstairs */
- "k: 53: 7\n" /* woodstairs */
- "l: 50: 3\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n: 50: 4\n" /* torch */
- "o: 53: 6\n" /* woodstairs */
- "p: 53: 3\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmaaammmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "maaaaaaaaam"
- /* 7 */ "maaaaaaaaam"
- /* 8 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "....bcd...."
- /* 1 */ ".aaaaaaaaa."
- /* 2 */ ".aaaaaaaaa."
- /* 3 */ ".aaaaaaaaa."
- /* 4 */ ".aaaaaaaaa."
- /* 5 */ ".aaaaaaaaa."
- /* 6 */ ".aaaaaaaaa."
- /* 7 */ ".aaaaaaaaa."
- /* 8 */ "..........."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".efffgfffe."
- /* 2 */ ".f.......f."
- /* 3 */ ".f.......f."
- /* 4 */ ".f.......f."
- /* 5 */ ".f.......f."
- /* 6 */ ".f.......f."
- /* 7 */ ".efffffffe."
- /* 8 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".ehhfifhhe."
- /* 2 */ ".h.......h."
- /* 3 */ ".h.......h."
- /* 4 */ ".f.......f."
- /* 5 */ ".h.......h."
- /* 6 */ ".h.......h."
- /* 7 */ ".ehhhfhhhe."
- /* 8 */ "..........."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "jjjjjjjjjjj"
- /* 1 */ "kfffffffffk"
- /* 2 */ ".f..l.l..f."
- /* 3 */ ".f.......f."
- /* 4 */ ".f.......f."
- /* 5 */ ".f.......f."
- /* 6 */ ".f...n...f."
- /* 7 */ "offfffffffo"
- /* 8 */ "ppppppppppp"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "jjjjjjjjjjj"
- /* 2 */ "kfffffffffk"
- /* 3 */ ".f.......f."
- /* 4 */ ".f.......f."
- /* 5 */ ".f.......f."
- /* 6 */ "offfffffffo"
- /* 7 */ "ppppppppppp"
- /* 8 */ "..........."
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "jjjjjjjjjjj"
- /* 3 */ "kfffffffffk"
- /* 4 */ ".f.......f."
- /* 5 */ "offfffffffo"
- /* 6 */ "ppppppppppp"
- /* 7 */ "..........."
- /* 8 */ "..........."
-
- // Level 7
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "jjjjjjjjjjj"
- /* 4 */ "fffffffffff"
- /* 5 */ "ppppppppppp"
- /* 6 */ "..........."
- /* 7 */ "..........."
- /* 8 */ "...........",
-
- // Connectors:
- "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouse9x7
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouse9x7Butcher:
- // The data has been exported from the gallery Plains, area index 48, ID 99, created by Aloe_vera
- {
- // Size:
- 11, 9, 13, // SizeX = 11, SizeY = 9, SizeZ = 13
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 8, 13, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 3: 0\n" /* dirt */
- "b: 2: 0\n" /* grass */
- "c: 4: 0\n" /* cobblestone */
- "d: 67: 0\n" /* stairs */
- "e: 67: 2\n" /* stairs */
- "f: 67: 1\n" /* stairs */
- "g: 43: 0\n" /* doubleslab */
- "h: 17: 0\n" /* tree */
- "i: 5: 0\n" /* wood */
- "j: 64: 7\n" /* wooddoorblock */
- "k: 53: 3\n" /* woodstairs */
- "l: 85: 0\n" /* fence */
- "m: 19: 0\n" /* sponge */
- "n: 53: 2\n" /* woodstairs */
- "o:102: 0\n" /* glasspane */
- "p: 64:12\n" /* wooddoorblock */
- "q: 72: 0\n" /* woodplate */
- "r: 53: 7\n" /* woodstairs */
- "s: 50: 1\n" /* torch */
- "t: 50: 2\n" /* torch */
- "u: 53: 6\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "aaaaaaaaaaa"
- /* 1 */ "aaaaaaaaaaa"
- /* 2 */ "aaaaaaaaaaa"
- /* 3 */ "aaaaaaaaaaa"
- /* 4 */ "aaaaaaaaaab"
- /* 5 */ "baaaaaaaaab"
- /* 6 */ "aaaaaaaaaaa"
- /* 7 */ "baaaaaaaaaa"
- /* 8 */ "baaaaaaaaaa"
- /* 9 */ "baaaaaaaaab"
- /* 10 */ "aaaaaaaaaaa"
- /* 11 */ "aaaaaaaaaba"
- /* 12 */ "aaaaaaaaaba"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmcccmmmm"
- /* 1 */ "mcccccccccm"
- /* 2 */ "mcccccccccm"
- /* 3 */ "mcccccccccm"
- /* 4 */ "mcccccccccm"
- /* 5 */ "mcccccccccm"
- /* 6 */ "mcccccccccm"
- /* 7 */ "mcccccccccm"
- /* 8 */ "mmaaaaaaamm"
- /* 9 */ "mmaaaaaaamm"
- /* 10 */ "mmaaaaaaamm"
- /* 11 */ "mmaaaaaaamm"
- /* 12 */ "mmaaaaaaamm"
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "....def...."
- /* 1 */ ".ccccccccc."
- /* 2 */ ".cggggcccc."
- /* 3 */ ".cggggcccc."
- /* 4 */ ".cggggcccc."
- /* 5 */ ".cggggcccc."
- /* 6 */ ".cggggcccc."
- /* 7 */ ".ccccccccc."
- /* 8 */ "..bbbbbbb.."
- /* 9 */ "mmbbbbbbbmm"
- /* 10 */ "mmbbbbbbbmm"
- /* 11 */ "mmbbbbbbbmm"
- /* 12 */ "mmbbbbbbbmm"
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".hiiijiiih."
- /* 2 */ ".i.g....ki."
- /* 3 */ ".i.g....li."
- /* 4 */ ".i.g....ni."
- /* 5 */ ".i.......i."
- /* 6 */ ".i.......i."
- /* 7 */ ".hiiijiiih."
- /* 8 */ "..l.....l.."
- /* 9 */ "mml.....lmm"
- /* 10 */ "mml.....lmm"
- /* 11 */ "mml.....lmm"
- /* 12 */ "mmlllllllmm"
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".hooipiooh."
- /* 2 */ ".o.......o."
- /* 3 */ ".o......qo."
- /* 4 */ ".i.......i."
- /* 5 */ ".o.......o."
- /* 6 */ ".o.......o."
- /* 7 */ ".hooipiooh."
- /* 8 */ "..........."
- /* 9 */ "mm.......mm"
- /* 10 */ "mm.......mm"
- /* 11 */ "mm.......mm"
- /* 12 */ "mm.......mm"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "nnnnnnnnnnn"
- /* 1 */ "riiiiiiiiir"
- /* 2 */ ".i.......i."
- /* 3 */ ".i.......i."
- /* 4 */ ".is.....ti."
- /* 5 */ ".i.......i."
- /* 6 */ ".i.......i."
- /* 7 */ "uiiiiiiiiiu"
- /* 8 */ "kkkkkkkkkkk"
- /* 9 */ "mm.......mm"
- /* 10 */ "mm.......mm"
- /* 11 */ "mm.......mm"
- /* 12 */ "mm.......mm"
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "nnnnnnnnnnn"
- /* 2 */ "riiiiiiiiir"
- /* 3 */ ".i.......i."
- /* 4 */ ".i.......i."
- /* 5 */ ".i.......i."
- /* 6 */ "uiiiiiiiiiu"
- /* 7 */ "kkkkkkkkkkk"
- /* 8 */ "..........."
- /* 9 */ "mm.......mm"
- /* 10 */ "mm.......mm"
- /* 11 */ "mm.......mm"
- /* 12 */ "mm.......mm"
-
- // Level 7
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "nnnnnnnnnnn"
- /* 3 */ "riiiiiiiiir"
- /* 4 */ ".i.......i."
- /* 5 */ "uiiiiiiiiiu"
- /* 6 */ "kkkkkkkkkkk"
- /* 7 */ "..........."
- /* 8 */ "..........."
- /* 9 */ "mm.......mm"
- /* 10 */ "mm.......mm"
- /* 11 */ "mm.......mm"
- /* 12 */ "mm.......mm"
-
- // Level 8
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "nnnnnnnnnnn"
- /* 4 */ "iiiiiiiiiii"
- /* 5 */ "kkkkkkkkkkk"
- /* 6 */ "..........."
- /* 7 */ "..........."
- /* 8 */ "..........."
- /* 9 */ "mm.......mm"
- /* 10 */ "mm.......mm"
- /* 11 */ "mm.......mm"
- /* 12 */ "mm.......mm",
-
- // Connectors:
- "-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouse9x7Butcher
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouse9x7DoubleDoor:
- // The data has been exported from the gallery Plains, area index 38, ID 87, created by Aloe_vera
- {
- // Size:
- 11, 8, 9, // SizeX = 11, SizeY = 8, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 11, 7, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 67: 3\n" /* stairs */
- "f: 17: 0\n" /* tree */
- "g: 5: 0\n" /* wood */
- "h: 64: 7\n" /* wooddoorblock */
- "i:102: 0\n" /* glasspane */
- "j: 64:12\n" /* wooddoorblock */
- "k: 53: 2\n" /* woodstairs */
- "l: 53: 7\n" /* woodstairs */
- "m: 19: 0\n" /* sponge */
- "n: 17: 4\n" /* tree */
- "o: 17: 8\n" /* tree */
- "p: 50: 3\n" /* torch */
- "q: 50: 4\n" /* torch */
- "r: 53: 6\n" /* woodstairs */
- "s: 53: 3\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmaaammmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "maaaaaaaaam"
- /* 7 */ "maaaaaaaaam"
- /* 8 */ "mmmmaaammmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "....bcd...."
- /* 1 */ ".aaaaaaaaa."
- /* 2 */ ".aaaaaaaaa."
- /* 3 */ ".aaaaaaaaa."
- /* 4 */ ".aaaaaaaaa."
- /* 5 */ ".aaaaaaaaa."
- /* 6 */ ".aaaaaaaaa."
- /* 7 */ ".aaaaaaaaa."
- /* 8 */ "....bed...."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".fggfhfggf."
- /* 2 */ ".g.......g."
- /* 3 */ ".g.......g."
- /* 4 */ ".f.......f."
- /* 5 */ ".g.......g."
- /* 6 */ ".g.......g."
- /* 7 */ ".fggfhfggf."
- /* 8 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".fiifjfiif."
- /* 2 */ ".i.......i."
- /* 3 */ ".i.......i."
- /* 4 */ ".f.......f."
- /* 5 */ ".i.......i."
- /* 6 */ ".i.......i."
- /* 7 */ ".fiifjfiif."
- /* 8 */ "..........."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "kkkkkkkkkkk"
- /* 1 */ "lfnnnnnnnfl"
- /* 2 */ ".o..p.p..o."
- /* 3 */ ".o.......o."
- /* 4 */ ".o.......o."
- /* 5 */ ".o.......o."
- /* 6 */ ".o..q.q..o."
- /* 7 */ "rfnnnnnnnfr"
- /* 8 */ "sssssssssss"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "kkkkkkkkkkk"
- /* 2 */ "lgggggggggl"
- /* 3 */ ".g.......g."
- /* 4 */ ".g.......g."
- /* 5 */ ".g.......g."
- /* 6 */ "rgggggggggr"
- /* 7 */ "sssssssssss"
- /* 8 */ "..........."
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "kkkkkkkkkkk"
- /* 3 */ "lgggggggggl"
- /* 4 */ ".g.......g."
- /* 5 */ "rgggggggggr"
- /* 6 */ "sssssssssss"
- /* 7 */ "..........."
- /* 8 */ "..........."
-
- // Level 7
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "kkkkkkkkkkk"
- /* 4 */ "ggggggggggg"
- /* 5 */ "sssssssssss"
- /* 6 */ "..........."
- /* 7 */ "..........."
- /* 8 */ "...........",
-
- // Connectors:
- "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouse9x7DoubleDoor
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouseL13x14:
- // The data has been exported from the gallery Plains, area index 39, ID 90, created by STR_Warrior
- {
- // Size:
- 15, 9, 16, // SizeX = 15, SizeY = 9, SizeZ = 16
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 15, 8, 16, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "A: 53: 7\n" /* woodstairs */
- "B: 53: 4\n" /* woodstairs */
- "C: 53: 5\n" /* woodstairs */
- "D: 53: 6\n" /* woodstairs */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 43: 0\n" /* doubleslab */
- "f: 17: 0\n" /* tree */
- "g: 5: 0\n" /* wood */
- "h: 64: 7\n" /* wooddoorblock */
- "i: 96: 8\n" /* trapdoor */
- "j: 61: 2\n" /* furnace */
- "k: 53: 3\n" /* woodstairs */
- "l: 85: 0\n" /* fence */
- "m: 19: 0\n" /* sponge */
- "n: 53: 2\n" /* woodstairs */
- "o: 53: 1\n" /* woodstairs */
- "p: 53: 0\n" /* woodstairs */
- "q: 47: 0\n" /* bookshelf */
- "r:102: 0\n" /* glasspane */
- "s: 64:12\n" /* wooddoorblock */
- "t: 72: 0\n" /* woodplate */
- "u: 17: 4\n" /* tree */
- "v: 17: 8\n" /* tree */
- "w: 50: 3\n" /* torch */
- "x: 50: 1\n" /* torch */
- "y: 50: 4\n" /* torch */
- "z: 50: 2\n" /* torch */,
-
- // Block data:
- // Level 0
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmmmmaaammmmmm"
- /* 1 */ "maaaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaaaaam"
- /* 7 */ "maaaaaaaaaaaaam"
- /* 8 */ "mmmmmmmmaaaaaam"
- /* 9 */ "mmmmmmmmaaaaaam"
- /* 10 */ "mmmmmmmmaaaaaam"
- /* 11 */ "mmmmmmmmaaaaaam"
- /* 12 */ "mmmmmmmmaaaaaam"
- /* 13 */ "mmmmmmmmaaaaaam"
- /* 14 */ "mmmmmmmmaaaaaam"
- /* 15 */ "mmmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "......bcd......"
- /* 1 */ ".aaaaaaaaaaaaa."
- /* 2 */ ".aeeeeaaaaaaaa."
- /* 3 */ ".aeeeeaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaaaa."
- /* 6 */ ".aaaaaaaaaaaaa."
- /* 7 */ ".aaaaaaaaaaaaa."
- /* 8 */ "........aaaaaa."
- /* 9 */ "mmmmmmm.aaaaaa."
- /* 10 */ "mmmmmmm.aaaaaa."
- /* 11 */ "mmmmmmm.aaaaaa."
- /* 12 */ "mmmmmmm.aaaaaa."
- /* 13 */ "mmmmmmm.aaaaaa."
- /* 14 */ "mmmmmmm.aaaaaa."
- /* 15 */ "mmmmmmm........"
-
- // Level 2
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".fggggfhfggggf."
- /* 2 */ ".g...i.......g."
- /* 3 */ ".gjeee......kg."
- /* 4 */ ".f..........lg."
- /* 5 */ ".g..........ng."
- /* 6 */ ".g.olp..ol...g."
- /* 7 */ ".fggggggfn...f."
- /* 8 */ "........g....g."
- /* 9 */ "mmmmmmm.gk...g."
- /* 10 */ "mmmmmmm.gl..kg."
- /* 11 */ "mmmmmmm.gn..lg."
- /* 12 */ "mmmmmmm.g...ng."
- /* 13 */ "mmmmmmm.gq..qg."
- /* 14 */ "mmmmmmm.fggggf."
- /* 15 */ "mmmmmmm........"
-
- // Level 3
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".fgrrgfsfgrrgf."
- /* 2 */ ".g...........g."
- /* 3 */ ".g...........r."
- /* 4 */ ".f..........tr."
- /* 5 */ ".g...........r."
- /* 6 */ ".g..t....t...g."
- /* 7 */ ".fgrrrrgf....f."
- /* 8 */ "........g....g."
- /* 9 */ "mmmmmmm.r....r."
- /* 10 */ "mmmmmmm.rt...r."
- /* 11 */ "mmmmmmm.r...tr."
- /* 12 */ "mmmmmmm.r....r."
- /* 13 */ "mmmmmmm.gq..qg."
- /* 14 */ "mmmmmmm.fgrrgf."
- /* 15 */ "mmmmmmm........"
-
- // Level 4
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".fuuuuuuuuuuuf."
- /* 2 */ ".v....w.w....v."
- /* 3 */ ".v...........v."
- /* 4 */ ".vx..........v."
- /* 5 */ ".v...........v."
- /* 6 */ ".v......y....v."
- /* 7 */ ".fuuuuuufx..zv."
- /* 8 */ "........v....v."
- /* 9 */ "mmmmmmm.v....v."
- /* 10 */ "mmmmmmm.v....v."
- /* 11 */ "mmmmmmm.v....v."
- /* 12 */ "mmmmmmm.v....v."
- /* 13 */ "mmmmmmm.v.yy.v."
- /* 14 */ "mmmmmmm.fuuuuf."
- /* 15 */ "mmmmmmm........"
-
- // Level 5
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "nnnnnnnnnnnnnno"
- /* 1 */ "pgggggggggggggo"
- /* 2 */ "pgAAAAAAAAAABgo"
- /* 3 */ "pgC.........Bgo"
- /* 4 */ "pgC.........Bgo"
- /* 5 */ "pgC.........Bgo"
- /* 6 */ "pgCDDDDDDD..Bgo"
- /* 7 */ "pggggggggC..Bgo"
- /* 8 */ "pkkkkkkpgC..Bgo"
- /* 9 */ "mmmmmmmpgC..Bgo"
- /* 10 */ "mmmmmmmpgC..Bgo"
- /* 11 */ "mmmmmmmpgC..Bgo"
- /* 12 */ "mmmmmmmpgC..Bgo"
- /* 13 */ "mmmmmmmpgCDDBgo"
- /* 14 */ "mmmmmmmpggggggo"
- /* 15 */ "mmmmmmmpkkkkkkk"
-
- // Level 6
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".pnnnnnnnnnnno."
- /* 2 */ ".pgggggggggggo."
- /* 3 */ ".pgggggggggggo."
- /* 4 */ ".pgggggggggggo."
- /* 5 */ ".pgggggggggggo."
- /* 6 */ ".pgggggggggggo."
- /* 7 */ ".pkkkkkkkggggo."
- /* 8 */ "........pggggo."
- /* 9 */ "mmmmmmm.pggggo."
- /* 10 */ "mmmmmmm.pggggo."
- /* 11 */ "mmmmmmm.pggggo."
- /* 12 */ "mmmmmmm.pggggo."
- /* 13 */ "mmmmmmm.pggggo."
- /* 14 */ "mmmmmmm.kkkkko."
- /* 15 */ "mmmmmmm........"
-
- // Level 7
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..nnnnnnnnnnn.."
- /* 3 */ "..pgggggggggo.."
- /* 4 */ "..pgggggggggo.."
- /* 5 */ "..pgggggggggo.."
- /* 6 */ "..kkkkkkkkggo.."
- /* 7 */ ".........pggo.."
- /* 8 */ ".........pggo.."
- /* 9 */ "mmmmmmm..pggo.."
- /* 10 */ "mmmmmmm..pggo.."
- /* 11 */ "mmmmmmm..pggo.."
- /* 12 */ "mmmmmmm..pggo.."
- /* 13 */ "mmmmmmm..kkko.."
- /* 14 */ "mmmmmmm........"
- /* 15 */ "mmmmmmm........"
-
- // Level 8
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "...pnnnnnnno..."
- /* 4 */ "...pgggggggo..."
- /* 5 */ "...pkkkkkkpo..."
- /* 6 */ "..........po..."
- /* 7 */ "..........po..."
- /* 8 */ "..........po..."
- /* 9 */ "mmmmmmm...po..."
- /* 10 */ "mmmmmmm...po..."
- /* 11 */ "mmmmmmm...po..."
- /* 12 */ "mmmmmmm...pk..."
- /* 13 */ "mmmmmmm........"
- /* 14 */ "mmmmmmm........"
- /* 15 */ "mmmmmmm........",
-
- // Connectors:
- "-1: 7, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouseL13x14
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouseL14x14:
- // The data has been exported from the gallery Plains, area index 0, ID 4, created by Aloe_vera
- {
- // Size:
- 16, 8, 16, // SizeX = 16, SizeY = 8, SizeZ = 16
-
- // Hitbox (relative to bounding box):
- -1, 1, 0, // MinX, MinY, MinZ
- 16, 7, 16, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 5: 0\n" /* wood */
- "f: 67: 3\n" /* stairs */
- "g: 17: 0\n" /* tree */
- "h: 64: 7\n" /* wooddoorblock */
- "i: 64: 5\n" /* wooddoorblock */
- "j:102: 0\n" /* glasspane */
- "k: 64:12\n" /* wooddoorblock */
- "l: 53: 2\n" /* woodstairs */
- "m: 19: 0\n" /* sponge */
- "n: 53: 1\n" /* woodstairs */
- "o: 53: 7\n" /* woodstairs */
- "p: 53: 6\n" /* woodstairs */
- "q: 53: 3\n" /* woodstairs */
- "r: 53: 0\n" /* woodstairs */
- "s: 53: 5\n" /* woodstairs */
- "t: 53: 4\n" /* woodstairs */
- "u: 50: 3\n" /* torch */
- "v: 50: 2\n" /* torch */
- "w: 50: 4\n" /* torch */
- "x: 50: 1\n" /* torch */,
-
- // Block data:
- // Level 0
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "mmmmmmmmaaammmmm"
- /* 1 */ "maaaaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaaaaaam"
- /* 7 */ "maaaaaaaaaaaaaam"
- /* 8 */ "mmmmmaaaaaaaaaam"
- /* 9 */ "mmmmmmmmaaaaaaam"
- /* 10 */ "mmmmmmmmaaaaaaam"
- /* 11 */ "mmmmmmmmaaaaaaam"
- /* 12 */ "mmmmmmmmaaaaaaam"
- /* 13 */ "mmmmmmmmaaaaaaam"
- /* 14 */ "mmmmmmmmaaaaaaam"
- /* 15 */ "mmmmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "........bcd....."
- /* 1 */ ".aaaaaaaaaaaaaa."
- /* 2 */ ".aeeeeeeeeeeeea."
- /* 3 */ ".aeeeeeeeeeeeea."
- /* 4 */ ".aeeeeeeeeeeeea."
- /* 5 */ ".aeeeeeeeeeeeea."
- /* 6 */ ".aeeeeeeeeeeeea."
- /* 7 */ ".aaaaaaaaeeeeea."
- /* 8 */ ".....bfdaeeeeea."
- /* 9 */ "mmmm....aeeeeea."
- /* 10 */ "mmmmmmm.aeeeeea."
- /* 11 */ "mmmmmmm.aeeeeea."
- /* 12 */ "mmmmmmm.aeeeeea."
- /* 13 */ "mmmmmmm.aeeeeea."
- /* 14 */ "mmmmmmm.aaaaaaa."
- /* 15 */ "mmmmmmm........."
-
- // Level 2
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ ".geeeeeeghgeeeg."
- /* 2 */ ".e............e."
- /* 3 */ ".e............e."
- /* 4 */ ".e............e."
- /* 5 */ ".e............e."
- /* 6 */ ".e............e."
- /* 7 */ ".geeeeieg.....e."
- /* 8 */ "........e.....e."
- /* 9 */ "mmmm....e.....e."
- /* 10 */ "mmmmmmm.e.....e."
- /* 11 */ "mmmmmmm.e.....e."
- /* 12 */ "mmmmmmm.e.....e."
- /* 13 */ "mmmmmmm.e.....e."
- /* 14 */ "mmmmmmm.geeeeeg."
- /* 15 */ "mmmmmmm........."
-
- // Level 3
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ ".gejjejjgkgjjeg."
- /* 2 */ ".j............e."
- /* 3 */ ".j............j."
- /* 4 */ ".j............j."
- /* 5 */ ".j............e."
- /* 6 */ ".j............j."
- /* 7 */ ".gejjekeg.....j."
- /* 8 */ "........e.....e."
- /* 9 */ "mmmm....j.....j."
- /* 10 */ "mmmmmmm.j.....j."
- /* 11 */ "mmmmmmm.e.....e."
- /* 12 */ "mmmmmmm.j.....j."
- /* 13 */ "mmmmmmm.j.....j."
- /* 14 */ "mmmmmmm.gjjjjjg."
- /* 15 */ "mmmmmmm........."
-
- // Level 4
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "llllllllllllllln"
- /* 1 */ "ogeeeeeegegeeegn"
- /* 2 */ ".e............en"
- /* 3 */ ".e............en"
- /* 4 */ ".e............en"
- /* 5 */ ".e............en"
- /* 6 */ ".e............en"
- /* 7 */ "pgeeeeeeg.....en"
- /* 8 */ "qqqqqqqre.....en"
- /* 9 */ "mmmm...re.....en"
- /* 10 */ "mmmmmmmre.....en"
- /* 11 */ "mmmmmmmre.....en"
- /* 12 */ "mmmmmmmre.....en"
- /* 13 */ "mmmmmmmre.....en"
- /* 14 */ "mmmmmmmrgeeeeegn"
- /* 15 */ "mmmmmmmrs.....tn"
-
- // Level 5
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "lllllllllllllll."
- /* 2 */ "oeeeeeeeeeeeeen."
- /* 3 */ ".e.........u.en."
- /* 4 */ ".e..........ven."
- /* 5 */ ".e......w....en."
- /* 6 */ "peeeeeeeee...en."
- /* 7 */ "qqqqqqqqrex..en."
- /* 8 */ "........re...en."
- /* 9 */ "mmmm....re...en."
- /* 10 */ "mmmmmmm.re...en."
- /* 11 */ "mmmmmmm.re...en."
- /* 12 */ "mmmmmmm.re...en."
- /* 13 */ "mmmmmmm.re...en."
- /* 14 */ "mmmmmmm.reeeeen."
- /* 15 */ "mmmmmmm.rs...tn."
-
- // Level 6
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "llllllllllllln.."
- /* 3 */ "oeeeeeeeeeeeen.."
- /* 4 */ ".ex.........en.."
- /* 5 */ "peeeeeeeeee.en.."
- /* 6 */ "qqqqqqqqqre.en.."
- /* 7 */ ".........re.en.."
- /* 8 */ ".........re.en.."
- /* 9 */ "mmmm.....re.en.."
- /* 10 */ "mmmmmmm..re.en.."
- /* 11 */ "mmmmmmm..re.en.."
- /* 12 */ "mmmmmmm..re.en.."
- /* 13 */ "mmmmmmm..rewen.."
- /* 14 */ "mmmmmmm..reeen.."
- /* 15 */ "mmmmmmm..rs.tn.."
-
- // Level 7
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "................"
- /* 3 */ "lllllllllllll..."
- /* 4 */ "eeeeeeeeeeeen..."
- /* 5 */ "qqqqqqqqqqren..."
- /* 6 */ "..........ren..."
- /* 7 */ "..........ren..."
- /* 8 */ "..........ren..."
- /* 9 */ "mmmm......ren..."
- /* 10 */ "mmmmmmm...ren..."
- /* 11 */ "mmmmmmm...ren..."
- /* 12 */ "mmmmmmm...ren..."
- /* 13 */ "mmmmmmm...ren..."
- /* 14 */ "mmmmmmm...ren..."
- /* 15 */ "mmmmmmm...ren...",
-
- // Connectors:
- "-1: 9, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouseL14x14
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouseL9x9:
- // The data has been exported from the gallery Plains, area index 42, ID 93, created by xoft
- {
- // Size:
- 11, 7, 11, // SizeX = 11, SizeY = 7, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 11, 6, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 64: 7\n" /* wooddoorblock */
- "h:102: 0\n" /* glasspane */
- "i: 64:12\n" /* wooddoorblock */
- "j: 53: 2\n" /* woodstairs */
- "k: 53: 7\n" /* woodstairs */
- "l: 53: 1\n" /* woodstairs */
- "m: 19: 0\n" /* sponge */
- "n: 50: 3\n" /* torch */
- "o: 50: 4\n" /* torch */
- "p: 53: 6\n" /* woodstairs */
- "q: 50: 1\n" /* torch */
- "r: 50: 2\n" /* torch */
- "s: 53: 3\n" /* woodstairs */
- "t: 53: 0\n" /* woodstairs */
- "u: 53: 5\n" /* woodstairs */
- "v: 53: 4\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmaaammmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "mmmmmaaaaam"
- /* 7 */ "mmmmmaaaaam"
- /* 8 */ "mmmmmaaaaam"
- /* 9 */ "mmmmmaaaaam"
- /* 10 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "....bcd...."
- /* 1 */ ".aaaaaaaaa."
- /* 2 */ ".aaaaaaaaa."
- /* 3 */ ".aaaaaaaaa."
- /* 4 */ ".aaaaaaaaa."
- /* 5 */ ".aaaaaaaaa."
- /* 6 */ ".....aaaaa."
- /* 7 */ "mmmm.aaaaa."
- /* 8 */ "mmmm.aaaaa."
- /* 9 */ "mmmm.aaaaa."
- /* 10 */ "mmmm......."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".efffgfffe."
- /* 2 */ ".f.......f."
- /* 3 */ ".f.......f."
- /* 4 */ ".f.......f."
- /* 5 */ ".efffe...f."
- /* 6 */ ".....f...f."
- /* 7 */ "mmmm.f...f."
- /* 8 */ "mmmm.f...f."
- /* 9 */ "mmmm.efffe."
- /* 10 */ "mmmm......."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".ehhfifhhe."
- /* 2 */ ".h.......h."
- /* 3 */ ".h.......h."
- /* 4 */ ".h.......h."
- /* 5 */ ".ehhhe...f."
- /* 6 */ ".....h...h."
- /* 7 */ "mmmm.h...h."
- /* 8 */ "mmmm.h...h."
- /* 9 */ "mmmm.ehhhe."
- /* 10 */ "mmmm......."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "jjjjjjjjjjj"
- /* 1 */ "kfffffffffl"
- /* 2 */ ".f..n.n..fl"
- /* 3 */ ".f.......fl"
- /* 4 */ ".f...o...fl"
- /* 5 */ "pfffffq.rfl"
- /* 6 */ "sssssf...fl"
- /* 7 */ "mmmmtf...fl"
- /* 8 */ "mmmmtf...fl"
- /* 9 */ "mmmmtfffffl"
- /* 10 */ "mmmmtu...vl"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "jjjjjjjjjl."
- /* 2 */ "kffffffffl."
- /* 3 */ ".f......fl."
- /* 4 */ "pffffff.fl."
- /* 5 */ "ssssssf.fl."
- /* 6 */ ".....tf.fl."
- /* 7 */ "mmmm.tf.fl."
- /* 8 */ "mmmm.tf.fl."
- /* 9 */ "mmmm.tfffl."
- /* 10 */ "mmmm.tu.vl."
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "jjjjjjjjj.."
- /* 3 */ "ffffffffl.."
- /* 4 */ "sssssstfl.."
- /* 5 */ "......tfl.."
- /* 6 */ "......tfl.."
- /* 7 */ "mmmm..tfl.."
- /* 8 */ "mmmm..tfl.."
- /* 9 */ "mmmm..tfl.."
- /* 10 */ "mmmm..tfl..",
-
- // Connectors:
- "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouseL9x9
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenHouseU13x9:
- // The data has been exported from the gallery Plains, area index 43, ID 94, created by xoft
- {
- // Size:
- 15, 7, 11, // SizeX = 15, SizeY = 7, SizeZ = 11
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 15, 6, 11, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 64: 7\n" /* wooddoorblock */
- "h:102: 0\n" /* glasspane */
- "i: 64:12\n" /* wooddoorblock */
- "j: 53: 2\n" /* woodstairs */
- "k: 53: 0\n" /* woodstairs */
- "l: 53: 1\n" /* woodstairs */
- "m: 19: 0\n" /* sponge */
- "n: 50: 3\n" /* torch */
- "o: 50: 4\n" /* torch */
- "p: 50: 2\n" /* torch */
- "q: 50: 1\n" /* torch */
- "r: 53: 3\n" /* woodstairs */
- "s: 53: 5\n" /* woodstairs */
- "t: 53: 4\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmmmmaaammmmmm"
- /* 1 */ "maaaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaaaam"
- /* 6 */ "maaaaammmaaaaam"
- /* 7 */ "maaaaammmaaaaam"
- /* 8 */ "maaaaammmaaaaam"
- /* 9 */ "maaaaammmaaaaam"
- /* 10 */ "mmmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "......bcd......"
- /* 1 */ ".aaaaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaaaa."
- /* 6 */ ".aaaaa...aaaaa."
- /* 7 */ ".aaaaa...aaaaa."
- /* 8 */ ".aaaaa...aaaaa."
- /* 9 */ ".aaaaa...aaaaa."
- /* 10 */ "..............."
-
- // Level 2
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".efffffgfffffe."
- /* 2 */ ".f...........f."
- /* 3 */ ".f...........f."
- /* 4 */ ".f...........f."
- /* 5 */ ".f...efffe...f."
- /* 6 */ ".f...f...f...f."
- /* 7 */ ".f...f...f...f."
- /* 8 */ ".f...f...f...f."
- /* 9 */ ".efffe...efffe."
- /* 10 */ "..............."
-
- // Level 3
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".ehhhhfifhhhhe."
- /* 2 */ ".h...........h."
- /* 3 */ ".h...........h."
- /* 4 */ ".h...........h."
- /* 5 */ ".f...ehhhe...f."
- /* 6 */ ".h...h...h...h."
- /* 7 */ ".h...h...h...h."
- /* 8 */ ".h...h...h...h."
- /* 9 */ ".ehhhe...ehhhe."
- /* 10 */ "..............."
-
- // Level 4
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "jjjjjjjjjjjjjjj"
- /* 1 */ "kfffffffffffffl"
- /* 2 */ "kf....n.n....fl"
- /* 3 */ "kf...........fl"
- /* 4 */ "kf...o...o...fl"
- /* 5 */ "kf..pfffffq..fl"
- /* 6 */ "kf...frrrf...fl"
- /* 7 */ "kf...fl.kf...fl"
- /* 8 */ "kf...fl.kf...fl"
- /* 9 */ "kfffffl.kfffffl"
- /* 10 */ "ks...tl.ks...tl"
-
- // Level 5
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".jjjjjjjjjjjjl."
- /* 2 */ ".kfffffffffffl."
- /* 3 */ ".kfffffffffffl."
- /* 4 */ ".kfffffffffffl."
- /* 5 */ ".kffflrrrrfffl."
- /* 6 */ ".kfffl...kfffl."
- /* 7 */ ".kfffl...kfffl."
- /* 8 */ ".kfffl...kfffl."
- /* 9 */ ".kfffl...kfffl."
- /* 10 */ ".ks.tl...ks.tl."
-
- // Level 6
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..kjjjjjjjjjj.."
- /* 3 */ "..kfffffffffl.."
- /* 4 */ "..kflrrrrrkfl.."
- /* 5 */ "..kfl.....kfl.."
- /* 6 */ "..kfl.....kfl.."
- /* 7 */ "..kfl.....kfl.."
- /* 8 */ "..kfl.....kfl.."
- /* 9 */ "..kfl.....kfl.."
- /* 10 */ "..kfl.....kfl..",
-
- // Connectors:
- "-1: 7, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenHouseU13x9
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenMill5x5:
- // The data has been exported from the gallery Plains, area index 60, ID 111, created by Aloe_vera
- {
- // Size:
- 9, 17, 13, // SizeX = 9, SizeY = 17, SizeZ = 13
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 8, 16, 12, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 2\n" /* stairs */
- "c: 67: 1\n" /* stairs */
- "d: 67: 3\n" /* stairs */
- "e: 17: 0\n" /* tree */
- "f: 5: 0\n" /* wood */
- "g: 54: 4\n" /* chest */
- "h:154: 4\n" /* hopper */
- "i: 64: 4\n" /* wooddoorblock */
- "j:102: 0\n" /* glasspane */
- "k: 85: 0\n" /* fence */
- "l: 64:12\n" /* wooddoorblock */
- "m: 19: 0\n" /* sponge */
- "n: 50: 2\n" /* torch */
- "o: 35: 0\n" /* wool */
- "p: 17: 4\n" /* tree */
- "q: 17: 8\n" /* tree */
- "r: 53: 2\n" /* woodstairs */
- "s: 53: 7\n" /* woodstairs */
- "t: 53: 6\n" /* woodstairs */
- "u: 53: 3\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmmmm"
- /* 1 */ "mmmmmmmmm"
- /* 2 */ "mmmmmmmmm"
- /* 3 */ "mmmmmmmmm"
- /* 4 */ "maaaaammm"
- /* 5 */ "maaaaaamm"
- /* 6 */ "maaaaaamm"
- /* 7 */ "maaaaaamm"
- /* 8 */ "maaaaammm"
- /* 9 */ "mmmmmmmmm"
- /* 10 */ "mmmmmmmmm"
- /* 11 */ "mmmmmmmmm"
- /* 12 */ "mmmmmmmmm"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ ".aaaaa..."
- /* 5 */ ".aaaaab.."
- /* 6 */ ".aaaaac.."
- /* 7 */ ".aaaaad.."
- /* 8 */ ".aaaaa..."
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ ".efffe..."
- /* 5 */ ".f...f..."
- /* 6 */ ".fgh.i..."
- /* 7 */ ".f...f..."
- /* 8 */ ".efffe..."
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ ".ejjje..."
- /* 5 */ ".j...f..."
- /* 6 */ ".j.k.l..."
- /* 7 */ ".j...f..."
- /* 8 */ ".ejjje..."
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ ".efffe..."
- /* 5 */ ".f..nf..."
- /* 6 */ ".f.k.f..."
- /* 7 */ ".f..nf..k"
- /* 8 */ ".efffe..o"
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ ".epppe..."
- /* 5 */ ".q...q..."
- /* 6 */ ".q.k.q..."
- /* 7 */ ".q...q..k"
- /* 8 */ ".epppe..o"
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 6
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ ".efffe..."
- /* 5 */ ".f...f..."
- /* 6 */ ".f.k.f..k"
- /* 7 */ ".f...f..o"
- /* 8 */ ".efffe..o"
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 7
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ ".ejjje..."
- /* 5 */ ".j...j..."
- /* 6 */ ".j.k.j..k"
- /* 7 */ ".j...j..o"
- /* 8 */ ".ejjje..."
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 8
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.o"
- /* 1 */ "mmmmmmm.o"
- /* 2 */ "mmmmmmm.o"
- /* 3 */ "........."
- /* 4 */ ".efffe..."
- /* 5 */ ".f...f..k"
- /* 6 */ ".f.k.f..o"
- /* 7 */ ".f...f..o"
- /* 8 */ ".efffe..."
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 9
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.k"
- /* 1 */ "mmmmmmm.k"
- /* 2 */ "mmmmmmm.o"
- /* 3 */ "........o"
- /* 4 */ ".epppe..o"
- /* 5 */ ".q...q..k"
- /* 6 */ ".q.k.q..o"
- /* 7 */ ".q...q..k"
- /* 8 */ ".epppe..k"
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 10
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.k"
- /* 3 */ "rrrrrrr.k"
- /* 4 */ "sfffffs.o"
- /* 5 */ ".f...f..o"
- /* 6 */ ".f.kppppp"
- /* 7 */ ".f...f..o"
- /* 8 */ "tffffft.o"
- /* 9 */ "uuuuuuu.k"
- /* 10 */ "mmmmmmm.k"
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 11
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ "rrrrrrr.k"
- /* 5 */ "sfffffs.k"
- /* 6 */ ".f...f..o"
- /* 7 */ "tffffft.k"
- /* 8 */ "uuuuuuu.o"
- /* 9 */ "........o"
- /* 10 */ "mmmmmmm.o"
- /* 11 */ "mmmmmmm.k"
- /* 12 */ "mmmmmmm.k"
-
- // Level 12
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ "........."
- /* 5 */ "rrrrrrr.o"
- /* 6 */ "fffffff.o"
- /* 7 */ "uuuuuuu.k"
- /* 8 */ "........."
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.o"
- /* 11 */ "mmmmmmm.o"
- /* 12 */ "mmmmmmm.o"
-
- // Level 13
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ "........."
- /* 5 */ "........o"
- /* 6 */ "........k"
- /* 7 */ "........."
- /* 8 */ "........."
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 14
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ "........o"
- /* 5 */ "........o"
- /* 6 */ "........k"
- /* 7 */ "........."
- /* 8 */ "........."
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 15
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ "........o"
- /* 5 */ "........k"
- /* 6 */ "........."
- /* 7 */ "........."
- /* 8 */ "........."
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm.."
-
- // Level 16
- /* z\x* 012345678 */
- /* 0 */ "mmmmmmm.."
- /* 1 */ "mmmmmmm.."
- /* 2 */ "mmmmmmm.."
- /* 3 */ "........."
- /* 4 */ "........o"
- /* 5 */ "........k"
- /* 6 */ "........."
- /* 7 */ "........."
- /* 8 */ "........."
- /* 9 */ "........."
- /* 10 */ "mmmmmmm.."
- /* 11 */ "mmmmmmm.."
- /* 12 */ "mmmmmmm..",
-
- // Connectors:
- "-1: 8, 1, 6: 5\n" /* Type -1, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenMill5x5
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // WoodenStables:
- // The data has been exported from the gallery Plains, area index 55, ID 106, created by Aloe_vera
- {
- // Size:
- 15, 9, 9, // SizeX = 15, SizeY = 9, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, -1, 0, // MinX, MinY, MinZ
- 15, 8, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 4: 0\n" /* cobblestone */
- "b: 67: 0\n" /* stairs */
- "c: 67: 2\n" /* stairs */
- "d: 67: 1\n" /* stairs */
- "e: 3: 0\n" /* dirt */
- "f: 17: 0\n" /* tree */
- "g:107: 0\n" /* fencegate */
- "h:107: 4\n" /* fencegate */
- "i: 5: 0\n" /* wood */
- "j:107: 6\n" /* fencegate */
- "k: 85: 0\n" /* fence */
- "l:170: 0\n" /* haybale */
- "m: 19: 0\n" /* sponge */
- "n:170: 4\n" /* haybale */
- "o:170: 8\n" /* haybale */
- "p: 50: 1\n" /* torch */
- "q: 50: 2\n" /* torch */
- "r: 53: 2\n" /* woodstairs */
- "s: 53: 7\n" /* woodstairs */
- "t: 53: 6\n" /* woodstairs */
- "u: 53: 3\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "maaaaaaaaaaaaam"
- /* 1 */ "maaaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaaaaam"
- /* 7 */ "maaaaaaaaaaaaam"
- /* 8 */ "mmmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ ".bcccccccccccd."
- /* 1 */ ".aaaaaaaaaaaaa."
- /* 2 */ ".aeeeeeeeeeeea."
- /* 3 */ ".aeeeeeeeeeeea."
- /* 4 */ ".aeeeeeeeeeeea."
- /* 5 */ ".aeeeeeeeeeeea."
- /* 6 */ ".aeeeeeeeeeeea."
- /* 7 */ ".aaaaaaaaaaaaa."
- /* 8 */ "..............."
-
- // Level 2
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".fghgighgigjgf."
- /* 2 */ ".k...k...k...k."
- /* 3 */ ".k...k...k...k."
- /* 4 */ ".k...k...k...k."
- /* 5 */ ".k...k...k...k."
- /* 6 */ ".kl..k..nko..k."
- /* 7 */ ".fkkkikkkikkkf."
- /* 8 */ "..............."
-
- // Level 3
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".f...i...i...f."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ ".f...i...i...f."
- /* 8 */ "..............."
-
- // Level 4
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".fp.qip.qip.qf."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ ".f...i...i...f."
- /* 8 */ "..............."
-
- // Level 5
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "rrrrrrrrrrrrrrr"
- /* 1 */ "siiiiiiiiiiiiis"
- /* 2 */ ".i...........i."
- /* 3 */ ".i...........i."
- /* 4 */ ".i...........i."
- /* 5 */ ".i...........i."
- /* 6 */ ".i...........i."
- /* 7 */ "tiiiiiiiiiiiiit"
- /* 8 */ "uuuuuuuuuuuuuuu"
-
- // Level 6
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "rrrrrrrrrrrrrrr"
- /* 2 */ "siiiiiiiiiiiiis"
- /* 3 */ ".i...........i."
- /* 4 */ ".i...........i."
- /* 5 */ ".i...........i."
- /* 6 */ "tiiiiiiiiiiiiit"
- /* 7 */ "uuuuuuuuuuuuuuu"
- /* 8 */ "..............."
-
- // Level 7
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "rrrrrrrrrrrrrrr"
- /* 3 */ "siiiiiiiiiiiiis"
- /* 4 */ ".i...........i."
- /* 5 */ "tiiiiiiiiiiiiit"
- /* 6 */ "uuuuuuuuuuuuuuu"
- /* 7 */ "..............."
- /* 8 */ "..............."
-
- // Level 8
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "rrrrrrrrrrrrrrr"
- /* 4 */ "iiiiiiiiiiiiiii"
- /* 5 */ "uuuuuuuuuuuuuuu"
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "...............",
-
- // Connectors:
- "-1: 7, 1, -1: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // WoodenStables
-}; // g_PlainsVillagePrefabs
-
-
-
-
-
-
-const cPrefab::sDef g_PlainsVillageStartingPrefabs[] =
-{
- ////////////////////////////////////////////////////////////////////////////////
- // CobbleWell4x4:
- // The data has been exported from the gallery Plains, area index 1, ID 5, created by Aloe_vera
- {
- // Size:
- 4, 13, 4, // SizeX = 4, SizeY = 13, SizeZ = 4
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 3, 12, 3, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 1: 0\n" /* stone */
- "b: 4: 0\n" /* cobblestone */
- "c: 8: 0\n" /* water */
- "d: 85: 0\n" /* fence */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 0123 */
- /* 0 */ "aaaa"
- /* 1 */ "aaaa"
- /* 2 */ "aaaa"
- /* 3 */ "aaaa"
-
- // Level 1
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 2
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 3
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 4
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 5
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 6
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 7
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 8
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 9
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "b..b"
- /* 2 */ "b..b"
- /* 3 */ "bbbb"
-
- // Level 10
- /* z\x* 0123 */
- /* 0 */ "d..d"
- /* 1 */ "...."
- /* 2 */ "...."
- /* 3 */ "d..d"
-
- // Level 11
- /* z\x* 0123 */
- /* 0 */ "d..d"
- /* 1 */ "...."
- /* 2 */ "...."
- /* 3 */ "d..d"
-
- // Level 12
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bbbb"
- /* 2 */ "bbbb"
- /* 3 */ "bbbb",
-
- // Connectors:
- "2: 1, 9, 3: 3\n" /* Type 2, direction Z+ */
- "2: 2, 9, 0: 2\n" /* Type 2, direction Z- */
- "2: 0, 9, 1: 4\n" /* Type 2, direction X- */
- "2: 3, 9, 2: 5\n" /* Type 2, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // CobbleWell4x4
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MineEntrance:
- // The data has been exported from the gallery Plains, area index 138, ID 446, created by STR_Warrior
- {
- // Size:
- 7, 38, 7, // SizeX = 7, SizeY = 38, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 6, 37, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 5: 0\n" /* wood */
- "b: 77: 2\n" /* stonebutton */
- "c: 66: 6\n" /* tracks */
- "d: 27: 1\n" /* poweredrail */
- "e: 66: 5\n" /* tracks */
- "f: 66: 9\n" /* tracks */
- "g: 66: 2\n" /* tracks */
- "h: 50: 4\n" /* torch */
- "i: 66: 4\n" /* tracks */
- "j: 66: 8\n" /* tracks */
- "k: 66: 3\n" /* tracks */
- "l: 66: 7\n" /* tracks */
- "m: 19: 0\n" /* sponge */
- "n: 50: 2\n" /* torch */
- "o: 4: 0\n" /* cobblestone */
- "p: 2: 0\n" /* grass */
- "q: 13: 0\n" /* gravel */
- "r: 53: 2\n" /* woodstairs */
- "s: 77: 1\n" /* stonebutton */
- "t: 27: 0\n" /* poweredrail */
- "u: 53: 7\n" /* woodstairs */
- "v: 53: 6\n" /* woodstairs */
- "w: 53: 3\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "maaaaam"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "maaaaam"
- /* 6 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "mm.abam"
- /* 2 */ "mmcddam"
- /* 3 */ "mae..am"
- /* 4 */ "mmaa.mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "mm...mm"
- /* 1 */ "mm.a.mm"
- /* 2 */ "mm...mm"
- /* 3 */ "ma..aam"
- /* 4 */ "mmfgamm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "mm.h.mm"
- /* 1 */ "mm.a.mm"
- /* 2 */ "mm.aamm"
- /* 3 */ "ma..iam"
- /* 4 */ "mm..jmm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmaklmm"
- /* 3 */ "maa..am"
- /* 4 */ "mm...mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmc..mm"
- /* 3 */ "mae.nam"
- /* 4 */ "mmaa.mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm...mm"
- /* 3 */ "ma..aam"
- /* 4 */ "mmfgamm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 7
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm.aamm"
- /* 3 */ "ma..iam"
- /* 4 */ "mm..jmm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 8
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmaklmm"
- /* 3 */ "maa..am"
- /* 4 */ "mm...mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 9
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmc..mm"
- /* 3 */ "mae.nam"
- /* 4 */ "mmaa.mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 10
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm...mm"
- /* 3 */ "ma..aam"
- /* 4 */ "mmfgamm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 11
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm.aamm"
- /* 3 */ "ma..iam"
- /* 4 */ "mm..jmm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 12
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmaklmm"
- /* 3 */ "maa..am"
- /* 4 */ "mm...mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 13
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmc..mm"
- /* 3 */ "mae.nam"
- /* 4 */ "mmaa.mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 14
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm...mm"
- /* 3 */ "ma..aam"
- /* 4 */ "mmfgamm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 15
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm.aamm"
- /* 3 */ "ma..iam"
- /* 4 */ "mm..jmm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 16
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmaklmm"
- /* 3 */ "maa..am"
- /* 4 */ "mm...mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 17
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmc..mm"
- /* 3 */ "mae.nam"
- /* 4 */ "mmaa.mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 18
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm...mm"
- /* 3 */ "ma..aam"
- /* 4 */ "mmfgamm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 19
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm.aamm"
- /* 3 */ "ma..iam"
- /* 4 */ "mm..jmm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 20
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmaklmm"
- /* 3 */ "maa..am"
- /* 4 */ "mm...mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 21
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmc..mm"
- /* 3 */ "mae.nam"
- /* 4 */ "mmaa.mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 22
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm...mm"
- /* 3 */ "ma..aam"
- /* 4 */ "mmfgamm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 23
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm.aamm"
- /* 3 */ "ma..iam"
- /* 4 */ "mm..jmm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 24
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmaklmm"
- /* 3 */ "maa..am"
- /* 4 */ "mm...mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 25
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmc..mm"
- /* 3 */ "mae.nam"
- /* 4 */ "mmaa.mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 26
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm...mm"
- /* 3 */ "ma..aam"
- /* 4 */ "mmfgamm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 27
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mm.aamm"
- /* 3 */ "ma..iam"
- /* 4 */ "mm..jmm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 28
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmaklmm"
- /* 3 */ "maa..am"
- /* 4 */ "mm...mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 29
- /* z\x* 0123456 */
- /* 0 */ "mmmmmmm"
- /* 1 */ "mmmammm"
- /* 2 */ "mmc..mm"
- /* 3 */ "mae.nam"
- /* 4 */ "mmaa.mm"
- /* 5 */ "mmmammm"
- /* 6 */ "mmmmmmm"
-
- // Level 30
- /* z\x* 0123456 */
- /* 0 */ "mmooomm"
- /* 1 */ "mmmammm"
- /* 2 */ "om...mo"
- /* 3 */ "oa..aao"
- /* 4 */ "omfgamo"
- /* 5 */ "mmmammm"
- /* 6 */ "mmooomm"
-
- // Level 31
- /* z\x* 0123456 */
- /* 0 */ "ppqqqpp"
- /* 1 */ "paaaaap"
- /* 2 */ "qa.aaaq"
- /* 3 */ "qa..iaq"
- /* 4 */ "qa..jaq"
- /* 5 */ "paaaaap"
- /* 6 */ "ppqqqpp"
-
- // Level 32
- /* z\x* 0123456 */
- /* 0 */ "...r..."
- /* 1 */ ".astba."
- /* 2 */ "...fl.."
- /* 3 */ "......."
- /* 4 */ "......."
- /* 5 */ ".a...a."
- /* 6 */ "......."
-
- // Level 33
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".a...a."
- /* 2 */ "......."
- /* 3 */ "......."
- /* 4 */ "......."
- /* 5 */ ".a...a."
- /* 6 */ "......."
-
- // Level 34
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".a...a."
- /* 2 */ "......."
- /* 3 */ "......."
- /* 4 */ "......."
- /* 5 */ ".a...a."
- /* 6 */ "......."
-
- // Level 35
- /* z\x* 0123456 */
- /* 0 */ "rrrrrrr"
- /* 1 */ "uaaaaau"
- /* 2 */ ".a...a."
- /* 3 */ ".a...a."
- /* 4 */ ".a...a."
- /* 5 */ "vaaaaav"
- /* 6 */ "wwwwwww"
-
- // Level 36
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "rrrrrrr"
- /* 2 */ "uaaaaau"
- /* 3 */ ".aaaaa."
- /* 4 */ "vaaaaav"
- /* 5 */ "wwwwwww"
- /* 6 */ "......."
-
- // Level 37
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "......."
- /* 2 */ "rrrrrrr"
- /* 3 */ "aaaaaaa"
- /* 4 */ "wwwwwww"
- /* 5 */ "......."
- /* 6 */ ".......",
-
- // Connectors:
- "2: 6, 32, 3: 5\n" /* Type 2, direction X+ */
- "2: 3, 32, 6: 3\n" /* Type 2, direction Z+ */
- "2: 0, 32, 3: 4\n" /* Type 2, direction X- */
- "2: 3, 32, 0: 2\n" /* Type 2, direction Z- */
- "3: 3, 1, 0: 2\n" /* Type 3, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- false,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // MineEntrance
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // RoofedWell:
- // The data has been exported from the gallery Plains, area index 119, ID 271, created by STR_Warrior
- {
- // Size:
- 7, 15, 7, // SizeX = 7, SizeY = 15, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 6, 14, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 1: 0\n" /* stone */
- "b: 4: 0\n" /* cobblestone */
- "c: 8: 0\n" /* water */
- "d: 3: 0\n" /* dirt */
- "e: 2: 0\n" /* grass */
- "f: 13: 0\n" /* gravel */
- "g:118: 3\n" /* cauldronblock */
- "h: 85: 0\n" /* fence */
- "i: 53: 2\n" /* woodstairs */
- "j: 53: 7\n" /* woodstairs */
- "k: 5: 0\n" /* wood */
- "l: 53: 4\n" /* woodstairs */
- "m: 19: 0\n" /* sponge */
- "n: 53: 5\n" /* woodstairs */
- "o: 53: 6\n" /* woodstairs */
- "p: 53: 3\n" /* woodstairs */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "aaaaaaa"
- /* 2 */ "aaaaaaa"
- /* 3 */ "aaaaaaa"
- /* 4 */ "aaaaaaa"
- /* 5 */ "aaaaaaa"
- /* 6 */ "aaaaaaa"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "abbbbba"
- /* 2 */ "abcccba"
- /* 3 */ "abcccba"
- /* 4 */ "abcccba"
- /* 5 */ "abbbbba"
- /* 6 */ "aaaaaaa"
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "abbbbba"
- /* 2 */ "abcccba"
- /* 3 */ "abcccba"
- /* 4 */ "abcccba"
- /* 5 */ "abbbbba"
- /* 6 */ "aaaaaaa"
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "abbbbba"
- /* 2 */ "abcccba"
- /* 3 */ "abcccba"
- /* 4 */ "abcccba"
- /* 5 */ "abbbbba"
- /* 6 */ "aaaaaaa"
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "abbbbba"
- /* 2 */ "abcccba"
- /* 3 */ "abcccba"
- /* 4 */ "abcccba"
- /* 5 */ "abbbbba"
- /* 6 */ "aaaaaaa"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "ddddddd"
- /* 1 */ "dbbbbbd"
- /* 2 */ "dbcccbd"
- /* 3 */ "dbcccbd"
- /* 4 */ "dbcccbd"
- /* 5 */ "dbbbbbd"
- /* 6 */ "ddddddd"
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "ddddddd"
- /* 1 */ "dbbbbbd"
- /* 2 */ "dbcccbd"
- /* 3 */ "dbcccbd"
- /* 4 */ "dbcccbd"
- /* 5 */ "dbbbbbd"
- /* 6 */ "ddddddd"
-
- // Level 7
- /* z\x* 0123456 */
- /* 0 */ "ddddddd"
- /* 1 */ "dbbbbbd"
- /* 2 */ "dbcccbd"
- /* 3 */ "dbcccbd"
- /* 4 */ "dbcccbd"
- /* 5 */ "dbbbbbd"
- /* 6 */ "ddddddd"
-
- // Level 8
- /* z\x* 0123456 */
- /* 0 */ "eefffee"
- /* 1 */ "ebbbbbe"
- /* 2 */ "fbcccbf"
- /* 3 */ "fbcccbf"
- /* 4 */ "fbcccbf"
- /* 5 */ "ebbbbbe"
- /* 6 */ "eefffee"
-
- // Level 9
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".bbbbb."
- /* 2 */ ".b...b."
- /* 3 */ ".b.g.b."
- /* 4 */ ".b...b."
- /* 5 */ ".bbbbb."
- /* 6 */ "......."
-
- // Level 10
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".h...h."
- /* 2 */ "......."
- /* 3 */ "...h..."
- /* 4 */ "......."
- /* 5 */ ".h...h."
- /* 6 */ "......."
-
- // Level 11
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".h...h."
- /* 2 */ "......."
- /* 3 */ "...h..."
- /* 4 */ "......."
- /* 5 */ ".h...h."
- /* 6 */ "......."
-
- // Level 12
- /* z\x* 0123456 */
- /* 0 */ "iiiiiii"
- /* 1 */ "jkjjjkj"
- /* 2 */ ".l...n."
- /* 3 */ ".l.h.n."
- /* 4 */ ".l...n."
- /* 5 */ "okoooko"
- /* 6 */ "ppppppp"
-
- // Level 13
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "iiiiiii"
- /* 2 */ "jkjjjkj"
- /* 3 */ ".k.h.k."
- /* 4 */ "okoooko"
- /* 5 */ "ppppppp"
- /* 6 */ "......."
-
- // Level 14
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "......."
- /* 2 */ "iiiiiii"
- /* 3 */ "kkkkkkk"
- /* 4 */ "ppppppp"
- /* 5 */ "......."
- /* 6 */ ".......",
-
- // Connectors:
- "2: 0, 9, 3: 4\n" /* Type 2, direction X- */
- "2: 3, 9, 6: 3\n" /* Type 2, direction Z+ */
- "2: 6, 9, 3: 5\n" /* Type 2, direction X+ */
- "2: 3, 9, 0: 2\n" /* Type 2, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // RoofedWell
-};
-
-
-
-
-
-// The prefab counts:
-
-const size_t g_PlainsVillagePrefabsCount = ARRAYCOUNT(g_PlainsVillagePrefabs);
-
-const size_t g_PlainsVillageStartingPrefabsCount = ARRAYCOUNT(g_PlainsVillageStartingPrefabs);
-
diff --git a/src/Generating/Prefabs/PlainsVillagePrefabs.h b/src/Generating/Prefabs/PlainsVillagePrefabs.h
deleted file mode 100644
index 087783b1e..000000000
--- a/src/Generating/Prefabs/PlainsVillagePrefabs.h
+++ /dev/null
@@ -1,15 +0,0 @@
-
-// PlainsVillagePrefabs.h
-
-// Declares the prefabs in the group PlainsVillage
-
-#include "../Prefab.h"
-
-
-
-
-
-extern const cPrefab::sDef g_PlainsVillagePrefabs[];
-extern const cPrefab::sDef g_PlainsVillageStartingPrefabs[];
-extern const size_t g_PlainsVillagePrefabsCount;
-extern const size_t g_PlainsVillageStartingPrefabsCount;
diff --git a/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp b/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp
deleted file mode 100644
index 3328ee210..000000000
--- a/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.cpp
+++ /dev/null
@@ -1,1669 +0,0 @@
-
-// SandFlatRoofVillagePrefabs.cpp
-
-// 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!
-
-#include "Globals.h"
-#include "SandFlatRoofVillagePrefabs.h"
-
-
-
-
-
-const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
-{
- ////////////////////////////////////////////////////////////////////////////////
- // Forge:
- // The data has been exported from the gallery Desert, area index 32, ID 173, created by Aloe_vera
- {
- // Size:
- 12, 6, 10, // SizeX = 12, SizeY = 6, SizeZ = 10
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 12, 5, 10, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e:128: 3\n" /* sandstonestairs */
- "f:171:15\n" /* carpet */
- "g: 64: 6\n" /* wooddoorblock */
- "h:171: 0\n" /* carpet */
- "i:171:14\n" /* carpet */
- "j: 61: 2\n" /* furnace */
- "k: 10: 0\n" /* lava */
- "l: 54: 2\n" /* chest */
- "m: 19: 0\n" /* sponge */
- "n: 24: 2\n" /* sandstone */
- "o: 64:12\n" /* wooddoorblock */
- "p: 50: 1\n" /* torch */
- "q:101: 0\n" /* ironbars */
- "r:128: 4\n" /* sandstonestairs */
- "s:128: 6\n" /* sandstonestairs */
- "t:128: 5\n" /* sandstonestairs */
- "u:128: 7\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "aaaaaaammmmm"
- /* 1 */ "aaaaaaaaaaam"
- /* 2 */ "aaaaaaaaaaam"
- /* 3 */ "aaaaaaaaaaam"
- /* 4 */ "aaaaaaaaaaam"
- /* 5 */ "aaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaam"
- /* 7 */ "maaaaaaaaaam"
- /* 8 */ "maaaaaaaaaam"
- /* 9 */ "mmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "bcccccd....."
- /* 1 */ "baaaaaaaaaa."
- /* 2 */ "baaaaaaaaaa."
- /* 3 */ "baaaaaaaaaa."
- /* 4 */ "baaaaaaaaaa."
- /* 5 */ "eaaaaaaaaaa."
- /* 6 */ ".aaaaaaaaaa."
- /* 7 */ ".aaaaaaaaaa."
- /* 8 */ ".aaaaaaaaaa."
- /* 9 */ "............"
-
- // Level 2
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ ".a....aaaaa."
- /* 2 */ "......afffa."
- /* 3 */ "......ghfha."
- /* 4 */ "......aiiia."
- /* 5 */ ".a....ahfha."
- /* 6 */ ".ajaajafffa."
- /* 7 */ ".aakkaal..a."
- /* 8 */ ".aaaaaaaaaa."
- /* 9 */ "............"
-
- // Level 3
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ ".n....nn.nn."
- /* 2 */ "......n...n."
- /* 3 */ "......o...n."
- /* 4 */ "......n....."
- /* 5 */ ".n....n...n."
- /* 6 */ ".n....n...n."
- /* 7 */ ".n....n...n."
- /* 8 */ ".nnn.nnn.nn."
- /* 9 */ "............"
-
- // Level 4
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "............"
- /* 1 */ ".a....aaaaa."
- /* 2 */ "......a...a."
- /* 3 */ "......a...a."
- /* 4 */ "......ap..a."
- /* 5 */ ".a....a...a."
- /* 6 */ ".aqqqqa...a."
- /* 7 */ ".a....a...a."
- /* 8 */ ".aaaaaaaaaa."
- /* 9 */ "............"
-
- // Level 5
- /* z\x* 11 */
- /* * 012345678901 */
- /* 0 */ "rsssssssssss"
- /* 1 */ "raaaaaaaaaat"
- /* 2 */ "raaaaaaaaaat"
- /* 3 */ "raaaaaaaaaat"
- /* 4 */ "raaaaaaaaaat"
- /* 5 */ "raaaaaaaaaat"
- /* 6 */ "raaaaaaaaaat"
- /* 7 */ "raaaaaaaaaat"
- /* 8 */ "raaaaaaaaaat"
- /* 9 */ "uuuuuuuuuuut",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Forge
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House11x7:
- // The data has been exported from the gallery Desert, area index 31, ID 172, created by Aloe_vera
- {
- // Size:
- 13, 6, 9, // SizeX = 13, SizeY = 6, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 13, 5, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:171: 0\n" /* carpet */
- "g:171:15\n" /* carpet */
- "h:171:14\n" /* carpet */
- "i: 24: 2\n" /* sandstone */
- "j: 64:12\n" /* wooddoorblock */
- "k: 50: 3\n" /* torch */
- "l: 50: 1\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n: 50: 2\n" /* torch */
- "o: 50: 4\n" /* torch */
- "p:128: 4\n" /* sandstonestairs */
- "q:128: 6\n" /* sandstonestairs */
- "r:128: 5\n" /* sandstonestairs */
- "s:128: 7\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "mmaaammmmmmmm"
- /* 1 */ "maaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaaam"
- /* 7 */ "maaaaaaaaaaam"
- /* 8 */ "mmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "..bcd........"
- /* 1 */ ".aaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaa."
- /* 6 */ ".aaaaaaaaaaa."
- /* 7 */ ".aaaaaaaaaaa."
- /* 8 */ "............."
-
- // Level 2
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ ".aaeaaaaaaaa."
- /* 2 */ ".affgggggffa."
- /* 3 */ ".afghhhhhgfa."
- /* 4 */ ".afghfffhgfa."
- /* 5 */ ".afghhhhhgfa."
- /* 6 */ ".affgggggffa."
- /* 7 */ ".aaaaaaaaaaa."
- /* 8 */ "............."
-
- // Level 3
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ ".iiji.iii.ii."
- /* 2 */ ".i.........i."
- /* 3 */ ".i.........i."
- /* 4 */ "............."
- /* 5 */ ".i.........i."
- /* 6 */ ".i.........i."
- /* 7 */ ".ii.ii.ii.ii."
- /* 8 */ "............."
-
- // Level 4
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ ".aaaaaaaaaaa."
- /* 2 */ ".a..k..k...a."
- /* 3 */ ".a.........a."
- /* 4 */ ".al.......na."
- /* 5 */ ".a.........a."
- /* 6 */ ".a....o....a."
- /* 7 */ ".aaaaaaaaaaa."
- /* 8 */ "............."
-
- // Level 5
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "pqqqqqqqqqqqq"
- /* 1 */ "paaaaaaaaaaar"
- /* 2 */ "paaaaaaaaaaar"
- /* 3 */ "paaaaaaaaaaar"
- /* 4 */ "paaaaaaaaaaar"
- /* 5 */ "paaaaaaaaaaar"
- /* 6 */ "paaaaaaaaaaar"
- /* 7 */ "paaaaaaaaaaar"
- /* 8 */ "ssssssssssssr",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House11x7
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House5x4:
- // The data has been exported from the gallery Desert, area index 25, ID 166, created by Aloe_vera
- {
- // Size:
- 7, 6, 6, // SizeX = 7, SizeY = 6, SizeZ = 6
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 7, 5, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:171: 0\n" /* carpet */
- "g:171:14\n" /* carpet */
- "h: 24: 2\n" /* sandstone */
- "i: 64:12\n" /* wooddoorblock */
- "j: 50: 3\n" /* torch */
- "k:128: 4\n" /* sandstonestairs */
- "l:128: 6\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */
- "n:128: 5\n" /* sandstonestairs */
- "o:128: 7\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mmaaamm"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "..bcd.."
- /* 1 */ ".aaaaa."
- /* 2 */ ".aaaaa."
- /* 3 */ ".aaaaa."
- /* 4 */ ".aaaaa."
- /* 5 */ "......."
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".aaeaa."
- /* 2 */ ".afgfa."
- /* 3 */ ".afgfa."
- /* 4 */ ".aaaaa."
- /* 5 */ "......."
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".hhihh."
- /* 2 */ ".h...h."
- /* 3 */ ".h...h."
- /* 4 */ ".hh.hh."
- /* 5 */ "......."
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".aaaaa."
- /* 2 */ ".aj.ja."
- /* 3 */ ".a...a."
- /* 4 */ ".aaaaa."
- /* 5 */ "......."
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "kllllln"
- /* 1 */ "kaaaaan"
- /* 2 */ "kaaaaan"
- /* 3 */ "kaaaaan"
- /* 4 */ "kaaaaan"
- /* 5 */ "oooooon",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House5x4
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House5x5:
- // The data has been exported from the gallery Desert, area index 26, ID 167, created by Aloe_vera
- {
- // Size:
- 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 7, 5, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:171: 0\n" /* carpet */
- "g:171:15\n" /* carpet */
- "h:171:14\n" /* carpet */
- "i: 24: 2\n" /* sandstone */
- "j: 64:12\n" /* wooddoorblock */
- "k: 50: 3\n" /* torch */
- "l:128: 4\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */
- "n:128: 6\n" /* sandstonestairs */
- "o:128: 5\n" /* sandstonestairs */
- "p:128: 7\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mmaaamm"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "maaaaam"
- /* 6 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "..bcd.."
- /* 1 */ ".aaaaa."
- /* 2 */ ".aaaaa."
- /* 3 */ ".aaaaa."
- /* 4 */ ".aaaaa."
- /* 5 */ ".aaaaa."
- /* 6 */ "......."
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".aaeaa."
- /* 2 */ ".afffa."
- /* 3 */ ".aghga."
- /* 4 */ ".afffa."
- /* 5 */ ".aaaaa."
- /* 6 */ "......."
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".iijii."
- /* 2 */ ".i...i."
- /* 3 */ "......."
- /* 4 */ ".i...i."
- /* 5 */ ".ii.ii."
- /* 6 */ "......."
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".aaaaa."
- /* 2 */ ".ak.ka."
- /* 3 */ ".a...a."
- /* 4 */ ".a...a."
- /* 5 */ ".aaaaa."
- /* 6 */ "......."
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "lnnnnno"
- /* 1 */ "laaaaao"
- /* 2 */ "laaaaao"
- /* 3 */ "laaaaao"
- /* 4 */ "laaaaao"
- /* 5 */ "laaaaao"
- /* 6 */ "ppppppo",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House5x5
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House7x5:
- // The data has been exported from the gallery Desert, area index 27, ID 168, created by Aloe_vera
- {
- // Size:
- 9, 6, 7, // SizeX = 9, SizeY = 6, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 9, 5, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:171:14\n" /* carpet */
- "g:171: 0\n" /* carpet */
- "h:171:15\n" /* carpet */
- "i: 24: 2\n" /* sandstone */
- "j: 64:12\n" /* wooddoorblock */
- "k: 50: 3\n" /* torch */
- "l:128: 4\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */
- "n:128: 6\n" /* sandstonestairs */
- "o:128: 5\n" /* sandstonestairs */
- "p:128: 7\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "mmaaammmm"
- /* 1 */ "maaaaaaam"
- /* 2 */ "maaaaaaam"
- /* 3 */ "maaaaaaam"
- /* 4 */ "maaaaaaam"
- /* 5 */ "maaaaaaam"
- /* 6 */ "mmmmmmmmm"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "..bcd...."
- /* 1 */ ".aaaaaaa."
- /* 2 */ ".aaaaaaa."
- /* 3 */ ".aaaaaaa."
- /* 4 */ ".aaaaaaa."
- /* 5 */ ".aaaaaaa."
- /* 6 */ "........."
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ ".aaeaaaa."
- /* 2 */ ".afffffa."
- /* 3 */ ".aghhhga."
- /* 4 */ ".afffffa."
- /* 5 */ ".aaaaaaa."
- /* 6 */ "........."
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ ".iiji.ii."
- /* 2 */ ".i.....i."
- /* 3 */ "........."
- /* 4 */ ".i.....i."
- /* 5 */ ".iii.iii."
- /* 6 */ "........."
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ ".aaaaaaa."
- /* 2 */ ".ak.k..a."
- /* 3 */ ".a.....a."
- /* 4 */ ".a.....a."
- /* 5 */ ".aaaaaaa."
- /* 6 */ "........."
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "lnnnnnnnn"
- /* 1 */ "laaaaaaao"
- /* 2 */ "laaaaaaao"
- /* 3 */ "laaaaaaao"
- /* 4 */ "laaaaaaao"
- /* 5 */ "laaaaaaao"
- /* 6 */ "ppppppppo",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House7x5
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House8x5:
- // The data has been exported from the gallery Desert, area index 28, ID 169, created by Aloe_vera
- {
- // Size:
- 10, 6, 7, // SizeX = 10, SizeY = 6, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 10, 5, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:171: 0\n" /* carpet */
- "g:171:14\n" /* carpet */
- "h:171:15\n" /* carpet */
- "i: 24: 2\n" /* sandstone */
- "j: 64:12\n" /* wooddoorblock */
- "k: 50: 3\n" /* torch */
- "l:128: 4\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */
- "n:128: 6\n" /* sandstonestairs */
- "o:128: 5\n" /* sandstonestairs */
- "p:128: 7\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "mmaaammmmm"
- /* 1 */ "maaaaaaaam"
- /* 2 */ "maaaaaaaam"
- /* 3 */ "maaaaaaaam"
- /* 4 */ "maaaaaaaam"
- /* 5 */ "maaaaaaaam"
- /* 6 */ "mmmmmmmmmm"
-
- // Level 1
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "..bcd....."
- /* 1 */ ".aaaaaaaa."
- /* 2 */ ".aaaaaaaa."
- /* 3 */ ".aaaaaaaa."
- /* 4 */ ".aaaaaaaa."
- /* 5 */ ".aaaaaaaa."
- /* 6 */ ".........."
-
- // Level 2
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".aaeaaaaa."
- /* 2 */ ".afghhgfa."
- /* 3 */ ".afhffhfa."
- /* 4 */ ".afghhgfa."
- /* 5 */ ".aaaaaaaa."
- /* 6 */ ".........."
-
- // Level 3
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".iijii.ii."
- /* 2 */ ".i......i."
- /* 3 */ ".........."
- /* 4 */ ".i......i."
- /* 5 */ ".ii.ii.ii."
- /* 6 */ ".........."
-
- // Level 4
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".aaaaaaaa."
- /* 2 */ ".ak.k...a."
- /* 3 */ ".a......a."
- /* 4 */ ".a......a."
- /* 5 */ ".aaaaaaaa."
- /* 6 */ ".........."
-
- // Level 5
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "lnnnnnnnnn"
- /* 1 */ "laaaaaaaao"
- /* 2 */ "laaaaaaaao"
- /* 3 */ "laaaaaaaao"
- /* 4 */ "laaaaaaaao"
- /* 5 */ "laaaaaaaao"
- /* 6 */ "pppppppppo",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House8x5
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House8x7:
- // The data has been exported from the gallery Desert, area index 29, ID 170, created by Aloe_vera
- {
- // Size:
- 10, 6, 9, // SizeX = 10, SizeY = 6, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 10, 5, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:171: 0\n" /* carpet */
- "g:171:14\n" /* carpet */
- "h:171:15\n" /* carpet */
- "i: 24: 2\n" /* sandstone */
- "j: 64:12\n" /* wooddoorblock */
- "k: 50: 3\n" /* torch */
- "l: 50: 1\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n: 50: 2\n" /* torch */
- "o:128: 4\n" /* sandstonestairs */
- "p:128: 6\n" /* sandstonestairs */
- "q:128: 5\n" /* sandstonestairs */
- "r:128: 7\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "mmaaammmmm"
- /* 1 */ "maaaaaaaam"
- /* 2 */ "maaaaaaaam"
- /* 3 */ "maaaaaaaam"
- /* 4 */ "maaaaaaaam"
- /* 5 */ "maaaaaaaam"
- /* 6 */ "maaaaaaaam"
- /* 7 */ "maaaaaaaam"
- /* 8 */ "mmmmmmmmmm"
-
- // Level 1
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "..bcd....."
- /* 1 */ ".aaaaaaaa."
- /* 2 */ ".aaaaaaaa."
- /* 3 */ ".aaaaaaaa."
- /* 4 */ ".aaaaaaaa."
- /* 5 */ ".aaaaaaaa."
- /* 6 */ ".aaaaaaaa."
- /* 7 */ ".aaaaaaaa."
- /* 8 */ ".........."
-
- // Level 2
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".aaeaaaaa."
- /* 2 */ ".afghhgfa."
- /* 3 */ ".afhffhfa."
- /* 4 */ ".afhgghfa."
- /* 5 */ ".afhffhfa."
- /* 6 */ ".afghhgfa."
- /* 7 */ ".aaaaaaaa."
- /* 8 */ ".........."
-
- // Level 3
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".iijii.ii."
- /* 2 */ ".i......i."
- /* 3 */ ".i......i."
- /* 4 */ ".........."
- /* 5 */ ".i......i."
- /* 6 */ ".i......i."
- /* 7 */ ".ii.ii.ii."
- /* 8 */ ".........."
-
- // Level 4
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ ".........."
- /* 1 */ ".aaaaaaaa."
- /* 2 */ ".a..k...a."
- /* 3 */ ".a......a."
- /* 4 */ ".al....na."
- /* 5 */ ".a......a."
- /* 6 */ ".a......a."
- /* 7 */ ".aaaaaaaa."
- /* 8 */ ".........."
-
- // Level 5
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "oppppppppp"
- /* 1 */ "oaaaaaaaaq"
- /* 2 */ "oaaaaaaaaq"
- /* 3 */ "oaaaaaaaaq"
- /* 4 */ "oaaaaaaaaq"
- /* 5 */ "oaaaaaaaaq"
- /* 6 */ "oaaaaaaaaq"
- /* 7 */ "oaaaaaaaaq"
- /* 8 */ "rrrrrrrrrq",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House8x7
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House9x7:
- // The data has been exported from the gallery Desert, area index 30, ID 171, created by Aloe_vera
- {
- // Size:
- 11, 6, 9, // SizeX = 11, SizeY = 6, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 5, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:171: 0\n" /* carpet */
- "g:171:15\n" /* carpet */
- "h:171:14\n" /* carpet */
- "i: 24: 2\n" /* sandstone */
- "j: 64:12\n" /* wooddoorblock */
- "k: 50: 3\n" /* torch */
- "l: 50: 1\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n: 50: 2\n" /* torch */
- "o: 50: 4\n" /* torch */
- "p:128: 4\n" /* sandstonestairs */
- "q:128: 6\n" /* sandstonestairs */
- "r:128: 5\n" /* sandstonestairs */
- "s:128: 7\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmaaammmmmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "maaaaaaaaam"
- /* 7 */ "maaaaaaaaam"
- /* 8 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..bcd......"
- /* 1 */ ".aaaaaaaaa."
- /* 2 */ ".aaaaaaaaa."
- /* 3 */ ".aaaaaaaaa."
- /* 4 */ ".aaaaaaaaa."
- /* 5 */ ".aaaaaaaaa."
- /* 6 */ ".aaaaaaaaa."
- /* 7 */ ".aaaaaaaaa."
- /* 8 */ "..........."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".aaeaaaaaa."
- /* 2 */ ".affgggffa."
- /* 3 */ ".afghhhgfa."
- /* 4 */ ".afghfhgfa."
- /* 5 */ ".afghhhgfa."
- /* 6 */ ".affgggffa."
- /* 7 */ ".aaaaaaaaa."
- /* 8 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".iijii.iii."
- /* 2 */ ".i.......i."
- /* 3 */ ".i.......i."
- /* 4 */ "..........."
- /* 5 */ ".i.......i."
- /* 6 */ ".i.......i."
- /* 7 */ ".ii.iii.ii."
- /* 8 */ "..........."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".aaaaaaaaa."
- /* 2 */ ".a..k....a."
- /* 3 */ ".a.......a."
- /* 4 */ ".al.....na."
- /* 5 */ ".a.......a."
- /* 6 */ ".a...o...a."
- /* 7 */ ".aaaaaaaaa."
- /* 8 */ "..........."
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "pqqqqqqqqqq"
- /* 1 */ "paaaaaaaaar"
- /* 2 */ "paaaaaaaaar"
- /* 3 */ "paaaaaaaaar"
- /* 4 */ "paaaaaaaaar"
- /* 5 */ "paaaaaaaaar"
- /* 6 */ "paaaaaaaaar"
- /* 7 */ "paaaaaaaaar"
- /* 8 */ "ssssssssssr",
-
- // Connectors:
- "-1: 3, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House9x7
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseL13x12:
- // The data has been exported from the gallery Desert, area index 53, ID 345, created by jakibaki
- {
- // Size:
- 15, 6, 14, // SizeX = 15, SizeY = 6, SizeZ = 14
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 15, 5, 14, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 43: 1\n" /* doubleslab */
- "f: 64: 7\n" /* wooddoorblock */
- "g:171: 0\n" /* carpet */
- "h:171:15\n" /* carpet */
- "i:171:14\n" /* carpet */
- "j: 58: 0\n" /* workbench */
- "k: 24: 2\n" /* sandstone */
- "l: 64:12\n" /* wooddoorblock */
- "m: 19: 0\n" /* sponge */
- "n: 50: 3\n" /* torch */
- "o: 50: 1\n" /* torch */
- "p: 50: 2\n" /* torch */
- "q: 50: 4\n" /* torch */
- "r:128: 6\n" /* sandstonestairs */
- "s:128: 5\n" /* sandstonestairs */
- "t:128: 4\n" /* sandstonestairs */
- "u:128: 7\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmaaammmmmmmmm"
- /* 1 */ "maaaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaaaaam"
- /* 7 */ "maaaaaaaaaaaaam"
- /* 8 */ "mmmmmmmaaaaaaam"
- /* 9 */ "mmmmmmmaaaaaaam"
- /* 10 */ "mmmmmmmaaaaaaam"
- /* 11 */ "mmmmmmmaaaaaaam"
- /* 12 */ "mmmmmmmaaaaaaam"
- /* 13 */ "mmmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "...bcd........."
- /* 1 */ ".aaaaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaaea."
- /* 6 */ ".aaaaaaaaaaaaa."
- /* 7 */ ".aaaaaaaaaaaaa."
- /* 8 */ ".......aeaaaaa."
- /* 9 */ "mmmmmm.aaaaaaa."
- /* 10 */ "mmmmmm.aaaaaaa."
- /* 11 */ "mmmmmm.aaaaaaa."
- /* 12 */ "mmmmmm.aaaaaaa."
- /* 13 */ "..............."
-
- // Level 2
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".aaafaaaaaaaaa."
- /* 2 */ ".agghhhhhhhhga."
- /* 3 */ ".aghiiiiiiiiha."
- /* 4 */ ".aghiggggggiha."
- /* 5 */ ".aghiiiiiigiha."
- /* 6 */ ".agghhhhhigiha."
- /* 7 */ ".aaaaaaahigiha."
- /* 8 */ ".......ahigiha."
- /* 9 */ "mmmmmm.ahiiiha."
- /* 10 */ "mmmmmm.aghhhga."
- /* 11 */ "mmmmmm.aggggja."
- /* 12 */ "mmmmmm.aaaaaaa."
- /* 13 */ "..............."
-
- // Level 3
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".kkklkkkk.kkkk."
- /* 2 */ ".k...........k."
- /* 3 */ ".k...........k."
- /* 4 */ "..............."
- /* 5 */ ".k...........k."
- /* 6 */ ".k...........k."
- /* 7 */ ".kkk.kkk.....k."
- /* 8 */ ".......k.....k."
- /* 9 */ "mmmmmm.k......."
- /* 10 */ "mmmmmm.......k."
- /* 11 */ "mmmmmm.k.....k."
- /* 12 */ "mmmmmm.kkk.kkk."
- /* 13 */ "..............."
-
- // Level 4
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".aaaaaaaaaaaaa."
- /* 2 */ ".a......n....a."
- /* 3 */ ".a...........a."
- /* 4 */ ".ao..........a."
- /* 5 */ ".a...........a."
- /* 6 */ ".a..........pa."
- /* 7 */ ".aaaaaaa.....a."
- /* 8 */ ".......a.....a."
- /* 9 */ "mmmmmm.a.....a."
- /* 10 */ "mmmmmm.a.....a."
- /* 11 */ "mmmmmm.a..q..a."
- /* 12 */ "mmmmmm.aaaaaaa."
- /* 13 */ "..............."
-
- // Level 5
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "rrrrrrrrrrrrrrs"
- /* 1 */ "taaaaaaaaaaaaas"
- /* 2 */ "taaaaaaaaaaaaas"
- /* 3 */ "taaaaaaaaaaaaas"
- /* 4 */ "taaaaaaaaaaaaas"
- /* 5 */ "taaaaaaaaaaaaas"
- /* 6 */ "taaaaaaaaaaaaas"
- /* 7 */ "taaaaaaaaaaaaas"
- /* 8 */ "tuuuuutaaaaaaas"
- /* 9 */ "mmmmmmtaaaaaaas"
- /* 10 */ "mmmmmmtaaaaaaas"
- /* 11 */ "mmmmmmtaaaaaaas"
- /* 12 */ "mmmmmmtaaaaaaas"
- /* 13 */ "......tuuuuuuuu",
-
- // Connectors:
- "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseL13x12
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // MarketStall:
- // The data has been exported from the gallery Desert, area index 34, ID 175, created by Aloe_vera
- {
- // Size:
- 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 7, 5, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 12: 0\n" /* sand */
- "b: 85: 0\n" /* fence */
- "c:171:14\n" /* carpet */
- "d:171:15\n" /* carpet */
- "e:171: 0\n" /* carpet */
- "f: 35:14\n" /* wool */
- "g: 35: 0\n" /* wool */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "aaaaaaa"
- /* 2 */ "aaaaaaa"
- /* 3 */ "aaaaaaa"
- /* 4 */ "aaaaaaa"
- /* 5 */ "aaaaaaa"
- /* 6 */ "aaaaaaa"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "b.....b"
- /* 1 */ "cddeddc"
- /* 2 */ "cdeeedc"
- /* 3 */ "cdeeedc"
- /* 4 */ "cddeddc"
- /* 5 */ "b.....b"
- /* 6 */ "......."
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "b.....b"
- /* 1 */ "......."
- /* 2 */ "......."
- /* 3 */ "......."
- /* 4 */ "......."
- /* 5 */ "b.....b"
- /* 6 */ "......."
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "b.....b"
- /* 1 */ "......."
- /* 2 */ "......."
- /* 3 */ "......."
- /* 4 */ "......."
- /* 5 */ "b.....b"
- /* 6 */ "fgfgfgf"
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "fgfgfgf"
- /* 1 */ "......."
- /* 2 */ "......."
- /* 3 */ "......."
- /* 4 */ "......."
- /* 5 */ "fgfgfgf"
- /* 6 */ "......."
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "fgfgfgf"
- /* 2 */ "fgfgfgf"
- /* 3 */ "fgfgfgf"
- /* 4 */ "fgfgfgf"
- /* 5 */ "......."
- /* 6 */ ".......",
-
- // Connectors:
- "-1: 2, 0, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 5,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // MarketStall
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Marketplace:
- // The data has been exported from the gallery Desert, area index 38, ID 261, created by Aloe_vera
- {
- // Size:
- 14, 4, 16, // SizeX = 14, SizeY = 4, SizeZ = 16
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 14, 3, 16, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b: 12: 0\n" /* sand */
- "c: 24: 2\n" /* sandstone */
- "d: 12: 2\n" /* sand */
- "e: 85: 0\n" /* fence */
- "f: 5: 0\n" /* wood */
- "g:128: 2\n" /* sandstonestairs */
- "h:128: 0\n" /* sandstonestairs */
- "i: 8: 0\n" /* water */
- "j:128: 1\n" /* sandstonestairs */
- "k:128: 3\n" /* sandstonestairs */
- "l: 35: 0\n" /* wool */
- "m: 19: 0\n" /* sponge */
- "n: 35:14\n" /* wool */,
-
- // Block data:
- // Level 0
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ "aaaabbbaaabbbb"
- /* 1 */ "aaaabbaabbabbb"
- /* 2 */ "aababbabcabbbb"
- /* 3 */ "aaaaabaaaaabbb"
- /* 4 */ "bbbbbbbbbbbbbb"
- /* 5 */ "bbbbbbbbbbaabb"
- /* 6 */ "bbbbccccbbabab"
- /* 7 */ "ccbbccccbbaaab"
- /* 8 */ "ccbbccccbbabbb"
- /* 9 */ "dcbbccccbbabaa"
- /* 10 */ "ccbbbbbbbbaaba"
- /* 11 */ "ccbbbbbbbbabaa"
- /* 12 */ "bbbbbbbbbbabaa"
- /* 13 */ "bbbaababbbaaba"
- /* 14 */ "bbbcaaaabbabbb"
- /* 15 */ "bbbcccabbbabbb"
-
- // Level 1
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ "e...e.e...e..."
- /* 1 */ ".............."
- /* 2 */ ".............."
- /* 3 */ "fffff.fffff..."
- /* 4 */ ".............."
- /* 5 */ "..........f..e"
- /* 6 */ "....gggg..f..."
- /* 7 */ ".f..hiij..f..."
- /* 8 */ ".f..hiij..f..."
- /* 9 */ ".f..kkkk..f..e"
- /* 10 */ ".f............"
- /* 11 */ ".f........f..e"
- /* 12 */ "...fffff..f..."
- /* 13 */ "..........f..."
- /* 14 */ "..........f..."
- /* 15 */ "...e...e..f..e"
-
- // Level 2
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ "lnlnl.lnlnl..."
- /* 1 */ ".............."
- /* 2 */ ".............."
- /* 3 */ "e...e.e...e..."
- /* 4 */ ".............."
- /* 5 */ "..........e..l"
- /* 6 */ ".............n"
- /* 7 */ ".e...........l"
- /* 8 */ ".............n"
- /* 9 */ "..........e..l"
- /* 10 */ ".............."
- /* 11 */ ".e........e..l"
- /* 12 */ "...e...e.....n"
- /* 13 */ ".............l"
- /* 14 */ ".............n"
- /* 15 */ "...lnlnl..e..l"
-
- // Level 3
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".............."
- /* 1 */ "lnlnl.lnlnl..."
- /* 2 */ "lnlnl.lnlnl..."
- /* 3 */ "lnlnl.lnlnl..."
- /* 4 */ ".............."
- /* 5 */ "..........lll."
- /* 6 */ "..........nnn."
- /* 7 */ "ll........lll."
- /* 8 */ "nn........nnn."
- /* 9 */ "ll........lll."
- /* 10 */ "nn............"
- /* 11 */ "ll........lll."
- /* 12 */ "...lnlnl..nnn."
- /* 13 */ "...lnlnl..lll."
- /* 14 */ "...lnlnl..nnn."
- /* 15 */ "..........lll.",
-
- // Connectors:
- "-1: 5, 0, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 20,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Marketplace
-}; // g_SandFlatRoofVillagePrefabs
-
-
-
-
-
-
-const cPrefab::sDef g_SandFlatRoofVillageStartingPrefabs[] =
-{
- ////////////////////////////////////////////////////////////////////////////////
- // Well:
- // The data has been exported from the gallery Desert, area index 44, ID 275, created by Aloe_vera
- {
- // Size:
- 5, 16, 5, // SizeX = 5, SizeY = 16, SizeZ = 5
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 4, 15, 4, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 1: 0\n" /* stone */
- "b: 24: 0\n" /* sandstone */
- "c: 8: 0\n" /* water */
- "d:128: 2\n" /* sandstonestairs */
- "e:128: 0\n" /* sandstonestairs */
- "f:128: 1\n" /* sandstonestairs */
- "g:128: 3\n" /* sandstonestairs */
- "h:128: 6\n" /* sandstonestairs */
- "i:128: 4\n" /* sandstonestairs */
- "j:128: 5\n" /* sandstonestairs */
- "k:128: 7\n" /* sandstonestairs */
- "l: 44: 1\n" /* step */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 01234 */
- /* 0 */ "aaaaa"
- /* 1 */ "abbba"
- /* 2 */ "abbba"
- /* 3 */ "abbba"
- /* 4 */ "aaaaa"
-
- // Level 1
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bcccb"
- /* 2 */ "bcccb"
- /* 3 */ "bcccb"
- /* 4 */ "bbbbb"
-
- // Level 2
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bcccb"
- /* 2 */ "bcccb"
- /* 3 */ "bcccb"
- /* 4 */ "bbbbb"
-
- // Level 3
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bcccb"
- /* 2 */ "bcccb"
- /* 3 */ "bcccb"
- /* 4 */ "bbbbb"
-
- // Level 4
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bcccb"
- /* 2 */ "bcccb"
- /* 3 */ "bcccb"
- /* 4 */ "bbbbb"
-
- // Level 5
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bcccb"
- /* 2 */ "bcccb"
- /* 3 */ "bcccb"
- /* 4 */ "bbbbb"
-
- // Level 6
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bcccb"
- /* 2 */ "bcccb"
- /* 3 */ "bcccb"
- /* 4 */ "bbbbb"
-
- // Level 7
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bcccb"
- /* 2 */ "bcccb"
- /* 3 */ "bcccb"
- /* 4 */ "bbbbb"
-
- // Level 8
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bcbcb"
- /* 2 */ "bbcbb"
- /* 3 */ "bcbcb"
- /* 4 */ "bbbbb"
-
- // Level 9
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bcbcb"
- /* 2 */ "bbbbb"
- /* 3 */ "bcbcb"
- /* 4 */ "bbbbb"
-
- // Level 10
- /* z\x* 01234 */
- /* 0 */ "bbbbb"
- /* 1 */ "bcbcb"
- /* 2 */ "bbbbb"
- /* 3 */ "bcbcb"
- /* 4 */ "bbbbb"
-
- // Level 11
- /* z\x* 01234 */
- /* 0 */ "ddddd"
- /* 1 */ "ecccf"
- /* 2 */ "ecbcf"
- /* 3 */ "ecccf"
- /* 4 */ "ggggf"
-
- // Level 12
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "....."
- /* 2 */ "..b.."
- /* 3 */ "....."
- /* 4 */ "....."
-
- // Level 13
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ "....."
- /* 2 */ "..b.."
- /* 3 */ "....."
- /* 4 */ "....."
-
- // Level 14
- /* z\x* 01234 */
- /* 0 */ "....."
- /* 1 */ ".hhh."
- /* 2 */ ".ibj."
- /* 3 */ ".kkj."
- /* 4 */ "....."
-
- // Level 15
- /* z\x* 01234 */
- /* 0 */ "lllll"
- /* 1 */ "lllll"
- /* 2 */ "lllll"
- /* 3 */ "lllll"
- /* 4 */ "lllll",
-
- // Connectors:
- "2: 4, 11, 2: 5\n" /* Type 2, direction X+ */
- "2: 2, 11, 4: 3\n" /* Type 2, direction Z+ */
- "2: 0, 11, 2: 4\n" /* Type 2, direction X- */
- "2: 2, 11, 0: 2\n" /* Type 2, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Well
-};
-
-
-
-
-
-// The prefab counts:
-
-const size_t g_SandFlatRoofVillagePrefabsCount = ARRAYCOUNT(g_SandFlatRoofVillagePrefabs);
-
-const size_t g_SandFlatRoofVillageStartingPrefabsCount = ARRAYCOUNT(g_SandFlatRoofVillageStartingPrefabs);
-
diff --git a/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.h b/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.h
deleted file mode 100644
index ea06de5b5..000000000
--- a/src/Generating/Prefabs/SandFlatRoofVillagePrefabs.h
+++ /dev/null
@@ -1,15 +0,0 @@
-
-// SandFlatRoofVillagePrefabs.h
-
-// Declares the prefabs in the group SandFlatRoofVillage
-
-#include "../Prefab.h"
-
-
-
-
-
-extern const cPrefab::sDef g_SandFlatRoofVillagePrefabs[];
-extern const cPrefab::sDef g_SandFlatRoofVillageStartingPrefabs[];
-extern const size_t g_SandFlatRoofVillagePrefabsCount;
-extern const size_t g_SandFlatRoofVillageStartingPrefabsCount;
diff --git a/src/Generating/Prefabs/SandVillagePrefabs.cpp b/src/Generating/Prefabs/SandVillagePrefabs.cpp
deleted file mode 100644
index c63f8161b..000000000
--- a/src/Generating/Prefabs/SandVillagePrefabs.cpp
+++ /dev/null
@@ -1,2307 +0,0 @@
-
-// SandVillagePrefabs.cpp
-
-// 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!
-
-#include "Globals.h"
-#include "SandVillagePrefabs.h"
-
-
-
-
-
-const cPrefab::sDef g_SandVillagePrefabs[] =
-{
- ////////////////////////////////////////////////////////////////////////////////
- // DoubleField:
- // The data has been exported from the gallery Desert, area index 5, ID 75, created by tonibm1999
- {
- // Size:
- 13, 3, 9, // SizeX = 13, SizeY = 3, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, -1, // MinX, MinY, MinZ
- 13, 2, 8, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b: 60: 7\n" /* tilleddirt */
- "c: 8: 0\n" /* water */
- "d: 50: 5\n" /* torch */
- "e: 59: 7\n" /* crops */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "aaaaaaaaaaaaa"
- /* 1 */ "aaaaaaaaaaaaa"
- /* 2 */ "aaaaaaaaaaaaa"
- /* 3 */ "aaaaaaaaaaaaa"
- /* 4 */ "aaaaaaaaaaaaa"
- /* 5 */ "aaaaaaaaaaaaa"
- /* 6 */ "aaaaaaaaaaaaa"
- /* 7 */ "aaaaaaaaaaaaa"
- /* 8 */ "aaaaaaaaaaaaa"
-
- // Level 1
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "aaaaaaaaaaaaa"
- /* 1 */ "abbcbbabbcbba"
- /* 2 */ "abbcbbabbcbba"
- /* 3 */ "abbcbbabbcbba"
- /* 4 */ "abbcbbabbcbba"
- /* 5 */ "abbcbbabbcbba"
- /* 6 */ "abbcbbabbcbba"
- /* 7 */ "abbcbbabbcbba"
- /* 8 */ "aaaaaaaaaaaaa"
-
- // Level 2
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "d.....d.....d"
- /* 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 */ ".ee.ee.ee.ee."
- /* 8 */ "d.....d.....d",
-
- // Connectors:
- "-1: 6, 1, 8: 3\n" /* Type -1, direction Z+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // DoubleField
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House11x7:
- // The data has been exported from the gallery Desert, area index 6, ID 81, created by Aloe_vera
- {
- // Size:
- 11, 7, 7, // SizeX = 11, SizeY = 7, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 6, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:102: 0\n" /* glasspane */
- "g: 64:12\n" /* wooddoorblock */
- "h:128: 7\n" /* sandstonestairs */
- "i: 50: 3\n" /* torch */
- "j: 50: 4\n" /* torch */
- "k:128: 6\n" /* sandstonestairs */
- "l:128: 3\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */
- "n: 50: 1\n" /* torch */
- "o: 50: 2\n" /* torch */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmaaammmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "....bcd...."
- /* 1 */ ".aaaaaaaaa."
- /* 2 */ ".aaaaaaaaa."
- /* 3 */ ".aaaaaaaaa."
- /* 4 */ ".aaaaaaaaa."
- /* 5 */ ".aaaaaaaaa."
- /* 6 */ "..........."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".aaaaeaaaa."
- /* 2 */ ".a.......a."
- /* 3 */ ".a.......a."
- /* 4 */ ".a.......a."
- /* 5 */ ".aaaaaaaaa."
- /* 6 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".affagaffa."
- /* 2 */ ".f.......f."
- /* 3 */ ".f.......f."
- /* 4 */ ".f.......f."
- /* 5 */ ".affafaffa."
- /* 6 */ "..........."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "ccccccccccc"
- /* 1 */ "haaaaaaaaah"
- /* 2 */ ".a..i.i..a."
- /* 3 */ ".a.......a."
- /* 4 */ ".a..j.j..a."
- /* 5 */ "kaaaaaaaaak"
- /* 6 */ "lllllllllll"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "ccccccccccc"
- /* 2 */ "haaaaaaaaah"
- /* 3 */ ".an.....oa."
- /* 4 */ "kaaaaaaaaak"
- /* 5 */ "lllllllllll"
- /* 6 */ "..........."
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "ccccccccccc"
- /* 3 */ "aaaaaaaaaaa"
- /* 4 */ "lllllllllll"
- /* 5 */ "..........."
- /* 6 */ "...........",
-
- // Connectors:
- "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House11x7
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House11x9:
- // The data has been exported from the gallery Desert, area index 11, ID 115, created by xoft
- {
- // Size:
- 11, 8, 9, // SizeX = 11, SizeY = 8, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 11, 7, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:102: 0\n" /* glasspane */
- "g: 64:12\n" /* wooddoorblock */
- "h:128: 7\n" /* sandstonestairs */
- "i: 50: 3\n" /* torch */
- "j: 50: 4\n" /* torch */
- "k:128: 6\n" /* sandstonestairs */
- "l:128: 3\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "mmmmaaammmm"
- /* 1 */ "maaaaaaaaam"
- /* 2 */ "maaaaaaaaam"
- /* 3 */ "maaaaaaaaam"
- /* 4 */ "maaaaaaaaam"
- /* 5 */ "maaaaaaaaam"
- /* 6 */ "maaaaaaaaam"
- /* 7 */ "maaaaaaaaam"
- /* 8 */ "mmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "....bcd...."
- /* 1 */ ".aaaaaaaaa."
- /* 2 */ ".aaaaaaaaa."
- /* 3 */ ".aaaaaaaaa."
- /* 4 */ ".aaaaaaaaa."
- /* 5 */ ".aaaaaaaaa."
- /* 6 */ ".aaaaaaaaa."
- /* 7 */ ".aaaaaaaaa."
- /* 8 */ "..........."
-
- // Level 2
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".aaaaeaaaa."
- /* 2 */ ".a.......a."
- /* 3 */ ".a.......a."
- /* 4 */ ".a.......a."
- /* 5 */ ".a.......a."
- /* 6 */ ".a.......a."
- /* 7 */ ".aaaaaaaaa."
- /* 8 */ "..........."
-
- // Level 3
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ ".affagaffa."
- /* 2 */ ".f.......f."
- /* 3 */ ".f.......f."
- /* 4 */ ".a.......a."
- /* 5 */ ".f.......f."
- /* 6 */ ".f.......f."
- /* 7 */ ".afffafffa."
- /* 8 */ "..........."
-
- // Level 4
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "ccccccccccc"
- /* 1 */ "haaaaaaaaah"
- /* 2 */ ".a..i.i..a."
- /* 3 */ ".a.......a."
- /* 4 */ ".a.......a."
- /* 5 */ ".a.......a."
- /* 6 */ ".a...j...a."
- /* 7 */ "kaaaaaaaaak"
- /* 8 */ "lllllllllll"
-
- // Level 5
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "ccccccccccc"
- /* 2 */ "haaaaaaaaah"
- /* 3 */ ".a.......a."
- /* 4 */ ".a.......a."
- /* 5 */ ".a.......a."
- /* 6 */ "kaaaaaaaaak"
- /* 7 */ "lllllllllll"
- /* 8 */ "..........."
-
- // Level 6
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "ccccccccccc"
- /* 3 */ "haaaaaaaaah"
- /* 4 */ ".a.......a."
- /* 5 */ "kaaaaaaaaak"
- /* 6 */ "lllllllllll"
- /* 7 */ "..........."
- /* 8 */ "..........."
-
- // Level 7
- /* z\x* 1 */
- /* * 01234567890 */
- /* 0 */ "..........."
- /* 1 */ "..........."
- /* 2 */ "..........."
- /* 3 */ "ccccccccccc"
- /* 4 */ "aaaaaaaaaaa"
- /* 5 */ "lllllllllll"
- /* 6 */ "..........."
- /* 7 */ "..........."
- /* 8 */ "...........",
-
- // Connectors:
- "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House11x9
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House13x7:
- // The data has been exported from the gallery Desert, area index 15, ID 125, created by Aloe_vera
- {
- // Size:
- 13, 7, 7, // SizeX = 13, SizeY = 7, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 13, 6, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:102: 0\n" /* glasspane */
- "g: 64:12\n" /* wooddoorblock */
- "h:128: 7\n" /* sandstonestairs */
- "i: 50: 3\n" /* torch */
- "j: 50: 4\n" /* torch */
- "k:128: 6\n" /* sandstonestairs */
- "l:128: 3\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "mmmmmaaammmmm"
- /* 1 */ "maaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaam"
- /* 6 */ "mmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ ".....bcd....."
- /* 1 */ ".aaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaa."
- /* 6 */ "............."
-
- // Level 2
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ ".aaaaaeaaaaa."
- /* 2 */ ".a.........a."
- /* 3 */ ".a.........a."
- /* 4 */ ".a.........a."
- /* 5 */ ".aaaaaaaaaaa."
- /* 6 */ "............."
-
- // Level 3
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ ".afffagafffa."
- /* 2 */ ".f.........f."
- /* 3 */ ".f.........f."
- /* 4 */ ".f.........f."
- /* 5 */ ".affafffaffa."
- /* 6 */ "............."
-
- // Level 4
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "ccccccccccccc"
- /* 1 */ "haaaaaaaaaaah"
- /* 2 */ ".a...i.i...a."
- /* 3 */ ".a.........a."
- /* 4 */ ".a..j...j..a."
- /* 5 */ "kaaaaaaaaaaak"
- /* 6 */ "lllllllllllll"
-
- // Level 5
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "ccccccccccccc"
- /* 2 */ "haaaaaaaaaaah"
- /* 3 */ ".a.........a."
- /* 4 */ "kaaaaaaaaaaak"
- /* 5 */ "lllllllllllll"
- /* 6 */ "............."
-
- // Level 6
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "ccccccccccccc"
- /* 3 */ "aaaaaaaaaaaaa"
- /* 4 */ "lllllllllllll"
- /* 5 */ "............."
- /* 6 */ ".............",
-
- // Connectors:
- "-1: 6, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House13x7
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House13x9:
- // The data has been exported from the gallery Desert, area index 12, ID 116, created by xoft
- {
- // Size:
- 13, 8, 9, // SizeX = 13, SizeY = 8, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 13, 7, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:102: 0\n" /* glasspane */
- "g: 64:12\n" /* wooddoorblock */
- "h:128: 7\n" /* sandstonestairs */
- "i: 50: 3\n" /* torch */
- "j: 50: 4\n" /* torch */
- "k:128: 6\n" /* sandstonestairs */
- "l:128: 3\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "mmmmmaaammmmm"
- /* 1 */ "maaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaaam"
- /* 7 */ "maaaaaaaaaaam"
- /* 8 */ "mmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ ".....bcd....."
- /* 1 */ ".aaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaa."
- /* 6 */ ".aaaaaaaaaaa."
- /* 7 */ ".aaaaaaaaaaa."
- /* 8 */ "............."
-
- // Level 2
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ ".aaaaaeaaaaa."
- /* 2 */ ".a.........a."
- /* 3 */ ".a.........a."
- /* 4 */ ".a.........a."
- /* 5 */ ".a.........a."
- /* 6 */ ".a.........a."
- /* 7 */ ".aaaaaaaaaaa."
- /* 8 */ "............."
-
- // Level 3
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ ".afffagafffa."
- /* 2 */ ".f.........f."
- /* 3 */ ".f.........f."
- /* 4 */ ".a.........a."
- /* 5 */ ".f.........f."
- /* 6 */ ".f.........f."
- /* 7 */ ".affaffafffa."
- /* 8 */ "............."
-
- // Level 4
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "ccccccccccccc"
- /* 1 */ "haaaaaaaaaaah"
- /* 2 */ ".a...i.i...a."
- /* 3 */ ".a.........a."
- /* 4 */ ".a.........a."
- /* 5 */ ".a.........a."
- /* 6 */ ".a..j..j...a."
- /* 7 */ "kaaaaaaaaaaak"
- /* 8 */ "lllllllllllll"
-
- // Level 5
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "ccccccccccccc"
- /* 2 */ "haaaaaaaaaaah"
- /* 3 */ ".a.........a."
- /* 4 */ ".a.........a."
- /* 5 */ ".a.........a."
- /* 6 */ "kaaaaaaaaaaak"
- /* 7 */ "lllllllllllll"
- /* 8 */ "............."
-
- // Level 6
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "ccccccccccccc"
- /* 3 */ "haaaaaaaaaaah"
- /* 4 */ ".a.........a."
- /* 5 */ "kaaaaaaaaaaak"
- /* 6 */ "lllllllllllll"
- /* 7 */ "............."
- /* 8 */ "............."
-
- // Level 7
- /* z\x* 111 */
- /* * 0123456789012 */
- /* 0 */ "............."
- /* 1 */ "............."
- /* 2 */ "............."
- /* 3 */ "ccccccccccccc"
- /* 4 */ "aaaaaaaaaaaaa"
- /* 5 */ "lllllllllllll"
- /* 6 */ "............."
- /* 7 */ "............."
- /* 8 */ ".............",
-
- // Connectors:
- "-1: 6, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House13x9
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House15x9:
- // The data has been exported from the gallery Desert, area index 13, ID 118, created by xoft
- {
- // Size:
- 15, 8, 9, // SizeX = 15, SizeY = 8, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 15, 7, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:102: 0\n" /* glasspane */
- "g: 64:12\n" /* wooddoorblock */
- "h:128: 7\n" /* sandstonestairs */
- "i: 50: 3\n" /* torch */
- "j: 50: 4\n" /* torch */
- "k:128: 6\n" /* sandstonestairs */
- "l:128: 3\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "mmmmmaaammmmmmm"
- /* 1 */ "maaaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaaaaam"
- /* 7 */ "maaaaaaaaaaaaam"
- /* 8 */ "mmmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ ".....bcd......."
- /* 1 */ ".aaaaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaaaa."
- /* 6 */ ".aaaaaaaaaaaaa."
- /* 7 */ ".aaaaaaaaaaaaa."
- /* 8 */ "..............."
-
- // Level 2
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".aaaaaeaaaaaaa."
- /* 2 */ ".a...........a."
- /* 3 */ ".a...........a."
- /* 4 */ ".a...........a."
- /* 5 */ ".a...........a."
- /* 6 */ ".a...........a."
- /* 7 */ ".aaaaaaaaaaaaa."
- /* 8 */ "..............."
-
- // Level 3
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ ".afffagaffaffa."
- /* 2 */ ".f...........f."
- /* 3 */ ".f...........f."
- /* 4 */ ".a...........a."
- /* 5 */ ".f...........f."
- /* 6 */ ".f...........f."
- /* 7 */ ".affaffaffaffa."
- /* 8 */ "..............."
-
- // Level 4
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "ccccccccccccccc"
- /* 1 */ "haaaaaaaaaaaaah"
- /* 2 */ ".a...i.i..i..a."
- /* 3 */ ".a...........a."
- /* 4 */ ".a...........a."
- /* 5 */ ".a...........a."
- /* 6 */ ".a..j..j..j..a."
- /* 7 */ "kaaaaaaaaaaaaak"
- /* 8 */ "lllllllllllllll"
-
- // Level 5
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "ccccccccccccccc"
- /* 2 */ "haaaaaaaaaaaaah"
- /* 3 */ ".a...........a."
- /* 4 */ ".a...........a."
- /* 5 */ ".a...........a."
- /* 6 */ "kaaaaaaaaaaaaak"
- /* 7 */ "lllllllllllllll"
- /* 8 */ "..............."
-
- // Level 6
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "ccccccccccccccc"
- /* 3 */ "haaaaaaaaaaaaah"
- /* 4 */ ".a...........a."
- /* 5 */ "kaaaaaaaaaaaaak"
- /* 6 */ "lllllllllllllll"
- /* 7 */ "..............."
- /* 8 */ "..............."
-
- // Level 7
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "ccccccccccccccc"
- /* 4 */ "aaaaaaaaaaaaaaa"
- /* 5 */ "lllllllllllllll"
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "...............",
-
- // Connectors:
- "-1: 6, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House15x9
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House16x9:
- // The data has been exported from the gallery Desert, area index 16, ID 126, created by Aloe_vera
- {
- // Size:
- 16, 8, 9, // SizeX = 16, SizeY = 8, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 16, 7, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:102: 0\n" /* glasspane */
- "g: 64:12\n" /* wooddoorblock */
- "h:128: 7\n" /* sandstonestairs */
- "i: 50: 3\n" /* torch */
- "j: 50: 4\n" /* torch */
- "k:128: 6\n" /* sandstonestairs */
- "l:128: 3\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "mmmmmmmmaaammmmm"
- /* 1 */ "maaaaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaaaaaam"
- /* 7 */ "maaaaaaaaaaaaaam"
- /* 8 */ "mmmmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "........bcd....."
- /* 1 */ ".aaaaaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaaaaa."
- /* 6 */ ".aaaaaaaaaaaaaa."
- /* 7 */ ".aaaaaaaaaaaaaa."
- /* 8 */ "................"
-
- // Level 2
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ ".aaaaaaaaeaaaaa."
- /* 2 */ ".a............a."
- /* 3 */ ".a............a."
- /* 4 */ ".a............a."
- /* 5 */ ".a............a."
- /* 6 */ ".a............a."
- /* 7 */ ".aaaaaaaaaaaaaa."
- /* 8 */ "................"
-
- // Level 3
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ ".affafffagafffa."
- /* 2 */ ".f............f."
- /* 3 */ ".f............f."
- /* 4 */ ".a............a."
- /* 5 */ ".f............f."
- /* 6 */ ".f............f."
- /* 7 */ ".affaffafffaffa."
- /* 8 */ "................"
-
- // Level 4
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "cccccccccccccccc"
- /* 1 */ "haaaaaaaaaaaaaah"
- /* 2 */ ".a..i...i.i...a."
- /* 3 */ ".a............a."
- /* 4 */ ".a............a."
- /* 5 */ ".a............a."
- /* 6 */ ".a..j..j...j..a."
- /* 7 */ "kaaaaaaaaaaaaaak"
- /* 8 */ "llllllllllllllll"
-
- // Level 5
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "cccccccccccccccc"
- /* 2 */ "haaaaaaaaaaaaaah"
- /* 3 */ ".a............a."
- /* 4 */ ".a............a."
- /* 5 */ ".a............a."
- /* 6 */ "kaaaaaaaaaaaaaak"
- /* 7 */ "llllllllllllllll"
- /* 8 */ "................"
-
- // Level 6
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "cccccccccccccccc"
- /* 3 */ "haaaaaaaaaaaaaah"
- /* 4 */ ".a............a."
- /* 5 */ "kaaaaaaaaaaaaaak"
- /* 6 */ "llllllllllllllll"
- /* 7 */ "................"
- /* 8 */ "................"
-
- // Level 7
- /* z\x* 111111 */
- /* * 0123456789012345 */
- /* 0 */ "................"
- /* 1 */ "................"
- /* 2 */ "................"
- /* 3 */ "cccccccccccccccc"
- /* 4 */ "aaaaaaaaaaaaaaaa"
- /* 5 */ "llllllllllllllll"
- /* 6 */ "................"
- /* 7 */ "................"
- /* 8 */ "................",
-
- // Connectors:
- "-1: 9, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House16x9
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House7x7:
- // The data has been exported from the gallery Desert, area index 8, ID 112, created by Aloe_vera
- {
- // Size:
- 7, 7, 7, // SizeX = 7, SizeY = 7, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 7, 6, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:102: 0\n" /* glasspane */
- "g: 64:12\n" /* wooddoorblock */
- "h:128: 7\n" /* sandstonestairs */
- "i: 50: 3\n" /* torch */
- "j:128: 6\n" /* sandstonestairs */
- "k:128: 3\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "mmmaaam"
- /* 1 */ "maaaaam"
- /* 2 */ "maaaaam"
- /* 3 */ "maaaaam"
- /* 4 */ "maaaaam"
- /* 5 */ "maaaaam"
- /* 6 */ "mmmmmmm"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "...bcd."
- /* 1 */ ".aaaaa."
- /* 2 */ ".aaaaa."
- /* 3 */ ".aaaaa."
- /* 4 */ ".aaaaa."
- /* 5 */ ".aaaaa."
- /* 6 */ "......."
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".aaaea."
- /* 2 */ ".a...a."
- /* 3 */ ".a...a."
- /* 4 */ ".a...a."
- /* 5 */ ".aaaaa."
- /* 6 */ "......."
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".afaga."
- /* 2 */ ".f...f."
- /* 3 */ ".f...f."
- /* 4 */ ".f...f."
- /* 5 */ ".afffa."
- /* 6 */ "......."
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "ccccccc"
- /* 1 */ "haaaaah"
- /* 2 */ ".a.i.a."
- /* 3 */ ".a...a."
- /* 4 */ ".a...a."
- /* 5 */ "jaaaaaj"
- /* 6 */ "kkkkkkk"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "ccccccc"
- /* 2 */ "haaaaah"
- /* 3 */ ".a...a."
- /* 4 */ "jaaaaaj"
- /* 5 */ "kkkkkkk"
- /* 6 */ "......."
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "......."
- /* 2 */ "ccccccc"
- /* 3 */ "aaaaaaa"
- /* 4 */ "kkkkkkk"
- /* 5 */ "......."
- /* 6 */ ".......",
-
- // Connectors:
- "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House7x7
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House9x7:
- // The data has been exported from the gallery Desert, area index 9, ID 113, created by xoft
- {
- // Size:
- 9, 7, 7, // SizeX = 9, SizeY = 7, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 9, 6, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:102: 0\n" /* glasspane */
- "g: 64:12\n" /* wooddoorblock */
- "h:128: 7\n" /* sandstonestairs */
- "i: 50: 3\n" /* torch */
- "j: 50: 4\n" /* torch */
- "k:128: 6\n" /* sandstonestairs */
- "l:128: 3\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "mmmaaammm"
- /* 1 */ "maaaaaaam"
- /* 2 */ "maaaaaaam"
- /* 3 */ "maaaaaaam"
- /* 4 */ "maaaaaaam"
- /* 5 */ "maaaaaaam"
- /* 6 */ "mmmmmmmmm"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "...bcd..."
- /* 1 */ ".aaaaaaa."
- /* 2 */ ".aaaaaaa."
- /* 3 */ ".aaaaaaa."
- /* 4 */ ".aaaaaaa."
- /* 5 */ ".aaaaaaa."
- /* 6 */ "........."
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ ".aaaeaaa."
- /* 2 */ ".a.....a."
- /* 3 */ ".a.....a."
- /* 4 */ ".a.....a."
- /* 5 */ ".aaaaaaa."
- /* 6 */ "........."
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ ".afagafa."
- /* 2 */ ".f.....f."
- /* 3 */ ".f.....f."
- /* 4 */ ".f.....f."
- /* 5 */ ".affaffa."
- /* 6 */ "........."
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "ccccccccc"
- /* 1 */ "haaaaaaah"
- /* 2 */ ".a.i.i.a."
- /* 3 */ ".a.....a."
- /* 4 */ ".a..j..a."
- /* 5 */ "kaaaaaaak"
- /* 6 */ "lllllllll"
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ "ccccccccc"
- /* 2 */ "haaaaaaah"
- /* 3 */ ".a.....a."
- /* 4 */ "kaaaaaaak"
- /* 5 */ "lllllllll"
- /* 6 */ "........."
-
- // Level 6
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ "........."
- /* 2 */ "ccccccccc"
- /* 3 */ "aaaaaaaaa"
- /* 4 */ "lllllllll"
- /* 5 */ "........."
- /* 6 */ ".........",
-
- // Connectors:
- "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House9x7
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // House9x9:
- // The data has been exported from the gallery Desert, area index 10, ID 114, created by xoft
- {
- // Size:
- 9, 8, 9, // SizeX = 9, SizeY = 8, SizeZ = 9
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 9, 7, 9, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e: 64: 7\n" /* wooddoorblock */
- "f:102: 0\n" /* glasspane */
- "g: 64:12\n" /* wooddoorblock */
- "h:128: 7\n" /* sandstonestairs */
- "i: 50: 3\n" /* torch */
- "j: 50: 4\n" /* torch */
- "k:128: 6\n" /* sandstonestairs */
- "l:128: 3\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 012345678 */
- /* 0 */ "mmmaaammm"
- /* 1 */ "maaaaaaam"
- /* 2 */ "maaaaaaam"
- /* 3 */ "maaaaaaam"
- /* 4 */ "maaaaaaam"
- /* 5 */ "maaaaaaam"
- /* 6 */ "maaaaaaam"
- /* 7 */ "maaaaaaam"
- /* 8 */ "mmmmmmmmm"
-
- // Level 1
- /* z\x* 012345678 */
- /* 0 */ "...bcd..."
- /* 1 */ ".aaaaaaa."
- /* 2 */ ".aaaaaaa."
- /* 3 */ ".aaaaaaa."
- /* 4 */ ".aaaaaaa."
- /* 5 */ ".aaaaaaa."
- /* 6 */ ".aaaaaaa."
- /* 7 */ ".aaaaaaa."
- /* 8 */ "........."
-
- // Level 2
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ ".aaaeaaa."
- /* 2 */ ".a.....a."
- /* 3 */ ".a.....a."
- /* 4 */ ".a.....a."
- /* 5 */ ".a.....a."
- /* 6 */ ".a.....a."
- /* 7 */ ".aaaaaaa."
- /* 8 */ "........."
-
- // Level 3
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ ".afagafa."
- /* 2 */ ".f.....f."
- /* 3 */ ".f.....f."
- /* 4 */ ".a.....a."
- /* 5 */ ".f.....f."
- /* 6 */ ".f.....f."
- /* 7 */ ".affaffa."
- /* 8 */ "........."
-
- // Level 4
- /* z\x* 012345678 */
- /* 0 */ "ccccccccc"
- /* 1 */ "haaaaaaah"
- /* 2 */ ".a.i.i.a."
- /* 3 */ ".a.....a."
- /* 4 */ ".a.....a."
- /* 5 */ ".a.....a."
- /* 6 */ ".a..j..a."
- /* 7 */ "kaaaaaaak"
- /* 8 */ "lllllllll"
-
- // Level 5
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ "ccccccccc"
- /* 2 */ "haaaaaaah"
- /* 3 */ ".a.....a."
- /* 4 */ ".a.....a."
- /* 5 */ ".a.....a."
- /* 6 */ "kaaaaaaak"
- /* 7 */ "lllllllll"
- /* 8 */ "........."
-
- // Level 6
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ "........."
- /* 2 */ "ccccccccc"
- /* 3 */ "haaaaaaah"
- /* 4 */ ".a.....a."
- /* 5 */ "kaaaaaaak"
- /* 6 */ "lllllllll"
- /* 7 */ "........."
- /* 8 */ "........."
-
- // Level 7
- /* z\x* 012345678 */
- /* 0 */ "........."
- /* 1 */ "........."
- /* 2 */ "........."
- /* 3 */ "ccccccccc"
- /* 4 */ "aaaaaaaaa"
- /* 5 */ "lllllllll"
- /* 6 */ "........."
- /* 7 */ "........."
- /* 8 */ ".........",
-
- // Connectors:
- "-1: 4, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // House9x9
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseL14x12:
- // The data has been exported from the gallery Desert, area index 14, ID 124, created by Aloe_vera
- {
- // Size:
- 14, 8, 12, // SizeX = 14, SizeY = 8, SizeZ = 12
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 14, 7, 12, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e:128: 3\n" /* sandstonestairs */
- "f: 64: 3\n" /* wooddoorblock */
- "g: 64: 1\n" /* wooddoorblock */
- "h:102: 0\n" /* glasspane */
- "i: 64: 8\n" /* wooddoorblock */
- "j:128: 7\n" /* sandstonestairs */
- "k: 50: 3\n" /* torch */
- "l: 50: 2\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n: 50: 4\n" /* torch */
- "o:128: 6\n" /* sandstonestairs */
- "p: 50: 1\n" /* torch */
- "q:128: 5\n" /* sandstonestairs */
- "r:128: 4\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ "mmmmaaammmmmmm"
- /* 1 */ "maaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaaam"
- /* 6 */ "maaaaaaaaaaaam"
- /* 7 */ "maaaaaaaaaaaam"
- /* 8 */ "mmmmaaaaaaaaam"
- /* 9 */ "mmmmmmaaaaaaam"
- /* 10 */ "mmmmmmaaaaaaam"
- /* 11 */ "mmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ "....bcd......."
- /* 1 */ ".aaaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaaa."
- /* 6 */ ".aaaaaaaaaaaa."
- /* 7 */ ".aaaaaaaaaaaa."
- /* 8 */ "....beaaaaaaa."
- /* 9 */ "mmmmm.aaaaaaa."
- /* 10 */ "mmmmm.aaaaaaa."
- /* 11 */ "mmmmm........."
-
- // Level 2
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".............."
- /* 1 */ ".aaaafaaaaaaa."
- /* 2 */ ".a..........a."
- /* 3 */ ".a..........a."
- /* 4 */ ".a..........a."
- /* 5 */ ".a..........a."
- /* 6 */ ".a..........a."
- /* 7 */ ".aaaaga.....a."
- /* 8 */ "......a.....a."
- /* 9 */ "mmmmm.a.....a."
- /* 10 */ "mmmmm.aaaaaaa."
- /* 11 */ "mmmmm........."
-
- // Level 3
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".............."
- /* 1 */ ".ahhaiahhahha."
- /* 2 */ ".h..........h."
- /* 3 */ ".h..........h."
- /* 4 */ ".a..........a."
- /* 5 */ ".h..........h."
- /* 6 */ ".h..........h."
- /* 7 */ ".ahhaia.....a."
- /* 8 */ "......h.....h."
- /* 9 */ "mmmmm.h.....h."
- /* 10 */ "mmmmm.ahhahha."
- /* 11 */ "mmmmm........."
-
- // Level 4
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ "cccccccccccccc"
- /* 1 */ "jaaaaaaaaaaaad"
- /* 2 */ ".a..k.k.....ad"
- /* 3 */ ".a..........ad"
- /* 4 */ ".a.........lad"
- /* 5 */ ".a..........ad"
- /* 6 */ ".a..n.n.....ad"
- /* 7 */ "oaaaaaap...lad"
- /* 8 */ "eeeeeba.....ad"
- /* 9 */ "mmmmmba.....ad"
- /* 10 */ "mmmmmbaaaaaaad"
- /* 11 */ "mmmmmbq.....rd"
-
- // Level 5
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".............."
- /* 1 */ "ccccccccccccd."
- /* 2 */ "jaaaaaaaaaaad."
- /* 3 */ ".a.........ad."
- /* 4 */ ".a.........ad."
- /* 5 */ ".a.........ad."
- /* 6 */ "oaaaaaaa...ad."
- /* 7 */ "eeeeeeba...ad."
- /* 8 */ "......ba...ad."
- /* 9 */ "mmmmm.ba...ad."
- /* 10 */ "mmmmm.baaaaad."
- /* 11 */ "mmmmm.bq...rd."
-
- // Level 6
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".............."
- /* 1 */ ".............."
- /* 2 */ "cccccccccccc.."
- /* 3 */ "jaaaaaaaaaad.."
- /* 4 */ ".a........ad.."
- /* 5 */ "oaaaaaaaa.ad.."
- /* 6 */ "eeeeeeeea.ad.."
- /* 7 */ ".......ba.ad.."
- /* 8 */ ".......ba.ad.."
- /* 9 */ "mmmmm..ba.ad.."
- /* 10 */ "mmmmm..baaad.."
- /* 11 */ "mmmmm..bq.rd.."
-
- // Level 7
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".............."
- /* 1 */ ".............."
- /* 2 */ ".............."
- /* 3 */ "ccccccccccc..."
- /* 4 */ "aaaaaaaaaad..."
- /* 5 */ "eeeeeeeebad..."
- /* 6 */ "........bad..."
- /* 7 */ "........bad..."
- /* 8 */ "........bad..."
- /* 9 */ "mmmmm...bad..."
- /* 10 */ "mmmmm...bad..."
- /* 11 */ "mmmmm...bad...",
-
- // Connectors:
- "-1: 5, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseL14x12
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // HouseL14x12:
- // The data has been exported from the gallery Desert, area index 7, ID 82, created by Aloe_vera
- {
- // Size:
- 14, 7, 12, // SizeX = 14, SizeY = 7, SizeZ = 12
-
- // Hitbox (relative to bounding box):
- -1, 0, 0, // MinX, MinY, MinZ
- 14, 6, 12, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 0\n" /* sandstonestairs */
- "c:128: 2\n" /* sandstonestairs */
- "d:128: 1\n" /* sandstonestairs */
- "e:128: 3\n" /* sandstonestairs */
- "f: 64: 7\n" /* wooddoorblock */
- "g: 64: 5\n" /* wooddoorblock */
- "h:102: 0\n" /* glasspane */
- "i: 64:12\n" /* wooddoorblock */
- "j:128: 7\n" /* sandstonestairs */
- "k: 50: 3\n" /* torch */
- "l: 50: 4\n" /* torch */
- "m: 19: 0\n" /* sponge */
- "n:128: 6\n" /* sandstonestairs */
- "o:128: 5\n" /* sandstonestairs */
- "p:128: 4\n" /* sandstonestairs */
- "q: 50: 1\n" /* torch */,
-
- // Block data:
- // Level 0
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ "mmmmmmmaaammmm"
- /* 1 */ "maaaaaaaaaaaam"
- /* 2 */ "maaaaaaaaaaaam"
- /* 3 */ "maaaaaaaaaaaam"
- /* 4 */ "maaaaaaaaaaaam"
- /* 5 */ "maaaaaaaaaaaam"
- /* 6 */ "mmmmaaamaaaaam"
- /* 7 */ "mmmmmmmmaaaaam"
- /* 8 */ "mmmmmmmmaaaaam"
- /* 9 */ "mmmmmmmmaaaaam"
- /* 10 */ "mmmmmmmmaaaaam"
- /* 11 */ "mmmmmmmmmmmmmm"
-
- // Level 1
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".......bcd...."
- /* 1 */ ".aaaaaaaaaaaa."
- /* 2 */ ".aaaaaaaaaaaa."
- /* 3 */ ".aaaaaaaaaaaa."
- /* 4 */ ".aaaaaaaaaaaa."
- /* 5 */ ".aaaaaaaaaaaa."
- /* 6 */ "....bed.aaaaa."
- /* 7 */ "........aaaaa."
- /* 8 */ "........aaaaa."
- /* 9 */ "........aaaaa."
- /* 10 */ "........aaaaa."
- /* 11 */ ".............."
-
- // Level 2
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".............."
- /* 1 */ ".aaaaaaafaaaa."
- /* 2 */ ".a..........a."
- /* 3 */ ".a..........a."
- /* 4 */ ".a..........a."
- /* 5 */ ".aaaagaaa...a."
- /* 6 */ "........a...a."
- /* 7 */ "........a...a."
- /* 8 */ "........a...a."
- /* 9 */ "........a...a."
- /* 10 */ "........aaaaa."
- /* 11 */ ".............."
-
- // Level 3
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".............."
- /* 1 */ ".ahhahhaiahha."
- /* 2 */ ".h..........h."
- /* 3 */ ".h..........h."
- /* 4 */ ".h..........a."
- /* 5 */ ".ahhaiahh...h."
- /* 6 */ "........h...h."
- /* 7 */ "........a...a."
- /* 8 */ "........h...h."
- /* 9 */ "........h...h."
- /* 10 */ "........ahhha."
- /* 11 */ ".............."
-
- // Level 4
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ "cccccccccccccc"
- /* 1 */ "jaaaaaaaaaaaad"
- /* 2 */ ".a.....k.k..ad"
- /* 3 */ ".a..........ad"
- /* 4 */ ".a..l.l.....ad"
- /* 5 */ "naaaaaaaa...ad"
- /* 6 */ "eeeeeeeba...ad"
- /* 7 */ ".......ba...ad"
- /* 8 */ ".......ba...ad"
- /* 9 */ ".......ba...ad"
- /* 10 */ ".......baaaaad"
- /* 11 */ ".......bo...pd"
-
- // Level 5
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".............."
- /* 1 */ "ccccccccccccc."
- /* 2 */ "jaaaaaaaaaaad."
- /* 3 */ ".aq........ad."
- /* 4 */ "naaaaaaaaa.ad."
- /* 5 */ "eeeeeeeeba.ad."
- /* 6 */ "........ba.ad."
- /* 7 */ "........ba.ad."
- /* 8 */ "........ba.ad."
- /* 9 */ "........balad."
- /* 10 */ "........baaad."
- /* 11 */ "........bo.pd."
-
- // Level 6
- /* z\x* 1111 */
- /* * 01234567890123 */
- /* 0 */ ".............."
- /* 1 */ ".............."
- /* 2 */ "cccccccccccc.."
- /* 3 */ "aaaaaaaaaaad.."
- /* 4 */ "eeeeeeeeebad.."
- /* 5 */ ".........bad.."
- /* 6 */ ".........bad.."
- /* 7 */ ".........bad.."
- /* 8 */ ".........bad.."
- /* 9 */ ".........bad.."
- /* 10 */ ".........bad.."
- /* 11 */ ".........bad..",
-
- // Connectors:
- "-1: 8, 1, 0: 2\n" /* Type -1, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // HouseL14x12
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // SingleField:
- // The data has been exported from the gallery Desert, area index 17, ID 127, created by Aloe_vera
- {
- // Size:
- 10, 3, 7, // SizeX = 10, SizeY = 3, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- 0, 0, -1, // MinX, MinY, MinZ
- 10, 2, 7, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b: 60: 7\n" /* tilleddirt */
- "c: 8: 0\n" /* water */
- "d: 50: 5\n" /* torch */
- "e: 59: 7\n" /* crops */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "aaaaaaaaaa"
- /* 1 */ "aaaaaaaaaa"
- /* 2 */ "aaaaaaaaaa"
- /* 3 */ "aaaaaaaaaa"
- /* 4 */ "aaaaaaaaaa"
- /* 5 */ "aaaaaaaaaa"
- /* 6 */ "aaaaaaaaaa"
-
- // Level 1
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "aaaaaaaaaa"
- /* 1 */ "abbbbbbbba"
- /* 2 */ "abbbbbbbba"
- /* 3 */ "acccccccca"
- /* 4 */ "abbbbbbbba"
- /* 5 */ "abbbbbbbba"
- /* 6 */ "aaaaaaaaaa"
-
- // Level 2
- /* z\x* */
- /* * 0123456789 */
- /* 0 */ "d........d"
- /* 1 */ ".eeeeeeee."
- /* 2 */ ".eeeeeeee."
- /* 3 */ ".........."
- /* 4 */ ".eeeeeeee."
- /* 5 */ ".eeeeeeee."
- /* 6 */ "d........d",
-
- // Connectors:
- "-1: 0, 1, 3: 4\n" /* Type -1, direction X- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // SingleField
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // SmallHut:
- // The data has been exported from the gallery Desert, area index 4, ID 68, created by tonibm1999
- {
- // Size:
- 5, 6, 6, // SizeX = 5, SizeY = 6, SizeZ = 6
-
- // Hitbox (relative to bounding box):
- -1, 0, -1, // MinX, MinY, MinZ
- 5, 5, 5, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 24: 0\n" /* sandstone */
- "b:128: 3\n" /* sandstonestairs */
- "c: 24: 2\n" /* sandstone */
- "d: 50: 5\n" /* torch */
- "e: 26:10\n" /* bedblock */
- "f: 26: 2\n" /* bedblock */
- "g: 64: 5\n" /* wooddoorblock */
- "h: 64:12\n" /* wooddoorblock */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 01234 */
- /* 0 */ "aaaaa"
- /* 1 */ "aaaaa"
- /* 2 */ "aaaaa"
- /* 3 */ "aaaaa"
- /* 4 */ "aaaaa"
- /* 5 */ "mmamm"
-
- // Level 1
- /* z\x* 01234 */
- /* 0 */ "aaaaa"
- /* 1 */ "aaaaa"
- /* 2 */ "aaaaa"
- /* 3 */ "aaaaa"
- /* 4 */ "aaaaa"
- /* 5 */ "..b.."
-
- // Level 2
- /* z\x* 01234 */
- /* 0 */ "accca"
- /* 1 */ "cdedc"
- /* 2 */ "c.f.c"
- /* 3 */ "c...c"
- /* 4 */ "acgca"
- /* 5 */ "....."
-
- // Level 3
- /* z\x* 01234 */
- /* 0 */ "ac.ca"
- /* 1 */ "c...c"
- /* 2 */ "....."
- /* 3 */ "c...c"
- /* 4 */ "achca"
- /* 5 */ "....."
-
- // Level 4
- /* z\x* 01234 */
- /* 0 */ "accca"
- /* 1 */ "c...c"
- /* 2 */ "c...c"
- /* 3 */ "c...c"
- /* 4 */ "accca"
- /* 5 */ "....."
-
- // Level 5
- /* z\x* 01234 */
- /* 0 */ ".aaa."
- /* 1 */ "aaaaa"
- /* 2 */ "aaaaa"
- /* 3 */ "aaaaa"
- /* 4 */ ".aaa."
- /* 5 */ ".....",
-
- // Connectors:
- "-1: 2, 1, 5: 3\n" /* Type -1, direction Z+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // SmallHut
-}; // g_SandVillagePrefabs
-
-
-
-
-
-
-const cPrefab::sDef g_SandVillageStartingPrefabs[] =
-{
- ////////////////////////////////////////////////////////////////////////////////
- // RoofedWell:
- // The data has been exported from the gallery Desert, area index 43, ID 274, created by Aloe_vera
- {
- // Size:
- 7, 14, 7, // SizeX = 7, SizeY = 14, SizeZ = 7
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 6, 13, 6, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 1: 0\n" /* stone */
- "b: 24: 0\n" /* sandstone */
- "c: 8: 0\n" /* water */
- "d: 12: 0\n" /* sand */
- "e: 4: 0\n" /* cobblestone */
- "f: 13: 0\n" /* gravel */
- "g:118: 3\n" /* cauldronblock */
- "h: 85: 0\n" /* fence */
- "i:128: 2\n" /* sandstonestairs */
- "j:128: 7\n" /* sandstonestairs */
- "k:128: 4\n" /* sandstonestairs */
- "l:128: 5\n" /* sandstonestairs */
- "m: 19: 0\n" /* sponge */
- "n:128: 6\n" /* sandstonestairs */
- "o:128: 3\n" /* sandstonestairs */,
-
- // Block data:
- // Level 0
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "aaaaaaa"
- /* 2 */ "aaaaaaa"
- /* 3 */ "aaaaaaa"
- /* 4 */ "aaaaaaa"
- /* 5 */ "aaaaaaa"
- /* 6 */ "aaaaaaa"
-
- // Level 1
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "abbbbba"
- /* 2 */ "abcccba"
- /* 3 */ "abcccba"
- /* 4 */ "abcccba"
- /* 5 */ "abbbbba"
- /* 6 */ "aaaaaaa"
-
- // Level 2
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "abbbbba"
- /* 2 */ "abcccba"
- /* 3 */ "abcccba"
- /* 4 */ "abcccba"
- /* 5 */ "abbbbba"
- /* 6 */ "aaaaaaa"
-
- // Level 3
- /* z\x* 0123456 */
- /* 0 */ "aaaaaaa"
- /* 1 */ "abbbbba"
- /* 2 */ "abcccba"
- /* 3 */ "abcccba"
- /* 4 */ "abcccba"
- /* 5 */ "abbbbba"
- /* 6 */ "aaaaaaa"
-
- // Level 4
- /* z\x* 0123456 */
- /* 0 */ "ddddddd"
- /* 1 */ "dbbbbbd"
- /* 2 */ "dbcccbd"
- /* 3 */ "dbcccbd"
- /* 4 */ "dbcccbd"
- /* 5 */ "dbbbbbd"
- /* 6 */ "ddddddd"
-
- // Level 5
- /* z\x* 0123456 */
- /* 0 */ "ddddddd"
- /* 1 */ "dbbbbbd"
- /* 2 */ "dbcccbd"
- /* 3 */ "dbcccbd"
- /* 4 */ "dbcccbd"
- /* 5 */ "dbbbbbd"
- /* 6 */ "ddddddd"
-
- // Level 6
- /* z\x* 0123456 */
- /* 0 */ "ddeeedd"
- /* 1 */ "dbbbbbd"
- /* 2 */ "ebcccbe"
- /* 3 */ "ebcccbe"
- /* 4 */ "ebcccbe"
- /* 5 */ "dbbbbbd"
- /* 6 */ "ddeeedd"
-
- // Level 7
- /* z\x* 0123456 */
- /* 0 */ "ddfffdd"
- /* 1 */ "dbbbbbd"
- /* 2 */ "fbcccbf"
- /* 3 */ "fbcccbf"
- /* 4 */ "fbcccbf"
- /* 5 */ "dbbbbbd"
- /* 6 */ "ddfffdd"
-
- // Level 8
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".bbbbb."
- /* 2 */ ".b...b."
- /* 3 */ ".b.g.b."
- /* 4 */ ".b...b."
- /* 5 */ ".bbbbb."
- /* 6 */ "......."
-
- // Level 9
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".h...h."
- /* 2 */ "......."
- /* 3 */ "...h..."
- /* 4 */ "......."
- /* 5 */ ".h...h."
- /* 6 */ "......."
-
- // Level 10
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ ".h...h."
- /* 2 */ "......."
- /* 3 */ "...h..."
- /* 4 */ "......."
- /* 5 */ ".h...h."
- /* 6 */ "......."
-
- // Level 11
- /* z\x* 0123456 */
- /* 0 */ "iiiiiii"
- /* 1 */ "jbjjjbj"
- /* 2 */ ".k...l."
- /* 3 */ ".k.h.l."
- /* 4 */ ".k...l."
- /* 5 */ "nbnnnbn"
- /* 6 */ "ooooooo"
-
- // Level 12
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "iiiiiii"
- /* 2 */ "jb...bj"
- /* 3 */ ".b.h.b."
- /* 4 */ "nb...bn"
- /* 5 */ "ooooooo"
- /* 6 */ "......."
-
- // Level 13
- /* z\x* 0123456 */
- /* 0 */ "......."
- /* 1 */ "......."
- /* 2 */ "iiiiiii"
- /* 3 */ "bbbbbbb"
- /* 4 */ "ooooooo"
- /* 5 */ "......."
- /* 6 */ ".......",
-
- // Connectors:
- "2: 6, 8, 3: 5\n" /* Type 2, direction X+ */
- "2: 3, 8, 6: 3\n" /* Type 2, direction Z+ */
- "2: 0, 8, 3: 4\n" /* Type 2, direction X- */
- "2: 3, 8, 0: 2\n" /* Type 2, direction Z- */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // RoofedWell
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Well:
- // The data has been exported from the gallery Desert, area index 0, ID 1, created by Aloe_vera
- {
- // Size:
- 4, 13, 4, // SizeX = 4, SizeY = 13, SizeZ = 4
-
- // Hitbox (relative to bounding box):
- 0, 0, 0, // MinX, MinY, MinZ
- 3, 12, 3, // MaxX, MaxY, MaxZ
-
- // Block definitions:
- ".: 0: 0\n" /* air */
- "a: 1: 0\n" /* stone */
- "b: 24: 0\n" /* sandstone */
- "c: 8: 0\n" /* water */
- "d: 85: 0\n" /* fence */
- "m: 19: 0\n" /* sponge */,
-
- // Block data:
- // Level 0
- /* z\x* 0123 */
- /* 0 */ "aaaa"
- /* 1 */ "aaaa"
- /* 2 */ "aaaa"
- /* 3 */ "aaaa"
-
- // Level 1
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 2
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 3
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 4
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 5
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 6
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 7
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bccb"
- /* 2 */ "bccb"
- /* 3 */ "bbbb"
-
- // Level 8
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "b..b"
- /* 2 */ "b..b"
- /* 3 */ "bbbb"
-
- // Level 9
- /* z\x* 0123 */
- /* 0 */ "d..d"
- /* 1 */ "...."
- /* 2 */ "...."
- /* 3 */ "d..d"
-
- // Level 10
- /* z\x* 0123 */
- /* 0 */ "d..d"
- /* 1 */ "...."
- /* 2 */ "...."
- /* 3 */ "d..d"
-
- // Level 11
- /* z\x* 0123 */
- /* 0 */ "d..d"
- /* 1 */ "...."
- /* 2 */ "...."
- /* 3 */ "d..d"
-
- // Level 12
- /* z\x* 0123 */
- /* 0 */ "bbbb"
- /* 1 */ "bbbb"
- /* 2 */ "bbbb"
- /* 3 */ "bbbb",
-
- // Connectors:
- "2: 2, 8, 0: 2\n" /* Type 2, direction Z- */
- "2: 0, 8, 1: 4\n" /* Type 2, direction X- */
- "2: 1, 8, 3: 3\n" /* Type 2, direction Z+ */
- "2: 3, 8, 2: 5\n" /* Type 2, direction X+ */,
-
- // AllowedRotations:
- 7, /* 1, 2, 3 CCW rotation allowed */
-
- // Merge strategy:
- cBlockArea::msSpongePrint,
-
- // ShouldExtendFloor:
- true,
-
- // DefaultWeight:
- 100,
-
- // DepthWeight:
- "",
-
- // AddWeightIfSame:
- 0,
-
- // MoveToGround:
- true,
- }, // Well
-};
-
-
-
-
-
-// The prefab counts:
-
-const size_t g_SandVillagePrefabsCount = ARRAYCOUNT(g_SandVillagePrefabs);
-
-const size_t g_SandVillageStartingPrefabsCount = ARRAYCOUNT(g_SandVillageStartingPrefabs);
-
diff --git a/src/Generating/Prefabs/SandVillagePrefabs.h b/src/Generating/Prefabs/SandVillagePrefabs.h
deleted file mode 100644
index 7b00db56f..000000000
--- a/src/Generating/Prefabs/SandVillagePrefabs.h
+++ /dev/null
@@ -1,15 +0,0 @@
-
-// SandVillagePrefabs.h
-
-// Declares the prefabs in the group SandVillage
-
-#include "../Prefab.h"
-
-
-
-
-
-extern const cPrefab::sDef g_SandVillagePrefabs[];
-extern const cPrefab::sDef g_SandVillageStartingPrefabs[];
-extern const size_t g_SandVillagePrefabsCount;
-extern const size_t g_SandVillageStartingPrefabsCount;
diff --git a/src/Generating/Prefabs/UnderwaterBasePrefabs.cpp b/src/Generating/Prefabs/UnderwaterBasePrefabs.cpp
index 1655f50b9..112531641 100644
--- a/src/Generating/Prefabs/UnderwaterBasePrefabs.cpp
+++ b/src/Generating/Prefabs/UnderwaterBasePrefabs.cpp
@@ -32,9 +32,9 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
"b: 20: 0\n" /* glass */
"c: 5: 5\n" /* wood */
"d: 8: 0\n" /* water */
- "e: 64: 4\n" /* wooddoorblock */
- "f: 64:12\n" /* wooddoorblock */
- "g: 64:13\n" /* wooddoorblock */
+ "e: 64: 0\n" /* wooddoorblock */
+ "f: 64: 8\n" /* wooddoorblock */
+ "g: 64: 9\n" /* wooddoorblock */
"m: 19: 0\n" /* sponge */,
// Block data:
@@ -280,18 +280,16 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
".: 0: 0\n" /* air */
"a: 5: 5\n" /* wood */
"b: 5: 0\n" /* wood */
- "c: 64: 5\n" /* wooddoorblock */
- "d: 64: 2\n" /* wooddoorblock */
- "e: 64: 4\n" /* wooddoorblock */
- "f: 64: 1\n" /* wooddoorblock */
- "g: 20: 0\n" /* glass */
- "h: 64:12\n" /* wooddoorblock */
- "i: 76: 3\n" /* redstonetorchon */
- "j: 64: 8\n" /* wooddoorblock */
- "k: 76: 4\n" /* redstonetorchon */
- "l: 76: 2\n" /* redstonetorchon */
- "m: 19: 0\n" /* sponge */
- "n: 76: 1\n" /* redstonetorchon */,
+ "c: 64: 2\n" /* wooddoorblock */
+ "d: 64: 1\n" /* wooddoorblock */
+ "e: 20: 0\n" /* glass */
+ "f: 64: 9\n" /* wooddoorblock */
+ "g: 76: 3\n" /* redstonetorchon */
+ "h: 64: 8\n" /* wooddoorblock */
+ "i: 76: 4\n" /* redstonetorchon */
+ "j: 76: 2\n" /* redstonetorchon */
+ "k: 76: 1\n" /* redstonetorchon */
+ "m: 19: 0\n" /* sponge */,
// Block data:
// Level 0
@@ -313,28 +311,28 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
/* * 0123456789 */
/* 0 */ "abbbbbmmmm"
/* 1 */ "c.....bbmm"
- /* 2 */ "d.......bm"
+ /* 2 */ "c.......bm"
/* 3 */ "abb.....bm"
/* 4 */ "mmmbb....b"
/* 5 */ "mmmmmb...b"
/* 6 */ "mmmmmb...b"
/* 7 */ "mmmmmmb..b"
/* 8 */ "mmmmmmb..b"
- /* 9 */ "mmmmmmaefa"
+ /* 9 */ "mmmmmmadda"
// Level 2
/* z\x* */
/* * 0123456789 */
- /* 0 */ "abggbbmmmm"
- /* 1 */ "h...i.bbmm"
- /* 2 */ "j.......bm"
- /* 3 */ "abbk....bm"
+ /* 0 */ "abeebbmmmm"
+ /* 1 */ "f...g.bbmm"
+ /* 2 */ "h.......bm"
+ /* 3 */ "abbi....bm"
/* 4 */ "mmmbb....b"
- /* 5 */ "mmmmmb..lb"
- /* 6 */ "mmmmmbn..g"
- /* 7 */ "mmmmmmb..g"
+ /* 5 */ "mmmmmb..jb"
+ /* 6 */ "mmmmmbk..e"
+ /* 7 */ "mmmmmmb..e"
/* 8 */ "mmmmmmb..b"
- /* 9 */ "mmmmmmahja"
+ /* 9 */ "mmmmmmafha"
// Level 3
/* z\x* */
@@ -396,20 +394,17 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
"a: 5: 5\n" /* wood */
"b: 5: 0\n" /* wood */
"c: 64: 3\n" /* wooddoorblock */
- "d: 64: 6\n" /* wooddoorblock */
- "e: 64: 5\n" /* wooddoorblock */
- "f: 64: 0\n" /* wooddoorblock */
- "g: 64: 2\n" /* wooddoorblock */
- "h: 64: 1\n" /* wooddoorblock */
- "i: 64: 8\n" /* wooddoorblock */
- "j: 64:12\n" /* wooddoorblock */
- "k: 20: 0\n" /* glass */
- "l: 76: 1\n" /* redstonetorchon */
+ "d: 64: 2\n" /* wooddoorblock */
+ "e: 64: 0\n" /* wooddoorblock */
+ "f: 64: 1\n" /* wooddoorblock */
+ "g: 64: 8\n" /* wooddoorblock */
+ "h: 64: 9\n" /* wooddoorblock */
+ "i: 20: 0\n" /* glass */
+ "j: 76: 1\n" /* redstonetorchon */
+ "k: 76: 2\n" /* redstonetorchon */
+ "l: 76: 3\n" /* redstonetorchon */
"m: 19: 0\n" /* sponge */
- "n: 76: 2\n" /* redstonetorchon */
- "o: 76: 3\n" /* redstonetorchon */
- "p: 76: 4\n" /* redstonetorchon */
- "q: 64: 9\n" /* wooddoorblock */,
+ "n: 76: 4\n" /* redstonetorchon */,
// Block data:
// Level 0
@@ -435,42 +430,42 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
// Level 1
/* z\x* 111111 */
/* * 0123456789012345 */
- /* 0 */ "mmmmmmacdammmmmm"
+ /* 0 */ "mmmmmmaccammmmmm"
/* 1 */ "mmmmmmb..bmmmmmm"
/* 2 */ "mmmmmmb..bmmmmmm"
/* 3 */ "mmmmmmb..bmmmmmm"
/* 4 */ "mmmmmmb..bmmmmmm"
/* 5 */ "mmmmmmb..bmmmmmm"
/* 6 */ "abbbbbb..bbbbbba"
- /* 7 */ "e..............f"
- /* 8 */ "g..............f"
+ /* 7 */ "d..............e"
+ /* 8 */ "d..............e"
/* 9 */ "abbbbbb..bbbbbba"
/* 10 */ "mmmmmmb..bmmmmmm"
/* 11 */ "mmmmmmb..bmmmmmm"
/* 12 */ "mmmmmmb..bmmmmmm"
/* 13 */ "mmmmmmb..bmmmmmm"
/* 14 */ "mmmmmmb..bmmmmmm"
- /* 15 */ "mmmmmmahhammmmmm"
+ /* 15 */ "mmmmmmaffammmmmm"
// Level 2
/* z\x* 111111 */
/* * 0123456789012345 */
- /* 0 */ "mmmmmmaijammmmmm"
+ /* 0 */ "mmmmmmaghammmmmm"
/* 1 */ "mmmmmmb..bmmmmmm"
- /* 2 */ "mmmmmmk..kmmmmmm"
- /* 3 */ "mmmmmmk..kmmmmmm"
- /* 4 */ "mmmmmmblnbmmmmmm"
+ /* 2 */ "mmmmmmi..immmmmm"
+ /* 3 */ "mmmmmmi..immmmmm"
+ /* 4 */ "mmmmmmbjkbmmmmmm"
/* 5 */ "mmmmmmb..bmmmmmm"
- /* 6 */ "abkkbbb..bbbkkba"
- /* 7 */ "j...o......o...i"
- /* 8 */ "i...p......p...q"
- /* 9 */ "abkkbbb..bbbkkba"
+ /* 6 */ "abiibbb..bbbiiba"
+ /* 7 */ "h...l......l...g"
+ /* 8 */ "g...n......n...h"
+ /* 9 */ "abiibbb..bbbiiba"
/* 10 */ "mmmmmmb..bmmmmmm"
- /* 11 */ "mmmmmmblnbmmmmmm"
- /* 12 */ "mmmmmmk..kmmmmmm"
- /* 13 */ "mmmmmmk..kmmmmmm"
+ /* 11 */ "mmmmmmbjkbmmmmmm"
+ /* 12 */ "mmmmmmi..immmmmm"
+ /* 13 */ "mmmmmmi..immmmmm"
/* 14 */ "mmmmmmb..bmmmmmm"
- /* 15 */ "mmmmmmaqiammmmmm"
+ /* 15 */ "mmmmmmahgammmmmm"
// Level 3
/* z\x* 111111 */
@@ -549,8 +544,6 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
"h: 64: 8\n" /* wooddoorblock */
"i: 76: 4\n" /* redstonetorchon */
"j: 64: 0\n" /* wooddoorblock */
- "k: 64: 7\n" /* wooddoorblock */
- "l: 64:12\n" /* wooddoorblock */
"m: 19: 0\n" /* sponge */,
// Block data:
@@ -607,7 +600,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
/* * 0123456789012345 */
/* 0 */ "mmmmmmmbbbbbbbba"
/* 1 */ "mmmmmmmb.......j"
- /* 2 */ "mmmmmmmb.......k"
+ /* 2 */ "mmmmmmmb.......j"
/* 3 */ "mmmmmmmbbbbbbbba"
// Level 7
@@ -615,7 +608,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
/* * 0123456789012345 */
/* 0 */ "mmmmmmmmbbbeebba"
/* 1 */ "mmmmmmmmb.g....h"
- /* 2 */ "mmmmmmmmb.i....l"
+ /* 2 */ "mmmmmmmmb.i....f"
/* 3 */ "mmmmmmmmbbbeebba"
// Level 8
@@ -672,19 +665,16 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
"a: 5: 5\n" /* wood */
"b: 5: 0\n" /* wood */
"c: 64: 3\n" /* wooddoorblock */
- "d: 64: 6\n" /* wooddoorblock */
- "e: 64: 5\n" /* wooddoorblock */
- "f: 64: 0\n" /* wooddoorblock */
- "g: 64: 2\n" /* wooddoorblock */
- "h: 64: 8\n" /* wooddoorblock */
- "i: 64:12\n" /* wooddoorblock */
- "j: 20: 0\n" /* glass */
- "k: 76: 1\n" /* redstonetorchon */
- "l: 76: 2\n" /* redstonetorchon */
- "m: 19: 0\n" /* sponge */
- "n: 76: 3\n" /* redstonetorchon */
- "o: 76: 4\n" /* redstonetorchon */
- "p: 64: 9\n" /* wooddoorblock */,
+ "d: 64: 2\n" /* wooddoorblock */
+ "e: 64: 0\n" /* wooddoorblock */
+ "f: 64: 8\n" /* wooddoorblock */
+ "g: 64: 9\n" /* wooddoorblock */
+ "h: 20: 0\n" /* glass */
+ "i: 76: 1\n" /* redstonetorchon */
+ "j: 76: 2\n" /* redstonetorchon */
+ "k: 76: 3\n" /* redstonetorchon */
+ "l: 76: 4\n" /* redstonetorchon */
+ "m: 19: 0\n" /* sponge */,
// Block data:
// Level 0
@@ -704,30 +694,30 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
// Level 1
/* z\x* 111111 */
/* * 0123456789012345 */
- /* 0 */ "mmmmmmacdammmmmm"
+ /* 0 */ "mmmmmmaccammmmmm"
/* 1 */ "mmmmmmb..bmmmmmm"
/* 2 */ "mmmmmmb..bmmmmmm"
/* 3 */ "mmmmmmb..bmmmmmm"
/* 4 */ "mmmmmmb..bmmmmmm"
/* 5 */ "mmmmmmb..bmmmmmm"
/* 6 */ "abbbbbb..bbbbbba"
- /* 7 */ "e..............f"
- /* 8 */ "g..............f"
+ /* 7 */ "d..............e"
+ /* 8 */ "d..............e"
/* 9 */ "abbbbbbbbbbbbbba"
// Level 2
/* z\x* 111111 */
/* * 0123456789012345 */
- /* 0 */ "mmmmmmahiammmmmm"
+ /* 0 */ "mmmmmmafgammmmmm"
/* 1 */ "mmmmmmb..bmmmmmm"
- /* 2 */ "mmmmmmj..jmmmmmm"
- /* 3 */ "mmmmmmj..jmmmmmm"
- /* 4 */ "mmmmmmbklbmmmmmm"
+ /* 2 */ "mmmmmmh..hmmmmmm"
+ /* 3 */ "mmmmmmh..hmmmmmm"
+ /* 4 */ "mmmmmmbijbmmmmmm"
/* 5 */ "mmmmmmb..bmmmmmm"
- /* 6 */ "abjjbbb..bbbjjba"
- /* 7 */ "i...n......n...h"
- /* 8 */ "h...o......o...p"
- /* 9 */ "abjjbbbjjbbbjjba"
+ /* 6 */ "abhhbbb..bbbhhba"
+ /* 7 */ "g...k......k...f"
+ /* 8 */ "f...l......l...g"
+ /* 9 */ "abhhbbbhhbbbhhba"
// Level 3
/* z\x* 111111 */
@@ -974,14 +964,12 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
"a: 5: 0\n" /* wood */
"b: 5: 5\n" /* wood */
"c: 20: 0\n" /* glass */
- "d: 64: 5\n" /* wooddoorblock */
+ "d: 64: 2\n" /* wooddoorblock */
"e: 64: 0\n" /* wooddoorblock */
- "f: 64: 2\n" /* wooddoorblock */
- "g: 76: 3\n" /* redstonetorchon */
- "h: 64:12\n" /* wooddoorblock */
- "i: 64: 8\n" /* wooddoorblock */
- "j: 64: 9\n" /* wooddoorblock */
- "k: 76: 4\n" /* redstonetorchon */
+ "f: 76: 3\n" /* redstonetorchon */
+ "g: 64: 9\n" /* wooddoorblock */
+ "h: 64: 8\n" /* wooddoorblock */
+ "i: 76: 4\n" /* redstonetorchon */
"m: 19: 0\n" /* sponge */,
// Block data:
@@ -1001,7 +989,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
/* 0 */ "mmaccccccccccamm"
/* 1 */ "ba............ab"
/* 2 */ "d..............e"
- /* 3 */ "f..............e"
+ /* 3 */ "d..............e"
/* 4 */ "ba............ab"
/* 5 */ "mmaccccccccccamm"
@@ -1009,10 +997,10 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
/* z\x* 111111 */
/* * 0123456789012345 */
/* 0 */ "mmaccccccccccamm"
- /* 1 */ "bag..........gab"
- /* 2 */ "h..............i"
- /* 3 */ "i..............j"
- /* 4 */ "bak..........kab"
+ /* 1 */ "baf..........fab"
+ /* 2 */ "g..............h"
+ /* 3 */ "h..............g"
+ /* 4 */ "bai..........iab"
/* 5 */ "mmaccccccccccamm"
// Level 3
@@ -1673,7 +1661,8 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
"j: 76: 4\n" /* redstonetorchon */
"k: 64: 1\n" /* wooddoorblock */
"l: 64: 8\n" /* wooddoorblock */
- "m: 19: 0\n" /* sponge */,
+ "m: 19: 0\n" /* sponge */
+ "n: 64: 9\n" /* wooddoorblock */,
// Block data:
// Level 0
@@ -1721,7 +1710,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
// Level 2
/* z\x* 1111 */
/* * 01234567890123 */
- /* 0 */ "mmmmallammmmmm"
+ /* 0 */ "mmmmalnammmmmm"
/* 1 */ "mmmmb..bmmmmmm"
/* 2 */ "mmmmc..cmmmmmm"
/* 3 */ "mmmcc..ccmmmmm"
@@ -1729,14 +1718,14 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
/* 5 */ "mcc......ccmmm"
/* 6 */ "mc........ccba"
/* 7 */ "c............l"
- /* 8 */ "c............l"
+ /* 8 */ "c............n"
/* 9 */ "mc........ccba"
/* 10 */ "mcc......ccmmm"
/* 11 */ "mmcc....ccmmmm"
/* 12 */ "mmmcc..ccmmmmm"
/* 13 */ "mmmmc..cmmmmmm"
/* 14 */ "mmmmb..bmmmmmm"
- /* 15 */ "mmmmallammmmmm"
+ /* 15 */ "mmmmanlammmmmm"
/* 16 */ "dddddddddddddd"
// Level 3
diff --git a/src/Generating/ProtIntGen.h b/src/Generating/ProtIntGen.h
index 9e471e8bb..c0c7102d2 100644
--- a/src/Generating/ProtIntGen.h
+++ b/src/Generating/ProtIntGen.h
@@ -47,7 +47,7 @@ public:
virtual ~cProtIntGen() {}
/** Generates the array of specified size into a_Values, based on given min coords. */
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) = 0;
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) = 0;
};
@@ -109,14 +109,14 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int BaseZ = a_MinZ + z;
- for (int x = 0; x < a_SizeX; x++)
+ int BaseZ = a_MinZ + static_cast<int>(z);
+ for (size_t x = 0; x < a_SizeX; x++)
{
- a_Values[x + a_SizeX * z] = (super::m_Noise.IntNoise2DInt(a_MinX + x, BaseZ) / 7) % m_Range;
+ a_Values[x + a_SizeX * z] = (super::m_Noise.IntNoise2DInt(a_MinX + static_cast<int>(x), BaseZ) / 7) % m_Range;
}
} // for z
}
@@ -146,22 +146,22 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int BaseZ = a_MinZ + z;
- for (int x = 0; x < a_SizeX; x++)
+ int BaseZ = a_MinZ + static_cast<int>(z);
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int rnd = (super::m_Noise.IntNoise2DInt(a_MinX + x, BaseZ) / 7);
+ int rnd = (super::m_Noise.IntNoise2DInt(a_MinX + static_cast<int>(x), BaseZ) / 7);
a_Values[x + a_SizeX * z] = ((rnd % 100) < m_Threshold) ? ((rnd / 101) % bgLandOceanMax + 1) : 0;
}
}
// If the centerpoint of the world is within the area, set it to bgTemperate, always:
- if ((a_MinX <= 0) && (a_MinZ <= 0) && (a_MinX + a_SizeX > 0) && (a_MinZ + a_SizeZ > 0))
+ if ((a_MinX <= 0) && (a_MinZ <= 0) && (a_MinX + static_cast<int>(a_SizeX) > 0) && (a_MinZ + static_cast<int>(a_SizeZ) > 0))
{
- a_Values[-a_MinX - a_MinZ * a_SizeX] = bgTemperate;
+ a_Values[static_cast<size_t>(-a_MinX) - static_cast<size_t>(a_MinZ) * a_SizeX] = bgTemperate;
}
}
@@ -189,13 +189,13 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Get the coords for the lower generator:
int lowerMinX = a_MinX >> 1;
int lowerMinZ = a_MinZ >> 1;
- int lowerSizeX = a_SizeX / 2 + 2;
- int lowerSizeZ = a_SizeZ / 2 + 2;
+ size_t lowerSizeX = a_SizeX / 2 + 2;
+ size_t lowerSizeZ = a_SizeZ / 2 + 2;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
ASSERT(lowerSizeX > 0);
ASSERT(lowerSizeZ > 0);
@@ -203,22 +203,22 @@ public:
// Generate the underlying data with half the resolution:
int lowerData[m_BufferSize];
m_UnderlyingGen->GetInts(lowerMinX, lowerMinZ, lowerSizeX, lowerSizeZ, lowerData);
- const int lowStepX = (lowerSizeX - 1) * 2;
+ const size_t lowStepX = (lowerSizeX - 1) * 2;
int cache[m_BufferSize];
// Discreet-interpolate the values into twice the size:
- for (int z = 0; z < lowerSizeZ - 1; ++z)
+ for (size_t z = 0; z < lowerSizeZ - 1; ++z)
{
- int idx = (z * 2) * lowStepX;
+ size_t idx = (z * 2) * lowStepX;
int PrevZ0 = lowerData[z * lowerSizeX];
int PrevZ1 = lowerData[(z + 1) * lowerSizeX];
- for (int x = 0; x < lowerSizeX - 1; ++x)
+ for (size_t x = 0; x < lowerSizeX - 1; ++x)
{
int ValX1Z0 = lowerData[x + 1 + z * lowerSizeX];
int ValX1Z1 = lowerData[x + 1 + (z + 1) * lowerSizeX];
- int RndX = (x + lowerMinX) * 2;
- int RndZ = (z + lowerMinZ) * 2;
+ int RndX = (static_cast<int>(x) + lowerMinX) * 2;
+ int RndZ = (static_cast<int>(z) + lowerMinZ) * 2;
cache[idx] = PrevZ0;
cache[idx + lowStepX] = super::chooseRandomOne(RndX, RndZ + 1, PrevZ0, PrevZ1);
cache[idx + 1] = super::chooseRandomOne(RndX, RndZ - 1, PrevZ0, ValX1Z0);
@@ -230,7 +230,7 @@ public:
}
// Copy from Cache into a_Values; take into account the even / odd offsets in a_Min:
- for (int z = 0; z < a_SizeZ; ++z)
+ for (size_t z = 0; z < a_SizeZ; ++z)
{
memcpy(a_Values + z * a_SizeX, cache + (z + (a_MinZ & 1)) * lowStepX + (a_MinX & 1), a_SizeX * sizeof(int));
}
@@ -259,21 +259,21 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying values:
- int lowerSizeX = a_SizeX + 2;
- int lowerSizeZ = a_SizeZ + 2;
+ size_t lowerSizeX = a_SizeX + 2;
+ size_t lowerSizeZ = a_SizeZ + 2;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerData[m_BufferSize];
m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerData);
// Smooth - for each square check if the surroundings are the same, if so, expand them diagonally.
// Also get rid of single-pixel irregularities (A-B-A):
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int NoiseZ = a_MinZ + z;
- for (int x = 0; x < a_SizeX; x++)
+ int NoiseZ = a_MinZ + static_cast<int>(z);
+ for (size_t x = 0; x < a_SizeX; x++)
{
int val = lowerData[x + 1 + (z + 1) * lowerSizeX];
int above = lowerData[x + 1 + z * lowerSizeX];
@@ -283,7 +283,7 @@ public:
if ((left == right) && (above == below))
{
- if (((super::m_Noise.IntNoise2DInt(a_MinX + x, NoiseZ) / 7) % 2) == 0)
+ if (((super::m_Noise.IntNoise2DInt(a_MinX + static_cast<int>(x), NoiseZ) / 7) % 2) == 0)
{
val = left;
}
@@ -331,21 +331,21 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying values:
- int lowerSizeX = a_SizeX + 1;
- int lowerSizeZ = a_SizeZ + 1;
+ size_t lowerSizeX = a_SizeX + 1;
+ size_t lowerSizeZ = a_SizeZ + 1;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerData[m_BufferSize];
m_Underlying->GetInts(a_MinX, a_MinZ, lowerSizeX, lowerSizeZ, lowerData);
// Average - add all 4 "neighbors" and divide by 4:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int idxLower = x + lowerSizeX * z;
+ size_t idxLower = x + lowerSizeX * z;
a_Values[x + a_SizeX * z] = (
lowerData[idxLower] + lowerData[idxLower + 1] +
lowerData[idxLower + lowerSizeX] + lowerData[idxLower + lowerSizeX + 1]
@@ -375,24 +375,24 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying values:
- int lowerSizeX = a_SizeX + 4;
- int lowerSizeZ = a_SizeZ + 4;
+ size_t lowerSizeX = a_SizeX + 4;
+ size_t lowerSizeZ = a_SizeZ + 4;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerData[m_BufferSize];
m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerData);
// Calculate the weighted average of all 16 "neighbors":
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int idxLower1 = x + lowerSizeX * z;
- int idxLower2 = idxLower1 + lowerSizeX;
- int idxLower3 = idxLower1 + 2 * lowerSizeX;
- int idxLower4 = idxLower1 + 3 * lowerSizeX;
+ size_t idxLower1 = x + lowerSizeX * z;
+ size_t idxLower2 = idxLower1 + lowerSizeX;
+ size_t idxLower3 = idxLower1 + 2 * lowerSizeX;
+ size_t idxLower4 = idxLower1 + 3 * lowerSizeX;
a_Values[x + a_SizeX * z] = (
1 * lowerData[idxLower1] + 2 * lowerData[idxLower1 + 1] + 2 * lowerData[idxLower1 + 2] + 1 * lowerData[idxLower1 + 3] +
2 * lowerData[idxLower2] + 32 * lowerData[idxLower2 + 1] + 32 * lowerData[idxLower2 + 2] + 2 * lowerData[idxLower2 + 3] +
@@ -425,23 +425,23 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying values:
- int lowerSizeX = a_SizeX + 3;
- int lowerSizeZ = a_SizeZ + 3;
+ size_t lowerSizeX = a_SizeX + 3;
+ size_t lowerSizeZ = a_SizeZ + 3;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerData[m_BufferSize];
m_Underlying->GetInts(a_MinX, a_MinZ, lowerSizeX, lowerSizeZ, lowerData);
// Calculate the weighted average the neighbors:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int idxLower1 = x + lowerSizeX * z;
- int idxLower2 = idxLower1 + lowerSizeX;
- int idxLower3 = idxLower1 + 2 * lowerSizeX;
+ size_t idxLower1 = x + lowerSizeX * z;
+ size_t idxLower2 = idxLower1 + lowerSizeX;
+ size_t idxLower3 = idxLower1 + 2 * lowerSizeX;
a_Values[x + a_SizeX * z] = (
WeightDiagonal * lowerData[idxLower1] + WeightCardinal * lowerData[idxLower1 + 1] + WeightDiagonal * lowerData[idxLower1 + 2] +
WeightCardinal * lowerData[idxLower2] + WeightCenter * lowerData[idxLower2 + 1] + WeightCardinal * lowerData[idxLower2 + 2] +
@@ -476,20 +476,20 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying values:
m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
// Replace random values:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int BaseZ = a_MinZ + z;
- for (int x = 0; x < a_SizeX; x++)
+ int BaseZ = a_MinZ + static_cast<int>(z);
+ for (size_t x = 0; x < a_SizeX; x++)
{
- if (((super::m_Noise.IntNoise2DInt(BaseZ, a_MinX + x) / 13) % 101) < m_ChancePct)
+ if (((super::m_Noise.IntNoise2DInt(BaseZ, a_MinX + static_cast<int>(x)) / 13) % 101) < m_ChancePct)
{
- a_Values[x + a_SizeX * z] = m_Min + (super::m_Noise.IntNoise2DInt(a_MinX + x, BaseZ) / 7) % m_Range;
+ a_Values[x + a_SizeX * z] = m_Min + (super::m_Noise.IntNoise2DInt(a_MinX + static_cast<int>(x), BaseZ) / 7) % m_Range;
}
} // for x
} // for z
@@ -522,18 +522,18 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying values:
m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
// Add the random values:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int NoiseZ = a_MinZ + z;
- for (int x = 0; x < a_SizeX; x++)
+ int NoiseZ = a_MinZ + static_cast<int>(z);
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int noiseVal = ((super::m_Noise.IntNoise2DInt(a_MinX + x, NoiseZ) / 7) % m_Range) - m_HalfRange;
+ int noiseVal = ((super::m_Noise.IntNoise2DInt(a_MinX + static_cast<int>(x), NoiseZ) / 7) % m_Range) - m_HalfRange;
a_Values[x + z * a_SizeX] += noiseVal;
}
}
@@ -564,23 +564,23 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying values:
- int lowerSizeX = a_SizeX + 2;
- int lowerSizeZ = a_SizeZ + 2;
+ size_t lowerSizeX = a_SizeX + 2;
+ size_t lowerSizeZ = a_SizeZ + 2;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerData[m_BufferSize];
m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerData);
// Average random values:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int NoiseZ = a_MinZ + z;
- for (int x = 0; x < a_SizeX; x++)
+ int NoiseZ = a_MinZ + static_cast<int>(z);
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int idxLower = x + 1 + lowerSizeX * (z + 1);
- if (((super::m_Noise.IntNoise2DInt(a_MinX + x, NoiseZ) / 7) % 100) > m_AvgChancePct)
+ size_t idxLower = x + 1 + lowerSizeX * (z + 1);
+ if (((super::m_Noise.IntNoise2DInt(a_MinX + static_cast<int>(x), NoiseZ) / 7) % 100) > m_AvgChancePct)
{
// Average the 4 neighbors:
a_Values[x + z * a_SizeX] = (
@@ -621,28 +621,28 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying values:
- int lowerSizeX = a_SizeX + 2;
- int lowerSizeZ = a_SizeZ + 2;
+ size_t lowerSizeX = a_SizeX + 2;
+ size_t lowerSizeZ = a_SizeZ + 2;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerData[m_BufferSize];
m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerData);
// Average random values:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int NoiseZ = a_MinZ + z;
- for (int x = 0; x < a_SizeX; x++)
+ int NoiseZ = a_MinZ + static_cast<int>(z);
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int idxLower = x + 1 + lowerSizeX * (z + 1);
- if (((super::m_Noise.IntNoise2DInt(a_MinX + x, NoiseZ) / 7) % 100) > m_AvgChancePct)
+ size_t idxLower = x + 1 + lowerSizeX * (z + 1);
+ if (((super::m_Noise.IntNoise2DInt(a_MinX + static_cast<int>(x), NoiseZ) / 7) % 100) > m_AvgChancePct)
{
// Chose a value in between the min and max neighbor:
int min = std::min(std::min(lowerData[idxLower - 1], lowerData[idxLower + 1]), std::min(lowerData[idxLower - lowerSizeX], lowerData[idxLower + lowerSizeX]));
int max = std::max(std::max(lowerData[idxLower - 1], lowerData[idxLower + 1]), std::max(lowerData[idxLower - lowerSizeX], lowerData[idxLower + lowerSizeX]));
- a_Values[x + z * a_SizeX] = min + ((super::m_Noise.IntNoise2DInt(a_MinX + x, NoiseZ + 10) / 7) % (max - min + 1));
+ a_Values[x + z * a_SizeX] = min + ((super::m_Noise.IntNoise2DInt(a_MinX + static_cast<int>(x), NoiseZ + 10) / 7) % (max - min + 1));
}
else
{
@@ -675,7 +675,7 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Map for biome -> its beach:
static const int ToBeach[] =
@@ -723,16 +723,16 @@ public:
};
// Generate the underlying values:
- int lowerSizeX = a_SizeX + 2;
- int lowerSizeZ = a_SizeZ + 2;
+ size_t lowerSizeX = a_SizeX + 2;
+ size_t lowerSizeZ = a_SizeZ + 2;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerValues[m_BufferSize];
m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerValues);
// Add beaches between ocean and biomes:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
int val = lowerValues[x + 1 + (z + 1) * lowerSizeX];
int above = lowerValues[x + 1 + z * lowerSizeX];
@@ -779,16 +779,16 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
if (a_Values[x + z * a_SizeX] == bgOcean)
{
- int rnd = super::m_Noise.IntNoise2DInt(a_MinX + x, a_MinZ + z) / 7;
+ int rnd = super::m_Noise.IntNoise2DInt(a_MinX + static_cast<int>(x), a_MinZ + static_cast<int>(z)) / 7;
if (rnd % 1000 < m_Chance)
{
a_Values[x + z * a_SizeX] = (rnd / 1003) % bgLandOceanMax;
@@ -822,19 +822,19 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values)
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values)
{
// Generate the underlying biome groups:
- int lowerSizeX = a_SizeX + 2;
- int lowerSizeZ = a_SizeZ + 2;
+ size_t lowerSizeX = a_SizeX + 2;
+ size_t lowerSizeZ = a_SizeZ + 2;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerValues[m_BufferSize];
m_Underlying->GetInts(a_MinX, a_MinZ, lowerSizeX, lowerSizeZ, lowerValues);
// Change the biomes on incompatible edges into an edge biome:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
int val = lowerValues[x + 1 + (z + 1) * lowerSizeX];
int Above = lowerValues[x + 1 + z * lowerSizeX];
@@ -920,7 +920,7 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Define the per-biome-group biomes:
static const int oceanBiomes[] =
@@ -998,16 +998,16 @@ public:
// Overwrite each biome group with a random biome from that group:
// Take care of the bgfRare flag
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int IdxZ = z * a_SizeX;
- for (int x = 0; x < a_SizeX; x++)
+ size_t IdxZ = z * a_SizeX;
+ for (size_t x = 0; x < a_SizeX; x++)
{
int val = a_Values[x + IdxZ];
const cBiomesInGroups & Biomes = (val > bgfRare) ?
rareBiomesInGroups[(val & (bgfRare - 1)) % ARRAYCOUNT(rareBiomesInGroups)] :
- biomesInGroups[val % ARRAYCOUNT(biomesInGroups)];
- int rnd = (super::m_Noise.IntNoise2DInt(x + a_MinX, z + a_MinZ) / 7);
+ biomesInGroups[static_cast<size_t>(val) % ARRAYCOUNT(biomesInGroups)];
+ int rnd = (super::m_Noise.IntNoise2DInt(static_cast<int>(x) + a_MinX, static_cast<int>(z) + a_MinZ) / 7);
a_Values[x + IdxZ] = Biomes.Biomes[rnd % Biomes.Count];
}
}
@@ -1050,21 +1050,21 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying values:
m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
// Replace some of the values:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int idxZ = z * a_SizeX;
- for (int x = 0; x < a_SizeX; x++)
+ size_t idxZ = z * a_SizeX;
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int idx = x + idxZ;
+ size_t idx = x + idxZ;
if (a_Values[idx] == m_From)
{
- int rnd = super::m_Noise.IntNoise2DInt(x + a_MinX, z + a_MinZ) / 7;
+ int rnd = super::m_Noise.IntNoise2DInt(static_cast<int>(x) + a_MinX, static_cast<int>(z) + a_MinZ) / 7;
if (rnd % 1000 < m_Chance)
{
a_Values[idx] = m_To;
@@ -1109,7 +1109,7 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying data:
ASSERT(a_SizeX * a_SizeZ <= m_BufferSize);
@@ -1118,12 +1118,12 @@ public:
m_Rivers->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, riverData);
// Mix the values:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int idxZ = z * a_SizeX;
- for (int x = 0; x < a_SizeX; x++)
+ size_t idxZ = z * a_SizeX;
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int idx = x + idxZ;
+ size_t idx = x + idxZ;
if (IsBiomeOcean(a_Values[idx]))
{
// Oceans are kept without any changes
@@ -1136,7 +1136,7 @@ public:
}
// There's a river, change the output to a river or a frozen river, based on the original biome:
- if (IsBiomeVeryCold((EMCSBiome)a_Values[idx]))
+ if (IsBiomeVeryCold(static_cast<EMCSBiome>(a_Values[idx])))
{
a_Values[idx] = biFrozenRiver;
}
@@ -1173,19 +1173,19 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying data:
- int lowerSizeX = a_SizeX + 2;
- int lowerSizeZ = a_SizeZ + 2;
+ size_t lowerSizeX = a_SizeX + 2;
+ size_t lowerSizeZ = a_SizeZ + 2;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerValues[m_BufferSize];
m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerValues);
// Detect the edges:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
int Above = lowerValues[x + 1 + z * lowerSizeX];
int Below = lowerValues[x + 1 + (z + 2) * lowerSizeX];
@@ -1231,19 +1231,19 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying data:
- int lowerSizeX = a_SizeX + 2;
- int lowerSizeZ = a_SizeZ + 2;
+ size_t lowerSizeX = a_SizeX + 2;
+ size_t lowerSizeZ = a_SizeZ + 2;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerValues[m_BufferSize];
m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerValues);
// Add the mushroom islands:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
int val = lowerValues[x + 1 + (z + 1) * lowerSizeX];
if (!IsBiomeOcean(val))
@@ -1278,7 +1278,7 @@ public:
// If at least 3 ocean neighbors and the chance is right, change:
if (
(NumOceanNeighbors >= 3) &&
- ((super::m_Noise.IntNoise2DInt(x + a_MinX, z + a_MinZ) / 7) % 1000 < m_Chance)
+ ((super::m_Noise.IntNoise2DInt(static_cast<int>(x) + a_MinX, static_cast<int>(z) + a_MinZ) / 7) % 1000 < m_Chance)
)
{
a_Values[x + z * a_SizeX] = m_ToValue;
@@ -1321,17 +1321,17 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying data:
m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
// Change random pixels to bgOcean:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int rnd = super::m_Noise.IntNoise2DInt(x + a_MinX, z + a_MinZ) / 7;
+ int rnd = super::m_Noise.IntNoise2DInt(static_cast<int>(x) + a_MinX, static_cast<int>(z) + a_MinZ) / 7;
if (rnd % 1000 < m_Chance)
{
a_Values[x + z * a_SizeX] = m_ToValue;
@@ -1370,20 +1370,20 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying data:
m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
// Change some of the biome groups into rare biome groups:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
- int rnd = super::m_Noise.IntNoise2DInt(x + a_MinX, z + a_MinZ) / 7;
+ int rnd = super::m_Noise.IntNoise2DInt(static_cast<int>(x) + a_MinX, static_cast<int>(z) + a_MinZ) / 7;
if (rnd % 1000 < m_Chance)
{
- int idx = x + a_SizeX * z;
+ size_t idx = x + a_SizeX * z;
a_Values[idx] = a_Values[idx] | bgfRare;
}
}
@@ -1418,7 +1418,7 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the base biomes and the alterations:
m_BaseBiomes->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
@@ -1426,8 +1426,8 @@ public:
m_Alterations->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, alterations);
// Change the biomes into their alternate versions:
- int len = a_SizeX * a_SizeZ;
- for (int idx = 0; idx < len; ++idx)
+ size_t len = a_SizeX * a_SizeZ;
+ for (size_t idx = 0; idx < len; ++idx)
{
if (alterations[idx] == 0)
{
@@ -1482,19 +1482,19 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying biomes:
- int lowerSizeX = a_SizeX + 2;
- int lowerSizeZ = a_SizeZ + 2;
+ size_t lowerSizeX = a_SizeX + 2;
+ size_t lowerSizeZ = a_SizeZ + 2;
ASSERT(lowerSizeX * lowerSizeZ <= m_BufferSize);
int lowerValues[m_BufferSize];
m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerValues);
// Convert incompatible edges into neutral biomes:
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
int biome = lowerValues[x + 1 + (z + 1) * lowerSizeX];
int above = lowerValues[x + 1 + z * lowerSizeX];
@@ -1642,7 +1642,7 @@ public:
}
- virtual void GetInts(int a_MinX, int a_MinZ, int a_SizeX, int a_SizeZ, int * a_Values) override
+ virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
{
// Generate the underlying biomes and the alterations:
m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
@@ -1650,8 +1650,8 @@ public:
m_Alteration->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, alterations);
// Wherever alterations are nonzero, change into alternate biome, if available:
- int len = a_SizeX * a_SizeZ;
- for (int idx = 0; idx < len; ++idx)
+ size_t len = a_SizeX * a_SizeZ;
+ for (size_t idx = 0; idx < len; ++idx)
{
if (alterations[idx] == 0)
{
diff --git a/src/Generating/RainbowRoadsGen.cpp b/src/Generating/RainbowRoadsGen.cpp
index fd4a81692..03400556a 100644
--- a/src/Generating/RainbowRoadsGen.cpp
+++ b/src/Generating/RainbowRoadsGen.cpp
@@ -76,7 +76,7 @@ protected:
{
for (cPlacedPieces::iterator itr = m_Pieces.begin(), end = m_Pieces.end(); itr != end; ++itr)
{
- cPrefab & Prefab = (cPrefab &)((*itr)->GetPiece());
+ const cPrefab & Prefab = static_cast<const cPrefab &>((*itr)->GetPiece());
Prefab.Draw(a_Chunk, *itr);
} // for itr - m_PlacedPieces[]
}
diff --git a/src/Generating/Ravines.cpp b/src/Generating/Ravines.cpp
index 9f8f69139..8c6316273 100644
--- a/src/Generating/Ravines.cpp
+++ b/src/Generating/Ravines.cpp
@@ -135,17 +135,17 @@ void cStructGenRavines::cRavine::GenerateBaseDefPoints(int a_BlockX, int a_Block
// Get the base angle in which the ravine "axis" goes:
float Angle = (float)(((float)((a_Noise.IntNoise3DInt(20 * a_BlockX, 70 * a_BlockZ, 6000) / 9) % 16384)) / 16384.0 * M_PI);
- float xc = sin(Angle);
- float zc = cos(Angle);
+ float xc = sinf(Angle);
+ float zc = cosf(Angle);
// Calculate the definition points and radii:
int MaxRadius = (int)(sqrt(12.0 + ((a_Noise.IntNoise2DInt(61 * a_BlockX, 97 * a_BlockZ) / 13) % a_Size) / 16));
int Top = 32 + ((a_Noise.IntNoise2DInt(13 * a_BlockX, 17 * a_BlockZ) / 23) % 32);
int Bottom = 5 + ((a_Noise.IntNoise2DInt(17 * a_BlockX, 29 * a_BlockZ) / 13) % 32);
int Mid = (Top + Bottom) / 2;
- int PointX = CenterX - (int)(xc * a_Size / 2);
- int PointZ = CenterZ - (int)(zc * a_Size / 2);
- m_Points.push_back(cRavDefPoint(PointX, PointZ, 0, (Mid + Top) / 2, (Mid + Bottom) / 2));
+ int DefinitionPointX = CenterX - (int)(xc * a_Size / 2);
+ int DefinitionPointZ = CenterZ - (int)(zc * a_Size / 2);
+ m_Points.push_back(cRavDefPoint(DefinitionPointX, DefinitionPointZ, 0, (Mid + Top) / 2, (Mid + Bottom) / 2));
for (int i = 1; i < NUM_RAVINE_POINTS - 1; i++)
{
int LineX = CenterX + (int)(xc * a_Size * (i - NUM_RAVINE_POINTS / 2) / NUM_RAVINE_POINTS);
@@ -160,9 +160,9 @@ void cStructGenRavines::cRavine::GenerateBaseDefPoints(int a_BlockX, int a_Block
int ThisBottom = Bottom + ((a_Noise.IntNoise3DInt(19 * a_BlockX, 7 * a_BlockZ, i * 31) / 13) % 8) - 4;
m_Points.push_back(cRavDefPoint(PointX, PointZ, Radius, ThisTop, ThisBottom));
} // for i - m_Points[]
- PointX = CenterX + (int)(xc * a_Size / 2);
- PointZ = CenterZ + (int)(zc * a_Size / 2);
- m_Points.push_back(cRavDefPoint(PointX, PointZ, 0, Mid, Mid));
+ DefinitionPointX = CenterX + (int)(xc * a_Size / 2);
+ DefinitionPointZ = CenterZ + (int)(zc * a_Size / 2);
+ m_Points.push_back(cRavDefPoint(DefinitionPointX, DefinitionPointZ, 0, Mid, Mid));
}
diff --git a/src/Generating/RoughRavines.cpp b/src/Generating/RoughRavines.cpp
index 2ee3704b3..c0397ee26 100644
--- a/src/Generating/RoughRavines.cpp
+++ b/src/Generating/RoughRavines.cpp
@@ -21,7 +21,7 @@ class cRoughRavine :
public:
cRoughRavine(
- int a_Seed, int a_Size,
+ int a_Seed, size_t a_Size,
float a_CenterWidth, float a_Roughness,
float a_FloorHeightEdge1, float a_FloorHeightEdge2, float a_FloorHeightCenter,
float a_CeilingHeightEdge1, float a_CeilingHeightEdge2, float a_CeilingHeightCenter,
@@ -33,14 +33,14 @@ public:
m_Roughness(a_Roughness)
{
// Create the basic structure - 2 lines meeting at the centerpoint:
- int Max = 2 * a_Size;
- int Half = a_Size; // m_DefPoints[Half] will be the centerpoint
+ size_t Max = 2 * a_Size;
+ size_t Half = a_Size; // m_DefPoints[Half] will be the centerpoint
m_DefPoints.resize(Max + 1);
int rnd = m_Noise.IntNoise2DInt(a_OriginX, a_OriginZ) / 7;
float Len = (float)a_Size;
float Angle = (float)rnd; // Angle is in radians, will be wrapped in the "sin" and "cos" operations
- float OfsX = sin(Angle) * Len;
- float OfsZ = cos(Angle) * Len;
+ float OfsX = sinf(Angle) * Len;
+ float OfsZ = cosf(Angle) * Len;
m_DefPoints[0].Set (a_OriginX - OfsX, a_OriginZ - OfsZ, 1, a_CeilingHeightEdge1, a_FloorHeightEdge1);
m_DefPoints[Half].Set((float)a_OriginX, (float)a_OriginZ, a_CenterWidth, a_CeilingHeightCenter, a_FloorHeightCenter);
m_DefPoints[Max].Set (a_OriginX + OfsX, a_OriginZ + OfsZ, 1, a_CeilingHeightEdge2, a_FloorHeightEdge2);
@@ -90,7 +90,7 @@ protected:
/** Recursively subdivides the line between the points of the specified index.
Sets the midpoint to the center of the line plus or minus a random offset, then calls itself for each half
of the new line. */
- void SubdivideLine(int a_Idx1, int a_Idx2)
+ void SubdivideLine(size_t a_Idx1, size_t a_Idx2)
{
// Calculate the midpoint:
const sRavineDefPoint & p1 = m_DefPoints[a_Idx1];
@@ -114,7 +114,7 @@ protected:
MidX -= dz * m_Roughness;
MidZ += dx * m_Roughness;
}
- int MidIdx = (a_Idx1 + a_Idx2) / 2;
+ size_t MidIdx = (a_Idx1 + a_Idx2) / 2;
m_DefPoints[MidIdx].Set(MidX, MidZ, MidR, MidT, MidB);
// Recurse the two halves, if they are worth recursing:
@@ -275,7 +275,7 @@ cRoughRavines::cRoughRavines(
cGridStructGen::cStructurePtr cRoughRavines::CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ)
{
// Pick a random value for each of the ravine's parameters:
- int Size = m_MinSize + (m_Noise.IntNoise2DInt(a_GridX, a_GridZ) / 7) % (m_MaxSize - m_MinSize); // Random int from m_MinSize to m_MaxSize
+ size_t Size = static_cast<size_t>(m_MinSize + (m_Noise.IntNoise2DInt(a_GridX, a_GridZ) / 7) % (m_MaxSize - m_MinSize)); // Random int from m_MinSize to m_MaxSize
float CenterWidth = m_Noise.IntNoise2DInRange(a_GridX + 10, a_GridZ, m_MinCenterWidth, m_MaxCenterWidth);
float Roughness = m_Noise.IntNoise2DInRange(a_GridX + 20, a_GridZ, m_MinRoughness, m_MaxRoughness);
float FloorHeightEdge1 = m_Noise.IntNoise2DInRange(a_GridX + 30, a_GridZ, m_MinFloorHeightEdge, m_MaxFloorHeightEdge);
diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp
index 7572cdcbf..fd911e7dc 100644
--- a/src/Generating/StructGen.cpp
+++ b/src/Generating/StructGen.cpp
@@ -72,7 +72,7 @@ void cStructGenTrees::GenFinish(cChunkDesc & a_ChunkDesc)
{
for (int z = 0; z < cChunkDef::Width; z++)
{
- for (int y = cChunkDef::Height - 1; y >= 0; y--)
+ for (HEIGHTTYPE y = cChunkDef::Height - 1; y >= 0; y--)
{
if (a_ChunkDesc.GetBlockType(x, y, z) != E_BLOCK_AIR)
{
@@ -304,14 +304,14 @@ void cStructGenOreNests::GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_Ore
for (int i = 0; i < a_NumNests; i++)
{
- int rnd = m_Noise.IntNoise3DInt(a_ChunkX + i, a_Seq, a_ChunkZ + 64 * i) / 8;
- int BaseX = rnd % cChunkDef::Width;
- rnd /= cChunkDef::Width;
- int BaseZ = rnd % cChunkDef::Width;
- rnd /= cChunkDef::Width;
- int BaseY = rnd % a_MaxHeight;
- rnd /= a_MaxHeight;
- int NestSize = a_NestSize + (rnd % (a_NestSize / 4)); // The actual nest size may be up to 1 / 4 larger
+ int Nestrnd = m_Noise.IntNoise3DInt(a_ChunkX + i, a_Seq, a_ChunkZ + 64 * i) / 8;
+ int BaseX = Nestrnd % cChunkDef::Width;
+ Nestrnd /= cChunkDef::Width;
+ int BaseZ = Nestrnd % cChunkDef::Width;
+ Nestrnd /= cChunkDef::Width;
+ int BaseY = Nestrnd % a_MaxHeight;
+ Nestrnd /= a_MaxHeight;
+ int NestSize = a_NestSize + (Nestrnd % (a_NestSize / 4)); // The actual nest size may be up to 1 / 4 larger
int Num = 0;
while (Num < NestSize)
{
@@ -436,14 +436,14 @@ void cStructGenLakes::CreateLakeImage(int a_ChunkX, int a_ChunkZ, int a_MaxLakeH
BLOCKTYPE * BlockTypes = a_Lake.GetBlockTypes();
for (int i = 0; i < NumBubbles; i++)
{
- int Rnd = m_Noise.IntNoise3DInt(a_ChunkX, i, a_ChunkZ) / 13;
- const int BubbleR = 2 + (Rnd & 0x03); // 2 .. 5
+ int BubbleRnd = m_Noise.IntNoise3DInt(a_ChunkX, i, a_ChunkZ) / 13;
+ const int BubbleR = 2 + (BubbleRnd & 0x03); // 2 .. 5
const int Range = 16 - 2 * BubbleR;
- const int BubbleX = BubbleR + (Rnd % Range);
+ const int BubbleX = BubbleR + (BubbleRnd % Range);
Rnd >>= 4;
- const int BubbleY = 4 + (Rnd & 0x01); // 4 .. 5
+ const int BubbleY = 4 + (BubbleRnd & 0x01); // 4 .. 5
Rnd >>= 1;
- const int BubbleZ = BubbleR + (Rnd % Range);
+ const int BubbleZ = BubbleR + (BubbleRnd % Range);
const int HalfR = BubbleR / 2; // 1 .. 2
const int RSquared = BubbleR * BubbleR;
for (int y = -HalfR; y <= HalfR; y++)
diff --git a/src/Generating/TestRailsGen.cpp b/src/Generating/TestRailsGen.cpp
index 8256b55a0..72317eb67 100644
--- a/src/Generating/TestRailsGen.cpp
+++ b/src/Generating/TestRailsGen.cpp
@@ -76,7 +76,7 @@ protected:
{
for (cPlacedPieces::iterator itr = m_Pieces.begin(), end = m_Pieces.end(); itr != end; ++itr)
{
- cPrefab & Prefab = (cPrefab &)((*itr)->GetPiece());
+ const cPrefab & Prefab = static_cast<const cPrefab &>((*itr)->GetPiece());
Prefab.Draw(a_Chunk, *itr);
} // for itr - m_PlacedPieces[]
}
diff --git a/src/Generating/Trees.cpp b/src/Generating/Trees.cpp
index 72fe5f819..5da8fc44a 100644
--- a/src/Generating/Trees.cpp
+++ b/src/Generating/Trees.cpp
@@ -6,6 +6,7 @@
#include "Globals.h"
#include "Trees.h"
#include "../BlockID.h"
+#include "../World.h"
@@ -130,7 +131,7 @@ inline void PushSomeColumns(int a_BlockX, int a_Height, int a_BlockZ, int a_Colu
{
int x = a_BlockX + a_Coords[i].x;
int z = a_BlockZ + a_Coords[i].z;
- if (a_Noise.IntNoise3DInt(x + 64 * a_Seq, a_Height + (int)i, z + 64 * a_Seq) <= a_Chance)
+ if (a_Noise.IntNoise3DInt(x + 64 * a_Seq, a_Height + static_cast<int>(i), z + 64 * a_Seq) <= a_Chance)
{
for (int j = 0; j < a_ColumnHeight; j++)
{
@@ -200,7 +201,8 @@ void GetTreeImageByBiome(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_No
}
else
{
- GetJungleTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks);
+ bool IsLarge = a_Noise.IntNoise3DInt(a_BlockX + 32 * a_Seq, a_BlockY + 32 * a_Seq, a_BlockZ) < 0x60000000;
+ GetJungleTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks, IsLarge);
}
return;
}
@@ -321,12 +323,12 @@ void GetSmallAppleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a
int Random = a_Noise.IntNoise3DInt(a_BlockX + 64 * a_Seq, a_BlockY, a_BlockZ) >> 3;
- int Heights[] = {1, 2, 2, 3} ;
- int Height = 1 + Heights[Random & 3];
+ HEIGHTTYPE Heights[] = {1, 2, 2, 3} ;
+ HEIGHTTYPE Height = 1 + Heights[Random & 3];
Random >>= 2;
// Pre-alloc so that we don't realloc too often later:
- a_LogBlocks.reserve(Height + 5);
+ a_LogBlocks.reserve(static_cast<size_t>(Height + 5));
a_OtherBlocks.reserve(ARRAYCOUNT(BigO2) * 2 + ARRAYCOUNT(BigO1) + ARRAYCOUNT(Corners) * 3 + 3 + 5);
// Trunk:
@@ -396,8 +398,8 @@ void GetLargeAppleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a
for (int i = 4; i < Height; i++)
{
// Get a direction for the trunk to go to.
- Vector3d BranchStartDirection = AvailableDirections[a_Noise.IntNoise3DInt(a_BlockX, a_BlockY + i, a_BlockZ) % ARRAYCOUNT(AvailableDirections)];
- Vector3d BranchDirection = AvailableDirections[a_Noise.IntNoise3DInt(a_BlockX, a_BlockY / i, a_BlockZ) % ARRAYCOUNT(AvailableDirections)] / 3;
+ Vector3d BranchStartDirection = AvailableDirections[static_cast<size_t>(a_Noise.IntNoise3DInt(a_BlockX, a_BlockY + i, a_BlockZ)) % ARRAYCOUNT(AvailableDirections)];
+ Vector3d BranchDirection = AvailableDirections[static_cast<size_t>(a_Noise.IntNoise3DInt(a_BlockX, a_BlockY / i, a_BlockZ)) % ARRAYCOUNT(AvailableDirections)] / 3;
int BranchLength = 2 + a_Noise.IntNoise3DInt(a_BlockX * a_Seq, a_BlockY * a_Seq, a_BlockZ * a_Seq) % 3;
GetLargeAppleTreeBranch(a_BlockX, a_BlockY + i, a_BlockZ, BranchLength, BranchStartDirection, BranchDirection, a_BlockY + Height, a_Noise, a_LogBlocks);
@@ -476,10 +478,10 @@ NIBBLETYPE GetLogMetaFromDirection(NIBBLETYPE a_BlockMeta, Vector3d a_Direction)
void GetBirchTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks)
{
- int Height = 5 + (a_Noise.IntNoise3DInt(a_BlockX + 64 * a_Seq, a_BlockY, a_BlockZ) % 3);
+ HEIGHTTYPE Height = 5 + (a_Noise.IntNoise3DInt(a_BlockX + 64 * a_Seq, a_BlockY, a_BlockZ) % 3);
// Prealloc, so that we don't realloc too often later:
- a_LogBlocks.reserve(Height);
+ a_LogBlocks.reserve(static_cast<size_t>(Height));
a_OtherBlocks.reserve(80);
// The entire trunk, out of logs:
@@ -650,10 +652,10 @@ void GetDarkoakTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_No
void GetTallBirchTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks)
{
- int Height = 9 + (a_Noise.IntNoise3DInt(a_BlockX + 64 * a_Seq, a_BlockY, a_BlockZ) % 3);
+ HEIGHTTYPE Height = 9 + (a_Noise.IntNoise3DInt(a_BlockX + 64 * a_Seq, a_BlockY, a_BlockZ) % 3);
// Prealloc, so that we don't realloc too often later:
- a_LogBlocks.reserve(Height);
+ a_LogBlocks.reserve(static_cast<size_t>(Height));
a_OtherBlocks.reserve(80);
// The entire trunk, out of logs:
@@ -713,12 +715,12 @@ void GetSpruceTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noi
// (each of the mod8 remainders has a very different chance of occurrence) - that's why we divide by 8
int MyRandom = a_Noise.IntNoise3DInt(a_BlockX + 32 * a_Seq, a_BlockY + 32 * a_Seq, a_BlockZ) / 8;
- static const int sHeights[] = {1, 2, 2, 3};
- int Height = sHeights[MyRandom & 3];
+ static const HEIGHTTYPE sHeights[] = {1, 2, 2, 3};
+ HEIGHTTYPE Height = sHeights[MyRandom & 3];
MyRandom >>= 2;
// Prealloc, so that we don't realloc too often later:
- a_LogBlocks.reserve(Height);
+ a_LogBlocks.reserve(static_cast<size_t>(Height));
a_OtherBlocks.reserve(180);
// Clear trunk blocks:
@@ -816,8 +818,8 @@ void GetPineTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise
}
// Pre-allocate the vector:
- a_LogBlocks.reserve(TrunkHeight);
- a_OtherBlocks.reserve(NumLeavesLayers * 25);
+ a_LogBlocks.reserve(static_cast<size_t>(TrunkHeight));
+ a_OtherBlocks.reserve(static_cast<size_t>(NumLeavesLayers * 25));
// The entire trunk, out of logs:
for (int i = TrunkHeight; i >= 0; --i)
@@ -843,7 +845,7 @@ void GetPineTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise
{
break;
}
- ASSERT((size_t)LayerSize < ARRAYCOUNT(BigOs));
+ ASSERT(static_cast<size_t>(LayerSize) < ARRAYCOUNT(BigOs));
PushCoordBlocks(a_BlockX, h, a_BlockZ, a_OtherBlocks, BigOs[LayerSize].Coords, BigOs[LayerSize].Count, E_BLOCK_LEAVES, E_META_LEAVES_CONIFER);
h--;
}
@@ -866,8 +868,8 @@ void GetSwampTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Nois
int Height = 3 + (a_Noise.IntNoise3DInt(a_BlockX + 32 * a_Seq, a_BlockY, a_BlockZ + 32 * a_Seq) / 8) % 3;
- a_LogBlocks.reserve(Height);
- a_OtherBlocks.reserve(2 * ARRAYCOUNT(BigO2) + 2 * ARRAYCOUNT(BigO3) + Height * ARRAYCOUNT(Vines) + 20);
+ a_LogBlocks.reserve(static_cast<size_t>(Height));
+ a_OtherBlocks.reserve(2 * ARRAYCOUNT(BigO2) + 2 * ARRAYCOUNT(BigO3) + static_cast<size_t>(Height) * ARRAYCOUNT(Vines) + 20);
for (int i = 0; i < Height; i++)
{
@@ -920,9 +922,9 @@ void GetAppleBushImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Nois
-void GetJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks)
+void GetJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks, bool a_Large)
{
- if (a_Noise.IntNoise3DInt(a_BlockX + 32 * a_Seq, a_BlockY + 32 * a_Seq, a_BlockZ) < 0x60000000)
+ if (!a_Large)
{
GetSmallJungleTreeImage(a_BlockX, a_BlockY, a_BlockZ, a_Noise, a_Seq, a_LogBlocks, a_OtherBlocks);
}
@@ -952,8 +954,8 @@ void GetLargeJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise &
int Height = 24 + (a_Noise.IntNoise3DInt(a_BlockX + 32 * a_Seq, a_BlockY, a_BlockZ + 32 * a_Seq) / 11) % 24;
- a_LogBlocks.reserve(Height * 4);
- a_OtherBlocks.reserve(2 * ARRAYCOUNT(BigO4) + ARRAYCOUNT(BigO3) + Height * ARRAYCOUNT(Vines) + 50);
+ a_LogBlocks.reserve(static_cast<size_t>(Height) * 4);
+ a_OtherBlocks.reserve(2 * ARRAYCOUNT(BigO4) + ARRAYCOUNT(BigO3) + static_cast<size_t>(Height) * ARRAYCOUNT(Vines) + 50);
for (int i = 0; i < Height; i++)
{
@@ -999,12 +1001,12 @@ void GetSmallJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise &
int Height = 7 + (a_Noise.IntNoise3DInt(a_BlockX + 5 * a_Seq, a_BlockY, a_BlockZ + 5 * a_Seq) / 5) % 3;
- a_LogBlocks.reserve(Height);
+ a_LogBlocks.reserve(static_cast<size_t>(Height));
a_OtherBlocks.reserve(
2 * ARRAYCOUNT(BigO3) + // O3 layer, 2x
2 * ARRAYCOUNT(BigO2) + // O2 layer, 2x
ARRAYCOUNT(BigO1) + 1 + // Plus on the top
- Height * ARRAYCOUNT(Vines) + // Vines
+ static_cast<size_t>(Height) * ARRAYCOUNT(Vines) + // Vines
50 // some safety
);
@@ -1041,3 +1043,89 @@ void GetSmallJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise &
+
+bool GetLargeTreeAdjustment(cWorld & a_World, int & a_X, int & a_Y, int & a_Z, NIBBLETYPE a_Meta)
+{
+ bool IsLarge = true;
+ a_Meta = a_Meta & 0x07;
+
+ // Check to see if we are the northwest corner
+ for (int x = 0; x < 2; ++x)
+ {
+ for (int z = 0; z < 2; ++z)
+ {
+ NIBBLETYPE meta;
+ BLOCKTYPE type;
+ a_World.GetBlockTypeMeta(a_X + x, a_Y, a_Z + z, type, meta);
+ IsLarge = IsLarge && (type == E_BLOCK_SAPLING) && ((a_Meta & meta) == a_Meta);
+ }
+ }
+
+ if (IsLarge)
+ {
+ return true;
+ }
+
+ IsLarge = true;
+ // Check to see if we are the southwest corner
+ for (int x = 0; x < 2; ++x)
+ {
+ for (int z = 0; z > -2; --z)
+ {
+ NIBBLETYPE meta;
+ BLOCKTYPE type;
+ a_World.GetBlockTypeMeta(a_X + x, a_Y, a_Z + z, type, meta);
+ IsLarge = IsLarge && (type == E_BLOCK_SAPLING) && ((a_Meta & meta) == a_Meta);
+ }
+ }
+
+ if (IsLarge)
+ {
+ --a_Z;
+ return true;
+ }
+
+ IsLarge = true;
+ // Check to see if we are the southeast corner
+ for (int x = 0; x > -2; --x)
+ {
+ for (int z = 0; z > -2; --z)
+ {
+ NIBBLETYPE meta;
+ BLOCKTYPE type;
+ a_World.GetBlockTypeMeta(a_X + x, a_Y, a_Z + z, type, meta);
+ IsLarge = IsLarge && (type == E_BLOCK_SAPLING) && ((a_Meta & meta) == a_Meta);
+ }
+ }
+
+ if (IsLarge)
+ {
+ --a_Z;
+ --a_X;
+ return true;
+ }
+
+ IsLarge = true;
+ // Check to see if we are the northeast corner
+ for (int x = 0; x > -2; --x)
+ {
+ for (int z = 0; z < 2; ++z)
+ {
+ NIBBLETYPE meta;
+ BLOCKTYPE type;
+ a_World.GetBlockTypeMeta(a_X + x, a_Y, a_Z + z, type, meta);
+ IsLarge = IsLarge && (type == E_BLOCK_SAPLING) && ((a_Meta & meta) == a_Meta);
+ }
+ }
+
+ if (IsLarge)
+ {
+ --a_X;
+ }
+
+ return IsLarge;
+}
+
+
+
+
diff --git a/src/Generating/Trees.h b/src/Generating/Trees.h
index a2c8274f5..092d71182 100644
--- a/src/Generating/Trees.h
+++ b/src/Generating/Trees.h
@@ -20,6 +20,8 @@ logs can overwrite others(leaves), but others shouldn't overwrite logs. This is
#include "../ChunkDef.h"
#include "../Noise/Noise.h"
+class cWorld;
+
@@ -96,7 +98,7 @@ void GetSwampTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Nois
void GetAppleBushImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks);
/// Generates an image of a random jungle tree
-void GetJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks);
+void GetJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks, bool a_Large);
/// Generates an image of a large jungle tree (2x2 trunk)
void GetLargeJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks);
@@ -104,7 +106,7 @@ void GetLargeJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise &
/// Generates an image of a small jungle tree (1x1 trunk)
void GetSmallJungleTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise, int a_Seq, sSetBlockVector & a_LogBlocks, sSetBlockVector & a_OtherBlocks);
-
+bool GetLargeTreeAdjustment(cWorld & a_World, int & a_X, int & a_Y, int & a_Z, NIBBLETYPE a_Meta);
diff --git a/src/Generating/TwoHeights.cpp b/src/Generating/TwoHeights.cpp
index e75c301de..06c474458 100644
--- a/src/Generating/TwoHeights.cpp
+++ b/src/Generating/TwoHeights.cpp
@@ -69,7 +69,7 @@ public:
}
- virtual void InitializeShapeGen(cIniFile & a_IniFile)
+ virtual void InitializeShapeGen(cIniFile & a_IniFile) override
{
m_FrequencyX = static_cast<NOISE_DATATYPE>(a_IniFile.GetValueSetF("Generator", "TwoHeightsFrequencyX", 40));
m_FrequencyY = static_cast<NOISE_DATATYPE>(a_IniFile.GetValueSetF("Generator", "TwoHeightsFrequencyY", 40));
diff --git a/src/Generating/UnderwaterBaseGen.cpp b/src/Generating/UnderwaterBaseGen.cpp
index dbc4aef1b..c5066ca1b 100644
--- a/src/Generating/UnderwaterBaseGen.cpp
+++ b/src/Generating/UnderwaterBaseGen.cpp
@@ -76,7 +76,7 @@ protected:
{
for (cPlacedPieces::iterator itr = m_Pieces.begin(), end = m_Pieces.end(); itr != end; ++itr)
{
- cPrefab & Prefab = (cPrefab &)((*itr)->GetPiece());
+ const cPrefab & Prefab = static_cast<const cPrefab &>((*itr)->GetPiece());
Prefab.Draw(a_Chunk, *itr);
} // for itr - m_PlacedPieces[]
}
diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp
index a3f8caa46..2475565c0 100644
--- a/src/Generating/VillageGen.cpp
+++ b/src/Generating/VillageGen.cpp
@@ -5,11 +5,6 @@
#include "Globals.h"
#include "VillageGen.h"
-#include "Prefabs/AlchemistVillagePrefabs.h"
-#include "Prefabs/JapaneseVillagePrefabs.h"
-#include "Prefabs/PlainsVillagePrefabs.h"
-#include "Prefabs/SandVillagePrefabs.h"
-#include "Prefabs/SandFlatRoofVillagePrefabs.h"
#include "PieceGenerator.h"
@@ -52,6 +47,16 @@ public:
) :
super(a_PieceDefs, a_NumPieceDefs, a_StartingPieceDefs, a_NumStartingPieceDefs)
{
+ AddRoadPieces();
+ }
+
+ cVillagePiecePool(void)
+ {
+ AddRoadPieces();
+ }
+
+ void AddRoadPieces(void)
+ {
// Add the road pieces:
for (int len = 27; len < 60; len += 12)
{
@@ -93,7 +98,7 @@ public:
return 0;
}
- return ((const cPrefab &)a_NewPiece).GetPieceWeight(a_PlacedPiece, a_ExistingConnector);
+ return static_cast<const cPrefab &>(a_NewPiece).GetPieceWeight(a_PlacedPiece, a_ExistingConnector);
}
};
@@ -115,10 +120,8 @@ public:
int a_MaxRoadDepth,
int a_MaxSize,
int a_Density,
- cPiecePool & a_Prefabs,
- cTerrainHeightGenPtr a_HeightGen,
- BLOCKTYPE a_RoadBlock,
- BLOCKTYPE a_WaterRoadBlock
+ cVillagePiecePool & a_Prefabs,
+ cTerrainHeightGenPtr a_HeightGen
) :
super(a_GridX, a_GridZ, a_OriginX, a_OriginZ),
m_Seed(a_Seed),
@@ -127,9 +130,7 @@ public:
m_Density(a_Density),
m_Borders(a_OriginX - a_MaxSize, 0, a_OriginZ - a_MaxSize, a_OriginX + a_MaxSize, cChunkDef::Height - 1, a_OriginZ + a_MaxSize),
m_Prefabs(a_Prefabs),
- m_HeightGen(a_HeightGen),
- m_RoadBlock(a_RoadBlock),
- m_WaterRoadBlock(a_WaterRoadBlock)
+ m_HeightGen(a_HeightGen)
{
// Generate the pieces for this village; don't care about the Y coord:
cBFSPieceGenerator pg(*this, a_Seed);
@@ -141,7 +142,7 @@ public:
// If the central piece should be moved to ground, move it, and
// check all of its dependents and move those that are strictly connector-driven based on its new Y coord:
- if (((cPrefab &)m_Pieces[0]->GetPiece()).ShouldMoveToGround())
+ if (static_cast<const cPrefab &>(m_Pieces[0]->GetPiece()).ShouldMoveToGround())
{
int OrigPosY = m_Pieces[0]->GetCoords().y;
PlacePieceOnGround(*m_Pieces[0]);
@@ -172,7 +173,7 @@ protected:
cCuboid m_Borders;
/** Prefabs to use for buildings */
- cPiecePool & m_Prefabs;
+ cVillagePiecePool & m_Prefabs;
/** The underlying height generator, used for placing the structures on top of the terrain. */
cTerrainHeightGenPtr m_HeightGen;
@@ -180,12 +181,6 @@ protected:
/** The village pieces, placed by the generator. */
cPlacedPieces m_Pieces;
- /** The block to use for the roads. */
- BLOCKTYPE m_RoadBlock;
-
- /** The block used for the roads if the road is on water. */
- BLOCKTYPE m_WaterRoadBlock;
-
// cGridStructGen::cStructure overrides:
virtual void DrawIntoChunk(cChunkDesc & a_Chunk) override
@@ -197,7 +192,7 @@ protected:
m_HeightGen->GenHeightMap(a_Chunk.GetChunkX(), a_Chunk.GetChunkZ(), HeightMap);
for (cPlacedPieces::iterator itr = m_Pieces.begin(), end = m_Pieces.end(); itr != end; ++itr)
{
- cPrefab & Prefab = (cPrefab &)((*itr)->GetPiece());
+ const cPrefab & Prefab = static_cast<const cPrefab &>((*itr)->GetPiece());
if ((*itr)->GetPiece().GetSize().y == 1)
{
// It's a road, special handling (change top terrain blocks to m_RoadBlock)
@@ -241,17 +236,21 @@ protected:
int MaxX = std::min(RoadCoords.p2.x - a_Chunk.GetChunkX() * cChunkDef::Width, cChunkDef::Width - 1);
int MinZ = std::max(RoadCoords.p1.z - a_Chunk.GetChunkZ() * cChunkDef::Width, 0);
int MaxZ = std::min(RoadCoords.p2.z - a_Chunk.GetChunkZ() * cChunkDef::Width, cChunkDef::Width - 1);
+ auto WaterRoadBlockType = m_Prefabs.GetVillageWaterRoadBlockType();
+ auto WaterRoadBlockMeta = m_Prefabs.GetVillageWaterRoadBlockMeta();
+ auto RoadBlockType = m_Prefabs.GetVillageRoadBlockType();
+ auto RoadBlockMeta = m_Prefabs.GetVillageRoadBlockMeta();
for (int z = MinZ; z <= MaxZ; z++)
{
for (int x = MinX; x <= MaxX; x++)
{
if (IsBlockWater(a_Chunk.GetBlockType(x, cChunkDef::GetHeight(a_HeightMap, x, z), z)))
{
- a_Chunk.SetBlockType(x, cChunkDef::GetHeight(a_HeightMap, x, z), z, m_WaterRoadBlock);
+ a_Chunk.SetBlockTypeMeta(x, cChunkDef::GetHeight(a_HeightMap, x, z), z, WaterRoadBlockType, WaterRoadBlockMeta);
}
else
{
- a_Chunk.SetBlockType(x, cChunkDef::GetHeight(a_HeightMap, x, z), z, m_RoadBlock);
+ a_Chunk.SetBlockTypeMeta(x, cChunkDef::GetHeight(a_HeightMap, x, z), z, RoadBlockType, RoadBlockMeta);
}
}
}
@@ -259,13 +258,13 @@ protected:
// cPiecePool overrides:
- virtual cPieces GetPiecesWithConnector(int a_ConnectorType)
+ virtual cPieces GetPiecesWithConnector(int a_ConnectorType) override
{
return m_Prefabs.GetPiecesWithConnector(a_ConnectorType);
}
- virtual cPieces GetStartingPieces(void)
+ virtual cPieces GetStartingPieces(void) override
{
return m_Prefabs.GetStartingPieces();
}
@@ -319,7 +318,7 @@ protected:
{
if (
(a_PlacedPieces[i]->GetParent() == Pivot) && // It is a direct dependant of the pivot
- !((const cPrefab &)a_PlacedPieces[i]->GetPiece()).ShouldMoveToGround() // It attaches strictly by connectors
+ !(static_cast<const cPrefab &>(a_PlacedPieces[i]->GetPiece())).ShouldMoveToGround() // It attaches strictly by connectors
)
{
a_PlacedPieces[i]->MoveToGroundBy(a_HeightDifference);
@@ -336,30 +335,18 @@ protected:
////////////////////////////////////////////////////////////////////////////////
// cVillageGen:
-static cVillagePiecePool g_SandVillage(g_SandVillagePrefabs, g_SandVillagePrefabsCount, g_SandVillageStartingPrefabs, g_SandVillageStartingPrefabsCount);
-static cVillagePiecePool g_SandFlatRoofVillage(g_SandFlatRoofVillagePrefabs, g_SandFlatRoofVillagePrefabsCount, g_SandFlatRoofVillageStartingPrefabs, g_SandFlatRoofVillageStartingPrefabsCount);
-static cVillagePiecePool g_AlchemistVillage(g_AlchemistVillagePrefabs, g_AlchemistVillagePrefabsCount, g_AlchemistVillageStartingPrefabs, g_AlchemistVillageStartingPrefabsCount);
-static cVillagePiecePool g_PlainsVillage(g_PlainsVillagePrefabs, g_PlainsVillagePrefabsCount, g_PlainsVillageStartingPrefabs, g_PlainsVillageStartingPrefabsCount);
-static cVillagePiecePool g_JapaneseVillage(g_JapaneseVillagePrefabs, g_JapaneseVillagePrefabsCount, g_JapaneseVillageStartingPrefabs, g_JapaneseVillageStartingPrefabsCount);
-
-static cVillagePiecePool * g_DesertVillagePools[] =
-{
- &g_SandVillage,
- &g_SandFlatRoofVillage,
- &g_AlchemistVillage,
-} ;
-
-static cVillagePiecePool * g_PlainsVillagePools[] =
-{
- &g_PlainsVillage,
- &g_JapaneseVillage,
-} ;
-
-
-
-
-
-cVillageGen::cVillageGen(int a_Seed, int a_GridSize, int a_MaxOffset, int a_MaxDepth, int a_MaxSize, int a_MinDensity, int a_MaxDensity, cBiomeGenPtr a_BiomeGen, cTerrainHeightGenPtr a_HeightGen) :
+cVillageGen::cVillageGen(
+ int a_Seed,
+ int a_GridSize,
+ int a_MaxOffset,
+ int a_MaxDepth,
+ int a_MaxSize,
+ int a_MinDensity,
+ int a_MaxDensity,
+ cBiomeGenPtr a_BiomeGen,
+ cTerrainHeightGenPtr a_HeightGen,
+ const AStringVector & a_PrefabsToLoad
+) :
super(a_Seed, a_GridSize, a_GridSize, a_MaxOffset, a_MaxOffset, a_MaxSize, a_MaxSize, 100),
m_Noise(a_Seed + 1000),
m_MaxDepth(a_MaxDepth),
@@ -369,6 +356,21 @@ cVillageGen::cVillageGen(int a_Seed, int a_GridSize, int a_MaxOffset, int a_MaxD
m_BiomeGen(a_BiomeGen),
m_HeightGen(a_HeightGen)
{
+ for (const auto & toLoad: a_PrefabsToLoad)
+ {
+ auto prefabs = std::make_shared<cVillagePiecePool>();
+ auto fileName = Printf("Prefabs%sVillages%s%s.cubeset", cFile::GetPathSeparator().c_str(), cFile::GetPathSeparator().c_str(), toLoad.c_str());
+ if (prefabs->LoadFromFile(fileName, true))
+ {
+ if (NoCaseCompare(prefabs->GetIntendedUse(), "village") != 0)
+ {
+ LOGWARNING("Village generator: File %s is intended for use in \"%s\", rather than villages. Loading the file, but the generator may behave unexpectedly.",
+ fileName.c_str(), prefabs->GetIntendedUse().c_str()
+ );
+ }
+ m_Pools.push_back(std::move(prefabs));
+ }
+ }
}
@@ -383,60 +385,48 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_GridX, int a_Gr
cChunkDef::BiomeMap Biomes;
m_BiomeGen->GenBiomes(ChunkX, ChunkZ, Biomes);
- // Check if all the biomes are village-friendly:
- // If just one is not, no village is created, because it's likely that an unfriendly biome is too close
- cVillagePiecePool * VillagePrefabs = nullptr;
- BLOCKTYPE RoadBlock = E_BLOCK_GRAVEL;
- BLOCKTYPE WaterRoadBlock = E_BLOCK_PLANKS;
- int rnd = m_Noise.IntNoise2DInt(a_OriginX, a_OriginZ) / 11;
- cVillagePiecePool * PlainsVillage = g_PlainsVillagePools[rnd % ARRAYCOUNT(g_PlainsVillagePools)];
- cVillagePiecePool * DesertVillage = g_DesertVillagePools[rnd % ARRAYCOUNT(g_DesertVillagePools)];
+ // Get a list of pools that support each biome within the chunk:
+ // If just one column's biome is not allowed, the pool is not used because it's likely that an unfriendly biome is too close
+ auto availablePools = m_Pools;
for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++)
{
- switch (Biomes[i])
- {
- case biDesert:
- case biDesertM:
+ auto biome = Biomes[i];
+ availablePools.erase(std::remove_if(availablePools.begin(), availablePools.end(),
+ [biome](SharedPtr<cPrefabPiecePool> a_Pool)
{
- // These biomes allow sand villages
- VillagePrefabs = DesertVillage;
- // RoadBlock = E_BLOCK_SANDSTONE;
- break;
- }
- case biPlains:
- case biSavanna:
- case biSavannaM:
- case biSunflowerPlains:
- {
- // These biomes allow plains-style villages
- VillagePrefabs = PlainsVillage;
- break;
- }
- default:
- {
- // Village-unfriendly biome, bail out with zero structure:
- return cStructurePtr();
- }
- } // switch (Biomes[i])
- } // for i - Biomes[]
+ return !a_Pool->IsBiomeAllowed(biome);
+ }),
+ availablePools.end()
+ );
+ // Bail out if no compatible pools left:
+ if (availablePools.empty())
+ {
+ return cStructurePtr();
+ }
+ }
+
+ // Pick one pool from the available pools:
+ if (availablePools.empty())
+ {
+ return cStructurePtr();
+ }
+ auto rnd = m_Noise.IntNoise2DInt(a_OriginX, a_OriginZ) / 11;
+ auto pool = availablePools[static_cast<size_t>(rnd) % availablePools.size()];
+ rnd /= 137;
// Choose density for the village, random between m_MinDensity and m_MaxDensity:
int Density;
- if (m_MaxDensity > m_MinDensity)
+ if (pool->GetMaxDensity() > pool->GetMinDensity())
{
- Density = m_MinDensity + rnd % (m_MaxDensity - m_MinDensity);
+ Density = pool->GetMinDensity() + rnd % (pool->GetMaxDensity() - pool->GetMinDensity());
}
else
{
- Density = m_MinDensity;
+ Density = pool->GetMinDensity();
}
// Create a village based on the chosen prefabs:
- if (VillagePrefabs == nullptr)
- {
- return cStructurePtr();
- }
- return cStructurePtr(new cVillage(m_Seed, a_GridX, a_GridZ, a_OriginX, a_OriginZ, m_MaxDepth, m_MaxSize, Density, *VillagePrefabs, m_HeightGen, RoadBlock, WaterRoadBlock));
+ return cStructurePtr(new cVillage(m_Seed, a_GridX, a_GridZ, a_OriginX, a_OriginZ, m_MaxDepth, m_MaxSize, Density, *pool.get(), m_HeightGen));
}
diff --git a/src/Generating/VillageGen.h b/src/Generating/VillageGen.h
index c384ed9e5..e7f9f2529 100644
--- a/src/Generating/VillageGen.h
+++ b/src/Generating/VillageGen.h
@@ -16,15 +16,34 @@
+// fwd:
+class cVillagePiecePool;
+
+
+
+
+
class cVillageGen :
public cGridStructGen
{
typedef cGridStructGen super;
public:
- cVillageGen(int a_Seed, int a_GridSize, int a_MaxOffset, int a_MaxDepth, int a_MaxSize, int a_MinDensity, int a_MaxDensity, cBiomeGenPtr a_BiomeGen, cTerrainHeightGenPtr a_HeightGen);
+ /** Creates a new instance of the generator with the specified parameters. */
+ cVillageGen(
+ int a_Seed,
+ int a_GridSize,
+ int a_MaxOffset,
+ int a_MaxDepth,
+ int a_MaxSize,
+ int a_MinDensity, int a_MaxDensity,
+ cBiomeGenPtr a_BiomeGen,
+ cTerrainHeightGenPtr a_HeightGen,
+ const AStringVector & a_PrefabsToLoad
+ );
protected:
class cVillage; // fwd: VillageGen.cpp
+ typedef std::vector<SharedPtr<cVillagePiecePool> > cVillagePiecePools;
/** The noise used for generating random numbers */
cNoise m_Noise;
@@ -47,6 +66,9 @@ protected:
/** The underlying height generator, used to position the prefabs crossing chunk borders */
cTerrainHeightGenPtr m_HeightGen;
+ /** All available prefab sets. Each village gets one of these chosen randomly. */
+ cVillagePiecePools m_Pools;
+
// cGridStructGen overrides:
virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override;
diff --git a/src/Globals.h b/src/Globals.h
index 1f354ae77..f0e370d2c 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -192,14 +192,13 @@ template class SizeChecker<UInt8, 1>;
#define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT _WIN32_WINNT_WS03 // We want to target Windows XP with Service Pack 2 & Windows Server 2003 with Service Pack 1 and higher
+ // Windows SDK defines min and max macros, messing up with our std::min and std::max usage
+ #define NOMINMAX
+
#include <Windows.h>
#include <winsock2.h>
#include <Ws2tcpip.h> // IPv6 stuff
- // Windows SDK defines min and max macros, messing up with our std::min and std::max usage
- #undef min
- #undef max
-
// Windows SDK defines GetFreeSpace as a constant, probably a Win16 API remnant
#ifdef GetFreeSpace
#undef GetFreeSpace
@@ -221,6 +220,7 @@ template class SizeChecker<UInt8, 1>;
#include <semaphore.h>
#include <errno.h>
#include <fcntl.h>
+ #include <unistd.h>
#endif
#if defined(ANDROID_NDK)
@@ -261,15 +261,15 @@ template class SizeChecker<UInt8, 1>;
+// Common headers (part 1, without macros):
+#include "StringUtils.h"
+#include "OSSupport/CriticalSection.h"
+#include "OSSupport/Event.h"
+#include "OSSupport/File.h"
+#include "OSSupport/StackTrace.h"
+
#ifndef TEST_GLOBALS
- // Common headers (part 1, without macros):
- #include "StringUtils.h"
- #include "OSSupport/CriticalSection.h"
- #include "OSSupport/Semaphore.h"
- #include "OSSupport/Event.h"
- #include "OSSupport/File.h"
#include "Logger.h"
- #include "OSSupport/StackTrace.h"
#else
// Logging functions
void inline LOGERROR(const char * a_Format, ...) FORMATSTRING(1, 2);
@@ -316,6 +316,9 @@ void inline LOG(const char * a_Format, ...)
va_end(argList);
}
+#define LOGINFO LOG
+#define LOGWARN LOGWARNING
+
#endif
@@ -433,10 +436,14 @@ typename std::enable_if<std::is_arithmetic<T>::value, C>::type CeilC(T a_Value)
//temporary replacement for std::make_unique until we get c++14
-template <class T, class... Args>
-std::unique_ptr<T> make_unique(Args&&... args)
+
+namespace cpp14
{
- return std::unique_ptr<T>(new T(args...));
+ template <class T, class... Args>
+ std::unique_ptr<T> make_unique(Args&&... args)
+ {
+ return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+ }
}
// a tick is 50 ms
diff --git a/src/HTTPServer/CMakeLists.txt b/src/HTTPServer/CMakeLists.txt
index b0efc810d..ab3828aae 100644
--- a/src/HTTPServer/CMakeLists.txt
+++ b/src/HTTPServer/CMakeLists.txt
@@ -24,6 +24,11 @@ SET (HDRS
NameValueParser.h
SslHTTPConnection.h)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(HTTPServer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors -Wno-error=old-style-cast")
+ set_source_files_properties(HTTPConnection.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum")
+endif()
+
if(NOT MSVC)
add_library(HTTPServer ${SRCS} ${HDRS})
endif()
diff --git a/src/HTTPServer/HTTPConnection.cpp b/src/HTTPServer/HTTPConnection.cpp
index a5c6afd18..c6a45e6ed 100644
--- a/src/HTTPServer/HTTPConnection.cpp
+++ b/src/HTTPServer/HTTPConnection.cpp
@@ -213,7 +213,7 @@ void cHTTPConnection::OnReceivedData(const char * a_Data, size_t a_Size)
ASSERT(m_CurrentRequest != nullptr);
if (m_CurrentRequestBodyRemaining > 0)
{
- size_t BytesToConsume = std::min(m_CurrentRequestBodyRemaining, (size_t)a_Size);
+ size_t BytesToConsume = std::min(m_CurrentRequestBodyRemaining, static_cast<size_t>(a_Size));
m_HTTPServer.RequestBody(*this, *m_CurrentRequest, a_Data, BytesToConsume);
m_CurrentRequestBodyRemaining -= BytesToConsume;
}
diff --git a/src/HTTPServer/HTTPFormParser.cpp b/src/HTTPServer/HTTPFormParser.cpp
index 72872078b..77f98e43b 100644
--- a/src/HTTPServer/HTTPFormParser.cpp
+++ b/src/HTTPServer/HTTPFormParser.cpp
@@ -90,11 +90,6 @@ void cHTTPFormParser::Parse(const char * a_Data, size_t a_Size)
m_MultipartParser->Parse(a_Data, a_Size);
break;
}
- default:
- {
- ASSERT(!"Unhandled form kind");
- break;
- }
}
}
@@ -113,7 +108,7 @@ bool cHTTPFormParser::Finish(void)
ParseFormUrlEncoded();
break;
}
- default:
+ case fpkMultipart:
{
// Nothing needed for other formats
break;
diff --git a/src/HTTPServer/HTTPServer.cpp b/src/HTTPServer/HTTPServer.cpp
index 71f974a97..2eb8bf1ff 100644
--- a/src/HTTPServer/HTTPServer.cpp
+++ b/src/HTTPServer/HTTPServer.cpp
@@ -112,7 +112,9 @@ class cDebugCallbacks :
// TODO
}
-} g_DebugCallbacks;
+};
+
+static cDebugCallbacks g_DebugCallbacks;
diff --git a/src/HTTPServer/SslHTTPConnection.cpp b/src/HTTPServer/SslHTTPConnection.cpp
index f8dea0731..7239741da 100644
--- a/src/HTTPServer/SslHTTPConnection.cpp
+++ b/src/HTTPServer/SslHTTPConnection.cpp
@@ -55,7 +55,7 @@ void cSslHTTPConnection::OnReceivedData(const char * a_Data, size_t a_Size)
int NumRead = m_Ssl.ReadPlain(Buffer, sizeof(Buffer));
if (NumRead > 0)
{
- super::OnReceivedData(Buffer, (size_t)NumRead);
+ super::OnReceivedData(Buffer, static_cast<size_t>(NumRead));
}
else if (NumRead == POLARSSL_ERR_NET_WANT_READ)
{
diff --git a/src/IniFile.cpp b/src/IniFile.cpp
index 99c0a5f0f..635af740d 100644
--- a/src/IniFile.cpp
+++ b/src/IniFile.cpp
@@ -49,6 +49,9 @@ cIniFile::cIniFile(void) :
bool cIniFile::ReadFile(const AString & a_FileName, bool a_AllowExampleRedirect)
{
+
+ m_Filename = a_FileName;
+
// Normally you would use ifstream, but the SGI CC compiler has
// a few bugs with ifstream. So ... fstream used.
fstream f;
@@ -56,7 +59,8 @@ bool cIniFile::ReadFile(const AString & a_FileName, bool a_AllowExampleRedirect)
AString keyname, valuename, value;
AString::size_type pLeft, pRight;
bool IsFromExampleRedirect = false;
-
+
+
f.open((FILE_IO_PREFIX + a_FileName).c_str(), ios::in);
if (f.fail())
{
@@ -239,7 +243,7 @@ int cIniFile::FindKey(const AString & a_KeyName) const
{
if (CheckCase(names[keyID]) == CaseKeyName)
{
- return (int)keyID;
+ return static_cast<int>(keyID);
}
}
return noID;
@@ -650,7 +654,7 @@ void cIniFile::Clear(void)
-bool cIniFile::HasValue(const AString & a_KeyName, const AString & a_ValueName)
+bool cIniFile::HasValue(const AString & a_KeyName, const AString & a_ValueName) const
{
// Find the key:
int keyID = FindKey(a_KeyName);
@@ -855,7 +859,7 @@ AString cIniFile::CheckCase(const AString & s) const
size_t len = res.length();
for (size_t i = 0; i < len; i++)
{
- res[i] = tolower(res[i]);
+ res[i] = static_cast<char>(tolower(res[i]));
}
return res;
}
@@ -889,8 +893,36 @@ void cIniFile::RemoveBom(AString & a_line) const
+bool cIniFile::KeyExists(AString a_keyname) const
+{
+ return FindKey(a_keyname) != noID;
+}
+
+
+
+
+
+std::vector<std::pair<AString, AString>> cIniFile::GetValues(AString a_keyName)
+{
+ std::vector<std::pair<AString, AString>> ret;
+ int keyID = FindKey(a_keyName);
+ if (keyID == noID)
+ {
+ return ret;
+ }
+ for (size_t valueID = 0; valueID < keys[keyID].names.size(); ++valueID)
+ {
+ ret.emplace_back(keys[keyID].names[valueID], keys[keyID].values[valueID]);
+ }
+ return ret;
+}
+
+
+
+
+
AStringVector ReadUpgradeIniPorts(
- cIniFile & a_IniFile,
+ cSettingsRepositoryInterface & a_Settings,
const AString & a_KeyName,
const AString & a_PortsValueName,
const AString & a_OldIPv4ValueName,
@@ -899,23 +931,34 @@ AStringVector ReadUpgradeIniPorts(
)
{
// Read the regular value, but don't use the default (in order to detect missing value for upgrade):
- AStringVector Ports = StringSplitAndTrim(a_IniFile.GetValue(a_KeyName, a_PortsValueName), ";,");
+
+ AStringVector Ports;
+
+ for (auto pair : a_Settings.GetValues(a_KeyName))
+ {
+ if (pair.first != a_PortsValueName)
+ {
+ continue;
+ }
+ AStringVector temp = StringSplitAndTrim(pair.second, ";,");
+ Ports.insert(Ports.end(), temp.begin(), temp.end());
+ }
if (Ports.empty())
{
// Historically there were two separate entries for IPv4 and IPv6, merge them and migrate:
- AString Ports4 = a_IniFile.GetValue(a_KeyName, a_OldIPv4ValueName, a_DefaultValue);
- AString Ports6 = a_IniFile.GetValue(a_KeyName, a_OldIPv6ValueName);
+ AString Ports4 = a_Settings.GetValue(a_KeyName, a_OldIPv4ValueName, a_DefaultValue);
+ AString Ports6 = a_Settings.GetValue(a_KeyName, a_OldIPv6ValueName);
Ports = MergeStringVectors(StringSplitAndTrim(Ports4, ";,"), StringSplitAndTrim(Ports6, ";,"));
- a_IniFile.DeleteValue(a_KeyName, a_OldIPv4ValueName);
- a_IniFile.DeleteValue(a_KeyName, a_OldIPv6ValueName);
+ a_Settings.DeleteValue(a_KeyName, a_OldIPv4ValueName);
+ a_Settings.DeleteValue(a_KeyName, a_OldIPv6ValueName);
// If those weren't present or were empty, use the default:"
if (Ports.empty())
{
Ports = StringSplitAndTrim(a_DefaultValue, ";,");
}
- a_IniFile.SetValue(a_KeyName, a_PortsValueName, StringsConcat(Ports, ','));
+ a_Settings.SetValue(a_KeyName, a_PortsValueName, StringsConcat(Ports, ','));
}
return Ports;
@@ -923,4 +966,3 @@ AStringVector ReadUpgradeIniPorts(
-
diff --git a/src/IniFile.h b/src/IniFile.h
index 71fea3a00..a05e8f734 100644
--- a/src/IniFile.h
+++ b/src/IniFile.h
@@ -18,7 +18,7 @@
#pragma once
-
+#include "SettingsRepositoryInterface.h"
#define MAX_KEYNAME 128
#define MAX_VALUENAME 128
@@ -30,10 +30,12 @@
// tolua_begin
-class cIniFile
+class cIniFile : public cSettingsRepositoryInterface
{
private:
bool m_IsCaseInsensitive;
+
+ AString m_Filename;
struct key
{
@@ -53,15 +55,19 @@ private:
void RemoveBom(AString & a_line) const;
public:
-
- enum errors
- {
- noID = -1,
- };
/// Creates a new instance with no data
cIniFile(void);
+// tolua_end
+ virtual ~cIniFile() = default;
+
+ virtual std::vector<std::pair<AString, AString>> GetValues(AString a_keyName) override;
+
+ virtual bool KeyExists(const AString a_keyName) const override;
+
+// tolua_begin
+
// Sets whether or not keynames and valuenames should be case sensitive.
// The default is case insensitive.
void CaseSensitive (void) { m_IsCaseInsensitive = false; }
@@ -77,11 +83,13 @@ public:
/// Writes data stored in class to the specified ini file
bool WriteFile(const AString & a_FileName) const;
+ virtual bool Flush() override { return WriteFile(m_Filename); }
+
/// Deletes all stored ini data (but doesn't touch the file)
void Clear(void);
/** Returns true iff the specified value exists. */
- bool HasValue(const AString & a_KeyName, const AString & a_ValueName);
+ bool HasValue(const AString & a_KeyName, const AString & a_ValueName) const override;
/// Returns index of specified key, or noID if not found
int FindKey(const AString & keyname) const;
@@ -90,10 +98,10 @@ public:
int FindValue(const int keyID, const AString & valuename) const;
/// Returns number of keys currently in the ini
- int GetNumKeys(void) const { return (int)keys.size(); }
+ int GetNumKeys(void) const { return static_cast<int>(keys.size()); }
/// Add a key name
- int AddKeyName(const AString & keyname);
+ int AddKeyName(const AString & keyname) override;
// Returns key names by index.
AString GetKeyName(const int keyID) const;
@@ -109,7 +117,7 @@ public:
// Gets value of [keyname] valuename =.
// Overloaded to return string, int, and double.
// Returns defValue if key / value not found.
- AString GetValue (const AString & keyname, const AString & valuename, const AString & defValue = "") const;
+ AString GetValue (const AString & keyname, const AString & valuename, const AString & defValue = "") const override;
AString GetValue (const int keyID, const int valueID, const AString & defValue = "") const;
double GetValueF(const AString & keyname, const AString & valuename, const double defValue = 0) const;
int GetValueI(const AString & keyname, const AString & valuename, const int defValue = 0) const;
@@ -119,18 +127,18 @@ public:
}
// Gets the value; if not found, write the default to the INI file
- AString GetValueSet (const AString & keyname, const AString & valuename, const AString & defValue = "");
+ AString GetValueSet (const AString & keyname, const AString & valuename, const AString & defValue = "") override;
double GetValueSetF(const AString & keyname, const AString & valuename, const double defValue = 0.0);
- int GetValueSetI(const AString & keyname, const AString & valuename, const int defValue = 0);
- Int64 GetValueSetI(const AString & keyname, const AString & valuename, const Int64 defValue = 0);
- bool GetValueSetB(const AString & keyname, const AString & valuename, const bool defValue = false)
+ int GetValueSetI(const AString & keyname, const AString & valuename, const int defValue = 0) override;
+ Int64 GetValueSetI(const AString & keyname, const AString & valuename, const Int64 defValue = 0) override;
+ bool GetValueSetB(const AString & keyname, const AString & valuename, const bool defValue = false) override
{
return (GetValueSetI(keyname, valuename, defValue ? 1 : 0) != 0);
}
// Adds a new value to the specified key.
// If a value of the same name already exists, creates another one (non-standard INI file)
- void AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value);
+ void AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value) override;
void AddValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value);
void AddValueB(const AString & a_KeyName, const AString & a_ValueName, const bool a_Value)
{
@@ -143,8 +151,8 @@ public:
// Returns true if value set, false otherwise.
// Overloaded to accept string, int, and double.
bool SetValue (const int keyID, const int valueID, const AString & value);
- bool SetValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value, const bool a_CreateIfNotExists = true);
- bool SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists = true);
+ bool SetValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value, const bool a_CreateIfNotExists = true) override;
+ bool SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists = true) override;
bool SetValueI(const AString & a_Keyname, const AString & a_ValueName, const Int64 a_Value, const bool a_CreateIfNotExists = true);
bool SetValueB(const AString & a_KeyName, const AString & a_ValueName, const bool a_Value, const bool a_CreateIfNotExists = true)
{
@@ -155,7 +163,7 @@ public:
// Deletes specified value.
// Returns true if value existed and deleted, false otherwise.
bool DeleteValueByID(const int keyID, const int valueID);
- bool DeleteValue(const AString & keyname, const AString & valuename);
+ bool DeleteValue(const AString & keyname, const AString & valuename) override;
// Deletes specified key and all values contained within.
// Returns true if key existed and deleted, false otherwise.
@@ -165,7 +173,7 @@ public:
// Header comments are those comments before the first key.
/// Returns the number of header comments
- int GetNumHeaderComments(void) {return (int)comments.size();}
+ int GetNumHeaderComments(void) {return static_cast<int>(comments.size());}
/// Adds a header comment
void AddHeaderComment(const AString & comment);
@@ -196,15 +204,15 @@ public:
bool AddKeyComment(const int keyID, const AString & comment);
/// Add a key comment
- bool AddKeyComment(const AString & keyname, const AString & comment);
+ bool AddKeyComment(const AString & keyname, const AString & comment) override;
/// Return a key comment
AString GetKeyComment(const int keyID, const int commentID) const;
- AString GetKeyComment(const AString & keyname, const int commentID) const;
+ AString GetKeyComment(const AString & keyname, const int commentID) const override;
// Delete a key comment.
bool DeleteKeyComment(const int keyID, const int commentID);
- bool DeleteKeyComment(const AString & keyname, const int commentID);
+ bool DeleteKeyComment(const AString & keyname, const int commentID) override;
// Delete all comments for a key.
bool DeleteKeyComments(const int keyID);
@@ -222,7 +230,7 @@ Reads the list of ports from a_PortsValueName. If that value doesn't exist or is
in a_OldIPv4ValueName and a_OldIPv6ValueName; in this case the old values are removed from the INI file.
If there is none of the three values or they are all empty, the default is used and stored in the Ports value. */
AStringVector ReadUpgradeIniPorts(
- cIniFile & a_IniFile,
+ cSettingsRepositoryInterface & a_Settings,
const AString & a_KeyName,
const AString & a_PortsValueName,
const AString & a_OldIPv4ValueName,
diff --git a/src/Inventory.cpp b/src/Inventory.cpp
index c595da5b0..6b3c8e62f 100644
--- a/src/Inventory.cpp
+++ b/src/Inventory.cpp
@@ -98,7 +98,7 @@ int cInventory::HowManyCanFit(const cItem & a_ItemStack, int a_BeginSlotNum, int
-int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst)
+int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks)
{
cItem ToAdd(a_Item);
int res = 0;
@@ -116,7 +116,28 @@ int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks, bool a_tryT
}
}
- res += m_HotbarSlots.AddItem(ToAdd, a_AllowNewStacks, a_tryToFillEquippedFirst ? m_EquippedSlotNum : -1);
+ for (int SlotIdx = 0; SlotIdx < m_InventorySlots.GetNumSlots(); ++SlotIdx)
+ {
+ auto & Slot = m_InventorySlots.GetSlot(SlotIdx);
+ if (Slot.IsEqual(a_Item))
+ {
+ cItemHandler Handler(Slot.m_ItemType);
+ int AmountToAdd = std::min(static_cast<char>(Handler.GetMaxStackSize() - Slot.m_ItemCount), ToAdd.m_ItemCount);
+ res += AmountToAdd;
+
+ cItem SlotAdjusted(Slot);
+ SlotAdjusted.m_ItemCount += AmountToAdd;
+ m_InventorySlots.SetSlot(SlotIdx, SlotAdjusted);
+
+ ToAdd.m_ItemCount -= AmountToAdd;
+ if (ToAdd.m_ItemCount == 0)
+ {
+ return res;
+ }
+ }
+ }
+
+ res += m_HotbarSlots.AddItem(ToAdd, a_AllowNewStacks);
ToAdd.m_ItemCount = a_Item.m_ItemCount - res;
if (ToAdd.m_ItemCount == 0)
{
@@ -131,12 +152,12 @@ int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks, bool a_tryT
-int cInventory::AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst)
+int cInventory::AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks)
{
int TotalAdded = 0;
for (cItems::iterator itr = a_ItemStackList.begin(); itr != a_ItemStackList.end();)
{
- int NumAdded = AddItem(*itr, a_AllowNewStacks, a_tryToFillEquippedFirst);
+ int NumAdded = AddItem(*itr, a_AllowNewStacks);
if (itr->m_ItemCount == NumAdded)
{
itr = a_ItemStackList.erase(itr);
diff --git a/src/Inventory.h b/src/Inventory.h
index b2a8f658b..5501399bd 100644
--- a/src/Inventory.h
+++ b/src/Inventory.h
@@ -70,23 +70,17 @@ public:
/** Adds as many items out of a_ItemStack as can fit.
If a_AllowNewStacks is set to false, only existing stacks can be topped up;
if a_AllowNewStacks is set to true, empty slots can be used for the rest.
- If a_tryToFillEquippedFirst is set to true, the currently equipped slot will be used first (if empty or
- compatible with added items)
- if a_tryToFillEquippedFirst is set to false, the regular order applies.
Returns the number of items that fit.
*/
- int AddItem(const cItem & a_ItemStack, bool a_AllowNewStacks = true, bool a_tryToFillEquippedFirst = false);
+ int AddItem(const cItem & a_ItemStack, bool a_AllowNewStacks = true);
/** Same as AddItem, but works on an entire list of item stacks.
The a_ItemStackList is modified to reflect the leftover items.
If a_AllowNewStacks is set to false, only existing stacks can be topped up;
if a_AllowNewStacks is set to true, empty slots can be used for the rest.
- If a_tryToFillEquippedFirst is set to true, the currently equipped slot will be used first (if empty or
- compatible with added items)
- if a_tryToFillEquippedFirst is set to false, the regular order applies.
Returns the total number of items that fit.
*/
- int AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst);
+ int AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks);
/** Removes the specified item from the inventory, as many as possible, up to a_ItemStack.m_ItemCount.
Returns the number of items that were removed. */
diff --git a/src/ItemGrid.cpp b/src/ItemGrid.cpp
index 06971a1ac..8433598f7 100644
--- a/src/ItemGrid.cpp
+++ b/src/ItemGrid.cpp
@@ -358,7 +358,7 @@ int cItemGrid::RemoveItem(const cItem & a_ItemStack)
if (m_Slots[i].IsEqual(a_ItemStack))
{
- int NumToRemove = std::min(NumLeft, (int)m_Slots[i].m_ItemCount);
+ int NumToRemove = std::min(NumLeft, static_cast<int>(m_Slots[i].m_ItemCount));
NumLeft -= NumToRemove;
m_Slots[i].m_ItemCount -= NumToRemove;
diff --git a/src/Items/CMakeLists.txt b/src/Items/CMakeLists.txt
index c50ddb372..71f2d9ceb 100644
--- a/src/Items/CMakeLists.txt
+++ b/src/Items/CMakeLists.txt
@@ -56,6 +56,10 @@ SET (HDRS
ItemThrowable.h
)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(ItemHandler.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=conversion -Wno-error=old-style-cast -Wno-error=switch-enum")
+endif()
+
if(NOT MSVC)
add_library(Items ${SRCS} ${HDRS})
endif()
diff --git a/src/Items/ItemBed.h b/src/Items/ItemBed.h
index 77d51d744..15b924a08 100644
--- a/src/Items/ItemBed.h
+++ b/src/Items/ItemBed.h
@@ -25,10 +25,11 @@ public:
}
- virtual bool OnPlayerPlace(
+ virtual bool GetBlocksToPlace(
cWorld & a_World, cPlayer & a_Player, const cItem & a_EquippedItem,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
- int a_CursorX, int a_CursorY, int a_CursorZ
+ int a_CursorX, int a_CursorY, int a_CursorZ,
+ sSetBlockVector & a_BlocksToPlace
) override
{
// Can only be placed on the floor:
@@ -36,12 +37,10 @@ public:
{
return false;
}
- AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
// The "foot" block:
- sSetBlockVector blks;
NIBBLETYPE BlockMeta = cBlockBedHandler::RotationToMetaData(a_Player.GetYaw());
- blks.emplace_back(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_BED, BlockMeta);
+ a_BlocksToPlace.emplace_back(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_BED, BlockMeta);
// Check if there is empty space for the "head" block:
// (Vanilla only allows beds to be placed into air)
@@ -50,10 +49,8 @@ public:
{
return false;
}
- blks.emplace_back(a_BlockX + Direction.x, a_BlockY, a_BlockZ + Direction.z, E_BLOCK_BED, BlockMeta | 0x08);
-
- // Place both bed blocks:
- return a_Player.PlaceBlocks(blks);
+ a_BlocksToPlace.emplace_back(a_BlockX + Direction.x, a_BlockY, a_BlockZ + Direction.z, E_BLOCK_BED, BlockMeta | 0x08);
+ return true;
}
} ;
diff --git a/src/Items/ItemBigFlower.h b/src/Items/ItemBigFlower.h
index 4341a1a17..a052485e4 100644
--- a/src/Items/ItemBigFlower.h
+++ b/src/Items/ItemBigFlower.h
@@ -27,10 +27,11 @@ public:
}
- virtual bool OnPlayerPlace(
+ virtual bool GetBlocksToPlace(
cWorld & a_World, cPlayer & a_Player, const cItem & a_EquippedItem,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
- int a_CursorX, int a_CursorY, int a_CursorZ
+ int a_CursorX, int a_CursorY, int a_CursorZ,
+ sSetBlockVector & a_BlocksToSet
) override
{
// Can only be placed on the floor:
@@ -38,16 +39,14 @@ public:
{
return false;
}
- AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
- // Place both blocks atomically:
- sSetBlockVector blks;
- blks.emplace_back(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_BIG_FLOWER, a_EquippedItem.m_ItemDamage & 0x07);
+ AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
+ a_BlocksToSet.emplace_back(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_BIG_FLOWER, a_EquippedItem.m_ItemDamage & 0x07);
if (a_BlockY < cChunkDef::Height - 1)
{
- blks.emplace_back(a_BlockX, a_BlockY + 1, a_BlockZ, E_BLOCK_BIG_FLOWER, (a_EquippedItem.m_ItemDamage & 0x07) | 0x08);
+ a_BlocksToSet.emplace_back(a_BlockX, a_BlockY + 1, a_BlockZ, E_BLOCK_BIG_FLOWER, (a_EquippedItem.m_ItemDamage & 0x07) | 0x08);
}
- return a_Player.PlaceBlocks(blks);
+ return true;
}
};
diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h
index 5164ddf59..8bbaa3d8c 100644
--- a/src/Items/ItemBow.h
+++ b/src/Items/ItemBow.h
@@ -53,7 +53,7 @@ public:
ASSERT(a_Player != nullptr);
int BowCharge = a_Player->FinishChargingBow();
- double Force = (double)BowCharge / 20.0;
+ double Force = static_cast<double>(BowCharge) / 20.0;
Force = (Force * Force + 2.0 * Force) / 3.0; // This formula is used by the 1.6.2 client
if (Force < 0.1)
{
@@ -80,7 +80,14 @@ public:
Arrow = nullptr;
return;
}
- a_Player->GetWorld()->BroadcastSoundEffect("random.bow", a_Player->GetPosX(), a_Player->GetPosY(), a_Player->GetPosZ(), 0.5, (float)Force);
+ a_Player->GetWorld()->BroadcastSoundEffect(
+ "random.bow",
+ a_Player->GetPosX(),
+ a_Player->GetPosY(),
+ a_Player->GetPosZ(),
+ 0.5,
+ static_cast<float>(Force)
+ );
if (!a_Player->IsGameModeCreative())
{
if (a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchInfinity) == 0)
diff --git a/src/Items/ItemBucket.h b/src/Items/ItemBucket.h
index 015720415..4d39bde82 100644
--- a/src/Items/ItemBucket.h
+++ b/src/Items/ItemBucket.h
@@ -80,6 +80,13 @@ public:
return false;
}
+ // Check to see if destination block is too far away
+ // Reach Distance Multiplayer = 5 Blocks
+ if ((BlockPos.x - a_Player->GetPosX() > 5) || (BlockPos.z - a_Player->GetPosZ() > 5))
+ {
+ return false;
+ }
+
// Remove water / lava block (unless plugins disagree)
if (!a_Player->PlaceBlock(BlockPos.x, BlockPos.y, BlockPos.z, E_BLOCK_AIR, 0))
{
@@ -96,7 +103,7 @@ public:
ASSERT(!"Inventory bucket mismatch");
return true;
}
- if (a_Player->GetInventory().AddItem(cItem(NewItem), true, true) != 1)
+ if (a_Player->GetInventory().AddItem(cItem(NewItem)) != 1)
{
// The bucket didn't fit, toss it as a pickup:
a_Player->TossPickup(cItem(NewItem));
@@ -126,6 +133,13 @@ public:
{
return false;
}
+
+ // Check to see if destination block is too far away
+ // Reach Distance Multiplayer = 5 Blocks
+ if ((BlockPos.x - a_Player->GetPosX() > 5) || (BlockPos.z - a_Player->GetPosZ() > 5))
+ {
+ return false;
+ }
if (a_Player->GetGameMode() != gmCreative)
{
@@ -137,7 +151,7 @@ public:
return false;
}
cItem Item(E_ITEM_BUCKET, 1);
- if (!a_Player->GetInventory().AddItem(Item, true, true))
+ if (!a_Player->GetInventory().AddItem(Item))
{
return false;
}
@@ -236,7 +250,7 @@ public:
m_EntryFace = static_cast<eBlockFace>(a_CBEntryFace);
if (!cFluidSimulator::CanWashAway(a_CBBlockType) && !IsBlockLiquid(a_CBBlockType))
{
- AddFaceDirection(a_CBBlockX, a_CBBlockY, a_CBBlockZ, (eBlockFace)a_CBEntryFace); // Was an unwashawayable block, can't overwrite it!
+ AddFaceDirection(a_CBBlockX, a_CBBlockY, a_CBBlockZ, static_cast<eBlockFace>(a_CBEntryFace)); // Was an unwashawayable block, can't overwrite it!
}
m_Pos.Set(a_CBBlockX, a_CBBlockY, a_CBBlockZ); // (Block could be washed away, replace it)
return true; // Abort tracing
diff --git a/src/Items/ItemChest.h b/src/Items/ItemChest.h
index 1d23975cd..3dd112c91 100644
--- a/src/Items/ItemChest.h
+++ b/src/Items/ItemChest.h
@@ -27,6 +27,8 @@ public:
}
+ /** We need an OnPlayerPlace override because we're processing neighbor chests and changing their metas,
+ the parent class cannot do that. */
virtual bool OnPlayerPlace(
cWorld & a_World, cPlayer & a_Player, const cItem & a_EquippedItem,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
@@ -118,34 +120,32 @@ public:
} // for j
} // for i
- // If there's no chest neighbor, place the single block chest and bail out:
+ // Get the meta of the placed chest; take existing neighbors into account:
BLOCKTYPE ChestBlockType = static_cast<BLOCKTYPE>(m_ItemType);
- if (NeighborIdx < 0)
+ NIBBLETYPE Meta;
+ auto yaw = a_Player.GetYaw();
+ switch (NeighborIdx)
{
- NIBBLETYPE Meta = cBlockChestHandler::PlayerYawToMetaData(a_Player.GetYaw());
- return a_Player.PlaceBlock(a_BlockX, a_BlockY, a_BlockZ, ChestBlockType, Meta);
- }
-
- // There is a neighbor to which we need to adjust
- double yaw = a_Player.GetYaw();
- if ((NeighborIdx == 0) || (NeighborIdx == 2))
- {
- // The neighbor is in the X axis, form a X-axis-aligned dblchest:
- NIBBLETYPE Meta = ((yaw >= -90) && (yaw < 90)) ? E_META_CHEST_FACING_ZM : E_META_CHEST_FACING_ZP;
-
- // Place the new chest:
- if (!a_Player.PlaceBlock(a_BlockX, a_BlockY, a_BlockZ, ChestBlockType, Meta))
+ case 0:
+ case 2:
{
- return false;
+ // The neighbor is in the X axis, form a X-axis-aligned dblchest:
+ Meta = ((yaw >= -90) && (yaw < 90)) ? E_META_CHEST_FACING_ZM : E_META_CHEST_FACING_ZP;
+ break;
}
-
- // Adjust the existing chest:
- a_World.FastSetBlock(a_BlockX + CrossCoords[NeighborIdx].x, a_BlockY, a_BlockZ + CrossCoords[NeighborIdx].z, ChestBlockType, Meta);
- return true;
- }
-
- // The neighbor is in the Z axis, form a Z-axis-aligned dblchest:
- NIBBLETYPE Meta = (yaw < 0) ? E_META_CHEST_FACING_XM : E_META_CHEST_FACING_XP;
+ case 1:
+ case 3:
+ {
+ // The neighbor is in the Z axis, form a Z-axis-aligned dblchest:
+ Meta = (yaw < 0) ? E_META_CHEST_FACING_XM : E_META_CHEST_FACING_XP;
+ break;
+ }
+ default:
+ {
+ Meta = cBlockChestHandler::PlayerYawToMetaData(yaw);
+ break;
+ }
+ } // switch (NeighborIdx)
// Place the new chest:
if (!a_Player.PlaceBlock(a_BlockX, a_BlockY, a_BlockZ, ChestBlockType, Meta))
@@ -153,8 +153,31 @@ public:
return false;
}
- // Adjust the existing chest:
- a_World.FastSetBlock(a_BlockX + CrossCoords[NeighborIdx].x, a_BlockY, a_BlockZ + CrossCoords[NeighborIdx].z, ChestBlockType, Meta);
+ // Adjust the existing chest, if any:
+ if (NeighborIdx > 0)
+ {
+ a_World.FastSetBlock(a_BlockX + CrossCoords[NeighborIdx].x, a_BlockY, a_BlockZ + CrossCoords[NeighborIdx].z, ChestBlockType, Meta);
+ }
+
+ // Play the placement sound:
+ AString PlaceSound = cBlockInfo::GetPlaceSound(ChestBlockType);
+ float Volume = 1.0f, Pitch = 0.8f;
+ if (PlaceSound == "dig.metal")
+ {
+ Pitch = 1.2f;
+ PlaceSound = "dig.stone";
+ }
+ else if (PlaceSound == "random.anvil_land")
+ {
+ Volume = 0.65f;
+ }
+ a_World.BroadcastSoundEffect(PlaceSound, a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, Volume, Pitch);
+
+ // Remove the "placed" item:
+ if (a_Player.IsGameModeSurvival())
+ {
+ a_Player.GetInventory().RemoveOneEquippedItem();
+ }
return true;
}
diff --git a/src/Items/ItemDoor.h b/src/Items/ItemDoor.h
index ddd3d4e20..e92c567fb 100644
--- a/src/Items/ItemDoor.h
+++ b/src/Items/ItemDoor.h
@@ -20,10 +20,11 @@ public:
}
- virtual bool OnPlayerPlace(
+ virtual bool GetBlocksToPlace(
cWorld & a_World, cPlayer & a_Player, const cItem & a_EquippedItem,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
- int a_CursorX, int a_CursorY, int a_CursorZ
+ int a_CursorX, int a_CursorY, int a_CursorZ,
+ sSetBlockVector & a_BlocksToSet
) override
{
// Vanilla only allows door placement while clicking on the top face of the block below the door:
@@ -31,7 +32,6 @@ public:
{
return false;
}
- AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
// Door (bottom block) can be placed in Y range of [1, 254]:
if ((a_BlockY < 1) || (a_BlockY >= cChunkDef::Height - 2))
@@ -107,10 +107,9 @@ public:
}
// Set the blocks:
- sSetBlockVector blks;
- blks.emplace_back(a_BlockX, a_BlockY, a_BlockZ, BlockType, LowerBlockMeta);
- blks.emplace_back(a_BlockX, a_BlockY + 1, a_BlockZ, BlockType, UpperBlockMeta);
- return a_Player.PlaceBlocks(blks);
+ a_BlocksToSet.emplace_back(a_BlockX, a_BlockY, a_BlockZ, BlockType, LowerBlockMeta);
+ a_BlocksToSet.emplace_back(a_BlockX, a_BlockY + 1, a_BlockZ, BlockType, UpperBlockMeta);
+ return true;
}
diff --git a/src/Items/ItemDye.h b/src/Items/ItemDye.h
index 273af826a..c2635bcb6 100644
--- a/src/Items/ItemDye.h
+++ b/src/Items/ItemDye.h
@@ -27,7 +27,7 @@ public:
) override
{
// Handle growing the plants:
- if (a_Item.m_ItemDamage == E_META_DYE_WHITE)
+ if ((a_Item.m_ItemDamage == E_META_DYE_WHITE) && (a_BlockFace != BLOCK_FACE_NONE))
{
if (a_World->GrowRipePlant(a_BlockX, a_BlockY, a_BlockZ, true))
{
diff --git a/src/Items/ItemEmptyMap.h b/src/Items/ItemEmptyMap.h
index 6e944b4da..fba8c0a2c 100644
--- a/src/Items/ItemEmptyMap.h
+++ b/src/Items/ItemEmptyMap.h
@@ -60,7 +60,7 @@ public:
return true;
}
- a_Player->GetInventory().AddItem(cItem(E_ITEM_MAP, 1, (short)(NewMap->GetID() & 0x7fff)), true, true);
+ a_Player->GetInventory().AddItem(cItem(E_ITEM_MAP, 1, (short)(NewMap->GetID() & 0x7fff)));
return true;
}
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index b7f89809e..a1fa67152 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -367,37 +367,51 @@ bool cItemHandler::OnPlayerPlace(
return false;
}
}
-
- BLOCKTYPE BlockType;
- NIBBLETYPE BlockMeta;
- if (!GetPlacementBlockTypeMeta(&a_World, &a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, BlockType, BlockMeta))
+
+ // Get all the blocks to place:
+ sSetBlockVector blocks;
+ if (!GetBlocksToPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, blocks))
{
// Handler refused the placement, send that information back to the client:
+ for (const auto & blk: blocks)
+ {
+ a_World.SendBlockTo(blk.GetX(), blk.GetY(), blk.GetZ(), &a_Player);
+ }
a_World.SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, &a_Player);
a_Player.GetInventory().SendEquippedSlot();
return false;
}
- if (!a_Player.PlaceBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta))
+ // Try to place the blocks:
+ if (!a_Player.PlaceBlocks(blocks))
{
- // The placement failed, the block has already been re-sent, re-send inventory:
+ // The placement failed, the blocks have already been re-sent, re-send inventory:
a_Player.GetInventory().SendEquippedSlot();
return false;
}
- AString PlaceSound = cBlockInfo::GetPlaceSound(BlockType);
- float Volume = 1.0f, Pitch = 0.8f;
- if (PlaceSound == "dig.metal")
- {
- Pitch = 1.2f;
- PlaceSound = "dig.stone";
- }
- else if (PlaceSound == "random.anvil_land")
+ // Play the placement sound for the main block:
+ for (const auto & blk: blocks)
{
- Volume = 0.65f;
- }
-
- a_World.BroadcastSoundEffect(PlaceSound, a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, Volume, Pitch);
+ // Find the main block by comparing the coords:
+ if ((blk.GetX() != a_BlockX) || (blk.GetY() != a_BlockY) || (blk.GetZ() != a_BlockZ))
+ {
+ continue;
+ }
+ AString PlaceSound = cBlockInfo::GetPlaceSound(blk.m_BlockType);
+ float Volume = 1.0f, Pitch = 0.8f;
+ if (PlaceSound == "dig.metal")
+ {
+ Pitch = 1.2f;
+ PlaceSound = "dig.stone";
+ }
+ else if (PlaceSound == "random.anvil_land")
+ {
+ Volume = 0.65f;
+ }
+ a_World.BroadcastSoundEffect(PlaceSound, a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, Volume, Pitch);
+ break;
+ } // for blk - blocks[]
// Remove the "placed" item:
if (a_Player.IsGameModeSurvival())
@@ -411,6 +425,27 @@ bool cItemHandler::OnPlayerPlace(
+bool cItemHandler::GetBlocksToPlace(
+ cWorld & a_World, cPlayer & a_Player, const cItem & a_EquippedItem,
+ int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
+ int a_CursorX, int a_CursorY, int a_CursorZ,
+ sSetBlockVector & a_BlocksToSet
+)
+{
+ BLOCKTYPE BlockType;
+ NIBBLETYPE BlockMeta;
+ if (!GetPlacementBlockTypeMeta(&a_World, &a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, BlockType, BlockMeta))
+ {
+ return false;
+ }
+ a_BlocksToSet.emplace_back(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta);
+ return true;
+}
+
+
+
+
+
bool cItemHandler::OnItemUse(
cWorld * a_World, cPlayer * a_Player, cBlockPluginInterface & a_PluginInterface, const cItem & a_Item,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace
diff --git a/src/Items/ItemHandler.h b/src/Items/ItemHandler.h
index ec88aeb99..684b55788 100644
--- a/src/Items/ItemHandler.h
+++ b/src/Items/ItemHandler.h
@@ -35,8 +35,9 @@ public:
/** Called when the player tries to place the item (right mouse button, IsPlaceable() == true).
- The default handler uses GetPlacementBlockTypeMeta and places the returned block.
- Override this function for advanced behavior such as placing multiple blocks.
+ The block coords are for the block that has been clicked.
+ The default handler uses GetBlocksToPlace() and places the returned blocks.
+ Override if the item needs advanced processing, such as spawning a mob based on the blocks being placed.
If the block placement is refused inside this call, it will automatically revert the client-side changes.
Returns true if the placement succeeded, false if the placement was aborted for any reason. */
virtual bool OnPlayerPlace(
@@ -46,7 +47,20 @@ public:
);
- /** Called when the player right-clicks with this item and IsPlaceable() == true, and OnPlace() is not overridden.
+ /** Called from OnPlayerPlace() to determine the blocks that the current placement operation should set.
+ The block coords are where the new (main) block should be placed.
+ The default handler uses GetPlacementBlockTypeMeta() and provides that as the single block at the specified coords.
+ Returns true if the placement succeeded, false if the placement was aborted for any reason.
+ If aborted, the server then sends all original blocks in the coords provided in a_BlocksToSet to the client. */
+ virtual bool GetBlocksToPlace(
+ cWorld & a_World, cPlayer & a_Player, const cItem & a_EquippedItem,
+ int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
+ int a_CursorX, int a_CursorY, int a_CursorZ,
+ sSetBlockVector & a_BlocksToSet
+ );
+
+
+ /** Called when the player right-clicks with this item and IsPlaceable() == true, and OnPlayerPlace() is not overridden.
This function should provide the block type and meta for the placed block, or refuse the placement.
Returns true to allow placement, false to refuse. */
virtual bool GetPlacementBlockTypeMeta(
diff --git a/src/Items/ItemMobHead.h b/src/Items/ItemMobHead.h
index 8780f7e4b..9a4044bc0 100644
--- a/src/Items/ItemMobHead.h
+++ b/src/Items/ItemMobHead.h
@@ -12,9 +12,11 @@
class cItemMobHeadHandler :
public cItemHandler
{
+ typedef cItemHandler super;
+
public:
cItemMobHeadHandler(int a_ItemType) :
- cItemHandler(a_ItemType)
+ super(a_ItemType)
{
}
@@ -30,34 +32,36 @@ public:
{
return true;
}
- AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
+ auto placedX = a_BlockX, placedY = a_BlockY, placedZ = a_BlockZ;
+ AddFaceDirection(placedY, placedY, placedZ, a_BlockFace);
// If the placed head is a wither, try to spawn the wither first:
if (a_EquippedItem.m_ItemDamage == E_META_HEAD_WITHER)
{
- if (TrySpawnWitherAround(a_World, a_Player, a_BlockX, a_BlockY, a_BlockZ))
+ if (TrySpawnWitherAround(a_World, a_Player, placedX, placedY, placedZ))
{
return true;
}
// Wither not created, proceed with regular head placement
}
- return PlaceRegularHead(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
+ cItem itemCopy(a_EquippedItem); // Make a copy in case this is the player's last head item and OnPlayerPlace removes it
+ if (!super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ))
+ {
+ return false;
+ }
+ RegularHeadPlaced(a_World, a_Player, itemCopy, placedX, placedY, placedZ, a_BlockFace);
+ return true;
}
- /** Places a regular head block with no mob spawning checking. */
- bool PlaceRegularHead(
+ /** Called after placing a regular head block with no mob spawning.
+ Adjusts the mob head entity based on the equipped item's data. */
+ void RegularHeadPlaced(
cWorld & a_World, cPlayer & a_Player, const cItem & a_EquippedItem,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace
)
{
- // Place the block:
- if (!a_Player.PlaceBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_HEAD, BlockFaceToBlockMeta(a_BlockFace)))
- {
- return false;
- }
-
// Use a callback to set the properties of the mob head block entity:
class cCallback : public cBlockEntityCallback
{
@@ -71,7 +75,7 @@ public:
{
return false;
}
- cMobHeadEntity * MobHeadEntity = static_cast<cMobHeadEntity *>(a_BlockEntity);
+ auto MobHeadEntity = static_cast<cMobHeadEntity *>(a_BlockEntity);
int Rotation = 0;
if (m_BlockMeta == 1)
@@ -94,7 +98,6 @@ public:
};
cCallback Callback(a_Player, static_cast<eMobHeadType>(a_EquippedItem.m_ItemDamage), static_cast<NIBBLETYPE>(a_BlockFace));
a_World.DoWithBlockEntityAt(a_BlockX, a_BlockY, a_BlockZ, Callback);
- return true;
}
@@ -340,7 +343,7 @@ public:
) override
{
a_BlockType = E_BLOCK_HEAD;
- a_BlockMeta = (NIBBLETYPE)(a_Player->GetEquippedItem().m_ItemDamage & 0x0f);
+ a_BlockMeta = BlockFaceToBlockMeta(a_BlockFace);
return true;
}
} ;
diff --git a/src/Items/ItemMushroomSoup.h b/src/Items/ItemMushroomSoup.h
index dba313ec5..1a761cbf1 100644
--- a/src/Items/ItemMushroomSoup.h
+++ b/src/Items/ItemMushroomSoup.h
@@ -41,7 +41,7 @@ public:
// Return a bowl to the inventory
if (!a_Player->IsGameModeCreative())
{
- a_Player->GetInventory().AddItem(cItem(E_ITEM_BOWL), true, true);
+ a_Player->GetInventory().AddItem(cItem(E_ITEM_BOWL));
}
return true;
}
diff --git a/src/Items/ItemSign.h b/src/Items/ItemSign.h
index dabbdbba1..3da93e2f1 100644
--- a/src/Items/ItemSign.h
+++ b/src/Items/ItemSign.h
@@ -25,7 +25,7 @@ public:
cWorld & a_World, cPlayer & a_Player, const cItem & a_EquippedItem,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
int a_CursorX, int a_CursorY, int a_CursorZ
- )
+ ) override
{
// If the regular placement doesn't work, do no further processing:
if (!super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ))
diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp
index effde03d0..7f13a94fd 100644
--- a/src/LightingThread.cpp
+++ b/src/LightingThread.cpp
@@ -43,8 +43,8 @@ class cReader :
{
// Copy the entire heightmap, distribute it into the 3x3 chunk blob:
typedef struct {HEIGHTTYPE m_Row[16]; } ROW;
- ROW * InputRows = (ROW *)a_Heightmap;
- ROW * OutputRows = (ROW *)m_HeightMap;
+ const ROW * InputRows = reinterpret_cast<const ROW *>(a_Heightmap);
+ ROW * OutputRows = reinterpret_cast<ROW *>(m_HeightMap);
int InputIdx = 0;
int OutputIdx = m_ReadingChunkX + m_ReadingChunkZ * cChunkDef::Width * 3;
for (int z = 0; z < cChunkDef::Width; z++)
@@ -149,11 +149,11 @@ void cLightingThread::Stop(void)
-void cLightingThread::QueueChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_CallbackAfter)
+void cLightingThread::QueueChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr<cChunkCoordCallback> a_CallbackAfter)
{
ASSERT(m_World != nullptr); // Did you call Start() properly?
- cChunkStay * ChunkStay = new cLightingChunkStay(*this, a_ChunkX, a_ChunkZ, a_CallbackAfter);
+ cChunkStay * ChunkStay = new cLightingChunkStay(*this, a_ChunkX, a_ChunkZ, std::move(a_CallbackAfter));
{
// The ChunkStay will enqueue itself using the QueueChunkStay() once it is fully loaded
// In the meantime, put it into the PendingQueue so that it can be removed when stopping the thread
@@ -217,7 +217,7 @@ void cLightingThread::Execute(void)
{
continue;
}
- Item = (cLightingChunkStay *)m_Queue.front();
+ Item = static_cast<cLightingChunkStay *>(m_Queue.front());
m_Queue.pop_front();
if (m_Queue.empty())
{
@@ -599,11 +599,11 @@ void cLightingThread::QueueChunkStay(cLightingChunkStay & a_ChunkStay)
////////////////////////////////////////////////////////////////////////////////
// cLightingThread::cLightingChunkStay:
-cLightingThread::cLightingChunkStay::cLightingChunkStay(cLightingThread & a_LightingThread, int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_CallbackAfter) :
+cLightingThread::cLightingChunkStay::cLightingChunkStay(cLightingThread & a_LightingThread, int a_ChunkX, int a_ChunkZ, std::unique_ptr<cChunkCoordCallback> a_CallbackAfter) :
m_LightingThread(a_LightingThread),
m_ChunkX(a_ChunkX),
m_ChunkZ(a_ChunkZ),
- m_CallbackAfter(a_CallbackAfter)
+ m_CallbackAfter(std::move(a_CallbackAfter))
{
Add(a_ChunkX + 1, a_ChunkZ + 1);
Add(a_ChunkX + 1, a_ChunkZ);
diff --git a/src/LightingThread.h b/src/LightingThread.h
index 87eb9c6d8..da6be12c8 100644
--- a/src/LightingThread.h
+++ b/src/LightingThread.h
@@ -61,7 +61,7 @@ public:
void Stop(void);
/** Queues the entire chunk for lighting */
- void QueueChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_CallbackAfter = nullptr);
+ void QueueChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr<cChunkCoordCallback> a_CallbackAfter);
/** Blocks until the queue is empty or the thread is terminated */
void WaitForQueueEmpty(void);
@@ -77,9 +77,9 @@ protected:
cLightingThread & m_LightingThread;
int m_ChunkX;
int m_ChunkZ;
- cChunkCoordCallback * m_CallbackAfter;
+ std::unique_ptr<cChunkCoordCallback> m_CallbackAfter;
- cLightingChunkStay(cLightingThread & a_LightingThread, int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_CallbackAfter);
+ cLightingChunkStay(cLightingThread & a_LightingThread, int a_ChunkX, int a_ChunkZ, std::unique_ptr<cChunkCoordCallback> a_CallbackAfter);
protected:
virtual void OnChunkAvailable(int a_ChunkX, int a_ChunkZ) override
diff --git a/src/LineBlockTracer.cpp b/src/LineBlockTracer.cpp
index e43a79566..587fa0e7c 100644
--- a/src/LineBlockTracer.cpp
+++ b/src/LineBlockTracer.cpp
@@ -96,17 +96,17 @@ bool cLineBlockTracer::Trace(double a_StartX, double a_StartY, double a_StartZ,
m_Callbacks->OnIntoWorld(m_StartX, m_StartY, m_StartZ);
}
- m_CurrentX = (int)floor(m_StartX);
- m_CurrentY = (int)floor(m_StartY);
- m_CurrentZ = (int)floor(m_StartZ);
+ m_CurrentX = FloorC(m_StartX);
+ m_CurrentY = FloorC(m_StartY);
+ m_CurrentZ = FloorC(m_StartZ);
m_DiffX = m_EndX - m_StartX;
m_DiffY = m_EndY - m_StartY;
m_DiffZ = m_EndZ - m_StartZ;
// The actual trace is handled with ChunkMapCS locked by calling our Item() for the specified chunk
- int BlockX = (int)floor(m_StartX);
- int BlockZ = (int)floor(m_StartZ);
+ int BlockX = FloorC(m_StartX);
+ int BlockZ = FloorC(m_StartZ);
int ChunkX, ChunkZ;
cChunkDef::BlockToChunk(BlockX, BlockZ, ChunkX, ChunkZ);
return m_World->DoWithChunk(ChunkX, ChunkZ, *this);
@@ -120,7 +120,7 @@ void cLineBlockTracer::FixStartAboveWorld(void)
{
// We must set the start Y to less than cChunkDef::Height so that it is considered inside the world later on
// Therefore we use an EPS-offset from the height, as small as reasonably possible.
- const double Height = (double)cChunkDef::Height - 0.00001;
+ const double Height = static_cast<double>(cChunkDef::Height) - 0.00001;
CalcXZIntersection(Height, m_StartX, m_StartZ);
m_StartY = Height;
}
@@ -154,38 +154,45 @@ bool cLineBlockTracer::MoveToNextBlock(void)
{
// Find out which of the current block's walls gets hit by the path:
static const double EPS = 0.00001;
- double Coeff = 1;
- enum eDirection
+ enum
{
dirNONE,
dirX,
dirY,
dirZ,
} Direction = dirNONE;
+
+ // Calculate the next YZ wall hit:
+ double Coeff = 1;
if (std::abs(m_DiffX) > EPS)
{
double DestX = (m_DirX > 0) ? (m_CurrentX + 1) : m_CurrentX;
- Coeff = (DestX - m_StartX) / m_DiffX;
- if (Coeff <= 1)
+ double CoeffX = (DestX - m_StartX) / m_DiffX;
+ if (CoeffX <= 1) // We need to include equality for the last block in the trace
{
+ Coeff = CoeffX;
Direction = dirX;
}
}
+
+ // If the next XZ wall hit is closer, use it instead:
if (std::abs(m_DiffY) > EPS)
{
double DestY = (m_DirY > 0) ? (m_CurrentY + 1) : m_CurrentY;
double CoeffY = (DestY - m_StartY) / m_DiffY;
- if (CoeffY < Coeff)
+ if (CoeffY <= Coeff) // We need to include equality for the last block in the trace
{
Coeff = CoeffY;
Direction = dirY;
}
}
+
+ // If the next XY wall hit is closer, use it instead:
if (std::abs(m_DiffZ) > EPS)
{
double DestZ = (m_DirZ > 0) ? (m_CurrentZ + 1) : m_CurrentZ;
double CoeffZ = (DestZ - m_StartZ) / m_DiffZ;
- if (CoeffZ < Coeff)
+ if (CoeffZ <= Coeff) // We need to include equality for the last block in the trace
{
Direction = dirZ;
}
diff --git a/src/LinearUpscale.h b/src/LinearUpscale.h
index 1b0fbd89a..adc873912 100644
--- a/src/LinearUpscale.h
+++ b/src/LinearUpscale.h
@@ -109,11 +109,11 @@ template <typename TYPE> void LinearUpscale2DArray(
TYPE RatioY[MAX_UPSCALE_Y];
for (int x = 0; x <= a_UpscaleX; x++)
{
- RatioX[x] = (TYPE)x / a_UpscaleX;
+ RatioX[x] = static_cast<TYPE>(x) / a_UpscaleX;
}
for (int y = 0; y <= a_UpscaleY; y++)
{
- RatioY[y] = (TYPE)y / a_UpscaleY;
+ RatioY[y] = static_cast<TYPE>(y) / a_UpscaleY;
}
// Interpolate each XY cell:
@@ -184,15 +184,15 @@ template <typename TYPE> void LinearUpscale3DArray(
TYPE RatioZ[MAX_UPSCALE_Z];
for (int x = 0; x <= a_UpscaleX; x++)
{
- RatioX[x] = (TYPE)x / a_UpscaleX;
+ RatioX[x] = static_cast<TYPE>(x) / a_UpscaleX;
}
for (int y = 0; y <= a_UpscaleY; y++)
{
- RatioY[y] = (TYPE)y / a_UpscaleY;
+ RatioY[y] = static_cast<TYPE>(y) / a_UpscaleY;
}
for (int z = 0; z <= a_UpscaleZ; z++)
{
- RatioZ[z] = (TYPE)z / a_UpscaleZ;
+ RatioZ[z] = static_cast<TYPE>(z) / a_UpscaleZ;
}
// Interpolate each XYZ cell:
diff --git a/src/LoggerListeners.cpp b/src/LoggerListeners.cpp
index 5c7097956..91964c57e 100644
--- a/src/LoggerListeners.cpp
+++ b/src/LoggerListeners.cpp
@@ -3,6 +3,8 @@
#include "LoggerListeners.h"
+#include <chrono>
+
#if defined(_WIN32)
#include <io.h> // Needed for _isatty(), not available on Linux
#include <time.h>
@@ -236,8 +238,26 @@ public:
-cLogger::cListener * MakeConsoleListener(void)
+// Listener for when stdout is closed, i.e. When running as a daemon.
+class cNullConsoleListener
+ : public cLogger::cListener
{
+ virtual void Log(AString a_Message, cLogger::eLogLevel a_LogLevel) override
+ {
+ }
+};
+
+
+
+
+
+cLogger::cListener * MakeConsoleListener(bool a_IsService)
+{
+ if (a_IsService)
+ {
+ return new cNullConsoleListener;
+ }
+
#ifdef _WIN32
// See whether we are writing to a console the default console attrib:
bool ShouldColorOutput = (_isatty(_fileno(stdin)) != 0);
@@ -279,9 +299,15 @@ cLogger::cListener * MakeConsoleListener(void)
cFileListener::cFileListener(void)
{
cFile::CreateFolder(FILE_IO_PREFIX + AString("logs"));
- AString FileName;
- FileName = Printf("%s%sLOG_%d.txt", FILE_IO_PREFIX, "logs/", (int)time(nullptr));
- m_File.Open(FileName, cFile::fmAppend);
+ m_File.Open(
+ FILE_IO_PREFIX + Printf(
+ "logs/LOG_%d.txt",
+ std::chrono::duration_cast<std::chrono::duration<int, std::ratio<1>>>(
+ std::chrono::system_clock::now().time_since_epoch()
+ ).count()
+ ),
+ cFile::fmAppend
+ );
}
@@ -300,7 +326,7 @@ void cFileListener::Log(AString a_Message, cLogger::eLogLevel a_LogLevel)
}
case cLogger::llInfo:
{
- LogLevelPrefix = "info ";
+ LogLevelPrefix = "Info ";
break;
}
case cLogger::llWarning:
diff --git a/src/LoggerListeners.h b/src/LoggerListeners.h
index c419aa75a..a7f9a35a5 100644
--- a/src/LoggerListeners.h
+++ b/src/LoggerListeners.h
@@ -25,7 +25,7 @@ private:
-cLogger::cListener * MakeConsoleListener();
+cLogger::cListener * MakeConsoleListener(bool a_IsService);
diff --git a/src/Map.cpp b/src/Map.cpp
index 5f296a5b2..48d7fb0ca 100644
--- a/src/Map.cpp
+++ b/src/Map.cpp
@@ -224,7 +224,7 @@ bool cMap::UpdatePixel(unsigned int a_X, unsigned int a_Z)
return false;
}
- unsigned int PixelWidth = m_Map->GetPixelWidth();
+ unsigned int CallbackPixelWidth = m_Map->GetPixelWidth();
if (m_Map->GetDimension() == dimNether)
{
@@ -237,9 +237,9 @@ bool cMap::UpdatePixel(unsigned int a_X, unsigned int a_Z)
ColorCountMap ColorCounts;
// Count surface blocks
- for (unsigned int X = m_RelX; X < m_RelX + PixelWidth; ++X)
+ for (unsigned int X = m_RelX; X < m_RelX + CallbackPixelWidth; ++X)
{
- for (unsigned int Z = m_RelZ; Z < m_RelZ + PixelWidth; ++Z)
+ for (unsigned int Z = m_RelZ; Z < m_RelZ + CallbackPixelWidth; ++Z)
{
// unsigned int WaterDepth = 0;
diff --git a/src/MapManager.cpp b/src/MapManager.cpp
index fc67bd901..41b0d9e34 100644
--- a/src/MapManager.cpp
+++ b/src/MapManager.cpp
@@ -76,7 +76,7 @@ cMap * cMapManager::GetMapData(unsigned int a_ID)
-cMap * cMapManager::CreateMap(int a_CenterX, int a_CenterY, int a_Scale)
+cMap * cMapManager::CreateMap(int a_CenterX, int a_CenterY, unsigned int a_Scale)
{
cCSLock Lock(m_CS);
@@ -86,7 +86,7 @@ cMap * cMapManager::CreateMap(int a_CenterX, int a_CenterY, int a_Scale)
return nullptr;
}
- cMap Map((unsigned)m_MapData.size(), a_CenterX, a_CenterY, m_World, a_Scale);
+ cMap Map(static_cast<unsigned>(m_MapData.size()), a_CenterX, a_CenterY, m_World, a_Scale);
m_MapData.push_back(Map);
@@ -151,7 +151,7 @@ void cMapManager::SaveMapData(void)
cIDCountSerializer IDSerializer(m_World->GetName());
- IDSerializer.SetMapCount((unsigned)m_MapData.size());
+ IDSerializer.SetMapCount(static_cast<unsigned>(m_MapData.size()));
if (!IDSerializer.Save())
{
diff --git a/src/MapManager.h b/src/MapManager.h
index 1059773c3..cacc6d816 100644
--- a/src/MapManager.h
+++ b/src/MapManager.h
@@ -36,7 +36,7 @@ public:
cMap * GetMapData(unsigned int a_ID);
/** Creates a new map. Returns nullptr on error */
- cMap * CreateMap(int a_CenterX, int a_CenterY, int a_Scale = 3);
+ cMap * CreateMap(int a_CenterX, int a_CenterY, unsigned int a_Scale = 3);
/** Calls the callback for the map with the specified ID.
Returns true if the map was found and the callback called, false if map not found.
diff --git a/src/Matrix4.h b/src/Matrix4.h
index 61ea60bfd..0558fa5f3 100644
--- a/src/Matrix4.h
+++ b/src/Matrix4.h
@@ -76,8 +76,8 @@ public:
inline void RotateX(T a_RX)
{
- T sx = (T) sin(a_RX * M_PI / 180);
- T cx = (T) cos(a_RX * M_PI / 180);
+ T sx = static_cast<T>(sin(a_RX * M_PI / 180));
+ T cx = static_cast<T>(cos(a_RX * M_PI / 180));
Identity();
@@ -87,8 +87,8 @@ public:
inline void RotateY(T a_RY)
{
- T sy = (T) sin(a_RY * M_PI / 180);
- T cy = (T) cos(a_RY * M_PI / 180);
+ T sy = static_cast<T>(sin(a_RY * M_PI / 180));
+ T cy = static_cast<T>(cos(a_RY * M_PI / 180));
Identity();
diff --git a/src/MemorySettingsRepository.cpp b/src/MemorySettingsRepository.cpp
new file mode 100644
index 000000000..21b4c769c
--- /dev/null
+++ b/src/MemorySettingsRepository.cpp
@@ -0,0 +1,312 @@
+
+#include "Globals.h"
+
+#include "MemorySettingsRepository.h"
+
+
+
+
+bool cMemorySettingsRepository::KeyExists(const AString keyname) const
+{
+ return m_Map.count(keyname) != 0;
+}
+
+
+
+
+
+bool cMemorySettingsRepository::HasValue(const AString & a_KeyName, const AString & a_ValueName) const
+{
+ auto outerIter = m_Map.find(a_KeyName);
+ if (outerIter == m_Map.end())
+ {
+ return false;
+ }
+ auto iter = outerIter->second.find(a_ValueName);
+ if (iter == outerIter->second.end())
+ {
+ return false;
+ }
+ return true;
+}
+
+
+
+
+int cMemorySettingsRepository::AddKeyName(const AString & a_keyname)
+{
+ m_Map.emplace(a_keyname, std::unordered_multimap<AString, sValue>{});
+ return 0;
+}
+
+
+
+
+
+bool cMemorySettingsRepository::AddKeyComment(const AString & keyname, const AString & comment)
+{
+ return false;
+}
+
+
+
+
+
+AString cMemorySettingsRepository::GetKeyComment(const AString & keyname, const int commentID) const
+{
+ return "";
+}
+
+
+
+
+
+bool cMemorySettingsRepository::DeleteKeyComment(const AString & keyname, const int commentID)
+{
+ return false;
+}
+
+
+
+
+
+
+void cMemorySettingsRepository::AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value)
+{
+ if (m_Writable)
+ {
+ m_Map[a_KeyName].emplace(a_ValueName, sValue(a_Value));
+ }
+}
+
+
+
+
+void cMemorySettingsRepository::AddValue (const AString & a_KeyName, const AString & a_ValueName, Int64 a_Value)
+{
+ if (m_Writable)
+ {
+ m_Map[a_KeyName].emplace(a_ValueName, sValue(a_Value));
+ }
+}
+
+
+
+
+
+void cMemorySettingsRepository::AddValue (const AString & a_KeyName, const AString & a_ValueName, bool a_Value)
+{
+ if (m_Writable)
+ {
+ m_Map[a_KeyName].emplace(a_ValueName, sValue(a_Value));
+ }
+}
+
+
+
+
+
+std::vector<std::pair<AString, AString>> cMemorySettingsRepository::GetValues(AString a_keyName)
+{
+ std::vector<std::pair<AString, AString>> ret;
+ for (auto pair : m_Map[a_keyName])
+ {
+ ret.emplace_back(pair.first, pair.second.getStringValue());
+ }
+ return ret;
+}
+
+
+
+
+
+AString cMemorySettingsRepository::GetValue (const AString & a_KeyName, const AString & a_ValueName, const AString & defValue) const
+{
+ auto outerIter = m_Map.find(a_KeyName);
+ if (outerIter == m_Map.end())
+ {
+ return defValue;
+ }
+ auto iter = outerIter->second.find(a_ValueName);
+ if (iter == outerIter->second.end())
+ {
+ return defValue;
+ }
+ return iter->second.getStringValue();
+}
+
+
+
+
+
+AString cMemorySettingsRepository::GetValueSet (const AString & a_KeyName, const AString & a_ValueName, const AString & defValue)
+{
+ auto outerIter = m_Map.find(a_KeyName);
+ if (outerIter == m_Map.end())
+ {
+ AddValue(a_KeyName, a_ValueName, defValue);
+ return defValue;
+ }
+ auto iter = outerIter->second.find(a_ValueName);
+ if (iter == outerIter->second.end())
+ {
+ AddValue(a_KeyName, a_ValueName, defValue);
+ return defValue;
+ }
+ return iter->second.getStringValue();
+}
+
+
+
+
+
+int cMemorySettingsRepository::GetValueSetI(const AString & a_KeyName, const AString & a_ValueName, const int defValue)
+{
+ auto outerIter = m_Map.find(a_KeyName);
+ if (outerIter == m_Map.end())
+ {
+ AddValue(a_KeyName, a_ValueName, static_cast<Int64>(defValue));
+ return defValue;
+ }
+ auto iter = outerIter->second.find(a_ValueName);
+ if (iter == outerIter->second.end())
+ {
+ AddValue(a_KeyName, a_ValueName, static_cast<Int64>(defValue));
+ return defValue;
+ }
+ return static_cast<int>(iter->second.getIntValue());
+}
+
+
+
+
+
+Int64 cMemorySettingsRepository::GetValueSetI(const AString & a_KeyName, const AString & a_ValueName, const Int64 defValue)
+{
+ auto outerIter = m_Map.find(a_KeyName);
+ if (outerIter == m_Map.end())
+ {
+ AddValue(a_KeyName, a_ValueName, defValue);
+ return defValue;
+ }
+ auto iter = outerIter->second.find(a_ValueName);
+ if (iter == outerIter->second.end())
+ {
+ AddValue(a_KeyName, a_ValueName, defValue);
+ return defValue;
+ }
+ return iter->second.getIntValue();
+}
+
+
+
+
+bool cMemorySettingsRepository::GetValueSetB(const AString & a_KeyName, const AString & a_ValueName, const bool defValue)
+{
+ auto outerIter = m_Map.find(a_KeyName);
+ if (outerIter == m_Map.end())
+ {
+ AddValue(a_KeyName, a_ValueName, defValue);
+ return defValue;
+ }
+ auto iter = outerIter->second.find(a_ValueName);
+ if (iter == outerIter->second.end())
+ {
+ AddValue(a_KeyName, a_ValueName, defValue);
+ return defValue;
+ }
+ return iter->second.getBoolValue();
+}
+
+
+
+
+
+bool cMemorySettingsRepository::SetValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value, const bool a_CreateIfNotExists)
+{
+ if (!m_Writable)
+ {
+ return false;
+ }
+ auto outerIter = m_Map.find(a_KeyName);
+ if (outerIter == m_Map.end())
+ {
+ if (a_CreateIfNotExists)
+ {
+ AddValue(a_KeyName, a_ValueName, a_Value);
+ }
+ return a_CreateIfNotExists;
+ }
+ auto iter = outerIter->second.find(a_ValueName);
+ if (iter == outerIter->second.end())
+ {
+ if (a_CreateIfNotExists)
+ {
+ AddValue(a_KeyName, a_ValueName, a_Value);
+ }
+ return a_CreateIfNotExists;
+ }
+ iter->second = sValue(a_Value);
+ return true;
+}
+
+
+
+
+bool cMemorySettingsRepository::SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists)
+{
+ if (!m_Writable)
+ {
+ return false;
+ }
+ auto outerIter = m_Map.find(a_KeyName);
+ if (outerIter == m_Map.end())
+ {
+ if (a_CreateIfNotExists)
+ {
+ AddValue(a_KeyName, a_ValueName, static_cast<Int64>(a_Value));
+ }
+ return a_CreateIfNotExists;
+ }
+ auto iter = outerIter->second.find(a_ValueName);
+ if (iter == outerIter->second.end())
+ {
+ if (a_CreateIfNotExists)
+ {
+ AddValue(a_KeyName, a_ValueName, static_cast<Int64>(a_Value));
+ }
+ return a_CreateIfNotExists;
+ }
+ iter->second = sValue(static_cast<Int64>(a_Value));
+ return true;
+}
+
+
+
+
+
+bool cMemorySettingsRepository::DeleteValue(const AString & a_KeyName, const AString & a_ValueName)
+{
+ if (!m_Writable)
+ {
+ return false;
+ }
+ auto outerIter = m_Map.find(a_KeyName);
+ if (outerIter == m_Map.end())
+ {
+ return false;
+ }
+ auto iter = outerIter->second.find(a_ValueName);
+ if (iter == outerIter->second.end())
+ {
+ return false;
+ }
+ outerIter->second.erase(iter);
+ return true;
+}
+
+bool cMemorySettingsRepository::Flush()
+{
+ return true;
+}
+
diff --git a/src/MemorySettingsRepository.h b/src/MemorySettingsRepository.h
new file mode 100644
index 000000000..335bc4513
--- /dev/null
+++ b/src/MemorySettingsRepository.h
@@ -0,0 +1,80 @@
+
+#pragma once
+
+#include "SettingsRepositoryInterface.h"
+
+#include <unordered_map>
+
+class cMemorySettingsRepository : public cSettingsRepositoryInterface
+{
+public:
+
+ virtual bool KeyExists(const AString keyname) const override;
+
+ virtual bool HasValue(const AString & a_KeyName, const AString & a_ValueName) const override;
+
+ virtual int AddKeyName(const AString & keyname) override;
+
+ virtual bool AddKeyComment(const AString & keyname, const AString & comment) override;
+
+ virtual AString GetKeyComment(const AString & keyname, const int commentID) const override;
+
+ virtual bool DeleteKeyComment(const AString & keyname, const int commentID) override;
+
+ virtual void AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value) override;
+ void AddValue (const AString & a_KeyName, const AString & a_ValueName, const Int64 a_Value);
+ void AddValue (const AString & a_KeyName, const AString & a_ValueName, const bool a_Value);
+
+ virtual std::vector<std::pair<AString, AString>> GetValues(AString a_keyName) override;
+
+ virtual AString GetValue (const AString & keyname, const AString & valuename, const AString & defValue = "") const override;
+
+
+ virtual AString GetValueSet (const AString & keyname, const AString & valuename, const AString & defValue = "") override;
+ virtual int GetValueSetI(const AString & keyname, const AString & valuename, const int defValue = 0) override;
+ virtual Int64 GetValueSetI(const AString & keyname, const AString & valuename, const Int64 defValue = 0) override;
+ virtual bool GetValueSetB(const AString & keyname, const AString & valuename, const bool defValue = false) override;
+
+ virtual bool SetValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value, const bool a_CreateIfNotExists = true) override;
+ virtual bool SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists = true) override;
+
+ virtual bool DeleteValue(const AString & keyname, const AString & valuename) override;
+
+ virtual bool Flush() override;
+
+ void SetReadOnly()
+ {
+ m_Writable = false;
+ }
+
+private:
+
+ bool m_Writable = true;
+
+ struct sValue
+ {
+ sValue(AString value) : m_Type(eType::String), m_stringValue (value) {}
+ sValue(Int64 value) : m_Type(eType::Int64), m_intValue(value) {}
+ sValue(bool value) : m_Type(eType::Bool), m_boolValue(value) {}
+
+ AString getStringValue() const { ASSERT(m_Type == eType::String); return m_stringValue; }
+ Int64 getIntValue() const { ASSERT(m_Type == eType::Int64); return m_intValue; }
+ bool getBoolValue() const { ASSERT(m_Type == eType::Bool); return m_boolValue; }
+ private:
+ enum class eType
+ {
+ String,
+ Int64,
+ Bool
+ } m_Type;
+ AString m_stringValue;
+ union
+ {
+ Int64 m_intValue;
+ bool m_boolValue;
+ };
+ };
+
+ std::unordered_map<AString, std::unordered_multimap<AString, sValue>> m_Map{};
+};
+
diff --git a/src/MobCensus.cpp b/src/MobCensus.cpp
index 1a69d8370..79b5176d2 100644
--- a/src/MobCensus.cpp
+++ b/src/MobCensus.cpp
@@ -41,12 +41,17 @@ int cMobCensus::GetCapMultiplier(cMonster::eFamily a_MobFamily)
case cMonster::mfPassive: return 11;
case cMonster::mfAmbient: return 16;
case cMonster::mfWater: return 5;
- default:
+ case cMonster::mfNoSpawn:
+ case cMonster::mfUnhandled:
{
ASSERT(!"Unhandled mob family");
return -1;
}
}
+ #if !defined(__clang__)
+ ASSERT(!"Unknown mob family");
+ return -1;
+ #endif
}
@@ -64,7 +69,7 @@ void cMobCensus::CollectSpawnableChunk(cChunk & a_Chunk)
int cMobCensus::GetNumChunks(void)
{
- return (int)m_EligibleForSpawnChunks.size();
+ return static_cast<int>(m_EligibleForSpawnChunks.size());
}
diff --git a/src/MobFamilyCollecter.cpp b/src/MobFamilyCollecter.cpp
index 6da330c83..c24ee48f5 100644
--- a/src/MobFamilyCollecter.cpp
+++ b/src/MobFamilyCollecter.cpp
@@ -18,7 +18,7 @@ void cMobFamilyCollecter::CollectMob(cMonster & a_Monster)
int cMobFamilyCollecter::GetNumberOfCollectedMobs(cMonster::eFamily a_Family)
{
- return (int)m_Mobs[a_Family].size();
+ return static_cast<int>(m_Mobs[a_Family].size());
}
diff --git a/src/MobSpawner.cpp b/src/MobSpawner.cpp
index 468b0cfb2..27dc5a877 100644
--- a/src/MobSpawner.cpp
+++ b/src/MobSpawner.cpp
@@ -110,7 +110,7 @@ eMonsterType cMobSpawner::ChooseMobType(EMCSBiome a_Biome)
if (allowedMobsSize > 0)
{
std::set<eMonsterType>::iterator itr = allowedMobs.begin();
- int iRandom = m_Random.NextInt((int)allowedMobsSize);
+ int iRandom = m_Random.NextInt(static_cast<int>(allowedMobsSize));
for (int i = 0; i < iRandom; i++)
{
diff --git a/src/Mobs/AggressiveMonster.cpp b/src/Mobs/AggressiveMonster.cpp
index d0fb79f6d..7fde1e56b 100644
--- a/src/Mobs/AggressiveMonster.cpp
+++ b/src/Mobs/AggressiveMonster.cpp
@@ -30,13 +30,12 @@ void cAggressiveMonster::InStateChasing(std::chrono::milliseconds a_Dt)
{
if (m_Target->IsPlayer())
{
- if (((cPlayer *)m_Target)->IsGameModeCreative())
+ if (static_cast<cPlayer *>(m_Target)->IsGameModeCreative())
{
m_EMState = IDLE;
return;
}
}
-
MoveToPosition(m_Target->GetPosition());
}
}
@@ -47,7 +46,7 @@ void cAggressiveMonster::InStateChasing(std::chrono::milliseconds a_Dt)
void cAggressiveMonster::EventSeePlayer(cEntity * a_Entity)
{
- if (!((cPlayer *)a_Entity)->IsGameModeCreative())
+ if (!static_cast<cPlayer *>(a_Entity)->IsGameModeCreative())
{
super::EventSeePlayer(a_Entity);
m_EMState = CHASING;
@@ -77,11 +76,14 @@ void cAggressiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
}
cTracer LineOfSight(GetWorld());
- Vector3d AttackDirection(m_Target->GetPosition() - GetPosition());
+ Vector3d MyHeadPosition = GetPosition() + Vector3d(0, GetHeight(), 0);
+ Vector3d AttackDirection(m_Target->GetPosition() + Vector3d(0, m_Target->GetHeight(), 0) - MyHeadPosition);
+
- if (ReachedFinalDestination() && !LineOfSight.Trace(GetPosition(), AttackDirection, (int)AttackDirection.Length()))
+ if (TargetIsInRange() && !LineOfSight.Trace(MyHeadPosition, AttackDirection, static_cast<int>(AttackDirection.Length())))
{
// Attack if reached destination, target isn't null, and have a clear line of sight to target (so won't attack through walls)
+ StopMovingToPosition();
Attack(a_Dt);
}
}
@@ -109,12 +111,12 @@ void cAggressiveMonster::Attack(std::chrono::milliseconds a_Dt)
bool cAggressiveMonster::IsMovingToTargetPosition()
{
// Difference between destination x and target x is negligible (to 10^-12 precision)
- if (fabsf((float)m_FinalDestination.x - (float)m_Target->GetPosX()) < std::numeric_limits<float>::epsilon())
+ if (fabsf(static_cast<float>(m_FinalDestination.x) - static_cast<float>(m_Target->GetPosX())) < std::numeric_limits<float>::epsilon())
{
return false;
}
// Difference between destination z and target z is negligible (to 10^-12 precision)
- else if (fabsf((float)m_FinalDestination.z - (float)m_Target->GetPosZ()) > std::numeric_limits<float>::epsilon())
+ else if (fabsf(static_cast<float>(m_FinalDestination.z) - static_cast<float>(m_Target->GetPosZ())) > std::numeric_limits<float>::epsilon())
{
return false;
}
diff --git a/src/Mobs/Blaze.cpp b/src/Mobs/Blaze.cpp
index d4ad24166..731da6b18 100644
--- a/src/Mobs/Blaze.cpp
+++ b/src/Mobs/Blaze.cpp
@@ -23,7 +23,7 @@ void cBlaze::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
if ((a_Killer != nullptr) && (a_Killer->IsPlayer() || a_Killer->IsA("cWolf")))
{
- int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
+ unsigned int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_BLAZE_ROD);
}
}
diff --git a/src/Mobs/CMakeLists.txt b/src/Mobs/CMakeLists.txt
index ffbcdf3ea..e99494508 100644
--- a/src/Mobs/CMakeLists.txt
+++ b/src/Mobs/CMakeLists.txt
@@ -80,6 +80,12 @@ SET (HDRS
Zombie.h
ZombiePigman.h)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(Monster.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=conversion -Wno-error=switch -Wno-error=switch-enum -Wno-error=float-equal -Wno-error=old-style-cast")
+ set_source_files_properties(SnowGolem.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(Villager.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+endif()
+
if(NOT MSVC)
add_library(Mobs ${SRCS} ${HDRS})
endif()
diff --git a/src/Mobs/CaveSpider.cpp b/src/Mobs/CaveSpider.cpp
index fa530db82..a8b40f52e 100644
--- a/src/Mobs/CaveSpider.cpp
+++ b/src/Mobs/CaveSpider.cpp
@@ -34,7 +34,7 @@ void cCaveSpider::Attack(std::chrono::milliseconds a_Dt)
if (m_Target->IsPawn())
{
// TODO: Easy = no poison, Medium = 7 seconds, Hard = 15 seconds
- ((cPawn *) m_Target)->AddEntityEffect(cEntityEffect::effPoison, 7 * 20, 0);
+ static_cast<cPawn *>(m_Target)->AddEntityEffect(cEntityEffect::effPoison, 7 * 20, 0);
}
}
@@ -44,7 +44,7 @@ void cCaveSpider::Attack(std::chrono::milliseconds a_Dt)
void cCaveSpider::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Chicken.cpp b/src/Mobs/Chicken.cpp
index b2b21d4ae..a52d1a2da 100644
--- a/src/Mobs/Chicken.cpp
+++ b/src/Mobs/Chicken.cpp
@@ -48,7 +48,7 @@ void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
void cChicken::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Cow.cpp b/src/Mobs/Cow.cpp
index 7dc6f3f37..a45010201 100644
--- a/src/Mobs/Cow.cpp
+++ b/src/Mobs/Cow.cpp
@@ -21,7 +21,7 @@ cCow::cCow(void) :
void cCow::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Creeper.cpp b/src/Mobs/Creeper.cpp
index 41796402f..30bd41f13 100644
--- a/src/Mobs/Creeper.cpp
+++ b/src/Mobs/Creeper.cpp
@@ -27,7 +27,7 @@ void cCreeper::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
- if (!ReachedFinalDestination() && !m_BurnedWithFlintAndSteel)
+ if (!TargetIsInRange() && !m_BurnedWithFlintAndSteel)
{
m_ExplodingTimer = 0;
m_bIsBlowing = false;
@@ -60,7 +60,7 @@ void cCreeper::GetDrops(cItems & a_Drops, cEntity * a_Killer)
return;
}
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
@@ -124,7 +124,7 @@ void cCreeper::Attack(std::chrono::milliseconds a_Dt)
if (!m_bIsBlowing)
{
- m_World->BroadcastSoundEffect("game.tnt.primed", GetPosX(), GetPosY(), GetPosZ(), 1.f, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64));
+ m_World->BroadcastSoundEffect("game.tnt.primed", GetPosX(), GetPosY(), GetPosZ(), 1.f, (0.75f + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64));
m_bIsBlowing = true;
m_World->BroadcastEntityMetadata(*this);
}
@@ -142,7 +142,7 @@ void cCreeper::OnRightClicked(cPlayer & a_Player)
{
a_Player.UseEquippedItem();
}
- m_World->BroadcastSoundEffect("game.tnt.primed", GetPosX(), GetPosY(), GetPosZ(), 1.f, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64));
+ m_World->BroadcastSoundEffect("game.tnt.primed", GetPosX(), GetPosY(), GetPosZ(), 1.f, (0.75f + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64));
m_bIsBlowing = true;
m_World->BroadcastEntityMetadata(*this);
m_BurnedWithFlintAndSteel = true;
diff --git a/src/Mobs/Enderman.cpp b/src/Mobs/Enderman.cpp
index 42c33884a..30bf82067 100644
--- a/src/Mobs/Enderman.cpp
+++ b/src/Mobs/Enderman.cpp
@@ -55,7 +55,7 @@ public:
}
cTracer LineOfSight(a_Player->GetWorld());
- if (LineOfSight.Trace(m_EndermanPos, Direction, (int)Direction.Length()))
+ if (LineOfSight.Trace(m_EndermanPos, Direction, static_cast<int>(Direction.Length())))
{
// No direct line of sight
return false;
@@ -91,7 +91,7 @@ cEnderman::cEnderman(void) :
void cEnderman::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Ghast.cpp b/src/Mobs/Ghast.cpp
index d17047ab7..15bbe484b 100644
--- a/src/Mobs/Ghast.cpp
+++ b/src/Mobs/Ghast.cpp
@@ -19,7 +19,7 @@ cGhast::cGhast(void) :
void cGhast::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Guardian.cpp b/src/Mobs/Guardian.cpp
index 5eb30785b..1429e2b13 100644
--- a/src/Mobs/Guardian.cpp
+++ b/src/Mobs/Guardian.cpp
@@ -21,7 +21,7 @@ cGuardian::cGuardian(void) :
void cGuardian::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
// Drops 0-3 Ink Sacs
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
@@ -37,19 +37,20 @@ void cGuardian::GetDrops(cItems & a_Drops, cEntity * a_Killer)
void cGuardian::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ m_IsFollowingPath = false; // Disable Pathfinding until it's fixed. TODO
+
// We must first process current location, and only then tick, otherwise we risk processing a location in a chunk
// that is not where the entity currently resides (FS #411)
-
Vector3d Pos = GetPosition();
// TODO: Not a real behavior, but cool :D
- int RelY = (int)floor(Pos.y);
+ int RelY = FloorC(Pos.y);
if ((RelY < 0) || (RelY >= cChunkDef::Height))
{
return;
}
- int RelX = (int)floor(Pos.x) - a_Chunk.GetPosX() * cChunkDef::Width;
- int RelZ = (int)floor(Pos.z) - a_Chunk.GetPosZ() * cChunkDef::Width;
+ int RelX = FloorC(Pos.x) - a_Chunk.GetPosX() * cChunkDef::Width;
+ int RelZ = FloorC(Pos.z) - a_Chunk.GetPosZ() * cChunkDef::Width;
BLOCKTYPE BlockType;
if (a_Chunk.UnboundedRelGetBlockType(RelX, RelY, RelZ, BlockType) && !IsBlockWater(BlockType) && !IsOnFire())
{
diff --git a/src/Mobs/Horse.cpp b/src/Mobs/Horse.cpp
index 5b4c78bfc..ce3bd65eb 100644
--- a/src/Mobs/Horse.cpp
+++ b/src/Mobs/Horse.cpp
@@ -55,10 +55,10 @@ void cHorse::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
if (m_World->GetTickRandomNumber(50) == 25)
{
- m_World->BroadcastSoundParticleEffect(2000, (int)GetPosX(), (int)GetPosY(), (int)GetPosZ(), 0);
- m_World->BroadcastSoundParticleEffect(2000, (int)GetPosX(), (int)GetPosY(), (int)GetPosZ(), 2);
- m_World->BroadcastSoundParticleEffect(2000, (int)GetPosX(), (int)GetPosY(), (int)GetPosZ(), 6);
- m_World->BroadcastSoundParticleEffect(2000, (int)GetPosX(), (int)GetPosY(), (int)GetPosZ(), 8);
+ m_World->BroadcastSoundParticleEffect(2000, FloorC(GetPosX()), FloorC(GetPosY()), FloorC(GetPosZ()), 0);
+ m_World->BroadcastSoundParticleEffect(2000, FloorC(GetPosX()), FloorC(GetPosY()), FloorC(GetPosZ()), 2);
+ m_World->BroadcastSoundParticleEffect(2000, FloorC(GetPosX()), FloorC(GetPosY()), FloorC(GetPosZ()), 6);
+ m_World->BroadcastSoundParticleEffect(2000, FloorC(GetPosX()), FloorC(GetPosY()), FloorC(GetPosZ()), 8);
m_Attachee->Detach();
m_bIsRearing = true;
@@ -140,7 +140,7 @@ void cHorse::OnRightClicked(cPlayer & a_Player)
void cHorse::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Horse.h b/src/Mobs/Horse.h
index be283705e..27168ebae 100644
--- a/src/Mobs/Horse.h
+++ b/src/Mobs/Horse.h
@@ -26,7 +26,7 @@ public:
bool IsEating (void) const {return m_bIsEating; }
bool IsRearing (void) const {return m_bIsRearing; }
bool IsMthOpen (void) const {return m_bIsMouthOpen; }
- bool IsTame (void) const {return m_bIsTame; }
+ bool IsTame (void) const override {return m_bIsTame; }
int GetHorseType (void) const {return m_Type; }
int GetHorseColor (void) const {return m_Color; }
int GetHorseStyle (void) const {return m_Style; }
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index f3f8c6b24..4befe307d 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -89,7 +89,7 @@ cMonster::cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const A
, m_SoundDeath(a_SoundDeath)
, m_AttackRate(3)
, m_AttackDamage(1)
- , m_AttackRange(2)
+ , m_AttackRange(1)
, m_AttackInterval(0)
, m_SightDistance(25)
, m_DropChanceWeapon(0.085f)
@@ -101,6 +101,7 @@ cMonster::cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const A
, m_TicksSinceLastDamaged(100)
, m_BurnsInDaylight(false)
, m_RelativeWalkSpeed(1)
+ , m_Age(1)
{
if (!a_ConfigName.empty())
{
@@ -147,10 +148,15 @@ bool cMonster::TickPathFinding(cChunk & a_Chunk)
(Recalculate lots when close, calculate rarely when far) */
if (
((GetPosition() - m_PathFinderDestination).Length() < 0.25) ||
- ((m_TicksSinceLastPathReset > 10) && (m_TicksSinceLastPathReset > (0.15 * (m_FinalDestination - GetPosition()).SqrLength())))
+ ((m_TicksSinceLastPathReset > 10) && (m_TicksSinceLastPathReset > (0.4 * (m_FinalDestination - GetPosition()).SqrLength())))
)
{
- ResetPathFinding();
+ /* Re-calculating is expensive when there's no path to target, and it results in mobs freezing very often as a result of always recalculating.
+ This is a workaround till we get better path recalculation. */
+ if (!m_NoPathToTarget)
+ {
+ ResetPathFinding();
+ }
}
}
@@ -161,15 +167,25 @@ bool cMonster::TickPathFinding(cChunk & a_Chunk)
StopMovingToPosition(); // Invalid chunks, probably world is loading or something, cancel movement.
return false;
}
+ m_NoPathToTarget = false;
+ m_NoMoreWayPoints = false;
m_PathFinderDestination = m_FinalDestination;
- m_Path = new cPath(a_Chunk, GetPosition().Floor(), m_PathFinderDestination.Floor(), 20);
+ m_Path = new cPath(a_Chunk, GetPosition(), m_PathFinderDestination, 20, GetWidth(), GetHeight());
}
switch (m_Path->Step(a_Chunk))
{
+ case ePathFinderStatus::NEARBY_FOUND:
+ {
+ m_NoPathToTarget = true;
+ m_PathFinderDestination = m_Path->AcceptNearbyPath();
+ break;
+ }
+
case ePathFinderStatus::PATH_NOT_FOUND:
{
- StopMovingToPosition(); // Give up pathfinding to that destination.
+ StopMovingToPosition(); // Try to calculate a path again.
+ // Note that the next time may succeed, e.g. if a player breaks a barrier.
break;
}
case ePathFinderStatus::CALCULATING:
@@ -179,15 +195,30 @@ bool cMonster::TickPathFinding(cChunk & a_Chunk)
}
case ePathFinderStatus::PATH_FOUND:
{
- if (--m_GiveUpCounter == 0)
+ if (m_NoMoreWayPoints || (--m_GiveUpCounter == 0))
{
- ResetPathFinding(); // Try to calculate a path again.
+ if (m_EMState == ATTACKING)
+ {
+ ResetPathFinding(); // Try to calculate a path again.
+ // This results in mobs hanging around an unreachable target (player).
+ }
+ else
+ {
+ StopMovingToPosition(); // Find a different place to go to.
+ }
return false;
}
- else if (!m_Path->IsLastPoint() && (m_Path->IsFirstPoint() || ReachedNextWaypoint())) // Have we arrived at the next cell, as denoted by m_NextWayPointPosition?
+ else if (!m_Path->IsLastPoint()) // Have we arrived at the next cell, as denoted by m_NextWayPointPosition?
+ {
+ if ((m_Path->IsFirstPoint() || ReachedNextWaypoint()))
+ {
+ m_NextWayPointPosition = m_Path->GetNextPoint();
+ m_GiveUpCounter = 40; // Give up after 40 ticks (2 seconds) if failed to reach m_NextWayPointPosition.
+ }
+ }
+ else
{
- m_NextWayPointPosition = Vector3d(0.5, 0, 0.5) + m_Path->GetNextPoint();
- m_GiveUpCounter = 40; // Give up after 40 ticks (2 seconds) if failed to reach m_NextWayPointPosition.
+ m_NoMoreWayPoints = true;
}
return true;
}
@@ -269,21 +300,59 @@ bool cMonster::EnsureProperDestination(cChunk & a_Chunk)
{
return false;
}
-
+
int RelX = FloorC(m_FinalDestination.x) - Chunk->GetPosX() * cChunkDef::Width;
int RelZ = FloorC(m_FinalDestination.z) - Chunk->GetPosZ() * cChunkDef::Width;
- // If destination in the air, go down to the lowest air block.
- while (m_FinalDestination.y > 0)
+ // If destination in the air, first try to go 1 block north, or east, or west.
+ // This fixes the player leaning issue.
+ // If that failed, we instead go down to the lowest air block.
+ Chunk->GetBlockTypeMeta(RelX, FloorC(m_FinalDestination.y) - 1, RelZ, BlockType, BlockMeta);
+ if (!cBlockInfo::IsSolid(BlockType))
{
- Chunk->GetBlockTypeMeta(RelX, FloorC(m_FinalDestination.y) - 1, RelZ, BlockType, BlockMeta);
- if (cBlockInfo::IsSolid(BlockType))
+ bool InTheAir = true;
+ int x, z;
+ for (z = -1; z <= 1; ++z)
{
- break;
+ for (x = -1; x <= 1; ++x)
+ {
+ if ((x==0) && (z==0))
+ {
+ continue;
+ }
+ Chunk = a_Chunk.GetNeighborChunk(FloorC(m_FinalDestination.x+x), FloorC(m_FinalDestination.z+z));
+ if ((Chunk == nullptr) || !Chunk->IsValid())
+ {
+ return false;
+ }
+ RelX = FloorC(m_FinalDestination.x+x) - Chunk->GetPosX() * cChunkDef::Width;
+ RelZ = FloorC(m_FinalDestination.z+z) - Chunk->GetPosZ() * cChunkDef::Width;
+ Chunk->GetBlockTypeMeta(RelX, FloorC(m_FinalDestination.y) - 1, RelZ, BlockType, BlockMeta);
+ if (cBlockInfo::IsSolid(BlockType))
+ {
+ m_FinalDestination.x += x;
+ m_FinalDestination.z += z;
+ InTheAir = false;
+ goto breakBothLoops;
+ }
+ }
}
- m_FinalDestination.y -= 1;
- }
+ breakBothLoops:
+ // Go down to the lowest air block.
+ if (InTheAir)
+ {
+ while (m_FinalDestination.y > 0)
+ {
+ Chunk->GetBlockTypeMeta(RelX, FloorC(m_FinalDestination.y) - 1, RelZ, BlockType, BlockMeta);
+ if (cBlockInfo::IsSolid(BlockType))
+ {
+ break;
+ }
+ m_FinalDestination.y -= 1;
+ }
+ }
+ }
// If destination in water, go up to the highest water block.
// If destination in solid, go up to first air block.
@@ -331,6 +400,7 @@ void cMonster::MoveToPosition(const Vector3d & a_Position)
void cMonster::StopMovingToPosition()
{
m_IsFollowingPath = false;
+ ResetPathFinding();
}
@@ -447,21 +517,36 @@ void cMonster::SetPitchAndYawFromDestination()
}
}
- Vector3d Distance = FinalDestination - GetPosition();
+
+ Vector3d BodyDistance;
+ if (!m_IsFollowingPath && (m_Target != nullptr))
{
- double Rotation, Pitch;
- Distance.Normalize();
- VectorToEuler(Distance.x, Distance.y, Distance.z, Rotation, Pitch);
- SetHeadYaw(Rotation);
- SetPitch(-Pitch);
+ BodyDistance = m_Target->GetPosition() - GetPosition();
}
+ else
+ {
+ BodyDistance = m_NextWayPointPosition - GetPosition();
+ }
+ double BodyRotation, BodyPitch;
+ BodyDistance.Normalize();
+ VectorToEuler(BodyDistance.x, BodyDistance.y, BodyDistance.z, BodyRotation, BodyPitch);
+ SetYaw(BodyRotation);
+ Vector3d Distance = FinalDestination - GetPosition();
{
- Vector3d BodyDistance = m_NextWayPointPosition - GetPosition();
- double Rotation, Pitch;
- BodyDistance.Normalize();
- VectorToEuler(BodyDistance.x, BodyDistance.y, BodyDistance.z, Rotation, Pitch);
- SetYaw(Rotation);
+ double HeadRotation, HeadPitch;
+ Distance.Normalize();
+ VectorToEuler(Distance.x, Distance.y, Distance.z, HeadRotation, HeadPitch);
+ if (std::abs(BodyRotation - HeadRotation) < 90)
+ {
+ SetHeadYaw(HeadRotation);
+ SetPitch(-HeadPitch);
+ }
+ else // We're not an owl. If it's more than 120, don't look behind and instead look at where you're walking.
+ {
+ SetHeadYaw(BodyRotation);
+ SetPitch(-BodyPitch);
+ }
}
}
@@ -989,9 +1074,9 @@ cMonster * cMonster::NewMonsterFromType(eMonsterType a_MobType)
case mtHorse:
{
// Horses take a type (species), a colour, and a style (dots, stripes, etc.)
- int HorseType = Random.NextInt(7);
- int HorseColor = Random.NextInt(6);
- int HorseStyle = Random.NextInt(6);
+ int HorseType = Random.NextInt(8);
+ int HorseColor = Random.NextInt(7);
+ int HorseStyle = Random.NextInt(5);
int HorseTameTimes = Random.NextInt(6) + 1;
if ((HorseType == 5) || (HorseType == 6) || (HorseType == 7))
@@ -1070,10 +1155,10 @@ void cMonster::AddRandomUncommonDropItem(cItems & a_Drops, float a_Chance, short
-void cMonster::AddRandomRareDropItem(cItems & a_Drops, cItems & a_Items, short a_LootingLevel)
+void cMonster::AddRandomRareDropItem(cItems & a_Drops, cItems & a_Items, unsigned int a_LootingLevel)
{
MTRand r1;
- int Count = r1.randInt() % 200;
+ unsigned int Count = r1.randInt() % 200;
if (Count < (5 + a_LootingLevel))
{
int Rare = r1.randInt() % a_Items.Size();
@@ -1085,7 +1170,7 @@ void cMonster::AddRandomRareDropItem(cItems & a_Drops, cItems & a_Items, short a
-void cMonster::AddRandomArmorDropItem(cItems & a_Drops, short a_LootingLevel)
+void cMonster::AddRandomArmorDropItem(cItems & a_Drops, unsigned int a_LootingLevel)
{
MTRand r1;
if (r1.randInt() % 200 < ((m_DropChanceHelmet * 200) + (a_LootingLevel * 2)))
@@ -1125,7 +1210,7 @@ void cMonster::AddRandomArmorDropItem(cItems & a_Drops, short a_LootingLevel)
-void cMonster::AddRandomWeaponDropItem(cItems & a_Drops, short a_LootingLevel)
+void cMonster::AddRandomWeaponDropItem(cItems & a_Drops, unsigned int a_LootingLevel)
{
MTRand r1;
if (r1.randInt() % 200 < ((m_DropChanceWeapon * 200) + (a_LootingLevel * 2)))
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index 5d20ba810..2832a1570 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -112,10 +112,14 @@ public:
void SetRelativeWalkSpeed(double a_WalkSpeed) { m_RelativeWalkSpeed = a_WalkSpeed; } // tolua_export
// Overridables to handle ageable mobs
- virtual bool IsBaby (void) const { return false; }
virtual bool IsTame (void) const { return false; }
virtual bool IsSitting (void) const { return false; }
+ bool IsBaby (void) const { return m_Age < 0; }
+ char GetAge (void) const { return m_Age; }
+ void SetAge(char a_Age) { m_Age = a_Age; }
+
+
// tolua_begin
/** Returns true if the monster has a custom name. */
@@ -180,19 +184,29 @@ protected:
/** Coordinates for the ultimate, final destination last given to the pathfinder. */
Vector3d m_PathFinderDestination;
+ /** True if there's no path to target and we're walking to an approximated location. */
+ bool m_NoPathToTarget;
+
+ /** Whether The mob has finished their path, note that this does not imply reaching the destination,
+ the destination may sometimes differ from the current path. */
+ bool m_NoMoreWayPoints;
+
/** Finds the lowest non-air block position (not the highest, as cWorld::GetHeight does)
If current Y is nonsolid, goes down to try to find a solid block, then returns that + 1
If current Y is solid, goes up to find first nonsolid block, and returns that.
If no suitable position is found, returns cChunkDef::Height. */
int FindFirstNonAirBlockPosition(double a_PosX, double a_PosZ);
- /** Returns if the ultimate, final destination has been reached */
- bool ReachedFinalDestination(void) { return ((m_FinalDestination - GetPosition()).SqrLength() < (m_AttackRange * m_AttackRange)); }
+ /** Returns if the ultimate, final destination has been reached. */
+ bool ReachedFinalDestination(void) { return ((m_FinalDestination - GetPosition()).Length() < GetWidth()/2); }
+
+ /** Returns whether or not the target is close enough for attack. */
+ bool TargetIsInRange(void) { return ((m_FinalDestination - GetPosition()).SqrLength() < (m_AttackRange * m_AttackRange)); }
/** Returns if the intermediate waypoint of m_NextWayPointPosition has been reached */
bool ReachedNextWaypoint(void) { return ((m_NextWayPointPosition - GetPosition()).SqrLength() < 0.25); }
- /** Returns if a monster can reach a given height by jumping */
+ /** Returns if a monster can reach a given height by jumping. */
inline bool DoesPosYRequireJump(int a_PosY)
{
return ((a_PosY > POSY_TOINT) && (a_PosY == POSY_TOINT + 1));
@@ -260,6 +274,8 @@ protected:
bool m_BurnsInDaylight;
double m_RelativeWalkSpeed;
+ char m_Age;
+
/** Adds a random number of a_Item between a_Min and a_Max to itemdrops a_Drops*/
void AddRandomDropItem(cItems & a_Drops, unsigned int a_Min, unsigned int a_Max, short a_Item, short a_ItemHealth = 0);
@@ -267,13 +283,13 @@ protected:
void AddRandomUncommonDropItem(cItems & a_Drops, float a_Chance, short a_Item, short a_ItemHealth = 0);
/** Adds one rare item out of the list of rare items a_Items modified by the looting level a_LootingLevel(I-III or custom) to the itemdrop a_Drops*/
- void AddRandomRareDropItem(cItems & a_Drops, cItems & a_Items, short a_LootingLevel);
+ void AddRandomRareDropItem(cItems & a_Drops, cItems & a_Items, unsigned int a_LootingLevel);
/** Adds armor that is equipped with the chance saved in m_DropChance[...] (this will be greter than 1 if piccked up or 0.085 + (0.01 per LootingLevel) if born with) to the drop*/
- void AddRandomArmorDropItem(cItems & a_Drops, short a_LootingLevel);
+ void AddRandomArmorDropItem(cItems & a_Drops, unsigned int a_LootingLevel);
/** Adds weapon that is equipped with the chance saved in m_DropChance[...] (this will be greter than 1 if piccked up or 0.085 + (0.01 per LootingLevel) if born with) to the drop*/
- void AddRandomWeaponDropItem(cItems & a_Drops, short a_LootingLevel);
+ void AddRandomWeaponDropItem(cItems & a_Drops, unsigned int a_LootingLevel);
} ; // tolua_export
diff --git a/src/Mobs/Mooshroom.cpp b/src/Mobs/Mooshroom.cpp
index ec533cfca..3b2fbad57 100644
--- a/src/Mobs/Mooshroom.cpp
+++ b/src/Mobs/Mooshroom.cpp
@@ -24,7 +24,7 @@ cMooshroom::cMooshroom(void) :
void cMooshroom::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/PassiveAggressiveMonster.cpp b/src/Mobs/PassiveAggressiveMonster.cpp
index cb8650cb9..f5577f71f 100644
--- a/src/Mobs/PassiveAggressiveMonster.cpp
+++ b/src/Mobs/PassiveAggressiveMonster.cpp
@@ -28,7 +28,7 @@ bool cPassiveAggressiveMonster::DoTakeDamage(TakeDamageInfo & a_TDI)
if ((m_Target != nullptr) && (m_Target->IsPlayer()))
{
- if (!((cPlayer *)m_Target)->IsGameModeCreative())
+ if (!static_cast<cPlayer *>(m_Target)->IsGameModeCreative())
{
m_EMState = CHASING;
}
diff --git a/src/Mobs/PassiveMonster.cpp b/src/Mobs/PassiveMonster.cpp
index 012ca9949..c220a7128 100644
--- a/src/Mobs/PassiveMonster.cpp
+++ b/src/Mobs/PassiveMonster.cpp
@@ -48,7 +48,7 @@ void cPassiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
return;
}
- cPlayer * a_Closest_Player = m_World->FindClosestPlayer(GetPosition(), (float)m_SightDistance);
+ cPlayer * a_Closest_Player = m_World->FindClosestPlayer(GetPosition(), static_cast<float>(m_SightDistance));
if (a_Closest_Player != nullptr)
{
if (a_Closest_Player->GetEquippedItem().IsEqual(FollowedItem))
diff --git a/src/Mobs/Path.cpp b/src/Mobs/Path.cpp
index dd306af13..e987381f7 100644
--- a/src/Mobs/Path.cpp
+++ b/src/Mobs/Path.cpp
@@ -6,20 +6,15 @@
#include "Path.h"
#include "../Chunk.h"
+#define JUMP_G_COST 20
+
#define DISTANCE_MANHATTAN 0 // 1: More speed, a bit less accuracy 0: Max accuracy, less speed.
#define HEURISTICS_ONLY 0 // 1: Much more speed, much less accurate.
-#define CALCULATIONS_PER_STEP 5 // Higher means more CPU load but faster path calculations.
+#define CALCULATIONS_PER_STEP 10 // Higher means more CPU load but faster path calculations.
// The only version which guarantees the shortest path is 0, 0.
-enum class eCellStatus {OPENLIST, CLOSEDLIST, NOLIST};
-struct cPathCell
-{
- Vector3i m_Location; // Location of the cell in the world.
- int m_F, m_G, m_H; // F, G, H as defined in regular A*.
- eCellStatus m_Status; // Which list is the cell in? Either non, open, or closed.
- cPathCell * m_Parent; // Cell's parent, as defined in regular A*.
- bool m_IsSolid; // Is the cell an air or a solid? Partial solids are currently considered solids.
-};
+
+
@@ -37,24 +32,40 @@ bool compareHeuristics::operator()(cPathCell * & a_Cell1, cPathCell * & a_Cell2)
/* cPath implementation */
cPath::cPath(
cChunk & a_Chunk,
- const Vector3i & a_StartingPoint, const Vector3i & a_EndingPoint, int a_MaxSteps,
+ const Vector3d & a_StartingPoint, const Vector3d & a_EndingPoint, int a_MaxSteps,
double a_BoundingBoxWidth, double a_BoundingBoxHeight,
int a_MaxUp, int a_MaxDown
) :
- m_Destination(a_EndingPoint.Floor()),
- m_Source(a_StartingPoint.Floor()),
+
m_CurrentPoint(0), // GetNextPoint increments this to 1, but that's fine, since the first cell is always a_StartingPoint
- m_Chunk(&a_Chunk)
+ m_Chunk(&a_Chunk),
+ m_BadChunkFound(false)
{
// TODO: if src not walkable OR dest not walkable, then abort.
// Borrow a new "isWalkable" from ProcessIfWalkable, make ProcessIfWalkable also call isWalkable
+ a_BoundingBoxWidth = 1; // Until we improve physics, if ever.
+
+ m_BoundingBoxWidth = CeilC(a_BoundingBoxWidth);
+ m_BoundingBoxHeight = CeilC(a_BoundingBoxHeight);
+ m_HalfWidth = a_BoundingBoxWidth / 2;
+
+ int HalfWidthInt = FloorC(a_BoundingBoxWidth / 2);
+ m_Source.x = FloorC(a_StartingPoint.x - HalfWidthInt);
+ m_Source.y = FloorC(a_StartingPoint.y);
+ m_Source.z = FloorC(a_StartingPoint.z - HalfWidthInt);
+
+ m_Destination.x = FloorC(a_EndingPoint.x - HalfWidthInt);
+ m_Destination.y = FloorC(a_EndingPoint.y);
+ m_Destination.z = FloorC(a_EndingPoint.z - HalfWidthInt);
+
if (GetCell(m_Source)->m_IsSolid || GetCell(m_Destination)->m_IsSolid)
{
m_Status = ePathFinderStatus::PATH_NOT_FOUND;
return;
}
+ m_NearestPointToTarget = GetCell(m_Source);
m_Status = ePathFinderStatus::CALCULATING;
m_StepsLeft = a_MaxSteps;
@@ -81,15 +92,20 @@ cPath::~cPath()
ePathFinderStatus cPath::Step(cChunk & a_Chunk)
{
m_Chunk = &a_Chunk;
-
if (m_Status != ePathFinderStatus::CALCULATING)
{
return m_Status;
}
- if (m_StepsLeft == 0)
+ if (m_BadChunkFound)
{
FinishCalculation(ePathFinderStatus::PATH_NOT_FOUND);
+ return m_Status;
+ }
+
+ if (m_StepsLeft == 0)
+ {
+ AttemptToFindAlternative();
}
else
{
@@ -102,9 +118,9 @@ ePathFinderStatus cPath::Step(cChunk & a_Chunk)
break; // if we're here, m_Status must have changed either to PATH_FOUND or PATH_NOT_FOUND.
}
}
- }
- m_Chunk = nullptr;
+ m_Chunk = nullptr;
+ }
return m_Status;
}
@@ -112,6 +128,17 @@ ePathFinderStatus cPath::Step(cChunk & a_Chunk)
+Vector3i cPath::AcceptNearbyPath()
+{
+ ASSERT(m_Status == ePathFinderStatus::NEARBY_FOUND);
+ m_Status = ePathFinderStatus::PATH_FOUND;
+ return m_Destination;
+}
+
+
+
+
+
bool cPath::IsSolid(const Vector3i & a_Location)
{
ASSERT(m_Chunk != nullptr);
@@ -119,6 +146,7 @@ bool cPath::IsSolid(const Vector3i & a_Location)
auto Chunk = m_Chunk->GetNeighborChunk(a_Location.x, a_Location.z);
if ((Chunk == nullptr) || !Chunk->IsValid())
{
+ m_BadChunkFound = true;
return true;
}
m_Chunk = Chunk;
@@ -129,13 +157,19 @@ bool cPath::IsSolid(const Vector3i & a_Location)
int RelZ = a_Location.z - m_Chunk->GetPosZ() * cChunkDef::Width;
m_Chunk->GetBlockTypeMeta(RelX, a_Location.y, RelZ, BlockType, BlockMeta);
- if ((BlockType == E_BLOCK_FENCE) || (BlockType == E_BLOCK_FENCE_GATE))
+ if (
+ (BlockType == E_BLOCK_FENCE) ||
+ (BlockType == E_BLOCK_FENCE_GATE) ||
+ (BlockType == E_BLOCK_NETHER_BRICK_FENCE) ||
+ ((BlockType >= E_BLOCK_SPRUCE_FENCE_GATE) && (BlockType <= E_BLOCK_ACACIA_FENCE))
+ )
{
+ // TODO move this out of IsSolid to a proper place.
GetCell(a_Location + Vector3i(0, 1, 0))->m_IsSolid = true; // Mobs will always think that the fence is 2 blocks high and therefore won't jump over.
}
if (BlockType == E_BLOCK_STATIONARY_WATER)
{
- GetCell(a_Location + Vector3i(0, -1, 0))->m_IsSolid = true; // Mobs will always think that the fence is 2 blocks high and therefore won't jump over.
+ GetCell(a_Location + Vector3i(0, -1, 0))->m_IsSolid = true;
}
return cBlockInfo::IsSolid(BlockType);
@@ -149,50 +183,81 @@ bool cPath::Step_Internal()
{
cPathCell * CurrentCell = OpenListPop();
- // Path not reachable, open list exauhsted.
+ // Path not reachable.
if (CurrentCell == nullptr)
{
- FinishCalculation(ePathFinderStatus::PATH_NOT_FOUND);
- ASSERT(m_Status == ePathFinderStatus::PATH_NOT_FOUND);
+ AttemptToFindAlternative();
return true;
}
// Path found.
- if (
- (CurrentCell->m_Location == m_Destination + Vector3i(0, 0, 1)) ||
- (CurrentCell->m_Location == m_Destination + Vector3i(1, 0, 0)) ||
- (CurrentCell->m_Location == m_Destination + Vector3i(-1, 0, 0)) ||
- (CurrentCell->m_Location == m_Destination + Vector3i(0, 0, -1)) ||
- (CurrentCell->m_Location == m_Destination + Vector3i(0, -1, 0))
- )
+ if (CurrentCell->m_Location == m_Destination)
{
- do
- {
- m_PathPoints.push_back(CurrentCell->m_Location); // Populate the cPath with points.
- CurrentCell = CurrentCell->m_Parent;
- } while (CurrentCell != nullptr);
-
+ BuildPath();
FinishCalculation(ePathFinderStatus::PATH_FOUND);
return true;
}
- // Calculation not finished yet, process a currentCell by inspecting all neighbors.
+ // Calculation not finished yet.
+ // Check if we have a new NearestPoint.
+ // TODO I don't like this that much, there should be a smarter way.
+ if ((m_Destination - CurrentCell->m_Location).Length() < 5)
+ {
+ if (m_Rand.NextInt(4) == 0)
+ {
+ m_NearestPointToTarget = CurrentCell;
+ }
+ }
+ else if (CurrentCell->m_H < m_NearestPointToTarget->m_H)
+ {
+ m_NearestPointToTarget = CurrentCell;
+ }
+ // process a currentCell by inspecting all neighbors.
+
- // Check North, South, East, West on all 3 different heights.
- int i;
- for (i = -1; i <= 1; ++i)
+ // Check North, South, East, West on our height.
+ ProcessIfWalkable(CurrentCell->m_Location + Vector3i(1, 0, 0), CurrentCell, 10);
+ ProcessIfWalkable(CurrentCell->m_Location + Vector3i(-1, 0, 0), CurrentCell, 10);
+ ProcessIfWalkable(CurrentCell->m_Location + Vector3i(0, 0, 1), CurrentCell, 10);
+ ProcessIfWalkable(CurrentCell->m_Location + Vector3i(0, 0, -1), CurrentCell, 10);
+
+ // Check diagonals on XY plane.
+ // x = -1: west, x = 1: east.
+ for (int x = -1; x <= 1; x += 2)
{
- ProcessIfWalkable(CurrentCell->m_Location + Vector3i(1, i, 0), CurrentCell, 10);
- ProcessIfWalkable(CurrentCell->m_Location + Vector3i(-1, i, 0), CurrentCell, 10);
- ProcessIfWalkable(CurrentCell->m_Location + Vector3i(0, i, 1), CurrentCell, 10);
- ProcessIfWalkable(CurrentCell->m_Location + Vector3i(0, i, -1), CurrentCell, 10);
+ if (GetCell(CurrentCell->m_Location + Vector3i(x, 0, 0))->m_IsSolid) // If there's a solid our east / west.
+ {
+ if (!GetCell(CurrentCell->m_Location + Vector3i(0, 1, 0))->m_IsSolid) // If there isn't a solid above.
+ {
+ ProcessIfWalkable(CurrentCell->m_Location + Vector3i(x, 1, 0), CurrentCell, JUMP_G_COST); // Check east-up / west-up.
+ }
+ }
+ else
+ {
+ ProcessIfWalkable(CurrentCell->m_Location + Vector3i(x, -1, 0), CurrentCell, 14); // Else check east-down / west-down.
+ }
+ }
+
+ // Check diagonals on the YZ plane.
+ for (int z = -1; z <= 1; z += 2)
+ {
+ if (GetCell(CurrentCell->m_Location + Vector3i(0, 0, z))->m_IsSolid) // If there's a solid our north / south.
+ {
+ if (!GetCell(CurrentCell->m_Location + Vector3i(0, 1, 0))->m_IsSolid) // If there isn't a solid above.
+ {
+ ProcessIfWalkable(CurrentCell->m_Location + Vector3i(0, 1, z), CurrentCell, JUMP_G_COST); // Check north-up / south-up.
+ }
+ }
+ else
+ {
+ ProcessIfWalkable(CurrentCell->m_Location + Vector3i(0, -1, z), CurrentCell, 14); // Else check north-down / south-down.
+ }
}
- // Check diagonals on mob's height only.
- int x, z;
- for (x = -1; x <= 1; x += 2)
+ // Check diagonals on the XZ plane. (Normal diagonals, this plane is special because of gravity, etc)
+ for (int x = -1; x <= 1; x += 2)
{
- for (z = -1; z <= 1; z += 2)
+ for (int z = -1; z <= 1; z += 2)
{
// This condition prevents diagonal corner cutting.
if (!GetCell(CurrentCell->m_Location + Vector3i(x, 0, 0))->m_IsSolid && !GetCell(CurrentCell->m_Location + Vector3i(0, 0, z))->m_IsSolid)
@@ -213,6 +278,38 @@ bool cPath::Step_Internal()
+void cPath::AttemptToFindAlternative()
+{
+ if (m_NearestPointToTarget == GetCell(m_Source))
+ {
+ FinishCalculation(ePathFinderStatus::PATH_NOT_FOUND);
+ }
+ else
+ {
+ m_Destination = m_NearestPointToTarget->m_Location;
+ BuildPath();
+ FinishCalculation(ePathFinderStatus::NEARBY_FOUND);
+ }
+}
+
+
+
+
+
+void cPath::BuildPath()
+{
+ cPathCell * CurrentCell = GetCell(m_Destination);
+ do
+ {
+ m_PathPoints.push_back(CurrentCell->m_Location); // Populate the cPath with points.
+ CurrentCell = CurrentCell->m_Parent;
+ } while (CurrentCell != nullptr);
+}
+
+
+
+
+
void cPath::FinishCalculation()
{
m_Map.clear();
@@ -225,6 +322,10 @@ void cPath::FinishCalculation()
void cPath::FinishCalculation(ePathFinderStatus a_NewStatus)
{
+ if (m_BadChunkFound)
+ {
+ a_NewStatus = ePathFinderStatus::PATH_NOT_FOUND;
+ }
m_Status = a_NewStatus;
FinishCalculation();
}
@@ -250,7 +351,7 @@ cPathCell * cPath::OpenListPop() // Popping from the open list also means addin
{
if (m_OpenList.size() == 0)
{
- return nullptr; // We've exhausted the search space and nothing was found, this will trigger a PATH_NOT_FOUND status.
+ return nullptr; // We've exhausted the search space and nothing was found, this will trigger a PATH_NOT_FOUND or NEARBY_FOUND status.
}
cPathCell * Ret = m_OpenList.top();
@@ -269,7 +370,53 @@ si::setBlock((Ret)->m_Location.x, (Ret)->m_Location.y, (Ret)->m_Location.z, debu
void cPath::ProcessIfWalkable(const Vector3i & a_Location, cPathCell * a_Parent, int a_Cost)
{
cPathCell * cell = GetCell(a_Location);
- if (!cell->m_IsSolid && GetCell(a_Location + Vector3i(0, -1, 0))->m_IsSolid && !GetCell(a_Location + Vector3i(0, 1, 0))->m_IsSolid)
+ int x, y, z;
+
+ // Make sure we fit in the position.
+ for (y = 0; y < m_BoundingBoxHeight; ++y)
+ {
+ for (x = 0; x < m_BoundingBoxWidth; ++x)
+ {
+ for (z = 0; z < m_BoundingBoxWidth; ++z)
+ {
+ if (GetCell(a_Location + Vector3i(x, y, z))->m_IsSolid)
+ {
+ return;
+ }
+ }
+ }
+ }
+
+ /*y =-1;
+ for (x = 0; x < m_BoundingBoxWidth; ++x)
+ {
+ for (z = 0; z < m_BoundingBoxWidth; ++z)
+ {
+ if (!GetCell(a_Location + Vector3i(x, y, z))->m_IsSolid)
+ {
+ return;
+ }
+ }
+ }
+ ProcessCell(cell, a_Parent, a_Cost);*/
+
+ // Make sure there's at least 1 piece of solid below us.
+
+ bool GroundFlag = false;
+ y =-1;
+ for (x = 0; x < m_BoundingBoxWidth; ++x)
+ {
+ for (z = 0; z < m_BoundingBoxWidth; ++z)
+ {
+ if (GetCell(a_Location + Vector3i(x, y, z))->m_IsSolid)
+ {
+ GroundFlag = true;
+ break;
+ }
+ }
+ }
+
+ if (GroundFlag)
{
ProcessCell(cell, a_Parent, a_Cost);
}
@@ -338,23 +485,20 @@ void cPath::ProcessCell(cPathCell * a_Cell, cPathCell * a_Caller, int a_GDelta)
cPathCell * cPath::GetCell(const Vector3i & a_Location)
{
// Create the cell in the hash table if it's not already there.
- cPathCell * Cell;
if (m_Map.count(a_Location) == 0) // Case 1: Cell is not on any list. We've never checked this cell before.
{
- Cell = new cPathCell();
- Cell->m_Location = a_Location;
- m_Map[a_Location] = UniquePtr<cPathCell>(Cell);
- Cell->m_IsSolid = IsSolid(a_Location);
- Cell->m_Status = eCellStatus::NOLIST;
+ m_Map[a_Location].m_Location = a_Location;
+ m_Map[a_Location].m_IsSolid = IsSolid(a_Location);
+ m_Map[a_Location].m_Status = eCellStatus::NOLIST;
#ifdef COMPILING_PATHFIND_DEBUGGER
#ifdef COMPILING_PATHFIND_DEBUGGER_MARK_UNCHECKED
si::setBlock(a_Location.x, a_Location.y, a_Location.z, debug_unchecked, Cell->m_IsSolid ? NORMAL : MINI);
#endif
#endif
- return Cell;
+ return &m_Map[a_Location];
}
else
{
- return m_Map[a_Location].get();
+ return &m_Map[a_Location];
}
}
diff --git a/src/Mobs/Path.h b/src/Mobs/Path.h
index 008722d29..d4ad066e3 100644
--- a/src/Mobs/Path.h
+++ b/src/Mobs/Path.h
@@ -1,16 +1,13 @@
#pragma once
-/* Wanna use the pathfinder? Put this in your header file:
-
-// Fwd: cPath
+/*
+// Needed Fwds: cPath
enum class ePathFinderStatus;
class cPath;
-
-Put this in your .cpp:
-#include "...Path.h"
*/
+#include "../FastRandom.h"
#ifdef COMPILING_PATHFIND_DEBUGGER
/* Note: the COMPILING_PATHFIND_DEBUGGER flag is used by Native / WiseOldMan95 to debug
this class outside of MCServer. This preprocessor flag is never set when compiling MCServer. */
@@ -23,14 +20,31 @@ Put this in your .cpp:
class cChunk;
/* Various little structs and classes */
-enum class ePathFinderStatus {CALCULATING, PATH_FOUND, PATH_NOT_FOUND};
-struct cPathCell; // Defined inside Path.cpp
+enum class ePathFinderStatus {CALCULATING, PATH_FOUND, PATH_NOT_FOUND, NEARBY_FOUND};
+enum class eCellStatus {OPENLIST, CLOSEDLIST, NOLIST};
+struct cPathCell
+{
+ Vector3i m_Location; // Location of the cell in the world.
+ int m_F, m_G, m_H; // F, G, H as defined in regular A*.
+ eCellStatus m_Status; // Which list is the cell in? Either non, open, or closed.
+ cPathCell * m_Parent; // Cell's parent, as defined in regular A*.
+ bool m_IsSolid; // Is the cell an air or a solid? Partial solids are currently considered solids.
+};
+
+
+
+
+
class compareHeuristics
{
public:
bool operator()(cPathCell * & a_V1, cPathCell * & a_V2);
};
+
+
+
+
class cPath
{
public:
@@ -54,23 +68,32 @@ public:
@param a_MaxSteps The maximum steps before giving up. */
cPath(
cChunk & a_Chunk,
- const Vector3i & a_StartingPoint, const Vector3i & a_EndingPoint, int a_MaxSteps,
- double a_BoundingBoxWidth = 1, double a_BoundingBoxHeight = 2,
+ const Vector3d & a_StartingPoint, const Vector3d & a_EndingPoint, int a_MaxSteps,
+ double a_BoundingBoxWidth, double a_BoundingBoxHeight,
int a_MaxUp = 1, int a_MaxDown = 1
);
/** Destroys the path and frees its memory. */
~cPath();
- /** Performs part of the path calculation and returns true if the path computation has finished. */
+ /** Performs part of the path calculation and returns the appropriate status.
+ If NEARBY_FOUND is returned, it means that the destination is not reachable, but a nearby destination
+ is reachable. If the user likes the alternative destination, they can call AcceptNearbyPath to treat the path as found,
+ and to make consequent calls to step return PATH_FOUND*/
ePathFinderStatus Step(cChunk & a_Chunk);
+ /** Called after the PathFinder's step returns NEARBY_FOUND.
+ Changes the PathFinder status from NEARBY_FOUND to PATH_FOUND, returns the nearby destination that
+ the PathFinder found a path to. */
+ Vector3i AcceptNearbyPath();
+
/* Point retrieval functions, inlined for performance. */
/** Returns the next point in the path. */
- inline Vector3i GetNextPoint()
+ inline Vector3d GetNextPoint()
{
ASSERT(m_Status == ePathFinderStatus::PATH_FOUND);
- return m_PathPoints[m_PathPoints.size() - 1 - (++m_CurrentPoint)];
+ Vector3i Point = m_PathPoints[m_PathPoints.size() - 1 - (++m_CurrentPoint)];
+ return Vector3d(Point.x + m_HalfWidth, Point.y, Point.z + m_HalfWidth);
}
/** Checks whether this is the last point or not. Never call getnextPoint when this is true. */
inline bool IsLastPoint()
@@ -84,34 +107,23 @@ public:
return (m_CurrentPoint == 0);
}
/** Get the point at a_index. Remark: Internally, the indexes are reversed. */
- inline Vector3i GetPoint(size_t a_index)
+ inline Vector3d GetPoint(size_t a_index)
{
ASSERT(m_Status == ePathFinderStatus::PATH_FOUND);
ASSERT(a_index < m_PathPoints.size());
- return m_PathPoints[m_PathPoints.size() - 1 - a_index];
+ Vector3i Point = m_PathPoints[m_PathPoints.size() - 1 - a_index];
+ return Vector3d(Point.x + m_HalfWidth, Point.y, Point.z + m_HalfWidth);
}
/** Returns the total number of points this path has. */
- inline int GetPointCount()
+ inline size_t GetPointCount()
{
- ASSERT(m_Status == ePathFinderStatus::PATH_FOUND);
+ if (m_Status != ePathFinderStatus::PATH_FOUND)
+ {
+ return 0;
+ }
return m_PathPoints.size();
}
- struct VectorHasher
- {
- std::size_t operator()(const Vector3i & a_Vector) const
- {
- // Guaranteed to have no hash collisions for any 128x128x128 area. Suitable for pathfinding.
- int32_t t = 0;
- t += (int8_t)a_Vector.x;
- t = t << 8;
- t += (int8_t)a_Vector.y;
- t = t << 8;
- t += (int8_t)a_Vector.z;
- t = t << 8;
- return (size_t)t;
- }
- };
private:
/* General */
@@ -119,6 +131,8 @@ private:
bool Step_Internal(); // The public version just calls this version * CALCULATIONS_PER_CALL times.
void FinishCalculation(); // Clears the memory used for calculating the path.
void FinishCalculation(ePathFinderStatus a_NewStatus); // Clears the memory used for calculating the path and changes the status.
+ void AttemptToFindAlternative();
+ void BuildPath();
/* Openlist and closedlist management */
void OpenListAdd(cPathCell * a_Cell);
@@ -131,10 +145,15 @@ private:
/* Pathfinding fields */
std::priority_queue<cPathCell *, std::vector<cPathCell *>, compareHeuristics> m_OpenList;
- std::unordered_map<Vector3i, UniquePtr<cPathCell>, VectorHasher> m_Map;
+ std::unordered_map<Vector3i, cPathCell, VectorHasher<int>> m_Map;
Vector3i m_Destination;
Vector3i m_Source;
+ int m_BoundingBoxWidth;
+ int m_BoundingBoxHeight;
+ double m_HalfWidth;
int m_StepsLeft;
+ cPathCell * m_NearestPointToTarget;
+ cFastRandom m_Rand;
/* Control fields */
ePathFinderStatus m_Status;
@@ -145,6 +164,7 @@ private:
/* Interfacing with the world */
cChunk * m_Chunk; // Only valid inside Step()!
+ bool m_BadChunkFound;
#ifdef COMPILING_PATHFIND_DEBUGGER
#include "../path_irrlicht.cpp"
#endif
diff --git a/src/Mobs/Pig.cpp b/src/Mobs/Pig.cpp
index 56d6abfd5..efa779ac2 100644
--- a/src/Mobs/Pig.cpp
+++ b/src/Mobs/Pig.cpp
@@ -21,7 +21,7 @@ cPig::cPig(void) :
void cPig::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Rabbit.cpp b/src/Mobs/Rabbit.cpp
index cf49d2744..c7f3d58f0 100644
--- a/src/Mobs/Rabbit.cpp
+++ b/src/Mobs/Rabbit.cpp
@@ -20,7 +20,7 @@ cRabbit::cRabbit(void) :
void cRabbit::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp
index ec24f167e..dcfef8135 100644
--- a/src/Mobs/Sheep.cpp
+++ b/src/Mobs/Sheep.cpp
@@ -37,10 +37,10 @@ void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
if (!m_IsSheared)
{
- a_Drops.push_back(cItem(E_BLOCK_WOOL, 1, m_WoolColor));
+ a_Drops.push_back(cItem(E_BLOCK_WOOL, 1, static_cast<short>(m_WoolColor)));
}
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
@@ -65,7 +65,7 @@ void cSheep::OnRightClicked(cPlayer & a_Player)
cItems Drops;
int NumDrops = m_World->GetTickRandomNumber(2) + 1;
- Drops.push_back(cItem(E_BLOCK_WOOL, NumDrops, m_WoolColor));
+ Drops.push_back(cItem(E_BLOCK_WOOL, static_cast<char>(NumDrops), static_cast<short>(m_WoolColor)));
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
m_World->BroadcastSoundEffect("mob.sheep.shear", GetPosX(), GetPosY(), GetPosZ(), 1.0f, 1.0f);
}
diff --git a/src/Mobs/Skeleton.cpp b/src/Mobs/Skeleton.cpp
index f99404669..767e5b95c 100644
--- a/src/Mobs/Skeleton.cpp
+++ b/src/Mobs/Skeleton.cpp
@@ -22,7 +22,7 @@ cSkeleton::cSkeleton(bool IsWither) :
void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
@@ -50,12 +50,13 @@ void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer)
void cSkeleton::Attack(std::chrono::milliseconds a_Dt)
{
+ cFastRandom Random;
m_AttackInterval += (static_cast<float>(a_Dt.count()) / 1000) * m_AttackRate;
if ((m_Target != nullptr) && (m_AttackInterval > 3.0))
{
- // Setting this higher gives us more wiggle room for attackrate
- Vector3d Speed = GetLookVector() * 20;
- Speed.y = Speed.y + 1;
+ Vector3d Inaccuracy = Vector3d(Random.NextFloat(0.5) - 0.25, Random.NextFloat(0.5) - 0.25, Random.NextFloat(0.5) - 0.25);
+ Vector3d Speed = (m_Target->GetPosition() + Inaccuracy - GetPosition()) * 5;
+ Speed.y = Speed.y - 1 + Random.NextInt(3);
cArrowEntity * Arrow = new cArrowEntity(this, GetPosX(), GetPosY() + 1, GetPosZ(), Speed);
if (Arrow == nullptr)
{
diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp
index 7fc4821d8..4988d1082 100644
--- a/src/Mobs/Slime.cpp
+++ b/src/Mobs/Slime.cpp
@@ -29,7 +29,7 @@ cSlime::cSlime(int a_Size) :
void cSlime::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Spider.cpp b/src/Mobs/Spider.cpp
index deb263c41..184a1d912 100644
--- a/src/Mobs/Spider.cpp
+++ b/src/Mobs/Spider.cpp
@@ -18,7 +18,7 @@ cSpider::cSpider(void) :
void cSpider::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Squid.cpp b/src/Mobs/Squid.cpp
index 3c508b65f..30fbfa1ff 100644
--- a/src/Mobs/Squid.cpp
+++ b/src/Mobs/Squid.cpp
@@ -21,7 +21,7 @@ cSquid::cSquid(void) :
void cSquid::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
// Drops 0-3 Ink Sacs
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
@@ -35,19 +35,20 @@ void cSquid::GetDrops(cItems & a_Drops, cEntity * a_Killer)
void cSquid::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ m_IsFollowingPath = false; // Disable Pathfinding until it's fixed. TODO
+
// We must first process current location, and only then tick, otherwise we risk processing a location in a chunk
// that is not where the entity currently resides (FS #411)
-
Vector3d Pos = GetPosition();
// TODO: Not a real behavior, but cool :D
- int RelY = (int)floor(Pos.y);
+ int RelY = FloorC(Pos.y);
if ((RelY < 0) || (RelY >= cChunkDef::Height))
{
return;
}
- int RelX = (int)floor(Pos.x) - a_Chunk.GetPosX() * cChunkDef::Width;
- int RelZ = (int)floor(Pos.z) - a_Chunk.GetPosZ() * cChunkDef::Width;
+ int RelX = FloorC(Pos.x) - a_Chunk.GetPosX() * cChunkDef::Width;
+ int RelZ = FloorC(Pos.z) - a_Chunk.GetPosZ() * cChunkDef::Width;
BLOCKTYPE BlockType;
if (a_Chunk.UnboundedRelGetBlockType(RelX, RelY, RelZ, BlockType) && !IsBlockWater(BlockType) && !IsOnFire())
{
diff --git a/src/Mobs/Witch.cpp b/src/Mobs/Witch.cpp
index a3cadbaa0..1f672b4f7 100644
--- a/src/Mobs/Witch.cpp
+++ b/src/Mobs/Witch.cpp
@@ -19,7 +19,7 @@ cWitch::cWitch(void) :
void cWitch::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/Wolf.cpp b/src/Mobs/Wolf.cpp
index 3c2ec1520..7b5953523 100644
--- a/src/Mobs/Wolf.cpp
+++ b/src/Mobs/Wolf.cpp
@@ -20,6 +20,7 @@ cWolf::cWolf(void) :
m_OwnerName(""),
m_CollarColor(14)
{
+ m_RelativeWalkSpeed = 2;
}
@@ -50,7 +51,7 @@ void cWolf::Attack(std::chrono::milliseconds a_Dt)
if ((m_Target != nullptr) && (m_Target->IsPlayer()))
{
- if (((cPlayer *)m_Target)->GetName() != m_OwnerName)
+ if (static_cast<cPlayer *>(m_Target)->GetName() != m_OwnerName)
{
super::Attack(a_Dt);
}
@@ -157,7 +158,7 @@ void cWolf::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
super::Tick(a_Dt, a_Chunk);
}
- cPlayer * a_Closest_Player = m_World->FindClosestPlayer(GetPosition(), (float)m_SightDistance);
+ cPlayer * a_Closest_Player = m_World->FindClosestPlayer(GetPosition(), static_cast<float>(m_SightDistance));
if (a_Closest_Player != nullptr)
{
switch (a_Closest_Player->GetEquippedItem().m_ItemType)
@@ -230,7 +231,7 @@ void cWolf::TickFollowPlayer()
{
// The player is present in the world, follow him:
double Distance = (Callback.OwnerPos - GetPosition()).Length();
- if (Distance > 30)
+ if (Distance > 20)
{
Callback.OwnerPos.y = FindFirstNonAirBlockPosition(Callback.OwnerPos.x, Callback.OwnerPos.z);
TeleportToCoords(Callback.OwnerPos.x, Callback.OwnerPos.y, Callback.OwnerPos.z);
diff --git a/src/Mobs/Wolf.h b/src/Mobs/Wolf.h
index 73ffb55c2..5de83acd8 100644
--- a/src/Mobs/Wolf.h
+++ b/src/Mobs/Wolf.h
@@ -25,8 +25,8 @@ public:
virtual void Attack(std::chrono::milliseconds a_Dt) override;
// Get functions
- bool IsSitting (void) const { return m_IsSitting; }
- bool IsTame (void) const { return m_IsTame; }
+ bool IsSitting (void) const override { return m_IsSitting; }
+ bool IsTame (void) const override { return m_IsTame; }
bool IsBegging (void) const { return m_IsBegging; }
bool IsAngry (void) const { return m_IsAngry; }
AString GetOwnerName (void) const { return m_OwnerName; }
diff --git a/src/Mobs/Zombie.cpp b/src/Mobs/Zombie.cpp
index fa4ac855d..a5b44e6c0 100644
--- a/src/Mobs/Zombie.cpp
+++ b/src/Mobs/Zombie.cpp
@@ -23,7 +23,7 @@ cZombie::cZombie(bool a_IsVillagerZombie) :
void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/Mobs/ZombiePigman.cpp b/src/Mobs/ZombiePigman.cpp
index 8b415b0af..96d587287 100644
--- a/src/Mobs/ZombiePigman.cpp
+++ b/src/Mobs/ZombiePigman.cpp
@@ -18,7 +18,7 @@ cZombiePigman::cZombiePigman(void) :
void cZombiePigman::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = 0;
+ unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
diff --git a/src/MonsterConfig.cpp b/src/MonsterConfig.cpp
index ae2cbbc6b..278e67b93 100644
--- a/src/MonsterConfig.cpp
+++ b/src/MonsterConfig.cpp
@@ -64,7 +64,7 @@ void cMonsterConfig::Initialize()
return;
}
- for (int i = (int)MonstersIniFile.GetNumKeys(); i >= 0; i--)
+ for (int i = static_cast<int>(MonstersIniFile.GetNumKeys()); i >= 0; i--)
{
sAttributesStruct Attributes;
AString Name = MonstersIniFile.GetKeyName(i);
@@ -93,7 +93,7 @@ void cMonsterConfig::AssignAttributes(cMonster * a_Monster, const AString & a_Na
a_Monster->SetAttackDamage (itr->m_AttackDamage);
a_Monster->SetAttackRange (itr->m_AttackRange);
a_Monster->SetSightDistance(itr->m_SightDistance);
- a_Monster->SetAttackRate ((float)itr->m_AttackRate);
+ a_Monster->SetAttackRate (static_cast<float>(itr->m_AttackRate));
a_Monster->SetMaxHealth (itr->m_MaxHealth);
a_Monster->SetIsFireproof (itr->m_IsFireproof);
return;
diff --git a/src/NetherPortalScanner.cpp b/src/NetherPortalScanner.cpp
new file mode 100644
index 000000000..cebf09ceb
--- /dev/null
+++ b/src/NetherPortalScanner.cpp
@@ -0,0 +1,296 @@
+
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+
+#include "NetherPortalScanner.h"
+#include "Vector3.h"
+#include "Entities/Entity.h"
+#include "World.h"
+
+
+
+
+
+cNetherPortalScanner::cNetherPortalScanner(cEntity * a_MovingEntity, cWorld * a_DestinationWorld, Vector3d a_DestPosition, int a_MaxY) :
+ m_Entity(a_MovingEntity),
+ m_World(a_DestinationWorld),
+ m_FoundPortal(false),
+ m_BuildPlatform(true),
+ m_Dir(Direction::X),
+ m_PortalLoc(a_DestPosition.Floor()),
+ m_Position(a_DestPosition),
+ m_MaxY(a_MaxY)
+{
+ int MinX = FloorC((m_Position.x - SearchRadius) / cChunkDef::Width);
+ int MinZ = FloorC((m_Position.z - SearchRadius) / cChunkDef::Width);
+ int MaxX = CeilC((m_Position.x + SearchRadius) / cChunkDef::Width);
+ int MaxZ = CeilC((m_Position.z + SearchRadius) / cChunkDef::Width);
+ for (int x = MinX; x < MaxX; x++)
+ {
+ for (int z = MinZ; z < MaxZ; z++)
+ {
+ Add(x, z);
+ }
+ }
+ Enable(*a_DestinationWorld->GetChunkMap());
+}
+
+
+
+
+
+void cNetherPortalScanner::OnChunkAvailable(int a_ChunkX, int a_ChunkZ)
+{
+ cChunkDef::BlockTypes blocks;
+ m_World->GetChunkBlockTypes(a_ChunkX, a_ChunkZ, blocks);
+
+ // Iterate through all of the blocks in the chunk
+ for (unsigned int i = 0; i < cChunkDef::NumBlocks; i++)
+ {
+ if (blocks[i] == E_BLOCK_NETHER_PORTAL)
+ {
+ Vector3i Coordinate = cChunkDef::IndexToCoordinate(i);
+ if (Coordinate.y >= m_MaxY)
+ {
+ // This is above the map, don't consider it.
+ continue;
+ }
+
+ Vector3d PortalLoc = Vector3d(Coordinate.x + a_ChunkX * cChunkDef::Width, Coordinate.y, Coordinate.z + a_ChunkZ * cChunkDef::Width);
+ if (!m_FoundPortal)
+ {
+ m_FoundPortal = true;
+ m_PortalLoc = PortalLoc;
+ }
+ else
+ {
+ if ((PortalLoc - m_Position).SqrLength() < (m_PortalLoc - m_Position).SqrLength())
+ {
+ m_FoundPortal = true;
+ m_PortalLoc = PortalLoc;
+ }
+ }
+ }
+ }
+}
+
+
+
+
+
+bool cNetherPortalScanner::IsValidBuildLocation(Vector3i a_BlockPos)
+{
+ // Check the base
+ for (int i = 0; i < SearchSolidBaseWidth; i++)
+ {
+ for (int j = 0; j < PortalLength; j++)
+ {
+ BLOCKTYPE blocktype = m_World->GetBlock(a_BlockPos.x + i, a_BlockPos.y, a_BlockPos.z + j);
+ if (!cBlockInfo::IsSolid(blocktype))
+ {
+ return false;
+ }
+
+ // Check the airspace
+ for (int k = 1; k < PortalHeight; k++)
+ {
+ blocktype = m_World->GetBlock(a_BlockPos.x + i, a_BlockPos.y + k, a_BlockPos.z + j);
+ if (blocktype != E_BLOCK_AIR)
+ {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+
+
+
+
+bool cNetherPortalScanner::OnAllChunksAvailable(void)
+{
+ if (m_FoundPortal)
+ {
+ // Find the bottom of this portal
+ while (m_World->GetBlock(m_PortalLoc.x, m_PortalLoc.y, m_PortalLoc.z) == E_BLOCK_NETHER_PORTAL)
+ {
+ m_PortalLoc.y -= 1;
+ }
+ m_PortalLoc.y += 1;
+
+ // Figure out which way the portal is facing
+ int BXP = m_World->GetBlock(m_PortalLoc.x + 1, m_PortalLoc.y, m_PortalLoc.z);
+ int BXM = m_World->GetBlock(m_PortalLoc.x - 1, m_PortalLoc.y, m_PortalLoc.z);
+ if ((BXP == E_BLOCK_NETHER_PORTAL) || (BXM == E_BLOCK_NETHER_PORTAL))
+ {
+ // The long axis is along X
+ m_Dir = Direction::X;
+ }
+ else
+ {
+ // The long axis is along Z
+ m_Dir = Direction::Y;
+ }
+ }
+ else
+ {
+ // Scan the area for a suitable location
+ int minx = FloorC(m_Position.x) - BuildSearchRadius;
+ int minz = FloorC(m_Position.z) - BuildSearchRadius;
+ int maxx = FloorC(m_Position.x) + BuildSearchRadius;
+ int maxz = FloorC(m_Position.z) + BuildSearchRadius;
+ int maxy = m_MaxY;
+ std::vector<Vector3i> Possibilities;
+ int x, y, z;
+ for (y = 0; y < maxy - PortalHeight; y++)
+ {
+ for (x = minx; x < maxx - PortalLength; x++)
+ {
+ for (z = minz; z < maxz - SearchSolidBaseWidth; z++)
+ {
+ Vector3i Location = Vector3i(x, y, z);
+ if (IsValidBuildLocation(Location))
+ {
+ Possibilities.push_back(Vector3i(x, y, z));
+ }
+ }
+ }
+ }
+
+ if (Possibilities.size() > 0)
+ {
+ m_BuildPlatform = false;
+
+ // Find the nearest
+ double DistanceToClosest = (Possibilities[0] - m_Position).SqrLength();
+ Vector3i Closest = Possibilities[0];
+ for (const auto & itr : Possibilities)
+ {
+ double Distance = (itr - m_Position).SqrLength();
+ if (Distance < DistanceToClosest)
+ {
+ DistanceToClosest = Distance;
+ Closest = itr;
+ }
+ }
+
+ m_PortalLoc = Closest;
+ }
+ }
+ return true;
+}
+
+
+
+
+
+void cNetherPortalScanner::BuildNetherPortal(Vector3i a_Location, Direction a_Direction, bool a_IncludePlatform)
+{
+ int x = a_Location.x;
+ int y = a_Location.y;
+ int z = a_Location.z;
+
+ // Clear a 3x4x4 area starting right above the base
+ for (int i = 0; i < SearchSolidBaseWidth; i++)
+ {
+ for (int j = 0; j < PortalLength; j++)
+ {
+ for (int k = 1; k < PortalHeight; k++)
+ {
+ if (a_Direction == Direction::Y)
+ {
+ m_World->SetBlock(x + i, y + k, z + j, E_BLOCK_AIR, 0);
+ }
+ else if (a_Direction == Direction::X)
+ {
+ m_World->SetBlock(x + j, y + k, z + i, E_BLOCK_AIR, 0);
+ }
+ }
+ }
+ }
+
+ // Put in an obsidian base
+ if (a_IncludePlatform)
+ {
+ for (int j = 0; j < PortalLength; j++)
+ {
+ // +2 on the short axis because that's where we deposit the entity
+ if (a_Direction == Direction::Y)
+ {
+ m_World->SetBlock(x + 2, y, z + j, E_BLOCK_OBSIDIAN, 0);
+ }
+ else if (a_Direction == Direction::X)
+ {
+ m_World->SetBlock(x + j, y, z + 2, E_BLOCK_OBSIDIAN, 0);
+ }
+ }
+ }
+
+ // Build an obsidian frame
+ for (int i = 0; i < PortalHeight; i++)
+ {
+ if (a_Direction == Direction::Y)
+ {
+ m_World->SetBlock(x + 1, y + i, z, E_BLOCK_OBSIDIAN, 0);
+ m_World->SetBlock(x + 1, y + i, z + 3, E_BLOCK_OBSIDIAN, 0);
+ }
+ else if (a_Direction == Direction::X)
+ {
+ m_World->SetBlock(x, y + i, z + 1, E_BLOCK_OBSIDIAN, 0);
+ m_World->SetBlock(x + 3, y + i, z + 1, E_BLOCK_OBSIDIAN, 0);
+ }
+ }
+ for (int i = 0; i < PortalLength; i++)
+ {
+ if (a_Direction == Direction::Y)
+ {
+ m_World->SetBlock(x + 1, y + 4, z + i, E_BLOCK_OBSIDIAN, 0);
+ m_World->SetBlock(x + 1, y, z + i, E_BLOCK_OBSIDIAN, 0);
+ }
+ else if (a_Direction == Direction::X)
+ {
+ m_World->SetBlock(x + i, y + 4, z + 1, E_BLOCK_OBSIDIAN, 0);
+ m_World->SetBlock(x + i, y, z + 1, E_BLOCK_OBSIDIAN, 0);
+ }
+ }
+
+ // Fill the frame (place a fire in the bottom)
+ m_World->SetBlock(x + 1, y + 1, z + 1, E_BLOCK_FIRE, 0);
+}
+
+
+
+
+
+void cNetherPortalScanner::OnDisabled(void)
+{
+ // Now we actually move the player
+ if (!m_FoundPortal)
+ {
+ // Build a new nether portal.
+ LOGD("Building nether portal at {%d, %d, %d}", m_PortalLoc.x, m_PortalLoc.y, m_PortalLoc.z);
+ BuildNetherPortal(m_PortalLoc, m_Dir, m_BuildPlatform);
+ m_PortalLoc.x += 1;
+ m_PortalLoc.y += 2;
+ m_PortalLoc.z += 1;
+ }
+
+ // Put the entity near the opening
+ Vector3d Position = m_PortalLoc;
+ if (m_Dir == Direction::Y)
+ {
+ Position.x += OutOffset;
+ Position.z += AcrossOffset;
+ }
+ else if (m_Dir == Direction::X)
+ {
+ Position.x += AcrossOffset;
+ Position.z += OutOffset;
+ }
+
+ LOGD("Placing player at {%f, %f, %f}", Position.x, Position.y, Position.z);
+ m_Entity->ScheduleMoveToWorld(m_World, Position, true);
+ delete this;
+}
+
diff --git a/src/NetherPortalScanner.h b/src/NetherPortalScanner.h
new file mode 100644
index 000000000..393859b4d
--- /dev/null
+++ b/src/NetherPortalScanner.h
@@ -0,0 +1,75 @@
+
+#pragma once
+
+#include "Vector3.h"
+#include "ChunkStay.h"
+
+
+class cEntity;
+class cWorld;
+
+
+
+
+
+// This is the chunk stay which finds nearby nether portals
+class cNetherPortalScanner : public cChunkStay
+{
+public:
+ cNetherPortalScanner(cEntity * a_MovingEntity, cWorld * a_DestinationWorld, Vector3d a_DestPosition, int a_MaxY);
+ virtual void OnChunkAvailable(int a_ChunkX, int a_ChunkY) override;
+ virtual bool OnAllChunksAvailable(void) override;
+ virtual void OnDisabled(void) override;
+
+ enum class Direction
+ {
+ X,
+ Y
+ };
+
+private:
+
+ /** Length and height, including the obsidian. */
+ static const int PortalLength = 4;
+ static const int PortalHeight = 5;
+
+ static const int SearchRadius = 128;
+ static const int BuildSearchRadius = 16;
+
+ /** The width of a solid base to search for when building. */
+ static const int SearchSolidBaseWidth = 3;
+
+ /** Where to place the player out from the face and across the face */
+ const double OutOffset = 0.5;
+ const double AcrossOffset = 0.5;
+
+ /** Builds a portal. */
+ void BuildNetherPortal(Vector3i a_Location, Direction a_Direction, bool a_IncludePlatform);
+
+ /** Whether the given location is a valid location to build a portal. */
+ bool IsValidBuildLocation(Vector3i a_BlockPosition);
+
+ /** The entity that's being moved. */
+ cEntity * m_Entity;
+
+ /** The world we're moving the entity to. */
+ cWorld * m_World;
+
+ /** Whether we found a portal during the loading of the chunks. */
+ bool m_FoundPortal;
+
+ /** Whether to build a platform. True if we couldn't build the portal on solid ground */
+ bool m_BuildPlatform;
+
+ /** The direction of the portal. */
+ Direction m_Dir;
+
+ /** The position of the pre-existing portal. */
+ Vector3i m_PortalLoc;
+
+ /** The center of the search area */
+ Vector3d m_Position;
+
+ /** The maximum Y to scan to */
+ int m_MaxY;
+};
diff --git a/src/Noise/CMakeLists.txt b/src/Noise/CMakeLists.txt
index e1837500f..ab4cf031b 100644
--- a/src/Noise/CMakeLists.txt
+++ b/src/Noise/CMakeLists.txt
@@ -14,6 +14,10 @@ SET (HDRS
RidgedNoise.h
)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(Noise.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+endif()
+
if(NOT MSVC)
add_library(Noise ${SRCS} ${HDRS})
diff --git a/src/Noise/Noise.cpp b/src/Noise/Noise.cpp
index d11c47bc2..703ec3d30 100644
--- a/src/Noise/Noise.cpp
+++ b/src/Noise/Noise.cpp
@@ -112,22 +112,22 @@ public:
////////////////////////////////////////////////////////////////////////////////
// Globals:
-void Debug3DNoise(const NOISE_DATATYPE * a_Noise, int a_SizeX, int a_SizeY, int a_SizeZ, const AString & a_FileNameBase, NOISE_DATATYPE a_Coeff)
+void Debug3DNoise(const NOISE_DATATYPE * a_Noise, size_t a_SizeX, size_t a_SizeY, size_t a_SizeZ, const AString & a_FileNameBase, NOISE_DATATYPE a_Coeff)
{
const int BUF_SIZE = 512;
ASSERT(a_SizeX <= BUF_SIZE); // Just stretch it, if needed
// Save in XY cuts:
cFile f1;
- if (f1.Open(Printf("%s_XY (%d).grab", a_FileNameBase.c_str(), a_SizeX), cFile::fmWrite))
+ if (f1.Open(Printf("%s_XY (" SIZE_T_FMT ").grab", a_FileNameBase.c_str(), a_SizeX), cFile::fmWrite))
{
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- for (int y = 0; y < a_SizeY; y++)
+ for (size_t y = 0; y < a_SizeY; y++)
{
- int idx = y * a_SizeX + z * a_SizeX * a_SizeY;
+ size_t idx = y * a_SizeX + z * a_SizeX * a_SizeY;
unsigned char buf[BUF_SIZE];
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
buf[x] = static_cast<unsigned char>(Clamp((int)(128 + a_Coeff * a_Noise[idx++]), 0, 255));
}
@@ -140,15 +140,15 @@ void Debug3DNoise(const NOISE_DATATYPE * a_Noise, int a_SizeX, int a_SizeY, int
} // if (XY file open)
cFile f2;
- if (f2.Open(Printf("%s_XZ (%d).grab", a_FileNameBase.c_str(), a_SizeX), cFile::fmWrite))
+ if (f2.Open(Printf("%s_XZ (" SIZE_T_FMT ").grab", a_FileNameBase.c_str(), a_SizeX), cFile::fmWrite))
{
- for (int y = 0; y < a_SizeY; y++)
+ for (size_t y = 0; y < a_SizeY; y++)
{
- for (int z = 0; z < a_SizeZ; z++)
+ for (size_t z = 0; z < a_SizeZ; z++)
{
- int idx = y * a_SizeX + z * a_SizeX * a_SizeY;
+ size_t idx = y * a_SizeX + z * a_SizeX * a_SizeY;
unsigned char buf[BUF_SIZE];
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
buf[x] = static_cast<unsigned char>(Clamp((int)(128 + a_Coeff * a_Noise[idx++]), 0, 255));
}
@@ -165,19 +165,19 @@ void Debug3DNoise(const NOISE_DATATYPE * a_Noise, int a_SizeX, int a_SizeY, int
-void Debug2DNoise(const NOISE_DATATYPE * a_Noise, int a_SizeX, int a_SizeY, const AString & a_FileNameBase, NOISE_DATATYPE a_Coeff)
+void Debug2DNoise(const NOISE_DATATYPE * a_Noise, size_t a_SizeX, size_t a_SizeY, const AString & a_FileNameBase, NOISE_DATATYPE a_Coeff)
{
const int BUF_SIZE = 512;
ASSERT(a_SizeX <= BUF_SIZE); // Just stretch it, if needed
cFile f1;
- if (f1.Open(Printf("%s (%d).grab", a_FileNameBase.c_str(), a_SizeX), cFile::fmWrite))
+ if (f1.Open(Printf("%s (" SIZE_T_FMT ").grab", a_FileNameBase.c_str(), a_SizeX), cFile::fmWrite))
{
- for (int y = 0; y < a_SizeY; y++)
+ for (size_t y = 0; y < a_SizeY; y++)
{
- int idx = y * a_SizeX;
+ size_t idx = y * a_SizeX;
unsigned char buf[BUF_SIZE];
- for (int x = 0; x < a_SizeX; x++)
+ for (size_t x = 0; x < a_SizeX; x++)
{
buf[x] = static_cast<unsigned char>(Clamp((int)(128 + a_Coeff * a_Noise[idx++]), 0, 255));
}
diff --git a/src/Noise/Noise.h b/src/Noise/Noise.h
index 323194bfd..b08b96e24 100644
--- a/src/Noise/Noise.h
+++ b/src/Noise/Noise.h
@@ -185,7 +185,7 @@ typedef cOctavedNoise<cRidgedNoise<cCubicNoise>> cRidgedMultiNoise;
NOISE_DATATYPE cNoise::IntNoise1D(int a_X) const
{
int x = ((a_X * m_Seed) << 13) ^ a_X;
- return (1 - (NOISE_DATATYPE)((x * (x * x * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824);
+ return (1 - static_cast<NOISE_DATATYPE>((x * (x * x * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824);
// returns a float number in the range of [-1, 1]
}
@@ -197,7 +197,7 @@ NOISE_DATATYPE cNoise::IntNoise2D(int a_X, int a_Y) const
{
int n = a_X + a_Y * 57 + m_Seed * 57 * 57;
n = (n << 13) ^ n;
- return (1 - (NOISE_DATATYPE)((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824);
+ return (1 - static_cast<NOISE_DATATYPE>((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824);
// returns a float number in the range of [-1, 1]
}
@@ -209,7 +209,9 @@ NOISE_DATATYPE cNoise::IntNoise3D(int a_X, int a_Y, int a_Z) const
{
int n = a_X + a_Y * 57 + a_Z * 57 * 57 + m_Seed * 57 * 57 * 57;
n = (n << 13) ^ n;
- return ((NOISE_DATATYPE)1 - (NOISE_DATATYPE)((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0f);
+ return (static_cast<NOISE_DATATYPE>(1) -
+ static_cast<NOISE_DATATYPE>((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0f
+ );
// returns a float number in the range of [-1, 1]
}
@@ -265,8 +267,8 @@ NOISE_DATATYPE cNoise::CubicInterpolate(NOISE_DATATYPE a_A, NOISE_DATATYPE a_B,
NOISE_DATATYPE cNoise::CosineInterpolate(NOISE_DATATYPE a_A, NOISE_DATATYPE a_B, NOISE_DATATYPE a_Pct)
{
- const NOISE_DATATYPE ft = a_Pct * (NOISE_DATATYPE)3.1415927;
- const NOISE_DATATYPE f = (NOISE_DATATYPE)((NOISE_DATATYPE)(1 - cos(ft)) * (NOISE_DATATYPE)0.5);
+ const NOISE_DATATYPE ft = a_Pct * static_cast<NOISE_DATATYPE>(3.1415927);
+ const NOISE_DATATYPE f = static_cast<NOISE_DATATYPE>(static_cast<NOISE_DATATYPE>(1 - cos(ft)) * static_cast<NOISE_DATATYPE>(0.5));
return a_A * (1 - f) + a_B * f;
}
@@ -288,11 +290,11 @@ NOISE_DATATYPE cNoise::LinearInterpolate(NOISE_DATATYPE a_A, NOISE_DATATYPE a_B,
/** Exports the noise array into a file.
a_Coeff specifies the value that each array value is multiplied by before being converted into a byte. */
-extern void Debug2DNoise(const NOISE_DATATYPE * a_Array, int a_SizeX, int a_SizeY, const AString & a_FileNameBase, NOISE_DATATYPE a_Coeff = 32);
+extern void Debug2DNoise(const NOISE_DATATYPE * a_Array, size_t a_SizeX, size_t a_SizeY, const AString & a_FileNameBase, NOISE_DATATYPE a_Coeff = 32);
/** Exports the noise array into a set of files, ordered by XY and XZ.
a_Coeff specifies the value that each array value is multiplied by before being converted into a byte. */
-extern void Debug3DNoise(const NOISE_DATATYPE * a_Array, int a_SizeX, int a_SizeY, int a_SizeZ, const AString & a_FileNameBase, NOISE_DATATYPE a_Coeff = 32);
+extern void Debug3DNoise(const NOISE_DATATYPE * a_Array, size_t a_SizeX, size_t a_SizeY, size_t a_SizeZ, const AString & a_FileNameBase, NOISE_DATATYPE a_Coeff = 32);
diff --git a/src/OSSupport/CMakeLists.txt b/src/OSSupport/CMakeLists.txt
index 0d3c9a63e..df47394ae 100644
--- a/src/OSSupport/CMakeLists.txt
+++ b/src/OSSupport/CMakeLists.txt
@@ -15,7 +15,6 @@ SET (SRCS
IsThread.cpp
NetworkInterfaceEnum.cpp
NetworkSingleton.cpp
- Semaphore.cpp
ServerHandleImpl.cpp
StackTrace.cpp
TCPLinkImpl.cpp
@@ -34,13 +33,16 @@ SET (HDRS
Network.h
NetworkSingleton.h
Queue.h
- Semaphore.h
ServerHandleImpl.h
StackTrace.h
TCPLinkImpl.h
UDPEndpointImpl.h
)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_flags_cxx("-Wno-error=global-constructors -Wno-error=old-style-cast")
+endif()
+
if(NOT MSVC)
add_library(OSSupport ${SRCS} ${HDRS})
diff --git a/src/OSSupport/Errors.cpp b/src/OSSupport/Errors.cpp
index a5361e1a6..407799495 100644
--- a/src/OSSupport/Errors.cpp
+++ b/src/OSSupport/Errors.cpp
@@ -22,7 +22,7 @@ AString GetOSErrorString( int a_ErrNo)
// According to http://linux.die.net/man/3/strerror_r there are two versions of strerror_r():
- #if !defined(__APPLE__) && ( _GNU_SOURCE) && !defined(ANDROID_NDK) // GNU version of strerror_r()
+ #if !defined(__APPLE__) && defined( _GNU_SOURCE) && !defined(ANDROID_NDK) // GNU version of strerror_r()
char * res = strerror_r( errno, buffer, ARRAYCOUNT(buffer));
if (res != nullptr)
diff --git a/src/OSSupport/Event.cpp b/src/OSSupport/Event.cpp
index 760e536a1..4c2adea3c 100644
--- a/src/OSSupport/Event.cpp
+++ b/src/OSSupport/Event.cpp
@@ -1,8 +1,8 @@
// Event.cpp
-// Implements the cEvent object representing an OS-specific synchronization primitive that can be waited-for
-// Implemented as an Event on Win and as a 1-semaphore on *nix
+// Interfaces to the cEvent object representing a synchronization primitive that can be waited-for
+// Implemented using C++11 condition variable and mutex
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
@@ -13,7 +13,7 @@
cEvent::cEvent(void) :
- m_ShouldWait(true)
+ m_ShouldContinue(false)
{
}
@@ -23,12 +23,11 @@ cEvent::cEvent(void) :
void cEvent::Wait(void)
{
- std::unique_lock<std::mutex> Lock(m_Mutex);
- while (m_ShouldWait)
{
- m_CondVar.wait(Lock);
+ std::unique_lock<std::mutex> Lock(m_Mutex);
+ m_CondVar.wait(Lock, [this](){ return m_ShouldContinue.load(); });
}
- m_ShouldWait = true;
+ m_ShouldContinue = false;
}
@@ -38,33 +37,13 @@ void cEvent::Wait(void)
bool cEvent::Wait(unsigned a_TimeoutMSec)
{
auto dst = std::chrono::system_clock::now() + std::chrono::milliseconds(a_TimeoutMSec);
- std::unique_lock<std::mutex> Lock(m_Mutex); // We assume that this lock is acquired without much delay - we are the only user of the mutex
- while (m_ShouldWait && (std::chrono::system_clock::now() <= dst))
+ bool Result;
{
- switch (m_CondVar.wait_until(Lock, dst))
- {
- case std::cv_status::no_timeout:
- {
- // The wait was successful, check for spurious wakeup:
- if (!m_ShouldWait)
- {
- m_ShouldWait = true;
- return true;
- }
- // This was a spurious wakeup, wait again:
- continue;
- }
-
- case std::cv_status::timeout:
- {
- // The wait timed out, return failure:
- return false;
- }
- } // switch (wait_until())
- } // while (m_ShouldWait && not timeout)
-
- // The wait timed out in the while condition:
- return false;
+ std::unique_lock<std::mutex> Lock(m_Mutex); // We assume that this lock is acquired without much delay - we are the only user of the mutex
+ Result = m_CondVar.wait_until(Lock, dst, [this](){ return m_ShouldContinue.load(); });
+ }
+ m_ShouldContinue = false;
+ return Result;
}
@@ -73,13 +52,20 @@ bool cEvent::Wait(unsigned a_TimeoutMSec)
void cEvent::Set(void)
{
- {
- std::unique_lock<std::mutex> Lock(m_Mutex);
- m_ShouldWait = false;
- }
+ m_ShouldContinue = true;
m_CondVar.notify_one();
}
+void cEvent::SetAll(void)
+{
+ m_ShouldContinue = true;
+ m_CondVar.notify_all();
+}
+
+
+
+
+
diff --git a/src/OSSupport/Event.h b/src/OSSupport/Event.h
index 572388a3f..2c58ba485 100644
--- a/src/OSSupport/Event.h
+++ b/src/OSSupport/Event.h
@@ -12,6 +12,7 @@
#include <mutex>
#include <condition_variable>
+#include <atomic>
@@ -28,7 +29,11 @@ public:
/** Sets the event - releases one thread that has been waiting in Wait().
If there was no thread waiting, the next call to Wait() will not block. */
- void Set (void);
+ void Set(void);
+
+ /** Sets the event - releases all threads that have been waiting in Wait().
+ If there was no thread waiting, the next call to Wait() will not block. */
+ void SetAll(void);
/** Waits for the event until either it is signalled, or the (relative) timeout is passed.
Returns true if the event was signalled, false if the timeout was hit or there was an error. */
@@ -37,9 +42,9 @@ public:
private:
/** Used for checking for spurious wakeups. */
- bool m_ShouldWait;
+ std::atomic<bool> m_ShouldContinue;
- /** Mutex protecting m_ShouldWait from multithreaded access. */
+ /** Mutex protecting m_ShouldContinue from multithreaded access. */
std::mutex m_Mutex;
/** The condition variable used as the Event. */
diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp
index 43105b230..6327b3505 100644
--- a/src/OSSupport/File.cpp
+++ b/src/OSSupport/File.cpp
@@ -180,7 +180,7 @@ int cFile::Write(const void * iBuffer, size_t iNumBytes)
-int cFile::Seek (int iPosition)
+long cFile::Seek (int iPosition)
{
ASSERT(IsOpen());
@@ -193,7 +193,7 @@ int cFile::Seek (int iPosition)
{
return -1;
}
- return (int)ftell(m_File);
+ return ftell(m_File);
}
@@ -201,7 +201,7 @@ int cFile::Seek (int iPosition)
-int cFile::Tell (void) const
+long cFile::Tell (void) const
{
ASSERT(IsOpen());
@@ -210,14 +210,14 @@ int cFile::Tell (void) const
return -1;
}
- return (int)ftell(m_File);
+ return ftell(m_File);
}
-int cFile::GetSize(void) const
+long cFile::GetSize(void) const
{
ASSERT(IsOpen());
@@ -226,7 +226,7 @@ int cFile::GetSize(void) const
return -1;
}
- int CurPos = Tell();
+ long CurPos = Tell();
if (CurPos < 0)
{
return -1;
@@ -235,7 +235,7 @@ int cFile::GetSize(void) const
{
return -1;
}
- int res = Tell();
+ long res = Tell();
if (fseek(m_File, (long)CurPos, SEEK_SET) != 0)
{
return -1;
@@ -256,7 +256,19 @@ int cFile::ReadRestOfFile(AString & a_Contents)
return -1;
}
- size_t DataSize = GetSize() - Tell();
+ long TotalSize = GetSize();
+ if (TotalSize < 0)
+ {
+ return -1;
+ }
+
+ long Position = Tell();
+ if (Position < 0)
+ {
+ return -1;
+ }
+
+ auto DataSize = static_cast<size_t>(TotalSize - Position);
// HACK: This depends on the internal knowledge that AString's data() function returns the internal buffer directly
a_Contents.assign(DataSize, '\0');
@@ -349,7 +361,7 @@ bool cFile::IsFile(const AString & a_Path)
-int cFile::GetSize(const AString & a_FileName)
+long cFile::GetSize(const AString & a_FileName)
{
struct stat st;
if (stat(a_FileName.c_str(), &st) == 0)
diff --git a/src/OSSupport/File.h b/src/OSSupport/File.h
index 1b5e71a17..6281d1494 100644
--- a/src/OSSupport/File.h
+++ b/src/OSSupport/File.h
@@ -87,13 +87,13 @@ public:
int Write(const void * iBuffer, size_t iNumBytes);
/** Seeks to iPosition bytes from file start, returns old position or -1 for failure; asserts if not open */
- int Seek (int iPosition);
+ long Seek (int iPosition);
/** Returns the current position (bytes from file start) or -1 for failure; asserts if not open */
- int Tell (void) const;
+ long Tell (void) const;
/** Returns the size of file, in bytes, or -1 for failure; asserts if not open */
- int GetSize(void) const;
+ long GetSize(void) const;
/** Reads the file from current position till EOF into an AString; returns the number of bytes read or -1 for error */
int ReadRestOfFile(AString & a_Contents);
@@ -119,7 +119,7 @@ public:
static bool IsFile(const AString & a_Path);
/** Returns the size of the file, or a negative number on error */
- static int GetSize(const AString & a_FileName);
+ static long GetSize(const AString & a_FileName);
/** Creates a new folder with the specified name. Returns true if successful. Path may be relative or absolute */
static bool CreateFolder(const AString & a_FolderPath);
diff --git a/src/OSSupport/GZipFile.h b/src/OSSupport/GZipFile.h
index dfb4e8c31..286c98aff 100644
--- a/src/OSSupport/GZipFile.h
+++ b/src/OSSupport/GZipFile.h
@@ -37,7 +37,7 @@ public:
int ReadRestOfFile(AString & a_Contents);
/// Writes a_Contents into file, compressing it along the way. Returns true if successful. Multiple writes are supported.
- bool Write(const AString & a_Contents) { return Write(a_Contents.data(), (int)(a_Contents.size())); }
+ bool Write(const AString & a_Contents) { return Write(a_Contents.data(), static_cast<int>(a_Contents.size())); }
bool Write(const char * a_Data, int a_Size);
diff --git a/src/OSSupport/IsThread.cpp b/src/OSSupport/IsThread.cpp
index 55e96b622..e295d5f25 100644
--- a/src/OSSupport/IsThread.cpp
+++ b/src/OSSupport/IsThread.cpp
@@ -134,9 +134,9 @@ bool cIsThread::Wait(void)
m_Thread.join();
return true;
}
- catch (std::system_error & a_Exception)
+ catch (const std::system_error & a_Exception)
{
- LOGERROR("cIsThread::Wait error %i: could not join thread %s; %s", a_Exception.code().value(), m_ThreadName.c_str(), a_Exception.code().message().c_str());
+ LOGERROR("%s error %i: could not join thread %s; %s", __FUNCTION__, a_Exception.code().value(), m_ThreadName.c_str(), a_Exception.code().message().c_str());
return false;
}
}
diff --git a/src/OSSupport/IsThread.h b/src/OSSupport/IsThread.h
index f642c8724..fa6813cd7 100644
--- a/src/OSSupport/IsThread.h
+++ b/src/OSSupport/IsThread.h
@@ -32,10 +32,6 @@ protected:
/** The overriden Execute() method should check this value periodically and terminate if this is true. */
volatile bool m_ShouldTerminate;
-private:
- /** Wrapper for Execute() that waits for the initialization event, to prevent race conditions in thread initialization. */
- void DoExecute(void);
-
public:
cIsThread(const AString & a_ThreadName);
virtual ~cIsThread();
@@ -51,14 +47,21 @@ public:
/** Returns true if the thread calling this function is the thread contained within this object. */
bool IsCurrentThread(void) const { return std::this_thread::get_id() == m_Thread.get_id(); }
+
+private:
-protected:
+ /** The name of the thread, used to aid debugging in IDEs which support named threads */
AString m_ThreadName;
+
+ /** The thread object which holds the created thread for later manipulation */
std::thread m_Thread;
/** The event that is used to wait with the thread's execution until the thread object is fully initialized.
- This prevents the IsCurrentThread() call to fail because of a race-condition. */
+ This prevents the IsCurrentThread() call to fail because of a race-condition where the thread starts before m_Thread has been fully assigned. */
cEvent m_evtStart;
+
+ /** Wrapper for Execute() that waits for the initialization event, to prevent race conditions in thread initialization. */
+ void DoExecute(void);
} ;
diff --git a/src/OSSupport/NetworkInterfaceEnum.cpp b/src/OSSupport/NetworkInterfaceEnum.cpp
index c4af1e93c..d74565e07 100644
--- a/src/OSSupport/NetworkInterfaceEnum.cpp
+++ b/src/OSSupport/NetworkInterfaceEnum.cpp
@@ -6,6 +6,8 @@
#include "Globals.h"
#include "Network.h"
#include "event2/util.h"
+#include "../SelfTests.h"
+
#ifdef _WIN32
#include <IPHlpApi.h>
#pragma comment(lib, "IPHLPAPI.lib")
@@ -27,13 +29,18 @@ static class cEnumIPAddressTest
public:
cEnumIPAddressTest(void)
{
- printf("Enumerating all IP addresses...\n");
+ cSelfTests::Get().Register(std::function<void(void)>(&Test), "Network IP enumeration");
+ }
+
+ static void Test(void)
+ {
+ LOG("Enumerating all IP addresses...");
auto IPs = cNetwork::EnumLocalIPAddresses();
for (auto & ip: IPs)
{
- printf(" %s\n", ip.c_str());
+ LOG(" %s", ip.c_str());
}
- printf("Done.\n");
+ LOG("Done.");
}
} g_EnumIPAddressTest;
diff --git a/src/OSSupport/Semaphore.cpp b/src/OSSupport/Semaphore.cpp
deleted file mode 100644
index 6a2d57901..000000000
--- a/src/OSSupport/Semaphore.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-
-#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
-
-
-
-
-
-cSemaphore::cSemaphore( unsigned int a_MaxCount, unsigned int a_InitialCount /* = 0 */)
-#ifndef _WIN32
- : m_bNamed( false)
-#endif
-{
-#ifndef _WIN32
- (void)a_MaxCount;
- m_Handle = new sem_t;
- if (sem_init( (sem_t*)m_Handle, 0, 0))
- {
- LOG("WARNING cSemaphore: Could not create unnamed semaphore, fallback to named.");
- delete (sem_t*)m_Handle; // named semaphores return their own address
- m_bNamed = true;
-
- AString Name;
- Printf(Name, "cSemaphore%p", this);
- m_Handle = sem_open(Name.c_str(), O_CREAT, 777, a_InitialCount);
- if (m_Handle == SEM_FAILED)
- {
- LOG("ERROR: Could not create Semaphore. (%i)", errno);
- }
- else
- {
- if (sem_unlink(Name.c_str()) != 0)
- {
- LOG("ERROR: Could not unlink cSemaphore. (%i)", errno);
- }
- }
- }
-#else
- m_Handle = CreateSemaphore(
- nullptr, // security attribute
- a_InitialCount, // initial count
- a_MaxCount, // maximum count
- 0 // name (optional)
- );
-#endif
-}
-
-
-
-
-
-cSemaphore::~cSemaphore()
-{
-#ifdef _WIN32
- CloseHandle( m_Handle);
-#else
- if (m_bNamed)
- {
- if (sem_close( (sem_t*)m_Handle) != 0)
- {
- LOG("ERROR: Could not close cSemaphore. (%i)", errno);
- }
- }
- else
- {
- sem_destroy( (sem_t*)m_Handle);
- delete (sem_t*)m_Handle;
- }
- m_Handle = 0;
-
-#endif
-}
-
-
-
-
-
-void cSemaphore::Wait()
-{
-#ifndef _WIN32
- if (sem_wait( (sem_t*)m_Handle) != 0)
- {
- LOG("ERROR: Could not wait for cSemaphore. (%i)", errno);
- }
-#else
- WaitForSingleObject( m_Handle, INFINITE);
-#endif
-}
-
-
-
-
-
-void cSemaphore::Signal()
-{
-#ifndef _WIN32
- if (sem_post( (sem_t*)m_Handle) != 0)
- {
- LOG("ERROR: Could not signal cSemaphore. (%i)", errno);
- }
-#else
- ReleaseSemaphore( m_Handle, 1, nullptr);
-#endif
-}
-
-
-
-
diff --git a/src/OSSupport/Semaphore.h b/src/OSSupport/Semaphore.h
deleted file mode 100644
index 57fa4bdb2..000000000
--- a/src/OSSupport/Semaphore.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#pragma once
-
-class cSemaphore
-{
-public:
- cSemaphore( unsigned int a_MaxCount, unsigned int a_InitialCount = 0);
- ~cSemaphore();
-
- void Wait();
- void Signal();
-private:
- void * m_Handle; // HANDLE pointer
-
-#ifndef _WIN32
- bool m_bNamed;
-#endif
-};
diff --git a/src/OSSupport/ServerHandleImpl.cpp b/src/OSSupport/ServerHandleImpl.cpp
index 44ace448b..6f0a1ee16 100644
--- a/src/OSSupport/ServerHandleImpl.cpp
+++ b/src/OSSupport/ServerHandleImpl.cpp
@@ -294,14 +294,14 @@ void cServerHandleImpl::Callback(evconnlistener * a_Listener, evutil_socket_t a_
case AF_INET:
{
sockaddr_in * sin = reinterpret_cast<sockaddr_in *>(a_Addr);
- evutil_inet_ntop(AF_INET, sin, IPAddress, ARRAYCOUNT(IPAddress));
+ evutil_inet_ntop(AF_INET, &(sin->sin_addr), IPAddress, ARRAYCOUNT(IPAddress));
Port = ntohs(sin->sin_port);
break;
}
case AF_INET6:
{
sockaddr_in6 * sin6 = reinterpret_cast<sockaddr_in6 *>(a_Addr);
- evutil_inet_ntop(AF_INET, sin6, IPAddress, ARRAYCOUNT(IPAddress));
+ evutil_inet_ntop(AF_INET6, &(sin6->sin6_addr), IPAddress, ARRAYCOUNT(IPAddress));
Port = ntohs(sin6->sin6_port);
break;
}
diff --git a/src/OSSupport/StackTrace.cpp b/src/OSSupport/StackTrace.cpp
index 015a53ba0..1ec10f20e 100644
--- a/src/OSSupport/StackTrace.cpp
+++ b/src/OSSupport/StackTrace.cpp
@@ -12,6 +12,13 @@
#include <unistd.h>
#endif
+// FreeBSD uses size_t for the return type of backtrace()
+#if defined(__FreeBSD__) && (__FreeBSD__ >= 10)
+ #define btsize size_t
+#else
+ #define btsize int
+#endif
+
@@ -34,7 +41,7 @@ void PrintStackTrace(void)
// Use the backtrace() function to get and output the stackTrace:
// Code adapted from http://stackoverflow.com/questions/77005/how-to-generate-a-stacktrace-when-my-gcc-c-app-crashes
void * stackTrace[30];
- int numItems = backtrace(stackTrace, ARRAYCOUNT(stackTrace));
+ btsize numItems = backtrace(stackTrace, ARRAYCOUNT(stackTrace));
backtrace_symbols_fd(stackTrace, numItems, STDERR_FILENO);
#endif
}
diff --git a/src/OverridesSettingsRepository.cpp b/src/OverridesSettingsRepository.cpp
new file mode 100644
index 000000000..e63f2c44c
--- /dev/null
+++ b/src/OverridesSettingsRepository.cpp
@@ -0,0 +1,273 @@
+
+#include "Globals.h"
+#include "OverridesSettingsRepository.h"
+
+cOverridesSettingsRepository::cOverridesSettingsRepository(std::unique_ptr<cSettingsRepositoryInterface> a_Main, std::unique_ptr<cSettingsRepositoryInterface> a_Overrides) :
+ m_Main(std::move(a_Main)),
+ m_Overrides(std::move(a_Overrides))
+{
+}
+
+
+
+
+
+bool cOverridesSettingsRepository::KeyExists(const AString a_keyName) const
+{
+ return m_Overrides->KeyExists(a_keyName) || m_Main->KeyExists(a_keyName);
+}
+
+
+
+
+bool cOverridesSettingsRepository::HasValue(const AString & a_KeyName, const AString & a_ValueName) const
+{
+ return m_Overrides->HasValue(a_KeyName, a_ValueName) || m_Main->HasValue(a_KeyName, a_ValueName);
+}
+
+
+
+
+
+int cOverridesSettingsRepository::AddKeyName(const AString & a_keyname)
+{
+
+ if (m_Overrides->KeyExists(a_keyname))
+ {
+ m_Overrides->AddKeyName(a_keyname);
+ return 0;
+ }
+
+ return m_Main->AddKeyName(a_keyname);
+}
+
+
+
+
+
+bool cOverridesSettingsRepository::AddKeyComment(const AString & a_keyname, const AString & a_comment)
+{
+ if (m_Overrides->KeyExists(a_keyname))
+ {
+ return m_Overrides->AddKeyComment(a_keyname, a_comment);
+ }
+
+ return m_Main->AddKeyComment(a_keyname, a_comment);
+}
+
+
+
+
+
+AString cOverridesSettingsRepository::GetKeyComment(const AString & a_keyname, const int a_commentID) const
+{
+
+ if (m_Overrides->KeyExists(a_keyname))
+ {
+ return m_Overrides->GetKeyComment(a_keyname, a_commentID);
+ }
+
+ return m_Main->GetKeyComment(a_keyname, a_commentID);
+}
+
+
+
+
+
+bool cOverridesSettingsRepository::DeleteKeyComment(const AString & a_keyname, const int a_commentID)
+{
+ if (m_Overrides->KeyExists(a_keyname))
+ {
+ return m_Overrides->DeleteKeyComment(a_keyname, a_commentID);
+ }
+
+ return m_Main->DeleteKeyComment(a_keyname, a_commentID);
+}
+
+
+
+
+
+void cOverridesSettingsRepository::AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value)
+{
+ if (m_Overrides->HasValue(a_KeyName, a_ValueName))
+ {
+ m_Overrides->AddValue(a_KeyName, a_ValueName, a_Value);
+ }
+ else
+ {
+ m_Main->AddValue(a_KeyName, a_ValueName, a_Value);
+ }
+}
+
+
+
+
+
+std::vector<std::pair<AString, AString>> cOverridesSettingsRepository::GetValues(AString a_keyName)
+{
+ auto overrides = m_Overrides->GetValues(a_keyName);
+ auto main = m_Main->GetValues(a_keyName);
+ std::sort(overrides.begin(), overrides.end(), [](std::pair<AString, AString> a, std::pair<AString, AString> b) -> bool { return a < b ;});
+ std::sort(main.begin(), main.end(), [](std::pair<AString, AString> a, std::pair<AString, AString> b) -> bool { return a < b ;});
+
+ std::vector<std::pair<AString, AString>> ret;
+
+
+ size_t overridesIndex = 0;
+ for (auto pair : main)
+ {
+ if (overridesIndex >= overrides.size())
+ {
+ ret.push_back(pair);
+ continue;
+ }
+ if (pair.first == overrides[overridesIndex].first)
+ {
+ continue;
+ }
+ while (pair.first > overrides[overridesIndex].first)
+ {
+ ret.push_back(overrides[overridesIndex]);
+ overridesIndex++;
+ }
+ ret.push_back(pair);
+ }
+ return ret;
+}
+
+
+
+
+
+AString cOverridesSettingsRepository::GetValue(const AString & a_KeyName, const AString & a_ValueName, const AString & defValue) const
+{
+ if (m_Overrides->HasValue(a_KeyName, a_ValueName))
+ {
+ return m_Overrides->GetValue(a_KeyName, a_ValueName, defValue);
+ }
+ else
+ {
+ return m_Main->GetValue(a_KeyName, a_ValueName, defValue);
+ }
+}
+
+
+
+
+
+AString cOverridesSettingsRepository::GetValueSet (const AString & a_KeyName, const AString & a_ValueName, const AString & defValue)
+{
+ if (m_Overrides->HasValue(a_KeyName, a_ValueName))
+ {
+ return m_Overrides->GetValueSet(a_KeyName, a_ValueName, defValue);
+ }
+ else
+ {
+ return m_Main->GetValueSet(a_KeyName, a_ValueName, defValue);
+ }
+}
+
+
+
+
+
+int cOverridesSettingsRepository::GetValueSetI(const AString & a_KeyName, const AString & a_ValueName, const int defValue)
+{
+ if (m_Overrides->HasValue(a_KeyName, a_ValueName))
+ {
+ return m_Overrides->GetValueSetI(a_KeyName, a_ValueName, defValue);
+ }
+ else
+ {
+ return m_Main->GetValueSetI(a_KeyName, a_ValueName, defValue);
+ }
+}
+
+
+
+
+
+Int64 cOverridesSettingsRepository::GetValueSetI(const AString & a_KeyName, const AString & a_ValueName, const Int64 defValue)
+{
+ if (m_Overrides->HasValue(a_KeyName, a_ValueName))
+ {
+ return m_Overrides->GetValueSetI(a_KeyName, a_ValueName, defValue);
+ }
+ else
+ {
+ return m_Main->GetValueSetI(a_KeyName, a_ValueName, defValue);
+ }
+}
+
+
+
+
+
+bool cOverridesSettingsRepository::GetValueSetB(const AString & a_KeyName, const AString & a_ValueName, const bool defValue)
+{
+ if (m_Overrides->HasValue(a_KeyName, a_ValueName))
+ {
+ return m_Overrides->GetValueSetB(a_KeyName, a_ValueName, defValue);
+ }
+ else
+ {
+ return m_Main->GetValueSetB(a_KeyName, a_ValueName, defValue);
+ }
+}
+
+
+
+
+
+bool cOverridesSettingsRepository::SetValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value, const bool a_CreateIfNotExists)
+{
+ if (m_Overrides->HasValue(a_KeyName, a_ValueName))
+ {
+ return m_Overrides->SetValue(a_KeyName, a_ValueName, a_Value, a_CreateIfNotExists);
+ }
+ else
+ {
+ return m_Main->SetValue(a_KeyName, a_ValueName, a_Value, a_CreateIfNotExists);
+ }
+}
+
+
+
+
+
+bool cOverridesSettingsRepository::SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists)
+{
+ if (m_Overrides->HasValue(a_KeyName, a_ValueName))
+ {
+ return m_Overrides->SetValueI(a_KeyName, a_ValueName, a_Value, a_CreateIfNotExists);
+ }
+ else
+ {
+ return m_Main->SetValueI(a_KeyName, a_ValueName, a_Value, a_CreateIfNotExists);
+ }
+}
+
+
+
+
+
+bool cOverridesSettingsRepository::DeleteValue(const AString & a_KeyName, const AString & a_ValueName)
+{
+ if (m_Overrides->HasValue(a_KeyName, a_ValueName))
+ {
+ return m_Overrides->DeleteValue(a_KeyName, a_ValueName);
+ }
+ else
+ {
+ return m_Main->DeleteValue(a_KeyName, a_ValueName);
+ }
+}
+
+
+
+bool cOverridesSettingsRepository::Flush()
+{
+ return m_Overrides->Flush() && m_Main->Flush();
+}
+
diff --git a/src/OverridesSettingsRepository.h b/src/OverridesSettingsRepository.h
new file mode 100644
index 000000000..04a53997f
--- /dev/null
+++ b/src/OverridesSettingsRepository.h
@@ -0,0 +1,52 @@
+
+#pragma once
+
+#include "SettingsRepositoryInterface.h"
+
+#include <unordered_map>
+
+class cOverridesSettingsRepository : public cSettingsRepositoryInterface
+{
+
+public:
+ cOverridesSettingsRepository(std::unique_ptr<cSettingsRepositoryInterface> a_Main, std::unique_ptr<cSettingsRepositoryInterface> a_Overrides);
+
+ virtual ~cOverridesSettingsRepository() = default;
+
+ virtual bool KeyExists(const AString keyname) const override;
+
+ virtual bool HasValue(const AString & a_KeyName, const AString & a_ValueName) const override;
+
+ virtual int AddKeyName(const AString & keyname) override;
+
+ virtual bool AddKeyComment(const AString & keyname, const AString & comment) override;
+
+ virtual AString GetKeyComment(const AString & keyname, const int commentID) const override;
+
+ virtual bool DeleteKeyComment(const AString & keyname, const int commentID) override;
+
+ virtual void AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value) override;
+
+ virtual std::vector<std::pair<AString, AString>> GetValues(AString a_keyName) override;
+
+ virtual AString GetValue (const AString & keyname, const AString & valuename, const AString & defValue = "") const override;
+
+ virtual AString GetValueSet (const AString & keyname, const AString & valuename, const AString & defValue = "") override;
+ virtual int GetValueSetI(const AString & keyname, const AString & valuename, const int defValue = 0) override;
+ virtual Int64 GetValueSetI(const AString & keyname, const AString & valuename, const Int64 defValue = 0) override;
+ virtual bool GetValueSetB(const AString & keyname, const AString & valuename, const bool defValue = false) override;
+
+ virtual bool SetValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value, const bool a_CreateIfNotExists = true) override;
+ virtual bool SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists = true) override;
+
+ virtual bool DeleteValue(const AString & keyname, const AString & valuename) override;
+
+ virtual bool Flush() override;
+
+private:
+
+ std::unique_ptr<cSettingsRepositoryInterface> m_Main;
+ std::unique_ptr<cSettingsRepositoryInterface> m_Overrides;
+
+};
+
diff --git a/src/PolarSSL++/BlockingSslClientSocket.cpp b/src/PolarSSL++/BlockingSslClientSocket.cpp
index 821125b31..a3c26f261 100644
--- a/src/PolarSSL++/BlockingSslClientSocket.cpp
+++ b/src/PolarSSL++/BlockingSslClientSocket.cpp
@@ -54,19 +54,19 @@ class cBlockingSslClientSocketLinkCallbacks:
}
- virtual void OnReceivedData(const char * a_Data, size_t a_Length)
+ virtual void OnReceivedData(const char * a_Data, size_t a_Length) override
{
m_Socket.OnReceivedData(a_Data, a_Length);
}
- virtual void OnRemoteClosed(void)
+ virtual void OnRemoteClosed(void) override
{
m_Socket.OnDisconnected();
}
- virtual void OnError(int a_ErrorCode, const AString & a_ErrorMsg)
+ virtual void OnError(int a_ErrorCode, const AString & a_ErrorMsg) override
{
m_Socket.OnDisconnected();
}
@@ -200,7 +200,7 @@ bool cBlockingSslClientSocket::Send(const void * a_Data, size_t a_NumBytes)
else
{
Data += res;
- NumBytes -= res;
+ NumBytes -= static_cast<size_t>(res);
if (NumBytes == 0)
{
return true;
diff --git a/src/PolarSSL++/BlockingSslClientSocket.h b/src/PolarSSL++/BlockingSslClientSocket.h
index 319e82bf2..462ee95a7 100644
--- a/src/PolarSSL++/BlockingSslClientSocket.h
+++ b/src/PolarSSL++/BlockingSslClientSocket.h
@@ -21,6 +21,11 @@ class cBlockingSslClientSocket :
{
public:
cBlockingSslClientSocket(void);
+
+ ~cBlockingSslClientSocket(void)
+ {
+ Disconnect();
+ }
/** Connects to the specified server and performs SSL handshake.
Returns true if successful, false on failure. Sets internal error text on failure. */
diff --git a/src/PolarSSL++/BufferedSslContext.cpp b/src/PolarSSL++/BufferedSslContext.cpp
index 9f7caeb8a..c8d4736f7 100644
--- a/src/PolarSSL++/BufferedSslContext.cpp
+++ b/src/PolarSSL++/BufferedSslContext.cpp
@@ -66,7 +66,7 @@ int cBufferedSslContext::ReceiveEncrypted(unsigned char * a_Buffer, size_t a_Num
return POLARSSL_ERR_NET_RECV_FAILED;
}
m_IncomingData.CommitRead();
- return (int)NumBytes;
+ return static_cast<int>(NumBytes);
}
@@ -81,11 +81,11 @@ int cBufferedSslContext::SendEncrypted(const unsigned char * a_Buffer, size_t a_
{
return POLARSSL_ERR_NET_WANT_WRITE;
}
- if (!m_OutgoingData.Write((const char *)a_Buffer, a_NumBytes))
+ if (!m_OutgoingData.Write(reinterpret_cast<const char *>(a_Buffer), a_NumBytes))
{
return POLARSSL_ERR_NET_SEND_FAILED;
}
- return (int)a_NumBytes;
+ return static_cast<int>(a_NumBytes);
}
diff --git a/src/PolarSSL++/CMakeLists.txt b/src/PolarSSL++/CMakeLists.txt
index b11d16e33..fddb37501 100644
--- a/src/PolarSSL++/CMakeLists.txt
+++ b/src/PolarSSL++/CMakeLists.txt
@@ -33,6 +33,10 @@ set(HDRS
X509Cert.h
)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(RsaPrivateKey.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+endif()
+
if(NOT MSVC)
add_library(PolarSSL++ ${SRCS} ${HDRS})
diff --git a/src/PolarSSL++/CryptoKey.cpp b/src/PolarSSL++/CryptoKey.cpp
index 9354ddf50..cc4eefdfe 100644
--- a/src/PolarSSL++/CryptoKey.cpp
+++ b/src/PolarSSL++/CryptoKey.cpp
@@ -77,7 +77,7 @@ int cCryptoKey::Decrypt(const Byte * a_EncryptedData, size_t a_EncryptedLength,
{
return res;
}
- return (int)DecryptedLen;
+ return static_cast<int>(DecryptedLen);
}
@@ -97,7 +97,7 @@ int cCryptoKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte * a
{
return res;
}
- return (int)EncryptedLength;
+ return static_cast<int>(EncryptedLength);
}
@@ -109,7 +109,7 @@ int cCryptoKey::ParsePublic(const void * a_Data, size_t a_NumBytes)
{
ASSERT(!IsValid()); // Cannot parse a second key
- return pk_parse_public_key(&m_Pk, (const unsigned char *)a_Data, a_NumBytes);
+ return pk_parse_public_key(&m_Pk, reinterpret_cast<const unsigned char *>(a_Data), a_NumBytes);
}
@@ -123,14 +123,14 @@ int cCryptoKey::ParsePrivate(const void * a_Data, size_t a_NumBytes, const AStri
if (a_Password.empty())
{
- return pk_parse_key(&m_Pk, (const unsigned char *)a_Data, a_NumBytes, nullptr, 0);
+ return pk_parse_key(&m_Pk, reinterpret_cast<const unsigned char *>(a_Data), a_NumBytes, nullptr, 0);
}
else
{
return pk_parse_key(
&m_Pk,
- (const unsigned char *)a_Data, a_NumBytes,
- (const unsigned char *)a_Password.c_str(), a_Password.size()
+ reinterpret_cast<const unsigned char *>(a_Data), a_NumBytes,
+ reinterpret_cast<const unsigned char *>(a_Password.c_str()), a_Password.size()
);
}
}
diff --git a/src/PolarSSL++/CtrDrbgContext.cpp b/src/PolarSSL++/CtrDrbgContext.cpp
index 86e6d1ca5..25c2987b1 100644
--- a/src/PolarSSL++/CtrDrbgContext.cpp
+++ b/src/PolarSSL++/CtrDrbgContext.cpp
@@ -39,7 +39,7 @@ int cCtrDrbgContext::Initialize(const void * a_Custom, size_t a_CustomSize)
return 0;
}
- int res = ctr_drbg_init(&m_CtrDrbg, entropy_func, &(m_EntropyContext->m_Entropy), (const unsigned char *)a_Custom, a_CustomSize);
+ int res = ctr_drbg_init(&m_CtrDrbg, entropy_func, &(m_EntropyContext->m_Entropy), reinterpret_cast<const unsigned char *>(a_Custom), a_CustomSize);
m_IsValid = (res == 0);
return res;
}
diff --git a/src/PolarSSL++/SslContext.cpp b/src/PolarSSL++/SslContext.cpp
index 5ac4bc227..1409405bc 100644
--- a/src/PolarSSL++/SslContext.cpp
+++ b/src/PolarSSL++/SslContext.cpp
@@ -172,7 +172,7 @@ int cSslContext::WritePlain(const void * a_Data, size_t a_NumBytes)
}
}
- return ssl_write(&m_Ssl, (const unsigned char *)a_Data, a_NumBytes);
+ return ssl_write(&m_Ssl, reinterpret_cast<const unsigned char *>(a_Data), a_NumBytes);
}
@@ -191,7 +191,7 @@ int cSslContext::ReadPlain(void * a_Data, size_t a_MaxBytes)
}
}
- return ssl_read(&m_Ssl, (unsigned char *)a_Data, a_MaxBytes);
+ return ssl_read(&m_Ssl, reinterpret_cast<unsigned char *>(a_Data), a_MaxBytes);
}
diff --git a/src/PolarSSL++/SslContext.h b/src/PolarSSL++/SslContext.h
index 6b4f2c1e7..408fc7c56 100644
--- a/src/PolarSSL++/SslContext.h
+++ b/src/PolarSSL++/SslContext.h
@@ -127,13 +127,13 @@ protected:
/** The callback used by PolarSSL when it wants to read encrypted data. */
static int ReceiveEncrypted(void * a_This, unsigned char * a_Buffer, size_t a_NumBytes)
{
- return ((cSslContext *)a_This)->ReceiveEncrypted(a_Buffer, a_NumBytes);
+ return (reinterpret_cast<cSslContext *>(a_This))->ReceiveEncrypted(a_Buffer, a_NumBytes);
}
/** The callback used by PolarSSL when it wants to write encrypted data. */
static int SendEncrypted(void * a_This, const unsigned char * a_Buffer, size_t a_NumBytes)
{
- return ((cSslContext *)a_This)->SendEncrypted(a_Buffer, a_NumBytes);
+ return (reinterpret_cast<cSslContext *>(a_This))->SendEncrypted(a_Buffer, a_NumBytes);
}
#ifdef _DEBUG
diff --git a/src/PolarSSL++/X509Cert.cpp b/src/PolarSSL++/X509Cert.cpp
index ecf664855..ed65639a5 100644
--- a/src/PolarSSL++/X509Cert.cpp
+++ b/src/PolarSSL++/X509Cert.cpp
@@ -30,7 +30,7 @@ cX509Cert::~cX509Cert()
int cX509Cert::Parse(const void * a_CertContents, size_t a_Size)
{
- return x509_crt_parse(&m_Cert, (const unsigned char *)a_CertContents, a_Size);
+ return x509_crt_parse(&m_Cert, reinterpret_cast<const unsigned char *>(a_CertContents), a_Size);
}
diff --git a/src/Protocol/Authenticator.cpp b/src/Protocol/Authenticator.cpp
index c9e4296a2..bfbe5028d 100644
--- a/src/Protocol/Authenticator.cpp
+++ b/src/Protocol/Authenticator.cpp
@@ -19,6 +19,10 @@
#define DEFAULT_AUTH_SERVER "sessionserver.mojang.com"
#define DEFAULT_AUTH_ADDRESS "/session/minecraft/hasJoined?username=%USERNAME%&serverId=%SERVERID%"
+
+
+
+
cAuthenticator::cAuthenticator(void) :
super("cAuthenticator"),
m_Server(DEFAULT_AUTH_SERVER),
@@ -40,11 +44,11 @@ cAuthenticator::~cAuthenticator()
-void cAuthenticator::ReadINI(cIniFile & IniFile)
+void cAuthenticator::ReadSettings(cSettingsRepositoryInterface & a_Settings)
{
- m_Server = IniFile.GetValueSet ("Authentication", "Server", DEFAULT_AUTH_SERVER);
- m_Address = IniFile.GetValueSet ("Authentication", "Address", DEFAULT_AUTH_ADDRESS);
- m_ShouldAuthenticate = IniFile.GetValueSetB("Authentication", "Authenticate", true);
+ m_Server = a_Settings.GetValueSet ("Authentication", "Server", DEFAULT_AUTH_SERVER);
+ m_Address = a_Settings.GetValueSet ("Authentication", "Address", DEFAULT_AUTH_ADDRESS);
+ m_ShouldAuthenticate = a_Settings.GetValueSetB("Authentication", "Authenticate", true);
}
@@ -69,9 +73,9 @@ void cAuthenticator::Authenticate(int a_ClientID, const AString & a_UserName, co
-void cAuthenticator::Start(cIniFile & IniFile)
+void cAuthenticator::Start(cSettingsRepositoryInterface & a_Settings)
{
- ReadINI(IniFile);
+ ReadSettings(a_Settings);
m_ShouldTerminate = false;
super::Start();
}
@@ -267,3 +271,7 @@ bool cAuthenticator::GetPlayerProperties(const AString & a_UUID, Json::Value & a
return true;
}
*/
+
+
+
+
diff --git a/src/Protocol/Authenticator.h b/src/Protocol/Authenticator.h
index 853eff535..02b349256 100644
--- a/src/Protocol/Authenticator.h
+++ b/src/Protocol/Authenticator.h
@@ -14,7 +14,7 @@
#include "../OSSupport/IsThread.h"
-
+class cSettingsRepositoryInterface;
@@ -40,13 +40,13 @@ public:
~cAuthenticator();
/** (Re-)read server and address from INI: */
- void ReadINI(cIniFile & IniFile);
+ void ReadSettings(cSettingsRepositoryInterface & a_Settings);
/** Queues a request for authenticating a user. If the auth fails, the user will be kicked */
void Authenticate(int a_ClientID, const AString & a_UserName, const AString & a_ServerHash);
/** Starts the authenticator thread. The thread may be started and stopped repeatedly */
- void Start(cIniFile & IniFile);
+ void Start(cSettingsRepositoryInterface & a_Settings);
/** Stops the authenticator thread. The thread may be started and stopped repeatedly */
void Stop(void);
diff --git a/src/Protocol/CMakeLists.txt b/src/Protocol/CMakeLists.txt
index c3a45ca47..42a7d5a9d 100644
--- a/src/Protocol/CMakeLists.txt
+++ b/src/Protocol/CMakeLists.txt
@@ -25,6 +25,15 @@ SET (HDRS
ProtocolRecognizer.h
)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(ChunkDataSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(MojangAPI.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(Packetizer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(Protocol18x.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast -Wno-error=sign-conversion -Wno-error=conversion -Wno-error=switch-enum -Wno-error=switch")
+ set_source_files_properties(Protocol17x.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum -Wno-error=old-style-cast")
+ set_source_files_properties(ProtocolRecognizer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+endif()
+
if (NOT MSVC)
add_library(Protocol ${SRCS} ${HDRS})
endif()
diff --git a/src/Protocol/ChunkDataSerializer.cpp b/src/Protocol/ChunkDataSerializer.cpp
index 2b9c06779..37fbae0e5 100644
--- a/src/Protocol/ChunkDataSerializer.cpp
+++ b/src/Protocol/ChunkDataSerializer.cpp
@@ -43,7 +43,6 @@ const AString & cChunkDataSerializer::Serialize(int a_Version, int a_ChunkX, int
AString data;
switch (a_Version)
{
- case RELEASE_1_2_5: Serialize29(data); break;
case RELEASE_1_3_2: Serialize39(data); break;
case RELEASE_1_8_0: Serialize47(data, a_ChunkX, a_ChunkZ); break;
// TODO: Other protocol versions may serialize the data differently; implement here
@@ -65,65 +64,6 @@ const AString & cChunkDataSerializer::Serialize(int a_Version, int a_ChunkX, int
-
-void cChunkDataSerializer::Serialize29(AString & a_Data)
-{
- // TODO: Do not copy data and then compress it; rather, compress partial blocks of data (zlib can stream)
-
- const int BiomeDataSize = cChunkDef::Width * cChunkDef::Width;
- const int MetadataOffset = sizeof(m_BlockTypes);
- const int BlockLightOffset = MetadataOffset + sizeof(m_BlockMetas);
- const int SkyLightOffset = BlockLightOffset + sizeof(m_BlockLight);
- const int BiomeOffset = SkyLightOffset + sizeof(m_BlockSkyLight);
- const int DataSize = BiomeOffset + BiomeDataSize;
-
- // Temporary buffer for the composed data:
- char AllData [DataSize];
-
- memcpy(AllData, m_BlockTypes, sizeof(m_BlockTypes));
- memcpy(AllData + MetadataOffset, m_BlockMetas, sizeof(m_BlockMetas));
- memcpy(AllData + BlockLightOffset, m_BlockLight, sizeof(m_BlockLight));
- memcpy(AllData + SkyLightOffset, m_BlockSkyLight, sizeof(m_BlockSkyLight));
- memcpy(AllData + BiomeOffset, m_BiomeData, BiomeDataSize);
-
- // Compress the data:
- // In order not to use allocation, use a fixed-size buffer, with the size
- // that uses the same calculation as compressBound():
- const uLongf CompressedMaxSize = DataSize + (DataSize >> 12) + (DataSize >> 14) + (DataSize >> 25) + 16;
- char CompressedBlockData[CompressedMaxSize];
-
- uLongf CompressedSize = compressBound(DataSize);
-
- // Run-time check that our compile-time guess about CompressedMaxSize was enough:
- ASSERT(CompressedSize <= CompressedMaxSize);
-
- compress2((Bytef*)CompressedBlockData, &CompressedSize, (const Bytef*)AllData, sizeof(AllData), Z_DEFAULT_COMPRESSION);
-
- // Now put all those data into a_Data:
-
- // "Ground-up continuous", or rather, "biome data present" flag:
- a_Data.push_back('\x01');
-
- // Two bitmaps; we're aways sending the full chunk with no additional data, so the bitmaps are 0xffff and 0, respectively
- // Also, no endian flipping is needed because of the const values
- unsigned short BitMap1 = 0xffff;
- unsigned short BitMap2 = 0;
- a_Data.append((const char *)&BitMap1, sizeof(short));
- a_Data.append((const char *)&BitMap2, sizeof(short));
-
- UInt32 CompressedSizeBE = htonl((UInt32)CompressedSize);
- a_Data.append((const char *)&CompressedSizeBE, sizeof(CompressedSizeBE));
-
- Int32 UnusedInt32 = 0;
- a_Data.append((const char *)&UnusedInt32, sizeof(UnusedInt32));
-
- a_Data.append(CompressedBlockData, CompressedSize);
-}
-
-
-
-
-
void cChunkDataSerializer::Serialize39(AString & a_Data)
{
// TODO: Do not copy data and then compress it; rather, compress partial blocks of data (zlib can stream)
diff --git a/src/Protocol/ChunkDataSerializer.h b/src/Protocol/ChunkDataSerializer.h
index a082ef3d8..6acc1544b 100644
--- a/src/Protocol/ChunkDataSerializer.h
+++ b/src/Protocol/ChunkDataSerializer.h
@@ -22,14 +22,12 @@ protected:
Serializations m_Serializations;
- void Serialize29(AString & a_Data); // Release 1.2.4 and 1.2.5
void Serialize39(AString & a_Data); // Release 1.3.1 to 1.7.10
void Serialize47(AString & a_Data, int a_ChunkX, int a_ChunkZ); // Release 1.8
public:
enum
{
- RELEASE_1_2_5 = 29,
RELEASE_1_3_2 = 39,
RELEASE_1_8_0 = 47,
} ;
diff --git a/src/Protocol/MojangAPI.cpp b/src/Protocol/MojangAPI.cpp
index 0d1441500..110590359 100644
--- a/src/Protocol/MojangAPI.cpp
+++ b/src/Protocol/MojangAPI.cpp
@@ -38,12 +38,36 @@ const int MAX_PER_QUERY = 100;
-/** This is the data of the root certs for Starfield Technologies, the CA that signed sessionserver.mojang.com's cert:
-Downloaded from http://certs.starfieldtech.com/repository/ */
-static const AString & StarfieldCACert(void)
+/** Returns the CA certificates that should be trusted for Mojang-related connections. */
+static const AString & GetCACerts(void)
{
static const AString Cert(
- // G2 cert
+ // Equifax root CA cert
+ // Currently used for signing *.mojang.com's cert
+ // Exported from Mozilla Firefox's built-in CA repository
+ "-----BEGIN CERTIFICATE-----\n"
+ "MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV\n"
+ "UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy\n"
+ "dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1\n"
+ "MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx\n"
+ "dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B\n"
+ "AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f\n"
+ "BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A\n"
+ "cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC\n"
+ "AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ\n"
+ "MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm\n"
+ "aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw\n"
+ "ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj\n"
+ "IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF\n"
+ "MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA\n"
+ "A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y\n"
+ "7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh\n"
+ "1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4\n"
+ "-----END CERTIFICATE-----\n\n"
+
+ // Starfield G2 cert
+ // This is the data of the root certs for Starfield Technologies, the CA that used to sign sessionserver.mojang.com's cert
+ // Downloaded from http://certs.starfieldtech.com/repository/
"-----BEGIN CERTIFICATE-----\n"
"MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx\n"
"EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT\n"
@@ -67,7 +91,8 @@ static const AString & StarfieldCACert(void)
"pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1\n"
"mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0\n"
"-----END CERTIFICATE-----\n\n"
- // Original (G1) cert:
+
+ // Starfield original (G1) cert:
"-----BEGIN CERTIFICATE-----\n"
"MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl\n"
"MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp\n"
@@ -226,12 +251,12 @@ cMojangAPI::~cMojangAPI()
-void cMojangAPI::Start(cIniFile & a_SettingsIni, bool a_ShouldAuth)
+void cMojangAPI::Start(cSettingsRepositoryInterface & a_Settings, bool a_ShouldAuth)
{
- m_NameToUUIDServer = a_SettingsIni.GetValueSet("MojangAPI", "NameToUUIDServer", DEFAULT_NAME_TO_UUID_SERVER);
- m_NameToUUIDAddress = a_SettingsIni.GetValueSet("MojangAPI", "NameToUUIDAddress", DEFAULT_NAME_TO_UUID_ADDRESS);
- m_UUIDToProfileServer = a_SettingsIni.GetValueSet("MojangAPI", "UUIDToProfileServer", DEFAULT_UUID_TO_PROFILE_SERVER);
- m_UUIDToProfileAddress = a_SettingsIni.GetValueSet("MojangAPI", "UUIDToProfileAddress", DEFAULT_UUID_TO_PROFILE_ADDRESS);
+ m_NameToUUIDServer = a_Settings.GetValueSet("MojangAPI", "NameToUUIDServer", DEFAULT_NAME_TO_UUID_SERVER);
+ m_NameToUUIDAddress = a_Settings.GetValueSet("MojangAPI", "NameToUUIDAddress", DEFAULT_NAME_TO_UUID_ADDRESS);
+ m_UUIDToProfileServer = a_Settings.GetValueSet("MojangAPI", "UUIDToProfileServer", DEFAULT_UUID_TO_PROFILE_SERVER);
+ m_UUIDToProfileAddress = a_Settings.GetValueSet("MojangAPI", "UUIDToProfileAddress", DEFAULT_UUID_TO_PROFILE_ADDRESS);
LoadCachesFromDisk();
if (a_ShouldAuth)
{
@@ -390,7 +415,7 @@ bool cMojangAPI::SecureRequest(const AString & a_ServerName, const AString & a_R
{
// Connect the socket:
cBlockingSslClientSocket Socket;
- Socket.SetTrustedRootCertsFromString(StarfieldCACert(), a_ServerName);
+ Socket.SetTrustedRootCertsFromString(GetCACerts(), a_ServerName);
if (!Socket.Connect(a_ServerName, 443))
{
LOGWARNING("%s: Can't connect to %s: %s", __FUNCTION__, a_ServerName.c_str(), Socket.GetLastErrorText().c_str());
@@ -434,7 +459,6 @@ bool cMojangAPI::SecureRequest(const AString & a_ServerName, const AString & a_R
a_Response.append((const char *)buf, (size_t)ret);
}
- Socket.Disconnect();
return true;
}
diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h
index 0dc2617b6..bea950740 100644
--- a/src/Protocol/MojangAPI.h
+++ b/src/Protocol/MojangAPI.h
@@ -25,7 +25,7 @@ namespace Json
-
+class cSettingsRepositoryInterface;
// tolua_begin
class cMojangAPI
@@ -38,7 +38,7 @@ public:
/** Initializes the API; reads the settings from the specified ini file.
Loads cached results from disk. */
- void Start(cIniFile & a_SettingsIni, bool a_ShouldAuth);
+ void Start(cSettingsRepositoryInterface & a_Settings, bool a_ShouldAuth);
/** Connects to the specified server using SSL, sends the given request and receives the response.
Checks Mojang certificates using the hard-coded Starfield root CA certificate.
diff --git a/src/Protocol/Packetizer.h b/src/Protocol/Packetizer.h
index 7f5e9c2c3..efed9c7a9 100644
--- a/src/Protocol/Packetizer.h
+++ b/src/Protocol/Packetizer.h
@@ -58,7 +58,7 @@ public:
}
- inline void WriteBEUInt16(short a_Value)
+ inline void WriteBEUInt16(UInt16 a_Value)
{
VERIFY(m_Out.WriteBEUInt16(a_Value));
}
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index 3bca7551b..1a19249bf 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -70,6 +70,12 @@ public:
virtual void SendBlockChanges (int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes) = 0;
virtual void SendChat (const AString & a_Message) = 0;
virtual void SendChat (const cCompositeChat & a_Message) = 0;
+ virtual void SendChatAboveActionBar (const AString & a_Message) = 0;
+ virtual void SendChatAboveActionBar (const cCompositeChat & a_Message) = 0;
+ virtual void SendChatSystem (const AString & a_Message) = 0;
+ virtual void SendChatSystem (const cCompositeChat & a_Message) = 0;
+ virtual void SendChatType (const AString & a_Message, eChatType type) = 0;
+ virtual void SendChatType (const cCompositeChat & a_Message, eChatType type) = 0;
virtual void SendChunkData (int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer) = 0;
virtual void SendCollectEntity (const cEntity & a_Entity, const cPlayer & a_Player) = 0;
virtual void SendDestroyEntity (const cEntity & a_Entity) = 0;
@@ -88,6 +94,7 @@ public:
virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion) = 0;
virtual void SendGameMode (eGameMode a_GameMode) = 0;
virtual void SendHealth (void) = 0;
+ virtual void SendHideTitle (void) = 0;
virtual void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item) = 0;
virtual void SendKeepAlive (int a_PingID) = 0;
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) = 0;
@@ -112,12 +119,17 @@ public:
virtual void SendPlayerSpawn (const cPlayer & a_Player) = 0;
virtual void SendPluginMessage (const AString & a_Channel, const AString & a_Message) = 0;
virtual void SendRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID) = 0;
+ virtual void SendResetTitle (void) = 0;
virtual void SendRespawn (eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks) = 0;
virtual void SendExperience (void) = 0;
virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) = 0;
virtual void SendScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode) = 0;
virtual void SendScoreUpdate (const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode) = 0;
virtual void SendDisplayObjective (const AString & a_Objective, cScoreboard::eDisplaySlot a_Display) = 0;
+ virtual void SendSetSubTitle (const cCompositeChat & a_SubTitle) = 0;
+ virtual void SendSetRawSubTitle (const AString & a_SubTitle) = 0;
+ virtual void SendSetTitle (const cCompositeChat & a_Title) = 0;
+ virtual void SendSetRawTitle (const AString & a_Title) = 0;
virtual void SendSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch) = 0;
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) = 0;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) = 0;
@@ -128,6 +140,7 @@ public:
virtual void SendTabCompletionResults (const AStringVector & a_Results) = 0;
virtual void SendTeleportEntity (const cEntity & a_Entity) = 0;
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) = 0;
+ virtual void SendTitleTimes (int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks) = 0;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle) = 0;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) = 0;
virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) = 0;
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 799c021f3..c5c0f4a03 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -247,8 +247,67 @@ void cProtocol172::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockV
void cProtocol172::SendChat(const AString & a_Message)
{
+ this->SendChatType(a_Message, ctChatBox);
+}
+
+
+
+
+
+void cProtocol172::SendChat(const cCompositeChat & a_Message)
+{
+ this->SendChatType(a_Message, ctChatBox);
+}
+
+
+
+
+
+void cProtocol172::SendChatSystem(const AString & a_Message)
+{
+ this->SendChatType(a_Message, ctSystem);
+}
+
+
+
+
+
+void cProtocol172::SendChatSystem(const cCompositeChat & a_Message)
+{
+ this->SendChatType(a_Message, ctSystem);
+}
+
+
+
+
+
+void cProtocol172::SendChatAboveActionBar(const AString & a_Message)
+{
+ this->SendChatType(a_Message, ctAboveActionBar);
+}
+
+
+
+
+
+void cProtocol172::SendChatAboveActionBar(const cCompositeChat & a_Message)
+{
+ this->SendChatType(a_Message, ctAboveActionBar);
+}
+
+
+
+
+
+void cProtocol172::SendChatType(const AString & a_Message, eChatType type)
+{
ASSERT(m_State == 3); // In game mode?
-
+
+ if (type != ctChatBox) // 1.7.2 doesn't support anything else
+ {
+ return;
+ }
+
cPacketizer Pkt(*this, 0x02); // Chat Message packet
Pkt.WriteString(Printf("{\"text\":\"%s\"}", EscapeString(a_Message).c_str()));
}
@@ -257,10 +316,15 @@ void cProtocol172::SendChat(const AString & a_Message)
-void cProtocol172::SendChat(const cCompositeChat & a_Message)
+void cProtocol172::SendChatType(const cCompositeChat & a_Message, eChatType type)
{
ASSERT(m_State == 3); // In game mode?
+ if (type != ctChatBox) // 1.7.2 doesn't support anything else
+ {
+ return;
+ }
+
cWorld * World = m_Client->GetPlayer()->GetWorld();
bool ShouldUseChatPrefixes = (World == nullptr) ? false : World->ShouldUseChatPrefixes();
@@ -555,6 +619,15 @@ void cProtocol172::SendHealth(void)
+void cProtocol172::SendHideTitle(void)
+{
+ // Not implemented in this protocol version
+}
+
+
+
+
+
void cProtocol172::SendInventorySlot(char a_WindowID, short a_SlotNum, const cItem & a_Item)
{
ASSERT(m_State == 3); // In game mode?
@@ -995,6 +1068,15 @@ void cProtocol172::SendRemoveEntityEffect(const cEntity & a_Entity, int a_Effect
+void cProtocol172::SendResetTitle(void)
+{
+ // Not implemented in this protocol version
+}
+
+
+
+
+
void cProtocol172::SendRespawn(eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks)
{
if ((m_LastSentDimension == a_Dimension) && !a_ShouldIgnoreDimensionChecks)
@@ -1023,8 +1105,8 @@ void cProtocol172::SendExperience (void)
cPacketizer Pkt(*this, 0x1f); // Experience Packet
cPlayer * Player = m_Client->GetPlayer();
Pkt.WriteBEFloat(Player->GetXpPercentage());
- Pkt.WriteBEInt16(static_cast<UInt16>(std::max<int>(Player->GetXpLevel(), std::numeric_limits<UInt16>::max())));
- Pkt.WriteBEInt16(static_cast<UInt16>(std::max<int>(Player->GetCurrentXp(), std::numeric_limits<UInt16>::max())));
+ Pkt.WriteBEInt16(static_cast<Int16>(std::min<int>(Player->GetXpLevel(), std::numeric_limits<Int16>::max())));
+ Pkt.WriteBEInt16(static_cast<Int16>(std::min<int>(Player->GetCurrentXp(), std::numeric_limits<Int16>::max())));
}
@@ -1094,6 +1176,42 @@ void cProtocol172::SendDisplayObjective(const AString & a_Objective, cScoreboard
+void cProtocol172::SendSetSubTitle(const cCompositeChat & a_SubTitle)
+{
+ // Not implemented in this protocol version
+}
+
+
+
+
+
+void cProtocol172::SendSetRawSubTitle(const AString & a_SubTitle)
+{
+ // Not implemented in this protocol version
+}
+
+
+
+
+
+void cProtocol172::SendSetTitle(const cCompositeChat & a_Title)
+{
+ // Not implemented in this protocol version
+}
+
+
+
+
+
+void cProtocol172::SendSetRawTitle(const AString & a_Title)
+{
+ // Not implemented in this protocol version
+}
+
+
+
+
+
void cProtocol172::SendSoundEffect(const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch)
{
ASSERT(m_State == 3); // In game mode?
@@ -1296,6 +1414,15 @@ void cProtocol172::SendThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ)
+void cProtocol172::SendTitleTimes(int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks)
+{
+ // Not implemented in this protocol version
+}
+
+
+
+
+
void cProtocol172::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle)
{
ASSERT(m_State == 3); // In game mode?
@@ -2247,7 +2374,7 @@ void cProtocol172::HandlePacketWindowClick(cByteBuffer & a_ByteBuffer)
case 0x0206: Action = caNumber7; break;
case 0x0207: Action = caNumber8; break;
case 0x0208: Action = caNumber9; break;
- case 0x0300: Action = caMiddleClick; break;
+ case 0x0302: Action = caMiddleClick; break;
case 0x0400: Action = (SlotNum == SLOT_NUM_OUTSIDE) ? caLeftClickOutsideHoldNothing : caDropKey; break;
case 0x0401: Action = (SlotNum == SLOT_NUM_OUTSIDE) ? caRightClickOutsideHoldNothing : caCtrlDropKey; break;
case 0x0500: Action = (SlotNum == SLOT_NUM_OUTSIDE) ? caLeftPaintBegin : caUnknown; break;
diff --git a/src/Protocol/Protocol17x.h b/src/Protocol/Protocol17x.h
index 773c39f87..b07fa9ed9 100644
--- a/src/Protocol/Protocol17x.h
+++ b/src/Protocol/Protocol17x.h
@@ -68,6 +68,12 @@ public:
virtual void SendBlockChanges (int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes) override;
virtual void SendChat (const AString & a_Message) override;
virtual void SendChat (const cCompositeChat & a_Message) override;
+ virtual void SendChatAboveActionBar (const AString & a_Message) override;
+ virtual void SendChatAboveActionBar (const cCompositeChat & a_Message) override;
+ virtual void SendChatSystem (const AString & a_Message) override;
+ virtual void SendChatSystem (const cCompositeChat & a_Message) override;
+ virtual void SendChatType (const AString & a_Message, eChatType type) override;
+ virtual void SendChatType (const cCompositeChat & a_Message, eChatType type) override;
virtual void SendChunkData (int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer) override;
virtual void SendCollectEntity (const cEntity & a_Entity, const cPlayer & a_Player) override;
virtual void SendDestroyEntity (const cEntity & a_Entity) override;
@@ -90,6 +96,7 @@ public:
virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion) override;
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;
+ virtual void SendHideTitle (void) override;
virtual void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item) override;
virtual void SendKeepAlive (int a_PingID) override;
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) override;
@@ -113,9 +120,14 @@ public:
virtual void SendPlayerSpawn (const cPlayer & a_Player) override;
virtual void SendPluginMessage (const AString & a_Channel, const AString & a_Message) override;
virtual void SendRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID) override;
+ virtual void SendResetTitle (void) override;
virtual void SendRespawn (eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks) override;
virtual void SendScoreUpdate (const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode) override;
virtual void SendScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode) override;
+ virtual void SendSetSubTitle (const cCompositeChat & a_SubTitle) override;
+ virtual void SendSetRawSubTitle (const AString & a_SubTitle) override;
+ virtual void SendSetTitle (const cCompositeChat & a_Title) override;
+ virtual void SendSetRawTitle (const AString & a_Title) override;
virtual void SendSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch) override;
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
@@ -126,6 +138,7 @@ public:
virtual void SendTabCompletionResults (const AStringVector & a_Results) override;
virtual void SendTeleportEntity (const cEntity & a_Entity) override;
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
+ virtual void SendTitleTimes (int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) override;
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 17faca27e..4708d67c9 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -51,7 +51,7 @@ Implements the 1.8.x protocol classes:
/** The slot number that the client uses to indicate "outside the window". */
-static const Int16 SLOT_NUM_OUTSIDE = -1;
+static const Int16 SLOT_NUM_OUTSIDE = -999;
@@ -234,18 +234,72 @@ void cProtocol180::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockV
void cProtocol180::SendChat(const AString & a_Message)
{
+ this->SendChatType(a_Message, ctChatBox);
+}
+
+
+
+
+
+void cProtocol180::SendChat(const cCompositeChat & a_Message)
+{
+ this->SendChatType(a_Message, ctChatBox);
+}
+
+
+
+
+
+void cProtocol180::SendChatSystem(const AString & a_Message)
+{
+ this->SendChatType(a_Message, ctSystem);
+}
+
+
+
+
+
+void cProtocol180::SendChatSystem(const cCompositeChat & a_Message)
+{
+ this->SendChatType(a_Message, ctSystem);
+}
+
+
+
+
+
+void cProtocol180::SendChatAboveActionBar(const AString & a_Message)
+{
+ this->SendChatType(a_Message, ctAboveActionBar);
+}
+
+
+
+
+
+void cProtocol180::SendChatAboveActionBar(const cCompositeChat & a_Message)
+{
+ this->SendChatType(a_Message, ctAboveActionBar);
+}
+
+
+
+
+
+void cProtocol180::SendChatType(const AString & a_Message, eChatType type)
+{
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x02); // Chat Message packet
Pkt.WriteString(Printf("{\"text\":\"%s\"}", EscapeString(a_Message).c_str()));
- Pkt.WriteBEInt8(0);
+ Pkt.WriteBEInt8(type);
}
-void cProtocol180::SendChat(const cCompositeChat & a_Message)
+void cProtocol180::SendChatType(const cCompositeChat & a_Message, eChatType type)
{
ASSERT(m_State == 3); // In game mode?
@@ -255,7 +309,7 @@ void cProtocol180::SendChat(const cCompositeChat & a_Message)
// Send the message to the client:
cPacketizer Pkt(*this, 0x02);
Pkt.WriteString(a_Message.CreateJsonString(ShouldUseChatPrefixes));
- Pkt.WriteBEInt8(0);
+ Pkt.WriteBEInt8(type);
}
@@ -542,6 +596,18 @@ void cProtocol180::SendHealth(void)
+void cProtocol180::SendHideTitle(void)
+{
+ ASSERT(m_State == 3); // In game mode?
+
+ cPacketizer Pkt(*this, 0x45); // Title packet
+ Pkt.WriteVarInt32(3); // Hide title
+}
+
+
+
+
+
void cProtocol180::SendInventorySlot(char a_WindowID, short a_SlotNum, const cItem & a_Item)
{
ASSERT(m_State == 3); // In game mode?
@@ -681,7 +747,7 @@ void cProtocol180::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decor
cPacketizer Pkt(*this, 0x34);
Pkt.WriteVarInt32(a_ID);
Pkt.WriteBEUInt8(m_Scale);
- Pkt.WriteVarInt32(a_Decorators.size());
+ Pkt.WriteVarInt32(static_cast<UInt32>(a_Decorators.size()));
for (cMapDecoratorList::const_iterator it = a_Decorators.begin(); it != a_Decorators.end(); ++it)
{
@@ -1065,6 +1131,18 @@ void cProtocol180::SendRemoveEntityEffect(const cEntity & a_Entity, int a_Effect
+void cProtocol180::SendResetTitle(void)
+{
+ ASSERT(m_State == 3); // In game mode?
+
+ cPacketizer Pkt(*this, 0x45); // Title packet
+ Pkt.WriteVarInt32(4); // Reset title
+}
+
+
+
+
+
void cProtocol180::SendRespawn(eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks)
{
if ((m_LastSentDimension == a_Dimension) && !a_ShouldIgnoreDimensionChecks)
@@ -1167,6 +1245,52 @@ void cProtocol180::SendDisplayObjective(const AString & a_Objective, cScoreboard
+void cProtocol180::SendSetSubTitle(const cCompositeChat & a_SubTitle)
+{
+ SendSetRawSubTitle(a_SubTitle.CreateJsonString(false));
+}
+
+
+
+
+
+void cProtocol180::SendSetRawSubTitle(const AString & a_SubTitle)
+{
+ ASSERT(m_State == 3); // In game mode?
+
+ cPacketizer Pkt(*this, 0x45); // Title packet
+ Pkt.WriteVarInt32(1); // Set subtitle
+
+ Pkt.WriteString(a_SubTitle);
+}
+
+
+
+
+
+void cProtocol180::SendSetTitle(const cCompositeChat & a_Title)
+{
+ SendSetRawTitle(a_Title.CreateJsonString(false));
+}
+
+
+
+
+
+void cProtocol180::SendSetRawTitle(const AString & a_Title)
+{
+ ASSERT(m_State == 3); // In game mode?
+
+ cPacketizer Pkt(*this, 0x45); // Title packet
+ Pkt.WriteVarInt32(0); // Set title
+
+ Pkt.WriteString(a_Title);
+}
+
+
+
+
+
void cProtocol180::SendSoundEffect(const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch)
{
ASSERT(m_State == 3); // In game mode?
@@ -1374,6 +1498,22 @@ void cProtocol180::SendThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ)
+void cProtocol180::SendTitleTimes(int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks)
+{
+ ASSERT(m_State == 3); // In game mode?
+
+ cPacketizer Pkt(*this, 0x45); // Title packet
+ Pkt.WriteVarInt32(2); // Set title display times
+
+ Pkt.WriteBEInt32(a_FadeInTicks);
+ Pkt.WriteBEInt32(a_DisplayTicks);
+ Pkt.WriteBEInt32(a_FadeOutTicks);
+}
+
+
+
+
+
void cProtocol180::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle)
{
ASSERT(m_State == 3); // In game mode?
@@ -1575,7 +1715,7 @@ bool cProtocol180::CompressPacket(const AString & a_Packet, AString & a_Compress
// Compress the data:
char CompressedData[MAX_COMPRESSED_PACKET_LEN];
- uLongf CompressedSize = compressBound(a_Packet.size());
+ uLongf CompressedSize = compressBound(static_cast<uLongf>(a_Packet.size()));
if (CompressedSize >= MAX_COMPRESSED_PACKET_LEN)
{
ASSERT(!"Too high packet size.");
@@ -1584,7 +1724,7 @@ bool cProtocol180::CompressPacket(const AString & a_Packet, AString & a_Compress
int Status = compress2(
reinterpret_cast<Bytef *>(CompressedData), &CompressedSize,
- reinterpret_cast<const Bytef *>(a_Packet.data()), a_Packet.size(), Z_DEFAULT_COMPRESSION
+ reinterpret_cast<const Bytef *>(a_Packet.data()), static_cast<uLongf>(a_Packet.size()), Z_DEFAULT_COMPRESSION
);
if (Status != Z_OK)
{
@@ -1597,7 +1737,7 @@ bool cProtocol180::CompressPacket(const AString & a_Packet, AString & a_Compress
Buffer.ReadAll(LengthData);
Buffer.CommitRead();
- Buffer.WriteVarInt32(CompressedSize + LengthData.size());
+ Buffer.WriteVarInt32(static_cast<UInt32>(CompressedSize + LengthData.size()));
Buffer.WriteVarInt32(static_cast<UInt32>(a_Packet.size()));
Buffer.ReadAll(LengthData);
Buffer.CommitRead();
@@ -1770,7 +1910,7 @@ void cProtocol180::AddReceivedData(const char * a_Data, size_t a_Size)
AString UncompressedData;
if (m_State == 3)
{
- UInt32 NumBytesRead = m_ReceivedData.GetReadableSpace();
+ UInt32 NumBytesRead = static_cast<UInt32>(m_ReceivedData.GetReadableSpace());
m_ReceivedData.ReadVarInt(CompressedSize);
if (CompressedSize > PacketLen)
{
@@ -1781,17 +1921,16 @@ void cProtocol180::AddReceivedData(const char * a_Data, size_t a_Size)
{
// Decompress the data:
AString CompressedData;
- if (!m_ReceivedData.ReadString(CompressedData, CompressedSize))
+ if (!m_ReceivedData.ReadString(CompressedData, CompressedSize) || (InflateString(CompressedData.data(), CompressedSize, UncompressedData) != Z_OK))
{
m_Client->Kick("Compression failure");
return;
}
- InflateString(CompressedData.data(), CompressedSize, UncompressedData);
- PacketLen = UncompressedData.size();
+ PacketLen = static_cast<UInt32>(UncompressedData.size());
}
else
{
- NumBytesRead -= m_ReceivedData.GetReadableSpace(); // How many bytes has the CompressedSize taken up?
+ NumBytesRead -= static_cast<UInt32>(m_ReceivedData.GetReadableSpace()); // How many bytes has the CompressedSize taken up?
ASSERT(PacketLen > NumBytesRead);
PacketLen -= NumBytesRead;
}
@@ -2265,7 +2404,7 @@ void cProtocol180::HandlePacketCreativeInventoryAction(cByteBuffer & a_ByteBuffe
{
return;
}
- m_Client->HandleCreativeInventory(SlotNum, Item, (SlotNum == SLOT_NUM_OUTSIDE) ? caLeftClickOutside : caLeftClick);
+ m_Client->HandleCreativeInventory(SlotNum, Item, (SlotNum == -1) ? caLeftClickOutside : caLeftClick);
}
@@ -2553,7 +2692,7 @@ void cProtocol180::HandlePacketWindowClick(cByteBuffer & a_ByteBuffer)
case 0x0206: Action = caNumber7; break;
case 0x0207: Action = caNumber8; break;
case 0x0208: Action = caNumber9; break;
- case 0x0300: Action = caMiddleClick; break;
+ case 0x0302: Action = caMiddleClick; break;
case 0x0400: Action = (SlotNum == SLOT_NUM_OUTSIDE) ? caLeftClickOutsideHoldNothing : caDropKey; break;
case 0x0401: Action = (SlotNum == SLOT_NUM_OUTSIDE) ? caRightClickOutsideHoldNothing : caCtrlDropKey; break;
case 0x0500: Action = (SlotNum == SLOT_NUM_OUTSIDE) ? caLeftPaintBegin : caUnknown; break;
@@ -3202,7 +3341,7 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
a_Pkt.WriteBEUInt8(Bat.IsHanging() ? 1 : 0);
break;
} // case mtBat
-
+
case mtCreeper:
{
auto & Creeper = reinterpret_cast<const cCreeper &>(a_Mob);
@@ -3212,7 +3351,7 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
a_Pkt.WriteBEUInt8(Creeper.IsCharged() ? 1 : 0);
break;
} // case mtCreeper
-
+
case mtEnderman:
{
auto & Enderman = reinterpret_cast<const cEnderman &>(a_Mob);
@@ -3224,7 +3363,7 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
a_Pkt.WriteBEUInt8(Enderman.IsScreaming() ? 1 : 0);
break;
} // case mtEnderman
-
+
case mtGhast:
{
auto & Ghast = reinterpret_cast<const cGhast &>(a_Mob);
@@ -3232,7 +3371,7 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
a_Pkt.WriteBEUInt8(Ghast.IsCharging());
break;
} // case mtGhast
-
+
case mtHorse:
{
auto & Horse = reinterpret_cast<const cHorse &>(a_Mob);
@@ -3249,10 +3388,6 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
{
Flags |= 0x08;
}
- if (Horse.IsBaby())
- {
- Flags |= 0x10;
- }
if (Horse.IsEating())
{
Flags |= 0x20;
@@ -3276,6 +3411,9 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
a_Pkt.WriteBEInt32(Appearance);
a_Pkt.WriteBEUInt8(0x56); // Int at index 22
a_Pkt.WriteBEInt32(Horse.GetHorseArmour());
+
+ a_Pkt.WriteBEUInt8(0x0c);
+ a_Pkt.WriteBEInt8(Horse.GetAge());
break;
} // case mtHorse
@@ -3287,17 +3425,38 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
break;
} // case mtMagmaCube
+ case mtOcelot:
+ {
+ auto & Ocelot = reinterpret_cast<const cOcelot &>(a_Mob);
+ a_Pkt.WriteBEUInt8(0x0c);
+ a_Pkt.WriteBEInt8(Ocelot.GetAge());
+ break;
+ } // case mtOcelot
+
case mtPig:
{
auto & Pig = reinterpret_cast<const cPig &>(a_Mob);
+ a_Pkt.WriteBEUInt8(0x0c);
+ a_Pkt.WriteBEInt8(Pig.GetAge());
a_Pkt.WriteBEUInt8(0x10);
a_Pkt.WriteBEUInt8(Pig.IsSaddled() ? 1 : 0);
break;
} // case mtPig
-
+
+ case mtRabbit:
+ {
+ auto & Rabbit = reinterpret_cast<const cRabbit &>(a_Mob);
+ a_Pkt.WriteBEUInt8(0x0c);
+ a_Pkt.WriteBEInt8(Rabbit.GetAge());
+ break;
+ } // case mtRabbit
+
case mtSheep:
{
auto & Sheep = reinterpret_cast<const cSheep &>(a_Mob);
+ a_Pkt.WriteBEUInt8(0x0c);
+ a_Pkt.WriteBEInt8(Sheep.GetAge());
+
a_Pkt.WriteBEUInt8(0x10);
Byte SheepMetadata = 0;
SheepMetadata = Sheep.GetFurColor();
@@ -3308,7 +3467,7 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
a_Pkt.WriteBEUInt8(SheepMetadata);
break;
} // case mtSheep
-
+
case mtSkeleton:
{
auto & Skeleton = reinterpret_cast<const cSkeleton &>(a_Mob);
@@ -3316,7 +3475,7 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
a_Pkt.WriteBEUInt8(Skeleton.IsWither() ? 1 : 0);
break;
} // case mtSkeleton
-
+
case mtSlime:
{
auto & Slime = reinterpret_cast<const cSlime &>(a_Mob);
@@ -3330,9 +3489,11 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
auto & Villager = reinterpret_cast<const cVillager &>(a_Mob);
a_Pkt.WriteBEUInt8(0x50);
a_Pkt.WriteBEInt32(Villager.GetVilType());
+ a_Pkt.WriteBEUInt8(0x0c);
+ a_Pkt.WriteBEInt8(Villager.GetAge());
break;
} // case mtVillager
-
+
case mtWitch:
{
auto & Witch = reinterpret_cast<const cWitch &>(a_Mob);
@@ -3350,7 +3511,7 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
a_Pkt.WriteBEFloat(static_cast<float>(a_Mob.GetHealth()));
break;
} // case mtWither
-
+
case mtWolf:
{
auto & Wolf = reinterpret_cast<const cWolf &>(a_Mob);
@@ -3376,20 +3537,31 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
a_Pkt.WriteBEUInt8(Wolf.IsBegging() ? 1 : 0);
a_Pkt.WriteBEUInt8(0x14);
a_Pkt.WriteBEUInt8(Wolf.GetCollarColor());
+
+ a_Pkt.WriteBEUInt8(0x0c);
+ a_Pkt.WriteBEInt8(Wolf.GetAge());
break;
} // case mtWolf
-
+
case mtZombie:
{
auto & Zombie = reinterpret_cast<const cZombie &>(a_Mob);
a_Pkt.WriteBEUInt8(0x0c);
- a_Pkt.WriteBEUInt8(Zombie.IsBaby() ? 1 : 0);
+ a_Pkt.WriteBEInt8(Zombie.IsBaby() ? 1 : -1);
a_Pkt.WriteBEUInt8(0x0d);
a_Pkt.WriteBEUInt8(Zombie.IsVillagerZombie() ? 1 : 0);
a_Pkt.WriteBEUInt8(0x0e);
a_Pkt.WriteBEUInt8(Zombie.IsConverting() ? 1 : 0);
break;
} // case mtZombie
+
+ case mtZombiePigman:
+ {
+ auto & ZombiePigman = reinterpret_cast<const cZombiePigman &>(a_Mob);
+ a_Pkt.WriteBEUInt8(0x0c);
+ a_Pkt.WriteBEInt8(ZombiePigman.IsBaby() ? 1 : -1);
+ break;
+ } // case mtZombiePigman
} // switch (a_Mob.GetType())
}
diff --git a/src/Protocol/Protocol18x.h b/src/Protocol/Protocol18x.h
index 21024d702..36ed251fe 100644
--- a/src/Protocol/Protocol18x.h
+++ b/src/Protocol/Protocol18x.h
@@ -67,6 +67,12 @@ public:
virtual void SendBlockChanges (int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes) override;
virtual void SendChat (const AString & a_Message) override;
virtual void SendChat (const cCompositeChat & a_Message) override;
+ virtual void SendChatAboveActionBar (const AString & a_Message) override;
+ virtual void SendChatAboveActionBar (const cCompositeChat & a_Message) override;
+ virtual void SendChatSystem (const AString & a_Message) override;
+ virtual void SendChatSystem (const cCompositeChat & a_Message) override;
+ virtual void SendChatType (const AString & a_Message, eChatType type) override;
+ virtual void SendChatType (const cCompositeChat & a_Message, eChatType type) override;
virtual void SendChunkData (int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer) override;
virtual void SendCollectEntity (const cEntity & a_Entity, const cPlayer & a_Player) override;
virtual void SendDestroyEntity (const cEntity & a_Entity) override;
@@ -85,6 +91,7 @@ public:
virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion) override;
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;
+ virtual void SendHideTitle (void) override;
virtual void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item) override;
virtual void SendKeepAlive (int a_PingID) override;
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) override;
@@ -109,6 +116,7 @@ public:
virtual void SendPlayerSpawn (const cPlayer & a_Player) override;
virtual void SendPluginMessage (const AString & a_Channel, const AString & a_Message) override;
virtual void SendRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID) override;
+ virtual void SendResetTitle (void) override;
virtual void SendRespawn (eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks) override;
virtual void SendSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch) override;
virtual void SendExperience (void) override;
@@ -116,6 +124,10 @@ public:
virtual void SendScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode) override;
virtual void SendScoreUpdate (const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode) override;
virtual void SendDisplayObjective (const AString & a_Objective, cScoreboard::eDisplaySlot a_Display) override;
+ virtual void SendSetSubTitle (const cCompositeChat & a_SubTitle) override;
+ virtual void SendSetRawSubTitle (const AString & a_SubTitle) override;
+ virtual void SendSetTitle (const cCompositeChat & a_Title) override;
+ virtual void SendSetRawTitle (const AString & a_Title) override;
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
virtual void SendSpawnMob (const cMonster & a_Mob) override;
@@ -125,6 +137,7 @@ public:
virtual void SendTabCompletionResults (const AStringVector & a_Results) override;
virtual void SendTeleportEntity (const cEntity & a_Entity) override;
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
+ virtual void SendTitleTimes (int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) override;
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index e7f7a4526..c89c745a4 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -158,6 +158,66 @@ void cProtocolRecognizer::SendChat(const cCompositeChat & a_Message)
+void cProtocolRecognizer::SendChatAboveActionBar(const AString & a_Message)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendChatAboveActionBar(a_Message);
+}
+
+
+
+
+
+void cProtocolRecognizer::SendChatAboveActionBar(const cCompositeChat & a_Message)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendChatAboveActionBar(a_Message);
+}
+
+
+
+
+
+void cProtocolRecognizer::SendChatSystem(const AString & a_Message)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendChatSystem(a_Message);
+}
+
+
+
+
+
+void cProtocolRecognizer::SendChatSystem(const cCompositeChat & a_Message)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendChatSystem(a_Message);
+}
+
+
+
+
+
+void cProtocolRecognizer::SendChatType(const AString & a_Message, eChatType type)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendChatType(a_Message, type);
+}
+
+
+
+
+
+void cProtocolRecognizer::SendChatType(const cCompositeChat & a_Message, eChatType type)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendChatType(a_Message, type);
+}
+
+
+
+
+
void cProtocolRecognizer::SendChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer)
{
ASSERT(m_Protocol != nullptr);
@@ -350,6 +410,16 @@ void cProtocolRecognizer::SendHealth(void)
+void cProtocolRecognizer::SendHideTitle(void)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendHideTitle();
+}
+
+
+
+
+
void cProtocolRecognizer::SendWindowProperty(const cWindow & a_Window, short a_Property, short a_Value)
{
ASSERT(m_Protocol != nullptr);
@@ -599,6 +669,16 @@ void cProtocolRecognizer::SendRemoveEntityEffect(const cEntity & a_Entity, int a
+void cProtocolRecognizer::SendResetTitle(void)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendResetTitle();
+}
+
+
+
+
+
void cProtocolRecognizer::SendRespawn(eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks)
{
ASSERT(m_Protocol != nullptr);
@@ -659,6 +739,46 @@ void cProtocolRecognizer::SendDisplayObjective(const AString & a_Objective, cSco
+void cProtocolRecognizer::SendSetSubTitle(const cCompositeChat & a_SubTitle)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendSetSubTitle(a_SubTitle);
+}
+
+
+
+
+
+void cProtocolRecognizer::SendSetRawSubTitle(const AString & a_SubTitle)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendSetRawSubTitle(a_SubTitle);
+}
+
+
+
+
+
+void cProtocolRecognizer::SendSetTitle(const cCompositeChat & a_Title)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendSetTitle(a_Title);
+}
+
+
+
+
+
+void cProtocolRecognizer::SendSetRawTitle(const AString & a_Title)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendSetRawTitle(a_Title);
+}
+
+
+
+
+
void cProtocolRecognizer::SendSoundEffect(const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch)
{
ASSERT(m_Protocol != nullptr);
@@ -759,6 +879,16 @@ void cProtocolRecognizer::SendThunderbolt(int a_BlockX, int a_BlockY, int a_Bloc
+void cProtocolRecognizer::SendTitleTimes(int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks)
+{
+ ASSERT(m_Protocol != nullptr);
+ m_Protocol->SendTitleTimes(a_FadeInTicks, a_DisplayTicks, a_FadeOutTicks);
+}
+
+
+
+
+
void cProtocolRecognizer::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle)
{
ASSERT(m_Protocol != nullptr);
diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h
index 6c2185d6d..29eddcbc9 100644
--- a/src/Protocol/ProtocolRecognizer.h
+++ b/src/Protocol/ProtocolRecognizer.h
@@ -55,6 +55,12 @@ public:
virtual void SendBlockChanges (int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes) override;
virtual void SendChat (const AString & a_Message) override;
virtual void SendChat (const cCompositeChat & a_Message) override;
+ virtual void SendChatAboveActionBar (const AString & a_Message) override;
+ virtual void SendChatAboveActionBar (const cCompositeChat & a_Message) override;
+ virtual void SendChatSystem (const AString & a_Message) override;
+ virtual void SendChatSystem (const cCompositeChat & a_Message) override;
+ virtual void SendChatType (const AString & a_Message, eChatType type) override;
+ virtual void SendChatType (const cCompositeChat & a_Message, eChatType type) override;
virtual void SendChunkData (int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer) override;
virtual void SendCollectEntity (const cEntity & a_Entity, const cPlayer & a_Player) override;
virtual void SendDestroyEntity (const cEntity & a_Entity) override;
@@ -73,6 +79,7 @@ public:
virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion) override;
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;
+ virtual void SendHideTitle (void) override;
virtual void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item) override;
virtual void SendKeepAlive (int a_PingID) override;
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) override;
@@ -97,12 +104,17 @@ public:
virtual void SendPlayerSpawn (const cPlayer & a_Player) override;
virtual void SendPluginMessage (const AString & a_Channel, const AString & a_Message) override;
virtual void SendRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID) override;
+ virtual void SendResetTitle (void) override;
virtual void SendRespawn (eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks) override;
virtual void SendExperience (void) override;
virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) override;
virtual void SendScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode) override;
virtual void SendScoreUpdate (const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode) override;
virtual void SendDisplayObjective (const AString & a_Objective, cScoreboard::eDisplaySlot a_Display) override;
+ virtual void SendSetSubTitle (const cCompositeChat & a_SubTitle) override;
+ virtual void SendSetRawSubTitle (const AString & a_SubTitle) override;
+ virtual void SendSetTitle (const cCompositeChat & a_Title) override;
+ virtual void SendSetRawTitle (const AString & a_Title) override;
virtual void SendSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch) override;
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
@@ -113,6 +125,7 @@ public:
virtual void SendTabCompletionResults (const AStringVector & a_Results) override;
virtual void SendTeleportEntity (const cEntity & a_Entity) override;
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
+ virtual void SendTitleTimes (int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) override;
diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp
index 685bd92f5..c5dc9b69b 100644
--- a/src/RCONServer.cpp
+++ b/src/RCONServer.cpp
@@ -134,15 +134,15 @@ cRCONServer::~cRCONServer()
-void cRCONServer::Initialize(cIniFile & a_IniFile)
+void cRCONServer::Initialize(cSettingsRepositoryInterface & a_Settings)
{
- if (!a_IniFile.GetValueSetB("RCON", "Enabled", false))
+ if (!a_Settings.GetValueSetB("RCON", "Enabled", false))
{
return;
}
// Read the password, don't allow an empty one:
- m_Password = a_IniFile.GetValueSet("RCON", "Password", "");
+ m_Password = a_Settings.GetValueSet("RCON", "Password", "");
if (m_Password.empty())
{
LOGWARNING("RCON is requested, but the password is not set. RCON is now disabled.");
@@ -150,7 +150,7 @@ void cRCONServer::Initialize(cIniFile & a_IniFile)
}
// Read the listening ports for RCON from config:
- AStringVector Ports = ReadUpgradeIniPorts(a_IniFile, "RCON", "Ports", "PortsIPv4", "PortsIPv6", "25575");
+ AStringVector Ports = ReadUpgradeIniPorts(a_Settings, "RCON", "Ports", "PortsIPv4", "PortsIPv6", "25575");
// Start listening on each specified port:
for (auto port: Ports)
diff --git a/src/RCONServer.h b/src/RCONServer.h
index 352fa7b50..ecd936eeb 100644
--- a/src/RCONServer.h
+++ b/src/RCONServer.h
@@ -17,7 +17,7 @@
// fwd:
class cServer;
-class cIniFile;
+class cSettingsRepositoryInterface;
@@ -29,7 +29,7 @@ public:
cRCONServer(cServer & a_Server);
virtual ~cRCONServer();
- void Initialize(cIniFile & a_IniFile);
+ void Initialize(cSettingsRepositoryInterface & a_Settings);
protected:
friend class cRCONCommandOutput;
@@ -61,7 +61,7 @@ protected:
// cTCPLink::cCallbacks overrides:
- virtual void OnLinkCreated(cTCPLinkPtr a_Link);
+ virtual void OnLinkCreated(cTCPLinkPtr a_Link) override;
virtual void OnReceivedData(const char * a_Data, size_t a_Length) override;
virtual void OnRemoteClosed(void) override;
virtual void OnError(int a_ErrorCode, const AString & a_ErrorMsg) override;
diff --git a/src/Root.cpp b/src/Root.cpp
index 349608e8d..3ba391b7f 100644
--- a/src/Root.cpp
+++ b/src/Root.cpp
@@ -19,6 +19,11 @@
#include "LoggerListeners.h"
#include "BuildInfo.h"
#include "IniFile.h"
+#include "SettingsRepositoryInterface.h"
+#include "OverridesSettingsRepository.h"
+#include "SelfTests.h"
+
+#include <iostream>
#ifdef _WIN32
#include <conio.h>
@@ -70,7 +75,7 @@ cRoot::~cRoot()
void cRoot::InputThread(cRoot & a_Params)
{
cLogCommandOutputCallback Output;
-
+
while (!cRoot::m_ShouldStop && !a_Params.m_bRestart && !m_TerminateEventRaised && std::cin.good())
{
AString Command;
@@ -96,24 +101,29 @@ void cRoot::InputThread(cRoot & a_Params)
-void cRoot::Start(void)
+void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> overridesRepo)
{
#ifdef _WIN32
HWND hwnd = GetConsoleWindow();
HMENU hmenu = GetSystemMenu(hwnd, FALSE);
EnableMenuItem(hmenu, SC_CLOSE, MF_GRAYED); // Disable close button when starting up; it causes problems with our CTRL-CLOSE handling
#endif
-
- cLogger::cListener * consoleLogListener = MakeConsoleListener();
+
+ cLogger::cListener * consoleLogListener = MakeConsoleListener(m_RunAsService);
cLogger::cListener * fileLogListener = new cFileListener();
cLogger::GetInstance().AttachListener(consoleLogListener);
cLogger::GetInstance().AttachListener(fileLogListener);
-
- LOG("--- Started Log ---\n");
+
+ LOG("--- Started Log ---");
#ifdef BUILD_ID
- LOG("MCServer " BUILD_SERIES_NAME " build id: " BUILD_ID);
- LOG("from commit id: " BUILD_COMMIT_ID " built at: " BUILD_DATETIME);
+ LOG("MCServer " BUILD_SERIES_NAME " build id: " BUILD_ID);
+ LOG("from commit id: " BUILD_COMMIT_ID " built at: " BUILD_DATETIME);
+ #endif
+
+ // Run the self-tests registered previously via cSelfTests::Register():
+ #ifdef SELF_TEST
+ cSelfTests::ExecuteAll();
#endif
cDeadlockDetect dd;
@@ -130,22 +140,24 @@ void cRoot::Start(void)
m_Server = new cServer();
LOG("Reading server config...");
- cIniFile IniFile;
- if (!IniFile.ReadFile("settings.ini"))
+
+ auto IniFile = cpp14::make_unique<cIniFile>();
+ if (!IniFile->ReadFile("settings.ini"))
{
LOGWARN("Regenerating settings.ini, all settings will be reset");
- IniFile.AddHeaderComment(" This is the main server configuration");
- IniFile.AddHeaderComment(" Most of the settings here can be configured using the webadmin interface, if enabled in webadmin.ini");
- IniFile.AddHeaderComment(" See: http://wiki.mc-server.org/doku.php?id=configure:settings.ini for further configuration help");
+ IniFile->AddHeaderComment(" This is the main server configuration");
+ IniFile->AddHeaderComment(" Most of the settings here can be configured using the webadmin interface, if enabled in webadmin.ini");
+ IniFile->AddHeaderComment(" See: http://wiki.mc-server.org/doku.php?id=configure:settings.ini for further configuration help");
}
+ auto settingsRepo = cpp14::make_unique<cOverridesSettingsRepository>(std::move(IniFile), std::move(overridesRepo));
LOG("Starting server...");
m_MojangAPI = new cMojangAPI;
- bool ShouldAuthenticate = IniFile.GetValueSetB("Authentication", "Authenticate", true);
- m_MojangAPI->Start(IniFile, ShouldAuthenticate); // Mojang API needs to be started before plugins, so that plugins may use it for DB upgrades on server init
- if (!m_Server->InitServer(IniFile, ShouldAuthenticate))
+ bool ShouldAuthenticate = settingsRepo->GetValueSetB("Authentication", "Authenticate", true);
+ m_MojangAPI->Start(*settingsRepo, ShouldAuthenticate); // Mojang API needs to be started before plugins, so that plugins may use it for DB upgrades on server init
+ if (!m_Server->InitServer(*settingsRepo, ShouldAuthenticate))
{
- IniFile.WriteFile("settings.ini");
+ settingsRepo->Flush();
LOGERROR("Failure starting server, aborting...");
return;
}
@@ -158,31 +170,31 @@ void cRoot::Start(void)
m_RankManager->Initialize(*m_MojangAPI);
m_CraftingRecipes = new cCraftingRecipes;
m_FurnaceRecipe = new cFurnaceRecipe();
-
+
LOGD("Loading worlds...");
- LoadWorlds(IniFile);
+ LoadWorlds(*settingsRepo);
LOGD("Loading plugin manager...");
m_PluginManager = new cPluginManager();
- m_PluginManager->ReloadPluginsNow(IniFile);
-
+ m_PluginManager->ReloadPluginsNow(*settingsRepo);
+
LOGD("Loading MonsterConfig...");
m_MonsterConfig = new cMonsterConfig;
// This sets stuff in motion
LOGD("Starting Authenticator...");
- m_Authenticator.Start(IniFile);
-
+ m_Authenticator.Start(*settingsRepo);
+
LOGD("Starting worlds...");
StartWorlds();
-
- if (IniFile.GetValueSetB("DeadlockDetect", "Enabled", true))
+
+ if (settingsRepo->GetValueSetB("DeadlockDetect", "Enabled", true))
{
LOGD("Starting deadlock detector...");
- dd.Start(IniFile.GetValueSetI("DeadlockDetect", "IntervalSec", 20));
+ dd.Start(settingsRepo->GetValueSetI("DeadlockDetect", "IntervalSec", 20));
}
-
- IniFile.WriteFile("settings.ini");
+
+ settingsRepo->Flush();
LOGD("Finalising startup...");
if (m_Server->Start())
@@ -203,6 +215,10 @@ void cRoot::Start(void)
#endif
LOG("Startup complete, took %ldms!", static_cast<long int>(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - BeginTime).count()));
+
+ // Save the current time
+ m_StartTime = std::chrono::steady_clock::now();
+
#ifdef _WIN32
EnableMenuItem(hmenu, SC_CLOSE, MF_ENABLED); // Re-enable close button
#endif
@@ -247,9 +263,9 @@ void cRoot::Start(void)
delete m_FurnaceRecipe; m_FurnaceRecipe = nullptr;
delete m_CraftingRecipes; m_CraftingRecipes = nullptr;
- LOGD("Unloading worlds...");
+ LOG("Unloading worlds...");
UnloadWorlds();
-
+
LOGD("Stopping plugin manager...");
delete m_PluginManager; m_PluginManager = nullptr;
@@ -260,9 +276,9 @@ void cRoot::Start(void)
LOG("Shutdown successful!");
}
-
+
LOG("--- Stopped Log ---");
-
+
cLogger::GetInstance().DetachListener(consoleLogListener);
delete consoleLogListener;
cLogger::GetInstance().DetachListener(fileLogListener);
@@ -282,30 +298,29 @@ void cRoot::LoadGlobalSettings()
-void cRoot::LoadWorlds(cIniFile & IniFile)
+void cRoot::LoadWorlds(cSettingsRepositoryInterface & a_Settings)
{
// First get the default world
- AString DefaultWorldName = IniFile.GetValueSet("Worlds", "DefaultWorld", "world");
+ AString DefaultWorldName = a_Settings.GetValueSet("Worlds", "DefaultWorld", "world");
m_pDefaultWorld = new cWorld(DefaultWorldName.c_str());
m_WorldsByName[ DefaultWorldName ] = m_pDefaultWorld;
// Then load the other worlds
- int KeyNum = IniFile.FindKey("Worlds");
- int NumWorlds = IniFile.GetNumValues(KeyNum);
- if (NumWorlds <= 0)
+ auto Worlds = a_Settings.GetValues("Worlds");
+ if (Worlds.size() <= 0)
{
return;
}
-
+
bool FoundAdditionalWorlds = false;
- for (int i = 0; i < NumWorlds; i++)
+ for (auto WorldNameValue : Worlds)
{
- AString ValueName = IniFile.GetValueName(KeyNum, i);
+ AString ValueName = WorldNameValue.first;
if (ValueName.compare("World") != 0)
{
continue;
}
- AString WorldName = IniFile.GetValue(KeyNum, i);
+ AString WorldName = WorldNameValue.second;
if (WorldName.empty())
{
continue;
@@ -317,10 +332,10 @@ void cRoot::LoadWorlds(cIniFile & IniFile)
if (!FoundAdditionalWorlds)
{
- if (IniFile.GetKeyComment("Worlds", 0) != " World=secondworld")
+ if (a_Settings.GetKeyComment("Worlds", 0) != " World=secondworld")
{
- IniFile.DeleteKeyComment("Worlds", 0);
- IniFile.AddKeyComment("Worlds", " World=secondworld");
+ a_Settings.DeleteKeyComment("Worlds", 0);
+ a_Settings.AddKeyComment("Worlds", " World=secondworld");
}
}
}
@@ -329,7 +344,7 @@ void cRoot::LoadWorlds(cIniFile & IniFile)
-cWorld * cRoot::CreateAndInitializeWorld(const AString & a_WorldName, eDimension a_Dimension, const AString & a_OverworldName)
+cWorld * cRoot::CreateAndInitializeWorld(const AString & a_WorldName, eDimension a_Dimension, const AString & a_OverworldName, bool a_InitSpawn)
{
cWorld * World = m_WorldsByName[a_WorldName];
if (World != nullptr)
@@ -340,7 +355,10 @@ cWorld * cRoot::CreateAndInitializeWorld(const AString & a_WorldName, eDimension
cWorld * NewWorld = new cWorld(a_WorldName.c_str(), a_Dimension, a_OverworldName);
m_WorldsByName[a_WorldName] = NewWorld;
NewWorld->Start();
- NewWorld->InitializeSpawn();
+ if (a_InitSpawn)
+ {
+ NewWorld->InitializeSpawn();
+ }
m_PluginManager->CallHookWorldStarted(*NewWorld);
return NewWorld;
}
@@ -551,6 +569,23 @@ void cRoot::SaveAllChunks(void)
+void cRoot::SendPlayerLists(cPlayer * a_DestPlayer)
+{
+ for (const auto & itr : m_WorldsByName)
+ {
+ itr.second->SendPlayerList(a_DestPlayer);
+ } // for itr - m_WorldsByName[]
+}
+
+
+
+void cRoot::BroadcastPlayerListsAddPlayer(const cPlayer & a_Player, const cClientHandle * a_Exclude)
+{
+ for (const auto & itr : m_WorldsByName)
+ {
+ itr.second->BroadcastPlayerListAddPlayer(a_Player);
+ } // for itr - m_WorldsByName[]
+}
void cRoot::BroadcastChat(const AString & a_Message, eMessageType a_ChatPrefix)
@@ -575,8 +610,6 @@ void cRoot::BroadcastChat(const cCompositeChat & a_Message)
-
-
bool cRoot::ForEachPlayer(cPlayerListCallback & a_Callback)
{
for (WorldMap::iterator itr = m_WorldsByName.begin(), itr2 = itr; itr != m_WorldsByName.end(); itr = itr2)
@@ -851,3 +884,4 @@ int cRoot::GetFurnaceFuelBurnTime(const cItem & a_Fuel)
+
diff --git a/src/Root.h b/src/Root.h
index e0b6cf26c..0eae21384 100644
--- a/src/Root.h
+++ b/src/Root.h
@@ -24,6 +24,7 @@ class cWorld;
class cPlayer;
class cCommandOutputCallback;
class cCompositeChat;
+class cSettingsRepositoryInterface;
typedef cItemCallback<cPlayer> cPlayerListCallback;
typedef cItemCallback<cWorld> cWorldListCallback;
@@ -37,7 +38,7 @@ namespace Json
-/// The root of the object hierarchy
+/** The root of the object hierarchy */
// tolua_begin
class cRoot
{
@@ -53,7 +54,7 @@ public:
cRoot(void);
~cRoot();
- void Start(void);
+ void Start(std::unique_ptr<cSettingsRepositoryInterface> overridesRepo);
// tolua_begin
cServer * GetServer(void) { return m_Server; }
@@ -68,23 +69,32 @@ public:
The dimension parameter is used to create a world with a specific dimension
a_OverworldName should be set for non-overworld dimensions if one wishes that world to link back to an overworld via portals
*/
- cWorld * CreateAndInitializeWorld(const AString & a_WorldName, eDimension a_Dimension = dimOverworld, const AString & a_OverworldName = "");
+ cWorld * CreateAndInitializeWorld(const AString & a_WorldName, eDimension a_Dimension = dimOverworld, const AString & a_OverworldName = "", bool a_InitSpawn = true);
+
+ /** Returns the up time of the server in seconds */
+ int GetServerUpTime(void)
+ {
+ return static_cast<int>(std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now() - m_StartTime).count());
+ }
// tolua_end
-
+
/// Calls the callback for each world; returns true if the callback didn't abort (return true)
bool ForEachWorld(cWorldListCallback & a_Callback); // >> Exported in ManualBindings <<
-
+
/// Writes chunkstats, for each world and totals, to the output callback
void LogChunkStats(cCommandOutputCallback & a_Output);
-
+
cMonsterConfig * GetMonsterConfig(void) { return m_MonsterConfig; }
cCraftingRecipes * GetCraftingRecipes(void) { return m_CraftingRecipes; } // tolua_export
cFurnaceRecipe * GetFurnaceRecipe (void) { return m_FurnaceRecipe; } // Exported in ManualBindings.cpp with quite a different signature
-
+
/// Returns the number of ticks for how long the item would fuel a furnace. Returns zero if not a fuel
static int GetFurnaceFuelBurnTime(const cItem & a_Fuel); // tolua_export
-
+
+ /** The current time where the startup of the server has been completed */
+ std::chrono::steady_clock::time_point m_StartTime;
+
cWebAdmin * GetWebAdmin (void) { return m_WebAdmin; } // tolua_export
cPluginManager * GetPluginManager (void) { return m_PluginManager; } // tolua_export
cAuthenticator & GetAuthenticator (void) { return m_Authenticator; }
@@ -97,32 +107,32 @@ public:
"stop" and "restart" commands have special handling.
*/
void QueueExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallback & a_Output);
-
+
/** 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
"stop" and "restart" commands have special handling.
*/
void QueueExecuteConsoleCommand(const AString & a_Cmd); // tolua_export
-
+
/// Executes a console command through the cServer class; does special handling for "stop" and "restart".
void ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallback & a_Output);
-
+
/// Kicks the user, no matter in what world they are. Used from cAuthenticator
void KickUser(int a_ClientID, const AString & a_Reason);
-
+
/// Called by cAuthenticator to auth the specified user
void AuthenticateUser(int a_ClientID, const AString & a_Name, const AString & a_UUID, const Json::Value & a_Properties);
-
+
/// Executes commands queued in the command queue
void TickCommands(void);
/// Returns the number of chunks loaded
int GetTotalChunkCount(void); // tolua_export
-
+
/// Saves all chunks in all worlds
void SaveAllChunks(void); // tolua_export
-
+
/// Calls the callback for each player in all worlds
bool ForEachPlayer(cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
@@ -131,12 +141,18 @@ public:
/** Finds the player over his uuid and calls the callback */
bool DoWithPlayerByUUID(const AString & a_PlayerUUID, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
-
+
/** Finds the player using it's complete username and calls the callback */
bool DoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback);
-
+
+ /** Send playerlist of all worlds to player */
+ void SendPlayerLists(cPlayer * a_DestPlayer);
+
+ /** Broadcast Player through all worlds */
+ void BroadcastPlayerListsAddPlayer(const cPlayer & a_Player, const cClientHandle * a_Exclude = nullptr);
+
// tolua_begin
-
+
/// Sends a chat message to all connected clients (in all worlds)
void BroadcastChat (const AString & a_Message, eMessageType a_ChatPrefix = mtCustom);
void BroadcastChat (const cCompositeChat & a_Message);
@@ -148,18 +164,18 @@ public:
void BroadcastChatLeave (const AString & a_Message) { BroadcastChat(a_Message, mtLeave); }
void BroadcastChatSuccess(const AString & a_Message) { BroadcastChat(a_Message, mtSuccess); }
void BroadcastChatWarning(const AString & a_Message) { BroadcastChat(a_Message, mtWarning); }
-
+
/// Returns the textual description of the protocol version: 49 -> "1.4.4". Provided specifically for Lua API
static AString GetProtocolVersionTextFromInt(int a_ProtocolVersionNum);
-
+
/// Returns the amount of virtual RAM used, in KiB. Returns a negative number on error
static int GetVirtualRAMUsage(void);
-
+
/// Returns the amount of virtual RAM used, in KiB. Returns a negative number on error
static int GetPhysicalRAMUsage(void);
-
+
// tolua_end
-
+
private:
class cCommand
{
@@ -169,17 +185,17 @@ private:
m_Output(a_Output)
{
}
-
+
AString m_Command;
cCommandOutputCallback * m_Output;
} ;
-
+
typedef std::map<AString, cWorld *> WorldMap;
typedef std::vector<cCommand> cCommandQueue;
cWorld * m_pDefaultWorld;
WorldMap m_WorldsByName;
-
+
cCriticalSection m_CSPendingCommands;
cCommandQueue m_PendingCommands;
@@ -201,23 +217,24 @@ private:
bool m_bRestart;
+
void LoadGlobalSettings();
/// Loads the worlds from settings.ini, creates the worldmap
- void LoadWorlds(cIniFile & IniFile);
-
+ void LoadWorlds(cSettingsRepositoryInterface & a_Settings);
+
/// Starts each world's life
void StartWorlds(void);
-
+
/// Stops each world's threads, so that it's safe to unload them
void StopWorlds(void);
-
+
/// Unloads all worlds from memory
void UnloadWorlds(void);
-
+
/// Does the actual work of executing a command
void DoExecuteConsoleCommand(const AString & a_Cmd);
-
+
static cRoot * s_Root;
static void InputThread(cRoot & a_Params);
@@ -226,3 +243,4 @@ private:
+
diff --git a/src/Scoreboard.cpp b/src/Scoreboard.cpp
index a4a4c3391..9f251ab94 100644
--- a/src/Scoreboard.cpp
+++ b/src/Scoreboard.cpp
@@ -276,7 +276,7 @@ size_t cTeam::GetNumPlayers(void) const
cScoreboard::cScoreboard(cWorld * a_World) : m_World(a_World)
{
- for (int i = 0; i < (int) dsCount; ++i)
+ for (int i = 0; i < static_cast<int>(dsCount); ++i)
{
m_Display[i] = nullptr;
}
@@ -323,11 +323,11 @@ bool cScoreboard::RemoveObjective(const AString & a_Name)
ASSERT(m_World != nullptr);
m_World->BroadcastScoreboardObjective(it->second.GetName(), it->second.GetDisplayName(), 1);
- for (unsigned int i = 0; i < (unsigned int) dsCount; ++i)
+ for (unsigned int i = 0; i < static_cast<unsigned int>(dsCount); ++i)
{
if (m_Display[i] == &it->second)
{
- SetDisplay(nullptr, (eDisplaySlot) i);
+ SetDisplay(nullptr, static_cast<eDisplaySlot>(i));
}
}
@@ -557,14 +557,14 @@ void cScoreboard::SendTo(cClientHandle & a_Client)
it->second.SendTo(a_Client);
}
- for (int i = 0; i < (int) dsCount; ++i)
+ for (int i = 0; i < static_cast<int>(dsCount); ++i)
{
// Avoid race conditions
cObjective * Objective = m_Display[i];
if (Objective)
{
- a_Client.SendDisplayObjective(Objective->GetName(), (eDisplaySlot) i);
+ a_Client.SendDisplayObjective(Objective->GetName(), static_cast<eDisplaySlot>(i));
}
}
}
diff --git a/src/SelfTests.cpp b/src/SelfTests.cpp
new file mode 100644
index 000000000..7e35e675e
--- /dev/null
+++ b/src/SelfTests.cpp
@@ -0,0 +1,71 @@
+
+// SelfTests.h
+
+// Implements the cSelfTests class representing the singleton used for registering self-tests
+// This class is only declared if SELF_TEST macro is defined.
+
+#include "Globals.h"
+#include "SelfTests.h"
+
+
+
+
+
+#ifdef SELF_TEST
+ cSelfTests::cSelfTests(void):
+ m_AllowRegistering(true)
+ {
+ }
+
+
+
+
+
+ cSelfTests & cSelfTests::Get(void)
+ {
+ static cSelfTests singleton;
+ return singleton;
+ }
+
+
+
+
+
+ void cSelfTests::Register(cSelfTests::SelfTestFunction a_FnToExecute, const AString & a_TestName)
+ {
+ ASSERT(Get().m_AllowRegistering);
+ Get().m_SelfTests.push_back(std::make_pair(a_FnToExecute, a_TestName));
+ }
+
+
+
+
+
+ void cSelfTests::ExecuteAll(void)
+ {
+ Get().m_AllowRegistering = false;
+ LOG("--- Performing self-tests ---");
+ for (auto & test: Get().m_SelfTests)
+ {
+ LOG("Performing self-test: %s", test.second.c_str());
+ try
+ {
+ test.first();
+ }
+ catch (const std::exception & exc)
+ {
+ LOGWARNING("Exception in test %s: %s", test.second.c_str(), exc.what());
+ }
+ catch (...)
+ {
+ LOGWARNING("Unknown exception in test %s", test.second.c_str());
+ }
+ } // for test - m_SelfTests[]
+ LOG("--- Self-tests finished ---");
+ }
+
+#endif // SELF_TEST
+
+
+
+
diff --git a/src/SelfTests.h b/src/SelfTests.h
new file mode 100644
index 000000000..03a3b5faa
--- /dev/null
+++ b/src/SelfTests.h
@@ -0,0 +1,51 @@
+
+// SelfTests.h
+
+// Declares the cSelfTests class representing the singleton used for registering self-tests
+// This class is only declared if SELF_TEST macro is defined.
+
+
+
+
+
+#pragma once
+
+
+
+
+
+#ifdef SELF_TEST
+ /** Singleton containing registered self-tests.
+ Used to schedule self-tests to run after the logging framework is initialized (#2228). */
+ class cSelfTests
+ {
+ public:
+ /** Returns the singleton instance of this class. */
+ static cSelfTests & Get(void);
+
+ // typedef void (* SelfTestFunction)(void);
+ typedef std::function<void(void)> SelfTestFunction;
+
+ /** Registers a self-test to be executed once the logging framework is initialized. */
+ static void Register(SelfTestFunction a_FnToExecute, const AString & a_TestName);
+
+ /** Executes all the registered self-tests. */
+ static void ExecuteAll(void);
+
+ protected:
+ typedef std::vector<std::pair<SelfTestFunction, AString>> SelfTestFunctions;
+
+ /** Functions (registered self-tests) to call once the logging framework is initialized. */
+ SelfTestFunctions m_SelfTests;
+
+ /** If true, tests may be registered. Set to false once the tests are executed, to detect tests that are registered too late. */
+ bool m_AllowRegistering;
+
+
+ cSelfTests(void);
+ };
+#endif // SELF_TEST
+
+
+
+
diff --git a/src/Server.cpp b/src/Server.cpp
index 996de2695..fd3188b18 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -72,7 +72,7 @@ class cServerListenCallbacks:
virtual void OnAccepted(cTCPLink & a_Link) override {}
- virtual void OnError(int a_ErrorCode, const AString & a_ErrorMsg)
+ virtual void OnError(int a_ErrorCode, const AString & a_ErrorMsg) override
{
LOGWARNING("Cannot listen on port %d: %d (%s).", m_Port, a_ErrorCode, a_ErrorMsg.c_str());
}
@@ -185,12 +185,12 @@ void cServer::PlayerDestroying(const cPlayer * a_Player)
-bool cServer::InitServer(cIniFile & a_SettingsIni, bool a_ShouldAuth)
+bool cServer::InitServer(cSettingsRepositoryInterface & a_Settings, bool a_ShouldAuth)
{
- m_Description = a_SettingsIni.GetValueSet("Server", "Description", "MCServer - in C++!");
- m_MaxPlayers = a_SettingsIni.GetValueSetI("Server", "MaxPlayers", 100);
- m_bIsHardcore = a_SettingsIni.GetValueSetB("Server", "HardcoreEnabled", false);
- m_bAllowMultiLogin = a_SettingsIni.GetValueSetB("Server", "AllowMultiLogin", false);
+ m_Description = a_Settings.GetValueSet("Server", "Description", "MCServer - in C++!");
+ m_MaxPlayers = a_Settings.GetValueSetI("Server", "MaxPlayers", 100);
+ m_bIsHardcore = a_Settings.GetValueSetB("Server", "HardcoreEnabled", false);
+ m_bAllowMultiLogin = a_Settings.GetValueSetB("Server", "AllowMultiLogin", false);
m_PlayerCount = 0;
m_PlayerCountDiff = 0;
@@ -205,9 +205,9 @@ bool cServer::InitServer(cIniFile & a_SettingsIni, bool a_ShouldAuth)
LOGINFO("Compatible clients: %s", MCS_CLIENT_VERSIONS);
LOGINFO("Compatible protocol versions %s", MCS_PROTOCOL_VERSIONS);
- m_Ports = ReadUpgradeIniPorts(a_SettingsIni, "Server", "Ports", "Port", "PortsIPv6", "25565");
+ m_Ports = ReadUpgradeIniPorts(a_Settings, "Server", "Ports", "Port", "PortsIPv6", "25565");
- m_RCONServer.Initialize(a_SettingsIni);
+ m_RCONServer.Initialize(a_Settings);
m_bIsConnected = true;
@@ -226,16 +226,16 @@ bool cServer::InitServer(cIniFile & a_SettingsIni, bool a_ShouldAuth)
}
// Check if both BungeeCord and online mode are on, if so, warn the admin:
- m_ShouldAllowBungeeCord = a_SettingsIni.GetValueSetB("Authentication", "AllowBungeeCord", false);
+ m_ShouldAllowBungeeCord = a_Settings.GetValueSetB("Authentication", "AllowBungeeCord", false);
if (m_ShouldAllowBungeeCord && m_ShouldAuthenticate)
{
LOGWARNING("WARNING: BungeeCord is allowed and server set to online mode. This is unsafe and will not work properly. Disable either authentication or BungeeCord in settings.ini.");
}
- m_ShouldLoadOfflinePlayerData = a_SettingsIni.GetValueSetB("PlayerData", "LoadOfflinePlayerData", false);
- m_ShouldLoadNamedPlayerData = a_SettingsIni.GetValueSetB("PlayerData", "LoadNamedPlayerData", true);
+ m_ShouldLoadOfflinePlayerData = a_Settings.GetValueSetB("PlayerData", "LoadOfflinePlayerData", false);
+ m_ShouldLoadNamedPlayerData = a_Settings.GetValueSetB("PlayerData", "LoadNamedPlayerData", true);
- m_ClientViewDistance = a_SettingsIni.GetValueSetI("Server", "DefaultViewDistance", cClientHandle::DEFAULT_VIEW_DISTANCE);
+ m_ClientViewDistance = a_Settings.GetValueSetI("Server", "DefaultViewDistance", cClientHandle::DEFAULT_VIEW_DISTANCE);
if (m_ClientViewDistance < cClientHandle::MIN_VIEW_DISTANCE)
{
m_ClientViewDistance = cClientHandle::MIN_VIEW_DISTANCE;
diff --git a/src/Server.h b/src/Server.h
index 1f30295b7..4d0bc1c18 100644
--- a/src/Server.h
+++ b/src/Server.h
@@ -38,8 +38,8 @@ class cClientHandle;
typedef SharedPtr<cClientHandle> cClientHandlePtr;
typedef std::list<cClientHandlePtr> cClientHandlePtrs;
typedef std::list<cClientHandle *> cClientHandles;
-class cIniFile;
class cCommandOutputCallback;
+class cSettingsRepositoryInterface;
namespace Json
@@ -58,7 +58,7 @@ public:
// tolua_end
virtual ~cServer() {}
- bool InitServer(cIniFile & a_SettingsIni, bool a_ShouldAuth);
+ bool InitServer(cSettingsRepositoryInterface & a_Settings, bool a_ShouldAuth);
// tolua_begin
diff --git a/src/SettingsRepositoryInterface.h b/src/SettingsRepositoryInterface.h
new file mode 100644
index 000000000..443b90ff5
--- /dev/null
+++ b/src/SettingsRepositoryInterface.h
@@ -0,0 +1,61 @@
+
+#pragma once
+
+class cSettingsRepositoryInterface
+{
+public:
+
+ enum errors
+ {
+ noID = -1,
+ };
+
+ virtual ~cSettingsRepositoryInterface() = default;
+
+ /** Returns true iff the specified key exists */
+ virtual bool KeyExists(const AString keyname) const = 0;
+
+ /** Returns true iff the specified value exists. */
+ virtual bool HasValue(const AString & a_KeyName, const AString & a_ValueName) const = 0;
+
+ /** Add a key name. Return value is not required to mean anything **/
+ virtual int AddKeyName(const AString & keyname) = 0;
+
+ /** Add a key comment, will always fail if the repository does not support comments **/
+ virtual bool AddKeyComment(const AString & keyname, const AString & comment) = 0;
+
+ /** Return a key comment, returns "" for repositories that do not return comments **/
+ virtual AString GetKeyComment(const AString & keyname, const int commentID) const = 0;
+
+ /** Delete a key comment, will always fail if the repository does not support comments **/
+ virtual bool DeleteKeyComment(const AString & keyname, const int commentID) = 0;
+
+ /** Adds a new value to the specified key.
+ If a value of the same name already exists, creates another one **/
+ virtual void AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value) = 0;
+
+ /** returns a vector containing a name, value pair for each value under the key **/
+ virtual std::vector<std::pair<AString, AString>> GetValues(AString a_keyName) = 0;
+
+ /** Get the value at the specified key and value, returns defValue on failure **/
+ virtual AString GetValue (const AString & keyname, const AString & valuename, const AString & defValue = "") const = 0;
+
+ /** Gets the value; if not found, write the default to the repository **/
+ virtual AString GetValueSet (const AString & keyname, const AString & valuename, const AString & defValue = "") = 0;
+ virtual int GetValueSetI(const AString & keyname, const AString & valuename, const int defValue = 0) = 0;
+ virtual Int64 GetValueSetI(const AString & keyname, const AString & valuename, const Int64 defValue = 0) = 0;
+ virtual bool GetValueSetB(const AString & keyname, const AString & valuename, const bool defValue = false) = 0;
+
+ /** Overwrites the value of the key, value pair
+ Specify the optional parameter as false if you do not want the value created if it doesn't exist.
+ Returns true if value set, false otherwise. **/
+ virtual bool SetValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value, const bool a_CreateIfNotExists = true) = 0;
+ virtual bool SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists = true) = 0;
+
+ /** Deletes the specified key, value pair **/
+ virtual bool DeleteValue(const AString & keyname, const AString & valuename) = 0;
+
+
+ /** Writes the changes to the backing store, if the repository has one **/
+ virtual bool Flush() = 0;
+};
diff --git a/src/Simulator/CMakeLists.txt b/src/Simulator/CMakeLists.txt
index 5aa406717..5ac39bb0f 100644
--- a/src/Simulator/CMakeLists.txt
+++ b/src/Simulator/CMakeLists.txt
@@ -31,6 +31,13 @@ SET (HDRS
VanillaFluidSimulator.h
VaporizeFluidSimulator.h)
+
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(FireSimulator.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion")
+ set_source_files_properties(FluidSimulator.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=shadow")
+ set_source_files_properties(IncrementalRedstoneSimulator.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=old-style-cast")
+endif()
+
if(NOT MSVC)
add_library(Simulator ${SRCS} ${HDRS})
endif()
diff --git a/src/Simulator/DelayedFluidSimulator.cpp b/src/Simulator/DelayedFluidSimulator.cpp
index 0973962b6..e0da3ff61 100644
--- a/src/Simulator/DelayedFluidSimulator.cpp
+++ b/src/Simulator/DelayedFluidSimulator.cpp
@@ -99,8 +99,8 @@ void cDelayedFluidSimulator::AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ,
return;
}
- void * ChunkDataRaw = (m_FluidBlock == E_BLOCK_WATER) ? a_Chunk->GetWaterSimulatorData() : a_Chunk->GetLavaSimulatorData();
- cDelayedFluidSimulatorChunkData * ChunkData = (cDelayedFluidSimulatorChunkData *)ChunkDataRaw;
+ auto ChunkDataRaw = (m_FluidBlock == E_BLOCK_WATER) ? a_Chunk->GetWaterSimulatorData() : a_Chunk->GetLavaSimulatorData();
+ cDelayedFluidSimulatorChunkData * ChunkData = static_cast<cDelayedFluidSimulatorChunkData *>(ChunkDataRaw);
cDelayedFluidSimulatorChunkData::cSlot & Slot = ChunkData->m_Slots[m_AddSlotNum];
// Add, if not already present:
@@ -132,8 +132,8 @@ void cDelayedFluidSimulator::Simulate(float a_Dt)
void cDelayedFluidSimulator::SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk * a_Chunk)
{
- void * ChunkDataRaw = (m_FluidBlock == E_BLOCK_WATER) ? a_Chunk->GetWaterSimulatorData() : a_Chunk->GetLavaSimulatorData();
- cDelayedFluidSimulatorChunkData * ChunkData = (cDelayedFluidSimulatorChunkData *)ChunkDataRaw;
+ auto ChunkDataRaw = (m_FluidBlock == E_BLOCK_WATER) ? a_Chunk->GetWaterSimulatorData() : a_Chunk->GetLavaSimulatorData();
+ cDelayedFluidSimulatorChunkData * ChunkData = static_cast<cDelayedFluidSimulatorChunkData *>(ChunkDataRaw);
cDelayedFluidSimulatorChunkData::cSlot & Slot = ChunkData->m_Slots[m_SimSlotNum];
// Simulate all the blocks in the scheduled slot:
@@ -148,7 +148,7 @@ void cDelayedFluidSimulator::SimulateChunk(std::chrono::milliseconds a_Dt, int a
{
SimulateBlock(a_Chunk, itr->x, itr->y, itr->z);
}
- m_TotalBlocks -= (int)Blocks.size();
+ m_TotalBlocks -= static_cast<int>(Blocks.size());
Blocks.clear();
}
}
diff --git a/src/Simulator/FloodyFluidSimulator.cpp b/src/Simulator/FloodyFluidSimulator.cpp
index a9481edb0..69c46f090 100644
--- a/src/Simulator/FloodyFluidSimulator.cpp
+++ b/src/Simulator/FloodyFluidSimulator.cpp
@@ -255,7 +255,14 @@ void cFloodyFluidSimulator::SpreadToNeighbor(cChunk * a_NearChunk, int a_RelX, i
);
a_NearChunk->SetBlock(a_RelX, a_RelY, a_RelZ, NewBlock, 0);
- a_NearChunk->BroadcastSoundEffect("random.fizz", (double)BlockX, (double)a_RelY, (double)BlockZ, 0.5f, 1.5f);
+ a_NearChunk->BroadcastSoundEffect(
+ "random.fizz",
+ static_cast<double>(BlockX),
+ static_cast<double>(a_RelY),
+ static_cast<double>(BlockZ),
+ 0.5f,
+ 1.5f
+ );
return;
}
}
@@ -270,7 +277,14 @@ void cFloodyFluidSimulator::SpreadToNeighbor(cChunk * a_NearChunk, int a_RelX, i
);
a_NearChunk->SetBlock(a_RelX, a_RelY, a_RelZ, NewBlock, 0);
- a_NearChunk->BroadcastSoundEffect("random.fizz", (double)BlockX, (double)a_RelY, (double)BlockZ, 0.5f, 1.5f);
+ a_NearChunk->BroadcastSoundEffect(
+ "random.fizz",
+ static_cast<double>(BlockX),
+ static_cast<double>(a_RelY),
+ static_cast<double>(BlockZ),
+ 0.5f,
+ 1.5f
+ );
return;
}
}
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp
index 7f320af0d..7d9cc93b2 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -3,11 +3,10 @@
#include "BlockEntities/ChestEntity.h"
-typedef cItemCallback<cChestEntity> cChestCallback;
-
#include "Chunk.h"
#include "World.h"
#include "Blocks/GetHandlerCompileTimeTemplate.h"
+#include "Blocks/BlockComparator.h"
#include "Blocks/BlockTorch.h"
#include "Blocks/BlockLever.h"
#include "Blocks/BlockButton.h"
@@ -25,41 +24,42 @@ typedef cItemCallback<cChestEntity> cChestCallback;
-void cIncrementalRedstoneSimulator::RedstoneAddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk, cChunk * a_OtherChunk)
+void cIncrementalRedstoneSimulator::AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk)
{
- if ((a_Chunk == nullptr) || !a_Chunk->IsValid())
+ AddBlock(cChunkDef::AbsoluteToRelative({ a_BlockX, a_BlockY, a_BlockZ }, a_Chunk->GetPosX(), a_Chunk->GetPosZ()), a_Chunk, nullptr);
+}
+
+
+
+
+
+void cIncrementalRedstoneSimulator::AddBlock(const Vector3i & a_RelBlockPosition, cChunk * a_OriginalChunk, cChunk * a_NeighborChunk)
+{
+ if ((a_OriginalChunk == nullptr) || !a_OriginalChunk->IsValid())
{
return;
}
- else if ((a_BlockY < 0) || (a_BlockY >= cChunkDef::Height))
+ else if ((a_RelBlockPosition.y < 0) || (a_RelBlockPosition.y >= cChunkDef::Height))
{
return;
}
- // We may be called with coordinates in a chunk that is not the first chunk parameter
- // In that case, the actual chunk (which the coordinates are in), will be passed as the second parameter
- // Use that Chunk pointer to get a relative position
+ // The relative block position is relative to the neighboring chunk should it be passed as an argument
- int RelX = 0;
- int RelZ = 0;
BLOCKTYPE Block;
NIBBLETYPE Meta;
- if (a_OtherChunk != nullptr)
+ if (a_NeighborChunk != nullptr)
{
- RelX = a_BlockX - a_OtherChunk->GetPosX() * cChunkDef::Width;
- RelZ = a_BlockZ - a_OtherChunk->GetPosZ() * cChunkDef::Width;
- a_OtherChunk->GetBlockTypeMeta(RelX, a_BlockY, RelZ, Block, Meta);
+ a_NeighborChunk->UnboundedRelGetBlock(a_RelBlockPosition.x, a_RelBlockPosition.y, a_RelBlockPosition.z, Block, Meta);
- // If a_OtherChunk is passed (not nullptr), it is the chunk that had a block change, and a_Chunk will be the neighbouring chunk of that block
+ // If a_OtherChunk is passed (not nullptr), it is the neighbouring chunk of a_Chunk, which itself is the chunk with the block change
// Because said neighbouring chunk does not know of this change but still needs to update its redstone, we set it to dirty
- a_Chunk->SetIsRedstoneDirty(true);
+ a_NeighborChunk->SetIsRedstoneDirty(true);
}
else
{
- RelX = a_BlockX - a_Chunk->GetPosX() * cChunkDef::Width;
- RelZ = a_BlockZ - a_Chunk->GetPosZ() * cChunkDef::Width;
- a_Chunk->GetBlockTypeMeta(RelX, a_BlockY, RelZ, Block, Meta);
+ a_OriginalChunk->GetBlockTypeMeta(a_RelBlockPosition.x, a_RelBlockPosition.y, a_RelBlockPosition.z, Block, Meta);
}
// Every time a block is changed (AddBlock called), we want to go through all lists and check to see if the coordiantes stored within are still valid
@@ -77,68 +77,61 @@ void cIncrementalRedstoneSimulator::RedstoneAddBlock(int a_BlockX, int a_BlockY,
)
)
{
- SetSourceUnpowered(RelX, a_BlockY, RelZ, a_OtherChunk != nullptr ? a_OtherChunk : a_Chunk);
+ SetSourceUnpowered(a_RelBlockPosition.x, a_RelBlockPosition.y, a_RelBlockPosition.z, a_NeighborChunk != nullptr ? a_NeighborChunk : a_OriginalChunk);
}
if (!IsViableMiddleBlock(Block))
{
- SetInvalidMiddleBlock(RelX, a_BlockY, RelZ, a_OtherChunk != nullptr ? a_OtherChunk : a_Chunk);
+ SetInvalidMiddleBlock(a_RelBlockPosition.x, a_RelBlockPosition.y, a_RelBlockPosition.z, a_NeighborChunk != nullptr ? a_NeighborChunk : a_OriginalChunk);
}
- auto & SimulatedPlayerToggleableBlocks = ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_SimulatedPlayerToggleableBlocks;
- SimulatedPlayerToggleableBlocks.erase(std::remove_if(SimulatedPlayerToggleableBlocks.begin(), SimulatedPlayerToggleableBlocks.end(), [RelX, a_BlockY, RelZ, Block, this](const sSimulatedPlayerToggleableList & itr)
- {
- return itr.a_RelBlockPos.Equals(Vector3i(RelX, a_BlockY, RelZ)) && !IsAllowedBlock(Block);
- }
- ), SimulatedPlayerToggleableBlocks.end());
-
-
- auto & RepeatersDelayList = ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_RepeatersDelayList;
- RepeatersDelayList.erase(std::remove_if(RepeatersDelayList.begin(), RepeatersDelayList.end(), [RelX, a_BlockY, RelZ, Block](const sRepeatersDelayList & itr)
- {
- return itr.a_RelBlockPos.Equals(Vector3i(RelX, a_BlockY, RelZ)) && (Block != E_BLOCK_REDSTONE_REPEATER_ON) && (Block != E_BLOCK_REDSTONE_REPEATER_OFF);
- }
- ), RepeatersDelayList.end());
-
- if (a_OtherChunk != nullptr)
+ if (a_NeighborChunk != nullptr)
{
// DO NOT touch our chunk's data structure if we are being called with coordinates from another chunk - this one caused me massive grief :P
return;
}
+ auto RedstoneSimulatorData = static_cast<cIncrementalRedstoneSimulatorChunkData *>(a_OriginalChunk->GetRedstoneSimulatorData());
- cCoordWithBlockAndBoolVector & RedstoneSimulatorChunkData = ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_ChunkData;
- for (auto & itr : RedstoneSimulatorChunkData)
+ auto & SimulatedPlayerToggleableBlocks = RedstoneSimulatorData->m_SimulatedPlayerToggleableBlocks;
+ if (DoesIgnorePlayerToggle(Block))
{
- if ((itr.x == RelX) && (itr.y == a_BlockY) && (itr.z == RelZ)) // We are at an entry matching the current (changed) block
- {
- if (!IsAllowedBlock(Block))
- {
- itr.DataTwo = true; // The new blocktype is not redstone; it must be queued to be removed from this list
- }
- else
- {
- itr.DataTwo = false;
- itr.Data = Block; // Update block information
- }
- return;
- }
+ // Initialise the toggleable blocks list so that trapdoors etc. aren't reset on restart (#1887)
+ SimulatedPlayerToggleableBlocks.emplace(
+ a_RelBlockPosition,
+ AreCoordsDirectlyPowered(a_RelBlockPosition.x, a_RelBlockPosition.y, a_RelBlockPosition.z, a_OriginalChunk) || AreCoordsLinkedPowered(a_RelBlockPosition.x, a_RelBlockPosition.y, a_RelBlockPosition.z, a_OriginalChunk)
+ ); // This map won't insert if key already present, so no need to check
+ }
+ else
+ {
+ SimulatedPlayerToggleableBlocks.erase(a_RelBlockPosition);
}
+ if ((Block != E_BLOCK_REDSTONE_REPEATER_ON) && (Block != E_BLOCK_REDSTONE_REPEATER_OFF))
+ {
+ RedstoneSimulatorData->m_RepeatersDelayList.erase(a_RelBlockPosition);
+ }
+
+ auto & RedstoneSimulatorChunkData = RedstoneSimulatorData->m_ChunkData;
+ auto Iterator = RedstoneSimulatorChunkData.find(a_RelBlockPosition);
if (!IsAllowedBlock(Block))
{
+ if (Iterator != RedstoneSimulatorChunkData.end())
+ {
+ Iterator->second.second = true; // The new blocktype is not redstone; it must be queued to be removed from this list
+ }
return;
}
-
- cCoordWithBlockAndBoolVector & QueuedData = ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_QueuedChunkData;
- for (const auto & itr : QueuedData)
+ else
{
- if ((itr.x == RelX) && (itr.y == a_BlockY) && (itr.z == RelZ))
+ if (Iterator != RedstoneSimulatorChunkData.end())
{
- // Can't have duplicates in here either, in case something adds the block again before the structure can written to the main chunk data
+ Iterator->second.second = false; // De-schedule removal from list
+ Iterator->second.first = Block; // Update block information
return;
}
}
- QueuedData.emplace_back(cCoordWithBlockAndBool(RelX, a_BlockY, RelZ, Block, false));
+
+ RedstoneSimulatorChunkData.emplace(a_RelBlockPosition, std::make_pair(Block, false));
}
@@ -147,25 +140,17 @@ void cIncrementalRedstoneSimulator::RedstoneAddBlock(int a_BlockX, int a_BlockY,
void cIncrementalRedstoneSimulator::SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk * a_Chunk)
{
- m_RedstoneSimulatorChunkData = (cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData();
+ m_RedstoneSimulatorChunkData = static_cast<cIncrementalRedstoneSimulatorChunkData *>(a_Chunk->GetRedstoneSimulatorData());
if (m_RedstoneSimulatorChunkData == nullptr)
{
m_RedstoneSimulatorChunkData = new cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData();
a_Chunk->SetRedstoneSimulatorData(m_RedstoneSimulatorChunkData);
}
- if (m_RedstoneSimulatorChunkData->m_ChunkData.empty() && ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_QueuedChunkData.empty())
+ if (m_RedstoneSimulatorChunkData->m_ChunkData.empty())
{
return;
}
- m_RedstoneSimulatorChunkData->m_ChunkData.insert(
- m_RedstoneSimulatorChunkData->m_ChunkData.end(),
- m_RedstoneSimulatorChunkData->m_QueuedChunkData.begin(),
- m_RedstoneSimulatorChunkData->m_QueuedChunkData.end()
- );
-
- m_RedstoneSimulatorChunkData->m_QueuedChunkData.clear();
-
m_PoweredBlocks = &m_RedstoneSimulatorChunkData->m_PoweredBlocks;
m_RepeatersDelayList = &m_RedstoneSimulatorChunkData->m_RepeatersDelayList;
m_SimulatedPlayerToggleableBlocks = &m_RedstoneSimulatorChunkData->m_SimulatedPlayerToggleableBlocks;
@@ -185,24 +170,25 @@ void cIncrementalRedstoneSimulator::SimulateChunk(std::chrono::milliseconds a_Dt
for (auto dataitr = m_RedstoneSimulatorChunkData->m_ChunkData.begin(); dataitr != m_RedstoneSimulatorChunkData->m_ChunkData.end();)
{
- if (dataitr->DataTwo)
+ if (dataitr->second.second)
{
+ // Removal was scheduled - do so
dataitr = m_RedstoneSimulatorChunkData->m_ChunkData.erase(dataitr);
continue;
}
- switch (dataitr->Data)
+ switch (dataitr->second.first) // Call the appropriate simulator for the entry's block type
{
- case E_BLOCK_DAYLIGHT_SENSOR: HandleDaylightSensor(dataitr->x, dataitr->y, dataitr->z); break;
- case E_BLOCK_TRIPWIRE: HandleTripwire(dataitr->x, dataitr->y, dataitr->z); break;
- case E_BLOCK_TRIPWIRE_HOOK: HandleTripwireHook(dataitr->x, dataitr->y, dataitr->z); break;
+ case E_BLOCK_DAYLIGHT_SENSOR: HandleDaylightSensor(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
+ case E_BLOCK_TRIPWIRE: HandleTripwire(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
+ case E_BLOCK_TRIPWIRE_HOOK: HandleTripwireHook(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
case E_BLOCK_WOODEN_PRESSURE_PLATE:
case E_BLOCK_STONE_PRESSURE_PLATE:
case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE:
case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE:
{
- HandlePressurePlate(dataitr->x, dataitr->y, dataitr->z, dataitr->Data);
+ HandlePressurePlate(dataitr->first.x, dataitr->first.y, dataitr->first.z, dataitr->second.first);
break;
}
default: break;
@@ -210,23 +196,23 @@ void cIncrementalRedstoneSimulator::SimulateChunk(std::chrono::milliseconds a_Dt
if (ShouldUpdateSimulateOnceBlocks)
{
- switch (dataitr->Data)
+ switch (dataitr->second.first)
{
- case E_BLOCK_REDSTONE_WIRE: HandleRedstoneWire(dataitr->x, dataitr->y, dataitr->z); break;
- case E_BLOCK_COMMAND_BLOCK: HandleCommandBlock(dataitr->x, dataitr->y, dataitr->z); break;
- case E_BLOCK_NOTE_BLOCK: HandleNoteBlock(dataitr->x, dataitr->y, dataitr->z); break;
- case E_BLOCK_BLOCK_OF_REDSTONE: HandleRedstoneBlock(dataitr->x, dataitr->y, dataitr->z); break;
- case E_BLOCK_LEVER: HandleRedstoneLever(dataitr->x, dataitr->y, dataitr->z); break;
- case E_BLOCK_TNT: HandleTNT(dataitr->x, dataitr->y, dataitr->z); break;
- case E_BLOCK_IRON_TRAPDOOR: HandleTrapdoor(dataitr->x, dataitr->y, dataitr->z); break;
- case E_BLOCK_TRAPDOOR: HandleTrapdoor(dataitr->x, dataitr->y, dataitr->z); break;
- case E_BLOCK_TRAPPED_CHEST: HandleTrappedChest(dataitr->x, dataitr->y, dataitr->z); break;
+ case E_BLOCK_REDSTONE_WIRE: HandleRedstoneWire(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
+ case E_BLOCK_COMMAND_BLOCK: HandleCommandBlock(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
+ case E_BLOCK_NOTE_BLOCK: HandleNoteBlock(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
+ case E_BLOCK_BLOCK_OF_REDSTONE: HandleRedstoneBlock(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
+ case E_BLOCK_LEVER: HandleRedstoneLever(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
+ case E_BLOCK_TNT: HandleTNT(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
+ case E_BLOCK_IRON_TRAPDOOR: HandleTrapdoor(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
+ case E_BLOCK_TRAPDOOR: HandleTrapdoor(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
+ case E_BLOCK_TRAPPED_CHEST: HandleTrappedChest(dataitr->first.x, dataitr->first.y, dataitr->first.z); break;
case E_BLOCK_ACTIVATOR_RAIL:
case E_BLOCK_DETECTOR_RAIL:
case E_BLOCK_POWERED_RAIL:
{
- HandleRail(dataitr->x, dataitr->y, dataitr->z, dataitr->Data);
+ HandleRail(dataitr->first.x, dataitr->first.y, dataitr->first.z, dataitr->second.first);
break;
}
case E_BLOCK_ACACIA_DOOR:
@@ -237,7 +223,7 @@ void cIncrementalRedstoneSimulator::SimulateChunk(std::chrono::milliseconds a_Dt
case E_BLOCK_WOODEN_DOOR:
case E_BLOCK_IRON_DOOR:
{
- HandleDoor(dataitr->x, dataitr->y, dataitr->z);
+ HandleDoor(dataitr->first.x, dataitr->first.y, dataitr->first.z);
break;
}
case E_BLOCK_ACACIA_FENCE_GATE:
@@ -247,43 +233,49 @@ void cIncrementalRedstoneSimulator::SimulateChunk(std::chrono::milliseconds a_Dt
case E_BLOCK_JUNGLE_FENCE_GATE:
case E_BLOCK_SPRUCE_FENCE_GATE:
{
- HandleFenceGate(dataitr->x, dataitr->y, dataitr->z);
+ HandleFenceGate(dataitr->first.x, dataitr->first.y, dataitr->first.z);
break;
}
case E_BLOCK_REDSTONE_LAMP_OFF:
case E_BLOCK_REDSTONE_LAMP_ON:
{
- HandleRedstoneLamp(dataitr->x, dataitr->y, dataitr->z, dataitr->Data);
+ HandleRedstoneLamp(dataitr->first.x, dataitr->first.y, dataitr->first.z, dataitr->second.first);
break;
}
case E_BLOCK_DISPENSER:
case E_BLOCK_DROPPER:
{
- HandleDropSpenser(dataitr->x, dataitr->y, dataitr->z);
+ HandleDropSpenser(dataitr->first.x, dataitr->first.y, dataitr->first.z);
break;
}
case E_BLOCK_PISTON:
case E_BLOCK_STICKY_PISTON:
{
- HandlePiston(dataitr->x, dataitr->y, dataitr->z);
+ HandlePiston(dataitr->first.x, dataitr->first.y, dataitr->first.z);
break;
}
case E_BLOCK_REDSTONE_REPEATER_OFF:
case E_BLOCK_REDSTONE_REPEATER_ON:
{
- HandleRedstoneRepeater(dataitr->x, dataitr->y, dataitr->z, dataitr->Data);
+ HandleRedstoneRepeater(dataitr->first.x, dataitr->first.y, dataitr->first.z, dataitr->second.first);
break;
}
case E_BLOCK_REDSTONE_TORCH_OFF:
case E_BLOCK_REDSTONE_TORCH_ON:
{
- HandleRedstoneTorch(dataitr->x, dataitr->y, dataitr->z, dataitr->Data);
+ HandleRedstoneTorch(dataitr->first.x, dataitr->first.y, dataitr->first.z, dataitr->second.first);
break;
}
case E_BLOCK_STONE_BUTTON:
case E_BLOCK_WOODEN_BUTTON:
{
- HandleRedstoneButton(dataitr->x, dataitr->y, dataitr->z);
+ HandleRedstoneButton(dataitr->first.x, dataitr->first.y, dataitr->first.z);
+ break;
+ }
+ case E_BLOCK_ACTIVE_COMPARATOR:
+ case E_BLOCK_INACTIVE_COMPARATOR:
+ {
+ HandleRedstoneComparator(dataitr->first.x, dataitr->first.y, dataitr->first.z);
break;
}
default: break;
@@ -299,23 +291,14 @@ void cIncrementalRedstoneSimulator::SimulateChunk(std::chrono::milliseconds a_Dt
void cIncrementalRedstoneSimulator::WakeUp(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk)
{
- if (AreCoordsOnChunkBoundary(a_BlockX, a_BlockY, a_BlockZ))
- {
- // On a chunk boundary, alert all four sides (i.e. at least one neighbouring chunk)
- AddBlock(a_BlockX, a_BlockY, a_BlockZ, a_Chunk);
+ auto CurrentChunkRelative = cChunkDef::AbsoluteToRelative({a_BlockX, a_BlockY, a_BlockZ}, a_Chunk->GetPosX(), a_Chunk->GetPosZ());
+ AddBlock(CurrentChunkRelative, a_Chunk); // Alert the current chunk which the block is present in
- // Pass the original coordinates, because when adding things to our simulator lists, we get the chunk that they are in, and therefore any updates need to preseve their position
- // RedstoneAddBlock to pass both the neighbouring chunk and the chunk which the coordinates are in and +- 2 in GetNeighbour() to accomodate for LinkedPowered blocks being 2 away from chunk boundaries
- RedstoneAddBlock(a_BlockX, a_BlockY, a_BlockZ, a_Chunk->GetNeighborChunk(a_BlockX - 2, a_BlockZ), a_Chunk);
- RedstoneAddBlock(a_BlockX, a_BlockY, a_BlockZ, a_Chunk->GetNeighborChunk(a_BlockX + 2, a_BlockZ), a_Chunk);
- RedstoneAddBlock(a_BlockX, a_BlockY, a_BlockZ, a_Chunk->GetNeighborChunk(a_BlockX, a_BlockZ - 2), a_Chunk);
- RedstoneAddBlock(a_BlockX, a_BlockY, a_BlockZ, a_Chunk->GetNeighborChunk(a_BlockX, a_BlockZ + 2), a_Chunk);
-
- return;
+ for (const auto & BoundaryChunk : GetAdjacentChunks(CurrentChunkRelative, a_Chunk))
+ {
+ // On a chunk boundary, alert all neighbouring chunks which may have a connection with this block
+ AddBlock(cChunkDef::AbsoluteToRelative({a_BlockX, a_BlockY, a_BlockZ}, BoundaryChunk->GetPosX(), BoundaryChunk->GetPosZ()), a_Chunk, BoundaryChunk);
}
-
- // Not on boundary, just alert this chunk for speed
- AddBlock(a_BlockX, a_BlockY, a_BlockZ, a_Chunk);
}
@@ -503,152 +486,278 @@ void cIncrementalRedstoneSimulator::HandleRedstoneButton(int a_RelBlockX, int a_
void cIncrementalRedstoneSimulator::HandleRedstoneWire(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ)
{
- static const struct // Define which directions the wire can receive power from
- {
- int x, y, z;
- } gCrossCoords[] =
+ static const eBlockFace BlockFaceOffsets[] =
{
- { 1, 0, 0 }, /* Wires on same level start */
- { -1, 0, 0 },
- { 0, 0, 1 },
- { 0, 0, -1 }, /* Wires on same level stop */
- { 1, 1, 0 }, /* Wires one higher, surrounding self start */
- { -1, 1, 0 },
- { 0, 1, 1 },
- { 0, 1, -1 }, /* Wires one higher, surrounding self stop */
- { 1, -1, 0 }, /* Wires one lower, surrounding self start */
- { -1, -1, 0 },
- { 0, -1, 1 },
- { 0, -1, -1 }, /* Wires one lower, surrounding self stop */
+ BLOCK_FACE_XM,
+ BLOCK_FACE_XP,
+ BLOCK_FACE_ZM,
+ BLOCK_FACE_ZP
};
- static const struct // Define which directions the wire will check for repeater prescence
+ static const Vector3i VectorOffsets[] =
{
- int x, y, z;
- } gSideCoords[] =
- {
- { 1, 0, 0 },
{ -1, 0, 0 },
- { 0, 0, 1 },
+ { 1, 0, 0 },
{ 0, 0, -1 },
- { 0, 1, 0 },
+ { 0, 0, 1 }
};
+ auto RelBlock = Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
+
// Check to see if directly beside a power source
- unsigned char MyPower;
- if (!IsWirePowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower))
+ unsigned char MyPower = IsWirePowered(RelBlock, m_Chunk);
+ m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
+ if (MyPower == 0)
{
- m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, 0);
+ SetSourceUnpowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, m_Chunk);
return;
}
- m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
-
- if (MyPower < 1)
+ if (MyPower == MAX_POWER_LEVEL)
+ {
+ std::vector<std::pair<Vector3i, cChunk *>> PotentialWireList = { std::make_pair(RelBlock, m_Chunk) };
+ while (!PotentialWireList.empty())
+ {
+ auto Current = PotentialWireList.back();
+ PotentialWireList.pop_back();
+ FindAndPowerBorderingWires(PotentialWireList, Current.first, Current.second);
+ }
+ }
+ else if (MyPower == 1)
{
return;
}
+ // Wire still powered, power blocks beneath and in direction of facing
MyPower--;
- for (size_t i = 0; i < ARRAYCOUNT(gCrossCoords); i++) // Loop through all directions to transfer or receive power
+ SetBlockPowered(a_RelBlockX, a_RelBlockY - 1, a_RelBlockZ, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
+ SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_YM, MyPower);
+
+ int BorderingMechanismCount = 0;
+ bool RepeaterPresent = false;
+ Vector3i OffsetToPower;
+
+ for (const auto & Offset : VectorOffsets)
{
- if ((i >= 4) && (i <= 7)) // If we are currently checking for wire surrounding ourself one block above...
+ BLOCKTYPE Block;
+ Vector3i AdjustedOffset = RelBlock + Offset;
+ if (m_Chunk->UnboundedRelGetBlockType(AdjustedOffset.x, AdjustedOffset.y, AdjustedOffset.z, Block))
{
- BLOCKTYPE Type = 0;
- if (a_RelBlockY >= cChunkDef::Height - 1)
+ switch (Block)
{
- continue;
- }
- if (!m_Chunk->UnboundedRelGetBlockType(a_RelBlockX, a_RelBlockY + 1, a_RelBlockZ, Type))
- {
- continue;
- }
- if (cBlockInfo::IsSolid(Type)) // If there is something solid above us (wire cut off)...
- {
- continue; // We don't receive power from that wire
+ case E_BLOCK_REDSTONE_REPEATER_OFF:
+ {
+ BorderingMechanismCount++;
+ if (!RepeaterPresent)
+ {
+ // TODO: only if wire is actually connected to repeater (repeater facing right way)
+ RepeaterPresent = true;
+ OffsetToPower = { -Offset.x, Offset.y, -Offset.z }; // Negate to obtain offset in opposite direction since wire powers that way
+ }
+ SetBlockPowered(AdjustedOffset, RelBlock, MyPower);
+ }
+ case E_BLOCK_REDSTONE_TORCH_ON:
+ case E_BLOCK_REDSTONE_WIRE:
+ {
+ BorderingMechanismCount++;
+ if (!RepeaterPresent)
+ {
+ OffsetToPower = { -Offset.x, Offset.y, -Offset.z };
+ }
+ }
+ default: break;
}
}
- else if ((i >= 8) && (i <= 11)) // See above, but this is for wire below us
+ }
+
+ if (BorderingMechanismCount == 0)
+ {
+ SetAllDirsAsPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
+ for (const auto & BlockFaceOffset : BlockFaceOffsets)
{
- BLOCKTYPE Type = 0;
- if (!m_Chunk->UnboundedRelGetBlockType(a_RelBlockX + gCrossCoords[i].x, a_RelBlockY, a_RelBlockZ + gCrossCoords[i].z, Type))
- {
- continue;
- }
- if (cBlockInfo::IsSolid(Type))
- {
- continue;
- }
+ SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BlockFaceOffset, MyPower);
}
+ }
+ else if (BorderingMechanismCount == 1)
+ {
+ eBlockFace Face = BlockFaceOffsets[std::distance(VectorOffsets, std::find(VectorOffsets, VectorOffsets + ARRAYCOUNT(VectorOffsets), OffsetToPower))];
+ SetBlockPowered(RelBlock + OffsetToPower, RelBlock, MyPower);
+ SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Face, MyPower);
+ }
+}
- BLOCKTYPE Type = 0;
- if (!m_Chunk->UnboundedRelGetBlockType(a_RelBlockX + gCrossCoords[i].x, a_RelBlockY + gCrossCoords[i].y, a_RelBlockZ + gCrossCoords[i].z, Type))
+
+
+
+
+void cIncrementalRedstoneSimulator::FindAndPowerBorderingWires(std::vector<std::pair<Vector3i, cChunk *>> & a_PotentialWireList, const Vector3i & a_EntryRelBlockPosition, cChunk * a_EntryChunk)
+{
+ static const Vector3i LevelOffsets[] = // Wires on same level
+ {
+ { 1, 0, 0 },
+ { -1, 0, 0 },
+ { 0, 0, 1 },
+ { 0, 0, -1 },
+ };
+ static const Vector3i HigherOffsets[] = // Wires one higher, surrounding self
+ {
+ { 1, 1, 0 },
+ { -1, 1, 0 },
+ { 0, 1, 1 },
+ { 0, 1, -1 },
+ };
+ static const Vector3i LowerOffsets[] = // Wires one lower, surrounding self
+ {
+ { 1, -1, 0 },
+ { -1, -1, 0 },
+ { 0, -1, 1 },
+ { 0, -1, -1 },
+ };
+
+ for (auto Offset : LevelOffsets)
+ {
+ auto AdjustedPos = a_EntryRelBlockPosition + Offset;
+ auto Neighbour = a_EntryChunk->GetRelNeighborChunkAdjustCoords(AdjustedPos.x, AdjustedPos.z);
+ auto MyPower = IsWirePowered(a_EntryRelBlockPosition, a_EntryChunk);
+
+ if ((Neighbour == nullptr) || !Neighbour->IsValid())
{
- continue;
+ return;
}
- if (Type == E_BLOCK_REDSTONE_WIRE)
+
+ if ((Neighbour->GetBlock(AdjustedPos) == E_BLOCK_REDSTONE_WIRE) && (MyPower > 1) && (MyPower > IsWirePowered(AdjustedPos, Neighbour)))
{
- SetBlockPowered(a_RelBlockX + gCrossCoords[i].x, a_RelBlockY + gCrossCoords[i].y, a_RelBlockZ + gCrossCoords[i].z, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
+ PowerBorderingWires(a_PotentialWireList, a_EntryRelBlockPosition, a_EntryChunk, AdjustedPos, Neighbour, MyPower);
}
}
- for (size_t i = 0; i < ARRAYCOUNT(gSideCoords); i++) // Look for repeaters immediately surrounding self and try to power them
+ for (auto Offset : HigherOffsets)
{
- BLOCKTYPE Type = 0;
- if (!m_Chunk->UnboundedRelGetBlockType(a_RelBlockX + gSideCoords[i].x, a_RelBlockY + gSideCoords[i].y, a_RelBlockZ + gSideCoords[i].z, Type))
+ auto AdjustedPos = a_EntryRelBlockPosition + Offset;
+ auto Neighbour = a_EntryChunk->GetRelNeighborChunkAdjustCoords(AdjustedPos.x, AdjustedPos.z);
+ auto MyPower = IsWirePowered(a_EntryRelBlockPosition, a_EntryChunk);
+
+ if ((Neighbour == nullptr) || !Neighbour->IsValid())
{
- continue;
+ return;
}
- if (Type == E_BLOCK_REDSTONE_REPEATER_OFF)
+
+ if (
+ (Neighbour->GetBlock(AdjustedPos) == E_BLOCK_REDSTONE_WIRE) &&
+ (!cBlockInfo::FullyOccupiesVoxel(a_EntryChunk->GetBlock(a_EntryRelBlockPosition.x, a_EntryRelBlockPosition.y + 1, a_EntryRelBlockPosition.z))) &&
+ (MyPower > 1) && (MyPower > IsWirePowered(AdjustedPos, Neighbour)))
{
- SetBlockPowered(a_RelBlockX + gSideCoords[i].x, a_RelBlockY + gSideCoords[i].y, a_RelBlockZ + gSideCoords[i].z, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
+ PowerBorderingWires(a_PotentialWireList, a_EntryRelBlockPosition, a_EntryChunk, AdjustedPos, Neighbour, MyPower);
}
}
- // Wire still powered, power blocks beneath
- SetBlockPowered(a_RelBlockX, a_RelBlockY - 1, a_RelBlockZ, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
- SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_YM, MyPower);
-
- switch (GetWireDirection(a_RelBlockX, a_RelBlockY, a_RelBlockZ))
+ for (auto Offset : LowerOffsets)
{
- case REDSTONE_NONE:
- {
- SetBlockPowered(a_RelBlockX + 1, a_RelBlockY, a_RelBlockZ, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
- SetBlockPowered(a_RelBlockX - 1, a_RelBlockY, a_RelBlockZ, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
- SetBlockPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ + 1, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
- SetBlockPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ - 1, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
+ auto AdjustedPos = a_EntryRelBlockPosition + Offset;
+ auto Neighbour = a_EntryChunk->GetRelNeighborChunkAdjustCoords(AdjustedPos.x, AdjustedPos.z);
+ auto MyPower = IsWirePowered(a_EntryRelBlockPosition, a_EntryChunk);
- SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_XM, MyPower);
- SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_XP, MyPower);
- SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_ZM, MyPower);
- SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_ZP, MyPower);
- break;
- }
- case REDSTONE_X_POS:
+ if ((Neighbour == nullptr) || !Neighbour->IsValid())
{
- SetBlockPowered(a_RelBlockX + 1, a_RelBlockY, a_RelBlockZ, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
- SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_XP, MyPower);
- break;
+ return;
}
- case REDSTONE_X_NEG:
+
+ if (
+ (Neighbour->GetBlock(AdjustedPos) == E_BLOCK_REDSTONE_WIRE) &&
+ (!cBlockInfo::FullyOccupiesVoxel(Neighbour->GetBlock(AdjustedPos.x, AdjustedPos.y + 1, AdjustedPos.z))) &&
+ (MyPower > 1) && (MyPower > IsWirePowered(AdjustedPos, Neighbour)))
{
- SetBlockPowered(a_RelBlockX - 1, a_RelBlockY, a_RelBlockZ, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
- SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_XM, MyPower);
- break;
+ PowerBorderingWires(a_PotentialWireList, a_EntryRelBlockPosition, a_EntryChunk, AdjustedPos, Neighbour, MyPower);
}
- case REDSTONE_Z_POS:
+ }
+}
+
+
+
+
+
+void cIncrementalRedstoneSimulator::PowerBorderingWires(std::vector<std::pair<Vector3i, cChunk *>> & a_PotentialWireList, const Vector3i & a_EntryRelSourcePosition, cChunk * a_EntryChunk, const Vector3i & a_AdjustedPos, cChunk * a_NeighbourChunk, unsigned char a_MyPower)
+{
+ auto SourcePos = a_EntryRelSourcePosition + Vector3i((a_EntryChunk->GetPosX() - a_NeighbourChunk->GetPosX()) * cChunkDef::Width, 0, (a_EntryChunk->GetPosZ() - a_NeighbourChunk->GetPosZ()) * cChunkDef::Width);
+ auto & PoweredBlocks = static_cast<cIncrementalRedstoneSimulatorChunkData *>(a_NeighbourChunk->GetRedstoneSimulatorData())->m_PoweredBlocks; // We need to insert the value into the chunk who owns the block position
+ auto Position = std::find_if(PoweredBlocks.begin(), PoweredBlocks.end(), [a_AdjustedPos, SourcePos, a_MyPower](const sPoweredBlocks & itr) { return ((itr.m_BlockPos == a_AdjustedPos) && (itr.m_SourcePos == SourcePos)); });
+ if (Position != PoweredBlocks.end())
+ {
+ Position->m_PowerLevel = a_MyPower - 1;
+ }
+ else
+ {
+ PoweredBlocks.emplace_back(a_AdjustedPos, SourcePos, a_MyPower - 1);
+
+ a_NeighbourChunk->SetIsRedstoneDirty(true);
+ m_Chunk->SetIsRedstoneDirty(true);
+ }
+
+ a_NeighbourChunk->SetMeta(a_AdjustedPos.x, a_AdjustedPos.y, a_AdjustedPos.z, a_MyPower - 1);
+ a_PotentialWireList.emplace_back(std::make_pair(a_AdjustedPos, a_NeighbourChunk));
+}
+
+
+
+
+
+void cIncrementalRedstoneSimulator::HandleRedstoneComparator(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ)
+{
+ auto Meta = m_Chunk->GetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
+ auto HighestSidePower = std::max(IsWirePowered(AdjustRelativeCoords(cBlockComparatorHandler::GetSideCoordinate(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Meta & 0x3, false)), m_Chunk), IsWirePowered(AdjustRelativeCoords(cBlockComparatorHandler::GetSideCoordinate(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Meta & 0x3, true)), m_Chunk));
+ auto FrontCoordinate = AdjustRelativeCoords(cBlockComparatorHandler::GetFrontCoordinate(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Meta & 0x3));
+ unsigned char Power = 0;
+
+ class cContainerCallback : public cBlockEntityCallback
+ {
+ public:
+ cContainerCallback() : m_SignalStrength(0)
{
- SetBlockPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ + 1, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
- SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_ZP, MyPower);
- break;
}
- case REDSTONE_Z_NEG:
+
+ virtual bool Item(cBlockEntity * a_BlockEntity) override
{
- SetBlockPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ - 1, a_RelBlockX, a_RelBlockY, a_RelBlockZ, MyPower);
- SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_ZM, MyPower);
- break;
+ auto & Contents = static_cast<cBlockEntityWithItems *>(a_BlockEntity)->GetContents();
+ float Fullness = 0; // Is a floating-point type to allow later calculation to produce a non-truncated value
+ for (int Slot = 0; Slot != Contents.GetNumSlots(); ++Slot)
+ {
+ Fullness += Contents.GetSlot(Slot).m_ItemCount / Contents.GetSlot(Slot).GetMaxStackSize();
+ }
+
+ m_SignalStrength = static_cast<unsigned char>(1 + (Fullness / Contents.GetNumSlots()) * 14);
+ return false;
}
+
+ unsigned char m_SignalStrength;
+ } CCB;
+
+ auto AbsoluteComparatorCoords = cChunkDef::RelativeToAbsolute(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ), m_Chunk->GetPosX(), m_Chunk->GetPosZ());
+ auto AbsoluteRearCoords = cBlockComparatorHandler::GetRearCoordinate(AbsoluteComparatorCoords.x, AbsoluteComparatorCoords.y, AbsoluteComparatorCoords.z, Meta & 0x3);
+
+ m_Chunk->DoWithBlockEntityAt(AbsoluteRearCoords.x, AbsoluteRearCoords.y, AbsoluteRearCoords.z, CCB);
+ auto RearPower = std::max(CCB.m_SignalStrength, IsWirePowered(AdjustRelativeCoords(cBlockComparatorHandler::GetRearCoordinate(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Meta & 0x3)), m_Chunk));
+
+ if ((Meta & 0x4) == 0x4)
+ {
+ // Subtraction mode
+ Power = std::max(static_cast<unsigned char>(RearPower - HighestSidePower), std::numeric_limits<unsigned char>::min());
+ }
+ else
+ {
+ // Comparison mode
+ Power = (std::max(HighestSidePower, RearPower) == HighestSidePower) ? 0 : RearPower;
+ }
+
+ if (Power > 0)
+ {
+ m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, m_Chunk->GetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ) | 0x8);
+ SetBlockPowered(FrontCoordinate, Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ), Power);
+ }
+ else
+ {
+ m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, m_Chunk->GetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ) & 0x7);
+ SetSourceUnpowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, m_Chunk);
}
}
@@ -680,19 +789,50 @@ void cIncrementalRedstoneSimulator::HandleRedstoneRepeater(int a_RelBlockX, int
*/
// Create a variable holding my meta to avoid multiple lookups.
- NIBBLETYPE a_Meta = m_Chunk->GetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
+ NIBBLETYPE Meta = m_Chunk->GetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
bool IsOn = (a_MyState == E_BLOCK_REDSTONE_REPEATER_ON);
- if (!IsRepeaterLocked(a_RelBlockX, a_RelBlockY, a_RelBlockZ, a_Meta)) // If we're locked, change nothing. Otherwise:
+ if (!IsRepeaterLocked(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Meta)) // If we're locked, change nothing. Otherwise:
{
- bool IsSelfPowered = IsRepeaterPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, a_Meta);
+ bool IsSelfPowered = IsRepeaterPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Meta);
if (IsSelfPowered && !IsOn) // Queue a power change if powered, but not on and not locked.
{
- QueueRepeaterPowerChange(a_RelBlockX, a_RelBlockY, a_RelBlockZ, a_Meta, true);
+ QueueRepeaterPowerChange(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Meta, true);
}
else if (!IsSelfPowered && IsOn) // Queue a power change if unpowered, on, and not locked.
{
- QueueRepeaterPowerChange(a_RelBlockX, a_RelBlockY, a_RelBlockZ, a_Meta, false);
+ QueueRepeaterPowerChange(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Meta, false);
+ }
+ }
+
+ if (IsOn)
+ {
+ switch (Meta & 0x3) // We only want the direction (bottom) bits
+ {
+ case 0x0:
+ {
+ SetBlockPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ - 1, a_RelBlockX, a_RelBlockY, a_RelBlockZ);
+ SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_ZM);
+ break;
+ }
+ case 0x1:
+ {
+ SetBlockPowered(a_RelBlockX + 1, a_RelBlockY, a_RelBlockZ, a_RelBlockX, a_RelBlockY, a_RelBlockZ);
+ SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_XP);
+ break;
+ }
+ case 0x2:
+ {
+ SetBlockPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ + 1, a_RelBlockX, a_RelBlockY, a_RelBlockZ);
+ SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_ZP);
+ break;
+ }
+ case 0x3:
+ {
+ SetBlockPowered(a_RelBlockX - 1, a_RelBlockY, a_RelBlockZ, a_RelBlockX, a_RelBlockY, a_RelBlockZ);
+ SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_XM);
+ break;
+ }
}
}
}
@@ -702,60 +842,29 @@ void cIncrementalRedstoneSimulator::HandleRedstoneRepeaterDelays()
{
for (auto itr = m_RepeatersDelayList->begin(); itr != m_RepeatersDelayList->end();)
{
- if (itr->a_ElapsedTicks >= itr->a_DelayTicks) // Has the elapsed ticks reached the target ticks?
+ if (itr->second.a_ElapsedTicks >= itr->second.a_DelayTicks) // Has the elapsed ticks reached the target ticks?
{
- int RelBlockX = itr->a_RelBlockPos.x;
- int RelBlockY = itr->a_RelBlockPos.y;
- int RelBlockZ = itr->a_RelBlockPos.z;
BLOCKTYPE Block;
NIBBLETYPE Meta;
- m_Chunk->GetBlockTypeMeta(RelBlockX, RelBlockY, RelBlockZ, Block, Meta);
- if (itr->ShouldPowerOn)
+ m_Chunk->GetBlockTypeMeta(itr->first.x, itr->first.y, itr->first.z, Block, Meta);
+ if (itr->second.ShouldPowerOn)
{
if (Block != E_BLOCK_REDSTONE_REPEATER_ON) // For performance
{
- m_Chunk->SetBlock(itr->a_RelBlockPos, E_BLOCK_REDSTONE_REPEATER_ON, Meta);
- }
-
- switch (Meta & 0x3) // We only want the direction (bottom) bits
- {
- case 0x0:
- {
- SetBlockPowered(RelBlockX, RelBlockY, RelBlockZ - 1, RelBlockX, RelBlockY, RelBlockZ);
- SetDirectionLinkedPowered(RelBlockX, RelBlockY, RelBlockZ, BLOCK_FACE_ZM);
- break;
- }
- case 0x1:
- {
- SetBlockPowered(RelBlockX + 1, RelBlockY, RelBlockZ, RelBlockX, RelBlockY, RelBlockZ);
- SetDirectionLinkedPowered(RelBlockX, RelBlockY, RelBlockZ, BLOCK_FACE_XP);
- break;
- }
- case 0x2:
- {
- SetBlockPowered(RelBlockX, RelBlockY, RelBlockZ + 1, RelBlockX, RelBlockY, RelBlockZ);
- SetDirectionLinkedPowered(RelBlockX, RelBlockY, RelBlockZ, BLOCK_FACE_ZP);
- break;
- }
- case 0x3:
- {
- SetBlockPowered(RelBlockX - 1, RelBlockY, RelBlockZ, RelBlockX, RelBlockY, RelBlockZ);
- SetDirectionLinkedPowered(RelBlockX, RelBlockY, RelBlockZ, BLOCK_FACE_XM);
- break;
- }
+ m_Chunk->SetBlock(itr->first, E_BLOCK_REDSTONE_REPEATER_ON, Meta);
}
}
else if (Block != E_BLOCK_REDSTONE_REPEATER_OFF)
{
- m_Chunk->SetBlock(RelBlockX, RelBlockY, RelBlockZ, E_BLOCK_REDSTONE_REPEATER_OFF, Meta);
+ m_Chunk->SetBlock(itr->first.x, itr->first.y, itr->first.z, E_BLOCK_REDSTONE_REPEATER_OFF, Meta);
}
itr = m_RepeatersDelayList->erase(itr);
}
else
{
- LOGD("Incremented a repeater @ {%i %i %i} | Elapsed ticks: %i | Target delay: %i", itr->a_RelBlockPos.x, itr->a_RelBlockPos.y, itr->a_RelBlockPos.z, itr->a_ElapsedTicks, itr->a_DelayTicks);
- itr->a_ElapsedTicks++;
- itr++;
+ LOGD("Incremented a repeater @ {%i %i %i} | Elapsed ticks: %i | Target delay: %i", itr->first.x, itr->first.y, itr->first.z, itr->second.a_ElapsedTicks, itr->second.a_DelayTicks);
+ itr->second.a_ElapsedTicks++;
+ ++itr;
}
}
}
@@ -1017,19 +1126,19 @@ void cIncrementalRedstoneSimulator::HandleDaylightSensor(int a_RelBlockX, int a_
int ChunkX, ChunkZ;
cChunkDef::BlockToChunk(BlockX, BlockZ, ChunkX, ChunkZ);
- if (!this->m_World.IsChunkLighted(ChunkX, ChunkZ))
+ if (!m_World.IsChunkLighted(ChunkX, ChunkZ))
{
- this->m_World.QueueLightChunk(ChunkX, ChunkZ);
+ m_World.QueueLightChunk(ChunkX, ChunkZ);
}
else
{
- if (m_Chunk->GetTimeAlteredLight(this->m_World.GetBlockSkyLight(BlockX, a_RelBlockY + 1, BlockZ)) > 8)
+ if (m_Chunk->GetTimeAlteredLight(m_Chunk->GetSkyLight(a_RelBlockX, a_RelBlockY + 1, a_RelBlockZ)) > 8)
{
SetAllDirsAsPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
}
else
{
- WakeUp(BlockX, a_RelBlockY, BlockZ, m_Chunk);
+ SetSourceUnpowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, m_Chunk);
}
}
}
@@ -1452,30 +1561,18 @@ bool cIncrementalRedstoneSimulator::AreCoordsDirectlyPowered(int a_RelBlockX, in
{
// Torches want to access neighbour's data when on a wall, hence the extra chunk parameter
- for (const auto & itr : ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_PoweredBlocks) // Check powered list
- {
- if (itr.a_BlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
- {
- return true;
- }
- }
- return false;
+ const auto & Data = static_cast<cIncrementalRedstoneSimulatorChunkData *>(a_Chunk->GetRedstoneSimulatorData())->m_PoweredBlocks;
+ return std::find_if(Data.begin(), Data.end(), [a_RelBlockX, a_RelBlockY, a_RelBlockZ](const sPoweredBlocks & itr) { return itr.m_BlockPos == Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ); }) != Data.end();
}
-bool cIncrementalRedstoneSimulator::AreCoordsLinkedPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ)
+bool cIncrementalRedstoneSimulator::AreCoordsLinkedPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, cChunk * a_Chunk)
{
- for (const auto & itr : *m_LinkedPoweredBlocks) // Check linked powered list
- {
- if (itr.a_BlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
- {
- return true;
- }
- }
- return false;
+ const auto & Data = static_cast<cIncrementalRedstoneSimulatorChunkData *>(a_Chunk->GetRedstoneSimulatorData())->m_LinkedBlocks;
+ return std::find_if(Data.begin(), Data.end(), [a_RelBlockX, a_RelBlockY, a_RelBlockZ](const sLinkedPoweredBlocks & itr) { return itr.a_BlockPos == Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ); }) != Data.end();
}
@@ -1488,7 +1585,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterPowered(int a_RelBlockX, int a_Rel
for (const auto & itr : *m_PoweredBlocks)
{
- if (!itr.a_BlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
+ if (!itr.m_BlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
{
continue;
}
@@ -1498,7 +1595,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterPowered(int a_RelBlockX, int a_Rel
case 0x0:
{
// Flip the coords to check the back of the repeater
- if (itr.a_SourcePos.Equals(AdjustRelativeCoords(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ + 1))))
+ if (itr.m_SourcePos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ + 1)))
{
return true;
}
@@ -1506,7 +1603,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterPowered(int a_RelBlockX, int a_Rel
}
case 0x1:
{
- if (itr.a_SourcePos.Equals(AdjustRelativeCoords(Vector3i(a_RelBlockX - 1, a_RelBlockY, a_RelBlockZ))))
+ if (itr.m_SourcePos.Equals(Vector3i(a_RelBlockX - 1, a_RelBlockY, a_RelBlockZ)))
{
return true;
}
@@ -1514,7 +1611,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterPowered(int a_RelBlockX, int a_Rel
}
case 0x2:
{
- if (itr.a_SourcePos.Equals(AdjustRelativeCoords(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ - 1))))
+ if (itr.m_SourcePos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ - 1)))
{
return true;
}
@@ -1522,7 +1619,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterPowered(int a_RelBlockX, int a_Rel
}
case 0x3:
{
- if (itr.a_SourcePos.Equals(AdjustRelativeCoords(Vector3i(a_RelBlockX + 1, a_RelBlockY, a_RelBlockZ))))
+ if (itr.m_SourcePos.Equals(Vector3i(a_RelBlockX + 1, a_RelBlockY, a_RelBlockZ)))
{
return true;
}
@@ -1542,7 +1639,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterPowered(int a_RelBlockX, int a_Rel
{
case 0x0:
{
- if (itr.a_MiddlePos.Equals(AdjustRelativeCoords(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ + 1))))
+ if (itr.a_MiddlePos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ + 1)))
{
return true;
}
@@ -1550,7 +1647,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterPowered(int a_RelBlockX, int a_Rel
}
case 0x1:
{
- if (itr.a_MiddlePos.Equals(AdjustRelativeCoords(Vector3i(a_RelBlockX - 1, a_RelBlockY, a_RelBlockZ))))
+ if (itr.a_MiddlePos.Equals(Vector3i(a_RelBlockX - 1, a_RelBlockY, a_RelBlockZ)))
{
return true;
}
@@ -1558,7 +1655,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterPowered(int a_RelBlockX, int a_Rel
}
case 0x2:
{
- if (itr.a_MiddlePos.Equals(AdjustRelativeCoords(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ - 1))))
+ if (itr.a_MiddlePos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ - 1)))
{
return true;
}
@@ -1566,7 +1663,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterPowered(int a_RelBlockX, int a_Rel
}
case 0x3:
{
- if (itr.a_MiddlePos.Equals(AdjustRelativeCoords(Vector3i(a_RelBlockX + 1, a_RelBlockY, a_RelBlockZ))))
+ if (itr.a_MiddlePos.Equals(Vector3i(a_RelBlockX + 1, a_RelBlockY, a_RelBlockZ)))
{
return true;
}
@@ -1667,7 +1764,7 @@ bool cIncrementalRedstoneSimulator::IsPistonPowered(int a_RelBlockX, int a_RelBl
for (const auto & itr : *m_PoweredBlocks)
{
- if (!itr.a_BlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
+ if (!itr.m_BlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
{
continue;
}
@@ -1675,7 +1772,7 @@ bool cIncrementalRedstoneSimulator::IsPistonPowered(int a_RelBlockX, int a_RelBl
int X = a_RelBlockX, Z = a_RelBlockZ;
AddFaceDirection(X, a_RelBlockY, Z, Face);
- if (!itr.a_SourcePos.Equals(AdjustRelativeCoords(Vector3i(X, a_RelBlockY, Z))))
+ if (!itr.m_SourcePos.Equals(AdjustRelativeCoords(Vector3i(X, a_RelBlockY, Z))))
{
return true;
}
@@ -1702,35 +1799,35 @@ bool cIncrementalRedstoneSimulator::IsPistonPowered(int a_RelBlockX, int a_RelBl
-bool cIncrementalRedstoneSimulator::IsWirePowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, unsigned char & a_PowerLevel)
+unsigned char cIncrementalRedstoneSimulator::IsWirePowered(Vector3i a_RelBlockPosition, cChunk * a_Chunk)
{
- a_PowerLevel = 0;
+ unsigned char PowerLevel = 0;
- for (const auto & itr : *m_PoweredBlocks) // Check powered list
+ for (const auto & itr : static_cast<cIncrementalRedstoneSimulatorChunkData *>(a_Chunk->GetRedstoneSimulatorData())->m_PoweredBlocks) // Check powered list
{
- if (!itr.a_BlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
+ if (itr.m_BlockPos != a_RelBlockPosition)
{
continue;
}
- a_PowerLevel = std::max(itr.a_PowerLevel, a_PowerLevel); // Get the highest power level (a_PowerLevel is initialised already and there CAN be multiple levels for one block)
+ PowerLevel = std::max(itr.m_PowerLevel, PowerLevel); // Get the highest power level (a_PowerLevel is initialised already and there CAN be multiple levels for one block)
}
- for (const auto & itr : *m_LinkedPoweredBlocks) // Check linked powered list
+ for (const auto & itr : static_cast<cIncrementalRedstoneSimulatorChunkData *>(a_Chunk->GetRedstoneSimulatorData())->m_LinkedBlocks) // Check linked powered list
{
- if (!itr.a_BlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
+ if (itr.a_BlockPos != a_RelBlockPosition)
{
continue;
}
BLOCKTYPE Type = E_BLOCK_AIR;
- if (!m_Chunk->UnboundedRelGetBlockType(itr.a_SourcePos.x, itr.a_SourcePos.y, itr.a_SourcePos.z, Type) || (Type == E_BLOCK_REDSTONE_WIRE))
+ if (!a_Chunk->UnboundedRelGetBlockType(itr.a_SourcePos.x, itr.a_SourcePos.y, itr.a_SourcePos.z, Type) || (Type == E_BLOCK_REDSTONE_WIRE))
{
continue;
}
- a_PowerLevel = std::max(itr.a_PowerLevel, a_PowerLevel);
+ PowerLevel = std::max(itr.a_PowerLevel, PowerLevel);
}
- return (a_PowerLevel != 0); // Answer the inital question: is the wire powered?
+ return PowerLevel;
}
@@ -1741,9 +1838,9 @@ bool cIncrementalRedstoneSimulator::AreCoordsSimulated(int a_RelBlockX, int a_Re
{
for (const auto & itr : *m_SimulatedPlayerToggleableBlocks)
{
- if (itr.a_RelBlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
+ if (itr.first.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
{
- if (itr.WasLastStatePowered != IsCurrentStatePowered) // Was the last power state different to the current?
+ if (itr.second != IsCurrentStatePowered) // Was the last power state different to the current?
{
return false; // It was, coordinates are no longer simulated
}
@@ -1869,22 +1966,19 @@ void cIncrementalRedstoneSimulator::SetDirectionLinkedPowered(int a_RelBlockX, i
void cIncrementalRedstoneSimulator::SetAllDirsAsPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, unsigned char a_PowerLevel)
{
- static const struct
- {
- int x, y, z;
- } gCrossCoords[] =
- {
- { 1, 0, 0 },
- { -1, 0, 0 },
- { 0, 0, 1 },
- { 0, 0, -1 },
- { 0, 1, 0 },
- { 0, -1, 0 }
+ static const Vector3i Offsets[] =
+ {
+ {1, 0, 0},
+ { -1, 0, 0},
+ {0, 0, 1},
+ {0, 0, -1},
+ {0, 1, 0},
+ {0, -1, 0}
};
- for (size_t i = 0; i < ARRAYCOUNT(gCrossCoords); i++) // Loop through struct to power all directions
+ for (auto Offset : Offsets) // Loop through struct to power all directions
{
- SetBlockPowered(a_RelBlockX + gCrossCoords[i].x, a_RelBlockY + gCrossCoords[i].y, a_RelBlockZ + gCrossCoords[i].z, a_RelBlockX, a_RelBlockY, a_RelBlockZ, a_PowerLevel);
+ SetBlockPowered(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ) + Offset, Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ), a_PowerLevel);
}
}
@@ -1892,62 +1986,33 @@ void cIncrementalRedstoneSimulator::SetAllDirsAsPowered(int a_RelBlockX, int a_R
-void cIncrementalRedstoneSimulator::SetBlockPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, int a_RelSourceX, int a_RelSourceY, int a_RelSourceZ, unsigned char a_PowerLevel)
+void cIncrementalRedstoneSimulator::SetBlockPowered(Vector3i a_RelBlockPosition, Vector3i a_RelSourcePosition, unsigned char a_PowerLevel)
{
- cChunk * Neighbour = m_Chunk->GetRelNeighborChunkAdjustCoords(a_RelBlockX, a_RelBlockZ); // Adjust coordinates for the later call using these values
+ cChunk * Neighbour = m_Chunk->GetRelNeighborChunkAdjustCoords(a_RelBlockPosition.x, a_RelBlockPosition.z); // Adjust coordinates for the later call using these values
if ((Neighbour == nullptr) || !Neighbour->IsValid())
{
return;
}
+ a_RelSourcePosition.x += (m_Chunk->GetPosX() - Neighbour->GetPosX()) * cChunkDef::Width;
+ a_RelSourcePosition.z += (m_Chunk->GetPosZ() - Neighbour->GetPosZ()) * cChunkDef::Width;
- auto & Powered = ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)Neighbour->GetRedstoneSimulatorData())->m_PoweredBlocks; // We need to insert the value into the chunk who owns the block position
- for (auto itr = Powered.begin(); itr != Powered.end(); ++itr)
+ auto & Powered = static_cast<cIncrementalRedstoneSimulatorChunkData *>(Neighbour->GetRedstoneSimulatorData())->m_PoweredBlocks; // We need to insert the value into the chunk who owns the block position
+ for (auto & itr : Powered)
{
- if (
- itr->a_BlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)) &&
- itr->a_SourcePos.Equals(Vector3i(a_RelSourceX, a_RelSourceY, a_RelSourceZ))
- )
+ if ((itr.m_BlockPos == a_RelBlockPosition) && (itr.m_SourcePos == a_RelSourcePosition))
{
- // Check for duplicates, update power level, don't add a new listing
- itr->a_PowerLevel = a_PowerLevel;
- return;
- }
- }
-
- // No need to get neighbouring chunk as we can guarantee that when something is powering us, the entry will be in our chunk
- for (auto itr = m_PoweredBlocks->begin(); itr != m_PoweredBlocks->end(); ++itr)
- {
- if (
- itr->a_BlockPos.Equals(Vector3i(a_RelSourceX, a_RelSourceY, a_RelSourceZ)) &&
- itr->a_SourcePos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)) &&
- (m_Chunk->GetBlock(a_RelSourceX, a_RelSourceY, a_RelSourceZ) == E_BLOCK_REDSTONE_WIRE)
- )
- {
- BLOCKTYPE Block;
- NIBBLETYPE Meta;
- Neighbour->GetBlockTypeMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Block, Meta);
-
- if (Block == E_BLOCK_REDSTONE_WIRE)
+ if (itr.m_PowerLevel != a_PowerLevel)
{
- if (Meta < a_PowerLevel)
- {
- m_PoweredBlocks->erase(itr); // Powering source with higher power level, allow it
- break;
- }
- else
- {
- // Powered wires try to power their source - don't let them!
- return;
- }
+ // Update power level, don't add a new listing
+ Neighbour->SetIsRedstoneDirty(true);
+ m_Chunk->SetIsRedstoneDirty(true);
+ itr.m_PowerLevel = a_PowerLevel;
}
+ return;
}
}
- sPoweredBlocks RC;
- RC.a_BlockPos = Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
- RC.a_SourcePos = Vector3i(a_RelSourceX, a_RelSourceY, a_RelSourceZ);
- RC.a_PowerLevel = a_PowerLevel;
- Powered.emplace_back(RC);
+ Powered.emplace_back(a_RelBlockPosition, a_RelSourcePosition, a_PowerLevel);
Neighbour->SetIsRedstoneDirty(true);
m_Chunk->SetIsRedstoneDirty(true);
}
@@ -1969,13 +2034,16 @@ void cIncrementalRedstoneSimulator::SetBlockLinkedPowered(
}
cChunk * Neighbour = m_Chunk->GetRelNeighborChunkAdjustCoords(a_RelBlockX, a_RelBlockZ);
- m_Chunk->GetRelNeighborChunkAdjustCoords(a_RelMiddleX, a_RelMiddleZ);
if ((Neighbour == nullptr) || !Neighbour->IsValid())
{
return;
}
+ a_RelMiddleX += (m_Chunk->GetPosX() - Neighbour->GetPosX()) * cChunkDef::Width;
+ a_RelMiddleZ += (m_Chunk->GetPosZ() - Neighbour->GetPosZ()) * cChunkDef::Width;
+ a_RelSourceX += (m_Chunk->GetPosX() - Neighbour->GetPosX()) * cChunkDef::Width;
+ a_RelSourceZ += (m_Chunk->GetPosZ() - Neighbour->GetPosZ()) * cChunkDef::Width;
- auto & Linked = ((cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)Neighbour->GetRedstoneSimulatorData())->m_LinkedBlocks;
+ auto & Linked = static_cast<cIncrementalRedstoneSimulatorChunkData *>(Neighbour->GetRedstoneSimulatorData())->m_LinkedBlocks;
for (auto & itr : Linked) // Check linked powered list
{
if (
@@ -1984,8 +2052,13 @@ void cIncrementalRedstoneSimulator::SetBlockLinkedPowered(
itr.a_SourcePos.Equals(Vector3i(a_RelSourceX, a_RelSourceY, a_RelSourceZ))
)
{
- // Check for duplicates, update power level, don't add a new listing
- itr.a_PowerLevel = a_PowerLevel;
+ if (itr.a_PowerLevel != a_PowerLevel)
+ {
+ // Update power level, don't add a new listing
+ Neighbour->SetIsRedstoneDirty(true);
+ m_Chunk->SetIsRedstoneDirty(true);
+ itr.a_PowerLevel = a_PowerLevel;
+ }
return;
}
}
@@ -2004,130 +2077,110 @@ void cIncrementalRedstoneSimulator::SetBlockLinkedPowered(
-void cIncrementalRedstoneSimulator::SetPlayerToggleableBlockAsSimulated(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, bool WasLastStatePowered)
+void cIncrementalRedstoneSimulator::SetPlayerToggleableBlockAsSimulated(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, bool a_WasLastStatePowered)
{
- for (auto itr = m_SimulatedPlayerToggleableBlocks->begin(); itr != m_SimulatedPlayerToggleableBlocks->end(); ++itr)
- {
- if (!itr->a_RelBlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
- {
- continue;
- }
-
- if (itr->WasLastStatePowered != WasLastStatePowered)
- {
- // If power states different, update listing
- itr->WasLastStatePowered = WasLastStatePowered;
- return;
- }
- else
- {
- // If states the same, just ignore
- return;
- }
- }
-
- // We have arrive here; no block must be in list - add one
- sSimulatedPlayerToggleableList RC;
- RC.a_RelBlockPos = Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
- RC.WasLastStatePowered = WasLastStatePowered;
- m_SimulatedPlayerToggleableBlocks->emplace_back(RC);
+ m_SimulatedPlayerToggleableBlocks->operator[](Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)) = a_WasLastStatePowered;
}
-bool cIncrementalRedstoneSimulator::QueueRepeaterPowerChange(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, NIBBLETYPE a_Meta, bool ShouldPowerOn)
+void cIncrementalRedstoneSimulator::QueueRepeaterPowerChange(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, NIBBLETYPE a_Meta, bool a_ShouldPowerOn)
{
- for (auto itr = m_RepeatersDelayList->begin(); itr != m_RepeatersDelayList->end(); ++itr)
- {
- if (itr->a_RelBlockPos.Equals(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)))
- {
- if (ShouldPowerOn == itr->ShouldPowerOn) // We are queued already for the same thing, don't replace entry
- {
- return false;
- }
-
- // Already in here (normal to allow repeater to continue on powering and updating blocks in front) - just update info and quit
- itr->a_DelayTicks = (((a_Meta & 0xC) >> 0x2) + 1) * 2; // See below for description
- itr->a_ElapsedTicks = 0;
- itr->ShouldPowerOn = ShouldPowerOn;
- return false;
- }
- }
-
- // Self not in list, add self to list
sRepeatersDelayList RC;
- RC.a_RelBlockPos = Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
// Gets the top two bits (delay time), shifts them into the lower two bits, and adds one (meta 0 = 1 tick; 1 = 2 etc.)
// Multiply by 2 because in MCS, 1 redstone tick = 1 world tick, but in Vanilla, 1 redstone tick = 2 world ticks, and we need to maintain compatibility
RC.a_DelayTicks = (((a_Meta & 0xC) >> 0x2) + 1) * 2;
-
RC.a_ElapsedTicks = 0;
- RC.ShouldPowerOn = ShouldPowerOn;
- m_RepeatersDelayList->emplace_back(RC);
- return true;
+ RC.ShouldPowerOn = a_ShouldPowerOn;
+
+ auto Result = m_RepeatersDelayList->emplace(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ), RC);
+ if (!Result.second)
+ {
+ // Key exists
+ if (a_ShouldPowerOn == Result.first->second.ShouldPowerOn)
+ {
+ // We are queued already for the same thing, don't replace entry
+ return;
+ }
+
+ Result.first->second.a_DelayTicks = RC.a_DelayTicks;
+ Result.first->second.a_ElapsedTicks = 0;
+ Result.first->second.ShouldPowerOn = a_ShouldPowerOn;
+ }
}
-void cIncrementalRedstoneSimulator::SetSourceUnpowered(int a_RelSourceX, int a_RelSourceY, int a_RelSourceZ, cChunk * a_Chunk, bool a_IsFirstCall)
+void cIncrementalRedstoneSimulator::SetSourceUnpowered(int a_RelSourceX, int a_RelSourceY, int a_RelSourceZ, cChunk * a_Chunk)
{
- if (!a_IsFirstCall) // The neighbouring chunks passed when this parameter is false may be invalid
+ if ((a_Chunk == nullptr) || !a_Chunk->IsValid())
+ {
+ return;
+ }
+ std::vector<std::pair<Vector3i, cChunk *>> BlocksPotentiallyUnpowered = { std::make_pair(Vector3i(a_RelSourceX, a_RelSourceY, a_RelSourceZ), a_Chunk) };
+
+ auto UnpoweringFunction = [&BlocksPotentiallyUnpowered](cChunk * a_LambdaChunk, const Vector3i & a_RelSource)
{
- if ((a_Chunk == nullptr) || !a_Chunk->IsValid())
+ BLOCKTYPE RepeaterType;
+ if (a_LambdaChunk->UnboundedRelGetBlockType(a_RelSource.x, a_RelSource.y, a_RelSource.z, RepeaterType) && (RepeaterType == E_BLOCK_REDSTONE_REPEATER_ON))
{
return;
}
- }
- std::vector<Vector3i> BlocksPotentiallyUnpowered;
+ auto Data = static_cast<cIncrementalRedstoneSimulatorChunkData *>(a_LambdaChunk->GetRedstoneSimulatorData());
+ Data->m_PoweredBlocks.erase(std::remove_if(Data->m_PoweredBlocks.begin(), Data->m_PoweredBlocks.end(), [&BlocksPotentiallyUnpowered, a_LambdaChunk, a_RelSource](const sPoweredBlocks & itr)
+ {
+ if (itr.m_SourcePos != a_RelSource)
+ {
+ return false;
+ }
- auto Data = (cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData();
- Data->m_PoweredBlocks.erase(std::remove_if(Data->m_PoweredBlocks.begin(), Data->m_PoweredBlocks.end(), [&BlocksPotentiallyUnpowered, a_Chunk, a_RelSourceX, a_RelSourceY, a_RelSourceZ](const sPoweredBlocks & itr)
- {
- if (itr.a_SourcePos.Equals(Vector3i(a_RelSourceX, a_RelSourceY, a_RelSourceZ)))
+ BlocksPotentiallyUnpowered.emplace_back(std::make_pair(itr.m_BlockPos, a_LambdaChunk));
+ a_LambdaChunk->SetIsRedstoneDirty(true);
+ return true;
+ }
+ ), Data->m_PoweredBlocks.end());
+
+ Data->m_LinkedBlocks.erase(std::remove_if(Data->m_LinkedBlocks.begin(), Data->m_LinkedBlocks.end(), [&BlocksPotentiallyUnpowered, a_LambdaChunk, a_RelSource](const sLinkedPoweredBlocks & itr)
{
- BlocksPotentiallyUnpowered.emplace_back(itr.a_BlockPos);
- a_Chunk->SetIsRedstoneDirty(true);
+ if (itr.a_SourcePos != a_RelSource)
+ {
+ return false;
+ }
+
+ BlocksPotentiallyUnpowered.emplace_back(std::make_pair(itr.a_BlockPos, a_LambdaChunk));
+ a_LambdaChunk->SetIsRedstoneDirty(true);
return true;
}
- return false;
- }
- ), Data->m_PoweredBlocks.end());
+ ), Data->m_LinkedBlocks.end());
- Data->m_LinkedBlocks.erase(std::remove_if(Data->m_LinkedBlocks.begin(), Data->m_LinkedBlocks.end(), [&BlocksPotentiallyUnpowered, a_Chunk, a_RelSourceX, a_RelSourceY, a_RelSourceZ](const sLinkedPoweredBlocks & itr)
+ for (const auto & BoundaryChunk : GetAdjacentChunks(a_RelSource, a_LambdaChunk))
{
- if (itr.a_SourcePos.Equals(Vector3i(a_RelSourceX, a_RelSourceY, a_RelSourceZ)))
+ auto BoundaryData = static_cast<cIncrementalRedstoneSimulatorChunkData *>(BoundaryChunk->GetRedstoneSimulatorData());
+ Vector3i ChunkAdjustedSource = a_RelSource;
+ ChunkAdjustedSource.x += (a_LambdaChunk->GetPosX() - BoundaryChunk->GetPosX()) * cChunkDef::Width;
+ ChunkAdjustedSource.z += (a_LambdaChunk->GetPosZ() - BoundaryChunk->GetPosZ()) * cChunkDef::Width;
+
+ if (
+ (std::find_if(BoundaryData->m_PoweredBlocks.begin(), BoundaryData->m_PoweredBlocks.end(), [ChunkAdjustedSource](const sPoweredBlocks & itr) { return (itr.m_SourcePos == ChunkAdjustedSource); }) != BoundaryData->m_PoweredBlocks.end()) ||
+ (std::find_if(BoundaryData->m_LinkedBlocks.begin(), BoundaryData->m_LinkedBlocks.end(), [ChunkAdjustedSource](const sLinkedPoweredBlocks & itr) { return (itr.a_SourcePos == ChunkAdjustedSource); }) != BoundaryData->m_LinkedBlocks.end())
+ )
{
- BlocksPotentiallyUnpowered.emplace_back(itr.a_BlockPos);
- a_Chunk->SetIsRedstoneDirty(true);
- return true;
+ BlocksPotentiallyUnpowered.emplace_back(std::make_pair(ChunkAdjustedSource, BoundaryChunk));
}
- return false;
}
- ), Data->m_LinkedBlocks.end());
-
- if (a_IsFirstCall && AreCoordsOnChunkBoundary(a_RelSourceX, a_RelSourceY, a_RelSourceZ))
- {
- // +- 2 to accomodate linked powered blocks
- SetSourceUnpowered(a_RelSourceX, a_RelSourceY, a_RelSourceZ, a_Chunk->GetRelNeighborChunk(a_RelSourceX - 2, a_RelSourceZ), false);
- SetSourceUnpowered(a_RelSourceX, a_RelSourceY, a_RelSourceZ, a_Chunk->GetRelNeighborChunk(a_RelSourceX + 2, a_RelSourceZ), false);
- SetSourceUnpowered(a_RelSourceX, a_RelSourceY, a_RelSourceZ, a_Chunk->GetRelNeighborChunk(a_RelSourceX, a_RelSourceZ - 2), false);
- SetSourceUnpowered(a_RelSourceX, a_RelSourceY, a_RelSourceZ, a_Chunk->GetRelNeighborChunk(a_RelSourceX, a_RelSourceZ + 2), false);
- }
+ };
- for (const auto & itr : BlocksPotentiallyUnpowered)
+ while (!BlocksPotentiallyUnpowered.empty())
{
- auto Neighbour = a_Chunk->GetRelNeighborChunk(itr.x, itr.z);
- if (!AreCoordsPowered(itr.x, itr.y, itr.z) && (Neighbour->GetBlock(itr) != E_BLOCK_REDSTONE_REPEATER_ON))
- {
- // Repeaters time themselves with regards to unpowering; ensure we don't do it for them
- SetSourceUnpowered(itr.x, itr.y, itr.z, Neighbour);
- }
+ auto End = BlocksPotentiallyUnpowered.back();
+ BlocksPotentiallyUnpowered.pop_back();
+ UnpoweringFunction(End.second, End.first);
}
}
@@ -2135,45 +2188,48 @@ void cIncrementalRedstoneSimulator::SetSourceUnpowered(int a_RelSourceX, int a_R
-void cIncrementalRedstoneSimulator::SetInvalidMiddleBlock(int a_RelMiddleX, int a_RelMiddleY, int a_RelMiddleZ, cChunk * a_Chunk, bool a_IsFirstCall)
+void cIncrementalRedstoneSimulator::SetInvalidMiddleBlock(int a_RelMiddleX, int a_RelMiddleY, int a_RelMiddleZ, cChunk * a_Chunk)
{
- if (!a_IsFirstCall) // The neighbouring chunks passed when this parameter is false may be invalid
+ std::vector<std::pair<Vector3i, cChunk *>> BlocksPotentiallyUnpowered;
+
+ BLOCKTYPE RepeaterType;
+ if (a_Chunk->UnboundedRelGetBlockType(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ, RepeaterType) && (RepeaterType == E_BLOCK_REDSTONE_REPEATER_ON))
{
- if ((a_Chunk == nullptr) || !a_Chunk->IsValid())
- {
- return;
- }
+ return;
}
- std::vector<Vector3i> BlocksPotentiallyUnpowered;
- auto Data = (cIncrementalRedstoneSimulator::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData();
-
- Data->m_LinkedBlocks.erase(std::remove_if(Data->m_LinkedBlocks.begin(), Data->m_LinkedBlocks.end(), [&BlocksPotentiallyUnpowered, a_Chunk, a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ](const sLinkedPoweredBlocks & itr)
- {
- if (itr.a_MiddlePos.Equals(Vector3i(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ)))
+ auto MiddleBlockUnpoweringFunction = [&BlocksPotentiallyUnpowered](cChunk * a_LambdaChunk, const Vector3i & a_RelMiddle)
+ {
+ auto Data = static_cast<cIncrementalRedstoneSimulatorChunkData *>(a_LambdaChunk->GetRedstoneSimulatorData());
+ Data->m_LinkedBlocks.erase(std::remove_if(Data->m_LinkedBlocks.begin(), Data->m_LinkedBlocks.end(), [&BlocksPotentiallyUnpowered, a_LambdaChunk, a_RelMiddle](const sLinkedPoweredBlocks & itr)
{
- BlocksPotentiallyUnpowered.emplace_back(itr.a_BlockPos);
- a_Chunk->SetIsRedstoneDirty(true);
+ if (itr.a_MiddlePos != a_RelMiddle)
+ {
+ return false;
+ }
+
+ BlocksPotentiallyUnpowered.emplace_back(std::make_pair(itr.a_BlockPos, a_LambdaChunk));
+ a_LambdaChunk->SetIsRedstoneDirty(true);
return true;
}
- return false;
- }
- ), Data->m_LinkedBlocks.end());
+ ), Data->m_LinkedBlocks.end());
+ };
- if (a_IsFirstCall && AreCoordsOnChunkBoundary(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ))
+ MiddleBlockUnpoweringFunction(a_Chunk, Vector3i(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ));
+ for (const auto & BoundaryChunk : GetAdjacentChunks(Vector3i(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ), a_Chunk))
{
- // +- 2 to accomodate linked powered blocks
- SetInvalidMiddleBlock(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ, a_Chunk->GetRelNeighborChunk(a_RelMiddleX - 2, a_RelMiddleZ), false);
- SetInvalidMiddleBlock(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ, a_Chunk->GetRelNeighborChunk(a_RelMiddleX + 2, a_RelMiddleZ), false);
- SetInvalidMiddleBlock(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ, a_Chunk->GetRelNeighborChunk(a_RelMiddleX, a_RelMiddleZ - 2), false);
- SetInvalidMiddleBlock(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ, a_Chunk->GetRelNeighborChunk(a_RelMiddleX, a_RelMiddleZ + 2), false);
+ Vector3i ChunkAdjustedMiddlePos = Vector3i(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ);
+ ChunkAdjustedMiddlePos.x += (a_Chunk->GetPosX() - BoundaryChunk->GetPosX()) * cChunkDef::Width;
+ ChunkAdjustedMiddlePos.z += (a_Chunk->GetPosZ() - BoundaryChunk->GetPosZ()) * cChunkDef::Width;
+
+ MiddleBlockUnpoweringFunction(a_Chunk, Vector3i(a_RelMiddleX, a_RelMiddleY, a_RelMiddleZ));
}
for (const auto & itr : BlocksPotentiallyUnpowered)
{
- if (!AreCoordsPowered(itr.x, itr.y, itr.z))
+ if (!AreCoordsPowered(itr.first.x, itr.first.y, itr.first.z))
{
- SetSourceUnpowered(itr.x, itr.y, itr.z, a_Chunk->GetRelNeighborChunk(itr.x, itr.z));
+ SetSourceUnpowered(itr.first.x, itr.first.y, itr.first.z, itr.second);
}
}
}
@@ -2182,76 +2238,48 @@ void cIncrementalRedstoneSimulator::SetInvalidMiddleBlock(int a_RelMiddleX, int
-cIncrementalRedstoneSimulator::eRedstoneDirection cIncrementalRedstoneSimulator::GetWireDirection(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ)
+bool cIncrementalRedstoneSimulator::IsLeverOn(NIBBLETYPE a_BlockMeta)
{
- int Dir = REDSTONE_NONE;
+ // Extract the ON bit from metadata and return if true if it is set:
+ return ((a_BlockMeta & 0x8) == 0x8);
+}
+
+
+
+
+
+std::vector<cChunk *> cIncrementalRedstoneSimulator::GetAdjacentChunks(const Vector3i & a_RelBlockPosition, cChunk * a_Chunk)
+{
+ std::vector<cChunk *> AdjacentChunks;
+ AdjacentChunks.reserve(2); // At most bordering two chunks; reserve that many
- BLOCKTYPE NegX = 0;
- if (m_Chunk->UnboundedRelGetBlockType(a_RelBlockX - 1, a_RelBlockY, a_RelBlockZ, NegX))
+ auto CheckAndEmplace = [&AdjacentChunks](cChunk * a_LambdaChunk)
{
- if (IsPotentialSource(NegX))
+ if ((a_LambdaChunk != nullptr) && a_LambdaChunk->IsValid())
{
- Dir |= (REDSTONE_X_POS);
+ AdjacentChunks.emplace_back(a_LambdaChunk);
}
- }
+ };
- BLOCKTYPE PosX = 0;
- if (m_Chunk->UnboundedRelGetBlockType(a_RelBlockX + 1, a_RelBlockY, a_RelBlockZ, PosX))
+ // Are we on a chunk boundary? +- 2 because of LinkedPowered blocks
+ if (a_RelBlockPosition.x <= 1)
{
- if (IsPotentialSource(PosX))
- {
- Dir |= (REDSTONE_X_NEG);
- }
+ CheckAndEmplace(a_Chunk->GetRelNeighborChunk(a_RelBlockPosition.x - 2, a_RelBlockPosition.z));
}
-
- BLOCKTYPE NegZ = 0;
- if (m_Chunk->UnboundedRelGetBlockType(a_RelBlockX, a_RelBlockY, a_RelBlockZ - 1, NegZ))
+ if (a_RelBlockPosition.x >= 14)
{
- if (IsPotentialSource(NegZ))
- {
- if ((Dir & REDSTONE_X_POS) && !(Dir & REDSTONE_X_NEG)) // corner
- {
- Dir ^= REDSTONE_X_POS;
- Dir |= REDSTONE_X_NEG;
- }
- if ((Dir & REDSTONE_X_NEG) && !(Dir & REDSTONE_X_POS)) // corner
- {
- Dir ^= REDSTONE_X_NEG;
- Dir |= REDSTONE_X_POS;
- }
- Dir |= REDSTONE_Z_POS;
- }
+ CheckAndEmplace(a_Chunk->GetRelNeighborChunk(a_RelBlockPosition.x + 2, a_RelBlockPosition.z));
}
-
- BLOCKTYPE PosZ = 0;
- if (m_Chunk->UnboundedRelGetBlockType(a_RelBlockX, a_RelBlockY, a_RelBlockZ + 1, PosZ))
+ if (a_RelBlockPosition.z <= 1)
{
- if (IsPotentialSource(PosZ))
- {
- if ((Dir & REDSTONE_X_POS) && !(Dir & REDSTONE_X_NEG)) // corner
- {
- Dir ^= REDSTONE_X_POS;
- Dir |= REDSTONE_X_NEG;
- }
- if ((Dir & REDSTONE_X_NEG) && !(Dir & REDSTONE_X_POS)) // corner
- {
- Dir ^= REDSTONE_X_NEG;
- Dir |= REDSTONE_X_POS;
- }
- Dir |= REDSTONE_Z_NEG;
- }
+ CheckAndEmplace(a_Chunk->GetRelNeighborChunk(a_RelBlockPosition.x, a_RelBlockPosition.z - 2));
+ }
+ if (a_RelBlockPosition.z >= 14)
+ {
+ CheckAndEmplace(a_Chunk->GetRelNeighborChunk(a_RelBlockPosition.x, a_RelBlockPosition.z + 2));
}
- return (eRedstoneDirection)Dir;
-}
-
-
-
-
-bool cIncrementalRedstoneSimulator::IsLeverOn(NIBBLETYPE a_BlockMeta)
-{
- // Extract the ON bit from metadata and return if true if it is set:
- return ((a_BlockMeta & 0x8) == 0x8);
+ return AdjacentChunks;
}
diff --git a/src/Simulator/IncrementalRedstoneSimulator.h b/src/Simulator/IncrementalRedstoneSimulator.h
index 43f0e89d0..e4250c0b9 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.h
+++ b/src/Simulator/IncrementalRedstoneSimulator.h
@@ -3,6 +3,7 @@
#include "RedstoneSimulator.h"
#include "BlockEntities/RedstonePoweredEntity.h"
+#include <unordered_map>
class cWorld;
class cChunk;
@@ -22,7 +23,8 @@ class cIncrementalRedstoneSimulator :
public:
cIncrementalRedstoneSimulator(cWorld & a_World)
- : cRedstoneSimulator(a_World)
+ : cRedstoneSimulator(a_World),
+ m_Chunk(nullptr)
{
}
@@ -36,25 +38,22 @@ public:
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override { return IsRedstone(a_BlockType); }
virtual void WakeUp(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) override;
- enum eRedstoneDirection
- {
- REDSTONE_NONE = 0,
- REDSTONE_X_POS = 0x1,
- REDSTONE_X_NEG = 0x2,
- REDSTONE_Z_POS = 0x4,
- REDSTONE_Z_NEG = 0x8,
- };
- eRedstoneDirection GetWireDirection(int a_BlockX, int a_BlockY, int a_BlockZ);
-
private:
#define MAX_POWER_LEVEL 15
struct sPoweredBlocks // Define structure of the directly powered blocks list
{
- Vector3i a_BlockPos; // Position of powered block
- Vector3i a_SourcePos; // Position of source powering the block at a_BlockPos
- unsigned char a_PowerLevel;
+ sPoweredBlocks(Vector3i a_BlockPos, Vector3i a_SourcePos, unsigned char a_PowerLevel) :
+ m_BlockPos(a_BlockPos),
+ m_SourcePos(a_SourcePos),
+ m_PowerLevel(a_PowerLevel)
+ {
+ }
+
+ Vector3i m_BlockPos; // Position of powered block
+ Vector3i m_SourcePos; // Position of source powering the block at a_BlockPos
+ unsigned char m_PowerLevel;
};
struct sLinkedPoweredBlocks // Define structure of the indirectly powered blocks list (i.e. repeaters powering through a block to the block at the other side)
@@ -65,15 +64,8 @@ private:
unsigned char a_PowerLevel;
};
- struct sSimulatedPlayerToggleableList // Define structure of the list containing simulate-on-update blocks (such as trapdoors that respond once to a block update, and can be toggled by a player)
- {
- Vector3i a_RelBlockPos;
- bool WasLastStatePowered; // Was the last state powered or not? Determines whether a source update has happened and if I should resimulate
- };
-
struct sRepeatersDelayList // Define structure of list containing repeaters' delay states
{
- Vector3i a_RelBlockPos;
unsigned char a_DelayTicks; // For how many ticks should the repeater delay
unsigned char a_ElapsedTicks; // How much of the previous has been elapsed?
bool ShouldPowerOn; // What happens when the delay time is fulfilled?
@@ -84,20 +76,21 @@ private:
{
public:
/// Per-chunk data for the simulator, specified individual chunks to simulate
- cCoordWithBlockAndBoolVector m_ChunkData;
- cCoordWithBlockAndBoolVector m_QueuedChunkData;
+
+ /** test */
+ std::unordered_map<Vector3i, std::pair<BLOCKTYPE, bool>, VectorHasher<int>> m_ChunkData;
std::vector<sPoweredBlocks> m_PoweredBlocks;
std::vector<sLinkedPoweredBlocks> m_LinkedBlocks;
- std::vector<sSimulatedPlayerToggleableList> m_SimulatedPlayerToggleableBlocks;
- std::vector<sRepeatersDelayList> m_RepeatersDelayList;
+ std::unordered_map<Vector3i, bool, VectorHasher<int>> m_SimulatedPlayerToggleableBlocks;
+ std::unordered_map<Vector3i, sRepeatersDelayList, VectorHasher<int>> m_RepeatersDelayList;
};
public:
typedef std::vector <sPoweredBlocks> PoweredBlocksList;
typedef std::vector <sLinkedPoweredBlocks> LinkedBlocksList;
- typedef std::vector <sSimulatedPlayerToggleableList> SimulatedPlayerToggleableList;
- typedef std::vector <sRepeatersDelayList> RepeatersDelayList;
+ typedef std::unordered_map<Vector3i, bool, VectorHasher<int>> SimulatedPlayerToggleableList;
+ typedef std::unordered_map<Vector3i, sRepeatersDelayList, VectorHasher<int>> RepeatersDelayList;
private:
@@ -107,126 +100,171 @@ private:
SimulatedPlayerToggleableList * m_SimulatedPlayerToggleableBlocks;
RepeatersDelayList * m_RepeatersDelayList;
- virtual void AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) override { RedstoneAddBlock(a_BlockX, a_BlockY, a_BlockZ, a_Chunk); }
- void RedstoneAddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk, cChunk * a_OtherChunk = nullptr);
+ virtual void AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) override;
+
+ void AddBlock(const Vector3i & a_BlockPosition, cChunk * a_Chunk, cChunk * a_OtherChunk = nullptr);
cChunk * m_Chunk;
// We want a_MyState for devices needing a full FastSetBlock (as opposed to meta) because with our simulation model, we cannot keep setting the block if it is already set correctly
// In addition to being non-performant, it would stop the player from actually breaking said device
- /* ====== SOURCES ====== */
+
/** Handles the redstone torch */
void HandleRedstoneTorch(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, BLOCKTYPE a_MyState);
+
/** Handles the redstone block */
void HandleRedstoneBlock(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles levers */
void HandleRedstoneLever(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles buttons */
void HandleRedstoneButton(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles daylight sensors */
void HandleDaylightSensor(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles pressure plates */
void HandlePressurePlate(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, BLOCKTYPE a_MyType);
+
/** Handles tripwire hooks
Performs correct meta and power setting for self by going in the direction it faces and looking for a continous line of tripwire bounded by another oppositely facing hook
If this line is complete, it verifies that at least on wire reports an entity is on top (via its meta), and performs its task
*/
void HandleTripwireHook(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles trapped chests */
void HandleTrappedChest(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
- /* ==================== */
- /* ====== CARRIERS ====== */
+
/** Handles redstone wire */
void HandleRedstoneWire(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles repeaters */
void HandleRedstoneRepeater(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, BLOCKTYPE a_MyState);
- /* ====================== */
- /* ====== DEVICES ====== */
+ /** Handles comparators */
+ void HandleRedstoneComparator(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
+
/** Handles pistons */
void HandlePiston(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles dispensers and droppers */
void HandleDropSpenser(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles TNT (exploding) */
void HandleTNT(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles redstone lamps */
void HandleRedstoneLamp(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, BLOCKTYPE a_MyState);
+
/** Handles doords */
void HandleDoor(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles command blocks */
void HandleCommandBlock(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles activator, detector, and powered rails */
void HandleRail(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, BLOCKTYPE a_MyType);
+
/** Handles trapdoors */
void HandleTrapdoor(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles fence gates */
void HandleFenceGate(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles noteblocks */
void HandleNoteBlock(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+
/** Handles tripwires */
void HandleTripwire(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
- /* ===================== */
- /* ====== Helper functions ====== */
+
/** Marks a block as powered */
- void SetBlockPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, int a_RelSourceX, int a_RelSourceY, int a_RelSourceZ, unsigned char a_PowerLevel = MAX_POWER_LEVEL);
+ void SetBlockPowered(Vector3i a_RelBlockPosition, Vector3i a_RelSourcePosition, unsigned char a_PowerLevel = MAX_POWER_LEVEL);
+ void SetBlockPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, int a_RelSourceX, int a_RelSourceY, int a_RelSourceZ, unsigned char a_PowerLevel = MAX_POWER_LEVEL) { SetBlockPowered(Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ), Vector3i(a_RelSourceX, a_RelSourceY, a_RelSourceZ), a_PowerLevel); }
+
+ /** Recursively searches for a wire path and powers everything that should be powered */
+ void FindAndPowerBorderingWires(std::vector<std::pair<Vector3i, cChunk *>> & a_PotentialWireList, const Vector3i & a_EntryRelBlockPosition, cChunk * a_EntryChunk);
+
+ /** Powers a specified wire block position with the specified source wire position
+ Checks are performed to ensure one wire does not power the same location more than once
+ a_EntryChunk will be the chunk which the source resides, and a_NeighbourChunk will be that which the to-be-powered wire resides
+ a_PotentialWireList is updated to include the new powered wire so that FindAndPowerBorderingWires can continue the redstone wire line tracing process
+ */
+ void PowerBorderingWires(std::vector<std::pair<Vector3i, cChunk *>> & a_PotentialWireList, const Vector3i & a_EntryRelSourcePosition, cChunk * a_EntryChunk, const Vector3i & a_AdjustedPos, cChunk * a_NeighbourChunk, unsigned char a_MyPower);
+
/** Marks a block as being powered through another block */
void SetBlockLinkedPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, int a_RelMiddleX, int a_RelMiddleY, int a_RelMiddleZ, int a_RelSourceX, int a_RelSourceY, int a_RelSourceZ, BLOCKTYPE a_MiddeBlock, unsigned char a_PowerLevel = MAX_POWER_LEVEL);
+
/** Marks a block as simulated, who should not be simulated further unless their power state changes, to accomodate a player manually toggling the block without triggering the simulator toggling it back */
void SetPlayerToggleableBlockAsSimulated(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, bool WasLastStatePowered);
+
/** Marks the second block in a direction as linked powered */
void SetDirectionLinkedPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, char a_Direction, unsigned char a_PowerLevel = MAX_POWER_LEVEL);
+
/** Marks all blocks immediately surrounding a coordinate as powered */
void SetAllDirsAsPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, unsigned char a_PowerLevel = MAX_POWER_LEVEL);
+
/** Queues a repeater to be powered or unpowered and returns if the m_RepeatersDelayList iterators were invalidated */
- bool QueueRepeaterPowerChange(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, NIBBLETYPE a_Meta, bool ShouldPowerOn);
+ void QueueRepeaterPowerChange(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, NIBBLETYPE a_Meta, bool ShouldPowerOn);
+
/** Removes a block from the Powered and LinkedPowered lists
- Used for variable sources such as tripwire hooks, daylight sensors, and trapped chests
+ Recursively removes all blocks powered by the given one
*/
- void SetSourceUnpowered(int a_RelSourceX, int a_RelSourceY, int a_RelSourceZ, cChunk * a_Chunk, bool a_IsFirstCall = true);
- void SetInvalidMiddleBlock(int a_RelMiddleX, int a_RelMiddleY, int a_RelMiddleZ, cChunk * a_Chunk, bool a_IsFirstCall = true);
+ void SetSourceUnpowered(int a_RelSourceX, int a_RelSourceY, int a_RelSourceZ, cChunk * a_Chunk);
+ void SetInvalidMiddleBlock(int a_RelMiddleX, int a_RelMiddleY, int a_RelMiddleZ, cChunk * a_Chunk);
/** Returns if a coordinate is powered or linked powered */
- bool AreCoordsPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ) { return AreCoordsDirectlyPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, m_Chunk) || AreCoordsLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ); }
+ bool AreCoordsPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ) { return AreCoordsDirectlyPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, m_Chunk) || AreCoordsLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, m_Chunk); }
+
/** Returns if a coordinate is in the directly powered blocks list */
- bool AreCoordsDirectlyPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, cChunk * a_Chunk);
+ static bool AreCoordsDirectlyPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, cChunk * a_Chunk);
+
/** Returns if a coordinate is in the indirectly powered blocks list */
- bool AreCoordsLinkedPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ);
+ static bool AreCoordsLinkedPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, cChunk * a_Chunk);
+
/** Returns if a coordinate was marked as simulated (for blocks toggleable by players) */
bool AreCoordsSimulated(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, bool IsCurrentStatePowered);
+
/** Returns if a repeater is powered by testing for power sources behind the repeater */
bool IsRepeaterPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, NIBBLETYPE a_Meta);
+
/** Returns if a repeater is locked */
bool IsRepeaterLocked(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, NIBBLETYPE a_Meta);
+
/** Returns if a piston is powered */
bool IsPistonPowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, NIBBLETYPE a_Meta);
+
/** Returns if a wire is powered
The only diffence between this and a normal AreCoordsPowered is that this function checks for a wire powering another wire */
- bool IsWirePowered(int a_RelBlockX, int a_RelBlockY, int a_RelBlockZ, unsigned char & a_PowerLevel);
+ static unsigned char IsWirePowered(Vector3i a_RelBlockPosition, cChunk * a_Chunk);
+
/** Handles delayed updates to repeaters **/
void HandleRedstoneRepeaterDelays(void);
/** Returns if lever metadata marks it as emitting power */
bool IsLeverOn(NIBBLETYPE a_BlockMeta);
+
/** Returns if button metadata marks it as emitting power */
bool IsButtonOn(NIBBLETYPE a_BlockMeta) { return IsLeverOn(a_BlockMeta); }
- /* ============================== */
- /* ====== Misc Functions ====== */
+
/** Returns if a block is viable to be the MiddleBlock of a SetLinkedPowered operation */
- inline static bool IsViableMiddleBlock(BLOCKTYPE Block) { return cBlockInfo::FullyOccupiesVoxel(Block); }
+ inline static bool IsViableMiddleBlock(BLOCKTYPE a_Block) { return cBlockInfo::FullyOccupiesVoxel(a_Block); }
/** Returns if a block is a mechanism (something that accepts power and does something)
Used by torches to determine if they power a block whilst not standing on the ground
*/
- inline static bool IsMechanism(BLOCKTYPE Block)
+ inline static bool IsMechanism(BLOCKTYPE a_Block)
{
- switch (Block)
+ switch (a_Block)
{
case E_BLOCK_ACACIA_DOOR:
case E_BLOCK_ACACIA_FENCE_GATE:
case E_BLOCK_ACTIVATOR_RAIL:
+ case E_BLOCK_ACTIVE_COMPARATOR:
case E_BLOCK_BIRCH_DOOR:
case E_BLOCK_BIRCH_FENCE_GATE:
case E_BLOCK_COMMAND_BLOCK:
@@ -236,6 +274,7 @@ private:
case E_BLOCK_DROPPER:
case E_BLOCK_FENCE_GATE:
case E_BLOCK_HOPPER:
+ case E_BLOCK_INACTIVE_COMPARATOR:
case E_BLOCK_IRON_DOOR:
case E_BLOCK_IRON_TRAPDOOR:
case E_BLOCK_JUNGLE_DOOR:
@@ -262,9 +301,9 @@ private:
}
/** Returns if a block has the potential to output power */
- inline static bool IsPotentialSource(BLOCKTYPE Block)
+ inline static bool IsPotentialSource(BLOCKTYPE a_Block)
{
- switch (Block)
+ switch (a_Block)
{
case E_BLOCK_DETECTOR_RAIL:
case E_BLOCK_DAYLIGHT_SENSOR:
@@ -276,6 +315,7 @@ private:
case E_BLOCK_REDSTONE_REPEATER_ON:
case E_BLOCK_BLOCK_OF_REDSTONE:
case E_BLOCK_ACTIVE_COMPARATOR:
+ case E_BLOCK_INACTIVE_COMPARATOR:
case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE:
case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE:
case E_BLOCK_STONE_PRESSURE_PLATE:
@@ -289,9 +329,9 @@ private:
}
/** Returns if a block is any sort of redstone device */
- inline static bool IsRedstone(BLOCKTYPE Block)
+ inline static bool IsRedstone(BLOCKTYPE a_Block)
{
- switch (Block)
+ switch (a_Block)
{
// All redstone devices, please alpha sort
case E_BLOCK_ACACIA_DOOR:
@@ -348,47 +388,30 @@ private:
}
}
- inline static bool AreCoordsOnChunkBoundary(int a_BlockX, int a_BlockY, int a_BlockZ)
- {
- return ( // Are we on a chunk boundary? +- 2 because of LinkedPowered blocks
- ((a_BlockX % cChunkDef::Width) <= 1) ||
- ((a_BlockX % cChunkDef::Width) >= 14) ||
- ((a_BlockZ % cChunkDef::Width) <= 1) ||
- ((a_BlockZ % cChunkDef::Width) >= 14)
- );
- }
-
- inline static Vector3i AdjustRelativeCoords(const Vector3i & a_RelPosition)
+ inline static bool DoesIgnorePlayerToggle(BLOCKTYPE a_Block)
{
- if (
- (a_RelPosition.x >= 0) && (a_RelPosition.x < cChunkDef::Width) &&
- (a_RelPosition.z >= 0) && (a_RelPosition.z < cChunkDef::Width)
- )
+ switch (a_Block)
{
- return a_RelPosition;
+ case E_BLOCK_ACACIA_FENCE_GATE:
+ case E_BLOCK_BIRCH_FENCE_GATE:
+ case E_BLOCK_DARK_OAK_FENCE_GATE:
+ case E_BLOCK_FENCE_GATE:
+ case E_BLOCK_JUNGLE_FENCE_GATE:
+ case E_BLOCK_SPRUCE_FENCE_GATE:
+ case E_BLOCK_IRON_TRAPDOOR:
+ case E_BLOCK_TRAPDOOR:
+ {
+ return true;
+ }
+ default: return false;
}
+ }
- Vector3i RelPos = a_RelPosition;
-
- // Request for a different chunk, calculate chunk offset:
- while (RelPos.x >= cChunkDef::Width)
- {
- RelPos.x -= cChunkDef::Width;
- }
- while (RelPos.x < 0)
- {
- RelPos.x += cChunkDef::Width;
- }
- while (RelPos.z >= cChunkDef::Width)
- {
- RelPos.z -= cChunkDef::Width;
- }
- while (RelPos.z < 0)
- {
- RelPos.z += cChunkDef::Width;
- }
+ inline static std::vector<cChunk *> GetAdjacentChunks(const Vector3i & a_RelBlockPosition, cChunk * a_Chunk);
- return RelPos;
+ inline static Vector3i AdjustRelativeCoords(const Vector3i & a_RelPosition)
+ {
+ return { (a_RelPosition.x % cChunkDef::Width + cChunkDef::Width) % cChunkDef::Width, a_RelPosition.y, (a_RelPosition.z % cChunkDef::Width + cChunkDef::Width) % cChunkDef::Width };
}
};
diff --git a/src/Simulator/SandSimulator.cpp b/src/Simulator/SandSimulator.cpp
index 497f81999..70dde8cc0 100644
--- a/src/Simulator/SandSimulator.cpp
+++ b/src/Simulator/SandSimulator.cpp
@@ -65,7 +65,7 @@ void cSandSimulator::SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX,
a_Chunk->SetBlock(itr->x, itr->y, itr->z, E_BLOCK_AIR, 0);
}
}
- m_TotalBlocks -= (int)ChunkData.size();
+ m_TotalBlocks -= static_cast<int>(ChunkData.size());
ChunkData.clear();
}
@@ -265,8 +265,13 @@ void cSandSimulator::FinishFalling(
// Create a pickup instead:
cItems Pickups;
- Pickups.Add((ENUM_ITEM_ID)a_FallingBlockType, 1, a_FallingBlockMeta);
- a_World->SpawnItemPickups(Pickups, (double)a_BlockX + 0.5, (double)a_BlockY + 0.5, (double)a_BlockZ + 0.5);
+ Pickups.Add(static_cast<ENUM_ITEM_ID>(a_FallingBlockType), 1, a_FallingBlockMeta);
+ a_World->SpawnItemPickups(
+ Pickups,
+ static_cast<double>(a_BlockX) + 0.5,
+ static_cast<double>(a_BlockY) + 0.5,
+ static_cast<double>(a_BlockZ) + 0.5
+ );
}
diff --git a/src/Simulator/VanillaFluidSimulator.cpp b/src/Simulator/VanillaFluidSimulator.cpp
index 6df75eebb..f6fe1e9ec 100644
--- a/src/Simulator/VanillaFluidSimulator.cpp
+++ b/src/Simulator/VanillaFluidSimulator.cpp
@@ -105,7 +105,7 @@ int cVanillaFluidSimulator::CalculateFlowCost(cChunk * a_Chunk, int a_RelX, int
if (IsPassableForFluid(BlockType) || IsBlockLiquid(BlockType))
{
// Path found, exit
- return a_Iteration;
+ return static_cast<int>(a_Iteration);
}
// 5 blocks away, bail out
diff --git a/src/Simulator/VaporizeFluidSimulator.cpp b/src/Simulator/VaporizeFluidSimulator.cpp
index 119742346..d766b069f 100644
--- a/src/Simulator/VaporizeFluidSimulator.cpp
+++ b/src/Simulator/VaporizeFluidSimulator.cpp
@@ -35,7 +35,14 @@ void cVaporizeFluidSimulator::AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ,
)
{
a_Chunk->SetBlock(RelX, a_BlockY, RelZ, E_BLOCK_AIR, 0);
- a_Chunk->BroadcastSoundEffect("random.fizz", (double)a_BlockX, (double)a_BlockY, (double)a_BlockZ, 1.0f, 0.6f);
+ a_Chunk->BroadcastSoundEffect(
+ "random.fizz",
+ static_cast<double>(a_BlockX),
+ static_cast<double>(a_BlockY),
+ static_cast<double>(a_BlockZ),
+ 1.0f,
+ 0.6f
+ );
}
}
diff --git a/src/SpawnPrepare.cpp b/src/SpawnPrepare.cpp
new file mode 100644
index 000000000..74dcb3ecd
--- /dev/null
+++ b/src/SpawnPrepare.cpp
@@ -0,0 +1,125 @@
+
+#include "Globals.h"
+
+#include "SpawnPrepare.h"
+#include "World.h"
+
+
+
+
+
+class cSpawnPrepareCallback :
+ public cChunkCoordCallback
+{
+public:
+ cSpawnPrepareCallback(cSpawnPrepare & a_SpawnPrepare) :
+ m_SpawnPrepare(a_SpawnPrepare)
+ {
+ }
+protected:
+
+ cSpawnPrepare & m_SpawnPrepare;
+
+ virtual void Call(int a_ChunkX, int a_ChunkZ) override
+ {
+ m_SpawnPrepare.PreparedChunkCallback(a_ChunkX, a_ChunkZ);
+ }
+};
+
+
+
+
+
+cSpawnPrepare::cSpawnPrepare(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance, int a_FirstIdx):
+ m_World(a_World),
+ m_SpawnChunkX(a_SpawnChunkX),
+ m_SpawnChunkZ(a_SpawnChunkZ),
+ m_PrepareDistance(a_PrepareDistance),
+ m_NextIdx(a_FirstIdx),
+ m_MaxIdx(a_PrepareDistance * a_PrepareDistance),
+ m_NumPrepared(0),
+ m_LastReportTime(std::chrono::steady_clock::now()),
+ m_LastReportChunkCount(0)
+{
+}
+
+
+
+
+
+
+
+void cSpawnPrepare::PrepareChunks(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance)
+{
+
+ // Queue the initial chunks:
+ int MaxIdx = a_PrepareDistance * a_PrepareDistance;
+ int maxQueue = std::min(MaxIdx - 1, 100); // Number of chunks to queue at once
+ cSpawnPrepare prep(a_World, a_SpawnChunkX, a_SpawnChunkZ, a_PrepareDistance, maxQueue);
+ for (int i = 0; i < maxQueue; i++)
+ {
+ int chunkX, chunkZ;
+ prep.DecodeChunkCoords(i, chunkX, chunkZ);
+ a_World.PrepareChunk(chunkX, chunkZ, cpp14::make_unique<cSpawnPrepareCallback>(prep));
+ } // for i
+
+ // Wait for the lighting thread to prepare everything. Event is set in the Call() callback:
+ prep.m_EvtFinished.Wait();
+}
+
+
+
+
+
+void cSpawnPrepare::DecodeChunkCoords(int a_Idx, int & a_ChunkX, int & a_ChunkZ)
+{
+ // A zigzag pattern from the top to bottom, each row alternating between forward-x and backward-x:
+ int z = a_Idx / m_PrepareDistance;
+ int x = a_Idx % m_PrepareDistance;
+ if ((z & 1) == 0)
+ {
+ // Reverse every second row:
+ x = m_PrepareDistance - 1 - x;
+ }
+ a_ChunkZ = m_SpawnChunkZ + z - m_PrepareDistance / 2;
+ a_ChunkX = m_SpawnChunkX + x - m_PrepareDistance / 2;
+}
+
+
+
+
+
+void cSpawnPrepare::PreparedChunkCallback(int a_ChunkX, int a_ChunkZ)
+{
+ // Check if this was the last chunk:
+ m_NumPrepared += 1;
+ if (m_NumPrepared >= m_MaxIdx)
+ {
+ m_EvtFinished.Set();
+ // Must return here, because "this" may have gotten deleted by the previous line
+ return;
+ }
+
+ // Queue another chunk, if appropriate:
+ if (m_NextIdx < m_MaxIdx)
+ {
+ int chunkX, chunkZ;
+ DecodeChunkCoords(m_NextIdx, chunkX, chunkZ);
+ m_World.GetLightingThread().QueueChunk(chunkX, chunkZ, cpp14::make_unique<cSpawnPrepareCallback>(*this));
+ m_NextIdx += 1;
+ }
+
+ // Report progress every 1 second:
+ auto Now = std::chrono::steady_clock::now();
+ if (Now - m_LastReportTime > std::chrono::seconds(1))
+ {
+ float PercentDone = static_cast<float>(m_NumPrepared * 100) / m_MaxIdx;
+ float ChunkSpeed = static_cast<float>((m_NumPrepared - m_LastReportChunkCount) * 1000) / std::chrono::duration_cast<std::chrono::milliseconds>(Now - m_LastReportTime).count();
+ LOG("Preparing spawn (%s): %.02f%% (%d/%d; %.02f chunks / sec)",
+ m_World.GetName().c_str(), PercentDone, m_NumPrepared, m_MaxIdx, ChunkSpeed
+ );
+ m_LastReportTime = Now;
+ m_LastReportChunkCount = m_NumPrepared;
+ }
+}
+
diff --git a/src/SpawnPrepare.h b/src/SpawnPrepare.h
new file mode 100644
index 000000000..cc0da504e
--- /dev/null
+++ b/src/SpawnPrepare.h
@@ -0,0 +1,49 @@
+
+#pragma once
+
+class cWorld;
+
+
+
+/** Generates and lights the spawn area of the world. Runs as a separate thread. */
+class cSpawnPrepare
+{
+
+public:
+ static void PrepareChunks(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance);
+
+protected:
+ cWorld & m_World;
+ int m_SpawnChunkX;
+ int m_SpawnChunkZ;
+ int m_PrepareDistance;
+
+ /** The index of the next chunk to be queued in the lighting thread. */
+ int m_NextIdx;
+
+ /** The maximum index of the prepared chunks. Queueing stops when m_NextIdx reaches this number. */
+ int m_MaxIdx;
+
+ /** Total number of chunks already finished preparing. Preparation finishes when this number reaches m_MaxIdx. */
+ int m_NumPrepared;
+
+ /** Event used to signal that the preparation is finished. */
+ cEvent m_EvtFinished;
+
+ /** The timestamp of the last progress report emitted. */
+ std::chrono::steady_clock::time_point m_LastReportTime;
+
+ /** Number of chunks prepared when the last progress report was emitted. */
+ int m_LastReportChunkCount;
+
+ cSpawnPrepare(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance, int a_FirstIdx);
+
+ void PreparedChunkCallback(int a_ChunkX, int a_ChunkZ);
+
+ /** Decodes the index into chunk coords. Provides the specific chunk ordering. */
+ void DecodeChunkCoords(int a_Idx, int & a_ChunkX, int & a_ChunkZ);
+
+ friend class cSpawnPrepareCallback;
+
+};
+
diff --git a/src/Statistics.cpp b/src/Statistics.cpp
index e0c0dd925..fcaf3e7bc 100644
--- a/src/Statistics.cpp
+++ b/src/Statistics.cpp
@@ -185,7 +185,7 @@ StatValue cStatManager::AddValue(const eStatistic a_Stat, const StatValue a_Delt
void cStatManager::Reset(void)
{
- for (unsigned int i = 0; i < (unsigned int)statCount; ++i)
+ for (unsigned int i = 0; i < static_cast<unsigned int>(statCount); ++i)
{
m_MainStats[i] = 0;
}
diff --git a/src/StringUtils.h b/src/StringUtils.h
index b5fc58a2d..62767d007 100644
--- a/src/StringUtils.h
+++ b/src/StringUtils.h
@@ -158,7 +158,7 @@ bool StringToInteger(const AString & a_str, T & a_Num)
return false;
}
result *= 10;
- T digit = a_str[i] - '0';
+ T digit = static_cast<T>(a_str[i] - '0');
if (std::numeric_limits<T>::max() - digit < result)
{
return false;
@@ -168,6 +168,12 @@ bool StringToInteger(const AString & a_str, T & a_Num)
}
else
{
+ // Unsigned result cannot be signed!
+ if (!std::numeric_limits<T>::is_signed)
+ {
+ return false;
+ }
+
for (size_t size = a_str.size(); i < size; i++)
{
if ((a_str[i] < '0') || (a_str[i] > '9'))
@@ -179,7 +185,7 @@ bool StringToInteger(const AString & a_str, T & a_Num)
return false;
}
result *= 10;
- T digit = a_str[i] - '0';
+ T digit = static_cast<T>(a_str[i] - '0');
if (std::numeric_limits<T>::min() + digit > result)
{
return false;
diff --git a/src/Tracer.cpp b/src/Tracer.cpp
index 5fdaff15d..b54a50798 100644
--- a/src/Tracer.cpp
+++ b/src/Tracer.cpp
@@ -277,7 +277,7 @@ bool cTracer::Trace(const Vector3f & a_Start, const Vector3f & a_Direction, int
// return 1 = hit, other is not hit
-int LinesCross(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
+static int LinesCross(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
{
// float linx, liny;
diff --git a/src/UI/CMakeLists.txt b/src/UI/CMakeLists.txt
index ef4afc40a..178498479 100644
--- a/src/UI/CMakeLists.txt
+++ b/src/UI/CMakeLists.txt
@@ -34,6 +34,12 @@ SET (HDRS
MinecartWithChestWindow.h
WindowOwner.h)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(SlotArea.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=switch-enum -Wno-error=sign-conversion -Wno-error=old-style-cast")
+ set_source_files_properties(Window.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=switch-enum -Wno-error=sign-conversion -Wno-error=old-style-cast")
+ set_source_files_properties(ChestWindow.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+endif()
+
if(NOT MSVC)
add_library(UI ${SRCS} ${HDRS})
endif()
diff --git a/src/UI/EnchantingWindow.cpp b/src/UI/EnchantingWindow.cpp
index fe21ee83d..4c5bcbfd5 100644
--- a/src/UI/EnchantingWindow.cpp
+++ b/src/UI/EnchantingWindow.cpp
@@ -30,7 +30,7 @@ cEnchantingWindow::cEnchantingWindow(int a_BlockX, int a_BlockY, int a_BlockZ) :
void cEnchantingWindow::SetProperty(short a_Property, short a_Value, cPlayer & a_Player)
{
- if ((a_Property < 0) || ((size_t)a_Property >= ARRAYCOUNT(m_PropertyValue)))
+ if ((a_Property < 0) || (static_cast<size_t>(a_Property) >= ARRAYCOUNT(m_PropertyValue)))
{
ASSERT(!"a_Property is invalid");
return;
@@ -47,7 +47,7 @@ void cEnchantingWindow::SetProperty(short a_Property, short a_Value, cPlayer & a
void cEnchantingWindow::SetProperty(short a_Property, short a_Value)
{
- if ((a_Property < 0) || ((size_t)a_Property >= ARRAYCOUNT(m_PropertyValue)))
+ if ((a_Property < 0) || (static_cast<size_t>(a_Property) >= ARRAYCOUNT(m_PropertyValue)))
{
ASSERT(!"a_Property is invalid");
return;
@@ -63,7 +63,7 @@ void cEnchantingWindow::SetProperty(short a_Property, short a_Value)
short cEnchantingWindow::GetPropertyValue(short a_Property)
{
- if ((a_Property < 0) || ((size_t)a_Property >= ARRAYCOUNT(m_PropertyValue)))
+ if ((a_Property < 0) || (static_cast<size_t>(a_Property) >= ARRAYCOUNT(m_PropertyValue)))
{
ASSERT(!"a_Property is invalid");
return 0;
diff --git a/src/UI/EnderChestWindow.cpp b/src/UI/EnderChestWindow.cpp
index a5484468f..c597f3a9b 100644
--- a/src/UI/EnderChestWindow.cpp
+++ b/src/UI/EnderChestWindow.cpp
@@ -24,7 +24,14 @@ cEnderChestWindow::cEnderChestWindow(cEnderChestEntity * a_EnderChest) :
m_SlotAreas.push_back(new cSlotAreaHotBar(*this));
// Play the opening sound:
- m_World->BroadcastSoundEffect("random.chestopen", (double)m_BlockX, (double)m_BlockY, (double)m_BlockZ, 1, 1);
+ m_World->BroadcastSoundEffect(
+ "random.chestopen",
+ static_cast<double>(m_BlockX),
+ static_cast<double>(m_BlockY),
+ static_cast<double>(m_BlockZ),
+ 1,
+ 1
+ );
// Send out the chest-open packet:
m_World->BroadcastBlockAction(m_BlockX, m_BlockY, m_BlockZ, 1, 1, E_BLOCK_ENDER_CHEST);
@@ -40,7 +47,13 @@ cEnderChestWindow::~cEnderChestWindow()
m_World->BroadcastBlockAction(m_BlockX, m_BlockY, m_BlockZ, 1, 0, E_BLOCK_ENDER_CHEST);
// Play the closing sound
- m_World->BroadcastSoundEffect("random.chestclosed", (double)m_BlockX, (double)m_BlockY, (double)m_BlockZ, 1, 1);
+ m_World->BroadcastSoundEffect(
+ "random.chestclosed",
+ static_cast<double>(m_BlockX),
+ static_cast<double>(m_BlockY),
+ static_cast<double>(m_BlockZ),
+ 1, 1
+ );
}
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index 37683a8e5..5b58b18b6 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -1394,7 +1394,7 @@ void cSlotAreaBeacon::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum)
// cSlotAreaEnchanting:
cSlotAreaEnchanting::cSlotAreaEnchanting(cWindow & a_ParentWindow, int a_BlockX, int a_BlockY, int a_BlockZ) :
- cSlotAreaTemporary(1, a_ParentWindow),
+ cSlotAreaTemporary(2, a_ParentWindow),
m_BlockX(a_BlockX),
m_BlockY(a_BlockY),
m_BlockZ(a_BlockZ)
@@ -2154,10 +2154,10 @@ bool cSlotAreaArmor::CanPlaceArmorInSlot(int a_SlotNum, const cItem & a_Item)
{
switch (a_SlotNum)
{
- case 0: return ItemCategory::IsHelmet (a_Item.m_ItemType);
+ case 0: return (ItemCategory::IsHelmet(a_Item.m_ItemType) || (a_Item.m_ItemType == E_BLOCK_PUMPKIN));
case 1: return ItemCategory::IsChestPlate(a_Item.m_ItemType);
- case 2: return ItemCategory::IsLeggings (a_Item.m_ItemType);
- case 3: return ItemCategory::IsBoots (a_Item.m_ItemType);
+ case 2: return ItemCategory::IsLeggings(a_Item.m_ItemType);
+ case 3: return ItemCategory::IsBoots(a_Item.m_ItemType);
}
return false;
}
diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h
index f6a9972d6..664c6502c 100644
--- a/src/UI/SlotArea.h
+++ b/src/UI/SlotArea.h
@@ -239,7 +239,7 @@ public:
// cSlotAreaTemporary overrides:
virtual void Clicked (cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem) override;
- virtual void DblClicked (cPlayer & a_Player, int a_SlotNum);
+ virtual void DblClicked (cPlayer & a_Player, int a_SlotNum) override;
virtual void OnPlayerRemoved(cPlayer & a_Player) override;
virtual void SetSlot (int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override;
diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp
index d1c08acec..61e25651b 100644
--- a/src/UI/Window.cpp
+++ b/src/UI/Window.cpp
@@ -92,9 +92,9 @@ const AString cWindow::GetWindowTypeName(void) const
int cWindow::GetNumSlots(void) const
{
int res = 0;
- for (cSlotAreas::const_iterator itr = m_SlotAreas.begin(), end = m_SlotAreas.end(); itr != end; ++itr)
+ for (const auto & itr : m_SlotAreas)
{
- res += (*itr)->GetNumSlots();
+ res += itr->GetNumSlots();
} // for itr - m_SlotAreas[]
return res;
}
@@ -261,16 +261,14 @@ void cWindow::Clicked(
}
int LocalSlotNum = a_SlotNum;
- int idx = 0;
- for (cSlotAreas::iterator itr = m_SlotAreas.begin(), end = m_SlotAreas.end(); itr != end; ++itr)
+ for (const auto & itr : m_SlotAreas)
{
- if (LocalSlotNum < (*itr)->GetNumSlots())
+ if (LocalSlotNum < itr->GetNumSlots())
{
- (*itr)->Clicked(a_Player, LocalSlotNum, a_ClickAction, a_ClickedItem);
+ itr->Clicked(a_Player, LocalSlotNum, a_ClickAction, a_ClickedItem);
return;
}
- LocalSlotNum -= (*itr)->GetNumSlots();
- idx++;
+ LocalSlotNum -= itr->GetNumSlots();
}
LOGWARNING("Slot number higher than available window slots: %d, max %d received from \"%s\"; ignoring.",
diff --git a/src/Vector3.h b/src/Vector3.h
index 346bc1bbb..168071469 100644
--- a/src/Vector3.h
+++ b/src/Vector3.h
@@ -384,6 +384,28 @@ template <> inline Vector3<int> Vector3<int>::Floor(void) const
+template <typename What>
+class VectorHasher
+{
+public:
+ /** Provides a hash of a vector's contents */
+ size_t operator()(const Vector3<What> & a_Vector) const
+ {
+ // Guaranteed to have no hash collisions for any 128x128x128 area
+ size_t Hash = 0;
+ Hash ^= static_cast<size_t>(a_Vector.x);
+ Hash <<= 8;
+ Hash ^= static_cast<size_t>(a_Vector.y);
+ Hash <<= 8;
+ Hash ^= static_cast<size_t>(a_Vector.z);
+ return Hash;
+ }
+};
+
+
+
+
+
template <typename T>
const double Vector3<T>::EPS = 0.000001;
diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp
index 1cb4463e1..91fad96c6 100644
--- a/src/WebAdmin.cpp
+++ b/src/WebAdmin.cpp
@@ -321,7 +321,7 @@ void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPReque
int MemUsageKiB = cRoot::GetPhysicalRAMUsage();
if (MemUsageKiB > 0)
{
- ReplaceString(Template, "{MEM}", Printf("%.02f", (double)MemUsageKiB / 1024));
+ ReplaceString(Template, "{MEM}", Printf("%.02f", static_cast<double>(MemUsageKiB) / 1024));
ReplaceString(Template, "{MEMKIB}", Printf("%d", MemUsageKiB));
}
else
@@ -648,7 +648,7 @@ void cWebAdmin::OnRequestBegun(cHTTPConnection & a_Connection, cHTTPRequest & a_
void cWebAdmin::OnRequestBody(cHTTPConnection & a_Connection, cHTTPRequest & a_Request, const char * a_Data, size_t a_Size)
{
UNUSED(a_Connection);
- cRequestData * Data = (cRequestData *)(a_Request.GetUserData());
+ cRequestData * Data = reinterpret_cast<cRequestData *>(a_Request.GetUserData());
if (Data == nullptr)
{
return;
@@ -681,7 +681,7 @@ void cWebAdmin::OnRequestFinished(cHTTPConnection & a_Connection, cHTTPRequest &
}
// Delete any request data assigned to the request:
- cRequestData * Data = (cRequestData *)(a_Request.GetUserData());
+ cRequestData * Data = reinterpret_cast<cRequestData *>(a_Request.GetUserData());
delete Data;
Data = nullptr;
}
diff --git a/src/World.cpp b/src/World.cpp
index c0a79b9d0..123e4a8da 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -58,6 +58,8 @@
#endif
#include "Broadcaster.h"
+#include "SpawnPrepare.h"
+#include "FastRandom.h"
@@ -72,140 +74,6 @@ const int TIME_SPAWN_DIVISOR = 148;
////////////////////////////////////////////////////////////////////////////////
-// cSpawnPrepare:
-
-/** Generates and lights the spawn area of the world. Runs as a separate thread. */
-class cSpawnPrepare:
- public cIsThread,
- public cChunkCoordCallback
-{
- typedef cIsThread super;
-
-public:
- cSpawnPrepare(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance):
- super("SpawnPrepare"),
- m_World(a_World),
- m_SpawnChunkX(a_SpawnChunkX),
- m_SpawnChunkZ(a_SpawnChunkZ),
- m_PrepareDistance(a_PrepareDistance),
- m_MaxIdx(a_PrepareDistance * a_PrepareDistance),
- m_NumPrepared(0),
- m_LastReportChunkCount(0)
- {
- // Start the thread:
- Start();
-
- // Wait for start confirmation, so that the thread can be waited-upon after the constructor returns:
- m_EvtStarted.Wait();
- }
-
-
- // cIsThread override:
- virtual void Execute(void) override
- {
- // Confirm thread start:
- m_EvtStarted.Set();
-
- // Queue the initial chunks:
- m_MaxIdx = m_PrepareDistance * m_PrepareDistance;
- int maxQueue = std::min(m_MaxIdx - 1, 100); // Number of chunks to queue at once
- m_NextIdx = maxQueue;
- m_LastReportTime = std::chrono::steady_clock::now();
- for (int i = 0; i < maxQueue; i++)
- {
- int chunkX, chunkZ;
- DecodeChunkCoords(i, chunkX, chunkZ);
- m_World.PrepareChunk(chunkX, chunkZ, this);
- } // for i
-
- // Wait for the lighting thread to prepare everything. Event is set in the Call() callback:
- m_EvtFinished.Wait();
- }
-
-protected:
- cWorld & m_World;
- int m_SpawnChunkX;
- int m_SpawnChunkZ;
- int m_PrepareDistance;
-
- /** The index of the next chunk to be queued in the lighting thread. */
- int m_NextIdx;
-
- /** The maximum index of the prepared chunks. Queueing stops when m_NextIdx reaches this number. */
- int m_MaxIdx;
-
- /** Total number of chunks already finished preparing. Preparation finishes when this number reaches m_MaxIdx. */
- int m_NumPrepared;
-
- /** Event used to signal that the thread has started. */
- cEvent m_EvtStarted;
-
- /** Event used to signal that the preparation is finished. */
- cEvent m_EvtFinished;
-
- /** The timestamp of the last progress report emitted. */
- std::chrono::steady_clock::time_point m_LastReportTime;
-
- /** Number of chunks prepared when the last progress report was emitted. */
- int m_LastReportChunkCount;
-
- // cChunkCoordCallback override:
- virtual void Call(int a_ChunkX, int a_ChunkZ)
- {
- // Check if this was the last chunk:
- m_NumPrepared += 1;
- if (m_NumPrepared >= m_MaxIdx)
- {
- m_EvtFinished.Set();
- // Must return here, because "this" may have gotten deleted by the previous line
- return;
- }
-
- // Queue another chunk, if appropriate:
- if (m_NextIdx < m_MaxIdx)
- {
- int chunkX, chunkZ;
- DecodeChunkCoords(m_NextIdx, chunkX, chunkZ);
- m_World.GetLightingThread().QueueChunk(chunkX, chunkZ, this);
- m_NextIdx += 1;
- }
-
- // Report progress every 1 second:
- auto Now = std::chrono::steady_clock::now();
- if (Now - m_LastReportTime > std::chrono::seconds(1))
- {
- float PercentDone = static_cast<float>(m_NumPrepared * 100) / m_MaxIdx;
- float ChunkSpeed = static_cast<float>((m_NumPrepared - m_LastReportChunkCount) * 1000) / std::chrono::duration_cast<std::chrono::milliseconds>(Now - m_LastReportTime).count();
- LOG("Preparing spawn (%s): %.02f%% (%d/%d; %.02f chunks / sec)",
- m_World.GetName().c_str(), PercentDone, m_NumPrepared, m_MaxIdx, ChunkSpeed
- );
- m_LastReportTime = Now;
- m_LastReportChunkCount = m_NumPrepared;
- }
- }
-
-
- /** Decodes the index into chunk coords. Provides the specific chunk ordering. */
- void DecodeChunkCoords(int a_Idx, int & a_ChunkX, int & a_ChunkZ)
- {
- // A zigzag pattern from the top to bottom, each row alternating between forward-x and backward-x:
- int z = a_Idx / m_PrepareDistance;
- int x = a_Idx % m_PrepareDistance;
- if ((z & 1) == 0)
- {
- // Reverse every second row:
- x = m_PrepareDistance - 1 - x;
- }
- a_ChunkZ = m_SpawnChunkZ + z - m_PrepareDistance / 2;
- a_ChunkX = m_SpawnChunkX + x - m_PrepareDistance / 2;
- }
-};
-
-
-
-
-
-////////////////////////////////////////////////////////////////////////////////
// cWorld::cLock:
cWorld::cLock::cLock(cWorld & a_World) :
@@ -319,6 +187,7 @@ cWorld::cWorld(const AString & a_WorldName, eDimension a_Dimension, const AStrin
m_Scoreboard(this),
m_MapManager(this),
m_GeneratorCallbacks(*this),
+ m_ChunkSender(*this),
m_TickThread(*this)
{
LOGD("cWorld::cWorld(\"%s\")", a_WorldName.c_str());
@@ -362,6 +231,7 @@ cWorld::~cWorld()
void cWorld::CastThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ)
{
BroadcastThunderbolt(a_BlockX, a_BlockY, a_BlockZ);
+ BroadcastSoundEffect("ambient.weather.thunder", a_BlockX, a_BlockY, a_BlockZ, 50, 1);
}
@@ -469,8 +339,7 @@ void cWorld::InitializeSpawn(void)
int ViewDist = IniFile.GetValueSetI("SpawnPosition", "PregenerateDistance", DefaultViewDist);
IniFile.WriteFile(m_IniFileName);
- cSpawnPrepare prep(*this, ChunkX, ChunkZ, ViewDist);
- prep.Wait();
+ cSpawnPrepare::PrepareChunks(*this, ChunkX, ChunkZ, ViewDist);
#ifdef TEST_LINEBLOCKTRACER
// DEBUG: Test out the cLineBlockTracer class by tracing a few lines:
@@ -597,6 +466,10 @@ void cWorld::Start(void)
m_bCommandBlocksEnabled = IniFile.GetValueSetB("Mechanics", "CommandBlocksEnabled", false);
m_bEnabledPVP = IniFile.GetValueSetB("Mechanics", "PVPEnabled", true);
m_bUseChatPrefixes = IniFile.GetValueSetB("Mechanics", "UseChatPrefixes", true);
+ m_MinNetherPortalWidth = IniFile.GetValueSetI("Mechanics", "MinNetherPortalWidth", 2);
+ m_MaxNetherPortalWidth = IniFile.GetValueSetI("Mechanics", "MaxNetherPortalWidth", 21);
+ m_MinNetherPortalHeight = IniFile.GetValueSetI("Mechanics", "MinNetherPortalHeight", 3);
+ m_MaxNetherPortalHeight = IniFile.GetValueSetI("Mechanics", "MaxNetherPortalHeight", 21);
m_VillagersShouldHarvestCrops = IniFile.GetValueSetB("Monsters", "VillagersShouldHarvestCrops", true);
m_IsDaylightCycleEnabled = IniFile.GetValueSetB("General", "IsDaylightCycleEnabled", true);
int GameMode = IniFile.GetValueSetI("General", "Gamemode", (int)m_GameMode);
@@ -621,18 +494,18 @@ void cWorld::Start(void)
InitialiseAndLoadMobSpawningValues(IniFile);
SetTimeOfDay(IniFile.GetValueSetI("General", "TimeInTicks", GetTimeOfDay()));
- m_ChunkMap = make_unique<cChunkMap>(this);
+ m_ChunkMap = cpp14::make_unique<cChunkMap>(this);
// preallocate some memory for ticking blocks so we don't need to allocate that often
m_BlockTickQueue.reserve(1000);
m_BlockTickQueueCopy.reserve(1000);
// Simulators:
- m_SimulatorManager = make_unique<cSimulatorManager>(*this);
+ m_SimulatorManager = cpp14::make_unique<cSimulatorManager>(*this);
m_WaterSimulator = InitializeFluidSimulator(IniFile, "Water", E_BLOCK_WATER, E_BLOCK_STATIONARY_WATER);
m_LavaSimulator = InitializeFluidSimulator(IniFile, "Lava", E_BLOCK_LAVA, E_BLOCK_STATIONARY_LAVA);
- m_SandSimulator = make_unique<cSandSimulator>(*this, IniFile);
- m_FireSimulator = make_unique<cFireSimulator>(*this, IniFile);
+ m_SandSimulator = cpp14::make_unique<cSandSimulator>(*this, IniFile);
+ m_FireSimulator = cpp14::make_unique<cFireSimulator>(*this, IniFile);
m_RedstoneSimulator = InitializeRedstoneSimulator(IniFile);
// Water, Lava and Redstone simulators get registered in their initialize function.
@@ -642,7 +515,7 @@ void cWorld::Start(void)
m_Lighting.Start(this);
m_Storage.Start(this, m_StorageSchema, m_StorageCompressionFactor);
m_Generator.Start(m_GeneratorCallbacks, m_GeneratorCallbacks, IniFile);
- m_ChunkSender.Start(this);
+ m_ChunkSender.Start();
m_TickThread.Start();
// Init of the spawn monster time (as they are supposed to have different spawn rate)
@@ -800,7 +673,7 @@ void cWorld::InitialiseGeneratorDefaults(cIniFile & a_IniFile)
a_IniFile.GetValueSet("Generator", "BiomeGen", "Grown");
a_IniFile.GetValueSet("Generator", "ShapeGen", "BiomalNoise3D");
a_IniFile.GetValueSet("Generator", "CompositionGen", "Biomal");
- a_IniFile.GetValueSet("Generator", "Finishers", "Ravines, WormNestCaves, WaterLakes, WaterSprings, LavaLakes, LavaSprings, OreNests, Mineshafts, Trees, Villages, SprinkleFoliage, Ice, Snow, Lilypads, BottomLava, DeadBushes, NaturalPatches, PreSimulator, Animals");
+ a_IniFile.GetValueSet("Generator", "Finishers", "RoughRavines, WormNestCaves, WaterLakes, WaterSprings, LavaLakes, LavaSprings, OreNests, Mineshafts, Trees, Villages, TallGrass, SprinkleFoliage, Ice, Snow, Lilypads, BottomLava, DeadBushes, NaturalPatches, PreSimulator, Animals");
break;
}
case dimNether:
@@ -1459,6 +1332,30 @@ bool cWorld::DoWithChunk(int a_ChunkX, int a_ChunkZ, cChunkCallback & a_Callback
+bool cWorld::DoWithChunk(int a_ChunkX, int a_ChunkZ, std::function<bool(cChunk &)> a_Callback)
+{
+ struct cCallBackWrapper : cChunkCallback
+ {
+ cCallBackWrapper(std::function<bool(cChunk &)> a_InnerCallback) :
+ m_Callback(a_InnerCallback)
+ {
+ }
+
+ virtual bool Item(cChunk * a_Chunk)
+ {
+ return m_Callback(*a_Chunk);
+ }
+
+ private:
+ std::function<bool(cChunk &)> m_Callback;
+ } callback(a_Callback);
+ return m_ChunkMap->DoWithChunk(a_ChunkX, a_ChunkZ, callback);
+}
+
+
+
+
+
bool cWorld::DoWithChunkAt(Vector3i a_BlockPos, std::function<bool(cChunk &)> a_Callback)
{
return m_ChunkMap->DoWithChunkAt(a_BlockPos, a_Callback);
@@ -1496,9 +1393,23 @@ void cWorld::GrowTreeFromSapling(int a_X, int a_Y, int a_Z, NIBBLETYPE a_Sapling
case E_META_SAPLING_APPLE: GetAppleTreeImage (a_X, a_Y, a_Z, Noise, WorldAge, Logs, Other); break;
case E_META_SAPLING_BIRCH: GetBirchTreeImage (a_X, a_Y, a_Z, Noise, WorldAge, Logs, Other); break;
case E_META_SAPLING_CONIFER: GetConiferTreeImage(a_X, a_Y, a_Z, Noise, WorldAge, Logs, Other); break;
- case E_META_SAPLING_JUNGLE: GetJungleTreeImage (a_X, a_Y, a_Z, Noise, WorldAge, Logs, Other); break;
case E_META_SAPLING_ACACIA: GetAcaciaTreeImage (a_X, a_Y, a_Z, Noise, WorldAge, Logs, Other); break;
- case E_META_SAPLING_DARK_OAK: GetDarkoakTreeImage(a_X, a_Y, a_Z, Noise, WorldAge, Logs, Other); break;
+ case E_META_SAPLING_JUNGLE:
+ {
+ bool IsLarge = GetLargeTreeAdjustment(*this, a_X, a_Y, a_Z, a_SaplingMeta);
+ GetJungleTreeImage (a_X, a_Y, a_Z, Noise, WorldAge, Logs, Other, IsLarge);
+ break;
+ }
+ case E_META_SAPLING_DARK_OAK:
+ {
+ if (!GetLargeTreeAdjustment(*this, a_X, a_Y, a_Z, a_SaplingMeta))
+ {
+ return;
+ }
+
+ GetDarkoakTreeImage(a_X, a_Y, a_Z, Noise, WorldAge, Logs, Other);
+ break;
+ }
}
Other.insert(Other.begin(), Logs.begin(), Logs.end());
Logs.clear();
@@ -1569,6 +1480,7 @@ void cWorld::GrowTreeImage(const sSetBlockVector & a_Blocks)
bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsByBonemeal)
{
+ cFastRandom random;
BLOCKTYPE BlockType;
NIBBLETYPE BlockMeta;
GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta);
@@ -1582,10 +1494,19 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
}
if (BlockMeta < 7)
{
- FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
+ if (!a_IsByBonemeal)
+ {
+ ++BlockMeta;
+ }
+ else
+ {
+ BlockMeta += random.NextInt(4) + 2;
+ BlockMeta = std::min(BlockMeta, static_cast<NIBBLETYPE>(7));
+ }
+ FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta);
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
}
- return true;
+ return BlockMeta == 7;
}
case E_BLOCK_COCOA_POD:
@@ -1599,7 +1520,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, (NIBBLETYPE) (GrowState << 2 | TypeMeta));
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
}
- return true;
+ return GrowState == 2;
}
case E_BLOCK_CROPS:
@@ -1610,10 +1531,19 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
}
if (BlockMeta < 7)
{
- FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
+ if (!a_IsByBonemeal)
+ {
+ ++BlockMeta;
+ }
+ else
+ {
+ BlockMeta += random.NextInt(4) + 2;
+ BlockMeta = std::min(BlockMeta, static_cast<NIBBLETYPE>(7));
+ }
+ FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta);
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
}
- return true;
+ return BlockMeta == 7;
}
case E_BLOCK_MELON_STEM:
@@ -1624,7 +1554,17 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
{
return false;
}
- FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
+
+ if (!a_IsByBonemeal)
+ {
+ ++BlockMeta;
+ }
+ else
+ {
+ BlockMeta += random.NextInt(4) + 2;
+ BlockMeta = std::min(BlockMeta, static_cast<NIBBLETYPE>(7));
+ }
+ FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta);
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
}
else
@@ -1635,7 +1575,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
}
GrowMelonPumpkin(a_BlockX, a_BlockY, a_BlockZ, BlockType);
}
- return true;
+ return BlockMeta == 7;
}
case E_BLOCK_POTATOES:
@@ -1646,10 +1586,19 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
}
if (BlockMeta < 7)
{
- FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
+ if (!a_IsByBonemeal)
+ {
+ ++BlockMeta;
+ }
+ else
+ {
+ BlockMeta += random.NextInt(4) + 2;
+ BlockMeta = std::min(BlockMeta, static_cast<NIBBLETYPE>(7));
+ }
+ FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta);
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
}
- return true;
+ return BlockMeta == 7;
}
case E_BLOCK_PUMPKIN_STEM:
@@ -1660,7 +1609,17 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
{
return false;
}
- FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
+
+ if (!a_IsByBonemeal)
+ {
+ ++BlockMeta;
+ }
+ else
+ {
+ BlockMeta += random.NextInt(4) + 2;
+ BlockMeta = std::min(BlockMeta, static_cast<NIBBLETYPE>(7));
+ }
+ FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta);
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
}
else
@@ -1671,7 +1630,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
}
GrowMelonPumpkin(a_BlockX, a_BlockY, a_BlockZ, BlockType);
}
- return true;
+ return BlockMeta == 7;
}
case E_BLOCK_SAPLING:
@@ -1680,8 +1639,31 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
{
return false;
}
- GrowTreeFromSapling(a_BlockX, a_BlockY, a_BlockZ, BlockMeta);
- return true;
+ NIBBLETYPE TypeMeta = BlockMeta & 0x07;
+ int GrowState = BlockMeta >> 3;
+
+ if (GrowState < 1)
+ {
+ // Non-bonemeal forces a growth, while bonemeal only has a chance of growing it
+ if (!a_IsByBonemeal)
+ {
+ ++GrowState;
+ }
+ else if (random.NextInt(99) < 45)
+ {
+ ++GrowState;
+ }
+
+ FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, static_cast<NIBBLETYPE>(GrowState << 3 | TypeMeta));
+ BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
+ }
+ else if (random.NextInt(99) < 45)
+ {
+
+ GrowTreeFromSapling(a_BlockX, a_BlockY, a_BlockZ, BlockMeta);
+ return true;
+ }
+ return false;
}
case E_BLOCK_GRASS:
@@ -2071,7 +2053,7 @@ void cWorld::BroadcastAttachEntity(const cEntity & a_Entity, const cEntity * a_V
-void cWorld::BroadcastBlockAction(int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle * a_Exclude)
+void cWorld::BroadcastBlockAction(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Byte1, Byte a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle * a_Exclude)
{
m_ChunkMap->BroadcastBlockAction(a_BlockX, a_BlockY, a_BlockZ, a_Byte1, a_Byte2, a_BlockType, a_Exclude);
}
@@ -2134,15 +2116,6 @@ void cWorld::BroadcastChat(const cCompositeChat & a_Message, const cClientHandle
-void cWorld::BroadcastChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude)
-{
- m_ChunkMap->BroadcastChunkData(a_ChunkX, a_ChunkZ, a_Serializer, a_Exclude);
-}
-
-
-
-
-
void cWorld::BroadcastCollectEntity(const cEntity & a_Entity, const cPlayer & a_Player, const cClientHandle * a_Exclude)
{
m_ChunkMap->BroadcastCollectEntity(a_Entity, a_Player, a_Exclude);
@@ -2594,10 +2567,23 @@ void cWorld::SetChunkData(cSetChunkData & a_SetChunkData)
// If a client is requesting this chunk, send it to them:
int ChunkX = a_SetChunkData.GetChunkX();
int ChunkZ = a_SetChunkData.GetChunkZ();
- if (m_ChunkMap->HasChunkAnyClients(ChunkX, ChunkZ))
- {
- m_ChunkSender.ChunkReady(ChunkX, ChunkZ);
- }
+ cChunkSender & ChunkSender = m_ChunkSender;
+ DoWithChunk(
+ ChunkX, ChunkZ,
+ [&ChunkSender] (cChunk & a_Chunk) -> bool
+ {
+ if (a_Chunk.HasAnyClients())
+ {
+ ChunkSender.QueueSendChunkTo(
+ a_Chunk.GetPosX(),
+ a_Chunk.GetPosZ(),
+ cChunkSender::E_CHUNK_PRIORITY_MEDIUM,
+ a_Chunk.GetAllClients()
+ );
+ }
+ return true;
+ }
+ );
// Save the chunk right after generating, so that we don't have to generate it again on next run
if (a_SetChunkData.ShouldMarkDirty())
@@ -2680,7 +2666,7 @@ void cWorld::UnloadUnusedChunks(void)
void cWorld::QueueUnloadUnusedChunks(void)
{
- QueueTask(make_unique<cWorld::cTaskUnloadUnusedChunks>());
+ QueueTask(cpp14::make_unique<cWorld::cTaskUnloadUnusedChunks>());
}
@@ -3005,9 +2991,9 @@ void cWorld::TouchChunk(int a_ChunkX, int a_ChunkZ)
-void cWorld::PrepareChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_CallAfter)
+void cWorld::PrepareChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr<cChunkCoordCallback> a_CallAfter)
{
- m_ChunkMap->PrepareChunk(a_ChunkX, a_ChunkZ, a_CallAfter);
+ m_ChunkMap->PrepareChunk(a_ChunkX, a_ChunkZ, std::move(a_CallAfter));
}
@@ -3097,7 +3083,7 @@ bool cWorld::SetTrapdoorOpen(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_Op
return false;
}
- bool IsOpen = (Meta & 0x4) > 0;
+ bool IsOpen = (Meta & 0x4) != 0;
if (a_Open != IsOpen)
{
SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta ^ 0x4);
@@ -3131,9 +3117,9 @@ void cWorld::GenerateChunk(int a_ChunkX, int a_ChunkZ)
-void cWorld::QueueLightChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_Callback)
+void cWorld::QueueLightChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr<cChunkCoordCallback> a_Callback)
{
- m_Lighting.QueueChunk(a_ChunkX, a_ChunkZ, a_Callback);
+ m_Lighting.QueueChunk(a_ChunkX, a_ChunkZ, std::move(a_Callback));
}
@@ -3184,7 +3170,11 @@ void cWorld::QueueTask(cTaskPtr a_Task)
}
-
+void cWorld::ScheduleTask(int a_DelayTicks, std::function<void (cWorld&)> a_Func)
+{
+ cTaskLambda task(a_Func);
+ ScheduleTask(a_DelayTicks, static_cast<cTaskPtr>(std::make_shared<cTaskLambda>(task)));
+}
void cWorld::ScheduleTask(int a_DelayTicks, cTaskPtr a_Task)
@@ -3687,8 +3677,10 @@ void cWorld::cTaskSendBlockToAllPlayers::Run(cWorld & a_World)
a_World.ForEachPlayer(PlayerCallback);
}
-
-
+void cWorld::cTaskLambda::Run(cWorld & a_World)
+{
+ m_func(a_World);
+}
////////////////////////////////////////////////////////////////////////////////
diff --git a/src/World.h b/src/World.h
index 6c0548ae6..aeab7bfa5 100644
--- a/src/World.h
+++ b/src/World.h
@@ -103,8 +103,12 @@ public:
class cTask
{
public:
+ cTask(const cTask & other) = default;
virtual ~cTask() {}
virtual void Run(cWorld & a_World) = 0;
+
+ protected:
+ cTask() {}
} ;
typedef SharedPtr<cTask> cTaskPtr;
@@ -142,6 +146,21 @@ public:
std::vector<Vector3i> m_SendQueue;
};
+ class cTaskLambda :
+ public cTask
+ {
+
+ public:
+ cTaskLambda(std::function<void(cWorld&)> a_Func) :
+ m_func(a_Func)
+ { }
+
+ protected:
+ virtual void Run(cWorld & a_World) override;
+
+ std::function<void(cWorld&)> m_func;
+ };
+
static const char * GetClassStatic(void) // Needed for ManualBindings's ForEach templates
{
@@ -203,10 +222,10 @@ public:
bool VillagersShouldHarvestCrops(void) const { return m_VillagersShouldHarvestCrops; }
- virtual eDimension GetDimension(void) const { return m_Dimension; }
+ virtual eDimension GetDimension(void) const override { return m_Dimension; }
/** Returns the world height at the specified coords; waits for the chunk to get loaded / generated */
- virtual int GetHeight(int a_BlockX, int a_BlockZ);
+ virtual int GetHeight(int a_BlockX, int a_BlockZ) override;
// tolua_end
@@ -216,7 +235,7 @@ public:
// Broadcast respective packets to all clients of the chunk where the event is taking place
// (Please keep these alpha-sorted)
void BroadcastAttachEntity (const cEntity & a_Entity, const cEntity * a_Vehicle);
- void BroadcastBlockAction (int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle * a_Exclude = nullptr); // tolua_export
+ void BroadcastBlockAction (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Byte1, Byte a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle * a_Exclude = nullptr); // tolua_export
void BroadcastBlockBreakAnimation(UInt32 a_EntityID, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Stage, const cClientHandle * a_Exclude = nullptr);
void BroadcastBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, const cClientHandle * a_Exclude = nullptr); ///< If there is a block entity at the specified coods, sends it to all clients except a_Exclude
@@ -231,7 +250,6 @@ public:
void BroadcastChat (const cCompositeChat & a_Message, const cClientHandle * a_Exclude = nullptr);
// tolua_end
- void BroadcastChunkData (int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude = nullptr);
void BroadcastCollectEntity (const cEntity & a_Pickup, const cPlayer & a_Player, const cClientHandle * a_Exclude = nullptr);
void BroadcastDestroyEntity (const cEntity & a_Entity, const cClientHandle * a_Exclude = nullptr);
void BroadcastEntityEffect (const cEntity & a_Entity, int a_EffectID, int a_Amplifier, short a_Duration, const cClientHandle * a_Exclude = nullptr);
@@ -253,7 +271,7 @@ public:
void BroadcastScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode);
void BroadcastScoreUpdate (const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode);
void BroadcastDisplayObjective (const AString & a_Objective, cScoreboard::eDisplaySlot a_Display);
- void BroadcastSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude = nullptr); // tolua_export
+ void BroadcastSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude = nullptr) override; // tolua_export
void BroadcastSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data, const cClientHandle * a_Exclude = nullptr); // tolua_export
void BroadcastSpawnEntity (cEntity & a_Entity, const cClientHandle * a_Exclude = nullptr);
void BroadcastTeleportEntity (const cEntity & a_Entity, const cClientHandle * a_Exclude = nullptr);
@@ -385,7 +403,7 @@ public:
The specified chunk is queued to be loaded or generated, and lit if needed.
The specified callback is called after the chunk has been prepared. If there's no preparation to do, only the callback is called.
It is legal to call with no callback. */
- void PrepareChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_CallAfter = nullptr);
+ void PrepareChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr<cChunkCoordCallback> a_CallAfter = {});
/** Marks the chunk as failed-to-load: */
void ChunkLoadFailed(int a_ChunkX, int a_ChunkZ);
@@ -409,7 +427,7 @@ public:
void GenerateChunk(int a_ChunkX, int a_ChunkZ); // tolua_export
/** Queues a chunk for lighting; a_Callback is called after the chunk is lighted */
- void QueueLightChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_Callback = nullptr);
+ void QueueLightChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr<cChunkCoordCallback> a_Callback = {});
bool IsChunkLighted(int a_ChunkX, int a_ChunkZ);
@@ -609,6 +627,7 @@ public:
/** Calls the callback for the chunk specified, with ChunkMapCS locked; returns false if the chunk doesn't exist, otherwise returns the same value as the callback */
bool DoWithChunk(int a_ChunkX, int a_ChunkZ, cChunkCallback & a_Callback);
+ bool DoWithChunk(int a_ChunkX, int a_ChunkZ, std::function<bool(cChunk &)> a_Callback);
/** Calls the callback for the chunk at the block position specified, with ChunkMapCS locked; returns false if the chunk doesn't exist, otherwise returns the same value as the callback **/
bool DoWithChunkAt(Vector3i a_BlockPos, std::function<bool(cChunk &)> a_Callback);
@@ -694,6 +713,18 @@ public:
AString GetLinkedOverworldName(void) const { return m_LinkedOverworldName; }
void SetLinkedOverworldName(const AString & a_Name) { m_LinkedOverworldName = a_Name; }
+ /** Returns or sets the minumim or maximum netherportal width */
+ virtual int GetMinNetherPortalWidth(void) const override { return m_MinNetherPortalWidth; }
+ virtual int GetMaxNetherPortalWidth(void) const override { return m_MaxNetherPortalWidth; }
+ virtual void SetMinNetherPortalWidth(int a_NewMinWidth) override { m_MinNetherPortalWidth = a_NewMinWidth; }
+ virtual void SetMaxNetherPortalWidth(int a_NewMaxWidth) override { m_MaxNetherPortalWidth = a_NewMaxWidth; }
+
+ /** Returns or sets the minumim or maximum netherportal height */
+ virtual int GetMinNetherPortalHeight(void) const override { return m_MinNetherPortalHeight; }
+ virtual int GetMaxNetherPortalHeight(void) const override { return m_MaxNetherPortalHeight; }
+ virtual void SetMinNetherPortalHeight(int a_NewMinHeight) override { m_MinNetherPortalHeight = a_NewMinHeight; }
+ virtual void SetMaxNetherPortalHeight(int a_NewMaxHeight) override { m_MaxNetherPortalHeight = a_NewMaxHeight; }
+
// tolua_end
/** Saves all chunks immediately. Dangerous interface, may deadlock, use QueueSaveAllChunks() instead */
@@ -705,6 +736,9 @@ public:
/** Queues a task onto the tick thread. The task object will be deleted once the task is finished */
void QueueTask(cTaskPtr a_Task); // Exported in ManualBindings.cpp
+ /** Queues a lambda task onto the tick thread, with the specified delay. */
+ void ScheduleTask(int a_DelayTicks, std::function<void(cWorld&)> a_Func);
+
/** Queues a task onto the tick thread, with the specified delay. */
void ScheduleTask(int a_DelayTicks, cTaskPtr a_Task);
@@ -788,7 +822,7 @@ public:
bool IsWeatherWet(void) const { return !IsWeatherSunny(); }
/** Returns true if it is raining, stormy or snowing at the specified location. This takes into account biomes. */
- virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ)
+ virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) override
{
return (IsWeatherWet() && !IsBiomeNoDownfall(GetBiomeAt(a_BlockX, a_BlockZ)));
}
@@ -817,7 +851,7 @@ public:
UInt32 CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const cItem * a_Item, const Vector3d * a_Speed = nullptr); // tolua_export
/** Returns a random number from the m_TickRand in range [0 .. a_Range]. To be used only in the tick thread! */
- int GetTickRandomNumber(int a_Range) { return (int)(m_TickRand.randInt(a_Range)); }
+ int GetTickRandomNumber(int a_Range) { return static_cast<int>(m_TickRand.randInt(a_Range)); }
/** Appends all usernames starting with a_Text (case-insensitive) into Results */
void TabCompleteUserName(const AString & a_Text, AStringVector & a_Results);
@@ -920,6 +954,12 @@ private:
double m_SpawnY;
double m_SpawnZ;
+ // Variables defining the minimum and maximum size for a nether portal
+ int m_MinNetherPortalWidth;
+ int m_MaxNetherPortalWidth;
+ int m_MinNetherPortalHeight;
+ int m_MaxNetherPortalHeight;
+
bool m_BroadcastDeathMessages;
bool m_BroadcastAchievementMessages;
diff --git a/src/WorldStorage/CMakeLists.txt b/src/WorldStorage/CMakeLists.txt
index 59193db2a..017d85f27 100644
--- a/src/WorldStorage/CMakeLists.txt
+++ b/src/WorldStorage/CMakeLists.txt
@@ -14,7 +14,8 @@ SET (SRCS
ScoreboardSerializer.cpp
StatSerializer.cpp
WSSAnvil.cpp
- WorldStorage.cpp)
+ WorldStorage.cpp
+)
SET (HDRS
EnchantmentSerializer.h
@@ -26,7 +27,20 @@ SET (HDRS
ScoreboardSerializer.h
StatSerializer.h
WSSAnvil.h
- WorldStorage.h)
+ WorldStorage.h
+)
+
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(EnchantmentSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(FastNBT.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=old-style-cast")
+ set_source_files_properties(FireworksSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum -Wno-error=old-style-cast")
+ set_source_files_properties(MapSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(NBTChunkSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum -Wno-error=sign-conversion -Wno-error=conversion -Wno-error=old-style-cast")
+ set_source_files_properties(SchematicFileSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=shadow -Wno-error=conversion -Wno-error=old-style-cast -Wno-error=global-constructors")
+ set_source_files_properties(ScoreboardSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+ set_source_files_properties(WSSAnvil.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=shorten-64-to-32 -Wno-error=switch -Wno-error=switch-enum -Wno-error=conversion -Wno-error=old-style-cast")
+ set_source_files_properties(WorldStorage.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
+endif()
if(NOT MSVC)
add_library(WorldStorage ${SRCS} ${HDRS})
diff --git a/src/WorldStorage/EnchantmentSerializer.cpp b/src/WorldStorage/EnchantmentSerializer.cpp
index a6e562956..b28e16b1d 100644
--- a/src/WorldStorage/EnchantmentSerializer.cpp
+++ b/src/WorldStorage/EnchantmentSerializer.cpp
@@ -14,8 +14,8 @@ void EnchantmentSerializer::WriteToNBTCompound(const cEnchantments & a_Enchantme
for (cEnchantments::cMap::const_iterator itr = a_Enchantments.m_Enchantments.begin(), end = a_Enchantments.m_Enchantments.end(); itr != end; ++itr)
{
a_Writer.BeginCompound("");
- a_Writer.AddShort("id", itr->first);
- a_Writer.AddShort("lvl", itr->second);
+ a_Writer.AddShort("id", static_cast<Int16>(itr->first));
+ a_Writer.AddShort("lvl", static_cast<Int16>(itr->second));
a_Writer.EndCompound();
} // for itr - m_Enchantments[]
a_Writer.EndList();
@@ -82,7 +82,7 @@ void EnchantmentSerializer::ParseFromNBT(cEnchantments & a_Enchantments, const c
}
// Store the enchantment:
- a_Enchantments.m_Enchantments[id] = lvl;
+ a_Enchantments.m_Enchantments[id] = static_cast<unsigned int>(lvl);
} // for tag - children of the ench list tag
}
diff --git a/src/WorldStorage/FastNBT.cpp b/src/WorldStorage/FastNBT.cpp
index 033a07601..860eb3a4a 100644
--- a/src/WorldStorage/FastNBT.cpp
+++ b/src/WorldStorage/FastNBT.cpp
@@ -257,7 +257,10 @@ bool cParsedNBT::ReadTag(void)
return true;
}
+ #if !defined(__clang__)
default:
+ #endif
+ case TAG_Min:
{
ASSERT(!"Unhandled NBT tag type");
return false;
@@ -503,7 +506,7 @@ void cFastNBTWriter::AddString(const AString & a_Name, const AString & a_Value)
void cFastNBTWriter::AddByteArray(const AString & a_Name, const char * a_Value, size_t a_NumElements)
{
TagCommon(a_Name, TAG_ByteArray);
- u_long len = htonl(static_cast<u_long>(a_NumElements));
+ u_int len = htonl(static_cast<u_int>(a_NumElements));
m_Result.append(reinterpret_cast<const char *>(&len), 4);
m_Result.append(a_Value, a_NumElements);
}
@@ -515,7 +518,7 @@ void cFastNBTWriter::AddByteArray(const AString & a_Name, const char * a_Value,
void cFastNBTWriter::AddIntArray(const AString & a_Name, const int * a_Value, size_t a_NumElements)
{
TagCommon(a_Name, TAG_IntArray);
- u_long len = htonl(static_cast<u_long>(a_NumElements));
+ u_int len = htonl(static_cast<u_int>(a_NumElements));
size_t cap = m_Result.capacity();
size_t size = m_Result.length();
if ((cap - size) < (4 + a_NumElements * 4))
diff --git a/src/WorldStorage/FastNBT.h b/src/WorldStorage/FastNBT.h
index 35e47c8e4..a23dc7af2 100644
--- a/src/WorldStorage/FastNBT.h
+++ b/src/WorldStorage/FastNBT.h
@@ -126,33 +126,33 @@ public:
int GetRoot(void) const {return 0; }
/** Returns the first child of the specified tag, or -1 if none / not applicable. */
- int GetFirstChild (int a_Tag) const { return m_Tags[(size_t)a_Tag].m_FirstChild; }
+ int GetFirstChild (int a_Tag) const { return m_Tags[static_cast<size_t>(a_Tag)].m_FirstChild; }
/** Returns the last child of the specified tag, or -1 if none / not applicable. */
- int GetLastChild (int a_Tag) const { return m_Tags[(size_t)a_Tag].m_LastChild; }
+ int GetLastChild (int a_Tag) const { return m_Tags[static_cast<size_t>(a_Tag)].m_LastChild; }
/** Returns the next sibling of the specified tag, or -1 if none. */
- int GetNextSibling(int a_Tag) const { return m_Tags[(size_t)a_Tag].m_NextSibling; }
+ int GetNextSibling(int a_Tag) const { return m_Tags[static_cast<size_t>(a_Tag)].m_NextSibling; }
/** Returns the previous sibling of the specified tag, or -1 if none. */
- int GetPrevSibling(int a_Tag) const { return m_Tags[(size_t)a_Tag].m_PrevSibling; }
+ int GetPrevSibling(int a_Tag) const { return m_Tags[static_cast<size_t>(a_Tag)].m_PrevSibling; }
/** Returns the length of the tag's data, in bytes.
Not valid for Compound or List tags! */
size_t GetDataLength (int a_Tag) const
{
- ASSERT(m_Tags[(size_t)a_Tag].m_Type != TAG_List);
- ASSERT(m_Tags[(size_t)a_Tag].m_Type != TAG_Compound);
- return m_Tags[(size_t)a_Tag].m_DataLength;
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type != TAG_List);
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type != TAG_Compound);
+ return m_Tags[static_cast<size_t>(a_Tag)].m_DataLength;
}
/** Returns the data stored in this tag.
Not valid for Compound or List tags! */
const char * GetData(int a_Tag) const
{
- ASSERT(m_Tags[(size_t)a_Tag].m_Type != TAG_List);
- ASSERT(m_Tags[(size_t)a_Tag].m_Type != TAG_Compound);
- return m_Data + m_Tags[(size_t)a_Tag].m_DataStart;
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type != TAG_List);
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type != TAG_Compound);
+ return m_Data + m_Tags[static_cast<size_t>(a_Tag)].m_DataStart;
}
/** Returns the direct child tag of the specified name, or -1 if no such tag. */
@@ -167,47 +167,47 @@ public:
/** Returns the child tag of the specified path (Name1 / Name2 / Name3...), or -1 if no such tag. */
int FindTagByPath(int a_Tag, const AString & a_Path) const;
- eTagType GetType(int a_Tag) const { return m_Tags[(size_t)a_Tag].m_Type; }
+ eTagType GetType(int a_Tag) const { return m_Tags[static_cast<size_t>(a_Tag)].m_Type; }
/** Returns the children type for a List tag; undefined on other tags. If list empty, returns TAG_End. */
eTagType GetChildrenType(int a_Tag) const
{
- ASSERT(m_Tags[(size_t)a_Tag].m_Type == TAG_List);
- return (m_Tags[(size_t)a_Tag].m_FirstChild < 0) ? TAG_End : m_Tags[(size_t)m_Tags[(size_t)a_Tag].m_FirstChild].m_Type;
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_List);
+ return (m_Tags[static_cast<size_t>(a_Tag)].m_FirstChild < 0) ? TAG_End : m_Tags[static_cast<size_t>(m_Tags[static_cast<size_t>(a_Tag)].m_FirstChild)].m_Type;
}
/** Returns the value stored in a Byte tag. Not valid for any other tag type. */
inline unsigned char GetByte(int a_Tag) const
{
- ASSERT(m_Tags[(size_t)a_Tag].m_Type == TAG_Byte);
- return (unsigned char)(m_Data[(size_t)m_Tags[(size_t)a_Tag].m_DataStart]);
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_Byte);
+ return static_cast<unsigned char>(m_Data[static_cast<size_t>(m_Tags[static_cast<size_t>(a_Tag)].m_DataStart)]);
}
/** Returns the value stored in a Short tag. Not valid for any other tag type. */
inline Int16 GetShort(int a_Tag) const
{
- ASSERT(m_Tags[(size_t)a_Tag].m_Type == TAG_Short);
- return GetBEShort(m_Data + m_Tags[(size_t)a_Tag].m_DataStart);
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_Short);
+ return GetBEShort(m_Data + m_Tags[static_cast<size_t>(a_Tag)].m_DataStart);
}
/** Returns the value stored in an Int tag. Not valid for any other tag type. */
inline Int32 GetInt(int a_Tag) const
{
- ASSERT(m_Tags[(size_t)a_Tag].m_Type == TAG_Int);
- return GetBEInt(m_Data + m_Tags[(size_t)a_Tag].m_DataStart);
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_Int);
+ return GetBEInt(m_Data + m_Tags[static_cast<size_t>(a_Tag)].m_DataStart);
}
/** Returns the value stored in a Long tag. Not valid for any other tag type. */
inline Int64 GetLong(int a_Tag) const
{
- ASSERT(m_Tags[(size_t)a_Tag].m_Type == TAG_Long);
- return NetworkToHostLong8(m_Data + m_Tags[(size_t)a_Tag].m_DataStart);
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_Long);
+ return NetworkToHostLong8(m_Data + m_Tags[static_cast<size_t>(a_Tag)].m_DataStart);
}
/** Returns the value stored in a Float tag. Not valid for any other tag type. */
inline float GetFloat(int a_Tag) const
{
- ASSERT(m_Tags[(size_t)a_Tag].m_Type == TAG_Float);
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_Float);
// Cause a compile-time error if sizeof(float) != 4
// If your platform produces a compiler error here, you'll need to add code that manually decodes 32-bit floats
@@ -216,7 +216,7 @@ public:
UNUSED_VAR(Check1);
UNUSED_VAR(Check2);
- Int32 i = GetBEInt(m_Data + m_Tags[(size_t)a_Tag].m_DataStart);
+ Int32 i = GetBEInt(m_Data + m_Tags[static_cast<size_t>(a_Tag)].m_DataStart);
float f;
memcpy(&f, &i, sizeof(f));
return f;
@@ -232,16 +232,16 @@ public:
UNUSED_VAR(Check1);
UNUSED_VAR(Check2);
- ASSERT(m_Tags[(size_t)a_Tag].m_Type == TAG_Double);
- return NetworkToHostDouble8(m_Data + m_Tags[(size_t)a_Tag].m_DataStart);
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_Double);
+ return NetworkToHostDouble8(m_Data + m_Tags[static_cast<size_t>(a_Tag)].m_DataStart);
}
/** Returns the value stored in a String tag. Not valid for any other tag type. */
inline AString GetString(int a_Tag) const
{
- ASSERT(m_Tags[(size_t)a_Tag].m_Type == TAG_String);
+ ASSERT(m_Tags[static_cast<size_t>(a_Tag)].m_Type == TAG_String);
AString res;
- res.assign(m_Data + m_Tags[(size_t)a_Tag].m_DataStart, (size_t)m_Tags[(size_t)a_Tag].m_DataLength);
+ res.assign(m_Data + m_Tags[static_cast<size_t>(a_Tag)].m_DataStart, static_cast<size_t>(m_Tags[static_cast<size_t>(a_Tag)].m_DataLength));
return res;
}
@@ -249,7 +249,7 @@ public:
inline AString GetName(int a_Tag) const
{
AString res;
- res.assign(m_Data + m_Tags[(size_t)a_Tag].m_NameStart, (size_t)m_Tags[(size_t)a_Tag].m_NameLength);
+ res.assign(m_Data + m_Tags[static_cast<size_t>(a_Tag)].m_NameStart, static_cast<size_t>(m_Tags[static_cast<size_t>(a_Tag)].m_NameLength));
return res;
}
@@ -333,8 +333,8 @@ protected:
if (IsStackTopCompound())
{
// Compound: add the type and name:
- m_Result.push_back((char)a_Type);
- WriteString(a_Name.c_str(), (UInt16)a_Name.length());
+ m_Result.push_back(static_cast<char>(a_Type));
+ WriteString(a_Name.c_str(), static_cast<UInt16>(a_Name.length()));
}
else
{
diff --git a/src/WorldStorage/FireworksSerializer.cpp b/src/WorldStorage/FireworksSerializer.cpp
index 91a5b8b63..0398f4da8 100644
--- a/src/WorldStorage/FireworksSerializer.cpp
+++ b/src/WorldStorage/FireworksSerializer.cpp
@@ -14,7 +14,7 @@ void cFireworkItem::WriteToNBTCompound(const cFireworkItem & a_FireworkItem, cFa
case E_ITEM_FIREWORK_ROCKET:
{
a_Writer.BeginCompound("Fireworks");
- a_Writer.AddByte("Flight", a_FireworkItem.m_FlightTimeInTicks / 20);
+ a_Writer.AddByte("Flight", static_cast<Byte>(a_FireworkItem.m_FlightTimeInTicks / 20));
a_Writer.BeginList("Explosions", TAG_Compound);
a_Writer.BeginCompound("");
a_Writer.AddByte("Flicker", a_FireworkItem.m_HasFlicker);
diff --git a/src/WorldStorage/MapSerializer.cpp b/src/WorldStorage/MapSerializer.cpp
index da7b9d929..d4925dcab 100644
--- a/src/WorldStorage/MapSerializer.cpp
+++ b/src/WorldStorage/MapSerializer.cpp
@@ -102,11 +102,11 @@ void cMapSerializer::SaveMapToNBT(cFastNBTWriter & a_Writer)
{
a_Writer.BeginCompound("data");
- a_Writer.AddByte("scale", m_Map->GetScale());
- a_Writer.AddByte("dimension", (int) m_Map->GetDimension());
+ a_Writer.AddByte("scale", static_cast<Byte>(m_Map->GetScale()));
+ a_Writer.AddByte("dimension", static_cast<Byte>(m_Map->GetDimension()));
- a_Writer.AddShort("width", m_Map->GetWidth());
- a_Writer.AddShort("height", m_Map->GetHeight());
+ a_Writer.AddShort("width", static_cast<Int16>(m_Map->GetWidth()));
+ a_Writer.AddShort("height", static_cast<Int16>(m_Map->GetHeight()));
a_Writer.AddInt("xCenter", m_Map->GetCenterX());
a_Writer.AddInt("zCenter", m_Map->GetCenterZ());
@@ -235,7 +235,7 @@ bool cIDCountSerializer::Load(void)
int CurrLine = NBT.FindChildByName(0, "map");
if (CurrLine >= 0)
{
- m_MapCount = (int)NBT.GetShort(CurrLine) + 1;
+ m_MapCount = static_cast<unsigned int>(NBT.GetShort(CurrLine) + 1);
}
else
{
@@ -255,7 +255,7 @@ bool cIDCountSerializer::Save(void)
if (m_MapCount > 0)
{
- Writer.AddShort("map", m_MapCount - 1);
+ Writer.AddShort("map", static_cast<Int16>(m_MapCount - 1));
}
Writer.Finish();
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 10231ae3b..234c60d62 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -554,6 +554,7 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
m_Writer.AddInt ("Style", Horse.GetHorseStyle());
m_Writer.AddInt ("ArmorType", Horse.GetHorseArmour());
m_Writer.AddByte("Saddle", Horse.IsSaddled());
+ m_Writer.AddByte("Age", Horse.GetAge());
break;
}
case mtMagmaCube:
@@ -565,6 +566,7 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
{
m_Writer.AddByte("Sheared", ((const cSheep *)a_Monster)->IsSheared());
m_Writer.AddByte("Color", ((const cSheep *)a_Monster)->GetFurColor());
+ m_Writer.AddByte("Age", ((const cSheep *)a_Monster)->GetAge());
break;
}
case mtSlime:
@@ -580,6 +582,7 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
case mtVillager:
{
m_Writer.AddInt("Profession", ((const cVillager *)a_Monster)->GetVilType());
+ m_Writer.AddByte("Age", ((const cVillager *)a_Monster)->GetAge());
break;
}
case mtWither:
@@ -601,13 +604,37 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
m_Writer.AddByte("Sitting", Wolf.IsSitting() ? 1 : 0);
m_Writer.AddByte("Angry", Wolf.IsAngry() ? 1 : 0);
m_Writer.AddByte("CollarColor", (unsigned char)Wolf.GetCollarColor());
+ m_Writer.AddByte("Age", Wolf.GetAge());
break;
}
case mtZombie:
{
m_Writer.AddByte("IsVillager", (((const cZombie *)a_Monster)->IsVillagerZombie() ? 1 : 0));
- m_Writer.AddByte("IsBaby", (((const cZombie *)a_Monster)->IsBaby() ? 1 : 0));
m_Writer.AddByte("IsConverting", (((const cZombie *)a_Monster)->IsConverting() ? 1 : 0));
+ m_Writer.AddByte("Age", (((const cZombie *)a_Monster)->GetAge()));
+ break;
+ }
+ case mtZombiePigman:
+ {
+ m_Writer.AddByte("Age", (((const cZombiePigman *)a_Monster)->GetAge()));
+ break;
+ }
+ case mtOcelot:
+ {
+ const cOcelot & Ocelot = *((cOcelot *)a_Monster);
+ m_Writer.AddByte("Age", Ocelot.GetAge());
+ break;
+ }
+ case mtPig:
+ {
+ const cPig & Pig = *((cPig *)a_Monster);
+ m_Writer.AddByte("Age", Pig.GetAge());
+ break;
+ }
+ case mtRabbit:
+ {
+ const cRabbit & Rabbit = *((cRabbit *)a_Monster);
+ m_Writer.AddByte("Age", Rabbit.GetAge());
break;
}
case mtInvalidType:
@@ -621,15 +648,11 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
case mtGuardian:
case mtIronGolem:
case mtMooshroom:
- case mtOcelot:
- case mtPig:
- case mtRabbit:
case mtSilverfish:
case mtSnowGolem:
case mtSpider:
case mtSquid:
case mtWitch:
- case mtZombiePigman:
{
// Other mobs have no special tags.
break;
diff --git a/src/WorldStorage/SchematicFileSerializer.cpp b/src/WorldStorage/SchematicFileSerializer.cpp
index fb881e290..3e9ed5bef 100644
--- a/src/WorldStorage/SchematicFileSerializer.cpp
+++ b/src/WorldStorage/SchematicFileSerializer.cpp
@@ -9,6 +9,7 @@
#include "FastNBT.h"
#include "SchematicFileSerializer.h"
#include "../StringCompression.h"
+#include "../SelfTests.h"
@@ -21,6 +22,11 @@ static class cSchematicStringSelfTest
public:
cSchematicStringSelfTest(void)
{
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&Test), "Schematic-to-string serialization");
+ }
+
+ static void Test(void)
+ {
cBlockArea ba;
ba.Create(21, 256, 21);
ba.RelLine(0, 0, 0, 9, 8, 7, cBlockArea::baTypes | cBlockArea::baMetas, E_BLOCK_WOODEN_STAIRS, 1);
@@ -232,27 +238,27 @@ bool cSchematicFileSerializer::LoadFromSchematicNBT(cBlockArea & a_BlockArea, cP
}
// Copy the block types and metas:
- size_t NumBytes = a_BlockArea.GetBlockCount();
- if (a_NBT.GetDataLength(TBlockTypes) < NumBytes)
+ size_t NumTypeBytes = a_BlockArea.GetBlockCount();
+ if (a_NBT.GetDataLength(TBlockTypes) < NumTypeBytes)
{
- LOG("BlockTypes truncated in the schematic file (exp %d, got %d bytes). Loading partial.",
- (int)NumBytes, (int)a_NBT.GetDataLength(TBlockTypes)
+ LOG("BlockTypes truncated in the schematic file (exp %u, got %u bytes). Loading partial.",
+ static_cast<unsigned>(NumTypeBytes), static_cast<unsigned>(a_NBT.GetDataLength(TBlockTypes))
);
- NumBytes = a_NBT.GetDataLength(TBlockTypes);
+ NumTypeBytes = a_NBT.GetDataLength(TBlockTypes);
}
- memcpy(a_BlockArea.m_BlockTypes, a_NBT.GetData(TBlockTypes), NumBytes);
+ memcpy(a_BlockArea.m_BlockTypes, a_NBT.GetData(TBlockTypes), NumTypeBytes);
if (AreMetasPresent)
{
- size_t NumBytes = a_BlockArea.GetBlockCount();
- if (a_NBT.GetDataLength(TBlockMetas) < NumBytes)
+ size_t NumMetaBytes = a_BlockArea.GetBlockCount();
+ if (a_NBT.GetDataLength(TBlockMetas) < NumMetaBytes)
{
- LOG("BlockMetas truncated in the schematic file (exp %d, got %d bytes). Loading partial.",
- (int)NumBytes, (int)a_NBT.GetDataLength(TBlockMetas)
+ LOG("BlockMetas truncated in the schematic file (exp %u, got %u bytes). Loading partial.",
+ static_cast<unsigned>(NumMetaBytes), static_cast<unsigned>(a_NBT.GetDataLength(TBlockMetas))
);
- NumBytes = a_NBT.GetDataLength(TBlockMetas);
+ NumMetaBytes = a_NBT.GetDataLength(TBlockMetas);
}
- memcpy(a_BlockArea.m_BlockMetas, a_NBT.GetData(TBlockMetas), NumBytes);
+ memcpy(a_BlockArea.m_BlockMetas, a_NBT.GetData(TBlockMetas), NumMetaBytes);
}
return true;
diff --git a/src/WorldStorage/StatSerializer.cpp b/src/WorldStorage/StatSerializer.cpp
index 99a702c39..29f9b3cd6 100644
--- a/src/WorldStorage/StatSerializer.cpp
+++ b/src/WorldStorage/StatSerializer.cpp
@@ -79,13 +79,13 @@ bool cStatSerializer::Save(void)
void cStatSerializer::SaveStatToJSON(Json::Value & a_Out)
{
- for (unsigned int i = 0; i < (unsigned int)statCount; ++i)
+ for (unsigned int i = 0; i < static_cast<unsigned int>(statCount); ++i)
{
- StatValue Value = m_Manager->GetValue((eStatistic) i);
+ StatValue Value = m_Manager->GetValue(static_cast<eStatistic>(i));
if (Value != 0)
{
- const AString & StatName = cStatInfo::GetName((eStatistic) i);
+ const AString & StatName = cStatInfo::GetName(static_cast<eStatistic>(i));
a_Out[StatName] = Value;
}
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 392b9bf83..62918f44e 100755
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -130,7 +130,7 @@ cWSSAnvil::cWSSAnvil(cWorld * a_World, int a_CompressionFactor) :
gzFile gz = gzopen((FILE_IO_PREFIX + fnam).c_str(), "wb");
if (gz != nullptr)
{
- gzwrite(gz, Writer.GetResult().data(), (unsigned)Writer.GetResult().size());
+ gzwrite(gz, Writer.GetResult().data(), static_cast<unsigned>(Writer.GetResult().size()));
}
gzclose(gz);
}
@@ -497,7 +497,7 @@ bool cWSSAnvil::SaveChunkToNBT(const cChunkCoords & a_Chunk, cFastNBTWriter & a_
a_Writer.AddByteArray("Data", BlockMetas + Y * SliceSizeNibble, SliceSizeNibble);
a_Writer.AddByteArray("SkyLight", BlockSkyLight + Y * SliceSizeNibble, SliceSizeNibble);
a_Writer.AddByteArray("BlockLight", BlockLight + Y * SliceSizeNibble, SliceSizeNibble);
- a_Writer.AddByte("Y", (unsigned char)Y);
+ a_Writer.AddByte("Y", static_cast<unsigned char>(Y));
a_Writer.EndCompound();
}
a_Writer.EndList(); // "Sections"
@@ -859,7 +859,7 @@ cBlockEntity * cWSSAnvil::LoadBeaconFromNBT(const cParsedNBT & a_NBT, int a_TagI
return nullptr;
}
- std::unique_ptr<cBeaconEntity> Beacon(new cBeaconEntity(a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cBeaconEntity> Beacon = cpp14::make_unique<cBeaconEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
int CurrentLine = a_NBT.FindChildByName(a_TagIdx, "Levels");
if (CurrentLine >= 0)
@@ -909,7 +909,7 @@ cBlockEntity * cWSSAnvil::LoadChestFromNBT(const cParsedNBT & a_NBT, int a_TagId
{
return nullptr; // Make it an empty chest - the chunk loader will provide an empty cChestEntity for this
}
- std::unique_ptr<cChestEntity> Chest(new cChestEntity(a_BlockX, a_BlockY, a_BlockZ, m_World, a_ChestBlockType));
+ std::unique_ptr<cChestEntity> Chest = cpp14::make_unique<cChestEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World, a_ChestBlockType);
LoadItemGridFromNBT(Chest->GetContents(), a_NBT, Items);
return Chest.release();
}
@@ -926,7 +926,7 @@ cBlockEntity * cWSSAnvil::LoadCommandBlockFromNBT(const cParsedNBT & a_NBT, int
return nullptr;
}
- std::unique_ptr<cCommandBlockEntity> CmdBlock(new cCommandBlockEntity(a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cCommandBlockEntity> CmdBlock = cpp14::make_unique<cCommandBlockEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
int currentLine = a_NBT.FindChildByName(a_TagIdx, "Command");
if (currentLine >= 0)
@@ -968,7 +968,7 @@ cBlockEntity * cWSSAnvil::LoadDispenserFromNBT(const cParsedNBT & a_NBT, int a_T
{
return nullptr; // Make it an empty dispenser - the chunk loader will provide an empty cDispenserEntity for this
}
- std::unique_ptr<cDispenserEntity> Dispenser(new cDispenserEntity(a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cDispenserEntity> Dispenser = cpp14::make_unique<cDispenserEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
LoadItemGridFromNBT(Dispenser->GetContents(), a_NBT, Items);
return Dispenser.release();
}
@@ -990,7 +990,7 @@ cBlockEntity * cWSSAnvil::LoadDropperFromNBT(const cParsedNBT & a_NBT, int a_Tag
{
return nullptr; // Make it an empty dropper - the chunk loader will provide an empty cDropperEntity for this
}
- std::unique_ptr<cDropperEntity> Dropper(new cDropperEntity(a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cDropperEntity> Dropper = cpp14::make_unique<cDropperEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
LoadItemGridFromNBT(Dropper->GetContents(), a_NBT, Items);
return Dropper.release();
}
@@ -1007,7 +1007,7 @@ cBlockEntity * cWSSAnvil::LoadFlowerPotFromNBT(const cParsedNBT & a_NBT, int a_T
return nullptr;
}
- std::unique_ptr<cFlowerPotEntity> FlowerPot(new cFlowerPotEntity(a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cFlowerPotEntity> FlowerPot = cpp14::make_unique<cFlowerPotEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
cItem Item;
int currentLine = a_NBT.FindChildByName(a_TagIdx, "Item");
@@ -1051,8 +1051,9 @@ cBlockEntity * cWSSAnvil::LoadFurnaceFromNBT(const cParsedNBT & a_NBT, int a_Tag
return nullptr; // Make it an empty furnace - the chunk loader will provide an empty cFurnaceEntity for this
}
- std::unique_ptr<cFurnaceEntity> Furnace(new cFurnaceEntity(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, m_World));
-
+ std::unique_ptr<cFurnaceEntity> Furnace = cpp14::make_unique<cFurnaceEntity>(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, m_World);
+ Furnace->SetLoading(true);
+
// Load slots:
for (int Child = a_NBT.GetFirstChild(Items); Child != -1; Child = a_NBT.GetNextSibling(Child))
{
@@ -1085,9 +1086,9 @@ cBlockEntity * cWSSAnvil::LoadFurnaceFromNBT(const cParsedNBT & a_NBT, int a_Tag
// Anvil doesn't store the time that an item takes to cook. We simply use the default - 10 seconds (200 ticks)
Furnace->SetCookTimes(200, ct);
}
-
// Restart cooking:
Furnace->ContinueCooking();
+ Furnace->SetLoading(false);
return Furnace.release();
}
@@ -1103,7 +1104,7 @@ cBlockEntity * cWSSAnvil::LoadMobSpawnerFromNBT(const cParsedNBT & a_NBT, int a_
return nullptr;
}
- std::unique_ptr<cMobSpawnerEntity> MobSpawner(new cMobSpawnerEntity(a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cMobSpawnerEntity> MobSpawner = cpp14::make_unique<cMobSpawnerEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
// Load entity (MCServer worlds):
int Type = a_NBT.FindChildByName(a_TagIdx, "Entity");
@@ -1156,7 +1157,7 @@ cBlockEntity * cWSSAnvil::LoadHopperFromNBT(const cParsedNBT & a_NBT, int a_TagI
{
return nullptr; // Make it an empty hopper - the chunk loader will provide an empty cHopperEntity for this
}
- std::unique_ptr<cHopperEntity> Hopper(new cHopperEntity(a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cHopperEntity> Hopper = cpp14::make_unique<cHopperEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
LoadItemGridFromNBT(Hopper->GetContents(), a_NBT, Items);
return Hopper.release();
}
@@ -1173,7 +1174,7 @@ cBlockEntity * cWSSAnvil::LoadJukeboxFromNBT(const cParsedNBT & a_NBT, int a_Tag
return nullptr;
}
- std::unique_ptr<cJukeboxEntity> Jukebox(new cJukeboxEntity(a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cJukeboxEntity> Jukebox = cpp14::make_unique<cJukeboxEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
int Record = a_NBT.FindChildByName(a_TagIdx, "Record");
if (Record >= 0)
{
@@ -1194,7 +1195,7 @@ cBlockEntity * cWSSAnvil::LoadMobHeadFromNBT(const cParsedNBT & a_NBT, int a_Tag
return nullptr;
}
- std::unique_ptr<cMobHeadEntity> MobHead(new cMobHeadEntity(a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cMobHeadEntity> MobHead = cpp14::make_unique<cMobHeadEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
int currentLine = a_NBT.FindChildByName(a_TagIdx, "SkullType");
if (currentLine >= 0)
@@ -1229,7 +1230,7 @@ cBlockEntity * cWSSAnvil::LoadNoteBlockFromNBT(const cParsedNBT & a_NBT, int a_T
return nullptr;
}
- std::unique_ptr<cNoteEntity> NoteBlock(new cNoteEntity(a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cNoteEntity> NoteBlock = cpp14::make_unique<cNoteEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
int note = a_NBT.FindChildByName(a_TagIdx, "note");
if (note >= 0)
{
@@ -1250,7 +1251,7 @@ cBlockEntity * cWSSAnvil::LoadSignFromNBT(const cParsedNBT & a_NBT, int a_TagIdx
return nullptr;
}
- std::unique_ptr<cSignEntity> Sign(new cSignEntity(a_BlockType, a_BlockX, a_BlockY, a_BlockZ, m_World));
+ std::unique_ptr<cSignEntity> Sign = cpp14::make_unique<cSignEntity>(a_BlockType, a_BlockX, a_BlockY, a_BlockZ, m_World);
int currentLine = a_NBT.FindChildByName(a_TagIdx, "Text1");
if (currentLine >= 0)
@@ -1515,7 +1516,7 @@ void cWSSAnvil::LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a
void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cBoat> Boat(new cBoat(0, 0, 0));
+ std::unique_ptr<cBoat> Boat = cpp14::make_unique<cBoat>(0, 0, 0);
if (!LoadEntityBaseFromNBT(*Boat.get(), a_NBT, a_TagIdx))
{
return;
@@ -1529,7 +1530,7 @@ void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N
void cWSSAnvil::LoadEnderCrystalFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cEnderCrystal> EnderCrystal(new cEnderCrystal(0, 0, 0));
+ std::unique_ptr<cEnderCrystal> EnderCrystal = cpp14::make_unique<cEnderCrystal>(0, 0, 0);
if (!LoadEntityBaseFromNBT(*EnderCrystal.get(), a_NBT, a_TagIdx))
{
return;
@@ -1554,7 +1555,7 @@ void cWSSAnvil::LoadFallingBlockFromNBT(cEntityList & a_Entities, const cParsedN
int Type = a_NBT.GetInt(TypeIdx);
NIBBLETYPE Meta = (NIBBLETYPE)a_NBT.GetByte(MetaIdx);
- std::unique_ptr<cFallingBlock> FallingBlock(new cFallingBlock(Vector3i(0, 0, 0), Type, Meta));
+ std::unique_ptr<cFallingBlock> FallingBlock = cpp14::make_unique<cFallingBlock>(Vector3i(0, 0, 0), Type, Meta);
if (!LoadEntityBaseFromNBT(*FallingBlock.get(), a_NBT, a_TagIdx))
{
return;
@@ -1568,7 +1569,7 @@ void cWSSAnvil::LoadFallingBlockFromNBT(cEntityList & a_Entities, const cParsedN
void cWSSAnvil::LoadMinecartRFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cRideableMinecart> Minecart(new cRideableMinecart(0, 0, 0, cItem(), 1)); // TODO: Load the block and the height
+ std::unique_ptr<cRideableMinecart> Minecart = cpp14::make_unique<cRideableMinecart>(0, 0, 0, cItem(), 1); // TODO: Load the block and the height
if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
{
return;
@@ -1587,7 +1588,7 @@ void cWSSAnvil::LoadMinecartCFromNBT(cEntityList & a_Entities, const cParsedNBT
{
return; // Make it an empty chest - the chunk loader will provide an empty cChestEntity for this
}
- std::unique_ptr<cMinecartWithChest> Minecart(new cMinecartWithChest(0, 0, 0));
+ std::unique_ptr<cMinecartWithChest> Minecart = cpp14::make_unique<cMinecartWithChest>(0, 0, 0);
if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
{
return;
@@ -1614,7 +1615,7 @@ void cWSSAnvil::LoadMinecartCFromNBT(cEntityList & a_Entities, const cParsedNBT
void cWSSAnvil::LoadMinecartFFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cMinecartWithFurnace> Minecart(new cMinecartWithFurnace(0, 0, 0));
+ std::unique_ptr<cMinecartWithFurnace> Minecart = cpp14::make_unique<cMinecartWithFurnace>(0, 0, 0);
if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
{
return;
@@ -1631,7 +1632,7 @@ void cWSSAnvil::LoadMinecartFFromNBT(cEntityList & a_Entities, const cParsedNBT
void cWSSAnvil::LoadMinecartTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cMinecartWithTNT> Minecart(new cMinecartWithTNT(0, 0, 0));
+ std::unique_ptr<cMinecartWithTNT> Minecart = cpp14::make_unique<cMinecartWithTNT>(0, 0, 0);
if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
{
return;
@@ -1648,7 +1649,7 @@ void cWSSAnvil::LoadMinecartTFromNBT(cEntityList & a_Entities, const cParsedNBT
void cWSSAnvil::LoadMinecartHFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cMinecartWithHopper> Minecart(new cMinecartWithHopper(0, 0, 0));
+ std::unique_ptr<cMinecartWithHopper> Minecart = cpp14::make_unique<cMinecartWithHopper>(0, 0, 0);
if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
{
return;
@@ -1677,7 +1678,7 @@ void cWSSAnvil::LoadPickupFromNBT(cEntityList & a_Entities, const cParsedNBT & a
return;
}
- std::unique_ptr<cPickup> Pickup(new cPickup(0, 0, 0, Item, false)); // Pickup delay doesn't matter, just say false
+ std::unique_ptr<cPickup> Pickup = cpp14::make_unique<cPickup>(0, 0, 0, Item, false); // Pickup delay doesn't matter, just say false
if (!LoadEntityBaseFromNBT(*Pickup.get(), a_NBT, a_TagIdx))
{
return;
@@ -1699,7 +1700,7 @@ void cWSSAnvil::LoadPickupFromNBT(cEntityList & a_Entities, const cParsedNBT & a
void cWSSAnvil::LoadTNTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cTNTEntity> TNT(new cTNTEntity(0.0, 0.0, 0.0, 0));
+ std::unique_ptr<cTNTEntity> TNT = cpp14::make_unique<cTNTEntity>(0.0, 0.0, 0.0, 0);
if (!LoadEntityBaseFromNBT(*TNT.get(), a_NBT, a_TagIdx))
{
return;
@@ -1721,7 +1722,7 @@ void cWSSAnvil::LoadTNTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB
void cWSSAnvil::LoadExpOrbFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cExpOrb> ExpOrb(new cExpOrb(0.0, 0.0, 0.0, 0));
+ std::unique_ptr<cExpOrb> ExpOrb = cpp14::make_unique<cExpOrb>(0.0, 0.0, 0.0, 0);
if (!LoadEntityBaseFromNBT(*ExpOrb.get(), a_NBT, a_TagIdx))
{
return;
@@ -1790,7 +1791,7 @@ void cWSSAnvil::LoadItemFrameFromNBT(cEntityList & a_Entities, const cParsedNBT
return;
}
- std::unique_ptr<cItemFrame> ItemFrame(new cItemFrame(BLOCK_FACE_NONE, 0.0, 0.0, 0.0));
+ std::unique_ptr<cItemFrame> ItemFrame = cpp14::make_unique<cItemFrame>(BLOCK_FACE_NONE, 0.0, 0.0, 0.0);
if (!LoadEntityBaseFromNBT(*ItemFrame.get(), a_NBT, a_TagIdx))
{
return;
@@ -1822,7 +1823,7 @@ void cWSSAnvil::LoadPaintingFromNBT(cEntityList & a_Entities, const cParsedNBT &
return;
}
- std::unique_ptr<cPainting> Painting(new cPainting(a_NBT.GetString(MotiveTag), BLOCK_FACE_NONE, 0.0, 0.0, 0.0));
+ std::unique_ptr<cPainting> Painting = cpp14::make_unique<cPainting>(a_NBT.GetString(MotiveTag), BLOCK_FACE_NONE, 0.0, 0.0, 0.0);
if (!LoadEntityBaseFromNBT(*Painting.get(), a_NBT, a_TagIdx))
{
return;
@@ -1838,7 +1839,7 @@ void cWSSAnvil::LoadPaintingFromNBT(cEntityList & a_Entities, const cParsedNBT &
void cWSSAnvil::LoadArrowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cArrowEntity> Arrow(new cArrowEntity(nullptr, 0, 0, 0, Vector3d(0, 0, 0)));
+ std::unique_ptr<cArrowEntity> Arrow = cpp14::make_unique<cArrowEntity>(nullptr, 0, 0, 0, Vector3d(0, 0, 0));
if (!LoadProjectileBaseFromNBT(*Arrow.get(), a_NBT, a_TagIdx))
{
return;
@@ -1908,7 +1909,7 @@ void cWSSAnvil::LoadArrowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
void cWSSAnvil::LoadSplashPotionFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cSplashPotionEntity> SplashPotion(new cSplashPotionEntity(nullptr, 0, 0, 0, Vector3d(0, 0, 0), cItem()));
+ std::unique_ptr<cSplashPotionEntity> SplashPotion = cpp14::make_unique<cSplashPotionEntity>(nullptr, 0, 0, 0, Vector3d(0, 0, 0), cItem());
if (!LoadProjectileBaseFromNBT(*SplashPotion.get(), a_NBT, a_TagIdx))
{
return;
@@ -1932,7 +1933,7 @@ void cWSSAnvil::LoadSplashPotionFromNBT(cEntityList & a_Entities, const cParsedN
void cWSSAnvil::LoadSnowballFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cThrownSnowballEntity> Snowball(new cThrownSnowballEntity(nullptr, 0, 0, 0, Vector3d(0, 0, 0)));
+ std::unique_ptr<cThrownSnowballEntity> Snowball = cpp14::make_unique<cThrownSnowballEntity>(nullptr, 0, 0, 0, Vector3d(0, 0, 0));
if (!LoadProjectileBaseFromNBT(*Snowball.get(), a_NBT, a_TagIdx))
{
return;
@@ -1948,7 +1949,7 @@ void cWSSAnvil::LoadSnowballFromNBT(cEntityList & a_Entities, const cParsedNBT &
void cWSSAnvil::LoadEggFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cThrownEggEntity> Egg(new cThrownEggEntity(nullptr, 0, 0, 0, Vector3d(0, 0, 0)));
+ std::unique_ptr<cThrownEggEntity> Egg = cpp14::make_unique<cThrownEggEntity>(nullptr, 0, 0, 0, Vector3d(0, 0, 0));
if (!LoadProjectileBaseFromNBT(*Egg.get(), a_NBT, a_TagIdx))
{
return;
@@ -1964,7 +1965,7 @@ void cWSSAnvil::LoadEggFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB
void cWSSAnvil::LoadFireballFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cGhastFireballEntity> Fireball(new cGhastFireballEntity(nullptr, 0, 0, 0, Vector3d(0, 0, 0)));
+ std::unique_ptr<cGhastFireballEntity> Fireball = cpp14::make_unique<cGhastFireballEntity>(nullptr, 0, 0, 0, Vector3d(0, 0, 0));
if (!LoadProjectileBaseFromNBT(*Fireball.get(), a_NBT, a_TagIdx))
{
return;
@@ -1980,7 +1981,7 @@ void cWSSAnvil::LoadFireballFromNBT(cEntityList & a_Entities, const cParsedNBT &
void cWSSAnvil::LoadFireChargeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cFireChargeEntity> FireCharge(new cFireChargeEntity(nullptr, 0, 0, 0, Vector3d(0, 0, 0)));
+ std::unique_ptr<cFireChargeEntity> FireCharge = cpp14::make_unique<cFireChargeEntity>(nullptr, 0, 0, 0, Vector3d(0, 0, 0));
if (!LoadProjectileBaseFromNBT(*FireCharge.get(), a_NBT, a_TagIdx))
{
return;
@@ -1996,7 +1997,7 @@ void cWSSAnvil::LoadFireChargeFromNBT(cEntityList & a_Entities, const cParsedNBT
void cWSSAnvil::LoadThrownEnderpearlFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cThrownEnderPearlEntity> Enderpearl(new cThrownEnderPearlEntity(nullptr, 0, 0, 0, Vector3d(0, 0, 0)));
+ std::unique_ptr<cThrownEnderPearlEntity> Enderpearl = cpp14::make_unique<cThrownEnderPearlEntity>(nullptr, 0, 0, 0, Vector3d(0, 0, 0));
if (!LoadProjectileBaseFromNBT(*Enderpearl.get(), a_NBT, a_TagIdx))
{
return;
@@ -2012,7 +2013,7 @@ void cWSSAnvil::LoadThrownEnderpearlFromNBT(cEntityList & a_Entities, const cPar
void cWSSAnvil::LoadBatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cBat> Monster(new cBat());
+ std::unique_ptr<cBat> Monster = cpp14::make_unique<cBat>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2032,7 +2033,7 @@ void cWSSAnvil::LoadBatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB
void cWSSAnvil::LoadBlazeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cBlaze> Monster(new cBlaze());
+ std::unique_ptr<cBlaze> Monster = cpp14::make_unique<cBlaze>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2052,7 +2053,7 @@ void cWSSAnvil::LoadBlazeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
void cWSSAnvil::LoadCaveSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cCaveSpider> Monster(new cCaveSpider());
+ std::unique_ptr<cCaveSpider> Monster = cpp14::make_unique<cCaveSpider>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2072,7 +2073,7 @@ void cWSSAnvil::LoadCaveSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT
void cWSSAnvil::LoadChickenFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cChicken> Monster(new cChicken());
+ std::unique_ptr<cChicken> Monster = cpp14::make_unique<cChicken>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2092,7 +2093,7 @@ void cWSSAnvil::LoadChickenFromNBT(cEntityList & a_Entities, const cParsedNBT &
void cWSSAnvil::LoadCowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cCow> Monster(new cCow());
+ std::unique_ptr<cCow> Monster = cpp14::make_unique<cCow>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2112,7 +2113,7 @@ void cWSSAnvil::LoadCowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB
void cWSSAnvil::LoadCreeperFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cCreeper> Monster(new cCreeper());
+ std::unique_ptr<cCreeper> Monster = cpp14::make_unique<cCreeper>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2132,7 +2133,7 @@ void cWSSAnvil::LoadCreeperFromNBT(cEntityList & a_Entities, const cParsedNBT &
void cWSSAnvil::LoadEnderDragonFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cEnderDragon> Monster(new cEnderDragon());
+ std::unique_ptr<cEnderDragon> Monster = cpp14::make_unique<cEnderDragon>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2152,7 +2153,7 @@ void cWSSAnvil::LoadEnderDragonFromNBT(cEntityList & a_Entities, const cParsedNB
void cWSSAnvil::LoadEndermanFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cEnderman> Monster(new cEnderman());
+ std::unique_ptr<cEnderman> Monster = cpp14::make_unique<cEnderman>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2172,7 +2173,7 @@ void cWSSAnvil::LoadEndermanFromNBT(cEntityList & a_Entities, const cParsedNBT &
void cWSSAnvil::LoadGhastFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cGhast> Monster(new cGhast());
+ std::unique_ptr<cGhast> Monster = cpp14::make_unique<cGhast>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2192,7 +2193,7 @@ void cWSSAnvil::LoadGhastFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
void cWSSAnvil::LoadGiantFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cGiant> Monster(new cGiant());
+ std::unique_ptr<cGiant> Monster = cpp14::make_unique<cGiant>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2212,7 +2213,7 @@ void cWSSAnvil::LoadGiantFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
void cWSSAnvil::LoadGuardianFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cGuardian> Monster(new cGuardian());
+ std::unique_ptr<cGuardian> Monster = cpp14::make_unique<cGuardian>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2244,7 +2245,7 @@ void cWSSAnvil::LoadHorseFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
int Color = a_NBT.GetInt(ColorIdx);
int Style = a_NBT.GetInt(StyleIdx);
- std::unique_ptr<cHorse> Monster(new cHorse(Type, Color, Style, 1));
+ std::unique_ptr<cHorse> Monster = cpp14::make_unique<cHorse>(Type, Color, Style, 1);
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
@@ -2255,7 +2256,14 @@ void cWSSAnvil::LoadHorseFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
{
return;
}
-
+
+ int AgeableIdx = a_NBT.FindChildByName(a_TagIdx, "Age");
+ if (AgeableIdx > 0)
+ {
+ Byte Age = a_NBT.GetByte(AgeableIdx);
+ Monster->SetAge(Age);
+ }
+
a_Entities.push_back(Monster.release());
}
@@ -2265,7 +2273,7 @@ void cWSSAnvil::LoadHorseFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
void cWSSAnvil::LoadIronGolemFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cIronGolem> Monster(new cIronGolem());
+ std::unique_ptr<cIronGolem> Monster = cpp14::make_unique<cIronGolem>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2294,7 +2302,7 @@ void cWSSAnvil::LoadMagmaCubeFromNBT(cEntityList & a_Entities, const cParsedNBT
int Size = a_NBT.GetInt(SizeIdx);
- std::unique_ptr<cMagmaCube> Monster(new cMagmaCube(Size));
+ std::unique_ptr<cMagmaCube> Monster = cpp14::make_unique<cMagmaCube>(Size);
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2314,7 +2322,7 @@ void cWSSAnvil::LoadMagmaCubeFromNBT(cEntityList & a_Entities, const cParsedNBT
void cWSSAnvil::LoadMooshroomFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cMooshroom> Monster(new cMooshroom());
+ std::unique_ptr<cMooshroom> Monster = cpp14::make_unique<cMooshroom>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2334,7 +2342,7 @@ void cWSSAnvil::LoadMooshroomFromNBT(cEntityList & a_Entities, const cParsedNBT
void cWSSAnvil::LoadOcelotFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cOcelot> Monster(new cOcelot());
+ std::unique_ptr<cOcelot> Monster = cpp14::make_unique<cOcelot>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2345,6 +2353,13 @@ void cWSSAnvil::LoadOcelotFromNBT(cEntityList & a_Entities, const cParsedNBT & a
return;
}
+ int AgeableIdx = a_NBT.FindChildByName(a_TagIdx, "Age");
+ if (AgeableIdx > 0)
+ {
+ Byte Age = a_NBT.GetByte(AgeableIdx);
+ Monster->SetAge(Age);
+ }
+
a_Entities.push_back(Monster.release());
}
@@ -2354,7 +2369,7 @@ void cWSSAnvil::LoadOcelotFromNBT(cEntityList & a_Entities, const cParsedNBT & a
void cWSSAnvil::LoadPigFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cPig> Monster(new cPig());
+ std::unique_ptr<cPig> Monster = cpp14::make_unique<cPig>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2364,7 +2379,14 @@ void cWSSAnvil::LoadPigFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB
{
return;
}
-
+
+ int AgeableIdx = a_NBT.FindChildByName(a_TagIdx, "Age");
+ if (AgeableIdx > 0)
+ {
+ Byte Age = a_NBT.GetByte(AgeableIdx);
+ Monster->SetAge(Age);
+ }
+
a_Entities.push_back(Monster.release());
}
@@ -2374,7 +2396,7 @@ void cWSSAnvil::LoadPigFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB
void cWSSAnvil::LoadRabbitFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cRabbit> Monster(new cRabbit());
+ std::unique_ptr<cRabbit> Monster = cpp14::make_unique<cRabbit>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2384,7 +2406,14 @@ void cWSSAnvil::LoadRabbitFromNBT(cEntityList & a_Entities, const cParsedNBT & a
{
return;
}
-
+
+ int AgeableIdx = a_NBT.FindChildByName(a_TagIdx, "Age");
+ if (AgeableIdx > 0)
+ {
+ Byte Age = a_NBT.GetByte(AgeableIdx);
+ Monster->SetAge(Age);
+ }
+
a_Entities.push_back(Monster.release());
}
@@ -2401,7 +2430,7 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
Color = (int)a_NBT.GetByte(ColorIdx);
}
- std::unique_ptr<cSheep> Monster(new cSheep(Color));
+ std::unique_ptr<cSheep> Monster = cpp14::make_unique<cSheep>(Color);
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2417,7 +2446,14 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
{
Monster->SetSheared(a_NBT.GetByte(ShearedIdx) != 0);
}
-
+
+ int AgeableIdx = a_NBT.FindChildByName(a_TagIdx, "Age");
+ if (AgeableIdx > 0)
+ {
+ Byte Age = a_NBT.GetByte(AgeableIdx);
+ Monster->SetAge(Age);
+ }
+
a_Entities.push_back(Monster.release());
}
@@ -2427,7 +2463,7 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
void cWSSAnvil::LoadSilverfishFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cSilverfish> Monster(new cSilverfish());
+ std::unique_ptr<cSilverfish> Monster = cpp14::make_unique<cSilverfish>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2455,7 +2491,7 @@ void cWSSAnvil::LoadSkeletonFromNBT(cEntityList & a_Entities, const cParsedNBT &
bool Type = ((a_NBT.GetByte(TypeIdx) == 1) ? true : false);
- std::unique_ptr<cSkeleton> Monster(new cSkeleton(Type));
+ std::unique_ptr<cSkeleton> Monster = cpp14::make_unique<cSkeleton>(Type);
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2484,7 +2520,7 @@ void cWSSAnvil::LoadSlimeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
int Size = a_NBT.GetInt(SizeIdx);
- std::unique_ptr<cSlime> Monster(new cSlime(Size));
+ std::unique_ptr<cSlime> Monster = cpp14::make_unique<cSlime>(Size);
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2504,7 +2540,7 @@ void cWSSAnvil::LoadSlimeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
void cWSSAnvil::LoadSnowGolemFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cSnowGolem> Monster(new cSnowGolem());
+ std::unique_ptr<cSnowGolem> Monster = cpp14::make_unique<cSnowGolem>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2524,7 +2560,7 @@ void cWSSAnvil::LoadSnowGolemFromNBT(cEntityList & a_Entities, const cParsedNBT
void cWSSAnvil::LoadSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cSpider> Monster(new cSpider());
+ std::unique_ptr<cSpider> Monster = cpp14::make_unique<cSpider>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2544,7 +2580,7 @@ void cWSSAnvil::LoadSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT & a
void cWSSAnvil::LoadSquidFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cSquid> Monster(new cSquid());
+ std::unique_ptr<cSquid> Monster = cpp14::make_unique<cSquid>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2572,7 +2608,7 @@ void cWSSAnvil::LoadVillagerFromNBT(cEntityList & a_Entities, const cParsedNBT &
int Type = a_NBT.GetInt(TypeIdx);
- std::unique_ptr<cVillager> Monster(new cVillager(cVillager::eVillagerType(Type)));
+ std::unique_ptr<cVillager> Monster = cpp14::make_unique<cVillager>(cVillager::eVillagerType(Type));
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2582,7 +2618,15 @@ void cWSSAnvil::LoadVillagerFromNBT(cEntityList & a_Entities, const cParsedNBT &
{
return;
}
-
+
+ int AgeableIdx = a_NBT.FindChildByName(a_TagIdx, "Age");
+ if (AgeableIdx > 0)
+ {
+ Byte Age = a_NBT.GetByte(AgeableIdx);
+ Monster->SetAge(Age);
+ }
+
+
a_Entities.push_back(Monster.release());
}
@@ -2592,7 +2636,7 @@ void cWSSAnvil::LoadVillagerFromNBT(cEntityList & a_Entities, const cParsedNBT &
void cWSSAnvil::LoadWitchFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cWitch> Monster(new cWitch());
+ std::unique_ptr<cWitch> Monster = cpp14::make_unique<cWitch>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2612,7 +2656,7 @@ void cWSSAnvil::LoadWitchFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
void cWSSAnvil::LoadWitherFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cWither> Monster(new cWither());
+ std::unique_ptr<cWither> Monster = cpp14::make_unique<cWither>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2638,7 +2682,7 @@ void cWSSAnvil::LoadWitherFromNBT(cEntityList & a_Entities, const cParsedNBT & a
void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cWolf> Monster(new cWolf());
+ std::unique_ptr<cWolf> Monster = cpp14::make_unique<cWolf>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2682,6 +2726,14 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N
}
}
}
+
+ int AgeableIdx = a_NBT.FindChildByName(a_TagIdx, "Age");
+ if (AgeableIdx > 0)
+ {
+ Byte Age = a_NBT.GetByte(AgeableIdx);
+ Monster->SetAge(Age);
+ }
+
a_Entities.push_back(Monster.release());
}
@@ -2699,7 +2751,7 @@ void cWSSAnvil::LoadZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a
bool IsVillagerZombie = ((a_NBT.GetByte(IsVillagerIdx) == 1) ? true : false);
- std::unique_ptr<cZombie> Monster(new cZombie(IsVillagerZombie));
+ std::unique_ptr<cZombie> Monster = cpp14::make_unique<cZombie>(IsVillagerZombie);
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2709,7 +2761,14 @@ void cWSSAnvil::LoadZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a
{
return;
}
-
+
+ int AgeableIdx = a_NBT.FindChildByName(a_TagIdx, "Age");
+ if (AgeableIdx > 0)
+ {
+ Byte Age = a_NBT.GetByte(AgeableIdx);
+ Monster->SetAge(Age);
+ }
+
a_Entities.push_back(Monster.release());
}
@@ -2719,7 +2778,7 @@ void cWSSAnvil::LoadZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a
void cWSSAnvil::LoadPigZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx)
{
- std::unique_ptr<cZombiePigman> Monster(new cZombiePigman());
+ std::unique_ptr<cZombiePigman> Monster = cpp14::make_unique<cZombiePigman>();
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
{
return;
@@ -2729,7 +2788,14 @@ void cWSSAnvil::LoadPigZombieFromNBT(cEntityList & a_Entities, const cParsedNBT
{
return;
}
-
+
+ int AgeableIdx = a_NBT.FindChildByName(a_TagIdx, "Age");
+ if (AgeableIdx > 0)
+ {
+ Byte Age = a_NBT.GetByte(AgeableIdx);
+ Monster->SetAge(Age);
+ }
+
a_Entities.push_back(Monster.release());
}
@@ -3069,7 +3135,7 @@ bool cWSSAnvil::cMCAFile::GetChunkData(const cChunkCoords & a_Chunk, AString & a
LOAD_FAILED(a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ);
return false;
}
- ChunkSize = ntohl((u_long)ChunkSize);
+ ChunkSize = ntohl(static_cast<u_long>(ChunkSize));
char CompressionType = 0;
if (m_File.Read(&CompressionType, 1) != 1)
{
@@ -3121,7 +3187,7 @@ bool cWSSAnvil::cMCAFile::SetChunkData(const cChunkCoords & a_Chunk, const AStri
// Store the chunk data:
m_File.Seek(ChunkSector * 4096);
- u_long ChunkSize = htonl((u_long)a_Data.size() + 1);
+ u_long ChunkSize = htonl(static_cast<u_long>(a_Data.size()) + 1);
if (m_File.Write(&ChunkSize, 4) != 4)
{
LOGWARNING("Cannot save chunk [%d, %d], writing(1) data to file \"%s\" failed", a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, GetFileName().c_str());
@@ -3148,11 +3214,11 @@ bool cWSSAnvil::cMCAFile::SetChunkData(const cChunkCoords & a_Chunk, const AStri
}
// Store the header:
- ChunkSize = ((u_long)a_Data.size() + MCA_CHUNK_HEADER_LENGTH + 4095) / 4096; // Round data size up to nearest 4KB sector, make it a sector number
+ ChunkSize = (static_cast<u_long>(a_Data.size()) + MCA_CHUNK_HEADER_LENGTH + 4095) / 4096; // Round data size up to nearest 4KB sector, make it a sector number
if (ChunkSize > 255)
{
LOGWARNING("Cannot save chunk [%d, %d], the data is too large (%u KiB, maximum is 1024 KiB). Remove some entities and retry.",
- a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, (unsigned)(ChunkSize * 4)
+ a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, static_cast<unsigned>(ChunkSize * 4)
);
return false;
}
diff --git a/src/WorldStorage/WorldStorage.cpp b/src/WorldStorage/WorldStorage.cpp
index c7a295175..7e6cadb7e 100644
--- a/src/WorldStorage/WorldStorage.cpp
+++ b/src/WorldStorage/WorldStorage.cpp
@@ -84,7 +84,7 @@ void cWorldStorage::Stop(void)
void cWorldStorage::WaitForFinish(void)
{
- LOG("Waiting for the world storage to finish saving");
+ LOGD("Waiting for the world storage to finish saving");
{
m_LoadQueue.Clear();
@@ -97,7 +97,7 @@ void cWorldStorage::WaitForFinish(void)
m_ShouldTerminate = true;
m_Event.Set(); // Wake up the thread if waiting
super::Wait();
- LOG("World storage thread finished");
+ LOGD("World storage thread finished");
}
diff --git a/src/main.cpp b/src/main.cpp
index 1c34b8f61..2103f3356 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2,6 +2,7 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Root.h"
+#include "tclap/CmdLine.h"
#include <exception>
#include <csignal>
@@ -14,7 +15,7 @@
#include "OSSupport/NetworkSingleton.h"
#include "BuildInfo.h"
-
+#include "MemorySettingsRepository.h"
@@ -38,7 +39,7 @@ bool cRoot::m_RunAsService = false;
#if defined(_WIN32)
- SERVICE_STATUS_HANDLE g_StatusHandle = NULL;
+ SERVICE_STATUS_HANDLE g_StatusHandle = nullptr;
HANDLE g_ServiceThread = INVALID_HANDLE_VALUE;
#define SERVICE_NAME "MCServerService"
#endif
@@ -144,7 +145,7 @@ Its purpose is to create the crashdump using the dbghlp DLLs
*/
LONG WINAPI LastChanceExceptionFilter(__in struct _EXCEPTION_POINTERS * a_ExceptionInfo)
{
- char * newStack = &g_ExceptionStack[sizeof(g_ExceptionStack)];
+ char * newStack = &g_ExceptionStack[sizeof(g_ExceptionStack) - 1];
char * oldStack;
// Use the substitute stack:
@@ -206,7 +207,7 @@ BOOL CtrlHandler(DWORD fdwCtrlType)
////////////////////////////////////////////////////////////////////////////////
// universalMain - Main startup logic for both standard running and as a service
-void universalMain()
+void universalMain(std::unique_ptr<cSettingsRepositoryInterface> overridesRepo)
{
#ifdef _WIN32
if (!SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE))
@@ -226,7 +227,7 @@ void universalMain()
#endif
{
cRoot Root;
- Root.Start();
+ Root.Start(std::move(overridesRepo));
}
#if !defined(ANDROID_NDK)
catch (std::exception & e)
@@ -248,7 +249,8 @@ void universalMain()
-#if defined(_WIN32)
+
+#if defined(_WIN32) // Windows service support.
////////////////////////////////////////////////////////////////////////////////
// serviceWorkerThread: Keep the service alive
@@ -257,7 +259,7 @@ DWORD WINAPI serviceWorkerThread(LPVOID lpParam)
UNREFERENCED_PARAMETER(lpParam);
// Do the normal startup
- universalMain();
+ universalMain(cpp14::make_unique<cMemorySettingsRepository>());
return ERROR_SUCCESS;
}
@@ -265,6 +267,7 @@ DWORD WINAPI serviceWorkerThread(LPVOID lpParam)
+
////////////////////////////////////////////////////////////////////////////////
// serviceSetState: Set the internal status of the service
@@ -318,14 +321,10 @@ void WINAPI serviceCtrlHandler(DWORD CtrlCode)
void WINAPI serviceMain(DWORD argc, TCHAR *argv[])
{
- #if defined(_DEBUG) && defined(DEBUG_SERVICE_STARTUP)
- Sleep(10000);
- #endif
-
char applicationFilename[MAX_PATH];
char applicationDirectory[MAX_PATH];
- GetModuleFileName(NULL, applicationFilename, sizeof(applicationFilename)); // This binary's file path.
+ GetModuleFileName(nullptr, applicationFilename, sizeof(applicationFilename)); // This binary's file path.
// Strip off the filename, keep only the path:
strncpy_s(applicationDirectory, sizeof(applicationDirectory), applicationFilename, (strrchr(applicationFilename, '\\') - applicationFilename));
@@ -336,8 +335,7 @@ void WINAPI serviceMain(DWORD argc, TCHAR *argv[])
SetCurrentDirectory(applicationDirectory);
g_StatusHandle = RegisterServiceCtrlHandler(SERVICE_NAME, serviceCtrlHandler);
-
- if (g_StatusHandle == NULL)
+ if (g_StatusHandle == nullptr)
{
OutputDebugStringA("RegisterServiceCtrlHandler() failed\n");
serviceSetState(0, SERVICE_STOPPED, GetLastError());
@@ -346,8 +344,9 @@ void WINAPI serviceMain(DWORD argc, TCHAR *argv[])
serviceSetState(SERVICE_ACCEPT_STOP, SERVICE_RUNNING, 0);
- g_ServiceThread = CreateThread(NULL, 0, serviceWorkerThread, NULL, 0, NULL);
- if (g_ServiceThread == NULL)
+ DWORD ThreadID;
+ g_ServiceThread = CreateThread(nullptr, 0, serviceWorkerThread, nullptr, 0, &ThreadID);
+ if (g_ServiceThread == nullptr)
{
OutputDebugStringA("CreateThread() failed\n");
serviceSetState(0, SERVICE_STOPPED, GetLastError());
@@ -359,135 +358,180 @@ void WINAPI serviceMain(DWORD argc, TCHAR *argv[])
serviceSetState(0, SERVICE_STOPPED, 0);
}
-#endif
+#endif // Windows service support.
-////////////////////////////////////////////////////////////////////////////////
-// main:
-int main( int argc, char **argv)
+std::unique_ptr<cMemorySettingsRepository> parseArguments(int argc, char **argv)
{
- UNUSED(argc);
- UNUSED(argv);
-
- #if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER)
- InitLeakFinder();
- #endif
-
- // Magic code to produce dump-files on Windows if the server crashes:
- #if defined(_WIN32) && !defined(_WIN64) && defined(_MSC_VER)
- HINSTANCE hDbgHelp = LoadLibrary("DBGHELP.DLL");
- g_WriteMiniDump = (pMiniDumpWriteDump)GetProcAddress(hDbgHelp, "MiniDumpWriteDump");
- if (g_WriteMiniDump != nullptr)
+ try
{
- _snprintf_s(g_DumpFileName, ARRAYCOUNT(g_DumpFileName), _TRUNCATE, "crash_mcs_%x.dmp", GetCurrentProcessId());
- SetUnhandledExceptionFilter(LastChanceExceptionFilter);
-
- // Parse arguments for minidump flags:
- for (int i = 0; i < argc; i++)
+ // Parse the comand line args:
+ TCLAP::CmdLine cmd("MCServer");
+ TCLAP::ValueArg<int> slotsArg ("s", "max-players", "Maximum number of slots for the server to use, overrides setting in setting.ini", false, -1, "number", cmd);
+ TCLAP::MultiArg<int> portsArg ("p", "port", "The port number the server should listen to", false, "port", cmd);
+ TCLAP::SwitchArg commLogArg ("", "log-comm", "Log server client communications to file", cmd);
+ TCLAP::SwitchArg commLogInArg ("", "log-comm-in", "Log inbound server client communications to file", cmd);
+ TCLAP::SwitchArg commLogOutArg ("", "log-comm-out", "Log outbound server client communications to file", cmd);
+ TCLAP::SwitchArg crashDumpFull ("", "crash-dump-full", "Crashdumps created by the server will contain full server memory", cmd);
+ TCLAP::SwitchArg crashDumpGlobals("", "crash-dump-globals", "Crashdumps created by the server will contain the global variables' values", cmd);
+ TCLAP::SwitchArg noBufArg ("", "no-output-buffering", "Disable output buffering", cmd);
+ TCLAP::SwitchArg runAsServiceArg ("d", "service", "Run as a service on Windows, or daemon on UNIX like systems", cmd);
+ cmd.parse(argc, argv);
+
+ // Copy the parsed args' values into a settings repository:
+ auto repo = cpp14::make_unique<cMemorySettingsRepository>();
+ if (slotsArg.isSet())
+ {
+ int slots = slotsArg.getValue();
+ repo->AddValue("Server", "MaxPlayers", static_cast<Int64>(slots));
+ }
+ if (portsArg.isSet())
{
- if (_stricmp(argv[i], "/cdg") == 0)
+ for (auto port: portsArg.getValue())
{
- // Add globals to the dump
- g_DumpFlags = (MINIDUMP_TYPE)(g_DumpFlags | MiniDumpWithDataSegs);
+ repo->AddValue("Server", "Port", static_cast<Int64>(port));
}
- else if (_stricmp(argv[i], "/cdf") == 0)
+ }
+ if (commLogArg.getValue())
+ {
+ g_ShouldLogCommIn = true;
+ g_ShouldLogCommOut = true;
+ }
+ else
+ {
+ g_ShouldLogCommIn = commLogInArg.getValue();
+ g_ShouldLogCommOut = commLogOutArg.getValue();
+ }
+ if (noBufArg.getValue())
+ {
+ setvbuf(stdout, nullptr, _IONBF, 0);
+ }
+ repo->SetReadOnly();
+
+ // Set the service flag directly to cRoot:
+ if (runAsServiceArg.getValue())
+ {
+ cRoot::m_RunAsService = true;
+ }
+
+ // Apply the CrashDump flags for platforms that support them:
+ #if defined(_WIN32) && !defined(_WIN64) && defined(_MSC_VER) // 32-bit Windows app compiled in MSVC
+ if (crashDumpGlobals.getValue())
+ {
+ g_DumpFlags = static_cast<MINIDUMP_TYPE>(g_DumpFlags | MiniDumpWithDataSegs);
+ }
+ if (crashDumpFull.getValue())
{
- // Add full memory to the dump (HUUUGE file)
- g_DumpFlags = (MINIDUMP_TYPE)(g_DumpFlags | MiniDumpWithFullMemory);
+ g_DumpFlags = static_cast<MINIDUMP_TYPE>(g_DumpFlags | MiniDumpWithFullMemory);
}
- } // for i - argv[]
+ #endif // 32-bit Windows app compiled in MSVC
+
+ return repo;
+ }
+ catch (const TCLAP::ArgException & exc)
+ {
+ printf("Error reading command line %s for arg %s", exc.error().c_str(), exc.argId().c_str());
+ return cpp14::make_unique<cMemorySettingsRepository>();
}
- #endif // _WIN32 && !_WIN64
+}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// main:
+
+int main(int argc, char **argv)
+{
+ #if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER)
+ InitLeakFinder();
+ #endif
+
+ // Magic code to produce dump-files on Windows if the server crashes:
+ #if defined(_WIN32) && !defined(_WIN64) && defined(_MSC_VER) // 32-bit Windows app compiled in MSVC
+ HINSTANCE hDbgHelp = LoadLibrary("DBGHELP.DLL");
+ g_WriteMiniDump = (pMiniDumpWriteDump)GetProcAddress(hDbgHelp, "MiniDumpWriteDump");
+ if (g_WriteMiniDump != nullptr)
+ {
+ _snprintf_s(g_DumpFileName, ARRAYCOUNT(g_DumpFileName), _TRUNCATE, "crash_mcs_%x.dmp", GetCurrentProcessId());
+ SetUnhandledExceptionFilter(LastChanceExceptionFilter);
+ }
+ #endif // 32-bit Windows app compiled in MSVC
// End of dump-file magic
+
#if defined(_DEBUG) && defined(_MSC_VER)
- _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+ _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
- // _X: The simple built-in CRT leak finder - simply break when allocating the Nth block ({N} is listed in the leak output)
- // Only useful when the leak is in the same sequence all the time
- // _CrtSetBreakAlloc(85950);
+ // _X: The simple built-in CRT leak finder - simply break when allocating the Nth block ({N} is listed in the leak output)
+ // Only useful when the leak is in the same sequence all the time
+ // _CrtSetBreakAlloc(85950);
#endif // _DEBUG && _MSC_VER
#ifndef _DEBUG
- std::signal(SIGSEGV, NonCtrlHandler);
- std::signal(SIGTERM, NonCtrlHandler);
- std::signal(SIGINT, NonCtrlHandler);
- std::signal(SIGABRT, NonCtrlHandler);
- #ifdef SIGABRT_COMPAT
- std::signal(SIGABRT_COMPAT, NonCtrlHandler);
- #endif // SIGABRT_COMPAT
+ std::signal(SIGSEGV, NonCtrlHandler);
+ std::signal(SIGTERM, NonCtrlHandler);
+ std::signal(SIGINT, NonCtrlHandler);
+ std::signal(SIGABRT, NonCtrlHandler);
+ #ifdef SIGABRT_COMPAT
+ std::signal(SIGABRT_COMPAT, NonCtrlHandler);
+ #endif // SIGABRT_COMPAT
#endif
- // DEBUG: test the dumpfile creation:
- // *((int *)0) = 0;
-
- // Check if comm logging is to be enabled:
- for (int i = 0; i < argc; i++)
- {
- AString Arg(argv[i]);
- if (
- (NoCaseCompare(Arg, "/commlog") == 0) ||
- (NoCaseCompare(Arg, "/logcomm") == 0)
- )
- {
- g_ShouldLogCommIn = true;
- g_ShouldLogCommOut = true;
- }
- else if (
- (NoCaseCompare(Arg, "/commlogin") == 0) ||
- (NoCaseCompare(Arg, "/comminlog") == 0) ||
- (NoCaseCompare(Arg, "/logcommin") == 0)
- )
- {
- g_ShouldLogCommIn = true;
- }
- else if (
- (NoCaseCompare(Arg, "/commlogout") == 0) ||
- (NoCaseCompare(Arg, "/commoutlog") == 0) ||
- (NoCaseCompare(Arg, "/logcommout") == 0)
- )
- {
- g_ShouldLogCommOut = true;
- }
- else if (NoCaseCompare(Arg, "nooutbuf") == 0)
- {
- setvbuf(stdout, nullptr, _IONBF, 0);
- }
- else if (NoCaseCompare(Arg, "/service") == 0)
- {
- cRoot::m_RunAsService = true;
- }
- } // for i - argv[]
+ auto argsRepo = parseArguments(argc, argv);
- #if defined(_WIN32)
// Attempt to run as a service
if (cRoot::m_RunAsService)
{
- SERVICE_TABLE_ENTRY ServiceTable[] =
- {
- { SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION)serviceMain },
- { NULL, NULL }
- };
+ #if defined(_WIN32) // Windows service.
+ SERVICE_TABLE_ENTRY ServiceTable[] =
+ {
+ { SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION)serviceMain },
+ { nullptr, nullptr }
+ };
- if (StartServiceCtrlDispatcher(ServiceTable) == FALSE)
- {
- LOGERROR("Attempted, but failed, service startup.");
- return GetLastError();
- }
+ if (StartServiceCtrlDispatcher(ServiceTable) == FALSE)
+ {
+ LOGERROR("Attempted, but failed, service startup.");
+ return GetLastError();
+ }
+ #else // UNIX daemon.
+ pid_t pid = fork();
+
+ // fork() returns a negative value on error.
+ if (pid < 0)
+ {
+ LOGERROR("Could not fork process.");
+ return EXIT_FAILURE;
+ }
+
+ // Check if we are the parent or child process. Parent stops here.
+ if (pid > 0)
+ {
+ return EXIT_SUCCESS;
+ }
+
+ // Child process now goes quiet, running in the background.
+ close(STDIN_FILENO);
+ close(STDOUT_FILENO);
+ close(STDERR_FILENO);
+
+ universalMain(std::move(argsRepo));
+ #endif
}
else
- #endif
{
// Not running as a service, do normal startup
- universalMain();
+ universalMain(std::move(argsRepo));
}
#if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER)
- DeinitLeakFinder();
+ DeinitLeakFinder();
#endif
return EXIT_SUCCESS;
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 265640cc8..4db898fdb 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -6,3 +6,4 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(ChunkData)
add_subdirectory(Network)
+add_subdirectory(LoadablePieces)
diff --git a/tests/ChunkData/CMakeLists.txt b/tests/ChunkData/CMakeLists.txt
index 381e11cc2..bd2d6d9b4 100644
--- a/tests/ChunkData/CMakeLists.txt
+++ b/tests/ChunkData/CMakeLists.txt
@@ -3,6 +3,12 @@ cmake_minimum_required (VERSION 2.6)
enable_testing()
include_directories(${CMAKE_SOURCE_DIR}/src/)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_flags_cxx("-Wno-error=old-style-cast")
+ set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ChunkData.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion")
+ set_source_files_properties(${CMAKE_SOURCE_DIR}/src/StringUtils.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion")
+endif()
+
add_definitions(-DTEST_GLOBALS=1)
add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkData.cpp ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp)
diff --git a/tests/ChunkData/Coordinates.cpp b/tests/ChunkData/Coordinates.cpp
index b3c66dde5..de6686243 100644
--- a/tests/ChunkData/Coordinates.cpp
+++ b/tests/ChunkData/Coordinates.cpp
@@ -8,7 +8,7 @@ int main(int argc, char** argv)
{
class cMockAllocationPool
: public cAllocationPool<cChunkData::sChunkSection>
- {
+ {
virtual cChunkData::sChunkSection * Allocate()
{
return new cChunkData::sChunkSection();
@@ -138,17 +138,7 @@ int main(int argc, char** argv)
cChunkData buffer(Pool);
buffer.SetBlock(0, 0, 0, 0x42);
cChunkData copy(Pool);
- #if __cplusplus < 201103L
- copy = buffer;
- #else
copy = std::move(buffer);
- #endif
- testassert(copy.GetBlock(0, 0, 0) == 0x42);
- #if __cplusplus < 201103L
- copy = copy;
- #else
- copy = std::move(copy);
- #endif
testassert(copy.GetBlock(0, 0, 0) == 0x42);
}
diff --git a/tests/LoadablePieces/Bindings.h b/tests/LoadablePieces/Bindings.h
new file mode 100644
index 000000000..490830ac3
--- /dev/null
+++ b/tests/LoadablePieces/Bindings.h
@@ -0,0 +1,15 @@
+
+// Bindings.h
+
+// Dummy include file needed for LuaState to compile successfully
+
+
+
+
+struct lua_State;
+
+int tolua_AllToLua_open(lua_State * a_LuaState);
+
+
+
+
diff --git a/tests/LoadablePieces/CMakeLists.txt b/tests/LoadablePieces/CMakeLists.txt
new file mode 100644
index 000000000..4b3c0ab13
--- /dev/null
+++ b/tests/LoadablePieces/CMakeLists.txt
@@ -0,0 +1,96 @@
+cmake_minimum_required (VERSION 2.6)
+
+enable_testing()
+
+include_directories(${CMAKE_SOURCE_DIR}/src/)
+include_directories(${CMAKE_SOURCE_DIR}/lib/)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+add_definitions(-DTEST_GLOBALS=1)
+
+set (SHARED_SRCS
+ ${CMAKE_SOURCE_DIR}/src/BiomeDef.cpp
+ ${CMAKE_SOURCE_DIR}/src/BlockArea.cpp
+ ${CMAKE_SOURCE_DIR}/src/Cuboid.cpp
+ ${CMAKE_SOURCE_DIR}/src/ChunkData.cpp
+ ${CMAKE_SOURCE_DIR}/src/StringCompression.cpp
+ ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp
+
+ ${CMAKE_SOURCE_DIR}/src/Bindings/LuaState.cpp
+
+ ${CMAKE_SOURCE_DIR}/src/Generating/ChunkDesc.cpp
+ ${CMAKE_SOURCE_DIR}/src/Generating/PieceGenerator.cpp
+ ${CMAKE_SOURCE_DIR}/src/Generating/Prefab.cpp
+ ${CMAKE_SOURCE_DIR}/src/Generating/PrefabPiecePool.cpp
+
+ ${CMAKE_SOURCE_DIR}/src/Noise/Noise.cpp
+
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/Event.cpp
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/File.cpp
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/GZipFile.cpp
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/StackTrace.cpp
+
+ ${CMAKE_SOURCE_DIR}/src/WorldStorage/FastNBT.cpp
+ ${CMAKE_SOURCE_DIR}/src/WorldStorage/SchematicFileSerializer.cpp
+)
+
+set (SHARED_HDRS
+ ${CMAKE_SOURCE_DIR}/src/BiomeDef.h
+ ${CMAKE_SOURCE_DIR}/src/BlockArea.h
+ ${CMAKE_SOURCE_DIR}/src/Cuboid.h
+ ${CMAKE_SOURCE_DIR}/src/ChunkData.h
+ ${CMAKE_SOURCE_DIR}/src/Globals.h
+ ${CMAKE_SOURCE_DIR}/src/StringCompression.h
+ ${CMAKE_SOURCE_DIR}/src/StringUtils.h
+
+ ${CMAKE_SOURCE_DIR}/src/Bindings/LuaState.h
+
+ ${CMAKE_SOURCE_DIR}/src/Generating/ChunkDesc.h
+ ${CMAKE_SOURCE_DIR}/src/Generating/PieceGenerator.h
+ ${CMAKE_SOURCE_DIR}/src/Generating/Prefab.h
+ ${CMAKE_SOURCE_DIR}/src/Generating/PrefabPiecePool.h
+
+ ${CMAKE_SOURCE_DIR}/src/Noise/Noise.h
+
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.h
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/Event.h
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/File.h
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/GZipFile.h
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/StackTrace.h
+
+ ${CMAKE_SOURCE_DIR}/src/WorldStorage/FastNBT.h
+ ${CMAKE_SOURCE_DIR}/src/WorldStorage/SchematicFileSerializer.h
+)
+
+set (SRCS
+ LoadablePieces.cpp
+ Stubs.cpp
+ LuaState_Typedefs.inc
+ LuaState_Declaration.inc
+ Bindings.h
+)
+
+
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_flags_cxx("-Wno-error=conversion -Wno-error=old-style-cast")
+ add_flags_cxx("-Wno-error=global-constructors")
+ add_flags_cxx("-Wno-error=switch-enum")
+endif()
+
+
+if (MSVC)
+ # Add the MSVC-specific LeakFinder sources:
+ list (APPEND SHARED_SRCS ${CMAKE_SOURCE_DIR}/src/LeakFinder.cpp ${CMAKE_SOURCE_DIR}/src/StackWalker.cpp)
+ list (APPEND SHARED_HDRS ${CMAKE_SOURCE_DIR}/src/LeakFinder.h ${CMAKE_SOURCE_DIR}/src/StackWalker.h)
+endif()
+
+source_group("Shared" FILES ${SHARED_SRCS} ${SHARED_HDRS})
+source_group("Sources" FILES ${SRCS})
+add_executable(LoadablePieces ${SRCS} ${SHARED_SRCS} ${SHARED_HDRS})
+target_link_libraries(LoadablePieces tolualib zlib)
+add_test(NAME LoadablePieces-test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND LoadablePieces)
+
+
+
+
diff --git a/tests/LoadablePieces/LoadablePieces.cpp b/tests/LoadablePieces/LoadablePieces.cpp
new file mode 100644
index 000000000..cce43eee1
--- /dev/null
+++ b/tests/LoadablePieces/LoadablePieces.cpp
@@ -0,0 +1,57 @@
+
+// LoadablePieces.cpp
+
+// Implements the LoadablePieces test main entrypoint
+
+#include "Globals.h"
+#ifdef _WIN32
+ #include <direct.h>
+ #define GetCurrentFolder _getcwd
+#else
+ #include <unistd.h>
+ #define GetCurrentFolder getcwd
+#endif
+#include "Generating/PrefabPiecePool.h"
+
+
+
+
+
+static int DoTest(void)
+{
+ cPrefabPiecePool test;
+ auto res = test.LoadFromFile("Test.cubeset", true);
+ if (!res)
+ {
+ LOGWARNING("Loading from file \"Test.cubeset\" failed.");
+ return 1;
+ }
+ LOG("Loaded %u regular pieces and %u starting pieces", static_cast<unsigned>(test.GetAllPiecesCount()), static_cast<unsigned>(test.GetStartingPiecesCount()));
+
+ // Check that we loaded all the pieces:
+ testassert(test.GetAllPiecesCount() == 1);
+ testassert(test.GetStartingPiecesCount() == 1);
+
+ return 0;
+}
+
+
+
+
+
+int main(int argc, char * argv[])
+{
+ // Print the current directory for reference:
+ char folder[FILENAME_MAX];
+ GetCurrentFolder(folder, sizeof(folder));
+ LOG("Running cPrefabPiecePool test from folder \"%s\".", folder);
+
+ // Run the test:
+ int res = DoTest();
+ LOG("cPrefabPiecePool loading test done: %s", (res == 0) ? "success" : "failure");
+ return res;
+}
+
+
+
+
diff --git a/tests/LoadablePieces/LuaState_Declaration.inc b/tests/LoadablePieces/LuaState_Declaration.inc
new file mode 100644
index 000000000..4019b26c6
--- /dev/null
+++ b/tests/LoadablePieces/LuaState_Declaration.inc
@@ -0,0 +1,4 @@
+
+// LuaState_Declaration.inc
+
+// Dummy include file needed for LuaState to compile successfully
diff --git a/tests/LoadablePieces/LuaState_Typedefs.inc b/tests/LoadablePieces/LuaState_Typedefs.inc
new file mode 100644
index 000000000..5eba7c6f8
--- /dev/null
+++ b/tests/LoadablePieces/LuaState_Typedefs.inc
@@ -0,0 +1,19 @@
+
+// LuaState_Typedefs.inc
+
+// Dummy include file needed for LuaState to compile successfully
+
+
+
+
+
+// Forward-declare classes that are used in the API but never called:
+struct HTTPRequest;
+struct HTTPTemplateRequest;
+class cPluginLua;
+class cBoundingBox;
+template <typename T> class cItemCallback;
+class cEntity;
+
+
+
diff --git a/tests/LoadablePieces/Stubs.cpp b/tests/LoadablePieces/Stubs.cpp
new file mode 100644
index 000000000..3f4623850
--- /dev/null
+++ b/tests/LoadablePieces/Stubs.cpp
@@ -0,0 +1,274 @@
+
+// Stubs.cpp
+
+// Implements stubs of various MCServer methods that are needed for linking but not for runtime
+// This is required so that we don't bring in the entire MCServer via dependencies
+
+#include "Globals.h"
+#include "BlockInfo.h"
+#include "SelfTests.h"
+#include "Bindings.h"
+#include "Bindings/DeprecatedBindings.h"
+#include "Bindings/ManualBindings.h"
+#include "BlockEntities/BlockEntity.h"
+#include "Blocks/BlockHandler.h"
+#include "Generating/ChunkDesc.h"
+
+
+
+
+
+// fwd:
+struct lua_State;
+
+
+
+
+
+// Prototypes, needed by clang:
+extern "C" int luaopen_lsqlite3(lua_State * a_LuaState);
+extern "C" int luaopen_lxp(lua_State * a_LuaState);
+
+
+
+
+
+void cManualBindings::Bind(lua_State * a_LuaState)
+{
+}
+
+
+
+
+
+void DeprecatedBindings::Bind(lua_State * a_LuaState)
+{
+}
+
+
+
+
+
+int tolua_AllToLua_open(lua_State * a_LuaState)
+{
+ return 0;
+}
+
+
+
+
+
+extern "C" int luaopen_lsqlite3(lua_State * a_LuaState)
+{
+ return 0;
+}
+
+
+
+
+
+extern "C" int luaopen_lxp(lua_State * a_LuaState)
+{
+ return 0;
+}
+
+
+
+
+
+cBlockInfo::~cBlockInfo()
+{
+}
+
+
+
+
+
+void cBlockInfo::Initialize(cBlockInfo::cBlockInfoArray & a_BlockInfos)
+{
+ // The piece-loading code uses the handlers for rotations, so we need valid handlers
+ // Insert dummy handlers:
+ for (size_t i = 0; i < ARRAYCOUNT(a_BlockInfos); i++)
+ {
+ a_BlockInfos[i].m_Handler = new cBlockHandler(static_cast<BLOCKTYPE>(i));
+ }
+}
+
+
+
+
+
+cBlockHandler::cBlockHandler(BLOCKTYPE a_BlockType)
+{
+}
+
+
+
+
+
+bool cBlockHandler::GetPlacementBlockTypeMeta(
+ cChunkInterface & a_ChunkInterface, cPlayer * a_Player,
+ int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
+ int a_CursorX, int a_CursorY, int a_CursorZ,
+ BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
+)
+{
+ return true;
+}
+
+
+
+
+
+void cBlockHandler::OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ)
+{
+}
+
+
+
+
+
+void cBlockHandler::OnPlacedByPlayer(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, const sSetBlock & a_BlockChange)
+{
+}
+
+
+
+
+
+void cBlockHandler::OnDestroyedByPlayer(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ)
+{
+}
+
+
+
+
+
+void cBlockHandler::OnPlaced(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
+{
+}
+
+
+
+
+
+void cBlockHandler::OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ)
+{
+}
+
+
+
+
+
+void cBlockHandler::NeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_WhichNeighbor)
+{
+}
+
+
+
+
+
+void cBlockHandler::ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta)
+{
+}
+
+
+
+
+
+void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_BlockPluginInterface, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, bool a_CanDrop)
+{
+}
+
+
+
+
+
+bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, const cChunk & a_Chunk)
+{
+ return true;
+}
+
+
+
+
+
+bool cBlockHandler::IsUseable()
+{
+ return false;
+}
+
+
+
+
+
+bool cBlockHandler::IsClickedThrough(void)
+{
+ return false;
+}
+
+
+
+
+
+bool cBlockHandler::DoesIgnoreBuildCollision(void)
+{
+ return (m_BlockType == E_BLOCK_AIR);
+}
+
+
+
+
+
+bool cBlockHandler::DoesDropOnUnsuitable(void)
+{
+ return true;
+}
+
+
+
+
+
+void cBlockHandler::Check(cChunkInterface & a_ChunkInterface, cBlockPluginInterface & a_PluginInterface, int a_RelX, int a_RelY, int a_RelZ, cChunk & a_Chunk)
+{
+}
+
+
+
+
+
+cBlockEntity * cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World)
+{
+ return nullptr;
+}
+
+
+
+
+
+cSelfTests::cSelfTests(void):
+ m_AllowRegistering(true)
+{
+}
+
+
+
+
+
+cSelfTests & cSelfTests::Get(void)
+{
+ static cSelfTests singleton;
+ return singleton;
+}
+
+
+
+
+
+void cSelfTests::Register(cSelfTests::SelfTestFunction a_TestFn, const AString & a_TestName)
+{
+}
+
+
+
+
diff --git a/tests/LoadablePieces/Test.cubeset b/tests/LoadablePieces/Test.cubeset
new file mode 100644
index 000000000..c1bdc9844
--- /dev/null
+++ b/tests/LoadablePieces/Test.cubeset
@@ -0,0 +1,154 @@
+
+-- Test.cubeset
+
+-- This simple cubeset file is used for testing the cPrefabPiecePool loader.
+
+
+
+
+
+Cubeset =
+{
+ Metadata =
+ {
+ CubesetFormatVersion = 1,
+ },
+
+ Pieces =
+ {
+ -- One piece with inline definition:
+ {
+ Size =
+ {
+ x = 4,
+ y = 4,
+ z = 4,
+ },
+ Hitbox =
+ {
+ MinX = 0,
+ MinY = 0,
+ MinZ = 0,
+ MaxX = 3,
+ MaxY = 3,
+ MaxZ = 3,
+ },
+ 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
+ },
+ Connectors =
+ {
+ {
+ Type = 2,
+ RelX = 2,
+ RelY = 2,
+ RelZ = 0,
+ Direction = 2, -- Z-
+ },
+ {
+ Type = 2,
+ RelX = 0,
+ RelY = 2,
+ RelZ = 1,
+ Direction = 4, -- X-
+ },
+ {
+ Type = 2,
+ RelX = 1,
+ RelY = 2,
+ RelZ = 3,
+ Direction = 3, -- Z+
+ },
+ {
+ Type = 2,
+ RelX = 3,
+ RelY = 2,
+ RelZ = 2,
+ Direction = 5, -- X+
+ },
+ },
+ Metadata =
+ {
+ ["DefaultWeight"] = "100",
+ ["AllowedRotations"] = "7",
+ ["MergeStrategy"] = "msSpongePrint",
+ ["IsStarting"] = "1",
+ ["DepthWeight"] = "",
+ ["ShouldExpandFloor"] = "1",
+ ["MoveToGround"] = "1",
+ ["AddWeightIfSame"] = "0",
+ },
+ },
+
+ -- One piece with external definition:
+ {
+ Hitbox =
+ {
+ MinX = 0,
+ MinY = 0,
+ MinZ = 0,
+ MaxX = 3,
+ MaxY = 3,
+ MaxZ = 3,
+ },
+ SchematicFileName = "Test1.schematic",
+ Connectors =
+ {
+ {
+ Type = 2,
+ RelX = 2,
+ RelY = 2,
+ RelZ = 0,
+ Direction = 2, -- Z-
+ },
+ },
+ Metadata =
+ {
+ ["DefaultWeight"] = "100",
+ ["AllowedRotations"] = "7",
+ ["MergeStrategy"] = "msSpongePrint",
+ ["IsStarting"] = "0",
+ ["DepthWeight"] = "",
+ ["ShouldExpandFloor"] = "1",
+ ["MoveToGround"] = "0",
+ ["AddWeightIfSame"] = "0",
+ },
+ },
+ }, -- Pieces
+}
+
+
+
+
diff --git a/tests/LoadablePieces/Test1.schematic b/tests/LoadablePieces/Test1.schematic
new file mode 100644
index 000000000..6fe19e9db
--- /dev/null
+++ b/tests/LoadablePieces/Test1.schematic
Binary files differ
diff --git a/tests/Network/CMakeLists.txt b/tests/Network/CMakeLists.txt
index c0af50e2c..f93ccad8e 100644
--- a/tests/Network/CMakeLists.txt
+++ b/tests/Network/CMakeLists.txt
@@ -41,8 +41,12 @@ if (MSVC)
target_link_libraries(Network ws2_32.lib)
endif()
-
-
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_flags_cxx("-Wno-error=conversion -Wno-error=old-style-cast")
+ if ("${CLANG_VERSION}" VERSION_GREATER 3.5)
+ add_flags_cxx("-Wno-error=inconsistent-missing-override")
+ endif()
+endif()
# Define individual tests: