From 0483ee48f8fe3f4b66b96bd83f5d46c8c8f2c8a1 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sat, 15 May 2021 15:23:50 +0200 Subject: [PATCH] Update to 4.6 base --- CMakeLists.txt | 2 +- CMakeLists.txt~ | 123 ++ README.txt | 10 +- data/mods/default/init.lua~ | 2277 +++++++++++++++++++++++++++++++++++ doc/changelog.txt | 147 +++ doc/gpl-2.0.txt | 339 ++++++ doc/mapformat.txt | 94 ++ doc/protocol.txt | 72 ++ minetest.conf~ | 9 + po/da/minetest.po | 4 +- po/de/minetest.po | 4 +- po/fr/minetest.po | 4 +- src/activeobject.h | 2 +- src/auth.cpp | 2 +- src/auth.h | 2 +- src/ban.cpp | 2 +- src/ban.h | 2 +- src/camera.cpp | 2 +- src/camera.h | 2 +- src/client.cpp | 2 +- src/client.h | 2 +- src/clientobject.cpp | 2 +- src/clientobject.h | 2 +- src/clientserver.h | 2 +- src/clouds.cpp | 2 +- src/clouds.h | 2 +- src/collision.cpp | 2 +- src/collision.h | 2 +- src/common_irrlicht.h | 2 +- src/connection.cpp | 2 +- src/connection.h | 2 +- src/constants.h | 2 +- src/content_abm.cpp | 2 +- src/content_abm.h | 2 +- src/content_cao.cpp | 2 +- src/content_cao.h | 2 +- src/content_mapblock.cpp | 2 +- src/content_mapblock.h | 2 +- src/content_mapnode.cpp | 2 +- src/content_mapnode.h | 2 +- src/content_nodemeta.cpp | 2 +- src/content_nodemeta.h | 2 +- src/content_object.h | 2 +- src/content_sao.cpp | 2 +- src/content_sao.h | 2 +- src/craftdef.cpp | 2 +- src/craftdef.h | 2 +- src/debug.cpp | 2 +- src/debug.h | 2 +- src/defaultsettings.cpp | 2 +- src/defaultsettings.cpp~ | 116 ++ src/defaultsettings.h | 2 +- src/environment.cpp | 2 +- src/environment.h | 2 +- src/exceptions.h | 2 +- src/farmesh.cpp | 2 +- src/farmesh.h | 2 +- src/filesys.cpp | 35 +- src/filesys.h | 2 +- src/game.cpp | 6 +- src/game.h | 2 +- src/gamedef.h | 2 +- src/gettime.h | 2 +- src/guiDeathScreen.cpp | 2 +- src/guiDeathScreen.h | 2 +- src/guiInventoryMenu.cpp | 2 +- src/guiInventoryMenu.h | 2 +- src/guiKeyChangeMenu.cpp | 2 +- src/guiKeyChangeMenu.h | 2 +- src/guiMainMenu.cpp | 2 +- src/guiMainMenu.h | 2 +- src/guiMessageMenu.cpp | 2 +- src/guiMessageMenu.h | 2 +- src/guiPasswordChange.cpp | 2 +- src/guiPasswordChange.h | 2 +- src/guiPauseMenu.cpp | 4 +- src/guiPauseMenu.h | 2 +- src/guiTextInputMenu.cpp | 2 +- src/guiTextInputMenu.h | 2 +- src/inventory.cpp | 2 +- src/inventory.h | 2 +- src/inventorymanager.cpp | 2 +- src/inventorymanager.h | 2 +- src/irrlichttypes.h | 2 +- src/itemdef.cpp | 2 +- src/itemdef.h | 2 +- src/keycode.cpp | 2 +- src/keycode.h | 2 +- src/light.cpp | 2 +- src/light.h | 2 +- src/log.cpp | 2 +- src/log.h | 2 +- src/logoutputbuffer.h | 2 +- src/luaentity_common.cpp | 2 +- src/luaentity_common.h | 2 +- src/main.cpp | 4 +- src/main.h | 2 +- src/mainmenumanager.h | 2 +- src/map.cpp | 308 ++--- src/map.h | 2 +- src/mapblock.cpp | 2 +- src/mapblock.h | 2 +- src/mapblock_mesh.cpp | 2 +- src/mapblock_mesh.h | 2 +- src/mapblock_nodemod.h | 2 +- src/mapchunk.h | 2 +- src/mapgen.cpp | 2 +- src/mapgen.h | 2 +- src/mapnode.cpp | 2 +- src/mapnode.h | 2 +- src/mapsector.cpp | 2 +- src/mapsector.h | 2 +- src/materials.cpp | 2 +- src/materials.h | 2 +- src/mesh.cpp | 2 +- src/mesh.h | 2 +- src/modalMenu.h | 2 +- src/modifiedstate.h | 2 +- src/mods.cpp | 2 +- src/mods.h | 2 +- src/nameidmapping.cpp | 2 +- src/nameidmapping.h | 2 +- src/nodedef.cpp | 2 +- src/nodedef.h | 2 +- src/nodemetadata.cpp | 2 +- src/nodemetadata.h | 2 +- src/noise.cpp | 2 +- src/noise.h | 2 +- src/player.cpp | 2 +- src/player.h | 2 +- src/porting.cpp | 2 +- src/porting.h | 2 +- src/profiler.h | 2 +- src/script.cpp | 2 +- src/script.h | 2 +- src/scriptapi.cpp | 2 +- src/scriptapi.h | 2 +- src/serialization.cpp | 2 +- src/serialization.h | 2 +- src/server.cpp | 2 +- src/server.h | 2 +- src/servercommand.cpp | 2 +- src/servercommand.h | 2 +- src/servermain.cpp | 2 +- src/serverobject.cpp | 2 +- src/serverobject.h | 2 +- src/serverremoteplayer.cpp | 2 +- src/serverremoteplayer.h | 2 +- src/settings.h | 2 +- src/socket.cpp | 2 +- src/socket.h | 2 +- src/staticobject.h | 2 +- src/strfnd.h | 2 +- src/test.cpp | 2 +- src/test.h | 2 +- src/threads.h | 2 +- src/tile.cpp | 2 +- src/tile.h | 2 +- src/utility.cpp | 2 +- src/utility.h | 2 +- src/voxel.cpp | 2 +- src/voxel.h | 2 +- util/wireshark/minetest.lua | 2 +- 163 files changed, 3512 insertions(+), 336 deletions(-) create mode 100644 CMakeLists.txt~ create mode 100644 data/mods/default/init.lua~ create mode 100644 doc/changelog.txt create mode 100644 doc/gpl-2.0.txt create mode 100644 doc/mapformat.txt create mode 100644 doc/protocol.txt create mode 100644 minetest.conf~ create mode 100644 src/defaultsettings.cpp~ diff --git a/CMakeLists.txt b/CMakeLists.txt index 2625c8d..f17833e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ project(minetest) # Also remember to set PROTOCOL_VERSION in clientserver.h when releasing set(VERSION_MAJOR 0) set(VERSION_MINOR 4) -set(VERSION_PATCH 4_2-Dev) +set(VERSION_PATCH 6) set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") MESSAGE(STATUS "*** Will build version ${VERSION_STRING} ***") diff --git a/CMakeLists.txt~ b/CMakeLists.txt~ new file mode 100644 index 0000000..2625c8d --- /dev/null +++ b/CMakeLists.txt~ @@ -0,0 +1,123 @@ +cmake_minimum_required(VERSION 2.6) +if(${CMAKE_VERSION} STREQUAL "2.8.2") + # bug http://vtk.org/Bug/view.php?id=11020 + message( WARNING "CMake/CPack version 2.8.2 will not create working .deb packages!") +endif(${CMAKE_VERSION} STREQUAL "2.8.2") + +# This can be read from ${PROJECT_NAME} after project() is called +project(minetest) + +# Also remember to set PROTOCOL_VERSION in clientserver.h when releasing +set(VERSION_MAJOR 0) +set(VERSION_MINOR 4) +set(VERSION_PATCH 4_2-Dev) +set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") + +MESSAGE(STATUS "*** Will build version ${VERSION_STRING} ***") + +# Configuration options + +if(WIN32) + set(RUN_IN_PLACE 1 CACHE BOOL "Run directly in source directory structure") +else() + set(RUN_IN_PLACE 0 CACHE BOOL "Run directly in source directory structure") +endif() + +set(BUILD_CLIENT 1 CACHE BOOL "Build client") +if(WIN32) + set(BUILD_SERVER 0 CACHE BOOL "Build server") +else() + set(BUILD_SERVER 1 CACHE BOOL "Build server") +endif() + +set(WARN_ALL 1 CACHE BOOL "Enable -Wall for Release build") + +if(NOT CMAKE_BUILD_TYPE) + # Default to release + set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type: Debug or Release" FORCE) +endif() + +# Included stuff +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") +include(${CMAKE_SOURCE_DIR}/cmake/Modules/misc.cmake) + +# This is done here so that relative search paths are more reasnable +find_package(Irrlicht) + +# +# Installation +# + +if(WIN32) + set(DATADIR "data") + set(BINDIR "bin") + set(DOCDIR "doc") + set(EXAMPLE_CONF_DIR ".") +elseif(APPLE) + # random placeholders + set(DATADIR "share/${PROJECT_NAME}") + set(BINDIR "bin") + set(DOCDIR "share/doc/${PROJECT_NAME}") + set(EXAMPLE_CONF_DIR ".") +elseif(UNIX) # Linux, BSD etc + set(DATADIR "share/${PROJECT_NAME}") + set(BINDIR "bin") + set(DOCDIR "share/doc/${PROJECT_NAME}") + set(EXAMPLE_CONF_DIR "share/doc/${PROJECT_NAME}") +endif() + +install(FILES "README.txt" DESTINATION "${DOCDIR}") +install(FILES "doc/changelog.txt" DESTINATION "${DOCDIR}") +install(FILES "minetest.conf.example" DESTINATION "${DOCDIR}") + +# +# Subdirectories +# Be sure to add all relevant definitions above this +# + +add_subdirectory(src) + +# CPack + +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An InfiniMiner/Minecraft inspired game") +set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) +set(CPACK_PACKAGE_VENDOR "celeron55") +set(CPACK_PACKAGE_CONTACT "Perttu Ahola ") + +if(WIN32) + # For some reason these aren't copied otherwise + # NOTE: For some reason now it seems to work without these + #if(BUILD_CLIENT) + # install(FILES bin/minetest.exe DESTINATION bin) + #endif() + #if(BUILD_SERVER) + # install(FILES bin/minetestserver.exe DESTINATION bin) + #endif() + + set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32") + + set(CPACK_GENERATOR ZIP) + + # This might be needed for some installer + #set(CPACK_PACKAGE_EXECUTABLES bin/minetest.exe "Minetest" bin/minetestserver.exe "Minetest Server") +elseif(APPLE) + # TODO + # see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29 + # + set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-osx") + set(CPACK_PACKAGE_ICON "") + set(CPACK_BUNDLE_NAME ${PROJECT_NAME}) + set(CPACK_BUNDLE_ICON "") + set(CPACK_BUNDLE_PLIST "") + set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/${PROJECT_NAME}") + set(CPACK_GENERATOR "Bundle") +else() + set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-linux") + set(CPACK_GENERATOR TGZ) + set(CPACK_SOURCE_GENERATOR TGZ) +endif() + +include(CPack) + diff --git a/README.txt b/README.txt index de7ba37..c10fa75 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -Minetest-m13 +Minetest-c55 --------------- An InfiniMiner/Minecraft inspired game. Copyright (c) 2010-2011 Perttu Ahola @@ -93,7 +93,7 @@ Compiling on Windows: * Optional: gettext bibrary and tools: http://gnuwin32.sourceforge.net/downlinks/gettext.php - This is used for other UI languages. Feel free to leave it out. - * And, of course, Minetest-m13: + * And, of course, Minetest-c55: http://celeron.55.lt/~celeron55/minetest/download - Steps: - Select a directory called DIR hereafter in which you will operate. @@ -195,7 +195,7 @@ cmake %sourcedir% -G "Visual Studio 10" -DIRRLICHT_SOURCE_DIR=%irrlichtpath% -DR "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" PACKAGE.vcxproj /p:Configuration=Release popd -License of Minetest-m13 textures and sounds +License of Minetest-c55 textures and sounds ------------------------------------------- This applies to textures and sounds contained in the main Minetest @@ -204,10 +204,10 @@ distribution. Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) http://creativecommons.org/licenses/by-sa/3.0/ -License of Minetest-m13 source code +License of Minetest-c55 source code ----------------------------------- -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/data/mods/default/init.lua~ b/data/mods/default/init.lua~ new file mode 100644 index 0000000..bcd6b57 --- /dev/null +++ b/data/mods/default/init.lua~ @@ -0,0 +1,2277 @@ +-- default (Minetest 0.4 mod) +-- Most default stuff + +-- Quick documentation about the API +-- ================================= +-- +-- Helper functions defined by builtin.lua: +-- dump2(obj, name="_", dumped={}) +-- dump(obj, dumped={}) +-- +-- Mod load path +-- ------------- +-- Generic: +-- $path_data/mods/ +-- $path_userdata/usermods/ +-- $mapdir/worldmods/ +-- +-- On a run-in-place version (eg. the distributed windows version): +-- minetest-0.4.x/data/mods/ +-- minetest-0.4.x/usermods/ +-- minetest-0.4.x/world/worldmods/ +-- +-- On an installed version on linux: +-- /usr/share/minetest/mods/ +-- ~/.minetest/usermods +-- ~/.minetest/world/worldmods +-- +-- Naming convention for registered textual names +-- ---------------------------------------------- +-- "modname:" ( can have characters a-zA-Z0-9_) +-- +-- This is to prevent conflicting names from corrupting maps and is +-- enforced by the mod loader. +-- +-- Example: mod "experimental", ideal item/node/entity name "tnt": +-- -> the name should be "experimental:tnt". +-- +-- Enforcement can be overridden by prefixing the name with ":". This can +-- be used for overriding the registrations of some other mod. +-- +-- Example: Any mod can redefine experimental:tnt by using the name +-- ":experimental:tnt" when registering it. +-- (also that mods is required to have "experimental" as a dependency) +-- +-- The legacy mod uses ":" for maintaining backwards compatibility. +-- +-- Textures +-- -------- +-- Mods should generally prefix their textures with modname_, eg. given +-- the mod name "foomod", a texture could be called "default_foomod_superfurnace.png" +-- +-- This is not crucial and a conflicting name will not corrupt maps. +-- +-- Representations of simple things +-- -------------------------------- +-- +-- MapNode representation: +-- {name="name", param1=num, param2=num} +-- +-- param1 and param2 are 8 bit and 4 bit integers, respectively. They +-- are reserved for certain automated functions. If you don't use these +-- functions, you can use them to store arbitrary values. +-- +-- param1 is reserved for the engine when: +-- paramtype != "none" +-- param2 is reserved for the engine when any of these are used: +-- liquidtype == "flowing" +-- drawtype == "flowingliquid" +-- drawtype == "torchlike" +-- drawtype == "signlike" +-- +-- Position representation: +-- {x=num, y=num, z=num} +-- +-- stackstring/itemstring: A stack of items in serialized format. +-- eg. 'node "default:dirt" 5' +-- eg. 'tool "default:pick_wood" 21323' +-- eg. 'craft "default:apple" 2' +-- +-- item: A stack of items in Lua table format. +-- eg. {name="default:dirt", count=1, wear=0, metadata=""} +-- ^ a single dirt node +-- eg. {name="default:pick_wood", count=1, wear=21323, metadata=""} +-- ^ a wooden pick about 1/3 weared out +-- eg. {name="default:apple", count=1, wear=0, metadata=""} +-- ^ an apple. +-- +-- Any time an item must be passed to a function, it can be an +-- ItemStack (see below), an itemstring or a table in the above format. +-- +-- Global functions: +-- minetest.register_entity(name, prototype table) +-- minetest.register_abm(abm definition) +-- minetest.register_node(name, node definition) +-- minetest.register_tool(name, item definition) +-- minetest.register_craftitem(name, item definition) +-- minetest.register_alias(name, convert_to) +-- minetest.register_craft(recipe) +-- minetest.register_globalstep(func(dtime)) +-- minetest.register_on_placenode(func(pos, newnode, placer)) +-- minetest.register_on_dignode(func(pos, oldnode, digger)) +-- minetest.register_on_punchnode(func(pos, node, puncher)) +-- minetest.register_on_generated(func(minp, maxp)) +-- minetest.register_on_newplayer(func(ObjectRef)) +-- minetest.register_on_dieplayer(func(ObjectRef)) +-- minetest.register_on_respawnplayer(func(ObjectRef)) +-- ^ return true in func to disable regular player placement +-- ^ currently called _before_ repositioning of player occurs +-- minetest.register_on_chat_message(func(name, message)) +-- minetest.add_to_creative_inventory(itemstring) +-- minetest.setting_get(name) -> string or nil +-- minetest.setting_getbool(name) -> boolean value or nil +-- minetest.chat_send_all(text) +-- minetest.chat_send_player(name, text) +-- minetest.get_player_privs(name) -> set of privs +-- minetest.get_inventory(location) -> InvRef +-- minetest.get_current_modname() -> string +-- minetest.get_modpath(modname) -> eg. "/home/user/.minetest/usermods/modname" +-- ^ location = eg. {type="player", name="celeron55"} +-- {type="node", pos={x=, y=, z=}} +-- +-- minetest.debug(line) +-- ^ Goes to dstream +-- minetest.log(line) +-- minetest.log(loglevel, line) +-- ^ loglevel one of "error", "action", "info", "verbose" +-- +-- minetest.digprop_constanttime(time) +-- minetest.digprop_stonelike(toughness) +-- minetest.digprop_dirtlike(toughness) +-- minetest.digprop_gravellike(toughness) +-- minetest.digprop_woodlike(toughness) +-- minetest.digprop_leaveslike(toughness) +-- minetest.digprop_glasslike(toughness) +-- +-- Global objects: +-- minetest.env - environment reference +-- +-- Global tables: +-- minetest.registered_items +-- ^ List of registered items, indexed by name +-- minetest.registered_nodes +-- ^ List of registered node definitions, indexed by name +-- minetest.registered_craftitems +-- ^ List of registered craft item definitions, indexed by name +-- minetest.registered_tools +-- ^ List of registered tool definitions, indexed by name +-- minetest.registered_entities +-- ^ List of registered entity prototypes, indexed by name +-- minetest.object_refs +-- ^ List of object references, indexed by active object id +-- minetest.luaentities +-- ^ List of lua entities, indexed by active object id +-- +-- EnvRef is basically ServerEnvironment and ServerMap combined. +-- EnvRef methods: +-- - add_node(pos, node) +-- - remove_node(pos) +-- - get_node(pos) +-- ^ Returns {name="ignore", ...} for unloaded area +-- - get_node_or_nil(pos) +-- ^ Returns nil for unloaded area +-- - get_node_light(pos, timeofday) -> 0...15 or nil +-- ^ timeofday: nil = current time, 0 = night, 0.5 = day +-- - add_entity(pos, name): Returns ObjectRef or nil if failed +-- - add_item(pos, itemstring) +-- - add_rat(pos) +-- - add_firefly(pos) +-- - get_meta(pos) -- Get a NodeMetaRef at that position +-- - get_player_by_name(name) -- Get an ObjectRef to a player +-- - get_objects_inside_radius(pos, radius) +-- +-- NodeMetaRef (this stuff is subject to change in a future version) +-- - get_type() +-- - allows_text_input() +-- - set_text(text) -- eg. set the text of a sign +-- - get_text() +-- - get_owner() +-- - set_owner(string) +-- Generic node metadata specific: +-- - set_infotext(infotext) +-- - get_inventory() -> InvRef +-- - set_inventory_draw_spec(string) +-- - set_allow_text_input(bool) +-- - set_allow_removal(bool) +-- - set_enforce_owner(bool) +-- - is_inventory_modified() +-- - reset_inventory_modified() +-- - is_text_modified() +-- - reset_text_modified() +-- - set_string(name, value) +-- - get_string(name) +-- +-- ObjectRef is basically ServerActiveObject. +-- ObjectRef methods: +-- - remove(): remove object (after returning from Lua) +-- - getpos() -> {x=num, y=num, z=num} +-- - setpos(pos); pos={x=num, y=num, z=num} +-- - moveto(pos, continuous=false): interpolated move +-- - punch(puncher, time_from_last_punch) +-- ^ puncher = an another ObjectRef, +-- ^ time_from_last_punch = time since last punch action of the puncher +-- - right_click(clicker); clicker = an another ObjectRef +-- - get_hp(): returns number of hitpoints (2 * number of hearts) +-- - set_hp(hp): set number of hitpoints (2 * number of hearts) +-- - get_inventory() -> InvRef +-- - get_wield_list(): returns the name of the inventory list the wielded item is in +-- - get_wield_index(): returns the index of the wielded item +-- - get_wielded_item() -> ItemStack +-- - set_wielded_item(item): replaces the wielded item, returns true if successful +-- LuaEntitySAO-only: (no-op for other objects) +-- - setvelocity({x=num, y=num, z=num}) +-- - getvelocity() -> {x=num, y=num, z=num} +-- - setacceleration({x=num, y=num, z=num}) +-- - getacceleration() -> {x=num, y=num, z=num} +-- - setyaw(radians) +-- - getyaw() -> radians +-- - settexturemod(mod) +-- - setsprite(p={x=0,y=0}, num_frames=1, framelength=0.2, +-- - select_horiz_by_yawpitch=false) +-- - ^ Select sprite from spritesheet with optional animation and DM-style +-- - texture selection based on yaw relative to camera +-- - get_entity_name() (DEPRECATED: Will be removed in a future version) +-- - get_luaentity() +-- Player-only: (no-op for other objects) +-- - get_player_name(): will return nil if is not a player +-- - get_look_dir(): get camera direction as a unit vector +-- - get_look_pitch(): pitch in radians +-- - get_look_yaw(): yaw in radians (wraps around pretty randomly as of now) +-- +-- InvRef methods: +-- - get_size(listname): get size of a list +-- - set_size(listname, size): set size of a list +-- - get_stack(listname, i): get a copy of stack index i in list +-- - set_stack(listname, i, stack): copy stack to index i in list +-- - get_list(listname): return full list +-- - set_list(listname, list): set full list (size will not change) +-- - add_item(listname, stack): add item somewhere in list, returns leftover ItemStack +-- - room_for_item(listname, stack): returns true if the stack of items +-- can be fully added to the list +-- - contains_item(listname, stack): returns true if the stack of items +-- can be fully taken from the list +-- remove_item(listname, stack): take as many items as specified from the list, +-- returns the items that were actually removed (as an ItemStack) +-- +-- ItemStack methods: +-- - is_empty(): return true if stack is empty +-- - get_name(): returns item name (e.g. "default:stone") +-- - get_count(): returns number of items on the stack +-- - get_wear(): returns tool wear (0-65535), 0 for non-tools +-- - get_metadata(): returns metadata (a string attached to an item stack) +-- - clear(): removes all items from the stack, making it empty +-- - replace(item): replace the contents of this stack (item can also +-- be an itemstring or table) +-- - to_string(): returns the stack in itemstring form +-- - to_table(): returns the stack in Lua table form +-- - get_stack_max(): returns the maximum size of the stack (depends on the item) +-- - get_free_space(): returns get_stack_max() - get_count() +-- - is_known(): returns true if the item name refers to a defined item type +-- - get_definition(): returns the item definition table +-- - get_tool_digging_properties(): returns the digging properties of the item, +-- ^ or those of the hand if none are defined for this item type +-- - add_wear(amount): increases wear by amount if the item is a tool +-- - add_item(item): put some item or stack onto this stack, +-- ^ returns leftover ItemStack +-- - item_fits(item): returns true if item or stack can be fully added to this one +-- - take_item(n): take (and remove) up to n items from this stack +-- ^ returns taken ItemStack +-- ^ if n is omitted, n=1 is used +-- - peek_item(n): copy (don't remove) up to n items from this stack +-- ^ returns copied ItemStack +-- ^ if n is omitted, n=1 is used +-- +-- Registered entities: +-- - Functions receive a "luaentity" as self: +-- - It has the member .name, which is the registered name ("mod:thing") +-- - It has the member .object, which is an ObjectRef pointing to the object +-- - The original prototype stuff is visible directly via a metatable +-- - Callbacks: +-- - on_activate(self, staticdata) +-- - on_step(self, dtime) +-- - on_punch(self, hitter) +-- - on_rightclick(self, clicker) +-- - get_staticdata(self) +-- ^ return string that will be passed to on_activate when the object +-- is created next time +-- +-- Entity prototype table: +-- { +-- physical = true, +-- collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5}, +-- visual = "cube"/"sprite", +-- visual_size = {x=1, y=1}, +-- textures = {texture,texture,texture,texture,texture,texture}, +-- spritediv = {x=1, y=1}, +-- initial_sprite_basepos = {x=0, y=0}, +-- on_activate = function(self, staticdata), +-- on_step = function(self, dtime), +-- on_punch = function(self, hitter), +-- on_rightclick = function(self, clicker), +-- get_staticdata = function(self), +-- # Also you can define arbitrary member variables here +-- myvariable = whatever, +-- } +-- +-- Item definition options (register_node, register_craftitem, register_tool) +-- { +-- description = "Steel Axe", +-- inventory_image = "default_tool_steelaxe.png", +-- wield_image = "", +-- wield_scale = {x=1,y=1,z=1}, +-- stack_max = 99, +-- liquids_pointable = false, +-- tool_digging_properties = { +-- full_punch_interval = 1.0, +-- basetime = 1.0, +-- dt_weight = 0.5, +-- dt_crackiness = -0.2, +-- dt_crumbliness = 1, +-- dt_cuttability = -0.5, +-- basedurability = 330, +-- dd_weight = 0, +-- dd_crackiness = 0, +-- dd_crumbliness = 0, +-- dd_cuttability = 0, +-- } +-- on_drop = func(item, dropper, pos), +-- on_place = func(item, placer, pointed_thing), +-- on_use = func(item, user, pointed_thing), +-- } +-- +-- Node definition options (register_node): +-- { +-- , +-- drawtype = "normal", +-- visual_scale = 1.0, +-- tile_images = {"default_unknown_block.png"}, +-- special_materials = { +-- {image="", backface_culling=true}, +-- {image="", backface_culling=true}, +-- }, +-- alpha = 255, +-- post_effect_color = {a=0, r=0, g=0, b=0}, +-- paramtype = "none", +-- paramtype2 = "none", +-- is_ground_content = false, +-- sunlight_propagates = false, +-- walkable = true, +-- pointable = true, +-- diggable = true, +-- climbable = false, +-- buildable_to = false, +-- drop = "", +-- -- alternatively drop = { max_items = ..., items = { ... } } +-- metadata_name = "", +-- liquidtype = "none", +-- liquid_alternative_flowing = "", +-- liquid_alternative_source = "", +-- liquid_viscosity = 0, +-- light_source = 0, +-- damage_per_second = 0, +-- selection_box = {type="regular"}, +-- material = { +-- diggablity = "normal", +-- weight = 0, +-- crackiness = 0, +-- crumbliness = 0, +-- cuttability = 0, +-- flammability = 0, +-- }, +-- legacy_facedir_simple = false, -- Support maps made in and before January 2012 +-- legacy_wallmounted = false, -- Support maps made in and before January 2012 +-- } +-- +-- Recipe: +-- { +-- output = 'default:pick_stone', +-- recipe = { +-- {'default:cobble', 'default:cobble', 'default:cobble'}, +-- {'', 'default:stick', ''}, +-- {'', 'default:stick', ''}, +-- }, +-- replacements = +-- } +-- +-- Recipe (shapeless): +-- { +-- type = "shapeless", +-- output = 'mushrooms:mushroom_stew', +-- recipe = { +-- "mushrooms:bowl", +-- "mushrooms:mushroom_brown", +-- "mushrooms:mushroom_red", +-- }, +-- replacements = +-- } +-- +-- Recipe (tool repair): +-- { +-- type = "toolrepair", +-- additional_wear = -0.02, +-- } +-- +-- Recipe (cooking): +-- { +-- type = "cooking", +-- output = "default:glass", +-- recipe = "default:sand", +-- cooktime = 3, +-- } +-- +-- Recipe (furnace fuel): +-- { +-- type = "fuel", +-- recipe = "default:leaves", +-- burntime = 1, +-- } +-- +-- ABM (ActiveBlockModifier) definition: +-- { +-- nodenames = {"default:lava_source"}, +-- neighbors = {"default:water_source", "default:water_flowing"}, -- (any of these) +-- ^ If left out or empty, any neighbor will do +-- ^ This might get removed in the future +-- interval = 1.0, -- (operation interval) +-- chance = 1, -- (chance of trigger is 1.0/this) +-- action = func(pos, node, active_object_count, active_object_count_wider), +-- } + +WATER_ALPHA = 160 +WATER_VISC = 1 +LAVA_VISC = 7 +LIGHT_MAX = 14 + +-- Definitions made by this mod that other mods can use too +default = {} + +-- +-- Tool definition +-- + +minetest.register_tool("default:pick_wood", { + description = "Wooden Pickaxe", + inventory_image = "default_tool_woodpick.png", + tool_digging_properties = { + basetime = 2.0, + dt_weight = 0, + dt_crackiness = -0.5, + dt_crumbliness = 2, + dt_cuttability = 0, + basedurability = 30, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + }, +}) +minetest.register_tool("default:pick_stone", { + description = "Stone Pickaxe", + inventory_image = "default_tool_stonepick.png", + tool_digging_properties = { + basetime = 1.5, + dt_weight = 0, + dt_crackiness = -0.5, + dt_crumbliness = 2, + dt_cuttability = 0, + basedurability = 100, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + }, +}) +minetest.register_tool("default:pick_steel", { + description = "Steel Pickaxe", + inventory_image = "default_tool_steelpick.png", + tool_digging_properties = { + basetime = 1.0, + dt_weight = 0, + dt_crackiness = -0.5, + dt_crumbliness = 2, + dt_cuttability = 0, + basedurability = 333, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + }, +}) +minetest.register_tool("default:pick_mese", { + description = "Mese Pickaxe", + inventory_image = "default_tool_mesepick.png", + tool_digging_properties = { + basetime = 0, + dt_weight = 0, + dt_crackiness = 0, + dt_crumbliness = 0, + dt_cuttability = 0, + basedurability = 1337, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + }, +}) +minetest.register_tool("default:shovel_wood", { + description = "Wooden Shovel", + inventory_image = "default_tool_woodshovel.png", + tool_digging_properties = { + basetime = 2.0, + dt_weight = 0.5, + dt_crackiness = 2, + dt_crumbliness = -1.5, + dt_cuttability = 0.3, + basedurability = 30, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + }, +}) +minetest.register_tool("default:shovel_stone", { + description = "Stone Shovel", + inventory_image = "default_tool_stoneshovel.png", + tool_digging_properties = { + basetime = 1.5, + dt_weight = 0.5, + dt_crackiness = 2, + dt_crumbliness = -1.5, + dt_cuttability = 0.1, + basedurability = 100, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + }, +}) +minetest.register_tool("default:shovel_steel", { + description = "Steel Shovel", + inventory_image = "default_tool_steelshovel.png", + tool_digging_properties = { + basetime = 1.0, + dt_weight = 0.5, + dt_crackiness = 2, + dt_crumbliness = -1.5, + dt_cuttability = 0.0, + basedurability = 330, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + }, +}) +minetest.register_tool("default:axe_wood", { + description = "Wooden Axe", + inventory_image = "default_tool_woodaxe.png", + tool_digging_properties = { + basetime = 2.0, + dt_weight = 0.5, + dt_crackiness = -0.2, + dt_crumbliness = 1, + dt_cuttability = -0.5, + basedurability = 30, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + }, +}) +minetest.register_tool("default:axe_stone", { + description = "Stone Axe", + inventory_image = "default_tool_stoneaxe.png", + tool_digging_properties = { + basetime = 1.5, + dt_weight = 0.5, + dt_crackiness = -0.2, + dt_crumbliness = 1, + dt_cuttability = -0.5, + basedurability = 100, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + }, +}) +minetest.register_tool("default:axe_steel", { + description = "Steel Axe", + inventory_image = "default_tool_steelaxe.png", + tool_digging_properties = { + basetime = 1.0, + dt_weight = 0.5, + dt_crackiness = -0.2, + dt_crumbliness = 1, + dt_cuttability = -0.5, + basedurability = 330, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + }, +}) +minetest.register_tool("default:sword_wood", { + description = "Wooden Sword", + inventory_image = "default_tool_woodsword.png", + tool_digging_properties = { + basetime = 3.0, + dt_weight = 3, + dt_crackiness = 0, + dt_crumbliness = 1, + dt_cuttability = -1, + basedurability = 30, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + } +}) +minetest.register_tool("default:sword_stone", { + description = "Stone Sword", + inventory_image = "default_tool_stonesword.png", + tool_digging_properties = { + basetime = 2.5, + dt_weight = 3, + dt_crackiness = 0, + dt_crumbliness = 1, + dt_cuttability = -1, + basedurability = 100, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + } +}) +minetest.register_tool("default:sword_steel", { + description = "Steel Sword", + inventory_image = "default_tool_steelsword.png", + tool_digging_properties = { + basetime = 2.0, + dt_weight = 3, + dt_crackiness = 0, + dt_crumbliness = 1, + dt_cuttability = -1, + basedurability = 330, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, + } +}) + +-- +-- Crafting definition +-- + +minetest.register_craft({ + output = 'default:wood 4', + recipe = { + {'default:tree'}, + } +}) + +minetest.register_craft({ + output = 'default:stick 4', + recipe = { + {'default:wood'}, + } +}) + +minetest.register_craft({ + output = 'default:fence_wood 2', + recipe = { + {'default:stick', 'default:stick', 'default:stick'}, + {'default:stick', 'default:stick', 'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:sign_wall', + recipe = { + {'default:wood', 'default:wood', 'default:wood'}, + {'default:wood', 'default:wood', 'default:wood'}, + {'', 'default:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:torch 4', + recipe = { + {'default:coal_lump'}, + {'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:pick_wood', + recipe = { + {'default:wood', 'default:wood', 'default:wood'}, + {'', 'default:stick', ''}, + {'', 'default:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:pick_stone', + recipe = { + {'default:cobble', 'default:cobble', 'default:cobble'}, + {'', 'default:stick', ''}, + {'', 'default:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:pick_steel', + recipe = { + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'', 'default:stick', ''}, + {'', 'default:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:pick_mese', + recipe = { + {'default:mese', 'default:mese', 'default:mese'}, + {'', 'default:stick', ''}, + {'', 'default:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:shovel_wood', + recipe = { + {'default:wood'}, + {'default:stick'}, + {'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:shovel_stone', + recipe = { + {'default:cobble'}, + {'default:stick'}, + {'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:shovel_steel', + recipe = { + {'default:steel_ingot'}, + {'default:stick'}, + {'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:axe_wood', + recipe = { + {'default:wood', 'default:wood'}, + {'default:wood', 'default:stick'}, + {'', 'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:axe_stone', + recipe = { + {'default:cobble', 'default:cobble'}, + {'default:cobble', 'default:stick'}, + {'', 'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:axe_steel', + recipe = { + {'default:steel_ingot', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:stick'}, + {'', 'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:sword_wood', + recipe = { + {'default:wood'}, + {'default:wood'}, + {'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:sword_stone', + recipe = { + {'default:cobble'}, + {'default:cobble'}, + {'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:sword_steel', + recipe = { + {'default:steel_ingot'}, + {'default:steel_ingot'}, + {'default:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:rail 15', + recipe = { + {'default:steel_ingot', '', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:stick', 'default:steel_ingot'}, + {'default:steel_ingot', '', 'default:steel_ingot'}, + } +}) + +minetest.register_craft({ + output = 'default:chest', + recipe = { + {'default:wood', 'default:wood', 'default:wood'}, + {'default:wood', '', 'default:wood'}, + {'default:wood', 'default:wood', 'default:wood'}, + } +}) + +minetest.register_craft({ + output = 'default:chest_locked', + recipe = { + {'default:wood', 'default:wood', 'default:wood'}, + {'default:wood', 'default:steel_ingot', 'default:wood'}, + {'default:wood', 'default:wood', 'default:wood'}, + } +}) + +minetest.register_craft({ + output = 'default:furnace', + recipe = { + {'default:cobble', 'default:cobble', 'default:cobble'}, + {'default:cobble', '', 'default:cobble'}, + {'default:cobble', 'default:cobble', 'default:cobble'}, + } +}) + +minetest.register_craft({ + output = 'default:steelblock', + recipe = { + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + } +}) + +minetest.register_craft({ + output = 'default:sandstone', + recipe = { + {'default:sand', 'default:sand'}, + {'default:sand', 'default:sand'}, + } +}) + +minetest.register_craft({ + output = 'default:clay', + recipe = { + {'default:clay_lump', 'default:clay_lump'}, + {'default:clay_lump', 'default:clay_lump'}, + } +}) + +minetest.register_craft({ + output = 'default:brick', + recipe = { + {'default:clay_brick', 'default:clay_brick'}, + {'default:clay_brick', 'default:clay_brick'}, + } +}) + +minetest.register_craft({ + output = 'default:paper', + recipe = { + {'default:papyrus', 'default:papyrus', 'default:papyrus'}, + } +}) + +minetest.register_craft({ + output = 'default:book', + recipe = { + {'default:paper'}, + {'default:paper'}, + {'default:paper'}, + } +}) + +minetest.register_craft({ + output = 'default:bookshelf', + recipe = { + {'default:wood', 'default:wood', 'default:wood'}, + {'default:book', 'default:book', 'default:book'}, + {'default:wood', 'default:wood', 'default:wood'}, + } +}) + +minetest.register_craft({ + output = 'default:ladder', + recipe = { + {'default:stick', '', 'default:stick'}, + {'default:stick', 'default:stick', 'default:stick'}, + {'default:stick', '', 'default:stick'}, + } +}) + +-- +-- Crafting (tool repair) +-- +minetest.register_craft({ + type = "toolrepair", + additional_wear = -0.02, +}) + +-- +-- Cooking recipes +-- + +minetest.register_craft({ + type = "cooking", + output = "default:glass", + recipe = "default:sand", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:coal_lump", + recipe = "default:tree", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:coal_lump", + recipe = "default:jungletree", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:stone", + recipe = "default:cobble", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:steel_ingot", + recipe = "default:iron_lump", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:clay_brick", + recipe = "default:clay_lump", +}) + +-- +-- Fuels +-- + +minetest.register_craft({ + type = "fuel", + recipe = "default:tree", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:jungletree", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:junglegrass", + burntime = 2, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:leaves", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:cactus", + burntime = 15, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:papyrus", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:bookshelf", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:fence_wood", + burntime = 15, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:ladder", + burntime = 5, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:wood", + burntime = 7, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:mese", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:lava_source", + burntime = 60, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:torch", + burntime = 4, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:sign_wall", + burntime = 10, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:chest", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:chest_locked", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:nyancat", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:nyancat_rainbow", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:sapling", + burntime = 10, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:apple", + burntime = 3, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:coal_lump", + burntime = 40, +}) + +-- +-- Node definitions +-- + +minetest.register_node("default:stone", { + description = "Stone", + tile_images = {"default_stone.png"}, + is_ground_content = true, + material = minetest.digprop_stonelike(1.0), + drop = 'default:cobble', + legacy_mineral = true, +}) + +minetest.register_node("default:stone_with_coal", { + description = "Stone with coal", + tile_images = {"default_stone.png^default_mineral_coal.png"}, + is_ground_content = true, + material = minetest.digprop_stonelike(1.0), + drop = 'default:coal_lump', +}) + +minetest.register_node("default:stone_with_iron", { + description = "Stone with iron", + tile_images = {"default_stone.png^default_mineral_iron.png"}, + is_ground_content = true, + material = minetest.digprop_stonelike(1.0), + drop = 'default:iron_lump', +}) + +minetest.register_node("default:dirt_with_grass", { + description = "Dirt with grass", + tile_images = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), + drop = 'default:dirt', +}) + +minetest.register_node("default:dirt_with_grass_footsteps", { + description = "Dirt with grass and footsteps", + tile_images = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), + drop = 'default:dirt', +}) + +minetest.register_node("default:dirt", { + description = "Dirt", + tile_images = {"default_dirt.png"}, + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), +}) + +minetest.register_node("default:sand", { + description = "Sand", + tile_images = {"default_sand.png"}, + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), +}) + +minetest.register_node("default:gravel", { + description = "Gravel", + tile_images = {"default_gravel.png"}, + is_ground_content = true, + material = minetest.digprop_gravellike(1.0), +}) + +minetest.register_node("default:sandstone", { + description = "Sandstone", + tile_images = {"default_sandstone.png"}, + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), -- FIXME should this be stonelike? + drop = 'default:sand', +}) + +minetest.register_node("default:clay", { + description = "Clay", + tile_images = {"default_clay.png"}, + is_ground_content = true, + material = minetest.digprop_dirtlike(1.0), + drop = 'default:clay_lump 4', +}) + +minetest.register_node("default:brick", { + description = "Brick", + tile_images = {"default_brick.png"}, + is_ground_content = true, + material = minetest.digprop_stonelike(1.0), + drop = 'default:clay_brick 4', +}) + +minetest.register_node("default:tree", { + description = "Tree", + tile_images = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(1.0), +}) + +minetest.register_node("default:jungletree", { + description = "Jungle Tree", + tile_images = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(1.0), +}) + +minetest.register_node("default:junglegrass", { + description = "Jungle Grass", + drawtype = "plantlike", + visual_scale = 1.3, + tile_images = {"default_junglegrass.png"}, + inventory_image = "default_junglegrass.png", + wield_image = "default_junglegrass.png", + paramtype = "light", + walkable = false, + material = minetest.digprop_leaveslike(1.0), +}) + +minetest.register_node("default:leaves", { + description = "Leaves", + drawtype = "allfaces_optional", + visual_scale = 1.3, + tile_images = {"default_leaves.png"}, + paramtype = "light", + material = minetest.digprop_leaveslike(1.0), + drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/20 chance + items = {'default:sapling'}, + rarity = 20, + }, + { + -- player will get leaves only if he get no saplings, + -- this is because max_items is 1 + items = {'default:leaves'}, + } + } + }, +}) + +minetest.register_node("default:cactus", { + description = "Cactus", + tile_images = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.75), +}) + +minetest.register_node("default:papyrus", { + description = "Papyrus", + drawtype = "plantlike", + tile_images = {"default_papyrus.png"}, + inventory_image = "default_papyrus.png", + wield_image = "default_papyrus.png", + paramtype = "light", + is_ground_content = true, + walkable = false, + material = minetest.digprop_leaveslike(0.5), +}) + +minetest.register_node("default:bookshelf", { + description = "Bookshelf", + tile_images = {"default_wood.png", "default_wood.png", "default_bookshelf.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.75), +}) + +minetest.register_node("default:glass", { + description = "Glass", + drawtype = "glasslike", + tile_images = {"default_glass.png"}, + inventory_image = minetest.inventorycube("default_glass.png"), + paramtype = "light", + sunlight_propagates = true, + is_ground_content = true, + material = minetest.digprop_glasslike(1.0), +}) + +minetest.register_node("default:fence_wood", { + description = "Wooden Fence", + drawtype = "fencelike", + tile_images = {"default_wood.png"}, + inventory_image = "default_fence.png", + wield_image = "default_fence.png", + paramtype = "light", + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, + material = minetest.digprop_woodlike(0.75), +}) + +minetest.register_node("default:rail", { + description = "Rail", + drawtype = "raillike", + tile_images = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"}, + inventory_image = "default_rail.png", + wield_image = "default_rail.png", + paramtype = "light", + is_ground_content = true, + walkable = false, + selection_box = { + type = "fixed", + --fixed = + }, + material = minetest.digprop_dirtlike(0.75), +}) + +minetest.register_node("default:ladder", { + description = "Ladder", + drawtype = "signlike", + tile_images = {"default_ladder.png"}, + inventory_image = "default_ladder.png", + wield_image = "default_ladder.png", + paramtype = "light", + paramtype2 = "wallmounted", + is_ground_content = true, + walkable = false, + climbable = true, + selection_box = { + type = "wallmounted", + --wall_top = = + --wall_bottom = = + --wall_side = = + }, + material = minetest.digprop_woodlike(0.5), + legacy_wallmounted = true, +}) + +minetest.register_node("default:wood", { + description = "Wood", + tile_images = {"default_wood.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.75), +}) + +minetest.register_node("default:mese", { + description = "Mese", + tile_images = {"default_mese.png"}, + is_ground_content = true, + material = minetest.digprop_stonelike(0.5), +}) + +minetest.register_node("default:cloud", { + description = "Cloud", + tile_images = {"default_cloud.png"}, + is_ground_content = true, +}) + +minetest.register_node("default:water_flowing", { + description = "Water (flowing)", + inventory_image = minetest.inventorycube("default_water.png"), + drawtype = "flowingliquid", + tile_images = {"default_water.png"}, + alpha = WATER_ALPHA, + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + liquidtype = "flowing", + liquid_alternative_flowing = "default:water_flowing", + liquid_alternative_source = "default:water_source", + liquid_viscosity = WATER_VISC, + post_effect_color = {a=64, r=100, g=100, b=200}, + special_materials = { + {image="default_water.png", backface_culling=false}, + {image="default_water.png", backface_culling=true}, + }, +}) + +minetest.register_node("default:water_source", { + description = "Water", + inventory_image = minetest.inventorycube("default_water.png"), + drawtype = "liquid", + tile_images = {"default_water.png"}, + alpha = WATER_ALPHA, + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + liquidtype = "source", + liquid_alternative_flowing = "default:water_flowing", + liquid_alternative_source = "default:water_source", + liquid_viscosity = WATER_VISC, + post_effect_color = {a=64, r=100, g=100, b=200}, + special_materials = { + -- New-style water source material (mostly unused) + {image="default_water.png", backface_culling=false}, + }, +}) + +minetest.register_node("default:lava_flowing", { + description = "Lava (flowing)", + inventory_image = minetest.inventorycube("default_lava.png"), + drawtype = "flowingliquid", + tile_images = {"default_lava.png"}, + paramtype = "light", + light_source = LIGHT_MAX - 1, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + liquidtype = "flowing", + liquid_alternative_flowing = "default:lava_flowing", + liquid_alternative_source = "default:lava_source", + liquid_viscosity = LAVA_VISC, + damage_per_second = 4*2, + post_effect_color = {a=192, r=255, g=64, b=0}, + special_materials = { + {image="default_lava.png", backface_culling=false}, + {image="default_lava.png", backface_culling=true}, + }, +}) + +minetest.register_node("default:lava_source", { + description = "Lava", + inventory_image = minetest.inventorycube("default_lava.png"), + drawtype = "liquid", + tile_images = {"default_lava.png"}, + paramtype = "light", + light_source = LIGHT_MAX - 1, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + liquidtype = "source", + liquid_alternative_flowing = "default:lava_flowing", + liquid_alternative_source = "default:lava_source", + liquid_viscosity = LAVA_VISC, + damage_per_second = 4*2, + post_effect_color = {a=192, r=255, g=64, b=0}, + special_materials = { + -- New-style lava source material (mostly unused) + {image="default_lava.png", backface_culling=false}, + }, +}) + +minetest.register_node("default:torch", { + description = "Torch", + drawtype = "torchlike", + tile_images = {"default_torch_on_floor.png", "default_torch_on_ceiling.png", "default_torch.png"}, + inventory_image = "default_torch_on_floor.png", + wield_image = "default_torch_on_floor.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + walkable = false, + light_source = LIGHT_MAX-1, + selection_box = { + type = "wallmounted", + wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1}, + wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1}, + }, + material = minetest.digprop_constanttime(0.0), + legacy_wallmounted = true, +}) + +minetest.register_node("default:sign_wall", { + description = "Sign", + drawtype = "signlike", + tile_images = {"default_sign_wall.png"}, + inventory_image = "default_sign_wall.png", + wield_image = "default_sign_wall.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + walkable = false, + metadata_name = "sign", + selection_box = { + type = "wallmounted", + --wall_top = + --wall_bottom = + --wall_side = + }, + material = minetest.digprop_constanttime(0.5), + legacy_wallmounted = true, +}) + +minetest.register_node("default:chest", { + description = "Chest", + tile_images = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png", + "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"}, + paramtype2 = "facedir", + metadata_name = "chest", + material = minetest.digprop_woodlike(1.0), + legacy_facedir_simple = true, +}) + +minetest.register_node("default:chest_locked", { + description = "Locked Chest", + tile_images = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png", + "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"}, + paramtype2 = "facedir", + metadata_name = "locked_chest", + material = minetest.digprop_woodlike(1.0), + legacy_facedir_simple = true, +}) + +minetest.register_node("default:furnace", { + description = "Furnace", + tile_images = {"default_furnace_side.png", "default_furnace_side.png", "default_furnace_side.png", + "default_furnace_side.png", "default_furnace_side.png", "default_furnace_front.png"}, + paramtype2 = "facedir", + metadata_name = "furnace", + material = minetest.digprop_stonelike(3.0), + legacy_facedir_simple = true, +}) + +minetest.register_node("default:cobble", { + description = "Cobble", + tile_images = {"default_cobble.png"}, + is_ground_content = true, + material = minetest.digprop_stonelike(0.9), +}) + +minetest.register_node("default:mossycobble", { + description = "Mossy Cobble", + tile_images = {"default_mossycobble.png"}, + is_ground_content = true, + material = minetest.digprop_stonelike(0.8), +}) + +minetest.register_node("default:steelblock", { + description = "Steel Block", + tile_images = {"default_steel_block.png"}, + is_ground_content = true, + material = minetest.digprop_stonelike(5.0), +}) + +minetest.register_node("default:nyancat", { + description = "Nyancat", + tile_images = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png", + "default_nc_side.png", "default_nc_back.png", "default_nc_front.png"}, + inventory_image = "default_nc_front.png", + paramtype2 = "facedir", + material = minetest.digprop_stonelike(3.0), + legacy_facedir_simple = true, +}) + +minetest.register_node("default:nyancat_rainbow", { + description = "Nyancat Rainbow", + tile_images = {"default_nc_rb.png"}, + inventory_image = "default_nc_rb.png", + material = minetest.digprop_stonelike(3.0), +}) + +minetest.register_node("default:sapling", { + description = "Sapling", + drawtype = "plantlike", + visual_scale = 1.0, + tile_images = {"default_sapling.png"}, + inventory_image = "default_sapling.png", + wield_image = "default_sapling.png", + paramtype = "light", + walkable = false, + material = minetest.digprop_constanttime(0.0), +}) + +minetest.register_node("default:apple", { + description = "Apple", + drawtype = "plantlike", + visual_scale = 1.0, + tile_images = {"default_apple.png"}, + inventory_image = "default_apple.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + material = minetest.digprop_constanttime(0.0), + on_use = minetest.item_eat(4), +}) + +-- +-- Crafting items +-- + +minetest.register_craftitem("default:stick", { + description = "Stick", + inventory_image = "default_stick.png", +}) + +minetest.register_craftitem("default:paper", { + description = "Paper", + inventory_image = "default_paper.png", +}) + +minetest.register_craftitem("default:book", { + description = "Book", + inventory_image = "default_book.png", +}) + +minetest.register_craftitem("default:coal_lump", { + description = "Lump of coal", + inventory_image = "default_coal_lump.png", +}) + +minetest.register_craftitem("default:iron_lump", { + description = "Lump of iron", + inventory_image = "default_iron_lump.png", +}) + +minetest.register_craftitem("default:clay_lump", { + description = "Lump of clay", + inventory_image = "default_clay_lump.png", +}) + +minetest.register_craftitem("default:steel_ingot", { + description = "Steel ingot", + inventory_image = "default_steel_ingot.png", +}) + +minetest.register_craftitem("default:clay_brick", { + description = "Clay brick", + inventory_image = "default_steel_ingot.png", + inventory_image = "default_clay_brick.png", +}) + +minetest.register_craftitem("default:scorched_stuff", { + description = "Scorched stuff", + inventory_image = "default_scorched_stuff.png", +}) + +-- +-- Creative inventory +-- + +minetest.add_to_creative_inventory('default:pick_mese') +minetest.add_to_creative_inventory('default:pick_steel') +minetest.add_to_creative_inventory('default:axe_steel') +minetest.add_to_creative_inventory('default:shovel_steel') + +minetest.add_to_creative_inventory('default:torch') +minetest.add_to_creative_inventory('default:cobble') +minetest.add_to_creative_inventory('default:dirt') +minetest.add_to_creative_inventory('default:stone') +minetest.add_to_creative_inventory('default:sand') +minetest.add_to_creative_inventory('default:sandstone') +minetest.add_to_creative_inventory('default:clay') +minetest.add_to_creative_inventory('default:brick') +minetest.add_to_creative_inventory('default:tree') +minetest.add_to_creative_inventory('default:wood') +minetest.add_to_creative_inventory('default:leaves') +minetest.add_to_creative_inventory('default:cactus') +minetest.add_to_creative_inventory('default:papyrus') +minetest.add_to_creative_inventory('default:bookshelf') +minetest.add_to_creative_inventory('default:glass') +minetest.add_to_creative_inventory('default:fence') +minetest.add_to_creative_inventory('default:rail') +minetest.add_to_creative_inventory('default:mese') +minetest.add_to_creative_inventory('default:chest') +minetest.add_to_creative_inventory('default:furnace') +minetest.add_to_creative_inventory('default:sign_wall') +minetest.add_to_creative_inventory('default:water_source') +minetest.add_to_creative_inventory('default:lava_source') +minetest.add_to_creative_inventory('default:ladder') + +-- +-- Some common functions +-- + +default.falling_node_names = {} + +function nodeupdate_single(p) + n = minetest.env:get_node(p) + if default.falling_node_names[n.name] ~= nil then + p_bottom = {x=p.x, y=p.y-1, z=p.z} + n_bottom = minetest.env:get_node(p_bottom) + if n_bottom.name == "air" then + minetest.env:remove_node(p) + minetest.env:add_entity(p, "default:falling_"..n.name) + nodeupdate(p) + end + end +end + +function nodeupdate(p) + for x = -1,1 do + for y = -1,1 do + for z = -1,1 do + p2 = {x=p.x+x, y=p.y+y, z=p.z+z} + nodeupdate_single(p2) + end + end + end +end + +-- +-- Falling stuff +-- + +function default.register_falling_node(nodename, texture) + default.falling_node_names[nodename] = true + -- Override naming conventions for stuff like :default:falling_default:sand + minetest.register_entity(":default:falling_"..nodename, { + -- Static definition + physical = true, + collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5}, + visual = "cube", + textures = {texture,texture,texture,texture,texture,texture}, + -- State + -- Methods + on_step = function(self, dtime) + -- Set gravity + self.object:setacceleration({x=0, y=-10, z=0}) + -- Turn to actual sand when collides to ground or just move + local pos = self.object:getpos() + local bcp = {x=pos.x, y=pos.y-0.7, z=pos.z} -- Position of bottom center point + local bcn = minetest.env:get_node(bcp) + if bcn.name ~= "air" then + -- Turn to a sand node + local np = {x=bcp.x, y=bcp.y+1, z=bcp.z} + minetest.env:add_node(np, {name=nodename}) + self.object:remove() + else + -- Do nothing + end + end + }) +end + +default.register_falling_node("default:sand", "default_sand.png") +default.register_falling_node("default:gravel", "default_gravel.png") + +-- +-- Global callbacks +-- + +-- Global environment step function +function on_step(dtime) + -- print("on_step") +end +minetest.register_globalstep(on_step) + +function on_placenode(p, node) + --print("on_placenode") + nodeupdate(p) +end +minetest.register_on_placenode(on_placenode) + +function on_dignode(p, node) + --print("on_dignode") + nodeupdate(p) +end +minetest.register_on_dignode(on_dignode) + +function on_punchnode(p, node) +end +minetest.register_on_punchnode(on_punchnode) + +local function handle_give_command(cmd, giver, receiver, stackstring) + if not minetest.get_player_privs(giver)["give"] then + minetest.chat_send_player(giver, "error: you don't have permission to give") + return + end + minetest.debug("DEBUG: "..cmd..' invoked, stackstring="'..stackstring..'"') + minetest.log(cmd..' invoked, stackstring="'..stackstring..'"') + local itemstack = ItemStack(stackstring) + if itemstack:is_empty() then + minetest.chat_send_player(giver, 'error: cannot give an empty item') + return + elseif not itemstack:is_known() then + minetest.chat_send_player(giver, 'error: cannot give an unknown item') + return + end + local receiverref = minetest.env:get_player_by_name(receiver) + if receiverref == nil then + minetest.chat_send_player(giver, receiver..' is not a known player') + return + end + local leftover = receiverref:get_inventory():add_item("main", itemstack) + if leftover:is_empty() then + partiality = "" + elseif leftover:get_count() == itemstack:get_count() then + partiality = "could not be " + else + partiality = "partially " + end + if giver == receiver then + minetest.chat_send_player(giver, '"'..stackstring + ..'" '..partiality..'added to inventory.'); + else + minetest.chat_send_player(giver, '"'..stackstring + ..'" '..partiality..'added to '..receiver..'\'s inventory.'); + minetest.chat_send_player(receiver, '"'..stackstring + ..'" '..partiality..'added to inventory.'); + end +end + +minetest.register_on_chat_message(function(name, message) + --print("default on_chat_message: name="..dump(name).." message="..dump(message)) + local cmd = "/giveme" + if message:sub(0, #cmd) == cmd then + local stackstring = string.match(message, cmd.." (.*)") + if stackstring == nil then + minetest.chat_send_player(name, 'usage: '..cmd..' stackstring') + return true -- Handled chat message + end + handle_give_command(cmd, name, name, stackstring) + return true + end + local cmd = "/give" + if message:sub(0, #cmd) == cmd then + local receiver, stackstring = string.match(message, cmd.." ([%a%d_-]+) (.*)") + if receiver == nil or stackstring == nil then + minetest.chat_send_player(name, 'usage: '..cmd..' name stackstring') + return true -- Handled chat message + end + handle_give_command(cmd, name, receiver, stackstring) + return true + end + local cmd = "/spawnentity" + if message:sub(0, #cmd) == cmd then + if not minetest.get_player_privs(name)["give"] then + minetest.chat_send_player(name, "you don't have permission to spawn (give)") + return true -- Handled chat message + end + if not minetest.get_player_privs(name)["interact"] then + minetest.chat_send_player(name, "you don't have permission to interact") + return true -- Handled chat message + end + local entityname = string.match(message, cmd.." (.*)") + if entityname == nil then + minetest.chat_send_player(name, 'usage: '..cmd..' entityname') + return true -- Handled chat message + end + print(cmd..' invoked, entityname="'..entityname..'"') + local player = minetest.env:get_player_by_name(name) + if player == nil then + print("Unable to spawn entity, player is nil") + return true -- Handled chat message + end + local p = player:getpos() + p.y = p.y + 1 + minetest.env:add_entity(p, entityname) + minetest.chat_send_player(name, '"'..entityname + ..'" spawned.'); + return true -- Handled chat message + end + local cmd = "/pulverize" + if message:sub(0, #cmd) == cmd then + local player = minetest.env:get_player_by_name(name) + if player == nil then + print("Unable to pulverize, player is nil") + return true -- Handled chat message + end + if player:get_wielded_item():is_empty() then + minetest.chat_send_player(name, 'Unable to pulverize, no item in hand.') + else + player:set_wielded_item(nil) + minetest.chat_send_player(name, 'An item was pulverized.') + end + return true + end +end) + +--M13 Blocks-- +---nodes--- +minetest.register_node("default:m13", { + description = "M13 Block", + tile_images = {"m13.png"}, + is_ground_content = true, + material = minetest.digprop_stonelike(1.00), +}) +---crafting--- +minetest.register_craft({ + output = 'default:m13', + recipe = { + {'default:mese'}, + {'default:mese'}, + } +}) + +minetest.register_craft({ + output = 'default:m13_pick', + recipe = { + {'default:m13', 'default:m13', 'default:m13'}, + {'', 'default:stick', ''}, + {'', 'default:stick', ''}, + } +}) + +---tools--- + +minetest.register_tool("default:m13_pick", { + image = "m13_pick.png", + basetime = 0, + dt_weight = 0, + dt_crackiness = 0, + dt_crumbliness = 0, + dt_cuttability = 0, + basedurability = 3000, + dd_weight = 0, + dd_crackiness = 0, + dd_crumbliness = 0, + dd_cuttability = 0, +}) + +--Jungle Tree can be Crafted into wood!-- +minetest.register_craft({ + output = 'default:wood 4' , + recipe = { + {'default:jungletree'}, + } +}) + +-- Wool -- + +minetest.register_craft({ + output = 'default:red 16', + recipe = { + {'default:apple', 'default:white'}, + } +}) + +minetest.register_craft({ + output = 'default:yellow 16', + recipe = { + {'default:sand', 'default:white'}, + } +}) + +minetest.register_craft({ + output = 'default:white 16', + recipe = { + {'default:coal_lump', 'default:sand'}, + } +}) + + +minetest.register_craft({ + output = 'default:black 16', + recipe = { + {'default:coal_lump', 'default:grey'}, + } +}) + +minetest.register_craft({ + output = 'default:grey 16', + recipe = { + {'default:coal_lump', 'default:white'}, + } +}) + +minetest.register_craft({ + output = 'default:green 16', + recipe = { + {'default:leaves', 'default:white'}, + } +}) + + +minetest.register_craft({ + output = 'default:brown 16', + recipe = { + {'default:dirt', 'default:white'}, + } +}) + +minetest.register_craft({ + output = 'default:cyan 16', + recipe = { + {'default:jungletree', 'default:white'}, + } +}) + +minetest.register_craft({ + output = 'default:magenta 16', + recipe = { + {'default:cyan', 'default:red'}, + } +}) + +minetest.register_craft({ + output = 'default:blue 16', + recipe = { + {'default:cyan', 'default:magenta'}, + } +}) + + +minetest.register_craft({ + output = 'default:orange 16', + recipe = { + {'default:yellow', 'default:red'}, + } +}) + + +minetest.register_node("default:cyan", { + description = "Cyan", + tile_images = {"colour_cyan.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + +minetest.register_node("default:red", { + description = "Red", + tile_images = {"colour_red.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + +minetest.register_node("default:magenta", { + description = "Magenta", + tile_images = {"colour_magenta.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + +minetest.register_node("default:white", { + description = "White", + tile_images = {"colour_white.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + +minetest.register_node("default:blue", { + description = "Blue", + tile_images = {"colour_blue.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + +minetest.register_node("default:yellow", { + description = "Yellow", + tile_images = {"colour_yellow.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + +minetest.register_node("default:grey", { + description = "Grey", + tile_images = {"colour_grey.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + +minetest.register_node("default:black", { + description = "Black", + tile_images = {"colour_black.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + +minetest.register_node("default:green", { + description = "Green", + tile_images = {"colour_green.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + +minetest.register_node("default:brown", { + description = "Brown", + tile_images = {"colour_brown.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + + +minetest.register_node("default:orange", { + description = "Orange", + tile_images = {"colour_orange.png"}, + is_ground_content = true, + material = minetest.digprop_woodlike(0.25), +}) + +-- bucket (Minetest 0.4 mod) + +minetest.register_alias("bucket", "bucket:bucket_empty") +minetest.register_alias("bucket_water", "bucket:bucket_water") +minetest.register_alias("bucket_lava", "bucket:bucket_lava") + +minetest.register_craft({ + output = 'bucket:bucket_empty 1', + recipe = { + {'default:steel_ingot', '', 'default:steel_ingot'}, + {'', 'default:steel_ingot', ''}, + } +}) + +bucket = {} +bucket.liquids = {} + +-- Register a new liquid +-- source = name of the source node +-- flowing = name of the flowing node +-- itemname = name of the new bucket item (or nil if liquid is not takeable) +-- inventory_image = texture of the new bucket item (ignored if itemname == nil) +-- This function can be called from any mod (that depends on bucket). +function bucket.register_liquid(source, flowing, itemname, inventory_image) + bucket.liquids[source] = { + source = source, + flowing = flowing, + itemname = itemname, + } + bucket.liquids[flowing] = bucket.liquids[source] + + if itemname ~= nil then + minetest.register_craftitem(itemname, { + inventory_image = inventory_image, + stack_max = 1, + liquids_pointable = true, + on_use = function(itemstack, user, pointed_thing) + -- Must be pointing to node + if pointed_thing.type ~= "node" then + return + end + -- Check if pointing to a liquid + n = minetest.env:get_node(pointed_thing.under) + if bucket.liquids[n.name] == nil then + -- Not a liquid + minetest.env:add_node(pointed_thing.above, {name=source}) + elseif n.name ~= source then + -- It's a liquid + minetest.env:add_node(pointed_thing.under, {name=source}) + end + return {name="bucket:bucket_empty"} + end + }) + end +end + +minetest.register_craftitem("bucket:bucket_empty", { + inventory_image = "bucket.png", + stack_max = 1, + liquids_pointable = true, + on_use = function(itemstack, user, pointed_thing) + -- Must be pointing to node + if pointed_thing.type ~= "node" then + return + end + -- Check if pointing to a liquid source + n = minetest.env:get_node(pointed_thing.under) + liquiddef = bucket.liquids[n.name] + if liquiddef ~= nil and liquiddef.source == n.name and liquiddef.itemname ~= nil then + minetest.env:add_node(pointed_thing.under, {name="air"}) + return {name=liquiddef.itemname} + end + end, +}) + +bucket.register_liquid( + "default:water_source", + "default:water_flowing", + "bucket:bucket_water", + "bucket_water.png" +) + +bucket.register_liquid( + "default:lava_source", + "default:lava_flowing", + "bucket:bucket_lava", + "bucket_lava.png" +) + +minetest.register_craft({ + type = "fuel", + recipe = "default:bucket_lava", + burntime = 60, +}) + +--Ropes-- + +minetest.register_on_placenode(function(pos, newnode, placer) + if newnode.name == "default:rope" then + place_rope(pos, newnode, placer) + end + end +) + +minetest.register_on_dignode(function(pos, oldnode, digger) + if oldnode.name == "default:rope" then + remove_rope(pos, oldnode, digger, true) + end + end +) + +minetest.register_on_punchnode(function(pos, oldnode, digger) + if oldnode.name == "default:rope" then + remove_rope(pos, oldnode, digger, false) + end + end +) + +-- helper function +inventory_find_item = function (object, name, item) + local inventory = object:inventory_get_list(name) + for key, value in pairs(inventory) do + if value == item then + return key, value + end + end + return nil, nil +end + +place_rope = function (pos, newnode, placer) + local inventory = placer:inventory_get_list("main") + local witem = placer:get_wielded_itemstring() + local windex, witem = inventory_find_item(placer, "main", witem) + local param2 = newnode.param2 + while witem ~= nil and witem:len() ~= 0 do + pos.y = pos.y - 1 + if minetest.env:get_node(pos).name ~= "air" then + break + end + if minetest.env:add_node(pos, {name="default:rope", param2=param2}) ~= true + then + break + end + witem = stackstring_take_item(witem) + end + if windex == nil then + else + inventory[windex] = witem + placer:inventory_set_list("main", inventory) + end +end + +remove_rope = function(pos, oldnode, digger, completely) + local num = 0 + local below = pos + local above = pos + if completely == true then + above.y = above.y + 1 + while minetest.env:get_node(above).name == "default:rope" do + minetest.env:remove_node(above) + above.y = above.y + 1 + num = num + 1 + end + end + below.y = below.y - 1 + while minetest.env:get_node(below).name == "default:rope" do + minetest.env:remove_node(below) + below.y = below.y -1 + num = num + 1 + end + if num ~= 0 then + digger:add_to_inventory_later('node "default:rope" ' .. num) + end + return true +end + +minetest.register_craft({ + output = 'default:rope 16', + recipe = { + {'', 'tree', ''}, + {'', 'tree', ''}, + {'', 'tree', ''}, + } +}) + +minetest.register_node("default:rope", { + drawtype = "signlike", + tile_images = {"rope2.png"}, + inventory_image = "rope2.png", + light_propagates = true, + paramtype = "light", + is_ground_content = true, + wall_mounted = true, + walkable = false, + climbable = true, + selection_box = { + type = "wallmounted", + --wall_top = = + --wall_bottom = = + --wall_side = = + }, + furnace_burntime = 5, + material = { + diggablity = "normal", + cuttability = 1.5, + }, +}) + +-- +-- Done, print some random stuff +-- + +--print("minetest.registered_entities:") +--dump2(minetest.registered_entities) + +-- END diff --git a/doc/changelog.txt b/doc/changelog.txt new file mode 100644 index 0000000..b27fc50 --- /dev/null +++ b/doc/changelog.txt @@ -0,0 +1,147 @@ +Minetest-c55 changelog +---------------------- +This should contain all the major changes. +For minor stuff, refer to the commit log of the repository. + +0.3.1: (released on 2011-11-09) +- Fix frustum culling (previous versions have rendered too much stuff that is not actually visible (about 180 degrees, while should have been more like 100.)) +- Add occlusion culling (improves performance a lot) +- Add “3d clouds” on/off checkbox in main menu +- Add “opaque water” on/off checkbox +- Fix some random minor stuff +- Turn mipmapping off (This makes far-away textures a bit noisier but better looking) +- Add Command-line signal handler for Windows (contributed by SpeedProg) +- Fix network layer segmentation fault introduced in 0.3.dev-20111021 +- Fix water-glass and water-lava and lava-glass surfaces + +0.3.0: (released on 2011-11-01) +- Some small fixes +0.3.dev-20111021: +- Modify dungeon masters to only try to shoot players +- Fix object duplication bug at block load/unload bug +- Improve network layer +0.3.dev-20111016: +- Locked chest (contributed) +- Server user limit setting (max_users) +- Wielded tool is shown in HUD (contributed) +- View bobbing (contributed) +- Saplings that drop from leaf blocks and when placed on ground will grow to trees (contributed) +- Optimized map saving (does not re-save everything all the time) +- New mob system and new mob: dungeon master +- Death/respawn screen + +0.2.20110922_3: +- Fix the build for MSVC2010; also released for windows using MSVC2010. + +0.2.20110922_1: +- Make client report a newer version number to the server than 2011-07-31 does and make server disallow old clients + +0.2.20110922: +- Map is saved in an SQLite database file (by Queatz) +- Ladders (MarkTraceur) +- Lava +- Apple trees (sfan5) +- Slightly better looking inventory with transparency +- /me chat command (Oblomov) +- Using chosen map seed possible through fixed_map_seed configuration option (kahrl) +- Fix the long-existed PeerNotFound loop bug +- Some translations and localization-related fixes +- Lots of small fixes + +2011-07-31_3: +- Fixes a bug that made the server to deny non-empty passwords from players connecting the first time + +2011-07-31_2: +- Fixes a bug that caused the server to always read an empty password from the client when a client connected. + +2011-07-31: +- A number of small fixes, build system stuff and such (refer to version control log) +- Map generator no longer crashes at generation limit +- Fixed mapgen producing lots of cut-down trees +- Some minor tweaks in map generator (some contributed) +- Volumetric clouds (contributed) +- Icon added (graphic contributed) +- Key configuration menu (contributed) +- Decorative blocks and items: bookshelf, sandstone, cactus, clay, brick, papyrus, rail, paper, book (contributed) +- Jungles! +- Hotbar is a bit smaller +- Health is now enabled by default; You can now eat cooked rats to heal yourself. +- Finally added sword textures, altough sword is still of no use +- Creative mode now preserves normal mode inventory + +2011-07-04: +- Many small fixes +- Code reorganizing to aid further development +- Renewed map generator + +2011-06-02: +- Password crash on windows fixed +- Optimized server CPU usage a lot +- Furnaces now work also while players are not near to them + +2011-05-29: +- Optimized smooth lighting +- A number of small fixes +- Added clouds and simple skyboxes +- The glass block added +- Added key configuration to config file +- Player privileges on server +- Slightly updated map format +- Player passwords +- All textures first searched from texture_path +- Map directory ("map") has been renamed to "world" (just rename it to load an old world) +- Mouse inversion (invert_mouse) +- Grass doesn't grow immediately anymore +- Fence added + +2011-04-24: +- Smooth lighting with simple ambient occlusion +- Updated main menu + +2011-04-23_0_test: +- Small bug fixes +- Item drop multiplication fixed +- HP added +- Added A simple monster which spawns to dark places at map generation time +- Some code refactoring and cleaning (possibly new bugs) + +2011-04-11: +- Fixed crafting a bit + +2011-04-10_0: +- Asynchronous map generation +- New object system + +2011-04-06: +- Mesh update of node addition/removal is now done asynchronously on client, removing frametime spike +- Node addition/removal is sent directly only to clients that are closer than 100 nodes to the modification. For the others, the modified blocks are set unsent. (and are re-sent when applicable) + +2011-04-05: +- Made furnace usable +- Added cobblestone +- Added wood, stone and steel tools: pickaxes, shovels and axes +- Incremented to version 0.0.2 + +2011-04-04: +- Cleaned client to be completely synchronous, except for the mesh calculation, which is now done with queues in a separate thread. +- Added node metadata support +- Added chests + +2011-02-17: +- Added better handling of textures. Now many file extensions are searched. Also too large textures are not put on the texture atlas, and the construction of the texture atlas is stopped when it is full. + +2011-02-16: +- Better handling of Ctrl-C on POSIX systems + +2011-02-15: +- Fixed a problem of not saving and loading the "lighting expired" value of MapBlocks properly. This caused high server CPU usage. +- Ctrl-C handling on POSIX systems +- Added simple command support to server +- Added settings enable_texture_atlas and texture_path + +2011-02-14: +- Created changelog.txt +- Added sneaking/crouching +- Modified the looks of the hotbar and cleaned code +- Added code to allow generating 3D cube images for inventory + diff --git a/doc/gpl-2.0.txt b/doc/gpl-2.0.txt new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/doc/gpl-2.0.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/doc/mapformat.txt b/doc/mapformat.txt new file mode 100644 index 0000000..206f5f3 --- /dev/null +++ b/doc/mapformat.txt @@ -0,0 +1,94 @@ +I'll try to quickly document the newest block format in here (might contain +errors). Refer to the mapgen or minetestmapper script for the directory +structure and file naming. There are two sector namings possible, +sector/XXXXZZZZ and sector/XXX/ZZZ. + +There also exists files map_meta.txt and chunk_meta, that are used by the +generator. If they are not found or invalid, the generator will currently +behave quite strangely. + +The MapBlock file format (sectors2/XXX/ZZZ/YYYY): +------------------------------------------------- + +NOTE: Byte order is MSB first. + +u8 version +- map format version number, this one is version 17 + +u8 flags +- Flag bitmasks: + - 0x01: is_underground: Should be set to 0 if there will be no light + obstructions above the block. If/when sunlight of a block is updated and + there is no block above it, this value is checked for determining whether + sunlight comes from the top. + - 0x02: day_night_differs: Whether the lighting of the block is different on + day and night. Only blocks that have this bit set are updated when day + transforms to night. + - 0x04: lighting_expired: If true, lighting is invalid and should be updated. + If you can't calculate lighting in your generator properly, you could try + setting this 1 to everything and setting the uppermost block in every + sector as is_underground=0. I am quite sure it doesn't work properly, + though. + +zlib-compressed map data: +- content: + u8[4096]: content types + u8[4096]: param1 values + u8[4096]: param2 values + +zlib-compressed node metadata +- content: + u16 version (=1) + u16 count of metadata + foreach count: + u16 position (= p.Z*MAP_BLOCKSIZE*MAP_BLOCKSIZE + p.Y*MAP_BLOCKSIZE + p.X) + u16 type_id + u16 content_size + u8[content_size] misc. stuff contained in the metadata + +u16 mapblockobject_count +- always write as 0. +- if read != 0, just fail. + +foreach mapblockobject_count: + - deprecated, should not be used. Length of this data can only be known by + properly parsing it. Just hope not to run into any of this. + +u8 static object version: +- currently 0 + +u16 static_object_count + +foreach static_object_count: + u8 type (object type-id) + s32 pos_x * 1000 + s32 pos_y * 1000 + s32 pos_z * 1000 + u16 data_size + u8[data_size] data + +u32 timestamp +- Timestamp when last saved, as seconds from starting the game. +- 0xffffffff = invalid/unknown timestamp, nothing will be done with the time + difference when loaded (recommended) + +Node metadata format: +--------------------- + +Sign metadata: + u16 string_len + u8[string_len] string + +Furnace metadata: + TBD + +Chest metadata: + TBD + +Locking Chest metadata: + u16 string_len + u8[string_len] string + TBD + +// END + diff --git a/doc/protocol.txt b/doc/protocol.txt new file mode 100644 index 0000000..82dca59 --- /dev/null +++ b/doc/protocol.txt @@ -0,0 +1,72 @@ +Minetest-c55 protocol (incomplete, early draft): +Updated 2011-06-18 + +A custom protocol over UDP. +Integers are big endian. +Refer to connection.{h,cpp} for further reference. + +Initialization: +- A dummy reliable packet with peer_id=PEER_ID_INEXISTENT=0 is sent to the server: + - Actually this can be sent without the reliable packet header, too, i guess, + but the sequence number in the header allows the sender to re-send the + packet without accidentally getting a double initialization. + - Packet content: + # Basic header + u32 protocol_id = PROTOCOL_ID = 0x4f457403 + u16 sender_peer_id = PEER_ID_INEXISTENT = 0 + u8 channel = 0 + # Reliable packet header + u8 type = TYPE_RELIABLE = 3 + u16 seqnum = SEQNUM_INITIAL = 65500 + # Original packet header + u8 type = TYPE_ORIGINAL = 1 + # And no actual payload. +- Server responds with something like this: + - Packet content: + # Basic header + u32 protocol_id = PROTOCOL_ID = 0x4f457403 + u16 sender_peer_id = PEER_ID_INEXISTENT = 0 + u8 channel = 0 + # Reliable packet header + u8 type = TYPE_RELIABLE = 3 + u16 seqnum = SEQNUM_INITIAL = 65500 + # Control packet header + u8 type = TYPE_CONTROL = 0 + u8 controltype = CONTROLTYPE_SET_PEER_ID = 1 + u16 peer_id_new = assigned peer id to client (other than 0 or 1) +- Then the connection can be disconnected by sending: + - Packet content: + # Basic header + u32 protocol_id = PROTOCOL_ID = 0x4f457403 + u16 sender_peer_id = whatever was gotten in CONTROLTYPE_SET_PEER_ID + u8 channel = 0 + # Control packet header + u8 type = TYPE_CONTROL = 0 + u8 controltype = CONTROLTYPE_DISCO = 3 + +- Here's a quick untested connect-disconnect done in PHP: +# host: ip of server (use gethostbyname(hostname) to get from a dns name) +# port: port of server +function check_if_minetestserver_up($host, $port) +{ + $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); + $timeout = array("sec" => 1, "usec" => 0); + socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, $timeout); + $buf = "\x4f\x45\x74\x03\x00\x00\x00\x03\xff\xdc\x01"; + socket_sendto($socket, $buf, strlen($buf), 0, $host, $port); + $buf = socket_read($socket, 1000); + if($buf != "") + { + # We got a reply! read the peer id from it. + $peer_id = substr($buf, 9, 2); + + # Disconnect + $buf = "\x4f\x45\x74\x03".$peer_id."\x00\x00\x03"; + socket_sendto($socket, $buf, strlen($buf), 0, $host, $port); + socket_close($socket); + + return true; + } + return false; +} + diff --git a/minetest.conf~ b/minetest.conf~ new file mode 100644 index 0000000..e454d9b --- /dev/null +++ b/minetest.conf~ @@ -0,0 +1,9 @@ +address = 192.168.0.10 +creative_mode = 0 +enable_3d_clouds = 0 +enable_damage = 1 +name = ubuntu2 +new_style_leaves = 0 +opaque_water = 0 +port = 30000 +smooth_lighting = 1 diff --git a/po/da/minetest.po b/po/da/minetest.po index d0e593d..b64b5d8 100644 --- a/po/da/minetest.po +++ b/po/da/minetest.po @@ -1,6 +1,6 @@ -# German translations for minetest-m13 package. +# German translations for minetest-c55 package. # Copyright (C) 2011 celeron -# This file is distributed under the same license as the minetest-m13 package. +# This file is distributed under the same license as the minetest-c55 package. # Frederik Helth , 2011. # msgid "" diff --git a/po/de/minetest.po b/po/de/minetest.po index 3281698..4b22855 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -1,6 +1,6 @@ -# German translations for minetest-m13 package. +# German translations for minetest-c55 package. # Copyright (C) 2011 celeron -# This file is distributed under the same license as the minetest-m13 package. +# This file is distributed under the same license as the minetest-c55 package. # Constantin Wenger , 2011. # msgid "" diff --git a/po/fr/minetest.po b/po/fr/minetest.po index a23ad42..52a02c2 100644 --- a/po/fr/minetest.po +++ b/po/fr/minetest.po @@ -1,6 +1,6 @@ -# French translations for minetest-m13 package. +# French translations for minetest-c55 package. # Copyright (C) 2011 celeron -# This file is distributed under the same license as the minetest-m13 package. +# This file is distributed under the same license as the minetest-c55 package. # Cyriaque 'Cisoun' Skrapits , 2011 # msgid "" diff --git a/src/activeobject.h b/src/activeobject.h index 080cf34..c46ae61 100644 --- a/src/activeobject.h +++ b/src/activeobject.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/auth.cpp b/src/auth.cpp index 8bc7e49..7326a60 100644 --- a/src/auth.cpp +++ b/src/auth.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/auth.h b/src/auth.h index 325a7a8..6f17693 100644 --- a/src/auth.h +++ b/src/auth.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/ban.cpp b/src/ban.cpp index 0408c80..3989762 100644 --- a/src/ban.cpp +++ b/src/ban.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/ban.h b/src/ban.h index 0047d93..8fdcf4c 100644 --- a/src/ban.h +++ b/src/ban.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/camera.cpp b/src/camera.cpp index 85537d8..0662085 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/camera.h b/src/camera.h index bb7bffe..56c99d1 100644 --- a/src/camera.h +++ b/src/camera.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/client.cpp b/src/client.cpp index b9c9cc1..0463aa8 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/client.h b/src/client.h index 0cd0605..efdf315 100644 --- a/src/client.h +++ b/src/client.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/clientobject.cpp b/src/clientobject.cpp index e136d39..93f3b1c 100644 --- a/src/clientobject.cpp +++ b/src/clientobject.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/clientobject.h b/src/clientobject.h index 885119d..2e1b850 100644 --- a/src/clientobject.h +++ b/src/clientobject.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/clientserver.h b/src/clientserver.h index 9e3f4e6..acb4f85 100644 --- a/src/clientserver.h +++ b/src/clientserver.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/clouds.cpp b/src/clouds.cpp index 1af7aa8..2324365 100644 --- a/src/clouds.cpp +++ b/src/clouds.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/clouds.h b/src/clouds.h index 1b19aef..5986137 100644 --- a/src/clouds.h +++ b/src/clouds.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/collision.cpp b/src/collision.cpp index a943d80..3460b04 100644 --- a/src/collision.cpp +++ b/src/collision.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/collision.h b/src/collision.h index 1feeadf..e823a08 100644 --- a/src/collision.h +++ b/src/collision.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/common_irrlicht.h b/src/common_irrlicht.h index bb8da62..0a2ed0b 100644 --- a/src/common_irrlicht.h +++ b/src/common_irrlicht.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/connection.cpp b/src/connection.cpp index 8e72072..8f308c9 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/connection.h b/src/connection.h index 0d07c19..6d26e2e 100644 --- a/src/connection.h +++ b/src/connection.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/constants.h b/src/constants.h index d60dcb7..a7cf170 100644 --- a/src/constants.h +++ b/src/constants.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_abm.cpp b/src/content_abm.cpp index 240fef3..63867b7 100644 --- a/src/content_abm.cpp +++ b/src/content_abm.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_abm.h b/src/content_abm.h index f9c907b..4081512 100644 --- a/src/content_abm.h +++ b/src/content_abm.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_cao.cpp b/src/content_cao.cpp index 08b4e88..809cfb0 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_cao.h b/src/content_cao.h index ba9de25..6394bed 100644 --- a/src/content_cao.h +++ b/src/content_cao.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index ba94e0f..dc1e1da 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_mapblock.h b/src/content_mapblock.h index 35c5c29..eaf74b1 100644 --- a/src/content_mapblock.h +++ b/src/content_mapblock.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index c2463b8..ce7ee59 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_mapnode.h b/src/content_mapnode.h index 2f370a8..003b7ed 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp index bc1f4de..9fb5450 100644 --- a/src/content_nodemeta.cpp +++ b/src/content_nodemeta.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_nodemeta.h b/src/content_nodemeta.h index 6b72797..6ce7a22 100644 --- a/src/content_nodemeta.h +++ b/src/content_nodemeta.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_object.h b/src/content_object.h index f205763..0b85e3c 100644 --- a/src/content_object.h +++ b/src/content_object.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 1a7a023..02be64c 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/content_sao.h b/src/content_sao.h index cead54d..f0c9cea 100644 --- a/src/content_sao.h +++ b/src/content_sao.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/craftdef.cpp b/src/craftdef.cpp index df71504..5bcbf6f 100644 --- a/src/craftdef.cpp +++ b/src/craftdef.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/craftdef.h b/src/craftdef.h index d7a6864..57f26f0 100644 --- a/src/craftdef.h +++ b/src/craftdef.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/debug.cpp b/src/debug.cpp index df5d325..ad02c51 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/debug.h b/src/debug.h index c6185b1..5150758 100644 --- a/src/debug.h +++ b/src/debug.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 594e870..8c40314 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/defaultsettings.cpp~ b/src/defaultsettings.cpp~ new file mode 100644 index 0000000..1e48183 --- /dev/null +++ b/src/defaultsettings.cpp~ @@ -0,0 +1,116 @@ +/* +Minetest-c55 +Copyright (C) 2010 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include "settings.h" + +void set_default_settings(Settings *settings) +{ + // Client and server + + settings->setDefault("port", ""); + settings->setDefault("name", ""); + settings->setDefault("footprints", "false"); + + // Client stuff + + settings->setDefault("keymap_forward", "KEY_KEY_W"); + settings->setDefault("keymap_backward", "KEY_KEY_S"); + settings->setDefault("keymap_left", "KEY_KEY_A"); + settings->setDefault("keymap_right", "KEY_KEY_D"); + settings->setDefault("keymap_jump", "KEY_SPACE"); + settings->setDefault("keymap_sneak", "KEY_LSHIFT"); + settings->setDefault("keymap_drop", "KEY_KEY_Q"); + settings->setDefault("keymap_inventory", "KEY_KEY_I"); + settings->setDefault("keymap_special1", "KEY_KEY_E"); + settings->setDefault("keymap_chat", "KEY_KEY_T"); + settings->setDefault("keymap_cmd", "/"); + settings->setDefault("keymap_rangeselect", "KEY_KEY_R"); + settings->setDefault("keymap_freemove", "KEY_KEY_K"); + settings->setDefault("keymap_fastmove", "KEY_KEY_J"); + settings->setDefault("keymap_frametime_graph", "KEY_F1"); + settings->setDefault("keymap_screenshot", "KEY_F12"); + settings->setDefault("keymap_toggle_profiler", "KEY_F2"); + settings->setDefault("keymap_toggle_force_fog_off", "KEY_F3"); + settings->setDefault("keymap_toggle_update_camera", "KEY_F4"); + // Some (temporary) keys for debugging + settings->setDefault("keymap_print_debug_stacks", "KEY_KEY_P"); + + settings->setDefault("wanted_fps", "30"); + settings->setDefault("fps_max", "60"); + settings->setDefault("viewing_range_nodes_max", "300"); + settings->setDefault("viewing_range_nodes_min", "15"); + settings->setDefault("screenW", "800"); + settings->setDefault("screenH", "600"); + settings->setDefault("address", ""); + settings->setDefault("random_input", "false"); + settings->setDefault("client_unload_unused_data_timeout", "600"); + settings->setDefault("enable_fog", "true"); + settings->setDefault("fov", "72"); + settings->setDefault("view_bobbing", "true"); + settings->setDefault("new_style_water", "false"); + settings->setDefault("new_style_leaves", "false"); + settings->setDefault("smooth_lighting", "true"); + settings->setDefault("frametime_graph", "false"); + settings->setDefault("enable_texture_atlas", "true"); + settings->setDefault("texture_path", ""); + settings->setDefault("video_driver", "opengl"); + settings->setDefault("free_move", "false"); + settings->setDefault("continuous_forward", "false"); + settings->setDefault("fast_move", "false"); + settings->setDefault("invert_mouse", "false"); + settings->setDefault("enable_farmesh", "false"); + settings->setDefault("enable_clouds", "true"); + settings->setDefault("screenshot_path", "."); + settings->setDefault("view_bobbing_amount", "1.0"); + settings->setDefault("enable_3d_clouds", "false"); + settings->setDefault("opaque_water", "false"); + + // Server stuff + // "map-dir" doesn't exist by default. + settings->setDefault("motd", ""); + settings->setDefault("max_users", "20"); + settings->setDefault("strict_protocol_version_checking", "true"); + settings->setDefault("creative_mode", "false"); + settings->setDefault("enable_damage", "true"); + settings->setDefault("only_peaceful_mobs", "false"); + settings->setDefault("fixed_map_seed", ""); + settings->setDefault("give_initial_stuff", "false"); + settings->setDefault("default_password", ""); + settings->setDefault("default_privs", "build, shout"); + settings->setDefault("unlimited_player_transfer_distance", "true"); + settings->setDefault("enable_pvp", "true"); + + settings->setDefault("profiler_print_interval", "0"); + settings->setDefault("enable_mapgen_debug_info", "false"); + settings->setDefault("active_object_send_range_blocks", "3"); + settings->setDefault("active_block_range", "2"); + //settings->setDefault("max_simultaneous_block_sends_per_client", "1"); + // This causes frametime jitter on client side, or does it? + settings->setDefault("max_simultaneous_block_sends_per_client", "2"); + settings->setDefault("max_simultaneous_block_sends_server_total", "8"); + settings->setDefault("max_block_send_distance", "7"); + settings->setDefault("max_block_generate_distance", "5"); + settings->setDefault("time_send_interval", "20"); + settings->setDefault("time_speed", "96"); + settings->setDefault("server_unload_unused_data_timeout", "29"); + settings->setDefault("server_map_save_interval", "5.3"); + settings->setDefault("full_block_send_enable_min_time_from_building", "2.0"); + settings->setDefault("enable_experimental", "false"); +} + diff --git a/src/defaultsettings.h b/src/defaultsettings.h index 4f9164b..c0bfcc6 100644 --- a/src/defaultsettings.h +++ b/src/defaultsettings.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/environment.cpp b/src/environment.cpp index 1f07742..7c2aef2 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/environment.h b/src/environment.h index 619553f..89c9fd6 100644 --- a/src/environment.h +++ b/src/environment.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/exceptions.h b/src/exceptions.h index 7bce60a..40a0db4 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/farmesh.cpp b/src/farmesh.cpp index 8379663..fdc8105 100644 --- a/src/farmesh.cpp +++ b/src/farmesh.cpp @@ -1,5 +1,5 @@ /* -Part of Minetest-m13 +Part of Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/farmesh.h b/src/farmesh.h index cbf2510..0a30a8a 100644 --- a/src/farmesh.h +++ b/src/farmesh.h @@ -1,5 +1,5 @@ /* -Part of Minetest-m13 +Part of Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/filesys.cpp b/src/filesys.cpp index 7c6efe1..a65515d 100644 --- a/src/filesys.cpp +++ b/src/filesys.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify @@ -31,8 +31,8 @@ namespace fs #include #include #include -#include -#include +#include +#include #include #define BUFSIZE MAX_PATH @@ -71,13 +71,13 @@ std::vector GetDirListing(std::string pathstring) // Find the first file in the directory. hFind = FindFirstFile(DirSpec, &FindFileData); - if (hFind == INVALID_HANDLE_VALUE) + if (hFind == INVALID_HANDLE_VALUE) { - _tprintf (TEXT("Invalid file handle. Error is %u.\n"), + _tprintf (TEXT("Invalid file handle. Error is %u.\n"), GetLastError()); retval = (-1); - } - else + } + else { // NOTE: // Be very sure to not include '..' in the results, it will @@ -90,7 +90,7 @@ std::vector GetDirListing(std::string pathstring) listing.push_back(node); // List all the other files in the directory. - while (FindNextFile(hFind, &FindFileData) != 0) + while (FindNextFile(hFind, &FindFileData) != 0) { DirListNode node; node.name = FindFileData.cFileName; @@ -101,9 +101,9 @@ std::vector GetDirListing(std::string pathstring) dwError = GetLastError(); FindClose(hFind); - if (dwError != ERROR_NO_MORE_FILES) + if (dwError != ERROR_NO_MORE_FILES) { - _tprintf (TEXT("FindNextFile error. Error is %u.\n"), + _tprintf (TEXT("FindNextFile error. Error is %u.\n"), dwError); retval = (-1); goto Cleanup; @@ -119,7 +119,7 @@ std::vector GetDirListing(std::string pathstring) //for(unsigned int i=0; i #include #include #include @@ -255,11 +254,11 @@ bool RecursiveDelete(std::string path) /* Execute the 'rm' command directly, by fork() and execve() */ - + std::cerr<<"Removing \""< This program is free software; you can redistribute it and/or modify diff --git a/src/game.cpp b/src/game.cpp index d074caf..47a0e6a 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify @@ -917,7 +917,7 @@ void the_game( // First line of debug text gui::IGUIStaticText *guitext = guienv->addStaticText( - L"Minetest-m13", + L"Minetest-c55", core::rect(5, 5, 795, 5+text_height), false, false); // Second line of debug text @@ -2116,7 +2116,7 @@ void the_game( endscenetime_avg = endscenetime_avg * 0.95 + (float)endscenetime*0.05; char temptext[300]; - snprintf(temptext, 300, "Minetest-m13 %s (" + snprintf(temptext, 300, "Minetest-c55 %s (" "R: range_all=%i" ")" " drawtime=%.0f, beginscenetime=%.0f" diff --git a/src/game.h b/src/game.h index 19b0ff7..a9db6c3 100644 --- a/src/game.h +++ b/src/game.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/gamedef.h b/src/gamedef.h index d0360f5..10ab0b0 100644 --- a/src/gamedef.h +++ b/src/gamedef.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/gettime.h b/src/gettime.h index d0d2699..b195526 100644 --- a/src/gettime.h +++ b/src/gettime.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiDeathScreen.cpp b/src/guiDeathScreen.cpp index 1ffd37e..7a84126 100644 --- a/src/guiDeathScreen.cpp +++ b/src/guiDeathScreen.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiDeathScreen.h b/src/guiDeathScreen.h index 14d76df..54cc49b 100644 --- a/src/guiDeathScreen.h +++ b/src/guiDeathScreen.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiInventoryMenu.cpp b/src/guiInventoryMenu.cpp index d84c827..f334609 100644 --- a/src/guiInventoryMenu.cpp +++ b/src/guiInventoryMenu.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiInventoryMenu.h b/src/guiInventoryMenu.h index 90f92b5..ed8df88 100644 --- a/src/guiInventoryMenu.h +++ b/src/guiInventoryMenu.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index 1921726..01f583a 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -1,5 +1,5 @@ /* - Minetest-m13 + Minetest-c55 Copyright (C) 2010-11 celeron55, Perttu Ahola Copyright (C) 2011 Ciaran Gultnieks Copyright (C) 2011 teddydestodes diff --git a/src/guiKeyChangeMenu.h b/src/guiKeyChangeMenu.h index 052b2ea..a3d8b47 100644 --- a/src/guiKeyChangeMenu.h +++ b/src/guiKeyChangeMenu.h @@ -1,5 +1,5 @@ /* - Minetest-m13 + Minetest-c55 Copyright (C) 2010-11 celeron55, Perttu Ahola Copyright (C) 2011 Ciaran Gultnieks Copyright (C) 2011 teddydestodes diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index 83e7e54..5c6104c 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiMainMenu.h b/src/guiMainMenu.h index c3df720..ba2fc6b 100644 --- a/src/guiMainMenu.h +++ b/src/guiMainMenu.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiMessageMenu.cpp b/src/guiMessageMenu.cpp index 88fb55e..ff9316b 100644 --- a/src/guiMessageMenu.cpp +++ b/src/guiMessageMenu.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiMessageMenu.h b/src/guiMessageMenu.h index 14fe41c..82c40ce 100644 --- a/src/guiMessageMenu.h +++ b/src/guiMessageMenu.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index f85b2bb..ecae55e 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -1,5 +1,5 @@ /* -Part of Minetest-m13 +Part of Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola Copyright (C) 2011 Ciaran Gultnieks diff --git a/src/guiPasswordChange.h b/src/guiPasswordChange.h index 8449ad3..1748baa 100644 --- a/src/guiPasswordChange.h +++ b/src/guiPasswordChange.h @@ -1,5 +1,5 @@ /* -Part of Minetest-m13 +Part of Minetest-c55 Copyright (C) 2010-11 celeron55, Perttu Ahola Copyright (C) 2011 Ciaran Gultnieks diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index 5468df4..3cd5723 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify @@ -166,7 +166,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) /*wchar_t text[200]; swprintf(text, 200, - L"Minetest-m13\n" + L"Minetest-c55\n" L"by Perttu Ahola\n" L"celeron55@gmail.com\n\n" SWPRINTF_CHARSTRING L"\n" diff --git a/src/guiPauseMenu.h b/src/guiPauseMenu.h index 58d2edf..64e3c71 100644 --- a/src/guiPauseMenu.h +++ b/src/guiPauseMenu.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiTextInputMenu.cpp b/src/guiTextInputMenu.cpp index 09a0227..364f699 100644 --- a/src/guiTextInputMenu.cpp +++ b/src/guiTextInputMenu.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/guiTextInputMenu.h b/src/guiTextInputMenu.h index 0aaafac..2939cf6 100644 --- a/src/guiTextInputMenu.h +++ b/src/guiTextInputMenu.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/inventory.cpp b/src/inventory.cpp index 60f2c67..056cf55 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/inventory.h b/src/inventory.h index 875454b..fcac5f6 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/inventorymanager.cpp b/src/inventorymanager.cpp index 1ca75ac..b04a1c1 100644 --- a/src/inventorymanager.cpp +++ b/src/inventorymanager.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/inventorymanager.h b/src/inventorymanager.h index fc8e016..55e8f84 100644 --- a/src/inventorymanager.h +++ b/src/inventorymanager.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/irrlichttypes.h b/src/irrlichttypes.h index 6e604ea..67c96a6 100644 --- a/src/irrlichttypes.h +++ b/src/irrlichttypes.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/itemdef.cpp b/src/itemdef.cpp index c8dbd73..aa888bb 100644 --- a/src/itemdef.cpp +++ b/src/itemdef.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola Copyright (C) 2011 Kahrl diff --git a/src/itemdef.h b/src/itemdef.h index ed01b1b..5a43259 100644 --- a/src/itemdef.h +++ b/src/itemdef.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola Copyright (C) 2011 Kahrl diff --git a/src/keycode.cpp b/src/keycode.cpp index 3d8fb80..df20230 100644 --- a/src/keycode.cpp +++ b/src/keycode.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/keycode.h b/src/keycode.h index 9f97a6e..28fb3f1 100644 --- a/src/keycode.h +++ b/src/keycode.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/light.cpp b/src/light.cpp index dff4de2..f214d6e 100644 --- a/src/light.cpp +++ b/src/light.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/light.h b/src/light.h index e18a0d4..238acce 100644 --- a/src/light.h +++ b/src/light.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/log.cpp b/src/log.cpp index deaf637..5798310 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/log.h b/src/log.h index 6c8f53f..afbce57 100644 --- a/src/log.h +++ b/src/log.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/logoutputbuffer.h b/src/logoutputbuffer.h index 149ddcd..ffbaea4 100644 --- a/src/logoutputbuffer.h +++ b/src/logoutputbuffer.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/luaentity_common.cpp b/src/luaentity_common.cpp index 3a245fa..40dc4de 100644 --- a/src/luaentity_common.cpp +++ b/src/luaentity_common.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/luaentity_common.h b/src/luaentity_common.h index 394cc74..bc2871a 100644 --- a/src/luaentity_common.h +++ b/src/luaentity_common.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/main.cpp b/src/main.cpp index 37473ee..6cb9cf9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify @@ -1480,7 +1480,7 @@ int main(int argc, char *argv[]) // (map at least?) smgr->clear(); // Reset or hide the debug gui texts - /*guitext->setText(L"Minetest-m13"); + /*guitext->setText(L"Minetest-c55"); guitext2->setVisible(false); guitext_info->setVisible(false); guitext_chat->setVisible(false);*/ diff --git a/src/main.h b/src/main.h index 1372a1b..0e353fc 100644 --- a/src/main.h +++ b/src/main.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mainmenumanager.h b/src/mainmenumanager.h index 05a6f3c..11c74d9 100644 --- a/src/mainmenumanager.h +++ b/src/mainmenumanager.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/map.cpp b/src/map.cpp index 92036af..c245242 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify @@ -44,13 +44,13 @@ with this program; if not, write to the Free Software Foundation, Inc., /* SQLite format specification: - Initially only replaces sectors/ and sectors2/ - + If map.sqlite does not exist in the save dir or the block was not found in the database the map will try to load from sectors folder. In either case, map.sqlite will be created and all future saves will save there. - + Structure of map.sqlite: Tables: blocks @@ -113,14 +113,14 @@ MapSector * Map::getSectorNoGenerateNoExNoLock(v2s16 p) MapSector * sector = m_sector_cache; return sector; } - + core::map::Node *n = m_sectors.find(p); - + if(n == NULL) return NULL; - + MapSector *sector = n->getValue(); - + // Cache the last result m_sector_cache_p = p; m_sector_cache = sector; @@ -138,7 +138,7 @@ MapSector * Map::getSectorNoGenerate(v2s16 p) MapSector *sector = getSectorNoGenerateNoEx(p); if(sector == NULL) throw InvalidPositionException(); - + return sector; } @@ -153,7 +153,7 @@ MapBlock * Map::getBlockNoCreateNoEx(v3s16 p3d) } MapBlock * Map::getBlockNoCreate(v3s16 p3d) -{ +{ MapBlock *block = getBlockNoCreateNoEx(p3d); if(block == NULL) throw InvalidPositionException(); @@ -253,10 +253,10 @@ void Map::unspreadLight(enum LightBank bank, v3s16(0,-1,0), // bottom v3s16(-1,0,0), // left }; - + if(from_nodes.size() == 0) return; - + u32 blockchangecount = 0; core::map unlighted_nodes; @@ -270,12 +270,12 @@ void Map::unspreadLight(enum LightBank bank, MapBlock *block = NULL; // Cache this a bit, too bool block_checked_in_modified = false; - + for(; j.atEnd() == false; j++) { v3s16 pos = j.getNode()->getKey(); v3s16 blockpos = getNodeBlockPos(pos); - + // Only fetch a new block if the block position has changed try{ if(block == NULL || blockpos != blockpos_last){ @@ -789,7 +789,7 @@ void Map::updateLighting(enum LightBank bank, } } - + /* Enable this to disable proper lighting for speeding up map generation for testing or whatever @@ -1003,7 +1003,7 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n, /* Add intial metadata */ - + std::string metadata_name = nodemgr->get(n).metadata_name; if(metadata_name != ""){ NodeMetadata *meta = NodeMetadata::create(metadata_name, m_gamedef); @@ -1401,10 +1401,10 @@ void Map::timerUpdate(float dtime, float unload_timeout, core::list *unloaded_blocks) { bool save_before_unloading = (mapType() == MAPTYPE_SERVER); - + // Profile modified reasons Profiler modprofiler; - + core::list sector_deletion_queue; u32 deleted_blocks_count = 0; u32 saved_blocks_count = 0; @@ -1422,14 +1422,14 @@ void Map::timerUpdate(float dtime, float unload_timeout, core::list blocks; sector->getBlocks(blocks); - + for(core::list::Iterator i = blocks.begin(); i != blocks.end(); i++) { MapBlock *block = (*i); - + block->incrementUsageTimer(dtime); - + if(block->getUsageTimer() > unload_timeout) { v3s16 p = block->getPos(); @@ -1464,10 +1464,10 @@ void Map::timerUpdate(float dtime, float unload_timeout, } } endSave(); - + // Finally delete the empty sectors deleteSectors(sector_deletion_queue); - + if(deleted_blocks_count != 0) { PrintInfo(infostream); // ServerMap/ClientMap: @@ -1521,7 +1521,7 @@ void Map::unloadUnusedData(float timeout, i != blocks.end(); i++) { MapBlock *block = (*i); - + if(block->getUsageTimer() > timeout) { // Save if modified @@ -1590,7 +1590,7 @@ void Map::transformLiquids(core::map & modified_blocks) // list of nodes that due to viscosity have not reached their max level height UniqueQueue must_reflow; - + // List of MapBlocks that will require a lighting update (due to lava) core::map lighting_modified_blocks; @@ -1675,7 +1675,7 @@ void Map::transformLiquids(core::map & modified_blocks) } break; case LIQUID_SOURCE: - // if this node is not (yet) of a liquid type, choose the first liquid type we encounter + // if this node is not (yet) of a liquid type, choose the first liquid type we encounter if (liquid_kind == CONTENT_AIR) liquid_kind = nodemgr->getId(nodemgr->get(nb.n).liquid_alternative_flowing); if (nodemgr->getId(nodemgr->get(nb.n).liquid_alternative_flowing) != liquid_kind) { @@ -2071,7 +2071,7 @@ void ServerMap::initBlockMake(mapgen::BlockMakeData *data, v3s16 blockpos) if(enable_mapgen_debug_info) infostream<<"initBlockMake(): ("<no_op = true; return; } - + data->no_op = false; data->seed = m_seed; data->blockpos = blockpos; @@ -2090,7 +2090,7 @@ void ServerMap::initBlockMake(mapgen::BlockMakeData *data, v3s16 blockpos) */ { //TimeTaker timer("initBlockMake() create area"); - + for(s16 x=-1; x<=1; x++) for(s16 z=-1; z<=1; z++) { @@ -2126,18 +2126,18 @@ void ServerMap::initBlockMake(mapgen::BlockMakeData *data, v3s16 blockpos) } } } - + /* Now we have a big empty area. Make a ManualMapVoxelManipulator that contains this and the neighboring blocks */ - + // The area that contains this block and it's neighbors v3s16 bigarea_blocks_min = blockpos - v3s16(1,1,1); v3s16 bigarea_blocks_max = blockpos + v3s16(1,1,1); - + data->vmanip = new ManualMapVoxelManipulator(this); //data->vmanip->setMap(this); @@ -2200,7 +2200,7 @@ MapBlock* ServerMap::finishBlockMake(mapgen::BlockMakeData *data, v3s16 p = data->transforming_liquid.pop_front(); m_transforming_liquid.push_back(p); } - + /* Get central block */ @@ -2278,7 +2278,7 @@ MapBlock* ServerMap::finishBlockMake(mapgen::BlockMakeData *data, }*/ #endif updateLighting(lighting_update_blocks, changed_blocks); - + /* Set lighting to non-expired state in all of them. This is cheating, but it is not fast enough if all of them @@ -2324,7 +2324,7 @@ MapBlock* ServerMap::finishBlockMake(mapgen::BlockMakeData *data, Set central block as generated */ block->setGenerated(true); - + /* Save changed parts of map NOTE: Will be saved later. @@ -2361,14 +2361,14 @@ ServerMapSector * ServerMap::createSector(v2s16 p2d) DSTACKF("%s: p2d=(%d,%d)", __FUNCTION_NAME, p2d.X, p2d.Y); - + /* Check if it exists already in memory */ ServerMapSector *sector = (ServerMapSector*)getSectorNoGenerateNoEx(p2d); if(sector != NULL) return sector; - + /* Try to load it from disk (with blocks) */ @@ -2401,9 +2401,9 @@ ServerMapSector * ServerMap::createSector(v2s16 p2d) /* Generate blank sector */ - + sector = new ServerMapSector(this, p2d, m_gamedef); - + // Sector position on map in nodes v2s16 nodepos2d = p2d * MAP_BLOCKSIZE; @@ -2411,7 +2411,7 @@ ServerMapSector * ServerMap::createSector(v2s16 p2d) Insert to container */ m_sectors.insert(p2d, sector); - + return sector; } @@ -2424,20 +2424,20 @@ MapBlock * ServerMap::generateBlock( ) { DSTACKF("%s: p=(%d,%d,%d)", __FUNCTION_NAME, p.X, p.Y, p.Z); - + /*infostream<<"generateBlock(): " <<"("<getBool("enable_mapgen_debug_info"); TimeTaker timer("generateBlock"); - + //MapBlock *block = original_dummy; - + v2s16 p2d(p.X, p.Z); v2s16 p2d_nodes = p2d * MAP_BLOCKSIZE; - + /* Do not generate over-limit */ @@ -2532,7 +2532,7 @@ MapBlock * ServerMap::createBlock(v3s16 p) { DSTACKF("%s: p=(%d,%d,%d)", __FUNCTION_NAME, p.X, p.Y, p.Z); - + /* Do not create over-limit */ @@ -2543,7 +2543,7 @@ MapBlock * ServerMap::createBlock(v3s16 p) || p.Z < -MAP_GENERATION_LIMIT / MAP_BLOCKSIZE || p.Z > MAP_GENERATION_LIMIT / MAP_BLOCKSIZE) throw InvalidPositionException("createBlock(): pos. over limit"); - + v2s16 p2d(p.X, p.Z); s16 block_y = p.Y; /* @@ -2596,7 +2596,7 @@ MapBlock * ServerMap::emergeBlock(v3s16 p, bool allow_generate) DSTACKF("%s: p=(%d,%d,%d), allow_generate=%d", __FUNCTION_NAME, p.X, p.Y, p.Z, allow_generate); - + { MapBlock *block = getBlockNoCreateNoEx(p); if(block && block->isDummy() == false) @@ -2629,7 +2629,7 @@ MapBlock * ServerMap::emergeBlock(v3s16 p, bool allow_generate) // Queue event dispatchEvent(&event); - + return block; } } @@ -2673,7 +2673,7 @@ s16 ServerMap::findGroundLevel(v2s16 p2d) /* Determine from map generator noise functions */ - + s16 level = mapgen::find_ground_level_from_noise(m_seed, p2d, 1); return level; @@ -2699,48 +2699,48 @@ void ServerMap::createDatabase() { void ServerMap::verifyDatabase() { if(m_database) return; - + { std::string dbp = m_savedir + DIR_DELIM + "map.sqlite"; bool needs_create = false; int d; - + /* Open the database connection */ - + createDirs(m_savedir); - + if(!fs::PathExists(dbp)) needs_create = true; - + d = sqlite3_open_v2(dbp.c_str(), &m_database, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL); if(d != SQLITE_OK) { infostream<<"WARNING: Database failed to open: "<getValue(); assert(sector->getId() == MAPSECTOR_SERVER); - + if(sector->differs_from_disk || save_level == MOD_STATE_CLEAN) { saveSectorMeta(sector); @@ -2879,11 +2879,11 @@ void ServerMap::save(ModifiedState save_level) core::list blocks; sector->getBlocks(blocks); core::list::Iterator j; - + for(j=blocks.begin(); j!=blocks.end(); j++) { MapBlock *block = *j; - + block_count_all++; if(block->getModified() >= save_level) @@ -2959,10 +2959,10 @@ void ServerMap::listAllLoadableBlocks(core::list &dst) errorstream<<"Map::listAllLoadableBlocks(): Result will be missing " <<"all blocks that are stored in flat files"< &dst) void ServerMap::saveMapMeta() { DSTACK(__FUNCTION_NAME); - + infostream<<"ServerMap::saveMapMeta(): " <<"seed="<getPos(); std::string dir = getSectorDir(pos); createDirs(dir); - + std::string fullpath = dir + DIR_DELIM + "meta"; std::ofstream o(fullpath.c_str(), std::ios_base::binary); if(o.good() == false) throw FileNotGoodException("Cannot open sector metafile"); sector->serialize(o, version); - + sector->differs_from_disk = false; } @@ -3093,7 +3093,7 @@ MapSector* ServerMap::loadSectorMeta(std::string sectordir, bool save_after_load if(save_after_load) saveSectorMeta(sector); } - + sector->differs_from_disk = false; return sector; @@ -3138,7 +3138,7 @@ bool ServerMap::loadSectorMeta(v2s16 p2d) { return false; } - + return true; } @@ -3182,7 +3182,7 @@ bool ServerMap::loadSectorFull(v2s16 p2d) { return false; } - + /* Load blocks */ @@ -3244,8 +3244,8 @@ void ServerMap::saveBlock(MapBlock *block) u8 version = SER_FMT_VER_HIGHEST; // Get destination v3s16 p3d = block->getPos(); - - + + #if 0 v2s16 p2d(p3d.X, p3d.Z); std::string sectordir = getSectorDir(p2d); @@ -3261,21 +3261,21 @@ void ServerMap::saveBlock(MapBlock *block) [0] u8 serialization version [1] data */ - + verifyDatabase(); - + std::ostringstream o(std::ios_base::binary); - + o.write((char*)&version, 1); - + // Write basic data block->serialize(o, version, true); - + // Write block to database - + std::string tmp = o.str(); const char *bytes = tmp.c_str(); - + if(sqlite3_bind_int64(m_database_write, 1, getBlockAsInteger(p3d)) != SQLITE_OK) infostream<<"WARNING: Block position failed to bind: "<resetModified(); } @@ -3301,12 +3301,12 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSecto std::ifstream is(fullpath.c_str(), std::ios_base::binary); if(is.good() == false) throw FileNotGoodException("Cannot open block file"); - + v3s16 p3d = getBlockPos(sectordir, blockfile); v2s16 p2d(p3d.X, p3d.Z); - + assert(sector->getPos() == p2d); - + u8 version = SER_FMT_VER_INVALID; is.read((char*)&version, 1); @@ -3329,14 +3329,14 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSecto block = sector->createBlankBlockNoInsert(p3d.Y); created_new = true; } - + // Read basic data block->deSerialize(is, version, true); // If it's a new block, insert it to the map if(created_new) sector->insertBlock(block); - + /* Save blocks loaded in old format in new format */ @@ -3344,11 +3344,11 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSecto if(version < SER_FMT_VER_HIGHEST || save_after_load) { saveBlock(block); - + // Should be in database now, so delete the old file fs::RecursiveDelete(fullpath); } - + // We just loaded it from the disk, so it's up-to-date. block->resetModified(); @@ -3373,7 +3373,7 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool try { std::istringstream is(*blob, std::ios_base::binary); - + u8 version = SER_FMT_VER_INVALID; is.read((char*)&version, 1); @@ -3396,14 +3396,14 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool block = sector->createBlankBlockNoInsert(p3d.Y); created_new = true; } - + // Read basic data block->deSerialize(is, version, true); - + // If it's a new block, insert it to the map if(created_new) sector->insertBlock(block); - + /* Save blocks loaded in old format in new format */ @@ -3412,7 +3412,7 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool // Only save if asked to; no need to update version if(save_after_load) saveBlock(block); - + // We just loaded it from, so it's up-to-date. block->resetModified(); @@ -3438,7 +3438,7 @@ MapBlock* ServerMap::loadBlock(v3s16 blockpos) if(!loadFromFolders()) { verifyDatabase(); - + if(sqlite3_bind_int64(m_database_read, 1, getBlockAsInteger(blockpos)) != SQLITE_OK) infostream<<"WARNING: Could not bind block position for load: " <(-BS*1000000,-BS*1000000,-BS*1000000, BS*1000000,BS*1000000,BS*1000000); } @@ -3562,7 +3562,7 @@ ClientMap::ClientMap( ClientMap::~ClientMap() { /*JMutexAutoLock lock(mesh_mutex); - + if(mesh != NULL) { mesh->drop(); @@ -3580,15 +3580,15 @@ MapSector * ClientMap::emergeSector(v2s16 p2d) catch(InvalidPositionException &e) { } - + // Create a sector ClientMapSector *sector = new ClientMapSector(this, p2d, m_gamedef); - + { //JMutexAutoLock lock(m_sector_mutex); // Bulk comment-out m_sectors.insert(p2d, sector); } - + return sector; } @@ -3599,7 +3599,7 @@ void ClientMap::deSerializeSector(v2s16 p2d, std::istream &is) ClientMapSector *sector = NULL; //JMutexAutoLock lock(m_sector_mutex); // Bulk comment-out - + core::map::Node *n = m_sectors.find(p2d); if(n != NULL) @@ -3668,7 +3668,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) DSTACK(__FUNCTION_NAME); bool is_transparent_pass = pass == scene::ESNRP_TRANSPARENT; - + std::string prefix; if(pass == scene::ESNRP_SOLID) prefix = "CM: solid: "; @@ -3685,7 +3685,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) /* Get time for measuring timeout. - + Measuring time is very useful for long delays when the machine is swapping a lot. */ @@ -3704,7 +3704,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) */ v3s16 cam_pos_nodes = floatToInt(camera_position, BS); - + v3s16 box_nodes_d = m_control.wanted_range * v3s16(1,1,1); v3s16 p_nodes_min = cam_pos_nodes - box_nodes_d; @@ -3720,13 +3720,13 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) p_nodes_max.X / MAP_BLOCKSIZE + 1, p_nodes_max.Y / MAP_BLOCKSIZE + 1, p_nodes_max.Z / MAP_BLOCKSIZE + 1); - + u32 vertex_count = 0; u32 meshbuffer_count = 0; - + // For limiting number of mesh updates per frame u32 mesh_update_count = 0; - + // Number of blocks in rendering range u32 blocks_in_range = 0; // Number of blocks occlusion culled @@ -3746,7 +3746,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) /* Collect a set of blocks for drawing */ - + core::map drawset; { @@ -3758,7 +3758,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) { MapSector *sector = si.getNode()->getValue(); v2s16 sp = sector->getPos(); - + if(m_control.range_all == false) { if(sp.X < p_blocks_min.X @@ -3770,13 +3770,13 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) core::list< MapBlock * > sectorblocks; sector->getBlocks(sectorblocks); - + /* Loop through blocks in sector */ u32 sector_blocks_drawn = 0; - + core::list< MapBlock * >::Iterator i; for(i=sectorblocks.begin(); i!=sectorblocks.end(); i++) { @@ -3786,7 +3786,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) Compare block position to camera position, skip if not seen on display */ - + float range = 100000 * BS; if(m_control.range_all == false) range = m_control.wanted_range * BS; @@ -3805,7 +3805,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) continue;*/ blocks_in_range++; - + #if 1 /* Update expired mesh (used for day/night change) @@ -3815,7 +3815,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) */ bool mesh_expired = false; - + { JMutexAutoLock lock(block->mesh_mutex); @@ -3831,7 +3831,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) f32 faraway = BS*50; //f32 faraway = m_control.wanted_range * BS; - + /* This has to be done with the mesh_mutex unlocked */ @@ -3840,7 +3840,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) (mesh_update_count < 3 && (d < faraway || mesh_update_count < 2) ) - || + || (m_control.range_all && mesh_update_count < 20) ) ) @@ -3894,7 +3894,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) blocks_occlusion_culled++; continue; } - + // This block is in range. Reset usage timer. block->resetUsageTimer(); @@ -3905,23 +3905,23 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) JMutexAutoLock lock(block->mesh_mutex); scene::SMesh *mesh = block->mesh; - + if(mesh == NULL){ blocks_in_range_without_mesh++; continue; } } - + // Limit block count in case of a sudden increase blocks_would_have_drawn++; if(blocks_drawn >= m_control.wanted_max_blocks && m_control.range_all == false && d > m_control.wanted_min_range * BS) continue; - + // Add to set drawset[block->getPos()] = block; - + sector_blocks_drawn++; blocks_drawn++; @@ -3931,7 +3931,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) m_last_drawn_sectors[sp] = true; } } // ScopeProfiler - + /* Draw the selected MapBlocks */ @@ -3959,7 +3959,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) } } } - + MapBlock *block = i.getNode()->getValue(); /* @@ -3970,7 +3970,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) scene::SMesh *mesh = block->mesh; assert(mesh); - + u32 c = mesh->getMeshBufferCount(); bool stuff_actually_drawn = false; for(u32 i=0; iavg("CM: blocks in range", blocks_in_range); @@ -4015,7 +4015,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) (float)blocks_in_range_without_mesh/blocks_in_range); g_profiler->avg("CM: blocks drawn", blocks_drawn); } - + g_profiler->avg(prefix+"vertices drawn", vertex_count); if(blocks_had_pass_meshbuf != 0) g_profiler->avg(prefix+"meshbuffers per block", @@ -4165,7 +4165,7 @@ void ClientMap::expireMeshes(bool only_daynight_diffed) core::list< MapBlock * > sectorblocks; sector->getBlocks(sectorblocks); - + core::list< MapBlock * >::Iterator i; for(i=sectorblocks.begin(); i!=sectorblocks.end(); i++) { @@ -4175,7 +4175,7 @@ void ClientMap::expireMeshes(bool only_daynight_diffed) { continue; } - + { JMutexAutoLock lock(block->mesh_mutex); if(block->mesh != NULL) @@ -4305,7 +4305,7 @@ void MapVoxelManipulator::emerge(VoxelArea a, s32 caller_id) n = m_loaded_blocks.find(p); if(n != NULL) continue; - + bool block_data_inexistent = false; try { @@ -4316,7 +4316,7 @@ void MapVoxelManipulator::emerge(VoxelArea a, s32 caller_id) <<" wanted area: "; a.print(infostream); infostream<getBlockNoCreate(p); if(block->isDummy()) block_data_inexistent = true; @@ -4356,12 +4356,12 @@ void MapVoxelManipulator::blitBack { if(m_area.getExtent() == v3s16(0,0,0)) return; - + //TimeTaker timer1("blitBack"); /*infostream<<"blitBack(): m_loaded_blocks.size()=" <setNode(m_area.MinEdge + p, n); block->setNode(relpos, n); - + /* Make sure block is in modified_blocks */ @@ -4444,7 +4444,7 @@ void ManualMapVoxelManipulator::initialEmerge( VoxelArea block_area_nodes (p_min*MAP_BLOCKSIZE, (p_max+1)*MAP_BLOCKSIZE-v3s16(1,1,1)); - + u32 size_MB = block_area_nodes.getVolume()*4/1000000; if(size_MB >= 1) { @@ -4465,7 +4465,7 @@ void ManualMapVoxelManipulator::initialEmerge( n = m_loaded_blocks.find(p); if(n != NULL) continue; - + bool block_data_inexistent = false; try { @@ -4506,7 +4506,7 @@ void ManualMapVoxelManipulator::blitBackAll( { if(m_area.getExtent() == v3s16(0,0,0)) return; - + /* Copy data of all blocks */ diff --git a/src/map.h b/src/map.h index 695e97b..90255c1 100644 --- a/src/map.h +++ b/src/map.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapblock.cpp b/src/mapblock.cpp index cd26d07..b436378 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapblock.h b/src/mapblock.h index 532a844..c9ff366 100644 --- a/src/mapblock.h +++ b/src/mapblock.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp index da120c3..b843448 100644 --- a/src/mapblock_mesh.cpp +++ b/src/mapblock_mesh.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapblock_mesh.h b/src/mapblock_mesh.h index 921daf2..4d3e7d2 100644 --- a/src/mapblock_mesh.h +++ b/src/mapblock_mesh.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapblock_nodemod.h b/src/mapblock_nodemod.h index 2e3eedb..4952df1 100644 --- a/src/mapblock_nodemod.h +++ b/src/mapblock_nodemod.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapchunk.h b/src/mapchunk.h index 10326f2..98df7ce 100644 --- a/src/mapchunk.h +++ b/src/mapchunk.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapgen.cpp b/src/mapgen.cpp index f2ea6eb..fe2ce13 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapgen.h b/src/mapgen.h index 70e3454..207dfda 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapnode.cpp b/src/mapnode.cpp index 369a2af..6cb9671 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapnode.h b/src/mapnode.h index 9b8ea4e..5e06660 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapsector.cpp b/src/mapsector.cpp index 340a932..9b54328 100644 --- a/src/mapsector.cpp +++ b/src/mapsector.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mapsector.h b/src/mapsector.h index 887bffa..be9243e 100644 --- a/src/mapsector.h +++ b/src/mapsector.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/materials.cpp b/src/materials.cpp index d9a95bf..c37b7c5 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/materials.h b/src/materials.h index f242dfd..058b2ab 100644 --- a/src/materials.h +++ b/src/materials.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mesh.cpp b/src/mesh.cpp index 8772249..5afb4af 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mesh.h b/src/mesh.h index f7844ac..5716623 100644 --- a/src/mesh.h +++ b/src/mesh.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/modalMenu.h b/src/modalMenu.h index 90e44aa..1f6d4d8 100644 --- a/src/modalMenu.h +++ b/src/modalMenu.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/modifiedstate.h b/src/modifiedstate.h index 730cc94..280b0e0 100644 --- a/src/modifiedstate.h +++ b/src/modifiedstate.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mods.cpp b/src/mods.cpp index 3ecf107..db878d7 100644 --- a/src/mods.cpp +++ b/src/mods.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/mods.h b/src/mods.h index c23ad94..e85ec2f 100644 --- a/src/mods.h +++ b/src/mods.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/nameidmapping.cpp b/src/nameidmapping.cpp index 4892836..0fb6632 100644 --- a/src/nameidmapping.cpp +++ b/src/nameidmapping.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/nameidmapping.h b/src/nameidmapping.h index ee2634b..238deb4 100644 --- a/src/nameidmapping.h +++ b/src/nameidmapping.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/nodedef.cpp b/src/nodedef.cpp index 5e168bd..0c2793a 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/nodedef.h b/src/nodedef.h index ee6413b..9524385 100644 --- a/src/nodedef.h +++ b/src/nodedef.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/nodemetadata.cpp b/src/nodemetadata.cpp index 82b6b39..410b4e2 100644 --- a/src/nodemetadata.cpp +++ b/src/nodemetadata.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/nodemetadata.h b/src/nodemetadata.h index 023580c..19ce80a 100644 --- a/src/nodemetadata.h +++ b/src/nodemetadata.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/noise.cpp b/src/noise.cpp index 6587c9a..9c2141c 100644 --- a/src/noise.cpp +++ b/src/noise.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/noise.h b/src/noise.h index 3c2cfa4..ed75f31 100644 --- a/src/noise.h +++ b/src/noise.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/player.cpp b/src/player.cpp index 5deaaec..688be5d 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/player.h b/src/player.h index 109033d..085a4a1 100644 --- a/src/player.h +++ b/src/player.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/porting.cpp b/src/porting.cpp index 628d789..0adc955 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/porting.h b/src/porting.h index eb5a8e6..4970a84 100644 --- a/src/porting.h +++ b/src/porting.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/profiler.h b/src/profiler.h index 8cd9693..129118e 100644 --- a/src/profiler.h +++ b/src/profiler.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/script.cpp b/src/script.cpp index 63f059f..f91b228 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/script.h b/src/script.h index 90e9d43..3bf5342 100644 --- a/src/script.h +++ b/src/script.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 60c9e3f..5d68793 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/scriptapi.h b/src/scriptapi.h index c6dfffc..500a9ab 100644 --- a/src/scriptapi.h +++ b/src/scriptapi.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/serialization.cpp b/src/serialization.cpp index 07376a3..f150d45 100644 --- a/src/serialization.cpp +++ b/src/serialization.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/serialization.h b/src/serialization.h index ba70a94..bcfea45 100644 --- a/src/serialization.h +++ b/src/serialization.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/server.cpp b/src/server.cpp index 8dc8dbd..a0c8a00 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/server.h b/src/server.h index c187d03..4fdb600 100644 --- a/src/server.h +++ b/src/server.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/servercommand.cpp b/src/servercommand.cpp index 5152fca..e2e84ba 100644 --- a/src/servercommand.cpp +++ b/src/servercommand.cpp @@ -1,5 +1,5 @@ /* -Part of Minetest-m13 +Part of Minetest-c55 Copyright (C) 2010-11 celeron55, Perttu Ahola Copyright (C) 2011 Ciaran Gultnieks diff --git a/src/servercommand.h b/src/servercommand.h index b6eb315..648a573 100644 --- a/src/servercommand.h +++ b/src/servercommand.h @@ -1,5 +1,5 @@ /* -Part of Minetest-m13 +Part of Minetest-c55 Copyright (C) 2010-11 celeron55, Perttu Ahola Copyright (C) 2011 Ciaran Gultnieks diff --git a/src/servermain.cpp b/src/servermain.cpp index 0bcec74..3ef1d94 100644 --- a/src/servermain.cpp +++ b/src/servermain.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/serverobject.cpp b/src/serverobject.cpp index 264794d..2609e30 100644 --- a/src/serverobject.cpp +++ b/src/serverobject.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/serverobject.h b/src/serverobject.h index 54ed8aa..94ceb48 100644 --- a/src/serverobject.h +++ b/src/serverobject.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/serverremoteplayer.cpp b/src/serverremoteplayer.cpp index 17c75c3..2d70020 100644 --- a/src/serverremoteplayer.cpp +++ b/src/serverremoteplayer.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/serverremoteplayer.h b/src/serverremoteplayer.h index 50aa0a0..9d94376 100644 --- a/src/serverremoteplayer.h +++ b/src/serverremoteplayer.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/settings.h b/src/settings.h index 6883cce..4bc22ea 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/socket.cpp b/src/socket.cpp index 2eb1e78..6d48178 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/socket.h b/src/socket.h index ccb023f..74b5fb6 100644 --- a/src/socket.h +++ b/src/socket.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/staticobject.h b/src/staticobject.h index 80b5f1d..c3369af 100644 --- a/src/staticobject.h +++ b/src/staticobject.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/strfnd.h b/src/strfnd.h index 5821559..049ae0b 100644 --- a/src/strfnd.h +++ b/src/strfnd.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/test.cpp b/src/test.cpp index 3c73418..23113b1 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/test.h b/src/test.h index f45043b..6c97d10 100644 --- a/src/test.h +++ b/src/test.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/threads.h b/src/threads.h index c233859..1ea7d0a 100644 --- a/src/threads.h +++ b/src/threads.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/tile.cpp b/src/tile.cpp index 398fab1..bc4c49c 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/tile.h b/src/tile.h index 38292d2..c0d8914 100644 --- a/src/tile.h +++ b/src/tile.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/utility.cpp b/src/utility.cpp index 6d90c7b..06b6088 100644 --- a/src/utility.cpp +++ b/src/utility.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/utility.h b/src/utility.h index 8515c17..50f27c1 100644 --- a/src/utility.h +++ b/src/utility.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/voxel.cpp b/src/voxel.cpp index f0ac980..bd06be8 100644 --- a/src/voxel.cpp +++ b/src/voxel.cpp @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/src/voxel.h b/src/voxel.h index f5a6bac..46864e0 100644 --- a/src/voxel.h +++ b/src/voxel.h @@ -1,5 +1,5 @@ /* -Minetest-m13 +Minetest-c55 Copyright (C) 2010 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify diff --git a/util/wireshark/minetest.lua b/util/wireshark/minetest.lua index c38ebb6..de3e842 100644 --- a/util/wireshark/minetest.lua +++ b/util/wireshark/minetest.lua @@ -4,7 +4,7 @@ -- --- Minetest-m13 +-- Minetest-c55 -- Copyright (C) 2011 celeron55, Perttu Ahola -- -- This program is free software; you can redistribute it and/or modify -- 2.44.0