Git Product home page Git Product logo

minetest_classic's People

Contributors

sfan5 avatar sleepycrow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sleepycrow

minetest_classic's Issues

Add footprints and standing signs

Hey! It's me nininik0 I just wanted to tell you that I found the code for footprints, maybe you could use it to add stuff, so here it is: `local player_pos = {}
local player_pos_previous = {}

minetest.register_on_joinplayer(function(player)
local player_name = player:get_player_name()
player_pos_previous[player_name] = { x=0, y=0, z=0 }
end)

minetest.register_on_leaveplayer(function(player)
local player_name = player:get_player_name()
player_pos_previous[player_name] = nil
end)

minetest.override_item("default:dirt_with_grass_footsteps", {
on_timer = function(pos)
local node = minetest.get_node(pos)
node.name = "default:dirt_with_grass"
minetest.add_node(pos, node)
end,
})

-- Chance to change is odd of 100
local odd = 30
local timer = 0

minetest.register_globalstep(function(dtime)
-- Don't check all the time.
timer = timer + dtime
if timer < 5 then return end
timer = 0

for _,player in ipairs(minetest.get_connected_players()) do
	local pos = player:get_pos()
	local player_name = player:get_player_name()
	player_pos[player_name] = { x=math.floor(pos.x+0.5), y=math.floor(pos.y+0.5), z=math.floor(pos.z+0.5) }
	local p_ground = { x=math.floor(pos.x+0.5), y=math.floor(pos.y), z=math.floor(pos.z+0.5) }
	local n_ground  = minetest.get_node(p_ground)
	
	-- Check if position is the previous position
	if player_pos_previous[player_name] == nil then
		return
	end

	if player:get_player_control().sneak then
		return
	end
	
	if	player_pos[player_name].x == player_pos_previous[player_name].x and 
		player_pos[player_name].y == player_pos_previous[player_name].y and 
		player_pos[player_name].z == player_pos_previous[player_name].z 
	then
		return
	end

	
		
	-- Make footsteps
	if math.random(1, 100) <= odd then
		if n_ground.name == "default:dirt_with_grass"
			or n_ground.name == "default:dirt_with_grass_footsteps" then
			minetest.add_node(p_ground,{type="node",name="default:dirt_with_grass_footsteps"})
			minetest.get_node_timer(p_ground):start(math.random(3, 48))
		elseif n_ground.name == "farming:soil" 
			or n_ground.name == "farming:soil_wet" then
			minetest.add_node(p_ground,{type="node",name="default:dirt"})
			minetest.sound_play("default_dig_crumbly",
				{pos = pos, max_hear_distance = 16, gain = 0.25})
		end
	end

	-- Make position to previous position
	player_pos_previous[player_name] =  player_pos[player_name]
end

end)

minetest.register_lbm({
name = "footsteps:convert_footsteps_to_node_timer",
nodenames = {"default:dirt_with_grass_footsteps"},
action = function(pos)
minetest.get_node_timer(pos):start(math.random(3, 48))
end
})`

Too few ores

The following engine patch fixes importing of minerals in old maps:

diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp
--- a/src/content_mapnode.cpp
+++ b/src/content_mapnode.cpp
@@ -115,6 +115,13 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version)
                        }
                }
        }
+       if (version <= 20 && n_from.getContent() == CONTENT_STONE) {
+               const u8 mineral = n_from.getParam1() & 0x0f;
+               if (mineral == 1)
+                       result.setContent(CONTENT_COALSTONE);
+               else if (mineral == 2)
+                       result.setContent(0x666);
+       }
        return result;
 }
 
@@ -133,6 +140,7 @@ void content_mapnode_get_name_id_mapping(NameIdMapping *nimap)
        nimap->set(31, "default:ladder");
        nimap->set(32, "default:lava_flowing");
        nimap->set(33, "default:lava_source");
+       nimap->set(0x666, "default:ironstone");
        nimap->set(0x800, "default:dirt_with_grass");
        nimap->set(0x801, "default:tree");
        nimap->set(0x802, "default:leaves");

And here's an xray screenshot of a map generated in 0.3.1:
screenshot_20220630_234659_

The current code generates much fewer ores, something is definitely broken!

Crafting doesnt work

I don't know why but the mese pickaxe crafting recipe and the locked chest and iron apple recipes don't work. Idk the bug but I think u gotta fix it pls

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.