From 793d40cd1149a30130e30dae4fd8013c40e0d60b Mon Sep 17 00:00:00 2001 From: ROllerozxa Date: Wed, 21 Jun 2023 20:05:06 +0200 Subject: [PATCH] Initial Commit --- LICENSE | 21 +++++++++++++++++++++ README.md | 2 ++ init.lua | 18 ++++++++++++++++++ mod.conf | 3 +++ textures/get_biome_data_wand.png | Bin 0 -> 124 bytes 5 files changed, 44 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 init.lua create mode 100644 mod.conf create mode 100644 textures/get_biome_data_wand.png diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b65dc0a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 ROllerozxa + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..04566b2 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Get Biome Data +Get the biome data available from minetest.get_biome_data() at a given node's position, using the Biome Data Wand (itemstring `get_biome_data:wand`) diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..062c1e2 --- /dev/null +++ b/init.lua @@ -0,0 +1,18 @@ + +minetest.register_craftitem("get_biome_data:wand", { + description = "Biome Data Wand\n(right-click to get biome data in node's position)", + inventory_image = "get_biome_data_wand.png", + groups = {tool = 1}, + on_place = function(itemstack, player, pointed_thing) + local biomedata = minetest.get_biome_data(pointed_thing.under) + + local str = + minetest.colorize("#aaa", "Biome: ") + .. minetest.colorize("#0f0", minetest.get_biome_name(biomedata.biome)) + .. " ( heat: " .. minetest.colorize("#f00", biomedata.heat) .. ", humidity: " .. minetest.colorize("#55f", biomedata.humidity) .. ")" + + minetest.chat_send_player(player:get_player_name(), str) + + return itemstack + end, +}) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..f7a9b72 --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = get_biome_data +title = Get Biome Data +description = Get the biome data available from minetest.get_biome_data() at a given node's position. diff --git a/textures/get_biome_data_wand.png b/textures/get_biome_data_wand.png new file mode 100644 index 0000000000000000000000000000000000000000..c4fffbc6cfa44da2345cc960e25acb9658e80588 GIT binary patch literal 124 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9JOMr-u0UG8Q`AKuE6tgKW8arl zAfK@$$S;_|;n|HeAV<#A#W92