Compare commits

...

2 Commits

Author SHA1 Message Date
mckaygerhard 8be7726147 vessels - xdecor - integrates vessels into xdecor to minimize it 2023-08-07 12:19:27 -04:00
mckaygerhard 35829d7ca6 default - is_area_protected was renamed from intersects_protection
* backported for working able, renaming compatible function,
  https://github.com/minetest/minetest/pull/7073/files#diff-910f021741edbae068c5577bfc681853791aa6dce900b35305972bf5e24941e5R178
  for engines that already has it enabled, if not just use
  old way function, this backported and enabled
  66372e75d9
  from default game and also from newer engines build-in lua files
* provide both cases based on engine version, newer just call
  the is_area_protected and older just have the code improved,
  with aliasing to the improved code.
2023-08-06 10:09:56 -04:00
22 changed files with 81 additions and 100 deletions

View File

@ -1,5 +1,8 @@
-- mods/default/functions.lua
-- Check for a volume intersecting protection
local is_50 = minetest.has_feature("object_use_texture_alpha") or nil
--
-- Sounds
--
@ -482,25 +485,32 @@ minetest.register_abm({
--
-- Checks if specified volume intersects a protected volume
-- Checks if specified volume intersects a protected volume, return first node intersected in protected area by player
--
function default.intersects_protection(minp, maxp, player_name, interval)
-- 'interval' is the largest allowed interval for the 3D lattice of checks
-- but newer engines returned first node that intersect area protected or false
if is_50 then
return minetest.is_area_protected(minp, maxp, player_name, interval)
else
-- Compute the optimal float step 'd' for each axis so that all corners and
-- borders are checked. 'd' will be smaller or equal to 'interval'.
-- Subtracting 1e-4 ensures that the max co-ordinate will be reached by the
-- for loop (which might otherwise not be the case due to rounding errors).
local d = {}
for _, c in pairs({"x", "y", "z"}) do
if minp[c] > maxp[c] then
local tmp = maxp[c]
maxp[c] = minp[c]
minp[c] = tmp -- Repair positions: 'minp' > 'maxp'
end
if maxp[c] > minp[c] then
d[c] = (maxp[c] - minp[c]) / math.ceil((maxp[c] - minp[c]) / interval) - 1e-4
elseif maxp[c] == minp[c] then
else
d[c] = 1 -- Any value larger than 0 to avoid division by zero
else -- maxp[c] < minp[c], print error and treat as protection intersected
minetest.log("error", "maxp < minp in 'default.intersects_protection()'")
return true
end
end
@ -510,14 +520,23 @@ function default.intersects_protection(minp, maxp, player_name, interval)
local y = math.floor(yf + 0.5)
for xf = minp.x, maxp.x, d.x do
local x = math.floor(xf + 0.5)
if minetest.is_protected({x = x, y = y, z = z}, player_name) then
return true
local pos = {x = x, y = y, z = z}
if core.is_protected(pos, player_name) then
return pos
end
end
end
end
return false
end
end
if not is_50 then
-- older engines backguar compatibility
minetest.is_area_protected = default.intersects_protection
end

View File

@ -1,3 +1,4 @@
default
vessels
vessels?
xdecor?
ethereal?

View File

@ -1,4 +1,4 @@
name = fireflies
description = Adds fireflies which can be caught in a net and placed in bottles for lighting.
depends = default, vessels
optional_depends = ethereal
depends = default
optional_depends = ethereal, vessels, xdecor

View File

@ -110,7 +110,7 @@ if minetest.get_modpath("mushroom") ~= nil then
hbhunger.register_food("mushroom:brown", 1)
hbhunger.register_food("mushroom:red", 1, "", 3)
-- mushroom potions: red = strong poison, brown = light restorative
if minetest.get_modpath("vessels") then
if minetest.get_modpath("vessels") or minetest.get_modpath("xdecor") then
hbhunger.register_food("mushroom:brown_essence", 1, "vessels:glass_bottle", nil, 4)
hbhunger.register_food("mushroom:poison", 1, "vessels:glass_bottle", 10)
end
@ -253,7 +253,7 @@ if minetest.get_modpath("farming") and farming.mod == "redo" then
hbhunger.register_food("farming:raspberries", 1)
hbhunger.register_food("farming:blueberries", 1)
hbhunger.register_food("farming:muffin_blueberry", 4)
if minetest.get_modpath("vessels") then
if minetest.get_modpath("vessels") or minetest.get_modpath("xdecor") then
hbhunger.register_food("farming:smoothie_raspberry", 2, "vessels:drinking_glass")
end
hbhunger.register_food("farming:rhubarb", 1)

View File

@ -1,22 +0,0 @@
Minetest Game mod: vessels
==========================
See license.txt for license information.
Authors of source code
----------------------
Originally by Vanessa Ezekowitz (LGPL 2.1)
Modified by Perttu Ahola <celeron55@gmail.com> (LGPL 2.1)
Various Minetest developers and contributors (LGPL 2.1)
Authors of media (textures)
---------------------------
All not listed below, Vanessa Ezekowitz (CC BY-SA 3.0)
The following textures were modified by Thomas-S (CC BY-SA 3.0):
vessels_drinking_glass.png
vessels_drinking_glass_inv.png
vessels_glass_bottle.png
vessels_steel_bottle.png
The following texture was created by Wuzzy (CC BY-SA 3.0):
vessels_shelf_slot.png (based on vessels_glass_bottle.png)

View File

@ -1 +0,0 @@
default

View File

@ -1,52 +0,0 @@
License of source code
----------------------
GNU Lesser General Public License, version 2.1
Copyright (C) 2012-2016 Vanessa Ezekowitz
Copyright (C) 2012-2016 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2012-2016 Various Minetest developers and contributors
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU Lesser General Public License as published by the Free Software Foundation;
either version 2.1 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 Lesser General Public License for more details:
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
Licenses of media (textures)
----------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2012-2016 Vanessa Ezekowitz
Copyright (C) 2016 Thomas-S
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 B

View File

@ -6,7 +6,7 @@ Decoration lightweight alternative to HomeDecor
Information
-----------
This mod add cute cubes to decoration and minimal set of "moreblock" (some elements of picture may not be available)
This mod add cute cubes to decoration and minimal set of "moreblock" (some elements of picture may not be available), it also integrates vessels into
![](screenshot.png)
@ -14,7 +14,7 @@ This mod add cute cubes to decoration and minimal set of "moreblock" (some eleme
Tech information
----------------
This mod is forked more reduced version, more focused on speed over media.
This mod is forked more reduced version, more focused on speed over media. It integrates vessels into and autodetect if a more complete vessels mod its present!
#### Dependencies
@ -93,6 +93,12 @@ Optional:
| xdecor:rope | Rope |
| xdecor:hammer | Hammer, use it on workbench |
| xdecor:workbench | Work Bench, to reapir tools |
| vessels:shelf | Vessels Shelf to store anything |
| vessels:glass_bottle | Empty Glass Bottle |
| vessels:drinking_glass | Empty Drinking Glass |
| vessels:steel_bottle | Empty Heavy Steel Bottle |
| vessels:glass_fragments | Glass Fragments |
#### Crafts
@ -201,9 +207,6 @@ xdecor:rope 1
{"farming:string"}
```
xdecor:hammer 1
```
@ -236,6 +239,36 @@ xdecor:potted_<xxx>
{"", "default:clay_brick", ""}
```
vessels:shelf
```
{"group:wood", "group:wood", "group:wood"},
{"group:vessel", "group:vessel", "group:vessel"},
```
vessels:glass_bottle 10
```
{"default:glass", "", "default:glass"},
{"default:glass", "", "default:glass"},
```
vessels:drinking_glass 14
```
{"default:glass", "", "default:glass"},
{"default:glass", "", "default:glass"},
```
vessels:steel_bottle 5
```
{"default:steel_ingot", "", "default:steel_ingot"},
{"default:steel_ingot", "", "default:steel_ingot"},
```
### Credits ###
Gambit makes the textures from the PixelBOX pack for Minetest.

View File

@ -53,6 +53,10 @@ local subpart = {
"workbench",
}
if not minetest.get_modpath("vessels") then
table.insert(subpart, "vessels")
end
for _, name in ipairs(subpart) do
local enable = minetest.settings:get_bool("enable_xdecor_" .. name)
if enable or enable == nil then

View File

@ -1,5 +1,4 @@
-- Minetest 0.4 mod: vessels
-- See README.txt for licensing and other information.
-- Minetest 0.4 mod: vessels integrated
local vessels_shelf_formspec =
"size[8,7;]" ..
@ -32,7 +31,7 @@ local function get_vessels_shelf_formspec(inv)
return formspec
end
minetest.register_node("vessels:shelf", {
minetest.register_node(":vessels:shelf", {
description = "Vessels Shelf",
tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
"default_wood.png", "vessels_shelf.png", "vessels_shelf.png"},
@ -93,7 +92,7 @@ minetest.register_craft({
}
})
minetest.register_node("vessels:glass_bottle", {
minetest.register_node(":vessels:glass_bottle", {
description = "Empty Glass Bottle",
drawtype = "plantlike",
tiles = {"vessels_glass_bottle.png"},
@ -119,7 +118,7 @@ minetest.register_craft( {
}
})
minetest.register_node("vessels:drinking_glass", {
minetest.register_node(":vessels:drinking_glass", {
description = "Empty Drinking Glass",
drawtype = "plantlike",
tiles = {"vessels_drinking_glass.png"},
@ -145,7 +144,7 @@ minetest.register_craft( {
}
})
minetest.register_node("vessels:steel_bottle", {
minetest.register_node(":vessels:steel_bottle", {
description = "Empty Heavy Steel Bottle",
drawtype = "plantlike",
tiles = {"vessels_steel_bottle.png"},
@ -174,7 +173,7 @@ minetest.register_craft( {
-- Glass and steel recycling
minetest.register_craftitem("vessels:glass_fragments", {
minetest.register_craftitem(":vessels:glass_fragments", {
description = "Glass Fragments",
inventory_image = "vessels_glass_fragments.png",
})

View File

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

View File

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B