Merge pull request #2 from hasanalsamra/edited

New version update
This commit is contained in:
hasanalsamra 2016-08-30 14:52:35 +03:00 committed by GitHub
commit fc03a0f94a
12 changed files with 123 additions and 52 deletions

View File

@ -1,8 +1,13 @@
Version 0.3-beta:
Improve some textures.
Fix large chest issue.
added /mcnodes command to easly get the mod version.
Version 0.2-beta:
Textures updated.
Set textures license (See LICENSE.txt file for more information).
Some code improvements.
Textures updated.
Set textures license (See LICENSE.txt file for more information).
Some code improvements.
Version 0.1-beta:
First release.
First release.

View File

@ -1,11 +1,9 @@
# Mcnodes 0.2-beta
More custom nodes mod for minetest.
# Mcnodes 0.3-beta
-- This mod adds a 3d chest, if you don't like it edit nodes.lua file and set the ChangeChest variable to 0
-- The large chest still have some problems will be solved in the next release.
-- Large chest can be disabled by changing LargeChest variable to 0 at nodes.lua file
-- Large chest can be disabled by changing LargeChest variable to 0 at init.lua file
-- Auto stairs can be disabled by changing AutoStairs variable to 0 at init.lua file

View File

@ -1 +1 @@
0.2-beta
0.3-beta

8
chatcommands.lua Normal file
View File

@ -0,0 +1,8 @@
minetest.register_chatcommand("mcnodes", {
params = "",
description = "Mcnodes mod version",
privs = {},
func = function()
return true, mcnodes.version
end,
})

35
chest.functions.lua Normal file
View File

@ -0,0 +1,35 @@
function PlaceChest(NodeOn, Pos, OldNodePos)
if NodeOn == 'ZN' then
if getNodeYaxis(Pos) == '270' and getNodeYaxis(OldNodePos) == '270' or getNodeYaxis(Pos) == '90' and getNodeYaxis(OldNodePos) == '270' or getNodeYaxis(Pos) == '270' and getNodeYaxis(OldNodePos) == '90' then
True = false
else
True = true
end
end
if NodeOn == 'ZP' then
if getNodeYaxis(Pos) == '270' and getNodeYaxis(OldNodePos) == '270' or getNodeYaxis(Pos) == '270' and getNodeYaxis(OldNodePos) == '90' or getNodeYaxis(Pos) == '90' and getNodeYaxis(OldNodePos) == '270' then
True = false
else
True = true
end
end
if NodeOn == 'XN' then
if getNodeYaxis(Pos) == '180' and getNodeYaxis(OldNodePos) == '180' or getNodeYaxis(Pos) == '0' and getNodeYaxis(OldNodePos) == '180' or getNodeYaxis(Pos) == '180' and getNodeYaxis(OldNodePos) == '0' then
True = false
else
True = true
end
end
if NodeOn == 'XP' then
if getNodeYaxis(Pos) == '0' and getNodeYaxis(OldNodePos) == '0' or getNodeYaxis(Pos) == '180' and getNodeYaxis(OldNodePos) == '0' or getNodeYaxis(Pos) == '0' and getNodeYaxis(OldNodePos) == '180' then
True = false
else
True = true
end
end
return True
end

View File

@ -65,72 +65,87 @@ if LargeChest == '1' then
done = '0'
if done == '0' then
if minetest.get_node_or_nil({x=pos.x+1, y=pos.y, z=pos.z}).name == "default:chest" then
oldnodepos = {x=pos.x+1, y=pos.y, z=pos.z}
if minetest.get_node_or_nil(oldnodepos).name == "default:chest" then
MainNodeOn = 'XP'
NewNodeRotation = getNodeYaxis(pos)
minetest.remove_node({x=pos.x+1, y=pos.y, z=pos.z})
minetest.remove_node(pos)
if placer_pos.z < pos.z then
minetest.set_node(pos, {name="mcnodes:large_chest", param2 = facedir})
else
minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name="mcnodes:large_chest", param2 = facedir})
if PlaceChest('XP', pos, oldnodepos) == true then
minetest.remove_node(oldnodepos)
minetest.remove_node(pos)
if placer_pos.z < pos.z then
minetest.set_node(pos, {name="mcnodes:large_chest", param2 = facedir})
else
minetest.set_node(oldnodepos, {name="mcnodes:large_chest", param2 = facedir})
end
done = '1'
end
done = '1'
end
end
if done == '0' then
if minetest.get_node_or_nil({x=pos.x, y=pos.y, z=pos.z+1}).name == "default:chest" then
oldnodepos = {x=pos.x, y=pos.y, z=pos.z+1}
if minetest.get_node_or_nil(oldnodepos).name == "default:chest" then
MainNodeOn = 'ZP'
minetest.remove_node({x=pos.x, y=pos.y, z=pos.z+1})
minetest.remove_node(pos)
if PlaceChest('ZP', pos, oldnodepos) == true then
minetest.remove_node(oldnodepos)
minetest.remove_node(pos)
if placer_pos.x < pos.x then
minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name="mcnodes:large_chest", param2 = facedir})
else
minetest.set_node(pos, {name="mcnodes:large_chest", param2 = facedir})
if placer_pos.x < pos.x then
minetest.set_node(oldnodepos, {name="mcnodes:large_chest", param2 = facedir})
else
minetest.set_node(pos, {name="mcnodes:large_chest", param2 = facedir})
end
done = '1'
end
done = '1'
end
end
if done == '0' then
if minetest.get_node_or_nil({x=pos.x-1, y=pos.y, z=pos.z}).name == "default:chest" then
oldnodepos = {x=pos.x-1, y=pos.y, z=pos.z}
if minetest.get_node_or_nil(oldnodepos).name == "default:chest" then
MainNodeOn = 'XN'
minetest.remove_node({x=pos.x-1, y=pos.y, z=pos.z})
minetest.remove_node(pos)
if placer_pos.z > pos.z then
minetest.set_node(pos, {name="mcnodes:large_chest", param2 = facedir})
else
minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name="mcnodes:large_chest", param2 = facedir})
end
if PlaceChest('XN', pos, oldnodepos) == true then
minetest.remove_node(oldnodepos)
minetest.remove_node(pos)
if placer_pos.z > pos.z then
minetest.set_node(pos, {name="mcnodes:large_chest", param2 = facedir})
else
minetest.set_node(oldnodepos, {name="mcnodes:large_chest", param2 = facedir})
end
done = '1'
done = '1'
end
end
end
if done == '0' then
if minetest.get_node_or_nil({x=pos.x, y=pos.y, z=pos.z-1}).name == "default:chest" then
oldnodepos = {x=pos.x, y=pos.y, z=pos.z-1}
if minetest.get_node_or_nil(oldnodepos).name == "default:chest" then
MainNodeOn = 'ZN'
minetest.remove_node({x=pos.x, y=pos.y, z=pos.z-1})
minetest.remove_node(pos)
if placer_pos.x > pos.x then
minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name="mcnodes:large_chest", param2 = facedir})
else
minetest.set_node(pos, {name="mcnodes:large_chest", param2 = facedir})
if PlaceChest('ZN', pos, oldnodepos) == true then
minetest.remove_node(oldnodepos)
minetest.remove_node(pos)
if placer_pos.x > pos.x then
minetest.set_node(oldnodepos, {name="mcnodes:large_chest", param2 = facedir})
else
minetest.set_node(pos, {name="mcnodes:large_chest", param2 = facedir})
end
done = '1'
end
done = '1'
end
end
--minetest.chat_send_all('State: ' .. MainNodeOn .. ', Y-axis: ' .. NewNodeRotation)
minetest.chat_send_all('State: ' .. MainNodeOn)
end
end
minetest.chat_send_all('Y-axis: ' .. getNodeYaxis(pos))
end)
end

View File

@ -1,3 +1,9 @@
mcnodes = {}
mcnodes.version = '0.3-beta'
LargeChest = '1'
AutoStairs = '1'
dofile(minetest.get_modpath("mcnodes").."/functions.general.lua")
@ -15,13 +21,18 @@ dofile(minetest.get_modpath("mcnodes").."/crafting.lua")
--dofile(minetest.get_modpath("mcnodes").."/hand.lua")
dofile(minetest.get_modpath("mcnodes").."/chest.lua")
if LargeChest == '1' then
dofile(minetest.get_modpath("mcnodes").."/chest.functions.lua")
dofile(minetest.get_modpath("mcnodes").."/chest.lua")
end
dofile(minetest.get_modpath("mcnodes").."/register_ores.lua")
dofile(minetest.get_modpath("mcnodes").."/register_biome.lua")
dofile(minetest.get_modpath("mcnodes").."/replaced_nodes.lua")
dofile(minetest.get_modpath("mcnodes").."/chatcommands.lua")
if AutoStairs == '1' then
dofile(minetest.get_modpath("mcnodes").."/auto_stairs_functions.lua")

View File

@ -1,5 +1,4 @@
ChangeChest = '1'
LargeChest = '1'
minetest.register_node("mcnodes:quartz_block", {
description = "Quartz block",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 851 B

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 926 B

After

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 953 B

After

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 995 B

After

Width:  |  Height:  |  Size: 977 B