Add chain and many other changes

master
Joachim Stolberg 2021-02-18 20:01:29 +01:00
parent e088c8629e
commit a64d3f3167
45 changed files with 901 additions and 84 deletions

77
chains.lua Normal file
View File

@ -0,0 +1,77 @@
--[[
MyBlocks
Copyright (C) 2018-2021 Joachim Stolberg
LGPLv2.1+
See LICENSE.txt for more information
]]--
-- offsets
local OY = 2/16
local OX = 1/16
local function register_chain(name, description, texture)
minetest.register_node("myblocks:" .. name, {
description = description,
tiles = {"myblocks_chain.png"},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-2/32, -17/32, -1/32, -1/32, -11/32, 1/32},
{ 1/32, -17/32, -1/32, 2/32, -11/32, 1/32},
{-1/32, -13/32, -1/32, 1/32, -11/32, 1/32},
{-1/32, -13/32, -2/32, 1/32, -7/32, -1/32},
{-1/32, -13/32, 1/32, 1/32, -7/32, 2/32},
{-1/32, -9/32, -1/32, 1/32, -7/32, 1/32},
{-2/32, -9/32, -1/32, -1/32, -3/32, 1/32},
{ 1/32, -9/32, -1/32, 2/32, -3/32, 1/32},
{-1/32, -5/32, -1/32, 1/32, -3/32, 1/32},
{-1/32, -5/32, -2/32, 1/32, 1/32, -1/32},
{-1/32, -5/32, 1/32, 1/32, 1/32, 2/32},
{-1/32, -1/32, -1/32, 1/32, 1/32, 1/32},
{-2/32, -1/32, -1/32, -1/32, 5/32, 1/32},
{ 1/32, -1/32, -1/32, 2/32, 5/32, 1/32},
{-1/32, 3/32, -1/32, 1/32, 5/32, 1/32},
{-1/32, 3/32, -2/32, 1/32, 9/32, -1/32},
{-1/32, 3/32, 1/32, 1/32, 9/32, 2/32},
{-1/32, 7/32, -1/32, 1/32, 9/32, 1/32},
{-2/32, 7/32, -1/32, -1/32, 13/32, 1/32},
{ 1/32, 7/32, -1/32, 2/32, 13/32, 1/32},
{-1/32, 11/32, -1/32, 1/32, 13/32, 1/32},
{-1/32, 11/32, -2/32, 1/32, 17/32, -1/32},
{-1/32, 11/32, 1/32, 1/32, 17/32, 2/32},
}
},
selection_box = {
type = "fixed",
fixed = {-2/16, -8/16, -2/16, 2/16, 8/16, 2/16},
},
paramtype2 = "facedir",
climbable = true,
sunlight_propagates = true,
is_ground_content = false,
groups = {cracky = 2},
sounds = default.node_sound_metal_defaults(),
})
end
register_chain("steel", "Steel Chain", "default_steel_block.png")

223
christmaxx.lua Normal file
View File

@ -0,0 +1,223 @@
--christmaxx mod
--written 2018 by Maximilian Hipp
--Item list
local blocks = {
"default:goldblock",
"default:mese",
"wool:white",
"myblocks:christmaxe",
"myblocks:pick_christmas",
"myblocks:shovel_snow",
"myblocks:sword_sugar",
"unifieddyes:airbrush",
"unified_inventory:bag_large",
"techage:usmium_nuggets",
"techage:hammer_bronze",
"basic_materials:energy_crystal_simple",
"binoculars:binoculars",
"default:axe_diamond",
"homedecor:kitchen_cabinet_steel_locked",
"homedecor:table_mahogany",
"hyperloop:station_map",
"default:mese_post_light",
"hyperloop:station",
"ontime_clocks:green_digital",
"ta4_paraglider:paraglider",
"techage:chest_cart",
"techage:chest_ta4",
"techage:end_wrench",
"techage:hammer_diamond",
"techage:industriallamp1_off",
"techage:oilexplorer",
"techage:powerswitch",
"techage:streetlamp_off",
"techage:ta4_button_off",
"techage:ta4_icta_controller",
"techage:ta4_playerdetector_off",
"techage:ta4_signaltower",
"techage:ta4_solar_module",
"techage:tiny_generator",
"ts_skins:clothing_shirt_camo",
"ts_skins:clothing_jacket_closed",
"ts_skins:clothing_belt",
"ts_skins:clothing_safety_vest",
"ts_skins:clothing_sneakers",
"ts_skins:clothing_tie",
}
minetest.after(1, function()
for _,item in ipairs(blocks) do
if not minetest.registered_items[item] and
not minetest.registered_nodes[item] and
not minetest.registered_tools[item] then
minetest.log("error", "Unregistered Item: "..item)
end
end
end)
--Present color list
local presents = {
"myblocks:present_blue",
"myblocks:present_green",
"myblocks:present_red",
"myblocks:present_white"
}
local throwitems = function(pos, node)
minetest.set_node(pos, {name = "air"})
for i = 0, math.random(1,5), 1 do
minetest.add_item(pos, {name = blocks[math.random(1, #blocks)]})
end
end
-- function adds the sugar sword to the players inventory when he joins the game if there is no one
-- the sugar sword is needed to open the presents ;-)
--minetest.register_on_joinplayer(function(player)
-- local playerS = player:get_player_name()
-- if playerS == "unknown" or playerS == "singleplayer" then
-- end
-- local inv = player:get_inventory()
-- local stack = ItemStack({name="myblocks:sword_sugar", count=1} )
-- if not inv:contains_item("main", stack) then
-- inv:add_item("main",stack)
-- end
--end)
--Main present which is in creative inventory
minetest.register_node("myblocks:present", {
description = "Present by maxx",
tiles = {
"present_up.png",
"present_side.png",
"present_side.png",
"present_side.png",
"present_side.png",
"present_side.png"
},
groups = {cracky = 3},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.375, 0.375, 0.0625, 0.375}, -- NodeBox1
{-0.4375, 0.0625, -0.4375, 0.4375, 0.375, 0.4375}, -- NodeBox2
}
},
stack_max = 999,
inventory_image = "present_up.png",
-- on_construct = function(pos)
-- end,
after_place_node = function(pos, placer)
minetest.swap_node(pos, {name = presents[math.random(1, #presents)]})
minetest.chat_send_player(placer:get_player_name(), "Open the present with the Sugar Sword / Öffne das Geschenk mit der Zuckerstange")
end,
})
--Different present colors
--blue
minetest.register_node("myblocks:present_blue", {
description = "Present blue by maxx",
tiles = {
"present_up_b.png",
"present_side_b.png",
"present_side_b.png",
"present_side_b.png",
"present_side_b.png",
"present_side_b.png"
},
groups = {sugary = 1, not_in_creative_inventory = 1},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.375, 0.375, 0.0625, 0.375}, -- NodeBox1
{-0.4375, 0.0625, -0.4375, 0.4375, 0.375, 0.4375}, -- NodeBox2
}
},
on_dig = function(pos, node, digger)
if minetest.is_protected(pos, digger:get_player_name()) then return end
throwitems(pos, node)
end
})
--green
minetest.register_node("myblocks:present_green", {
description = "Present green by maxx",
tiles = {
"present_up.png",
"present_side.png",
"present_side.png",
"present_side.png",
"present_side.png",
"present_side.png"
},
groups = {sugary = 1, not_in_creative_inventory = 1},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.375, 0.375, 0.0625, 0.375}, -- NodeBox1
{-0.4375, 0.0625, -0.4375, 0.4375, 0.375, 0.4375}, -- NodeBox2
}
},
on_dig = function(pos, node, digger)
if minetest.is_protected(pos, digger:get_player_name()) then return end
throwitems(pos, node)
end
})
--red
minetest.register_node("myblocks:present_red", {
description = "Present red by maxx",
tiles = {
"present_up_r.png",
"present_side_r.png",
"present_side_r.png",
"present_side_r.png",
"present_side_r.png",
"present_side_r.png"
},
groups = {sugary = 1, not_in_creative_inventory = 1},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.375, 0.375, 0.0625, 0.375}, -- NodeBox1
{-0.4375, 0.0625, -0.4375, 0.4375, 0.375, 0.4375}, -- NodeBox2
}
},
on_dig = function(pos, node, digger)
if minetest.is_protected(pos, digger:get_player_name()) then return end
throwitems(pos, node)
end
})
--white
minetest.register_node("myblocks:present_white", {
description = "Present white by maxx",
tiles = {
"present_up_w.png",
"present_side_w.png",
"present_side_w.png",
"present_side_w.png",
"present_side_w.png",
"present_side_w.png"
},
groups = {sugary = 1, not_in_creative_inventory = 1},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.375, 0.375, 0.0625, 0.375}, -- NodeBox1
{-0.4375, 0.0625, -0.4375, 0.4375, 0.375, 0.4375}, -- NodeBox2
}
},
on_dig = function(pos, node, digger)
if minetest.is_protected(pos, digger:get_player_name()) then return end
throwitems(pos, node)
end
})

View File

@ -1,3 +0,0 @@
default
moreblocks?

283
init.lua
View File

@ -11,6 +11,8 @@
]]--
myblocks = {}
-- for lazy programmers
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
local P = minetest.string_to_pos
@ -21,9 +23,6 @@ local function register_node(name, desc, tiles)
minetest.register_node("myblocks:"..name, {
description = desc,
tiles = tiles,
paramtype = "light",
light_source = 0,
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {cracky=2, crumbly=2, choppy=2},
is_ground_content = false,
@ -42,17 +41,17 @@ minetest.register_craft({
})
minetest.register_craft({
type="shapeless",
output = "myblocks:reet",
recipe = {"farming:straw"}
output = "myblocks:reet 2",
recipe = {
{"farming:straw", "farming:straw", ""},
{"default:stick", "default:stick", ""},
{"", "", ""},
}
})
minetest.register_node("myblocks:brick", {
description = "Brick by unknown",
tiles = {"myblocks_brick.png"},
paramtype = "light",
light_source = 0,
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {cracky=2, crumbly=2, choppy=2},
is_ground_content = false,
@ -61,9 +60,22 @@ minetest.register_node("myblocks:brick", {
minetest.register_craft({
type="shapeless",
output = "myblocks:brick",
recipe = {"default:brick"},
recipe = {
{"default:clay_brick", "default:clay_brick"},
{"basic_materials:wet_cement", "default:clay_brick"},
},
})
minetest.register_node("myblocks:leaves", {
description = "Apple Tree Leaves",
drawtype = "allfaces_optional",
waving = 1,
tiles = {"default_leaves_simple.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
sounds = default.node_sound_leaves_defaults(),
})
if minetest.get_modpath("moreblocks") then
@ -86,6 +98,26 @@ if minetest.get_modpath("moreblocks") then
sounds = default.node_sound_stone_defaults(),
})
-- Blaetter fuer die Saege
stairsplus:register_all("myblocks", "leaves", "default:leaves", {
description="Apple Tree Leaves",
groups={snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
tiles={"default_leaves_simple.png"},
sounds = default.node_sound_leaves_defaults(),
})
-- stairsplus:register_all("myblocks", "brick", "myblocks:brick", {
-- description="Brick by unknown",
-- groups={cracky=2, crumbly=2, choppy=2, not_in_creative_inventory=1},
-- tiles={"myblocks_brick.png"},
-- sounds = default.node_sound_stone_defaults(),
-- })
-- stairsplus:register_all("myblocks", "brick", "myblocks:brick", {
-- description="Brick by unknown",
-- groups={cracky=2, crumbly=2, choppy=2, not_in_creative_inventory=1},
-- tiles={"myblocks_brick.png"},
-- sounds = default.node_sound_stone_defaults(),
-- })
stairsplus:register_alias_all("fachwerk", "bukki", "myblocks", "bukki")
stairsplus:register_alias_all("fachwerk", "reet", "myblocks", "reet")
stairsplus:register_alias_all("fachwerk", "brick", "myblocks", "brick")
@ -291,12 +323,38 @@ if minetest.get_modpath("screwdriver") then
inventory_image = "myblocks_screwdriver.png",
on_use = function(itemstack, user, pointed_thing)
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE, 2000)
if user:get_player_control().sneak then
-- swap_node with new stored param2
local pos = pointed_thing.under
if pos then
local node = minetest.get_node(pos)
if user:get_attribute("mytool_screwdriver_name") == node.name then
local ndef = minetest.registered_nodes[node.name]
if ndef and ndef.on_rotate ~= screwdriver.disallow then
local param2 = user:get_attribute("mytool_screwdriver_param2")
minetest.swap_node(pos, {name = node.name, param2 = param2})
end
end
end
else
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE, 2000)
end
return itemstack
end,
on_place = function(itemstack, user, pointed_thing)
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_AXIS, 2000)
if user:get_player_control().sneak then
-- read param2 and node name
local pos = pointed_thing.under
if pos then
local node = minetest.get_node(pos)
user:set_attribute("mytool_screwdriver_name", node.name)
user:set_attribute("mytool_screwdriver_param2", node.param2)
minetest.chat_send_player(user:get_player_name(), "Blockausrichtung gespeichert!")
end
else
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_AXIS, 2000)
end
return itemstack
end,
})
@ -313,57 +371,6 @@ if minetest.get_modpath("screwdriver") then
end
--
-- Admin Tool
--
local function clear_objects(itemstack, placer, pointed_thing)
local pos = placer:get_pos()
local pos1x, pos1y, pos1z = pos.x - 1.5, pos.y - 0.5, pos.z - 1.5
local pos2x, pos2y, pos2z = pos.x + 1.5, pos.y + 2.5, pos.z + 1.5
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 3)) do
local entity = obj:get_luaentity()
print("entity")
-- Avoid players
if not obj:is_player() then
local pos = obj:getpos()
print(dump(pos))
if pos.x >= pos1x and pos.x <= pos2x and
pos.y >= pos1y and pos.y <= pos2y and
pos.z >= pos1z and pos.z <= pos2z then
-- Inside region
obj:remove()
end
end
end
end
local function remove_node(itemstack, placer, pointed_thing)
if minetest.check_player_privs(placer:get_player_name(), "server") then
if pointed_thing.type == "node" then
local pos = pointed_thing.under
minetest.remove_node(pos)
end
else
minetest.chat_send_player(placer:get_player_name(), "You don't have the necessary privs!")
end
end
minetest.register_node("myblocks:admin_tool", {
description = "Admin Tool",
inventory_image = "myblocks_tool.png",
wield_image = "myblocks_tool.png",
use_texture_alpha = true,
groups = {cracky=1, book=1},
on_use = remove_node,
on_place = clear_objects,
on_secondary_use = clear_objects,
node_placement_prediction = "",
stack_max = 1,
})
--
-- Sandsack
--
@ -419,10 +426,14 @@ minetest.register_tool("myblocks:wand", {
local stack = inv:get_stack("main", 1)
local taken = stack:take_item(1)
if taken:get_count() == 1 then
inv:remove_item("main", ItemStack(taken:get_name()))
minetest.set_node(pos, {name = taken:get_name()})
itemstack:add_wear(65535 / (100 - 1))
minetest.log("action", user:get_player_name().." nutzt Zauberstab an pos "..S(pos))
local item_name = taken:get_name()
local ndef = minetest.registered_nodes[item_name]
if ndef then
inv:remove_item("main", ItemStack(item_name))
minetest.set_node(pos, {name = item_name})
itemstack:add_wear(65535 / (100 - 1))
minetest.log("action", user:get_player_name().." nutzt Zauberstab an pos "..S(pos))
end
end
else
minetest.chat_send_player(user:get_player_name(), "Du hast keine Superminer privs!")
@ -493,7 +504,7 @@ minetest.register_tool("myblocks:sword_sugar", {
minetest.register_chatcommand("peng", {
description = "Makes peng :)",
func = function(name, param)
if minetest.check_player_privs(name, "settler") then
if minetest.check_player_privs(name, "miniminer") then
local player = minetest.get_player_by_name(name)
local pos = player:get_pos()
minetest.sound_play({
@ -506,20 +517,96 @@ minetest.register_chatcommand("peng", {
end,
})
minetest.register_entity("myblocks:settler", {
visual = "mesh",
mesh = "character.b3d",
textures = {"character.png"},
collisionbox = {-0.5, 0.0, -0.5, 0.5, 2.0, 0.5},
makes_footstep_sound = false,
on_activate = function(self, staticdata)
-- Make immortal
self.object:set_armor_groups({immortal = 1})
-- Set animation
self.object:set_animation({x=1,y=40}, 30)
end,
local board_box = {
type = "wallmounted",
wall_side = {-16/32, -16/32, -12/32, -15/32, 16/32, 12/32},
}
minetest.register_node("myblocks:monalisa", {
description = "MyBlocks Monalisa",
inventory_image = 'myblocks_monalisa.png',
tiles = {"myblocks_monalisa.png"},
drawtype = "nodebox",
node_box = board_box,
selection_box = board_box,
paramtype2 = "wallmounted",
paramtype = "light",
sunlight_propagates = true,
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("myblocks:cartsroute", {
description = "Routenplan",
tiles = {"cartroute.png"},
paramtype2 = "wallmounted",
drop = "myblocks:cartsroute",
groups = {cracky = 3},
drawtype = "nodebox",
paramtype = "light",
light_source = 3,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}, -- NodeBox10
}
}
})
minetest.register_node("myblocks:glow", {
tiles = {{
name = "techage_gravel4.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.2,
},
}},
drawtype = "nodebox",
paramtype = "light",
light_source = 8,
groups = {crumbly = 2, falling_node = 1},
sounds = default.node_sound_gravel_defaults(),
drop = "",
node_box = {
type = "fixed",
fixed = {
{-0.5, 9.5, -0.5, 0.5, 10.5, 0.5}, -- NodeBox10
}
}
})
minetest.register_node("myblocks:invisible", {
description = "Invisible Block",
drawtype = "glasslike_framed_optional",
tiles = {"myblocks_invisible.png"},
inventory_image = 'myblocks_invisible_inv.png',
paramtype = "light",
light_source = 0,
sunlight_propagates = true,
is_ground_content = false,
groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(),
})
if minetest.global_exists("armor") then
armor:register_armor("myblocks:krone", {
description = "Admin Krone",
inventory_image = "myblocks_inv_krone_gold.png",
texture = "myblocks_krone_gold.png",
preview = "myblocks_krone_gold_preview.png",
armor_groups = {fleshy=100},
groups = {armor_head=1, armor_heal=100, armor_use=0, armor_water=1},
on_drop = function(itemstack, dropper, pos)
return
end,
})
end
minetest.register_alias("fachwerk:cherry_leaves", "myblocks:cherry_leaves")
minetest.register_alias("fachwerk:cherry_leaves2", "myblocks:cherry_leaves2")
@ -528,3 +615,37 @@ minetest.register_alias("fachwerk:reet", "myblocks:reet")
minetest.register_alias("access_protection:marker", "myblocks:marker")
minetest.register_alias("fachwerk:screwdriver_diamond", "myblocks:screwdriver_diamond")
dofile(minetest.get_modpath("myblocks") .. "/mytool.lua")
dofile(minetest.get_modpath("myblocks") .. "/strom_tool.lua")
dofile(minetest.get_modpath("myblocks") .. "/rooftop.lua")
dofile(minetest.get_modpath("myblocks") .. "/christmaxx.lua")
dofile(minetest.get_modpath("myblocks") .. "/chains.lua")
local clay = {
{"white", "White"},
{"grey", "Grey"},
{"black", "Black"},
{"red", "Red"},
{"yellow", "Yellow"},
{"green", "Green"},
{"cyan", "Cyan"},
{"blue", "Blue"},
{"magenta", "Magenta"},
{"orange", "Orange"},
{"violet", "Violet"},
{"brown", "Brown"},
{"pink", "Pink"},
{"dark_grey", "Dark Grey"},
{"dark_green", "Dark Green"},
}
for _,item in ipairs(clay) do
local color = item[2]
minetest.register_alias("stairs:stair_"..color, "bakedclay:stair_baked_clay_"..color)
minetest.register_alias("stairs:slab_"..color, "bakedclay:slab_baked_clay_"..color)
end
minetest.register_alias("stairs:slab_W", "fachwerk:slab_W")
minetest.register_alias("stairs:slab_NM", "fachwerk:slab_NM")
minetest.register_alias("stairs:stair_junglewood_outer", "default:junglewood_outerstair")

View File

@ -1 +1,4 @@
name=myblocks
depends=stairs,techage,tubelib2,moreblocks,carts
optional_depends=armor,bakedclay,fachwerk
description=some more or less useful blocks and tools

View File

@ -0,0 +1,26 @@
# Blender v2.70 (sub 0) OBJ File: 'Dachschräge_MT.blend'
# Alex Kirchner
o Cube
v 0.5 -0.5 -0.5
v 0.5 -0.5 0.5
v -0.5 -0.5 0.5
v -0.5 -0.5 -0.5
v 0.5 0 0
v -0.5 0 0
vt 1 0
vt 1 1
vt 0 1
vt 0 0
vt 1 0.653
vt 0 0.653
vt 0.5 0.4214
usemtl Material
s off
f 1/1 2/2 3/3 4/4
f 1/1 4/4 6/6 5/5
f 2/1 3/4 6/6 5/5
f 3/4 4/1 6/7
f 2/4 1/1 5/7

View File

@ -0,0 +1,60 @@
# Blender v2.70 (sub 0) OBJ File: ''
# www.blender.org
mtllib dachschraege_ecke_45.mtl
o Cube
v 0.500000 -0.000000 -0.500000
v 0.500000 -0.000000 0.500000
v -0.500000 -0.000000 0.500000
v -0.500000 -0.000000 -0.500000
v 0.500000 -0.000000 -0.500000
v -0.000000 0.500000 0.500000
v -0.000000 0.500000 0.500000
v -0.500000 -0.000000 -0.500000
v 0.500000 -0.000000 -0.500000
v 0.500000 -0.000000 -0.500000
v 0.500000 -0.000000 0.500000
v 0.500000 -0.000000 0.500000
v -0.500000 -0.000000 -0.500000
v -0.500000 -0.000000 -0.500000
v 0.500000 -0.000000 -0.500000
v 0.500000 -0.000000 -0.500000
v -0.500000 -0.000000 0.500000
v -0.500000 -0.000000 0.500000
v -0.000000 0.500000 0.500000
v -0.000000 0.500000 0.500000
v -0.000000 0.500000 0.500000
v -0.000000 0.500000 0.500000
v -0.500000 -0.000000 -0.500000
v -0.500000 -0.000000 -0.500000
vt 0.916983 0.728800
vt 0.574561 0.728800
vt 0.574561 0.386378
vt 0.916983 0.386378
vt 0.000187 0.107201
vt 0.320552 0.000187
vt 0.320552 0.506835
vt 0.311709 0.506758
vt 0.660707 0.000187
vt 0.660707 0.006117
vt 0.320926 0.386004
vt 0.320926 0.006117
vt 0.999813 0.043610
vt 0.830447 0.382341
vt 0.824856 0.386003
vt 0.661081 0.043610
vt 0.320926 0.669526
vt 0.574186 0.386378
vt 0.574182 0.896049
vt 0.570190 0.900434
vt 0.667402 0.900809
vt 0.667402 0.906856
vt 0.320979 0.912905
vt 0.320926 0.906858
usemtl Material
s off
f 1/1 2/2 3/3 4/4
f 15/5 23/6 21/7 19/8
f 9/9 5/10 6/11 11/12
f 12/13 20/14 7/15 17/16
f 18/17 22/18 8/19 13/20
f 16/21 10/22 14/23 24/24

148
mytool.lua Normal file
View File

@ -0,0 +1,148 @@
--
-- Admin Tool
--
local function clear_objects(itemstack, placer, pointed_thing)
local pos = placer:get_pos()
local pos1x, pos1y, pos1z = pos.x - 1.5, pos.y - 0.5, pos.z - 1.5
local pos2x, pos2y, pos2z = pos.x + 1.5, pos.y + 2.5, pos.z + 1.5
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 3)) do
local entity = obj:get_luaentity()
print("entity")
-- Avoid players
if not obj:is_player() then
local pos = obj:getpos()
print(dump(pos))
if pos.x >= pos1x and pos.x <= pos2x and
pos.y >= pos1y and pos.y <= pos2y and
pos.z >= pos1z and pos.z <= pos2z then
-- Inside region
obj:remove()
end
end
end
minetest.forceload_free_block(pos, true)
minetest.forceload_free_block(pos, false)
end
local function remove_node(itemstack, placer, pointed_thing)
if minetest.check_player_privs(placer:get_player_name(), "creative") then
if pointed_thing.type == "node" then
local pos = pointed_thing.under
minetest.remove_node(pos)
tubelib2.del_mem(pos)
techage.del_mem(pos)
minetest.get_meta(pos):from_table(nil)
end
else
minetest.chat_send_player(placer:get_player_name(), "You don't have 'creative' privs!")
end
end
minetest.register_node("myblocks:mytool1", {
description = "Admin Tool1",
inventory_image = "myblocks_tool.png",
wield_image = "myblocks_tool.png",
use_texture_alpha = true,
liquids_pointable = true,
groups = {cracky=1, book=1},
on_use = remove_node,
on_place = clear_objects,
on_secondary_use = clear_objects,
node_placement_prediction = "",
stack_max = 1,
})
local function read_data(itemstack, placer, pointed_thing)
if minetest.check_player_privs(placer:get_player_name(), "superminer") then
if pointed_thing.type == "node" then
local pos = pointed_thing.under
local mem = techage.get_mem(pos)
local tl2 = tubelib2.get_mem(pos)
local nvm = techage.get_nvm(pos)
local meta = minetest.get_meta(pos)
local node = minetest.get_node(pos)
minetest.swap_node(pos, node)
local ndef = minetest.registered_nodes[node.name] or minetest.registered_items[node.name] or minetest.registered_craftitems[node.name]
local number = techage and techage.get_node_number(pos)
local tdata
if number then
tdata = techage.get_node_info(number) or {}
print(number, dump(tdata))
tdata.number = number
--tdata = "nope"
else
tdata = "nope"
end
minetest.chat_send_player(placer:get_player_name(), "#############################################")
minetest.chat_send_player(placer:get_player_name(), "mem: "..dump(mem))
minetest.chat_send_player(placer:get_player_name(), "nvm: "..dump(nvm))
minetest.chat_send_player(placer:get_player_name(), "node: "..dump(node))
minetest.chat_send_player(placer:get_player_name(), "meta: "..dump(meta:to_table()))
minetest.chat_send_player(placer:get_player_name(), "techage: "..dump(tdata))
minetest.chat_send_player(placer:get_player_name(), "###### [F10] ######")
print("#############################################")
print("mem: "..dump(mem))
print("tlib2: "..dump(tl2))
print("nvm: "..dump(nvm))
print("node: "..dump(node))
print("meta: "..dump(meta:to_table()))
print("techage: "..dump(tdata))
if ndef and ndef.networks then
print("networks: "..dump(ndef.networks))
end
end
else
minetest.chat_send_player(placer:get_player_name(), "You don't have 'superminer' privs!")
end
end
local function show_protection_blocks(itemstack, placer, pointed_thing)
local pos = placer:get_pos()
local pos1 = {x = pos.x - 20, y = pos.y - 20, z = pos.z - 20}
local pos2 = {x = pos.x + 20, y = pos.y + 20, z = pos.z + 20}
local blocks = {"protector:protect", "protector:protect2", "protector:protect3"}
local cnt = 0
local name = placer:get_player_name()
for _, pos3 in ipairs(minetest.find_nodes_in_area(pos1, pos2, blocks)) do
techage.mark_position(name, pos3, "protect", "#FFFFFF", 10)
cnt = cnt + 1
end
minetest.chat_send_player(name, cnt.." blocks found")
end
minetest.register_node("myblocks:mytool2", {
description = "Admin Tool2",
inventory_image = "myblocks_mytool2.png",
wield_image = "myblocks_mytool2.png",
liquids_pointable = true,
use_texture_alpha = true,
groups = {cracky=1, book=1},
on_use = read_data,
on_place = read_data,
on_secondary_use = show_protection_blocks,
node_placement_prediction = "",
stack_max = 1,
})
minetest.register_chatcommand("sort", {
description = "Sort the player inventory in alphabetical order",
func = function(name, param)
local inv = minetest.get_inventory({type="player", name=name})
local list = inv:get_list("main")
table.sort(list, function (a, b)
local name_a = a:get_name()
local name_b = b:get_name()
if name_a == "" and name_b ~= "" then return false end
if name_a ~= "" and name_b == "" then return true end
return string.lower(name_a) < string.lower(name_b)
end)
inv:set_list("main", list)
end
})

119
rooftop.lua Normal file
View File

@ -0,0 +1,119 @@
--[[
MyBlocks
Copyright (C) 2018-2020 Joachim Stolberg
LGPLv2.1+
See LICENSE.txt for more information
]]--
minetest.register_craftitem("myblocks:circular_saw", {
description = "Circular Saw",
inventory_image = "myblocks_saw.png",
})
minetest.register_craft({
output = "myblocks:circular_saw",
recipe = {
{"basic_materials:plastic_strip", "basic_materials:plastic_strip", "basic_materials:plastic_strip"},
{"basic_materials:steel_strip", "basic_materials:motor", "basic_materials:steel_strip"},
{"", "basic_materials:gear_steel", ""},
},
})
function myblocks.register_rooftop1(node_name)
local new_name = node_name.."_rooftop1"
local ndef = table.copy(minetest.registered_nodes[node_name])
ndef.description = ndef.description.." Rooftop 1"
ndef.drawtype = "mesh"
ndef.mesh="myblocks_rooftop1.obj"
ndef.paramtype2 = "facedir"
ndef.node_box = {
type = "fixed",
fixed = {
{-8/16, -8/16, -8/16, 8/16, -4/16, 8/16},
{-8/16, -4/16, -4/16, 8/16, 0/16, 4/16},
},
}
ndef.selection_box = {
type = "fixed",
fixed = {
{-8/16, -8/16, -8/16, 8/16, -4/16, 8/16},
{-8/16, -4/16, -4/16, 8/16, 0/16, 4/16},
},
}
minetest.register_node(":"..new_name, ndef)
minetest.register_craft({
output = new_name.." 6",
recipe = {
{"myblocks:circular_saw", node_name, ""},
{node_name, "", node_name},
{"", "", ""},
},
replacements = {
{"myblocks:circular_saw", "myblocks:circular_saw"}
},
})
end
function myblocks.register_rooftop2(node_name)
local new_name = node_name.."_rooftop2"
local ndef = table.copy(minetest.registered_nodes[node_name])
ndef.description = ndef.description.." Rooftop 2"
ndef.drawtype = "mesh"
ndef.mesh="myblocks_rooftop2.obj"
ndef.paramtype2 = "facedir"
ndef.node_box = {
type = "fixed",
fixed = {
{-8/16, -8/16, -8/16, 8/16, -4/16, 8/16},
{-8/16, -4/16, -4/16, 8/16, 0/16, 4/16},
},
}
ndef.selection_box = {
type = "fixed",
fixed = {
{-8/16, -8/16, -8/16, 8/16, -4/16, 8/16},
{-8/16, -4/16, -4/16, 8/16, 0/16, 4/16},
},
}
minetest.register_node(":"..new_name, ndef)
minetest.register_craft({
output = new_name.." 6",
recipe = {
{"myblocks:circular_saw", "", node_name},
{node_name, "", node_name},
{"", "", ""},
},
replacements = {
{"myblocks:circular_saw", "myblocks:circular_saw"}
},
})
end
myblocks.register_rooftop1("myblocks:reet")
myblocks.register_rooftop1("myblocks:bukki")
myblocks.register_rooftop1("farming:straw")
if minetest.global_exists("fachwerk") then
myblocks.register_rooftop1("fachwerk:F")
myblocks.register_rooftop1("fachwerk:S")
myblocks.register_rooftop1("fachwerk:W")
myblocks.register_rooftop1("fachwerk:Z")
myblocks.register_rooftop1("fachwerk:pflaster")
end
myblocks.register_rooftop2("myblocks:reet")
myblocks.register_rooftop2("myblocks:bukki")
myblocks.register_rooftop2("farming:straw")
if minetest.global_exists("fachwerk") then
myblocks.register_rooftop2("fachwerk:F")
myblocks.register_rooftop2("fachwerk:S")
myblocks.register_rooftop2("fachwerk:W")
myblocks.register_rooftop2("fachwerk:Z")
myblocks.register_rooftop2("fachwerk:pflaster")
end

43
strom_tool.lua Normal file
View File

@ -0,0 +1,43 @@
--
-- Techage Strom Tool
--
local Cable = techage.ElectricCable
local function chat(name, txt)
minetest.chat_send_player(name, "[TA Power Tool] "..txt)
end
local function show_network_data(itemstack, placer, pointed_thing)
local name = placer:get_player_name()
if pointed_thing.type == "node" then
local pos = pointed_thing.under or pointed_thing.above
if pos then
local has_power = techage.power.power_available(pos, Cable)
chat(name, "node has power "..dump(has_power))
local nvm = techage.get_nvm(pos)
local netw = techage.networks.has_network("ele1", nvm.ele1 and nvm.ele1.netID)
chat(name, "node has network "..dump(netw ~= nil))
if netw then
chat(name, string.format("available1 = %u, available2 = %u, needed1 = %u, needed2 = %u",
(netw.available1 or 0), (netw.available2 or 0), (netw.needed1 or 0), (netw.needed2 or 0)))
chat(name, string.format("#gen1 = %u, #gen2 = %u, #con1 = %u, #con2 = %u",
#(netw.gen1 or {}), #(netw.gen2 or {}), #(netw.con1 or {}), #(netw.con2 or {})))
chat(name, "Max con1 power needed: "..techage.power.get_con1_sum(netw, "ele1"))
end
end
end
end
minetest.register_node("myblocks:power_tool", {
description = "TA Power Tool",
inventory_image = "myblocks_tool2.png",
wield_image = "myblocks_tool2.png",
use_texture_alpha = true,
groups = {cracky=1, book=1},
on_use = show_network_data,
on_place = show_network_data,
on_secondary_use = show_network_data,
node_placement_prediction = "",
stack_max = 1,
})

BIN
textures/cartroute.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 232 B

BIN
textures/myblocks_chain.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 B

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 854 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 151 B

BIN
textures/myblocks_saw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
textures/myblocks_tool2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1000 B

BIN
textures/present_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

BIN
textures/present_side_b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

BIN
textures/present_side_r.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

BIN
textures/present_side_w.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

BIN
textures/present_up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

BIN
textures/present_up_b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

BIN
textures/present_up_r.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

BIN
textures/present_up_w.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

BIN
textures/santa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

BIN
textures/santa_preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 168 B