up to date to minenux gameid mods stable-4.0 version 4.0.17.4

* this cherry pícked from comit
  at 6861a44b60
* 74702c6ada
    * Carts: Replace old, deprecated function names mods/carts/cart_entity.lua
* Mushroom spread: make overridable and reduce spread
    * Move mushroom spread ABM action into a global and overridable function.
      but do not optimise spread code mods/flowers/init.lua
    * backported bcf98df5fac3eb59b02d9fdb066ab92c6228d787
    * Reduce spread range to reduce spread through walls.
* 657f7cee6e
  set art and game default, use minenux name and logo venenux
    * backported d5cc8c46f6
    * Flowers: More flowers
    * now we are into minenux so minetest4 stable-4.0 branch for engine
* 95e70da3a6
  Default: Increase the maximum level of the diamond axe to 3
    * backported https://github.com/minetest/minetest_game/pull/1854
    * This is the maximum level of the other diamond tools and makes the
      number of uses similar to them at mods/default/tools.lua
    * fixed https://github.com/minetest/minetest_game/issues/1456
      Diamond axe breaks earlier than mese axe
* 535204298e
    * Farming: Make cotton look like cotton, add crafted string item
    * Remove string -> cotton alias.
    * mods/farming/README.txt, mods/farming/init.lua,
      mods/farming/textures/farming_cotton.png, mods/farming/textures/farming_string.png
* 2b6de659cb
  Floatland biomes: Add ocean biomes to fix missing sandstone
    * Update biome lists for blob ores mods/default/mapgen.lua
    * backported bdc09d2313e5734400d2283549c4906d77a546d0
* e07ad71d11
  aa7f6cd060
  4a1fc02e82
  Make sapling, leaves and fence descriptions consistent
  Descriptions: Make capitalization consistent also in
  Improve node descriptions for most default items and nodes
    * backported https://github.com/minetest/minetest_game/pull/1834
    * addressed consistency issues previously discussed in:
    * https://github.com/minetest/minetest_game/issues/1473
      Bad item descriptions: Too generic descriptions among specific descriptions
      also cos has a strong tendency towards mixing generic item names
    * https://github.com/minetest/minetest_game/issues/1817
      Add tree species to descriptions for appletree and jungletree
      No change to node technical names though. Normal wood is obviously an appletree
    * mods/default/nodes.lua, mods/doors/init.lua, mods/flowers/init.lua,
      mods/vessels/init.lua, mods/default/nodes.lua, mods/doors/init.lua,
      mods/flowers/init.lua, mods/carts/rails.lua, mods/dye/init.lua,
      mods/farming/init.lua and mods/xpanes/init.lua
    * backported https://github.com/minetest/minetest_game/pull/1795
* fb610ffa59
  Allow mossy cobble slabs to combine  mods/stairs/init.lua
    * backported https://github.com/minetest/minetest_game/pull/1791
    * fixed https://github.com/minetest/minetest_game/issues/1790
* d37c1d2312
    * Creative: Do not give creative priv to admin mods/creative/init.lua
* https://codeberg.org/minenux/minetest-game-minetest/commit/commit fea78bdf541e6106408018441937d77d163963e5
    * Creative: Add 'creative' privilege for survival servers
    * This adds a 'creative' privilege to survival servers which OPs can bestow
      on admin or competent builders to give access to the creative inventory.
    * backported from 0157175346f9af8cf9ea5ffeb5f3d91fa474d044
This commit is contained in:
mckaygerhard 2021-12-12 20:39:01 -06:00
parent 6861a44b60
commit 66952a26ac
7 changed files with 69 additions and 26 deletions

View File

@ -57,8 +57,8 @@ function cart_entity:get_staticdata()
end
function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, direction)
local pos = self.object:getpos()
local vel = self.object:getvelocity()
local pos = self.object:get_pos()
local vel = self.object:get_velocity()
if not self.railtype or vector.equals(vel, {x=0, y=0, z=0}) then
local node = minetest.get_node(pos).name
self.railtype = minetest.get_item_group(node, "connect_to_raillike")
@ -81,7 +81,7 @@ function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities,
-- Detach driver and items
if self.driver then
if self.old_pos then
self.object:setpos(self.old_pos)
self.object:set_pos(self.old_pos)
end
local player = minetest.get_player_by_name(self.driver)
carts:manage_attachment(player, nil)
@ -99,7 +99,7 @@ function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities,
local leftover = inv:add_item("main", "carts:cart")
-- If no room in inventory add a replacement cart to the world
if not leftover:is_empty() then
minetest.add_item(self.object:getpos(), leftover)
minetest.add_item(self.object:get_pos(), leftover)
end
end
self.object:remove()
@ -152,7 +152,7 @@ local function rail_sound(self, dtime)
self.sound_handle = nil
minetest.after(0.2, minetest.sound_stop, handle)
end
local vel = self.object:getvelocity()
local vel = self.object:get_velocity()
local speed = vector.length(vel)
if speed > 0 then
self.sound_handle = minetest.sound_play(
@ -170,16 +170,16 @@ local function get_railparams(pos)
end
local function rail_on_step(self, dtime)
local vel = self.object:getvelocity()
local vel = self.object:get_velocity()
if self.punched then
vel = vector.add(vel, self.velocity)
self.object:setvelocity(vel)
self.object:set_velocity(vel)
self.old_dir.y = 0
elseif vector.equals(vel, {x=0, y=0, z=0}) then
return
end
local pos = self.object:getpos()
local pos = self.object:get_pos()
local update = {}
-- stop cart if velocity vector flips
@ -187,8 +187,8 @@ local function rail_on_step(self, dtime)
(self.old_vel.x * vel.x < 0 or self.old_vel.z * vel.z < 0) then
self.old_vel = {x = 0, y = 0, z = 0}
self.old_pos = pos
self.object:setvelocity(vector.new())
self.object:setacceleration(vector.new())
self.object:set_velocity(vector.new())
self.object:set_acceleration(vector.new())
rail_on_step_event(get_railparams(pos).on_step, self, dtime)
return
end
@ -294,7 +294,7 @@ local function rail_on_step(self, dtime)
end
end
self.object:setacceleration(new_acc)
self.object:set_acceleration(new_acc)
self.old_pos = vector.new(pos)
if not vector.equals(dir, {x=0, y=0, z=0}) then
self.old_dir = vector.new(dir)
@ -342,9 +342,9 @@ local function rail_on_step(self, dtime)
end
self.object:set_animation(anim, 1, 0)
self.object:setvelocity(vel)
self.object:set_velocity(vel)
if update.pos then
self.object:setpos(pos)
self.object:set_pos(pos)
end
-- call event handler

View File

@ -2,7 +2,8 @@ creative = {}
minetest.register_privilege("creative", {
description = "Allow player to use creative inventory",
give_to_singleplayer = false
give_to_singleplayer = false,
give_to_admin = false
})
local creative_mode_cache = minetest.settings:get_bool("creative_mode")

View File

@ -35,3 +35,6 @@ Created by Gambit (CC BY 3.0):
farming_flour.png
farming_cotton_seed.png
farming_wheat_seed.png
Created by Napiophelios (CC BY-SA 3.0):
farming_cotton.png

View File

@ -1,13 +1,18 @@
-- Global farming namespace
farming = {}
farming.path = minetest.get_modpath("farming")
-- Load files
dofile(farming.path .. "/api.lua")
dofile(farming.path .. "/nodes.lua")
dofile(farming.path .. "/hoes.lua")
-- WHEAT
farming.register_plant("farming:wheat", {
description = "Wheat Seed",
paramtype2 = "meshoptions",
@ -19,6 +24,7 @@ farming.register_plant("farming:wheat", {
groups = {flammable = 4},
place_param2 = 3,
})
minetest.register_craftitem("farming:flour", {
description = "Flour",
inventory_image = "farming_flour.png",
@ -45,7 +51,9 @@ minetest.register_craft({
recipe = "farming:flour"
})
-- Cotton
farming.register_plant("farming:cotton", {
description = "Cotton Seed",
inventory_image = "farming_cotton_seed.png",
@ -56,7 +64,11 @@ farming.register_plant("farming:cotton", {
groups = {flammable = 4},
})
minetest.register_alias("farming:string", "farming:cotton")
minetest.register_craftitem("farming:string", {
description = "String",
inventory_image = "farming_string.png",
groups = {flammable = 2},
})
minetest.register_craft({
output = "wool:white",
@ -66,7 +78,17 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "farming:string 2",
recipe = {
{"farming:cotton"},
{"farming:cotton"},
}
})
-- Straw
minetest.register_craft({
output = "farming:straw 3",
recipe = {
@ -83,7 +105,9 @@ minetest.register_craft({
}
})
-- Fuels
minetest.register_craft({
type = "fuel",
recipe = "farming:straw",
@ -102,6 +126,12 @@ minetest.register_craft({
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "farming:string",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "farming:hoe_wood",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

View File

@ -214,19 +214,28 @@ function flowers.mushroom_spread(pos, node)
minetest.remove_node(pos)
return
end
local positions = minetest.find_nodes_in_area_under_air(
{x = pos.x - 1, y = pos.y - 2, z = pos.z - 1},
{x = pos.x + 1, y = pos.y + 1, z = pos.z + 1},
{"group:soil", "group:tree"})
if #positions == 0 then
local random = {
x = pos.x + math.random(-2, 2),
y = pos.y + math.random(-1, 1),
z = pos.z + math.random(-2, 2)
}
local random_node = minetest.get_node_or_nil(random)
if not random_node or random_node.name ~= "air" then
return
end
local pos2 = positions[math.random(#positions)]
pos2.y = pos2.y + 1
if minetest.get_node_light(pos, 0.5) <= 3 and
minetest.get_node_light(pos2, 0.5) <= 3 then
minetest.set_node(pos2, {name = node.name})
local node_under = minetest.get_node_or_nil({x = random.x,
y = random.y - 1, z = random.z})
if not node_under then
return
end
if (minetest.get_item_group(node_under.name, "soil") ~= 0 or
minetest.get_item_group(node_under.name, "tree") ~= 0) and
minetest.get_node_light(pos, 0.5) <= 3 and
minetest.get_node_light(random, 0.5) <= 3 then
minetest.set_node(random, {name = node.name})
end
end
minetest.register_abm({