From 051e7d1c58f0a62de840a8ba04a358426a9cb429 Mon Sep 17 00:00:00 2001 From: MoNTE48 Date: Sat, 4 May 2019 22:47:33 +0200 Subject: [PATCH] WIP --- games/default/files/default/init.lua | 8 +++- games/default/files/dropondie/README.md | 3 -- games/default/files/dropondie/depends.txt | 1 - games/default/files/dropondie/init.lua | 10 +--- .../files/{item_drop => drops}/License.txt | 0 games/default/files/drops/README.txt | 10 ++++ .../files/{item_drop => drops}/init.lua | 11 ++--- .../sounds/item_drop_pickup.1.ogg | Bin .../sounds/item_drop_pickup.2.ogg | Bin .../sounds/item_drop_pickup.3.ogg | Bin .../sounds/item_drop_pickup.4.ogg | Bin .../default/files/give_initial_stuff/init.lua | 5 -- games/default/files/item_drop/README.txt | 43 ------------------ src/CMakeLists.txt | 2 +- src/map.cpp | 2 + src/serverenvironment.cpp | 6 ++- 16 files changed, 30 insertions(+), 71 deletions(-) delete mode 100644 games/default/files/dropondie/README.md delete mode 100644 games/default/files/dropondie/depends.txt rename games/default/files/{item_drop => drops}/License.txt (100%) create mode 100644 games/default/files/drops/README.txt rename games/default/files/{item_drop => drops}/init.lua (90%) rename games/default/files/{item_drop => drops}/sounds/item_drop_pickup.1.ogg (100%) rename games/default/files/{item_drop => drops}/sounds/item_drop_pickup.2.ogg (100%) rename games/default/files/{item_drop => drops}/sounds/item_drop_pickup.3.ogg (100%) rename games/default/files/{item_drop => drops}/sounds/item_drop_pickup.4.ogg (100%) delete mode 100644 games/default/files/give_initial_stuff/init.lua delete mode 100644 games/default/files/item_drop/README.txt diff --git a/games/default/files/default/init.lua b/games/default/files/default/init.lua index 3938b4edb..d346f4a55 100644 --- a/games/default/files/default/init.lua +++ b/games/default/files/default/init.lua @@ -19,4 +19,10 @@ dofile(minetest.get_modpath("default").."/player.lua") dofile(minetest.get_modpath("default").."/trees.lua") dofile(minetest.get_modpath("default").."/aliases.lua") dofile(minetest.get_modpath("default").."/furnace.lua") -dofile(minetest.get_modpath("default").."/workbench.lua") \ No newline at end of file +dofile(minetest.get_modpath("default").."/workbench.lua") + +minetest.register_on_newplayer(function (player) + player:get_inventory():add_item('main', 'default:sword_steel') + player:get_inventory():add_item('main', 'default:torch 8') + player:get_inventory():add_item('main', 'default:wood 64') +end) \ No newline at end of file diff --git a/games/default/files/dropondie/README.md b/games/default/files/dropondie/README.md deleted file mode 100644 index 8874bc390..000000000 --- a/games/default/files/dropondie/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Minetest DroponDie Mod - -Drops contents of inventory and crafting grid when player dies diff --git a/games/default/files/dropondie/depends.txt b/games/default/files/dropondie/depends.txt deleted file mode 100644 index 331d858ce..000000000 --- a/games/default/files/dropondie/depends.txt +++ /dev/null @@ -1 +0,0 @@ -default \ No newline at end of file diff --git a/games/default/files/dropondie/init.lua b/games/default/files/dropondie/init.lua index ee04f4510..5d458df95 100644 --- a/games/default/files/dropondie/init.lua +++ b/games/default/files/dropondie/init.lua @@ -1,13 +1,5 @@ -local remi = minetest.setting_getbool("remove_items") or false -local crea = minetest.setting_getbool("creative_mode") - local drop = function(pos, itemstack) - -- is remove_items enabled? - if remi == true then - return - end - local obj = core.add_item(pos, itemstack:take_item(itemstack:get_count())) if obj then @@ -24,7 +16,7 @@ end minetest.register_on_dieplayer(function(player) -- are we in creative? - if crea then + if minetest.setting_getbool("creative_mode") then return end diff --git a/games/default/files/item_drop/License.txt b/games/default/files/drops/License.txt similarity index 100% rename from games/default/files/item_drop/License.txt rename to games/default/files/drops/License.txt diff --git a/games/default/files/drops/README.txt b/games/default/files/drops/README.txt new file mode 100644 index 000000000..71475177f --- /dev/null +++ b/games/default/files/drops/README.txt @@ -0,0 +1,10 @@ +MultiCraft Drops mod. +by PilzAdam +modified by Jordan4ibanez + +Introduction: +This mod adds drop/pick up of items. + +License: +Sourcecode: WTFP +Sound: WTFPL diff --git a/games/default/files/item_drop/init.lua b/games/default/files/drops/init.lua similarity index 90% rename from games/default/files/item_drop/init.lua rename to games/default/files/drops/init.lua index c2f868263..70fd7aa91 100644 --- a/games/default/files/item_drop/init.lua +++ b/games/default/files/drops/init.lua @@ -1,7 +1,6 @@ -local age = 1 --how old an item has to be before collecting -local radius_magnet = 2.5 --radius of item magnet -local player_collect_height = 1.3 --added to their pos y value -local adjuster_collect = 0.01 --Delay before collecting to visualize moveme +local age = 1 --How old an item has to be before collecting +local radius_magnet = 2 --Radius of item magnet +local player_collect_height = 1.3 --Added to their pos y value --Item collection minetest.register_globalstep(function(dtime) @@ -17,7 +16,7 @@ minetest.register_globalstep(function(dtime) if object:get_luaentity().age > age then if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then --collect - if object:get_luaentity().collectioner == true and object:get_luaentity().age > age and object:get_luaentity().age > object:get_luaentity().age_stamp + adjuster_collect then + if object:get_luaentity().collectioner == true and object:get_luaentity().age > age and object:get_luaentity().age > object:get_luaentity().age_stamp then if object:get_luaentity().itemstring ~= "" then inv:add_item("main", ItemStack(object:get_luaentity().itemstring)) minetest.sound_play("item_drop_pickup", { @@ -65,7 +64,7 @@ if minetest.setting_getbool("creative_mode") == false then local obj = minetest.add_item(pos, name) if obj ~= nil then obj:get_luaentity().collect = true - obj:get_luaentity().age = age + obj:get_luaentity().age = age obj:setvelocity({x=math.random(-3,3), y=math.random(2,5), z=math.random(-3,3)}) end end diff --git a/games/default/files/item_drop/sounds/item_drop_pickup.1.ogg b/games/default/files/drops/sounds/item_drop_pickup.1.ogg similarity index 100% rename from games/default/files/item_drop/sounds/item_drop_pickup.1.ogg rename to games/default/files/drops/sounds/item_drop_pickup.1.ogg diff --git a/games/default/files/item_drop/sounds/item_drop_pickup.2.ogg b/games/default/files/drops/sounds/item_drop_pickup.2.ogg similarity index 100% rename from games/default/files/item_drop/sounds/item_drop_pickup.2.ogg rename to games/default/files/drops/sounds/item_drop_pickup.2.ogg diff --git a/games/default/files/item_drop/sounds/item_drop_pickup.3.ogg b/games/default/files/drops/sounds/item_drop_pickup.3.ogg similarity index 100% rename from games/default/files/item_drop/sounds/item_drop_pickup.3.ogg rename to games/default/files/drops/sounds/item_drop_pickup.3.ogg diff --git a/games/default/files/item_drop/sounds/item_drop_pickup.4.ogg b/games/default/files/drops/sounds/item_drop_pickup.4.ogg similarity index 100% rename from games/default/files/item_drop/sounds/item_drop_pickup.4.ogg rename to games/default/files/drops/sounds/item_drop_pickup.4.ogg diff --git a/games/default/files/give_initial_stuff/init.lua b/games/default/files/give_initial_stuff/init.lua deleted file mode 100644 index 4330a8be6..000000000 --- a/games/default/files/give_initial_stuff/init.lua +++ /dev/null @@ -1,5 +0,0 @@ -minetest.register_on_newplayer(function (player) - player:get_inventory():add_item('main', 'default:sword_steel') - player:get_inventory():add_item('main', 'default:torch 8') - player:get_inventory():add_item('main', 'default:wood 64') - end) \ No newline at end of file diff --git a/games/default/files/item_drop/README.txt b/games/default/files/item_drop/README.txt deleted file mode 100644 index 871cbc4d1..000000000 --- a/games/default/files/item_drop/README.txt +++ /dev/null @@ -1,43 +0,0 @@ -===ITEM_DROP MOD Reloaded for MINETEST-C55=== -by PilzAdam -modified by Jordan4ibanez - -Introduction: -This mod adds Minecraft like drop/pick up of items to Minetest. - -How to install: -Unzip the archive an place it in minetest-base-directory/mods/minetest/ -if you have a windows client or a linux run-in-place client. If you have -a linux system-wide instalation place it in ~/.minetest/mods/minetest/. -If you want to install this mod only in one world create the folder -worldmods/ in your worlddirectory. -For further information or help see: -http://wiki.minetest.com/wiki/Installing_Mods - -How to use the mod: -Just install it an everything works. - -For developers: -You dont have to use get_drops() anymore because of changes in the -builtin files of minetest. - -License: -Sourcecode: WTFPL (see below) -Sound: WTFPL (see below) - -See also: -http://minetest.net/ - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (C) 2004 Sam Hocevar - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e1f0ed159..de22b0e67 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -383,7 +383,6 @@ set(common_SRCS database-leveldb.cpp database-postgresql.cpp database-redis.cpp - database-sqlite3.cpp database.cpp debug.cpp defaultsettings.cpp @@ -463,6 +462,7 @@ set(common_SRCS # This gives us the icon and file version information if(WIN32) + set(common_SRCS ${common_SRCS} database-sqlite3.cpp) set(WINRESOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../misc/winresource.rc") set(MINETEST_EXE_MANIFEST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../misc/minetest.exe.manifest") if(MINGW) diff --git a/src/map.cpp b/src/map.cpp index 6020a21ca..9920f0002 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2290,8 +2290,10 @@ MapDatabase *ServerMap::createDatabase( const std::string &savedir, Settings &conf) { + #ifdef _WIN32 if (name == "sqlite3") return new MapDatabaseSQLite3(savedir); + #endif if (name == "dummy") return new Database_Dummy(); #if USE_LEVELDB diff --git a/src/serverenvironment.cpp b/src/serverenvironment.cpp index 99d5dbc12..20736cd27 100644 --- a/src/serverenvironment.cpp +++ b/src/serverenvironment.cpp @@ -2170,10 +2170,12 @@ bool ServerEnvironment::saveStaticToBlock( PlayerDatabase *ServerEnvironment::openPlayerDatabase(const std::string &name, const std::string &savedir, const Settings &conf) { - +#ifdef _WIN32 if (name == "sqlite3") return new PlayerDatabaseSQLite3(savedir); - else if (name == "dummy") + else +#endif + if (name == "dummy") return new Database_Dummy(); #if USE_POSTGRESQL else if (name == "postgresql") {