├── mods ├── new_nodes │ └── init.lua ├── flora │ ├── depends.txt │ ├── models │ │ └── flora_cactus.b3d │ ├── textures │ │ └── flora_cactus.png │ ├── README.md │ └── init.lua ├── gui │ ├── depends.txt │ ├── textures │ │ ├── heart.png │ │ ├── bubble.png │ │ ├── gui_null.png │ │ ├── heart_bg.png │ │ ├── bubble_bg.png │ │ ├── gui_arrow_bg.png │ │ ├── gui_hotbar_bg.png │ │ ├── gui_itemslot.png │ │ ├── gui_formspec_bg.png │ │ ├── gui_icon_trash.png │ │ ├── gui_tab_active.png │ │ ├── gui_formspec_title.png │ │ ├── gui_icon_creative.png │ │ ├── gui_icon_inventory.png │ │ ├── gui_itemslot_dark.png │ │ ├── gui_tab_inactive.png │ │ ├── gui_button_1w_active.png │ │ ├── gui_button_2w_active.png │ │ ├── gui_button_3w_active.png │ │ ├── gui_hotbar_selected.png │ │ ├── gui_button_1w_inactive.png │ │ ├── gui_button_2w_inactive.png │ │ ├── gui_button_3w_inactive.png │ │ ├── gui_tab_horizontal_active.png │ │ └── gui_tab_horizontal_inactive.png │ ├── init.lua │ ├── README.md │ ├── hud.lua │ ├── formspec.lua │ └── api.lua ├── trees │ ├── depends.txt │ ├── schematics │ │ ├── oak_tree.mts │ │ └── lupuna_tree.mts │ ├── textures │ │ ├── trees_stick.png │ │ ├── trees_oak_log.png │ │ ├── trees_lupuna_log.png │ │ ├── trees_oak_leaf.png │ │ ├── trees_oak_plank.png │ │ ├── trees_lupuna_leaf.png │ │ ├── trees_lupuna_plank.png │ │ ├── trees_oak_sapling.png │ │ ├── trees_fence_overlay.png │ │ ├── trees_lupuna_planks.png │ │ ├── trees_lupuna_sapling.png │ │ ├── trees_oak_log_sides.png │ │ └── trees_lupuna_log_sides.png │ ├── README.md │ ├── trees.lua │ └── init.lua ├── eden │ ├── depends.txt │ ├── textures │ │ ├── crosshair.png │ │ ├── eden_rock.png │ │ ├── wieldhand.png │ │ ├── eden_cobble.png │ │ ├── eden_flint.png │ │ ├── eden_gravel.png │ │ ├── eden_stone.png │ │ ├── eden_torch.png │ │ ├── crack_anylength.png │ │ └── eden_item_smoke.png │ ├── sounds │ │ ├── eden_item_burn.ogg │ │ ├── eden_item_pickup.1.ogg │ │ ├── eden_item_pickup.2.ogg │ │ ├── eden_item_pickup.3.ogg │ │ └── eden_item_pickup.4.ogg │ ├── chatcommands.lua │ ├── README.md │ ├── init.lua │ ├── models │ │ ├── torch_floor.obj │ │ └── torch_wall.obj │ ├── nodes.lua │ ├── wield.lua │ ├── torch.lua │ ├── falling.lua │ └── item_entity.lua ├── soil │ ├── textures │ │ ├── soil_dirt.png │ │ ├── soil_sand.png │ │ ├── soil_grass.png │ │ └── soil_grass_side.png │ ├── README.md │ └── init.lua ├── players │ ├── models │ │ ├── character.b3d │ │ ├── character.blend │ │ └── character.png │ ├── README.md │ ├── init.lua │ ├── sprint.lua │ └── api.lua ├── liquid │ ├── textures │ │ ├── liquid_lava.png │ │ ├── liquid_water.png │ │ ├── liquid_river_water.png │ │ ├── liquid_lava_source_animated.png │ │ ├── liquid_lava_flowing_animated.png │ │ ├── liquid_water_flowing_animated.png │ │ ├── liquid_water_source_animated.png │ │ ├── liquid_river_water_flowing_animated.png │ │ └── liquid_river_water_source_animated.png │ └── init.lua ├── ores │ ├── textures │ │ ├── ores_coal_lump.png │ │ ├── ores_coal_ore.png │ │ ├── ores_gold_ore.png │ │ ├── ores_iron_ore.png │ │ ├── ores_diamond_lump.png │ │ ├── ores_diamond_ore.png │ │ ├── ores_gold_ingot.png │ │ └── ores_iron_ingot.png │ ├── README.md │ └── init.lua ├── tools │ ├── textures │ │ ├── tools_iron_axe.png │ │ ├── tools_iron_hoe.png │ │ ├── tools_iron_pick.png │ │ ├── tools_iron_sword.png │ │ ├── tools_rock_hoe.png │ │ ├── tools_rock_knife.png │ │ ├── tools_rock_pick.png │ │ ├── tools_rock_spade.png │ │ ├── tools_steel_axe.png │ │ ├── tools_steel_hoe.png │ │ ├── tools_steel_pick.png │ │ ├── tools_stone_axe.png │ │ ├── tools_stone_hoe.png │ │ ├── tools_stone_pick.png │ │ ├── tools_diamond_axe.png │ │ ├── tools_diamond_hoe.png │ │ ├── tools_diamond_pick.png │ │ ├── tools_iron_shovel.png │ │ ├── tools_rock_hatchet.png │ │ ├── tools_steel_shovel.png │ │ ├── tools_steel_sword.png │ │ ├── tools_stone_shovel.png │ │ ├── tools_stone_sword.png │ │ ├── tools_diamond_shovel.png │ │ ├── tools_diamond_sword.png │ │ ├── tools_rock_xl_knife.png │ │ └── tools_diamond_longsword.png │ ├── README.md │ ├── tools.lua │ └── init.lua ├── mapgen │ ├── README.md │ ├── init.lua │ ├── biomes.lua │ └── rotate.lua ├── gamemode │ ├── README.md │ ├── modes.lua │ └── init.lua └── processed_blocks │ ├── textures │ ├── processed_blocks_wattle.png │ ├── processed_blocks_oak_plank.png │ ├── processed_blocks_glass_block.png │ ├── processed_blocks_ladder_wood.png │ ├── processed_blocks_planks_overlay.png │ ├── processed_blocks_glass_block_detail.png │ ├── processed_blocks_stone_bricks_plain.png │ └── processed_blocks_glass_block_detail_red.png │ └── init.lua ├── game.conf ├── minetest.conf ├── menu ├── header.png └── icon.png ├── .gitmodules ├── README.md ├── settingtypes.txt ├── game_api.md └── LICENSE.txt /mods/new_nodes/init.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /game.conf: -------------------------------------------------------------------------------- 1 | name = Eden 2 | -------------------------------------------------------------------------------- /mods/flora/depends.txt: -------------------------------------------------------------------------------- 1 | mapgen 2 | -------------------------------------------------------------------------------- /mods/gui/depends.txt: -------------------------------------------------------------------------------- 1 | gamemode 2 | -------------------------------------------------------------------------------- /mods/trees/depends.txt: -------------------------------------------------------------------------------- 1 | mapgen 2 | -------------------------------------------------------------------------------- /mods/eden/depends.txt: -------------------------------------------------------------------------------- 1 | gamemode 2 | -------------------------------------------------------------------------------- /minetest.conf: -------------------------------------------------------------------------------- 1 | movement_speed_walk = 3.7 2 | -------------------------------------------------------------------------------- /menu/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/menu/header.png -------------------------------------------------------------------------------- /menu/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/menu/icon.png -------------------------------------------------------------------------------- /mods/gui/textures/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/heart.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "mods/hudlib"] 2 | path = mods/hudlib 3 | url = https://github.com/octacian/hudlib 4 | -------------------------------------------------------------------------------- /mods/gui/textures/bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/bubble.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_null.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_null.png -------------------------------------------------------------------------------- /mods/gui/textures/heart_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/heart_bg.png -------------------------------------------------------------------------------- /mods/eden/textures/crosshair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/textures/crosshair.png -------------------------------------------------------------------------------- /mods/eden/textures/eden_rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/textures/eden_rock.png -------------------------------------------------------------------------------- /mods/eden/textures/wieldhand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/textures/wieldhand.png -------------------------------------------------------------------------------- /mods/gui/textures/bubble_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/bubble_bg.png -------------------------------------------------------------------------------- /mods/soil/textures/soil_dirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/soil/textures/soil_dirt.png -------------------------------------------------------------------------------- /mods/soil/textures/soil_sand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/soil/textures/soil_sand.png -------------------------------------------------------------------------------- /mods/eden/sounds/eden_item_burn.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/sounds/eden_item_burn.ogg -------------------------------------------------------------------------------- /mods/eden/textures/eden_cobble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/textures/eden_cobble.png -------------------------------------------------------------------------------- /mods/eden/textures/eden_flint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/textures/eden_flint.png -------------------------------------------------------------------------------- /mods/eden/textures/eden_gravel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/textures/eden_gravel.png -------------------------------------------------------------------------------- /mods/eden/textures/eden_stone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/textures/eden_stone.png -------------------------------------------------------------------------------- /mods/eden/textures/eden_torch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/textures/eden_torch.png -------------------------------------------------------------------------------- /mods/flora/models/flora_cactus.b3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/flora/models/flora_cactus.b3d -------------------------------------------------------------------------------- /mods/gui/textures/gui_arrow_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_arrow_bg.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_hotbar_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_hotbar_bg.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_itemslot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_itemslot.png -------------------------------------------------------------------------------- /mods/players/models/character.b3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/players/models/character.b3d -------------------------------------------------------------------------------- /mods/players/models/character.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/players/models/character.blend -------------------------------------------------------------------------------- /mods/players/models/character.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/players/models/character.png -------------------------------------------------------------------------------- /mods/soil/textures/soil_grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/soil/textures/soil_grass.png -------------------------------------------------------------------------------- /mods/trees/schematics/oak_tree.mts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/schematics/oak_tree.mts -------------------------------------------------------------------------------- /mods/trees/textures/trees_stick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_stick.png -------------------------------------------------------------------------------- /mods/flora/textures/flora_cactus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/flora/textures/flora_cactus.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_formspec_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_formspec_bg.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_icon_trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_icon_trash.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_tab_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_tab_active.png -------------------------------------------------------------------------------- /mods/liquid/textures/liquid_lava.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/liquid/textures/liquid_lava.png -------------------------------------------------------------------------------- /mods/liquid/textures/liquid_water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/liquid/textures/liquid_water.png -------------------------------------------------------------------------------- /mods/ores/textures/ores_coal_lump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/ores/textures/ores_coal_lump.png -------------------------------------------------------------------------------- /mods/ores/textures/ores_coal_ore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/ores/textures/ores_coal_ore.png -------------------------------------------------------------------------------- /mods/ores/textures/ores_gold_ore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/ores/textures/ores_gold_ore.png -------------------------------------------------------------------------------- /mods/ores/textures/ores_iron_ore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/ores/textures/ores_iron_ore.png -------------------------------------------------------------------------------- /mods/trees/schematics/lupuna_tree.mts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/schematics/lupuna_tree.mts -------------------------------------------------------------------------------- /mods/trees/textures/trees_oak_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_oak_log.png -------------------------------------------------------------------------------- /mods/eden/sounds/eden_item_pickup.1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/sounds/eden_item_pickup.1.ogg -------------------------------------------------------------------------------- /mods/eden/sounds/eden_item_pickup.2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/sounds/eden_item_pickup.2.ogg -------------------------------------------------------------------------------- /mods/eden/sounds/eden_item_pickup.3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/sounds/eden_item_pickup.3.ogg -------------------------------------------------------------------------------- /mods/eden/sounds/eden_item_pickup.4.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/sounds/eden_item_pickup.4.ogg -------------------------------------------------------------------------------- /mods/eden/textures/crack_anylength.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/textures/crack_anylength.png -------------------------------------------------------------------------------- /mods/eden/textures/eden_item_smoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/eden/textures/eden_item_smoke.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_formspec_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_formspec_title.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_icon_creative.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_icon_creative.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_icon_inventory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_icon_inventory.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_itemslot_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_itemslot_dark.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_tab_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_tab_inactive.png -------------------------------------------------------------------------------- /mods/ores/textures/ores_diamond_lump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/ores/textures/ores_diamond_lump.png -------------------------------------------------------------------------------- /mods/ores/textures/ores_diamond_ore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/ores/textures/ores_diamond_ore.png -------------------------------------------------------------------------------- /mods/ores/textures/ores_gold_ingot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/ores/textures/ores_gold_ingot.png -------------------------------------------------------------------------------- /mods/ores/textures/ores_iron_ingot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/ores/textures/ores_iron_ingot.png -------------------------------------------------------------------------------- /mods/soil/textures/soil_grass_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/soil/textures/soil_grass_side.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_iron_axe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_iron_axe.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_iron_hoe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_iron_hoe.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_iron_pick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_iron_pick.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_iron_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_iron_sword.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_rock_hoe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_rock_hoe.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_rock_knife.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_rock_knife.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_rock_pick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_rock_pick.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_rock_spade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_rock_spade.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_steel_axe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_steel_axe.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_steel_hoe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_steel_hoe.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_steel_pick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_steel_pick.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_stone_axe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_stone_axe.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_stone_hoe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_stone_hoe.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_stone_pick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_stone_pick.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_lupuna_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_lupuna_log.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_oak_leaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_oak_leaf.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_oak_plank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_oak_plank.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_button_1w_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_button_1w_active.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_button_2w_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_button_2w_active.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_button_3w_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_button_3w_active.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_hotbar_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_hotbar_selected.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_diamond_axe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_diamond_axe.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_diamond_hoe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_diamond_hoe.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_diamond_pick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_diamond_pick.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_iron_shovel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_iron_shovel.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_rock_hatchet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_rock_hatchet.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_steel_shovel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_steel_shovel.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_steel_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_steel_sword.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_stone_shovel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_stone_shovel.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_stone_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_stone_sword.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_lupuna_leaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_lupuna_leaf.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_lupuna_plank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_lupuna_plank.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_oak_sapling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_oak_sapling.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_button_1w_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_button_1w_inactive.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_button_2w_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_button_2w_inactive.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_button_3w_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_button_3w_inactive.png -------------------------------------------------------------------------------- /mods/liquid/textures/liquid_river_water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/liquid/textures/liquid_river_water.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_diamond_shovel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_diamond_shovel.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_diamond_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_diamond_sword.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_rock_xl_knife.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_rock_xl_knife.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_fence_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_fence_overlay.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_lupuna_planks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_lupuna_planks.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_lupuna_sapling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_lupuna_sapling.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_oak_log_sides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_oak_log_sides.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_tab_horizontal_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_tab_horizontal_active.png -------------------------------------------------------------------------------- /mods/tools/textures/tools_diamond_longsword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/tools/textures/tools_diamond_longsword.png -------------------------------------------------------------------------------- /mods/trees/textures/trees_lupuna_log_sides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/trees/textures/trees_lupuna_log_sides.png -------------------------------------------------------------------------------- /mods/gui/textures/gui_tab_horizontal_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/gui/textures/gui_tab_horizontal_inactive.png -------------------------------------------------------------------------------- /mods/liquid/textures/liquid_lava_source_animated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/liquid/textures/liquid_lava_source_animated.png -------------------------------------------------------------------------------- /mods/liquid/textures/liquid_lava_flowing_animated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/liquid/textures/liquid_lava_flowing_animated.png -------------------------------------------------------------------------------- /mods/liquid/textures/liquid_water_flowing_animated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/liquid/textures/liquid_water_flowing_animated.png -------------------------------------------------------------------------------- /mods/liquid/textures/liquid_water_source_animated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/liquid/textures/liquid_water_source_animated.png -------------------------------------------------------------------------------- /mods/mapgen/README.md: -------------------------------------------------------------------------------- 1 | Eden mod: mapgen 2 | ================ 3 | 4 | Authors of source code 5 | ---------------------- 6 | Originally by octacian (LGPL 2.1) 7 | -------------------------------------------------------------------------------- /mods/gamemode/README.md: -------------------------------------------------------------------------------- 1 | Eden mod: gamemode 2 | ================ 3 | 4 | Authors of source code 5 | ---------------------- 6 | Originally by octacian (LGPL 2.1) 7 | -------------------------------------------------------------------------------- /mods/liquid/textures/liquid_river_water_flowing_animated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/liquid/textures/liquid_river_water_flowing_animated.png -------------------------------------------------------------------------------- /mods/liquid/textures/liquid_river_water_source_animated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/liquid/textures/liquid_river_water_source_animated.png -------------------------------------------------------------------------------- /mods/processed_blocks/textures/processed_blocks_wattle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/processed_blocks/textures/processed_blocks_wattle.png -------------------------------------------------------------------------------- /mods/processed_blocks/textures/processed_blocks_oak_plank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/processed_blocks/textures/processed_blocks_oak_plank.png -------------------------------------------------------------------------------- /mods/processed_blocks/textures/processed_blocks_glass_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/processed_blocks/textures/processed_blocks_glass_block.png -------------------------------------------------------------------------------- /mods/processed_blocks/textures/processed_blocks_ladder_wood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/processed_blocks/textures/processed_blocks_ladder_wood.png -------------------------------------------------------------------------------- /mods/processed_blocks/textures/processed_blocks_planks_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/processed_blocks/textures/processed_blocks_planks_overlay.png -------------------------------------------------------------------------------- /mods/processed_blocks/textures/processed_blocks_glass_block_detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/processed_blocks/textures/processed_blocks_glass_block_detail.png -------------------------------------------------------------------------------- /mods/processed_blocks/textures/processed_blocks_stone_bricks_plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/processed_blocks/textures/processed_blocks_stone_bricks_plain.png -------------------------------------------------------------------------------- /mods/processed_blocks/textures/processed_blocks_glass_block_detail_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MisterXtreme/eden/HEAD/mods/processed_blocks/textures/processed_blocks_glass_block_detail_red.png -------------------------------------------------------------------------------- /mods/ores/README.md: -------------------------------------------------------------------------------- 1 | Eden mod: ores 2 | ================ 3 | 4 | Authors of source code 5 | ---------------------- 6 | Originally by octacian (LGPL 2.1) 7 | 8 | Authors of media (textures, models, and sounds) 9 | ----------------------------------------------- 10 | Everything not listed in here: 11 | XtremeHacker (CC BY-SA 3.0) 12 | -------------------------------------------------------------------------------- /mods/soil/README.md: -------------------------------------------------------------------------------- 1 | Eden mod: soil 2 | ================ 3 | 4 | Authors of source code 5 | ---------------------- 6 | Originally by octacian (LGPL 2.1) 7 | 8 | Authors of media (textures, models, and sounds) 9 | ----------------------------------------------- 10 | Everything not listed in here: 11 | XtremeHacker (CC BY-SA 3.0) 12 | -------------------------------------------------------------------------------- /mods/flora/README.md: -------------------------------------------------------------------------------- 1 | Eden mod: flora 2 | =============== 3 | 4 | Authors of source code 5 | ---------------------- 6 | Originally by octacian (LGPL 2.1) 7 | 8 | Authors of media (textures, models, and sounds) 9 | ----------------------------------------------- 10 | Everything not listed in here: 11 | XtremeHacker (CC BY-SA 3.0) 12 | 13 | Jordach (CC BY-SA 3.0): 14 | flora_cactus.b3d 15 | -------------------------------------------------------------------------------- /mods/players/README.md: -------------------------------------------------------------------------------- 1 | Eden mod: players 2 | ================ 3 | 4 | Authors of source code 5 | ---------------------- 6 | Originally by octacian (LGPL 2.1) 7 | 8 | Authors of media (textures, models, and sounds) 9 | ----------------------------------------------- 10 | Everything not listed in here: 11 | XtremeHacker (CC BY-SA 3.0) 12 | 13 | celeron55, Perttu Ahola (CC BY-SA 3.0): 14 | character.b3d 15 | 16 | Jordach (CC BY-SA 3.0): 17 | character.png 18 | -------------------------------------------------------------------------------- /mods/tools/README.md: -------------------------------------------------------------------------------- 1 | Eden mod: tools 2 | ================ 3 | 4 | Authors of source code 5 | ---------------------- 6 | Originally by octacian (LGPL 2.1) 7 | 8 | Authors of media (textures, models, and sounds) 9 | ----------------------------------------------- 10 | Everything not listed in here: 11 | XtremeHacker (CC BY-SA 3.0) 12 | 13 | KaadmY (CC BY-SA 3.0) 14 | tools_steel_axe.png 15 | tools_steel_shovel.png 16 | tools_steel_pick.png 17 | tools_steel_hoe.png 18 | tools_steel_sword.png 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # eden 2 | Eden is a Role playing game like sandbox subgame for the popular FOSS 3 | Engine "Minetest". 4 | 5 | Eden aims to have you create your own identity, 6 | and will allow you to explore the giant, randomly-generated world, filled 7 | with many NPCs, animals, treasures, and many other things, feel free 8 | to mine, quest, build, or whatever tickles your fancy, there is no 9 | right, or wrong way to play, so just have fun! :D 10 | 11 | Eden: Begin, Play, Never end 12 | -XtremeHacker, 2nd readme for Eden, 2017 May 22 13 | -------------------------------------------------------------------------------- /mods/gui/init.lua: -------------------------------------------------------------------------------- 1 | -- gui/init.lua 2 | 3 | gui = {} 4 | 5 | local modpath = minetest.get_modpath("gui") 6 | 7 | -- [on join] Configure hotbar 8 | minetest.register_on_joinplayer(function(player) 9 | player:hud_set_hotbar_itemcount(9) 10 | player:hud_set_hotbar_image("gui_hotbar_bg.png") 11 | player:hud_set_hotbar_selected_image("gui_hotbar_selected.png") 12 | end) 13 | 14 | -- Load API 15 | dofile(modpath.."/api.lua") 16 | -- Load formspecs 17 | dofile(modpath.."/formspec.lua") 18 | -- Load HUD 19 | dofile(modpath.."/hud.lua") 20 | -------------------------------------------------------------------------------- /mods/trees/README.md: -------------------------------------------------------------------------------- 1 | Eden mod: trees 2 | =============== 3 | 4 | The trees mod provides an API and registers trees to be generated across the world. It also implements a chatcommand, `/place_tree ` (`name`: itemstring-like name of tree structure, `pos`: position to place tree at - defaults to current player position). The chatcommand requires the `debug` privilege. 5 | 6 | Authors of source code 7 | ---------------------- 8 | Originally by octacian (LGPL 2.1) 9 | 10 | Authors of media (textures, models, and sounds) 11 | ----------------------------------------------- 12 | Everything not listed in here: 13 | XtremeHacker (CC BY-SA 3.0) 14 | 15 | octacian (CC BY-SA 3.0): 16 | trees_oak_sapling.png (please replace) 17 | -------------------------------------------------------------------------------- /mods/mapgen/init.lua: -------------------------------------------------------------------------------- 1 | -- mapgen/init.lua 2 | 3 | local modpath = minetest.get_modpath("mapgen") 4 | 5 | --- 6 | --- Aliases for map generator outputs 7 | --- 8 | 9 | minetest.register_alias("mapgen_stone", "eden:stone") 10 | minetest.register_alias("mapgen_dirt", "soil:dirt") 11 | minetest.register_alias("mapgen_dirt_with_grass", "soil:dirt_with_grass") 12 | minetest.register_alias("mapgen_sand", "soil:sand") 13 | minetest.register_alias("mapgen_cobble", "eden:cobble") 14 | 15 | --- 16 | --- Load Required Resources 17 | --- 18 | 19 | dofile(modpath.."/biomes.lua") 20 | 21 | --- 22 | --- Load Optional Resources 23 | --- 24 | 25 | if minetest.settings:get("mapgen_rotate_textures") == "true" then 26 | dofile(modpath.."/rotate.lua") 27 | end 28 | -------------------------------------------------------------------------------- /mods/eden/chatcommands.lua: -------------------------------------------------------------------------------- 1 | -- eden/chatcommands.lua 2 | 3 | -- [privelege] Heal 4 | minetest.register_privilege("heal", "Ability to use /heal") 5 | 6 | -- [command] Heal - /heal param 7 | minetest.register_chatcommand("heal", { 8 | description = "Heal yourself or another player", 9 | params = "", 10 | privs = {heal=true}, 11 | func = function(name, param) 12 | local player = minetest.get_player_by_name(name) 13 | if param and minetest.get_player_by_name(param) then 14 | player = minetest.get_player_by_name(param) 15 | elseif param ~= "" then 16 | return true, "Player \""..param.."\" doesn't exist" 17 | end 18 | 19 | -- Set HP 20 | player:set_hp(20) 21 | -- Return message 22 | return true, player:get_player_name().." had been healed" 23 | end, 24 | }) 25 | -------------------------------------------------------------------------------- /mods/eden/README.md: -------------------------------------------------------------------------------- 1 | Eden mod: eden 2 | ================ 3 | 4 | Authors of source code 5 | ---------------------- 6 | Originally by octacian (LGPL 2.1) 7 | Some code is adapted from https://github.com/minetest/minetest_game 8 | 9 | Authors of media (textures, models, and sounds) 10 | ----------------------------------------------- 11 | Some textures are taken from https://github.com/minetest/minetest_game 12 | 13 | Everything not listed in here: 14 | XtremeHacker (CC BY-SA 3.0) 15 | 16 | celeron55, Perttu Ahola (CC BY-SA 3.0): 17 | character.b3d 18 | 19 | Jordach (CC BY-SA 3.0): 20 | character.png 21 | 22 | octacian (CC BY-SA 3.0): 23 | crosshair.png 24 | 25 | Jordan4ibanez (CC BY-SA 3.0): 26 | eden_item_pickup.1.ogg 27 | eden_item_pickup.2.ogg 28 | eden_item_pickup.3.ogg 29 | eden_item_pickup.4.ogg 30 | -------------------------------------------------------------------------------- /mods/gui/README.md: -------------------------------------------------------------------------------- 1 | Eden mod: gui 2 | ================ 3 | 4 | Authors of source code 5 | ---------------------- 6 | Originally by octacian (LGPL 2.1) 7 | 8 | Authors of media (textures, models, and sounds) 9 | ----------------------------------------------- 10 | Everything not listed in here: 11 | XtremeHacker (CC BY-SA 3.0) 12 | 13 | kaadmy (CC BY-SA 4.0): 14 | gui_hotbar_bg.png 15 | gui_hotbar_selected.png 16 | heart.png 17 | bubble.png 18 | gui_formspec_bg.png 19 | gui_tab_active.png 20 | gui_tab_inactive.png 21 | gui_itemslot.png 22 | gui_itemslot_dark.png 23 | gui_button_2w_inactive.png 24 | gui_button_2w_active.png 25 | gui_button_3w_inactive.png 26 | gui_button_3w_active.png 27 | gui_arrow_bg.png 28 | 29 | octacian (CC BY-SA 3.0): 30 | heart_bg.png 31 | bubble_bg.png 32 | gui_formspec_title.png 33 | gui_icon_inventory.png 34 | -------------------------------------------------------------------------------- /mods/players/init.lua: -------------------------------------------------------------------------------- 1 | -- Eden mod: players 2 | -- Adapted from Minetest 0.4 mod: players 3 | -- See README.txt for licensing and other information. 4 | 5 | local modpath = minetest.get_modpath("players") 6 | 7 | -- Load API 8 | dofile(modpath.."/api.lua") 9 | 10 | -- [register] Default players appearance 11 | players.register_model("character.b3d", { 12 | animation_speed = 30, 13 | textures = {"character.png"}, 14 | animations = { 15 | -- Standard animations. 16 | stand = { x= 0, y= 79, }, 17 | lay = { x=162, y=166, }, 18 | walk = { x=168, y=187, }, 19 | mine = { x=189, y=198, }, 20 | walk_mine = { x=200, y=219, }, 21 | sit = { x= 81, y=160, }, 22 | }, 23 | default_model = true, 24 | }) 25 | 26 | --- 27 | --- Load Extra Resources 28 | --- 29 | 30 | -- Load Sprinting 31 | dofile(modpath.."/sprint.lua") 32 | -------------------------------------------------------------------------------- /mods/eden/init.lua: -------------------------------------------------------------------------------- 1 | -- eden/init.lua 2 | 3 | eden = {} 4 | 5 | local modpath = minetest.get_modpath("eden") 6 | 7 | -- [function] Get subgame version information 8 | function eden.get_version() 9 | return { 10 | version = "0.1", 11 | type = "dev", 12 | core = "0.4.15", 13 | core_type = "dev", 14 | } 15 | end 16 | 17 | -- [register] On join send message 18 | minetest.register_on_joinplayer(function(player) 19 | minetest.after(0, function() 20 | minetest.chat_send_player(player:get_player_name(), "This is Eden, a highly" 21 | .." work-in-progress Minetest subgame.") 22 | end) 23 | end) 24 | 25 | -- Load item entity 26 | dofile(modpath.."/item_entity.lua") 27 | -- Load nodes 28 | dofile(modpath.."/nodes.lua") 29 | -- Load chatcommands 30 | dofile(modpath.."/chatcommands.lua") 31 | -- Load wield view 32 | dofile(modpath.."/wield.lua") 33 | -- Load torch 34 | dofile(modpath.."/torch.lua") 35 | -- Load falling nodes 36 | dofile(modpath.."/falling.lua") 37 | -------------------------------------------------------------------------------- /mods/soil/init.lua: -------------------------------------------------------------------------------- 1 | -- soil/init.lua 2 | 3 | soil = {} 4 | 5 | --- 6 | --- API 7 | --- 8 | 9 | -- [function] Register soil 10 | function soil.register(name, def) 11 | if not def.groups then def.groups = {} end 12 | def.groups.crumbly = def.groups.crumbly or 3 13 | def.groups.soil = def.groups.soil or 1 14 | def.is_ground_content = true 15 | def.drop = def.drop or "soil:"..name 16 | 17 | minetest.register_node("soil:"..name, def) 18 | end 19 | 20 | --- 21 | --- Registrations 22 | --- 23 | 24 | -- [soil] Dirt 25 | soil.register("dirt", { 26 | description = "Dirt", 27 | tiles ={"soil_dirt.png"}, 28 | }) 29 | 30 | -- [soil] Dirt with grass 31 | soil.register("dirt_with_grass", { 32 | description = "Dirt with grass", 33 | tiles ={"soil_grass.png"}, 34 | groups = {crumbly=3, soil=1}, 35 | drop = "soil:dirt", 36 | }) 37 | 38 | -- [soil] Sand 39 | soil.register("sand", { 40 | description = "Sand", 41 | tiles = {"soil_sand.png"}, 42 | groups = {soil=0, sand=1, falling_node=1}, 43 | }) 44 | -------------------------------------------------------------------------------- /mods/eden/models/torch_floor.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.78 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | mtllib torch_floor.mtl 4 | o Cube_Cube.001_Cube_Cube.001_Material.003 5 | v 0.062500 0.062500 0.062500 6 | v 0.062500 0.062500 -0.062500 7 | v -0.062500 0.062500 -0.062500 8 | v -0.062500 0.062500 0.062500 9 | v -0.062500 -0.500000 0.062500 10 | v 0.062500 -0.500000 0.062500 11 | v 0.062500 -0.500000 -0.062500 12 | v -0.062500 -0.500000 -0.062500 13 | vt 0.5625 0.5000 14 | vt 0.5625 0.6250 15 | vt 0.4375 0.6250 16 | vt 0.4375 0.5000 17 | vt 0.4375 0.0000 18 | vt 0.5625 0.0000 19 | vt 0.5625 0.1250 20 | vt 0.4375 0.1250 21 | vt 0.5625 0.6250 22 | vt 0.4375 0.6250 23 | vt 0.4375 0.6250 24 | vt 0.4375 0.0000 25 | vt 0.5625 0.6250 26 | vt 0.5625 0.0000 27 | vn 0.0000 1.0000 0.0000 28 | vn 0.0000 0.0000 -1.0000 29 | vn 1.0000 0.0000 0.0000 30 | usemtl Material.004 31 | s 1 32 | f 1/1/1 2/2/1 3/3/1 4/4/1 33 | f 5/5/1 6/6/1 7/7/1 8/8/1 34 | f 1/9/2 6/6/2 5/5/2 4/10/2 35 | f 2/11/3 1/9/3 6/6/3 7/12/3 36 | f 3/13/2 2/11/2 7/12/2 8/14/2 37 | f 4/10/3 5/5/3 8/14/3 3/13/3 38 | -------------------------------------------------------------------------------- /mods/mapgen/biomes.lua: -------------------------------------------------------------------------------- 1 | -- mapgen/biomes.lua 2 | 3 | minetest.clear_registered_biomes() 4 | minetest.clear_registered_decorations() 5 | 6 | --- 7 | --- Register Biomes 8 | --- 9 | 10 | minetest.register_biome({ 11 | name = "eden:grassland", 12 | node_top = "soil:dirt_with_grass", 13 | depth_top = 1, 14 | node_filler = "soil:dirt", 15 | depth_filler = 1, 16 | y_min = 5, 17 | y_max = 31000, 18 | heat_point = 50, 19 | humidity_point = 50, 20 | }) 21 | 22 | minetest.register_biome({ 23 | name = "eden:grassland_ocean", 24 | node_top = "soil:sand", 25 | depth_top = 1, 26 | node_filler = "soil:sand", 27 | depth_filler = 2, 28 | y_min = -31000, 29 | y_max = 4, 30 | heat_point = 50, 31 | humidity_point = 50, 32 | }) 33 | 34 | minetest.register_biome({ 35 | name = "eden:jungle", 36 | node_top = "soil:dirt_with_grass", 37 | depth_top = 1, 38 | depth_filler = "default:dirt", 39 | depth_filler = 3, 40 | node_riverbed = "soil:sand", 41 | depth_riverbed = 2, 42 | y_min = 1, 43 | y_max = 31000, 44 | heat_point = 86, 45 | humidity_point = 65, 46 | }) 47 | -------------------------------------------------------------------------------- /mods/trees/trees.lua: -------------------------------------------------------------------------------- 1 | -- trees/trees.lua 2 | 3 | --- 4 | --- Tree Registrations 5 | --- 6 | 7 | -- Oak 8 | trees.register("oak", { 9 | basename = "Oak", 10 | center = "trees_oak_log.png", 11 | sides = "trees_oak_log_sides.png", 12 | plank = "trees_oak_plank.png", 13 | sapling = "trees_oak_sapling.png", 14 | leaf = "trees_oak_leaf.png", 15 | offset = { x = -3, y = -1, z = -3}, 16 | schematic = "oak_tree.mts", 17 | mapgen = { 18 | place_on = {"soil:dirt_with_grass"}, 19 | fill_ratio = 0.01, 20 | biomes = {"eden:grassland"}, 21 | y_min = 1, 22 | y_max = 200, 23 | }, 24 | }) 25 | 26 | -- Lupuna 27 | trees.register("lupuna", { 28 | basename = "Lupuna", 29 | center = "trees_lupuna_log.png", 30 | sides = "trees_lupuna_log_sides.png", 31 | plank = "trees_lupuna_planks.png", 32 | sapling = "trees_lupuna_sapling.png", 33 | leaf = "trees_lupuna_leaf.png", 34 | offset = { x = -6, y = 0, z = -6}, 35 | schematic = "lupuna_tree.mts", 36 | mapgen = { 37 | place_on = {"soil:dirt_with_grass"}, 38 | fill_ratio = 0.01, 39 | biomes = {"eden:jungle"}, 40 | y_min = 1, 41 | y_max = 200, 42 | }, 43 | }) 44 | -------------------------------------------------------------------------------- /mods/eden/nodes.lua: -------------------------------------------------------------------------------- 1 | -- eden/nodes.lua 2 | 3 | LIGHT_MAX = 14 4 | 5 | -- [register] Stone 6 | minetest.register_node("eden:stone", { 7 | description = "Stone", 8 | tiles ={"eden_stone.png"}, 9 | groups = {cracky=3}, 10 | drop = "eden:cobble", 11 | legacy_mineral = true, 12 | }) 13 | 14 | -- [register] Cobble 15 | minetest.register_node("eden:cobble", { 16 | description = "Cobble", 17 | tiles ={"eden_cobble.png"}, 18 | is_ground_content = false, 19 | groups = {cracky=3}, 20 | }) 21 | minetest.register_craftitem("eden:flint", { 22 | description = "Flint", 23 | inventory_image = "eden_flint.png" 24 | }) 25 | minetest.register_craftitem("eden:rock", { 26 | description = "Rock", 27 | inventory_image = "eden_rock.png" 28 | }) 29 | -- [Register] Gravel 30 | minetest.register_node("eden:gravel", { 31 | description = "Gravel", 32 | tiles = {"eden_gravel.png"}, 33 | groups = {crumbly = 2, falling_node = 1}, 34 | drop = { 35 | max_items = 1, 36 | items = { 37 | {items = {'eden:flint'}, rarity = 16}, 38 | {items = {'eden:rock'}, rarity = 16}, 39 | {items = {'eden:gravel'}, rarity = 1} 40 | } 41 | } 42 | }) 43 | -------------------------------------------------------------------------------- /mods/mapgen/rotate.lua: -------------------------------------------------------------------------------- 1 | -- mapgen/rotate.lua 2 | 3 | local rotate = {} 4 | 5 | --- 6 | --- Rotate Textures 7 | --- 8 | 9 | local nodes = { 10 | "soil:dirt", 11 | "soil:dirt_with_grass", 12 | "soil:sand", 13 | } 14 | 15 | -- Override nodes 16 | for _, node_name in ipairs(nodes) do 17 | rotate[node_name] = true 18 | 19 | minetest.override_item(node_name, { 20 | paramtype2 = "facedir", 21 | after_place_node = function(pos) 22 | local facedir = math.random(0, 3) 23 | minetest.set_node(pos, {name = node_name, param2 = facedir}) 24 | end 25 | }) 26 | end 27 | 28 | -- Check on generated 29 | minetest.register_on_generated(function(minp, maxp, seed) 30 | for z = minp.z, maxp.z, 1 do 31 | for x = minp.x, maxp.x, 1 do 32 | -- Find ground level (0...15) 33 | local ground_y 34 | for y = maxp.y, minp.y, -1 do 35 | local node = minetest.get_node_or_nil({x = x, y = y, z = z}) 36 | if node and node.name ~= "air" and node.name ~= "ignore" then 37 | local is_leaf = minetest.registered_nodes[node.name].groups.leaf 38 | if not is_leaf or is_leaf == 0 then 39 | ground_y = y 40 | break 41 | end 42 | end 43 | end 44 | 45 | if not ground_y then break end 46 | 47 | local p = {x = x, y = ground_y, z = z} 48 | local n = minetest.get_node_or_nil(p) 49 | if n and rotate[n.name] then 50 | local facedir = math.random(0, 3) 51 | minetest.set_node(p, {name = n.name, param2 = facedir}) 52 | end 53 | end 54 | end 55 | end) 56 | -------------------------------------------------------------------------------- /mods/eden/models/torch_wall.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.78 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | mtllib torch_wall.mtl 4 | o Cube_Cube.001_Cube_Cube.001_Material.001 5 | v 0.062469 -0.303502 0.086070 6 | v 0.062469 -0.195248 0.023570 7 | v -0.062531 -0.195248 0.023570 8 | v -0.062531 -0.303502 0.086070 9 | v -0.062531 -0.584752 -0.401070 10 | v 0.062469 -0.584752 -0.401070 11 | v 0.062469 -0.476498 -0.463570 12 | v -0.062531 -0.476498 -0.463570 13 | v 0.353553 0.056811 -0.121957 14 | v 0.353553 -0.224439 -0.609096 15 | v -0.353553 -0.836811 -0.255543 16 | v -0.353553 -0.555561 0.231596 17 | v -0.353553 0.056811 -0.121957 18 | v -0.353553 -0.224439 -0.609096 19 | v 0.353553 -0.836811 -0.255543 20 | v 0.353553 -0.555561 0.231596 21 | vt 0.5625 0.5000 22 | vt 0.5625 0.6250 23 | vt 0.4375 0.6250 24 | vt 0.4375 0.5000 25 | vt 0.4375 0.0000 26 | vt 0.5625 0.0000 27 | vt 0.5625 0.1250 28 | vt 0.4375 0.1250 29 | vt 0.5625 0.6250 30 | vt 0.4375 0.6250 31 | vt 0.4375 0.6250 32 | vt 0.4375 0.0000 33 | vt 0.5625 0.6250 34 | vt 0.5625 0.0000 35 | vt 0.0000 0.5625 36 | vt 0.0000 -0.0000 37 | vt 1.0000 0.0000 38 | vt 1.0000 0.5625 39 | vt 0.0000 0.5625 40 | vt 0.0000 -0.0000 41 | vt 1.0000 0.0000 42 | vt 1.0000 0.5625 43 | vn 0.0000 0.5000 0.8660 44 | vn 0.0000 0.8660 -0.5000 45 | vn 1.0000 -0.0000 0.0000 46 | vn -0.7071 0.6124 -0.3536 47 | vn -0.7071 -0.6124 0.3536 48 | usemtl Material.001 49 | s 1 50 | f 1/1/1 2/2/1 3/3/1 4/4/1 51 | f 5/5/1 6/6/1 7/7/1 8/8/1 52 | f 1/9/2 6/6/2 5/5/2 4/10/2 53 | f 2/11/3 1/9/3 6/6/3 7/12/3 54 | f 3/13/2 2/11/2 7/12/2 8/14/2 55 | f 4/10/3 5/5/3 8/14/3 3/13/3 56 | f 9/15/4 10/16/4 11/17/4 12/18/4 57 | f 13/19/5 14/20/5 15/21/5 16/22/5 58 | -------------------------------------------------------------------------------- /mods/gui/hud.lua: -------------------------------------------------------------------------------- 1 | -- gui/hud.lua 2 | 3 | -- [statbar] Health 4 | minetest.register_on_joinplayer(function(player) 5 | local name = player:get_player_name() 6 | 7 | hudlib.add_statbar(name, "health", { 8 | replace = "health", 9 | position = { x = 0.5, y = 1 }, 10 | size = { x = 24, y = 24 }, 11 | offset = { x = (-10*24)-20, y = -(48+24+16)}, 12 | texture = "heart.png", 13 | background = "heart_bg.png", 14 | min = 0, 15 | max = 20, 16 | start = player:get_hp(), 17 | events = { 18 | damage = function(self, player) 19 | self:set_status(player:get_hp()) 20 | end, 21 | }, 22 | on_step = function(self, player) 23 | local def = gamemode.def(gamemode.get(player)) 24 | if def.damage == false then 25 | self:hide() 26 | else 27 | self:show() 28 | end 29 | end, 30 | }) 31 | end) 32 | 33 | -- [statbar] Breath 34 | minetest.register_on_joinplayer(function(player) 35 | local name = player:get_player_name() 36 | 37 | hudlib.add_statbar(name, "breath", { 38 | show = false, 39 | replace = "breath", 40 | position = { x = 0.5, y = 1 }, 41 | size = { x = 24, y = 24 }, 42 | offset = { x = 20, y = -(48+24+17)}, 43 | texture = "bubble.png", 44 | background = "bubble_bg.png", 45 | min = 0, 46 | max = 20, 47 | events = { 48 | breath = function(self, player) 49 | local bg = hudlib.get_statbar(name, "breath_background") 50 | local air = player:get_breath() 51 | local def = gamemode.def(gamemode.get(player)) 52 | 53 | if air < 11 and def.breath == false then 54 | self:hide() 55 | player:set_breath(11) 56 | return 57 | end 58 | 59 | if air > 10 then 60 | self:hide() 61 | else 62 | self:show() 63 | end 64 | 65 | self:set_status(air * 2) 66 | end, 67 | }, 68 | }) 69 | end) 70 | -------------------------------------------------------------------------------- /mods/gamemode/modes.lua: -------------------------------------------------------------------------------- 1 | -- gamemode/modes.lua 2 | 3 | --- 4 | --- Gamemode Registrations 5 | --- 6 | 7 | -- [gamemode] Survival 8 | gamemode.register("survival", { 9 | aliases = {"s", "0"}, 10 | tab_group = "survival", 11 | hand = { 12 | full_punch_interval = 1.0, 13 | max_drop_level = 0, 14 | groupcaps = { 15 | fleshy = {times={[2]=2.00, [3]=1.00}, uses=0, maxlevel=1}, 16 | crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1}, 17 | snappy = {times={[3]=0.40}, uses=0, maxlevel=1}, 18 | oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, uses=0, maxlevel=3}, 19 | }, 20 | damage_groups = {fleshy=1}, 21 | }, 22 | privileges = { 23 | interact = true, 24 | }, 25 | }) 26 | 27 | local digtime = 25 28 | local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256} 29 | -- [gamemode] Creative 30 | gamemode.register("creative", { 31 | aliases = {"c", "1"}, 32 | tab_group = "creative", 33 | stack_unlimited = true, 34 | item_drops = "auto", 35 | damage = false, 36 | breath = false, 37 | hand = { 38 | range = 10, 39 | full_punch_interval = 0.5, 40 | max_drop_level = 3, 41 | groupcaps = { 42 | crumbly = caps, 43 | cracky = caps, 44 | snappy = caps, 45 | choppy = caps, 46 | oddly_breakable_by_hand = caps, 47 | }, 48 | damage_groups = {fleshy = 10}, 49 | }, 50 | privileges = { 51 | fly = true, fast = true, 52 | }, 53 | }) 54 | 55 | -- [gamemode] Spectator 56 | gamemode.register("spectator", { 57 | aliases = {"o", "2"}, 58 | tab_group = "spectator", 59 | damage = false, 60 | breath = false, 61 | hand = { 62 | range = 0, 63 | on_use = function() return end, 64 | }, 65 | hud_flags = { 66 | hotbar = false, 67 | crosshair = false, 68 | wielditem = false, 69 | minimap = false, 70 | }, 71 | privileges = { 72 | fly = true, noclip = true, fast = true, interact = false, 73 | }, 74 | on_enable = function(player) 75 | player:set_properties({ 76 | visual_size = {x = 0, y = 0}, 77 | makes_footstep_sound = false, 78 | collisionbox = {0}, 79 | }) 80 | player:set_nametag_attributes({color = {a = 0}}) 81 | end, 82 | on_disable = function(player) 83 | player:set_properties({ 84 | visual_size = {x = 1, y = 1}, 85 | makes_footstep_sound = true, 86 | collisionbox = {-0.3, -1, -0.3, 0.3, 1, 0.3} 87 | }) 88 | player:set_nametag_attributes({color = {a = 255, r = 255, g = 255, b = 255}}) 89 | end, 90 | }) 91 | -------------------------------------------------------------------------------- /mods/flora/init.lua: -------------------------------------------------------------------------------- 1 | -- flora/init.lua 2 | 3 | flora = {} 4 | 5 | --- 6 | --- API 7 | --- 8 | 9 | -- [local function] Get connected nodes 10 | local function get_connected_nodes(pos, nodenames, iterator) 11 | local ret = {} 12 | local nodes = { 13 | {x=pos.x + 1, y=pos.y, z=pos.z}, 14 | {x=pos.x - 1, y=pos.y, z=pos.z}, 15 | {x=pos.x, y=pos.y + 1, z=pos.z}, 16 | {x=pos.x, y=pos.y - 1, z=pos.z}, 17 | {x=pos.x, y=pos.y, z=pos.z + 1}, 18 | {x=pos.x, y=pos.y, z=pos.z - 1}, 19 | } 20 | 21 | for _, p in pairs(nodes) do 22 | local node = minetest.get_node_or_nil(p) 23 | 24 | if node then 25 | for _, n in pairs(nodenames) do 26 | if n == node.name then 27 | ret[#ret + 1] = p 28 | 29 | if iterator and type(iterator) == "function" then 30 | iterator(p) 31 | end 32 | end 33 | end 34 | end 35 | end 36 | 37 | return ret 38 | end 39 | 40 | -- [function] Register flora 41 | function flora.register(name, def) 42 | def.node.is_ground_content = false 43 | 44 | if def.real_physics then 45 | local after_dig = def.node.after_dig_node 46 | def.node.after_dig_node = function(pos, node, meta, digger) 47 | if after_dig then 48 | after_dig(pos, node, meta, digger) 49 | end 50 | 51 | if digger then 52 | get_connected_nodes(pos, {"flora:"..name}, function(pos) 53 | local node = minetest.get_node_or_nil(pos) 54 | local node_under = minetest.get_node_or_nil({ 55 | x = pos.x, y = pos.y - 1, z = pos.z 56 | }) 57 | 58 | if node and node_under and node_under.name == "air" then 59 | minetest.node_dig(pos, node, digger) 60 | end 61 | end) 62 | end 63 | end 64 | end 65 | 66 | minetest.register_node("flora:"..name, def.node) 67 | minetest.register_decoration(def.decoration) 68 | end 69 | 70 | --- 71 | --- Registrations 72 | --- 73 | 74 | flora.register("cactus", { 75 | real_physics = true, 76 | node = { 77 | description = "Cactus", 78 | tiles = {{name = "flora_cactus.png", backface_culling = true}}, 79 | drawtype = "mesh", 80 | paramtype = "light", 81 | mesh = "flora_cactus.b3d", 82 | groups = {choppy = 3, flammable = 2, oddly_breakable_by_hand = 1}, 83 | 84 | selection_box = { 85 | type = "fixed", 86 | fixed = {-0.4375, -0.5, -0.4375, 0.4375, 0.5, 0.4375}, 87 | }, 88 | collision_box = { 89 | type = "fixed", 90 | fixed = {-0.4375, -0.5, -0.4375, 0.4375, 0.5, 0.4375}, 91 | }, 92 | }, 93 | decoration = { 94 | deco_type = "simple", 95 | place_on = "soil:sand", 96 | decoration = {"flora:cactus"}, 97 | sidelen = 8, 98 | fill_ratio = 0.004, 99 | height = 3, 100 | y_max = 4, 101 | }, 102 | }) 103 | -------------------------------------------------------------------------------- /mods/tools/tools.lua: -------------------------------------------------------------------------------- 1 | -- tools/tools.lua 2 | 3 | tools.register("iron", "iron", { 4 | material = "ores:iron", 5 | pick = {"tools_iron_pick.png", { 6 | full_punch_interval = 1.0, 7 | max_drop_level=1, 8 | groupcaps={ 9 | cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2}, 10 | }, 11 | damage_groups = {fleshy=4}, 12 | }}, 13 | axe = {"tools_iron_axe.png", { 14 | full_punch_interval = 1.0, 15 | max_drop_level=1, 16 | groupcaps={ 17 | choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20, maxlevel=2}, 18 | }, 19 | damage_groups = {fleshy=4}, 20 | }}, 21 | shovel = {"tools_iron_shovel.png", { 22 | full_punch_interval = 1.1, 23 | max_drop_level=1, 24 | groupcaps={ 25 | crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30, maxlevel=2}, 26 | }, 27 | damage_groups = {fleshy=3}, 28 | }}, 29 | hoe = {"tools_iron_hoe.png"}, 30 | sword = {"tools_iron_sword.png", { 31 | full_punch_interval = 0.8, 32 | max_drop_level=1, 33 | groupcaps={ 34 | snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2}, 35 | }, 36 | damage_groups = {fleshy=6}, 37 | }} 38 | }) 39 | 40 | tools.register("Diamond", "diamond", { 41 | material = "ores:diamond", 42 | pick = {"tools_diamond_pick.png", { 43 | full_punch_interval = 0.9, 44 | max_drop_level=3, 45 | groupcaps={ 46 | cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=3}, 47 | }, 48 | damage_groups = {fleshy=5}, 49 | }}, 50 | axe = {"tools_diamond_axe.png", { 51 | full_punch_interval = 0.9, 52 | max_drop_level=1, 53 | groupcaps={ 54 | choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=2}, 55 | }, 56 | damage_groups = {fleshy=7}, 57 | }}, 58 | shovel = {"tools_diamond_shovel.png", { 59 | full_punch_interval = 1.0, 60 | max_drop_level=1, 61 | groupcaps={ 62 | crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3}, 63 | }, 64 | damage_groups = {fleshy=4}, 65 | }}, 66 | }) 67 | 68 | tools.register("Rock", "rock", { 69 | material = "eden:cobble", 70 | pick = {"tools_rock_pick.png", { 71 | full_punch_interval = 1.2, 72 | max_drop_level=0, 73 | groupcaps={ 74 | cracky = {times={[3]=1.60}, uses=10, maxlevel=1}, 75 | }, 76 | damage_groups = {fleshy=2}, 77 | }}, 78 | hatchet = {"tools_rock_hatchet.png", { 79 | full_punch_interval = 1.0, 80 | max_drop_level=0, 81 | groupcaps={ 82 | choppy = {times={[2]=3.00, [3]=1.60}, uses=10, maxlevel=1}, 83 | }, 84 | damage_groups = {fleshy=2}, 85 | }}, 86 | spade = {"tools_rock_spade.png", { 87 | full_punch_interval = 1.2, 88 | max_drop_level=0, 89 | groupcaps={ 90 | crumbly = {times={[1]=3.00, [2]=1.60, [3]=0.60}, uses=10, maxlevel=1}, 91 | }, 92 | damage_groups = {fleshy=2}, 93 | }}, 94 | hoe = {"tools_rock_hoe.png"}, 95 | knife = {"tools_rock_knife.png", { 96 | full_punch_interval = 1, 97 | max_drop_level=0, 98 | groupcaps={ 99 | snappy={times={[2]=1.6, [3]=0.40}, uses=10, maxlevel=1}, 100 | }, 101 | damage_groups = {fleshy=2}, 102 | }}, 103 | }) 104 | -------------------------------------------------------------------------------- /mods/eden/wield.lua: -------------------------------------------------------------------------------- 1 | -- eden/wield.lua 2 | 3 | -- Code adapted from https://github.com/stujones11/wield3d 4 | 5 | --[[ 6 | 7 | Copyright (C) 2013 Stuart Jones 8 | Copyright (C) 2017 Elijah Duffy 9 | 10 | License: LGPL (relicensed) 11 | 12 | --]] 13 | 14 | --- 15 | --- API 16 | --- 17 | 18 | local player_wielding = {} 19 | 20 | local location = { 21 | "Arm_Right", -- default bone 22 | {x=0, y=5.5, z=3}, -- default position 23 | {x=-90, y=225, z=90}, -- default rotation 24 | {x=0.20, y=0.20}, -- default scale 25 | } 26 | 27 | -- [local function] Add wield entity 28 | local function add_wield_entity(player) 29 | local name = player:get_player_name() 30 | local pos = player:getpos() 31 | if name and pos then 32 | pos.y = pos.y + 0.5 33 | local object = minetest.add_entity(pos, "eden:wield_entity") 34 | if object then 35 | object:set_attach(player, location[1], location[2], location[3]) 36 | object:set_properties({ 37 | textures = {"eden:wield_hand"}, 38 | visual_size = location[4], 39 | }) 40 | player_wielding[name] = {} 41 | player_wielding[name].item = "" 42 | player_wielding[name].object = object 43 | player_wielding[name].location = location 44 | end 45 | end 46 | end 47 | 48 | -- [register] Wield hand 49 | minetest.register_item("eden:wield_hand", { 50 | type = "none", 51 | wield_image = "blank.png", 52 | }) 53 | 54 | -- [register] Wield entity 55 | minetest.register_entity("eden:wield_entity", { 56 | physical = false, 57 | collisionbox = {-0.125,-0.125,-0.125, 0.125,0.125,0.125}, 58 | visual = "wielditem", 59 | on_activate = function(self, staticdata) 60 | if staticdata == "expired" then 61 | self.object:remove() 62 | end 63 | end, 64 | on_punch = function(self) 65 | self.object:remove() 66 | end, 67 | get_staticdata = function(self) 68 | return "expired" 69 | end, 70 | }) 71 | 72 | -- [register] Globalstep 73 | minetest.register_globalstep(function(dtime) 74 | -- Add/update wielditem entity 75 | for _, player in pairs(minetest.get_connected_players()) do 76 | local name = player:get_player_name() 77 | local wield = player_wielding[name] or {} 78 | local stack = player:get_wielded_item() 79 | local item = stack:get_name() or "" 80 | local index = player:get_wield_index() 81 | 82 | if wield.index == index then 83 | if wield.item == item or wield.item == "" and item == "" then 84 | return 85 | end 86 | end 87 | 88 | if wield.object then 89 | wield.index = index 90 | if item ~= wield.item then 91 | wield.item = item 92 | if item == "" then 93 | item = "eden:wield_hand" 94 | end 95 | wield.object:set_properties({ 96 | textures = {item}, 97 | visual_size = location[4], 98 | }) 99 | end 100 | else 101 | add_wield_entity(player) 102 | end 103 | end 104 | end) 105 | 106 | -- [register] On leave player remove object 107 | minetest.register_on_leaveplayer(function(player) 108 | local name = player:get_player_name() 109 | if name then 110 | local wield = player_wielding[name] or {} 111 | if wield.object then 112 | wield.object:remove() 113 | end 114 | player_wielding[name] = nil 115 | end 116 | end) 117 | -------------------------------------------------------------------------------- /mods/processed_blocks/init.lua: -------------------------------------------------------------------------------- 1 | --Functions 2 | processed_blocks = {} 3 | 4 | --[[ 5 | --register general nodes 6 | function processed_blocks.register_node(node_def) 7 | --If no texture name is supplied, fall back to proccessed_blocks_.png 8 | if node_def.texture == nil then 9 | texture = {"processed_blocks_" .. node_def.node_name .. ".png"} 10 | end 11 | --If no description is supplied, fall back to "Proccessed block" 12 | if node_def.desc == nil then 13 | desc = "Proccessed block" 14 | end 15 | --If a keyword (stone, or wood) is passed as the node groups, set the node's groups as the same as those nodes 16 | if node_def.harvest_groups == "stone" or "Stone" then 17 | node_groups = {cracky = 3, stone = 1} 18 | elseif node_def.harvest_groups == "wood" or "Wood" then 19 | node_groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1} 20 | elseif node_def.harvest_groups == "glass" or "Glass" then 21 | node_groups = {cracky = 3, oddly_breakable_by_hand = 3} 22 | end 23 | --register the node 24 | minetest.register_node("processed_blocks:" .. node_def.node_name, { 25 | description = desc, 26 | tiles = texture, 27 | groups = node_groups 28 | }) 29 | end 30 | 31 | --Register treated wood planks 32 | function processed_blocks.register_treated_plank(wood_name) 33 | processed_blocks.register_node(wood_name .. "_plank", "Treated " .. wood_name .. " planks", "wood", wood_name .. "_plank") 34 | end 35 | 36 | 37 | --Register treated wood planks 38 | 39 | processed_blocks.register_treated_plank("oak") 40 | 41 | --Register bricks 42 | 43 | processed_blocks.register_node("stone_bricks_plain", "Plain stone bricks", "stone") 44 | 45 | --Register misc nodes 46 | 47 | --Wattle will be made with mud (wet dirt), clay, sand & straw 48 | processed_blocks.register_node("wattle", "Wattle & Duab", {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1}) 49 | --]] 50 | minetest.register_node("processed_blocks:wattle", { 51 | description = "Wattle & Duab", 52 | tiles = {"processed_blocks_wattle.png"}, 53 | groups = {cracky=3} 54 | }) 55 | 56 | minetest.register_node("processed_blocks:oak_planks", { 57 | description = "processed oak planks", 58 | tiles = {"processed_blocks_oak_plank.png"}, 59 | groups = {cracky=3} 60 | }) 61 | 62 | minetest.register_node("processed_blocks:glass", { 63 | description = "Glass", 64 | use_texture_alpha = true, 65 | drawtype = "glasslike_framed", 66 | tiles = {"processed_blocks_glass_block.png", "processed_blocks_glass_block_detail.png"}, 67 | groups = {cracky=3} 68 | }) 69 | 70 | 71 | minetest.register_node("processed_blocks:sponge", { 72 | description = "Sponge", 73 | tiles = {"processed_blocks_sponge.png"}, 74 | groups = {cracky=3} 75 | }) 76 | 77 | minetest.register_node("processed_blocks:ladder_wood", { 78 | drawtype = "signlike", 79 | description = "Wood Ladder", 80 | tiles = {"processed_blocks_ladder_wood.png"}, 81 | wield_image = "processed_blocks_ladder_wood.png", 82 | inventory_image = "processed_blocks_ladder_wood.png", 83 | paramtype = "light", 84 | paramtype2 = "wallmounted", 85 | sunlight_propagates = true, 86 | walkable = false, 87 | climbable = true, 88 | is_ground_content = false, 89 | selection_box = { 90 | type = "wallmounted", 91 | }, 92 | groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2} 93 | }) 94 | --]] 95 | -------------------------------------------------------------------------------- /settingtypes.txt: -------------------------------------------------------------------------------- 1 | # This file contains all settings displayed in the settings menu under Games -> Eden. 2 | # 3 | # General format: 4 | # name (Readable name) type type_args 5 | # 6 | # Note that the parts are separated by exactly one space 7 | # 8 | # `type` can be: 9 | # - int 10 | # - string 11 | # - bool 12 | # - float 13 | # - enum 14 | # - path 15 | # - filepath 16 | # - key (will be ignored in GUI, since a special key change dialog exists) 17 | # - flags 18 | # - noise_params 19 | # 20 | # `type_args` can be: 21 | # * int: 22 | # - default 23 | # - default min max 24 | # * string: 25 | # - default (if default is not specified then "" is set) 26 | # * bool: 27 | # - default 28 | # * float: 29 | # - default 30 | # - default min max 31 | # * enum: 32 | # - default value1,value2,... 33 | # * path: 34 | # - default (if default is not specified then "" is set) 35 | # * filepath: 36 | # - default (if default is not specified then "" is set) 37 | # * key: 38 | # - default 39 | # * flags: 40 | # Flags are always separated by comma without spaces. 41 | # - default possible_flags 42 | # * noise_params: 43 | # TODO: these are currently treated like strings 44 | # 45 | # Comments directly above a setting are bound to this setting. 46 | # All other comments are ignored. 47 | # 48 | # Comments and (Readable name) are handled by gettext. 49 | # Comments should be complete sentences that describe the setting and possibly 50 | # give the user additional useful insight. 51 | # Sections are marked by a single line in the format: [Section Name] 52 | # Sub-section are marked by adding * in front of the section name: [*Sub-section] 53 | # Sub-sub-sections have two * etc. 54 | # There shouldn't be too much settings per category; settings that shouldn't be 55 | # modified by the "average user" should be in (sub-)categories called "Advanced". 56 | 57 | # If this is disabled, particles are not shown above torches. 58 | eden_torch_particles (Torch Particles) bool true 59 | 60 | [Mapgen] 61 | 62 | # If this is enabled, the top textures of some nodes will be rotated 63 | # as the map generates and when the node is placed for increased variety. 64 | # Only nodes in the `rotate.lua` `nodes` table are effected. 65 | mapgen_rotate_textures (Mapgen: Randomly rotate textures) bool false 66 | 67 | [Player Physics] 68 | 69 | # Primary key that triggers a sprint speed multiplier when held. 70 | # This defaults to aux1, which is also used if fast_move is enabled. 71 | sprint_primary (Primary Sprint Key) string aux1 72 | 73 | # Secondary key that triggers the speed and jump multipliers when double-pressed 74 | # and held for the duration. This is most convenient to map to the "up" ("forward") 75 | # key, as it allows seemlessly enabling sprint by simply double-tapping forward 76 | # without having to move your hand to reach another key. 77 | sprint_second (Secondary Sprint Key) string up 78 | 79 | # If disabled, the secondary sprint key (sprint_second) is not allowed. 80 | sprint_enable_second (Double-tap Secondary Key to Sprint) bool true 81 | 82 | # Speed multiplier applied when sprinting. 83 | # Sprint key configured with the sprint_primary setting. 84 | sprint_speed (Speed Multiplier) float 1.5 85 | 86 | # If enabled, particles are shown behind the player when sprinting, taking on 87 | # the top texture of the node that the player is walking on. 88 | sprint_particles (Enable Particles While Sprinting) bool false 89 | 90 | # Configures the number of particles to be added behind the player as they 91 | # sprint. A greater number gives more variety but causes more load on the server. 92 | sprint_particle_num (Max Number of Particles to Spawn) int 1 0 10 93 | -------------------------------------------------------------------------------- /mods/gui/formspec.lua: -------------------------------------------------------------------------------- 1 | -- gui/formspec.lua 2 | 3 | --- 4 | --- Tabs 5 | --- 6 | 7 | -- [register] Inventory tab 8 | gui.register_tab("inventory", { 9 | icon = "gui_icon_inventory.png", 10 | tooltip = "Inventory", 11 | default = true, 12 | groups = {survival = true, creative = true}, 13 | get = function(name) 14 | return 15 | gui.make_inv(2.3, 1, 3, 3, "current_player", "craft", false) .. 16 | "image[5.25,2;1,1;gui_arrow_bg.png^[transformR270]" .. 17 | "listring[current_player;main]" .. 18 | "listring[current_player;craft]" .. 19 | gui.make_inv(6.25, 2, 1, 1, "current_player", "craftpreview", false) .. 20 | gui.make_inv(0.25, 4.7, 9, 4, "current_player", "main") 21 | end, 22 | handle = function(name, fields) 23 | if fields.quit then 24 | local player = minetest.get_player_by_name(name) 25 | local inv = player:get_inventory() 26 | 27 | if not inv:is_empty("craft") then 28 | local list = inv:get_list("craft") 29 | for _, i in pairs(list) do 30 | if i:is_known() and not i:is_empty() then 31 | minetest.item_drop(i, player, player:get_pos()) 32 | end 33 | end 34 | 35 | inv:set_list("craft", {}) 36 | end 37 | end 38 | end, 39 | }) 40 | 41 | local items = minetest.registered_items 42 | -- [register] Creative inventory tab 43 | gui.register_tab("creative", { 44 | icon = "gui_icon_creative.png", 45 | tooltip = "Creative inventory", 46 | groups = {creative = true}, 47 | get = function(name) 48 | gui.update_creative_inv(name, items) 49 | local inv = gui.creative_inventory[name] 50 | local start_i = inv.start_i or 0 51 | local pagenum = math.floor(start_i / (6*9) + 1) 52 | local pagemax = math.ceil(inv.size / (6*9)) 53 | return 54 | "label[7.48,6.7;" .. minetest.colorize("#FFFF00", tostring(pagenum)) .. " / " .. tostring(pagemax) .. "]" .. 55 | gui.make_inv(0.25, 7.7, 9, 1, "current_player", "main") .. 56 | gui.make_inv(5.25, 6.5, 1, 1, "detached:trash", "main", false) .. 57 | "listring[]" .. 58 | "listring[current_player;main]" .. 59 | "listring[detached:creative_" .. name .. ";main]" .. 60 | gui.make_inv(0.25, 0.25, 9, 6, "detached:creative_" .. name, "main", false, tostring(start_i), true) .. 61 | "field[0.55,6.89;3.2,1;creative_filter;;" .. minetest.formspec_escape(inv.filter) .. "]" .. 62 | gui.make_button(6.65, 6.55, 1, 1, "creative_prev", "<") .. 63 | gui.make_button(8.34, 6.55, 1, 1, "creative_next", ">") .. 64 | gui.make_button(3.35, 6.55, 1, 1, "creative_search", "?") .. 65 | gui.make_button(4, 6.55, 1, 1, "creative_clear", "X") .. 66 | [[ 67 | image[5.33,6.6;0.8,0.8;gui_icon_trash.png] 68 | tooltip[creative_search;Search] 69 | tooltip[creative_clear;Reset] 70 | listring[current_player;main] 71 | listring[current_player;main] 72 | field_close_on_enter[creative_filter;false] 73 | ]] 74 | end, 75 | handle = function(name, fields) 76 | local player = minetest.get_player_by_name(name) 77 | local inv = gui.creative_inventory[name] 78 | assert(inv) 79 | 80 | if fields.creative_clear then 81 | inv.start_i = 0 82 | inv.filter = "" 83 | gui.update_creative_inv(name, items) 84 | elseif fields.creative_search or 85 | fields.key_enter_field == "creative_filter" then 86 | inv.start_i = 0 87 | inv.filter = fields.creative_filter:lower() 88 | gui.update_creative_inv(name, items) 89 | elseif not fields.quit then 90 | local start_i = inv.start_i or 0 91 | 92 | if fields.creative_prev then 93 | start_i = start_i - 6*9 94 | if start_i < 0 then 95 | start_i = inv.size - (inv.size % (6*9)) 96 | if inv.size == start_i then 97 | start_i = math.max(0, inv.size - (6*9)) 98 | end 99 | end 100 | elseif fields.creative_next then 101 | start_i = start_i + 6*9 102 | if start_i >= inv.size then 103 | start_i = 0 104 | end 105 | end 106 | 107 | inv.start_i = start_i 108 | end 109 | end, 110 | }) 111 | -------------------------------------------------------------------------------- /mods/players/sprint.lua: -------------------------------------------------------------------------------- 1 | -- players/sprint.lua 2 | 3 | local sprinting = {} 4 | local secondary = {} 5 | local SPEED = minetest.settings:get("sprint_speed") or 1.5 6 | local PRIMARY = minetest.settings:get("sprint_primary") or "aux1" 7 | local SECOND = minetest.settings:get("sprint_second") or "up" 8 | local PARTICLE_NUM = minetest.settings:get("sprint_particle_num") or 1 9 | local ALLOW_SEC = minetest.settings:get("sprint_enable_second") 10 | local ALLOW_PARTICLES = minetest.settings:get("sprint_particles") 11 | 12 | --- 13 | --- Functions 14 | --- 15 | 16 | local function start_sprint(player, name, trigger) 17 | player:set_physics_override({speed = SPEED}) 18 | sprinting[name] = {is = true, trigger = trigger} 19 | end 20 | 21 | local function stop_sprint(player, name) 22 | player:set_physics_override({speed = 1}) 23 | sprinting[name] = {is = false} 24 | end 25 | 26 | --- 27 | --- Registrations 28 | --- 29 | 30 | minetest.register_globalstep(function(dtime) 31 | for _, player in pairs(minetest.get_connected_players()) do 32 | local name = player:get_player_name() 33 | local ctrl = player:get_player_control() 34 | 35 | if not sprinting[name] then 36 | sprinting[name] = {is = false} 37 | end 38 | 39 | local spr = sprinting[name] 40 | 41 | -- Primary Key 42 | if ctrl[PRIMARY] and ctrl.up and not spr.is then 43 | start_sprint(player, name, "primary") 44 | elseif ((not ctrl[PRIMARY] and spr.is) or 45 | (ctrl[PRIMARY] and not ctrl.up and spr.is)) 46 | and spr.trigger == "primary" then 47 | stop_sprint(player, name) 48 | end 49 | 50 | -- Secondary Key 51 | if ALLOW_SEC ~= "false" and SECOND and SECOND ~= "" and spr.trigger ~= "primary" then 52 | if not secondary[name] then 53 | secondary[name] = {count = 0, time = 0, last = false} 54 | end 55 | 56 | if ctrl[SECOND] ~= secondary[name].last then 57 | if secondary[name].time > 0.3 and not spr.is and 58 | secondary[name].count > 0 and secondary[name].count < 3 then 59 | secondary[name] = {count = 0, time = 0, last = false} 60 | return 61 | end 62 | 63 | if secondary[name].count < 3 and ctrl[SECOND] ~= secondary[name].last then 64 | secondary[name].count = secondary[name].count + 1 65 | secondary[name].last = ctrl[SECOND] 66 | end 67 | 68 | if (secondary[name].count == 3 and ctrl[SECOND]) and ctrl.up and not spr.is then 69 | start_sprint(player, name, "secondary") 70 | elseif ((secondary[name].count > 3 or not ctrl[SECOND]) or not ctrl.up) and 71 | spr.is then 72 | stop_sprint(player, name) 73 | secondary[name] = {count = 0, time = 0, last = false} 74 | end 75 | end 76 | 77 | if not spr.is and secondary[name].count ~= 0 then 78 | secondary[name].time = secondary[name].time + dtime 79 | end 80 | end 81 | 82 | -- Particles 83 | if ALLOW_PARTICLES ~= "false" and spr.is then 84 | local pos = player:get_pos() 85 | pos.y = pos.y - 1 86 | 87 | local node = minetest.get_node_or_nil(pos) 88 | if node and node.name ~= "air" and node.name ~= "ignore" then 89 | local def = minetest.registered_nodes[node.name] 90 | local tile = def.tiles[1] or def.inventory_image or "" 91 | if type(tile) == "string" and PARTICLE_NUM ~= 0 then 92 | minetest.add_particlespawner({ 93 | time = 0.5, 94 | amount = PARTICLE_NUM, 95 | minpos = {x = pos.x - 0.5, y = pos.y + 1.1, z = pos.z - 0.5}, 96 | maxpos = {x = pos.x + 0.5, y = pos.y + 1.1, z = pos.z + 0.5}, 97 | minvel = {x = 0, y = 3, z = 0}, 98 | maxvel = {x = 0, y = 5, z = 0}, 99 | minacc = {x = 0, y = -10, z = 0}, 100 | maxacc = {x = 0, y = -13, z = 0}, 101 | minexptime = 0.5, 102 | maxexptime = 1, 103 | minsize = 0.5, 104 | maxsize = 2, 105 | collisiondetection = true, 106 | vertical = false, 107 | texture = tile, 108 | }) 109 | end 110 | end 111 | end 112 | end 113 | end) 114 | -------------------------------------------------------------------------------- /mods/ores/init.lua: -------------------------------------------------------------------------------- 1 | -- ores/init.lua 2 | 3 | ores = {} 4 | 5 | --- 6 | --- API 7 | --- 8 | 9 | -- [local function] Register oredef 10 | local function register_oredef(ore, def) 11 | local ores = def.ore 12 | 13 | local function register(_) 14 | local oredef = ores[_] 15 | oredef.ore = ore 16 | oredef.ore_type = oredef.ore_type or def.ore_type 17 | oredef.wherein = oredef.wherein or def.ore_wherein 18 | -- Register ore definition 19 | minetest.register_ore(oredef) 20 | end 21 | 22 | for _, i in ipairs(ores) do 23 | register(_) 24 | end 25 | end 26 | 27 | -- [function] Register ore 28 | function ores.register(name, def) 29 | -- Check and register ore definition 30 | if def.ore then 31 | register_oredef("ores:"..name, def) 32 | end 33 | 34 | local drop = "ores:"..name 35 | if def.lump then 36 | drop = "ores:"..name.."_lump" 37 | 38 | if def.drop_wherein ~= false then 39 | drop = { 40 | max_items = 1, 41 | items = { 42 | { 43 | items = {drop, def.ore_wherein}, 44 | rarity = 2, 45 | }, 46 | { 47 | items = {drop}, 48 | rarity = 1, 49 | }, 50 | } 51 | } 52 | end 53 | end 54 | 55 | -- Ore node 56 | minetest.register_node("ores:"..name, { 57 | description = def.basename.." Ore", 58 | tiles = {"eden_stone.png^"..def.texture}, 59 | groups = def.groups, 60 | drop = drop, 61 | }) 62 | 63 | -- Ore Lump 64 | if def.lump then 65 | minetest.register_craftitem("ores:"..name.."_lump", { 66 | description = def.lump_description or def.basename.." Lump", 67 | inventory_image = def.lump, 68 | }) 69 | end 70 | 71 | -- Ingot 72 | if def.ingot then 73 | minetest.register_craftitem("ores:"..name.."_ingot", { 74 | description = def.ingot_description or def.basename.." Ingot", 75 | inventory_image = def.ingot, 76 | }) 77 | end 78 | end 79 | 80 | --- 81 | --- Registrations 82 | --- 83 | 84 | -- [ore] Coal 85 | ores.register("coal", { 86 | basename = "Coal", 87 | texture = "ores_coal_ore.png", 88 | lump = "ores_coal_lump.png", 89 | groups = {cracky = 3}, 90 | ore_type = "scatter", 91 | ore_wherein = "eden:stone", 92 | ore = { 93 | { 94 | clust_scarcity = 8 * 8 * 8, 95 | clust_num_ores = 8, 96 | clust_size = 3, 97 | y_min = -31000, 98 | y_max = 64, 99 | }, 100 | { 101 | clust_scarcity = 24 * 24 * 24, 102 | clust_num_ores = 27, 103 | clust_size = 6, 104 | y_min = -31000, 105 | y_max = 0, 106 | }, 107 | }, 108 | }) 109 | 110 | -- [ore] Iron 111 | ores.register("iron", { 112 | basename = "Iron", 113 | texture = "ores_iron_ore.png", 114 | ingot = "ores_iron_ingot.png", 115 | groups = {cracky = 2}, 116 | ore_type = "scatter", 117 | ore_wherein = "eden:stone", 118 | ore = { 119 | { 120 | clust_scarcity = 7 * 7 * 7, 121 | clust_num_ores = 5, 122 | clust_size = 3, 123 | y_min = -31000, 124 | y_max = 0, 125 | }, 126 | { 127 | clust_scarcity = 24 * 24 * 24, 128 | clust_num_ores = 27, 129 | clust_size = 6, 130 | y_min = -31000, 131 | y_max = -64, 132 | }, 133 | }, 134 | }) 135 | 136 | -- [ore] Gold 137 | ores.register("gold", { 138 | basename = "Gold", 139 | texture = "ores_gold_ore.png", 140 | ingot = "ores_gold_ingot.png", 141 | groups = {cracky = 2}, 142 | ore_type = "scatter", 143 | ore_wherein = "eden:stone", 144 | ore = { 145 | { 146 | clust_scarcity = 15 * 15 * 15, 147 | clust_num_ores = 3, 148 | clust_size = 2, 149 | y_min = -255, 150 | y_max = -64, 151 | }, 152 | { 153 | clust_scarcity = 13 * 13 * 13, 154 | clust_num_ores = 5, 155 | clust_size = 3, 156 | y_min = -31000, 157 | y_max = -256, 158 | }, 159 | }, 160 | }) 161 | 162 | -- [ore] Diamond 163 | ores.register("diamond", { 164 | basename = "Diamond", 165 | texture = "ores_diamond_ore.png", 166 | lump = "ores_diamond_lump.png", 167 | lump_description = "Diamond", 168 | groups = {cracky = 1, level = 3}, 169 | ore_type = "scatter", 170 | ore_wherein = "eden:stone", 171 | ore = { 172 | { 173 | clust_scarcity = 17 * 17 * 17, 174 | clust_num_ores = 4, 175 | clust_size = 3, 176 | y_min = -255, 177 | y_max = -128, 178 | }, 179 | { 180 | clust_scarcity = 15 * 15 * 15, 181 | clust_num_ores = 4, 182 | clust_size = 3, 183 | y_min = -31000, 184 | y_max = -256, 185 | }, 186 | }, 187 | }) 188 | -------------------------------------------------------------------------------- /mods/tools/init.lua: -------------------------------------------------------------------------------- 1 | -- tools/init.lua 2 | 3 | tools = {} 4 | 5 | --- 6 | --- API 7 | --- 8 | 9 | -- [function] Register tool set 10 | function tools.register(basename, basestack, def) 11 | if def.pick then 12 | minetest.register_tool("tools:"..basestack.."_pick", { 13 | description = basename.." Pickaxe", 14 | inventory_image = def.pick[1], 15 | tool_capabilities = def.pick[2], 16 | }) 17 | 18 | minetest.register_craft({ 19 | output = "tools:"..basestack.."_pick", 20 | recipe = { 21 | {def.material, def.material, def.material}, 22 | {"", "trees:stick", ""}, 23 | {"", "trees:stick", ""}, 24 | }, 25 | }) 26 | end 27 | 28 | if def.axe then 29 | minetest.register_tool("tools:"..basestack.."_axe", { 30 | description = basename.." Axe", 31 | inventory_image = def.axe[1], 32 | tool_capabilities = def.axe[2], 33 | }) 34 | 35 | minetest.register_craft({ 36 | output = "tools:"..basestack.."_axe", 37 | recipe = { 38 | {def.material, def.material, ""}, 39 | {def.material, "trees:stick", ""}, 40 | {"", "trees:stick", ""}, 41 | }, 42 | }) 43 | 44 | minetest.register_craft({ 45 | output = "tools:"..basestack.."_axe", 46 | recipe = { 47 | {"", def.material, def.material}, 48 | {"", "trees:stick", def.material}, 49 | {"", "trees:stick", ""}, 50 | }, 51 | }) 52 | end 53 | 54 | if def.hatchet then 55 | minetest.register_tool("tools:"..basestack.."_hatchet", { 56 | description = basename.." Hatchet", 57 | inventory_image = def.hatchet[1], 58 | tool_capabilities = def.hatchet[2], 59 | }) 60 | 61 | minetest.register_craft({ 62 | output = "tools:"..basestack.."_hatchet", 63 | recipe = { 64 | {def.material, def.material, ""}, 65 | {def.material, "trees:stick", ""}, 66 | }, 67 | }) 68 | 69 | minetest.register_craft({ 70 | output = "tools:"..basestack.."_hatchet", 71 | recipe = { 72 | {"", def.material, def.material}, 73 | {"", "trees:stick", def.material}, 74 | }, 75 | }) 76 | end 77 | 78 | if def.shovel then 79 | minetest.register_tool("tools:"..basestack.."_shovel", { 80 | description = basename.." Shovel", 81 | inventory_image = def.shovel[1], 82 | wield_image = def.shovel[1].."^[transformR90", 83 | tool_capabilities = def.shovel[2], 84 | }) 85 | 86 | minetest.register_craft({ 87 | output = "tools:"..basestack.."_shovel", 88 | recipe = { 89 | {"", def.material, ""}, 90 | {"", "trees:stick", ""}, 91 | {"", "trees:stick", ""}, 92 | }, 93 | }) 94 | end 95 | 96 | if def.spade then 97 | minetest.register_tool("tools:"..basestack.."_spade", { 98 | description = basename.." Spade", 99 | inventory_image = def.spade[1], 100 | wield_image = def.spade[1].."^[transformR90", 101 | tool_capabilities = def.spade[2], 102 | }) 103 | 104 | minetest.register_craft({ 105 | output = "tools:"..basestack.."_spade", 106 | recipe = { 107 | {"", def.material, ""}, 108 | {"", "trees:stick", ""}, 109 | }, 110 | }) 111 | end 112 | 113 | if def.hoe then 114 | minetest.register_tool("tools:"..basestack.."_hoe", { 115 | description = basename.." Hoe", 116 | inventory_image = def.hoe[1], 117 | tool_capabilities = def.hoe[2], 118 | }) 119 | 120 | minetest.register_craft({ 121 | output = "tools:"..basestack.."_hoe", 122 | recipe = { 123 | {def.material, def.material, ""}, 124 | {"", "trees:stick", ""}, 125 | {"", "trees:stick", ""}, 126 | }, 127 | }) 128 | 129 | minetest.register_craft({ 130 | output = "tools:"..basestack.."_", 131 | recipe = { 132 | {"", def.material, def.material}, 133 | {"", "trees:stick", ""}, 134 | {"", "trees:stick", ""}, 135 | }, 136 | }) 137 | end 138 | 139 | if def.sword then 140 | minetest.register_tool("tools:"..basestack.."_sword", { 141 | description = basename.." Sword", 142 | inventory_image = def.sword[1], 143 | tool_capabilities = def.sword[2], 144 | }) 145 | 146 | minetest.register_craft({ 147 | output = "tools:"..basestack.."_sword", 148 | recipe = { 149 | {def.material}, 150 | {def.material}, 151 | {"trees:stick"}, 152 | } 153 | }) 154 | end 155 | 156 | if def.knife then 157 | minetest.register_tool("tools:"..basestack.."_knife", { 158 | description = basename.." Knife", 159 | inventory_image = def.knife[1], 160 | tool_capabilities = def.knife[2], 161 | }) 162 | 163 | minetest.register_craft({ 164 | output = "tools:"..basestack.."_knife", 165 | recipe = { 166 | {def.material}, 167 | {"trees:stick"}, 168 | } 169 | }) 170 | end 171 | end 172 | 173 | --- 174 | --- Load Registrations 175 | --- 176 | 177 | dofile(minetest.get_modpath("tools").."/tools.lua") 178 | -------------------------------------------------------------------------------- /mods/eden/torch.lua: -------------------------------------------------------------------------------- 1 | 2 | --[[ 3 | 4 | Torch mod - formerly mod "Torches" 5 | ============================== 6 | 7 | (c) Copyright BlockMen (2013-2015) 8 | (C) Copyright sofar (2016) 9 | (C) Copyright octacian (2017) 10 | 11 | This mod changes the default torch drawtype from "torchlike" to "mesh", 12 | giving the torch a three dimensional appearance. The mesh contains the 13 | proper pixel mapping to make the animation appear as a particle above 14 | the torch, while in fact the animation is just the texture of the mesh. 15 | 16 | The "torch" mod (as mentioned above) has been modified by octacian for use 17 | in Eden. 18 | 19 | 20 | License: 21 | ~~~~~~~~ 22 | (c) Copyright BlockMen (2013-2015) 23 | 24 | Textures and Meshes/Models: 25 | CC-BY 3.0 BlockMen 26 | Note that the models were entirely done from scratch by sofar. 27 | 28 | Code: 29 | Licensed under the GNU LGPL version 2.1 or higher. 30 | You can redistribute it and/or modify it under 31 | the terms of the GNU Lesser General Public License 32 | as published by the Free Software Foundation; 33 | 34 | You should have received a copy of the GNU Lesser General Public 35 | License along with this library; if not, write to the Free Software 36 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 37 | 38 | See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt 39 | 40 | --]] 41 | 42 | local PARTICLES = minetest.settings:get("eden_torch_particles") 43 | 44 | if PARTICLES == "false" then 45 | PARTICLES = false 46 | else 47 | PARTICLES = true 48 | end 49 | 50 | --- 51 | --- Functions 52 | --- 53 | 54 | -- [function] Add particlespawner 55 | local function add(pos) 56 | if PARTICLES then 57 | local meta = minetest.get_meta(pos) 58 | if meta then 59 | local id = minetest.add_particlespawner({ 60 | time = 0, 61 | minpos = {x = pos.x - 0.3, y = pos.y + 0.2, z = pos.z - 0.3}, 62 | maxpos = {x = pos.x + 0.3, y = pos.y + 0.3, z = pos.z + 0.3}, 63 | minvel = {x = 0, y = 0.2, z = 0}, 64 | maxvel = {x = 0, y = 1, z = 0}, 65 | minexptime = 1, 66 | maxexptime = 2, 67 | minsize = 0.5, 68 | maxsize = 2, 69 | collisiondetection = true, 70 | collision_removal = true, 71 | vertical = false, 72 | texture = "eden_item_smoke.png", 73 | }) 74 | meta:set_int("particle_id", id) 75 | end 76 | end 77 | end 78 | 79 | -- [function] Remove particlespawner 80 | local function remove(pos) 81 | if PARTICLES then 82 | local meta = minetest.get_meta(pos) 83 | if meta then 84 | minetest.delete_particlespawner(meta:get_int("particle_id")) 85 | end 86 | end 87 | end 88 | 89 | --- 90 | --- Registrations 91 | --- 92 | 93 | minetest.register_node("eden:torch", { 94 | description = "Torch", 95 | drawtype = "mesh", 96 | mesh = "torch_floor.obj", 97 | inventory_image = "eden_torch.png", 98 | wield_image = "eden_torch.png", 99 | tiles = {"eden_torch.png"}, 100 | paramtype = "light", 101 | paramtype2 = "wallmounted", 102 | sunlight_propagates = true, 103 | walkable = false, 104 | liquids_pointable = false, 105 | light_source = 12, 106 | groups = {choppy=2, dig_immediate=3, flammable=1, attached_node=1}, 107 | drop = "eden:torch", 108 | selection_box = { 109 | type = "wallmounted", 110 | wall_bottom = {-1/8, -1/2, -1/8, 1/8, 2/16, 1/8}, 111 | }, 112 | on_place = function(itemstack, placer, pointed_thing) 113 | local under = pointed_thing.under 114 | local node = minetest.get_node(under) 115 | local def = minetest.registered_nodes[node.name] 116 | if def and def.on_rightclick and 117 | ((not placer) or (placer and not placer:get_player_control().sneak)) then 118 | return def.on_rightclick(under, node, placer, itemstack, 119 | pointed_thing) or itemstack 120 | end 121 | 122 | local above = pointed_thing.above 123 | local wdir = minetest.dir_to_wallmounted(vector.subtract(under, above)) 124 | local fakestack = itemstack 125 | if wdir == 0 then 126 | return 127 | elseif wdir == 1 then 128 | fakestack:set_name("eden:torch") 129 | else 130 | fakestack:set_name("eden:torch_wall") 131 | end 132 | 133 | itemstack = minetest.item_place(fakestack, placer, pointed_thing, wdir) 134 | itemstack:set_name("eden:torch") 135 | 136 | -- Add particles 137 | add(pointed_thing.above) 138 | 139 | return itemstack 140 | end, 141 | on_destruct = function(pos) 142 | remove(pos) 143 | end, 144 | }) 145 | 146 | minetest.register_node("eden:torch_wall", { 147 | drawtype = "mesh", 148 | mesh = "torch_wall.obj", 149 | tiles = {"eden_torch.png"}, 150 | paramtype = "light", 151 | paramtype2 = "wallmounted", 152 | sunlight_propagates = true, 153 | walkable = false, 154 | light_source = 12, 155 | groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1}, 156 | drop = "eden:torch", 157 | selection_box = { 158 | type = "wallmounted", 159 | wall_side = {-1/2, -1/2, -1/8, -1/8, 1/8, 1/8}, 160 | }, 161 | on_destruct = function(pos) 162 | remove(pos) 163 | end, 164 | }) 165 | 166 | if PARTICLES then 167 | minetest.register_lbm({ 168 | label = "Add particles to torches", 169 | name = "eden:torch_particle", 170 | nodenames = {"eden:torch", "eden:torch_wall"}, 171 | run_at_every_load = true, 172 | action = function(pos, node) 173 | -- Add particles 174 | add(pos) 175 | end, 176 | }) 177 | end 178 | -------------------------------------------------------------------------------- /mods/players/api.lua: -------------------------------------------------------------------------------- 1 | -- players/api.lua 2 | 3 | players = {} 4 | 5 | -- Player animation blending 6 | -- Note: This is currently broken due to a bug in Irrlicht, leave at 0 7 | local animation_blend = 0 8 | 9 | players.registered_models = {} 10 | 11 | -- Local for speed. 12 | local models = players.registered_models 13 | 14 | -- [function] Register model 15 | function players.register_model(name, def) 16 | models[name] = def 17 | 18 | if def.default_model then 19 | players.default_model = name 20 | end 21 | end 22 | 23 | -- Player stats and animations 24 | local player_model = {} 25 | local player_textures = {} 26 | local player_anim = {} 27 | local player_sneak = {} 28 | players.attached = {} 29 | 30 | -- [function] Get player animation 31 | function players.get_animation(player) 32 | local name = player:get_player_name() 33 | return { 34 | model = player_model[name], 35 | textures = player_textures[name], 36 | animation = player_anim[name], 37 | } 38 | end 39 | 40 | -- [function] Set player model 41 | function players.set_model(player, model_name) 42 | local name = player:get_player_name() 43 | local model = models[model_name] 44 | if model then 45 | if player_model[name] == model_name then 46 | return 47 | end 48 | player:set_properties({ 49 | mesh = model_name, 50 | textures = player_textures[name] or model.textures, 51 | visual = "mesh", 52 | visual_size = model.visual_size or {x=1, y=1}, 53 | }) 54 | players.set_animation(player, "stand") 55 | else 56 | player:set_properties({ 57 | textures = { "players.png", "player_back.png", }, 58 | visual = "upright_sprite", 59 | }) 60 | end 61 | player_model[name] = model_name 62 | end 63 | 64 | -- [function] Set player textures (skin) 65 | function players.set_textures(player, textures) 66 | local name = player:get_player_name() 67 | player_textures[name] = textures 68 | player:set_properties({textures = textures,}) 69 | end 70 | 71 | -- [function] Set player animation 72 | function players.set_animation(player, anim_name, speed) 73 | local name = player:get_player_name() 74 | if player_anim[name] == anim_name then 75 | return 76 | end 77 | local model = player_model[name] and models[player_model[name]] 78 | if not (model and model.animations[anim_name]) then 79 | return 80 | end 81 | local anim = model.animations[anim_name] 82 | player_anim[name] = anim_name 83 | player:set_animation(anim, speed or model.animation_speed, animation_blend) 84 | end 85 | 86 | -- [function] Set nametag colour 87 | function players.set_nametag_colour(player, colour) 88 | colour = colour or {} 89 | colour.a = colour.a or 255 90 | colour.r = colour.r or 255 91 | colour.g = colour.g or 255 92 | colour.b = colour.b or 255 93 | 94 | player:set_nametag_attributes({color = colour}) 95 | end 96 | 97 | -- [on joinplayer] Update appearance/physics 98 | minetest.register_on_joinplayer(function(player) 99 | if not players.default_model then 100 | return 101 | end 102 | 103 | players.attached[player:get_player_name()] = false 104 | players.set_model(player, players.default_model) 105 | player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30) 106 | 107 | -- Disable sneak glitch 108 | player:set_physics_override({sneak_glitch = false}) 109 | end) 110 | 111 | -- [on leaveplayer] Remove from tables 112 | minetest.register_on_leaveplayer(function(player) 113 | local name = player:get_player_name() 114 | player_model[name] = nil 115 | player_anim[name] = nil 116 | player_textures[name] = nil 117 | end) 118 | 119 | -- Localize for better performance. 120 | local set_animation = players.set_animation 121 | local attached = players.attached 122 | 123 | -- [globalstep] Check each player and apply animations 124 | minetest.register_globalstep(function(dtime) 125 | for _, player in pairs(minetest.get_connected_players()) do 126 | local name = player:get_player_name() 127 | local model_name = player_model[name] 128 | local model = model_name and models[model_name] 129 | if model and not attached[name] then 130 | local controls = player:get_player_control() 131 | local walking = false 132 | local animation_speed_mod = model.animation_speed or 30 133 | 134 | -- Determine if the player is walking 135 | if controls.up or controls.down or controls.left or controls.right then 136 | walking = true 137 | end 138 | 139 | -- Determine if the player is sneaking, and reduce animation speed if so 140 | if controls.sneak then 141 | animation_speed_mod = animation_speed_mod / 2 142 | end 143 | 144 | -- Determine if player sneak status has changed 145 | if player_sneak[name] ~= controls.sneak then 146 | if controls.sneak then 147 | players.set_nametag_colour(player, {a = 0}) -- Update nametag 148 | else 149 | players.set_nametag_colour(player) -- Update nametag 150 | end 151 | end 152 | 153 | -- Apply animations based on what the player is doing 154 | if player:get_hp() == 0 then 155 | set_animation(player, "lay") 156 | elseif walking then 157 | if player_sneak[name] ~= controls.sneak then 158 | player_anim[name] = nil 159 | player_sneak[name] = controls.sneak 160 | end 161 | if controls.LMB then 162 | set_animation(player, "walk_mine", animation_speed_mod) 163 | else 164 | set_animation(player, "walk", animation_speed_mod) 165 | end 166 | elseif controls.LMB then 167 | set_animation(player, "mine") 168 | else 169 | set_animation(player, "stand", animation_speed_mod) 170 | end 171 | end 172 | end 173 | end) 174 | -------------------------------------------------------------------------------- /mods/eden/falling.lua: -------------------------------------------------------------------------------- 1 | -- eden/falling.lua 2 | 3 | minetest.register_entity(":__builtin:falling_node", { 4 | initial_properties = { 5 | visual = "wielditem", 6 | visual_size = {x = 0.667, y = 0.667}, 7 | textures = {}, 8 | physical = true, 9 | is_visible = false, 10 | collide_with_objects = false, 11 | collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, 12 | }, 13 | 14 | node = {}, 15 | meta = {}, 16 | 17 | set_node = function(self, node, meta) 18 | self.node = node 19 | self.meta = meta or {} 20 | self.object:set_properties({ 21 | is_visible = true, 22 | textures = {node.name}, 23 | }) 24 | end, 25 | 26 | get_staticdata = function(self) 27 | local ds = { 28 | node = self.node, 29 | meta = self.meta, 30 | } 31 | return minetest.serialize(ds) 32 | end, 33 | 34 | on_activate = function(self, staticdata) 35 | self.object:set_armor_groups({immortal = 1}) 36 | 37 | local ds = minetest.deserialize(staticdata) 38 | if ds and ds.node then 39 | self:set_node(ds.node, ds.meta) 40 | elseif ds then 41 | self:set_node(ds) 42 | elseif staticdata ~= "" then 43 | self:set_node({name = staticdata}) 44 | end 45 | end, 46 | 47 | on_step = function(self, dtime) 48 | -- Check falling node existence 49 | if not minetest.registered_nodes[self.node.name] then 50 | self.object:remove() 51 | return 52 | end 53 | 54 | -- Set gravity 55 | local acceleration = self.object:getacceleration() 56 | if not vector.equals(acceleration, {x = 0, y = -10, z = 0}) then 57 | self.object:set_acceleration({x = 0, y = -10, z = 0}) 58 | end 59 | -- Turn to actual node when colliding with ground, or continue to move 60 | local pos = self.object:get_pos() 61 | -- Position of bottom center point 62 | local bcp = {x = pos.x, y = pos.y - 0.7, z = pos.z} 63 | -- Avoid bugs caused by an unloaded node below 64 | local bcn = minetest.get_node_or_nil(bcp) 65 | local bcd = bcn and minetest.registered_nodes[bcn.name] 66 | if bcn and (not bcd or bcd.walkable or 67 | (minetest.get_item_group(self.node.name, "float") ~= 0 and 68 | bcd.liquidtype ~= "none")) then 69 | if bcd and bcd.leveled and bcn.name == self.node.name then 70 | local addlevel = self.node.level 71 | if not addlevel or addlevel <= 0 then 72 | addlevel = bcd.leveled 73 | end 74 | if minetest.add_node_level(bcp, addlevel) == 0 then 75 | self.object:remove() 76 | return 77 | end 78 | elseif bcd and bcd.buildable_to and 79 | (minetest.get_item_group(self.node.name, "float") == 0 or 80 | bcd.liquidtype == "none") then 81 | minetest.remove_node(bcp) 82 | return 83 | end 84 | local np = {x = bcp.x, y = bcp.y + 1, z = bcp.z} 85 | -- Check what's here 86 | local n2 = minetest.get_node(np) 87 | local nd = minetest.registered_nodes[n2.name] 88 | -- If it's not air or liquid, drop falling node 89 | if n2.name ~= "air" and (not nd or nd.liquidtype == "none") then 90 | local def = minetest.registered_nodes[self.node.name] 91 | -- Add dropped items 92 | local drops = minetest.get_node_drops(self.node.name, "") 93 | for _, dropped_item in pairs(drops) do 94 | minetest.add_item(np, dropped_item) 95 | end 96 | self.object:remove() 97 | return 98 | else 99 | -- Create node and remove entity 100 | minetest.add_node(np, self.node) 101 | if self.meta then 102 | local meta = minetest.get_meta(np) 103 | meta:from_table(self.meta) 104 | end 105 | self.object:remove() 106 | minetest.check_for_falling(np) 107 | return 108 | end 109 | end 110 | local vel = self.object:get_velocity() 111 | if vector.equals(vel, {x = 0, y = 0, z = 0}) then 112 | local npos = self.object:get_pos() 113 | self.object:setpos(vector.round(npos)) 114 | end 115 | end, 116 | }) 117 | 118 | --- 119 | --- Function Redefinitions 120 | --- 121 | 122 | local function check_attached_node(p, n) 123 | local def = minetest.registered_nodes[n.name] 124 | local d = {x = 0, y = 0, z = 0} 125 | if def.paramtype2 == "wallmounted" or 126 | def.paramtype2 == "colorwallmounted" then 127 | -- The fallback vector here is in case 'wallmounted to dir' is nil due 128 | -- to voxelmanip placing a wallmounted node without resetting a 129 | -- pre-existing param2 value that is out-of-range for wallmounted. 130 | -- The fallback vector corresponds to param2 = 0. 131 | d = minetest.wallmounted_to_dir(n.param2) or {x = 0, y = 1, z = 0} 132 | else 133 | d.y = -1 134 | end 135 | local p2 = vector.add(p, d) 136 | local nn = minetest.get_node(p2).name 137 | local def2 = minetest.registered_nodes[nn] 138 | if def2 and not def2.walkable then 139 | return false 140 | end 141 | return true 142 | end 143 | 144 | local function spawn_falling_node(p, node, meta) 145 | local obj = minetest.add_entity(p, "__builtin:falling_node") 146 | if obj then 147 | obj:get_luaentity():set_node(node, meta) 148 | end 149 | end 150 | 151 | local function drop_attached_node(p) 152 | local n = minetest.get_node(p) 153 | minetest.remove_node(p) 154 | for _, item in pairs(minetest.get_node_drops(n, "")) do 155 | minetest.add_item(p, item) 156 | end 157 | 158 | local def = minetest.registered_nodes[n.name] 159 | if def and def.on_destruct then 160 | def.on_destruct(p) 161 | end 162 | end 163 | 164 | -- [function] Check single position for falling node 165 | function minetest.check_single_for_falling(p) 166 | local n = minetest.get_node(p) 167 | if minetest.get_item_group(n.name, "falling_node") ~= 0 then 168 | local p_bottom = {x = p.x, y = p.y - 1, z = p.z} 169 | -- Only spawn falling node if node below is loaded 170 | local n_bottom = minetest.get_node_or_nil(p_bottom) 171 | local d_bottom = n_bottom and minetest.registered_nodes[n_bottom.name] 172 | if d_bottom and 173 | 174 | (minetest.get_item_group(n.name, "float") == 0 or 175 | d_bottom.liquidtype == "none") and 176 | 177 | (n.name ~= n_bottom.name or (d_bottom.leveled and 178 | minetest.get_node_level(p_bottom) < 179 | minetest.get_node_max_level(p_bottom))) and 180 | 181 | (not d_bottom.walkable or d_bottom.buildable_to) then 182 | n.level = minetest.get_node_level(p) 183 | local meta = minetest.get_meta(p) 184 | local metatable = {} 185 | if meta ~= nil then 186 | metatable = meta:to_table() 187 | end 188 | minetest.remove_node(p) 189 | spawn_falling_node(p, n, metatable) 190 | return true 191 | end 192 | end 193 | 194 | if minetest.get_item_group(n.name, "attached_node") ~= 0 then 195 | if not check_attached_node(p, n) then 196 | drop_attached_node(p) 197 | return true 198 | end 199 | end 200 | 201 | return false 202 | end 203 | -------------------------------------------------------------------------------- /mods/gamemode/init.lua: -------------------------------------------------------------------------------- 1 | -- gamemode/init.lua 2 | 3 | gamemode = {} 4 | 5 | local gamemodes = {} 6 | local aliases = {} 7 | local creative = minetest.setting_getbool("creative_mode") 8 | 9 | --- 10 | --- Callbacks 11 | --- 12 | 13 | -- [register] On join set gamemode 14 | minetest.register_on_joinplayer(function(player) 15 | gamemode.set(player, gamemode.get(player)) 16 | end) 17 | 18 | -- [register] On place node 19 | minetest.register_on_placenode(function(pos, newnode, player, oldnode, itemstack) 20 | local mode = gamemode.def(gamemode.get(player)) 21 | local name = player:get_player_name() 22 | 23 | if not gamemode.can_interact(player) then 24 | minetest.remove_node(pos) 25 | minetest.chat_send_player(name, minetest.colorize("red", "WARNING").. 26 | " You cannot place nodes in "..mode.name.." mode") 27 | return true 28 | end 29 | 30 | return mode.stack_unlimited 31 | end) 32 | 33 | -- [register] On dig node 34 | minetest.register_on_dignode(function(pos, node, player) 35 | if player then 36 | local mode = gamemode.def(gamemode.get(player)) 37 | local name = player:get_player_name() 38 | if not gamemode.can_interact(player) then 39 | minetest.set_node(pos, {name = node.name}) 40 | minetest.chat_send_player(name, minetest.colorize("red", "WARNING").. 41 | " You cannot dig nodes in "..mode.name.." mode") 42 | return true 43 | end 44 | end 45 | end) 46 | 47 | -- [register] On hp change 48 | minetest.register_on_player_hpchange(function(player, hp_change) 49 | local def = gamemode.def(gamemode.get(player)) 50 | if def.damage == false then 51 | return 0 52 | else 53 | return hp_change 54 | end 55 | end, true) 56 | 57 | --- 58 | --- Redefinitions 59 | --- 60 | 61 | local rotate_node = minetest.rotate_node 62 | function minetest.rotate_node(itemstack, placer, pointed_thing) 63 | itemstack = rotate_node(itemstack, placer, pointed_thing) 64 | 65 | local mode = gamemode.def(gamemode.get(placer)) 66 | if not mode.stack_unlimited then 67 | itemstack:take_item(1) 68 | end 69 | 70 | return itemstack 71 | end 72 | 73 | --- 74 | --- API 75 | --- 76 | 77 | -- [function] Register gamemode 78 | function gamemode.register(name, def) 79 | -- Register hand 80 | if def.hand then 81 | minetest.register_item("gamemode:"..name, { 82 | type = "none", 83 | wield_image = def.hand.wield_image or "wieldhand.png", 84 | wield_scale = {x = 1, y = 1, z = 2.5}, 85 | range = def.hand.range, 86 | tool_capabilities = def.hand, 87 | on_use = def.hand.on_use, 88 | }) 89 | 90 | def.hand = "gamemode:"..name 91 | end 92 | 93 | -- Save aliases 94 | if def.aliases then 95 | for _, a in pairs(def.aliases) do 96 | aliases[a] = name 97 | end 98 | end 99 | 100 | def.name = name 101 | gamemodes[name] = def 102 | end 103 | 104 | -- [function] Get gamemode definition 105 | function gamemode.def(name) 106 | if gamemodes[name] then 107 | return gamemodes[name] 108 | else 109 | if aliases[name] then 110 | return gamemodes[aliases[name]] 111 | end 112 | end 113 | end 114 | 115 | -- [function] Set player gamemode 116 | function gamemode.set(player, gm_name) 117 | local gm = gamemode.def(gm_name) 118 | if gm then 119 | local name = player:get_player_name() 120 | local privs = minetest.get_player_privs(name) 121 | 122 | local old_gm = gamemode.def(gamemode.get(player)) 123 | -- Revert HUD flags 124 | if old_gm.hud_flags then 125 | local flags = table.copy(old_gm.hud_flags) 126 | for _, f in pairs(flags) do 127 | flags[_] = not f 128 | end 129 | player:hud_set_flags(flags) 130 | end 131 | -- Revert privileges 132 | if old_gm.privileges then 133 | for _, i in pairs(old_gm.privileges) do 134 | privs[_] = not old_gm.privileges[_] or nil 135 | end 136 | end 137 | -- Check for on disable 138 | if old_gm.on_disable then 139 | old_gm.on_disable(player) 140 | end 141 | 142 | -- Update cache 143 | player:set_attribute("gamemode", gm_name) 144 | -- Update formspec 145 | if gm.tab_group then 146 | gui.set_tab_group(player, gm.tab_group) 147 | end 148 | -- Update HUD flags 149 | if gm.hud_flags then 150 | player:hud_set_flags(gm.hud_flags) 151 | end 152 | -- Check for on enable 153 | if gm.on_enable then 154 | gm.on_enable(player) 155 | end 156 | -- Update privileges 157 | if gm.privileges then 158 | for _, i in pairs(gm.privileges) do 159 | privs[_] = gm.privileges[_] or nil 160 | end 161 | end 162 | -- Update hand 163 | if gm.hand then 164 | player:get_inventory():set_stack("hand", 1, gm.hand) 165 | else -- else, Reset hand 166 | player:get_inventory():set_stack("hand", 1, "") 167 | end 168 | 169 | minetest.set_player_privs(name, privs) 170 | 171 | return true 172 | end 173 | end 174 | 175 | -- [function] Get player gamemode 176 | function gamemode.get(player) 177 | if type(player) == "string" then 178 | player = minetest.get_player_by_name(player) 179 | end 180 | 181 | local gm = player:get_attribute("gamemode") 182 | if not gm or gm == "" then 183 | if creative then gm = "creative" 184 | else gm = "survival" end 185 | end 186 | 187 | if not gamemode.def(gm) then 188 | return "survival" 189 | end 190 | 191 | return gm 192 | end 193 | 194 | -- [function] Can interact 195 | function gamemode.can_interact(player) 196 | local mode = gamemode.def(gamemode.get(player)) 197 | if mode.privileges and mode.privileges.interact == false then 198 | return false 199 | end 200 | 201 | return true 202 | end 203 | 204 | --- 205 | --- Chatcommand 206 | --- 207 | 208 | -- [privelege] Gamemode 209 | minetest.register_privilege("gamemode", "Ability to use /gamemode") 210 | 211 | -- [command] Gamemode - /gamemode 212 | minetest.register_chatcommand("gamemode", { 213 | description = "Change gamemode", 214 | params = " / ", 215 | privs = {gamemode=true}, 216 | func = function(name, param) 217 | local params = param:split(" ") 218 | local player = minetest.get_player_by_name(name) 219 | local newgm 220 | 221 | if params and #params == 1 then 222 | newgm = params[1] 223 | elseif params and #params == 2 then 224 | player = minetest.get_player_by_name(params[1]) 225 | newgm = params[2] 226 | else 227 | return false, "Invalid usage (see /help gamemode)" 228 | end 229 | 230 | if not player then 231 | return false, "Invalid player "..dump(params[1]) 232 | end 233 | 234 | -- Set gamemode 235 | if newgm and gamemode.set(player, newgm) then 236 | local gm_name = gamemode.def(newgm).name 237 | return true, "Set "..player:get_player_name().."'s gamemode to "..gm_name 238 | else -- else, Return invalid gamemode 239 | return false, "Invalid gamemode "..dump(newgm) 240 | end 241 | end, 242 | }) 243 | 244 | --- 245 | --- Load Gamemodes 246 | --- 247 | 248 | dofile(minetest.get_modpath("gamemode").."/modes.lua") 249 | -------------------------------------------------------------------------------- /mods/liquid/init.lua: -------------------------------------------------------------------------------- 1 | -- Eden mod: liquid 2 | -- See README.txt for licensing and other information. 3 | 4 | WATER_ALPHA = 160 5 | WATER_VISC = 1 6 | LAVA_VISC = 7 7 | LIGHT_MAX = 14 8 | 9 | --- 10 | --- Mapgen 11 | --- 12 | 13 | minetest.register_alias("mapgen_water_source", "liquid:water_source") 14 | minetest.register_alias("mapgen_river_water_source", "liquid:river_water_source") 15 | minetest.register_alias("mapgen_lava_source", "liquid:lava_source") 16 | 17 | --- 18 | --- Registrations 19 | --- 20 | 21 | -- [register] Water source 22 | minetest.register_node("liquid:water_source", { 23 | description = "Water Source", 24 | drawtype = "liquid", 25 | tiles = { 26 | { 27 | name = "liquid_water_source_animated.png", 28 | animation = { 29 | type = "vertical_frames", 30 | aspect_w = 16, 31 | aspect_h = 16, 32 | length = 2.0, 33 | }, 34 | }, 35 | }, 36 | special_tiles = { 37 | -- New-style water source material (mostly unused) 38 | { 39 | name = "liquid_water_source_animated.png", 40 | animation = { 41 | type = "vertical_frames", 42 | aspect_w = 16, 43 | aspect_h = 16, 44 | length = 2.0, 45 | }, 46 | backface_culling = false, 47 | }, 48 | }, 49 | alpha = 160, 50 | paramtype = "light", 51 | walkable = false, 52 | pointable = false, 53 | diggable = false, 54 | buildable_to = true, 55 | is_ground_content = false, 56 | drop = "", 57 | drowning = 1, 58 | liquidtype = "source", 59 | liquid_alternative_flowing = "liquid:water_flowing", 60 | liquid_alternative_source = "liquid:water_source", 61 | liquid_viscosity = 1, 62 | post_effect_color = {a = 103, r = 30, g = 60, b = 90}, 63 | groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1}, 64 | }) 65 | 66 | -- [register] Flowing water 67 | minetest.register_node("liquid:water_flowing", { 68 | description = "Flowing Water", 69 | drawtype = "flowingliquid", 70 | tiles = {"liquid_water.png"}, 71 | special_tiles = { 72 | { 73 | name = "liquid_water_flowing_animated.png", 74 | backface_culling = false, 75 | animation = { 76 | type = "vertical_frames", 77 | aspect_w = 16, 78 | aspect_h = 16, 79 | length = 0.8, 80 | }, 81 | }, 82 | { 83 | name = "liquid_water_flowing_animated.png", 84 | backface_culling = true, 85 | animation = { 86 | type = "vertical_frames", 87 | aspect_w = 16, 88 | aspect_h = 16, 89 | length = 0.8, 90 | }, 91 | }, 92 | }, 93 | alpha = 160, 94 | paramtype = "light", 95 | paramtype2 = "flowingliquid", 96 | walkable = false, 97 | pointable = false, 98 | diggable = false, 99 | buildable_to = true, 100 | is_ground_content = false, 101 | drop = "", 102 | drowning = 1, 103 | liquidtype = "flowing", 104 | liquid_alternative_flowing = "liquid:water_flowing", 105 | liquid_alternative_source = "liquid:water_source", 106 | liquid_viscosity = 1, 107 | post_effect_color = {a = 103, r = 30, g = 60, b = 90}, 108 | groups = {water = 3, liquid = 3, puts_out_fire = 1, 109 | not_in_creative_inventory = 1, cools_lava = 1}, 110 | }) 111 | 112 | -- [register] River water source 113 | minetest.register_node("liquid:river_water_source", { 114 | description = "River Water Source", 115 | drawtype = "liquid", 116 | tiles = { 117 | { 118 | name = "liquid_river_water_source_animated.png", 119 | animation = { 120 | type = "vertical_frames", 121 | aspect_w = 16, 122 | aspect_h = 16, 123 | length = 2.0, 124 | }, 125 | }, 126 | }, 127 | special_tiles = { 128 | { 129 | name = "liquid_river_water_source_animated.png", 130 | animation = { 131 | type = "vertical_frames", 132 | aspect_w = 16, 133 | aspect_h = 16, 134 | length = 2.0, 135 | }, 136 | backface_culling = false, 137 | }, 138 | }, 139 | alpha = 160, 140 | paramtype = "light", 141 | walkable = false, 142 | pointable = false, 143 | diggable = false, 144 | buildable_to = true, 145 | is_ground_content = false, 146 | drop = "", 147 | drowning = 1, 148 | liquidtype = "source", 149 | liquid_alternative_flowing = "liquid:river_water_flowing", 150 | liquid_alternative_source = "liquid:river_water_source", 151 | liquid_viscosity = 1, 152 | liquid_renewable = false, 153 | liquid_range = 2, 154 | post_effect_color = {a = 103, r = 30, g = 76, b = 90}, 155 | groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1}, 156 | }) 157 | 158 | -- [register] Flowing river water 159 | minetest.register_node("liquid:river_water_flowing", { 160 | description = "Flowing River Water", 161 | drawtype = "flowingliquid", 162 | tiles = {"liquid_river_water.png"}, 163 | special_tiles = { 164 | { 165 | name = "liquid_river_water_flowing_animated.png", 166 | backface_culling = false, 167 | animation = { 168 | type = "vertical_frames", 169 | aspect_w = 16, 170 | aspect_h = 16, 171 | length = 0.8, 172 | }, 173 | }, 174 | { 175 | name = "liquid_river_water_flowing_animated.png", 176 | backface_culling = true, 177 | animation = { 178 | type = "vertical_frames", 179 | aspect_w = 16, 180 | aspect_h = 16, 181 | length = 0.8, 182 | }, 183 | }, 184 | }, 185 | alpha = 160, 186 | paramtype = "light", 187 | paramtype2 = "flowingliquid", 188 | walkable = false, 189 | pointable = false, 190 | diggable = false, 191 | buildable_to = true, 192 | is_ground_content = false, 193 | drop = "", 194 | drowning = 1, 195 | liquidtype = "flowing", 196 | liquid_alternative_flowing = "liquid:river_water_flowing", 197 | liquid_alternative_source = "liquid:river_water_source", 198 | liquid_viscosity = 1, 199 | liquid_renewable = false, 200 | liquid_range = 2, 201 | post_effect_color = {a = 103, r = 30, g = 76, b = 90}, 202 | groups = {water = 3, liquid = 3, puts_out_fire = 1, 203 | not_in_creative_inventory = 1, cools_lava = 1}, 204 | }) 205 | 206 | -- [register] Lava source 207 | minetest.register_node("liquid:lava_source", { 208 | description = "Lava Source", 209 | drawtype = "liquid", 210 | tiles = { 211 | { 212 | name = "liquid_lava_source_animated.png", 213 | animation = { 214 | type = "vertical_frames", 215 | aspect_w = 16, 216 | aspect_h = 16, 217 | length = 3.0, 218 | }, 219 | }, 220 | }, 221 | special_tiles = { 222 | -- New-style lava source material (mostly unused) 223 | { 224 | name = "liquid_lava_source_animated.png", 225 | animation = { 226 | type = "vertical_frames", 227 | aspect_w = 16, 228 | aspect_h = 16, 229 | length = 3.0, 230 | }, 231 | backface_culling = false, 232 | }, 233 | }, 234 | paramtype = "light", 235 | light_source = LIGHT_MAX - 1, 236 | walkable = false, 237 | pointable = false, 238 | diggable = false, 239 | buildable_to = true, 240 | is_ground_content = false, 241 | drop = "", 242 | drowning = 1, 243 | liquidtype = "source", 244 | liquid_alternative_flowing = "liquid:lava_flowing", 245 | liquid_alternative_source = "liquid:lava_source", 246 | liquid_viscosity = 7, 247 | liquid_renewable = false, 248 | damage_per_second = 4 * 2, 249 | post_effect_color = {a = 191, r = 255, g = 64, b = 0}, 250 | groups = {lava = 3, liquid = 2, igniter = 1}, 251 | }) 252 | 253 | -- [register] Flowing lava 254 | minetest.register_node("liquid:lava_flowing", { 255 | description = "Flowing Lava", 256 | drawtype = "flowingliquid", 257 | tiles = {"liquid_lava.png"}, 258 | special_tiles = { 259 | { 260 | name = "liquid_lava_flowing_animated.png", 261 | backface_culling = false, 262 | animation = { 263 | type = "vertical_frames", 264 | aspect_w = 16, 265 | aspect_h = 16, 266 | length = 3.3, 267 | }, 268 | }, 269 | { 270 | name = "liquid_lava_flowing_animated.png", 271 | backface_culling = true, 272 | animation = { 273 | type = "vertical_frames", 274 | aspect_w = 16, 275 | aspect_h = 16, 276 | length = 3.3, 277 | }, 278 | }, 279 | }, 280 | paramtype = "light", 281 | paramtype2 = "flowingliquid", 282 | light_source = LIGHT_MAX - 1, 283 | walkable = false, 284 | pointable = false, 285 | diggable = false, 286 | buildable_to = true, 287 | is_ground_content = false, 288 | drop = "", 289 | drowning = 1, 290 | liquidtype = "flowing", 291 | liquid_alternative_flowing = "liquid:lava_flowing", 292 | liquid_alternative_source = "liquid:lava_source", 293 | liquid_viscosity = 7, 294 | liquid_renewable = false, 295 | damage_per_second = 4 * 2, 296 | post_effect_color = {a = 191, r = 255, g = 64, b = 0}, 297 | groups = {lava = 3, liquid = 2, igniter = 1, 298 | not_in_creative_inventory = 1}, 299 | }) 300 | -------------------------------------------------------------------------------- /mods/trees/init.lua: -------------------------------------------------------------------------------- 1 | -- tree/init.lua 2 | 3 | trees = {} 4 | trees.registered = {} 5 | 6 | local path = minetest.get_modpath("trees").."/schematics" 7 | 8 | --- 9 | --- Prerequisites 10 | --- 11 | 12 | -- [item] Stick 13 | minetest.register_craftitem("trees:stick", { 14 | description = "Stick", 15 | inventory_image = "trees_stick.png", 16 | }) 17 | 18 | -- [recipe] Stick 19 | minetest.register_craft({ 20 | type = "shapeless", 21 | output = "trees:stick 4", 22 | recipe = {"group:plank"}, 23 | }) 24 | 25 | --- 26 | --- API 27 | --- 28 | 29 | -- [function] Register tree 30 | function trees.register(name, def) 31 | def.items = { 32 | sapling = "trees:"..name, 33 | large = "trees:"..name.."_large", 34 | trunk = "trees:"..name.."_trunk", 35 | log = "trees:"..name.."_log", 36 | plank = "trees:"..name.."_plank", 37 | leaf = "trees:"..name.."_leaf", 38 | wall = "trees:"..name.."_wall", 39 | fence = "trees:"..name.."_fence", 40 | } 41 | local items = def.items 42 | 43 | -- Sapling 44 | minetest.register_node(items.sapling, { 45 | tree_type = name, 46 | description = def.basename.." Sapling", 47 | drawtype = "plantlike", 48 | inventory_image = def.sapling, 49 | wield_image = def.sapling, 50 | tiles = {def.sapling}, 51 | paramtype = "light", 52 | sunlight_propagates = true, 53 | walkable = false, 54 | on_timer = trees.grow, 55 | on_construct = function(pos) 56 | minetest.get_node_timer(pos):start(math.random(def.time.start_min, def.time.start_max)) 57 | end, 58 | selection_box = { 59 | type = "fixed", 60 | fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} 61 | }, 62 | groups = {dig_immediate = 3, flammable = 2, sapling = 1}, 63 | }) 64 | 65 | -- Normal (large) 66 | minetest.register_node(items.large, { 67 | tree_type = name, 68 | description = "Large "..def.basename.." Log", 69 | tiles = {def.center, def.sides}, 70 | paramtype2 = "facedir", 71 | is_ground_content = false, 72 | groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, log = 1}, 73 | on_place = minetest.rotate_node, 74 | }) 75 | 76 | -- Trunk 77 | minetest.register_node(items.trunk, { 78 | tree_type = name, 79 | description = def.basename.." Trunk", 80 | tiles = {def.center, def.sides}, 81 | paramtype = "light", 82 | paramtype2 = "facedir", 83 | is_ground_content = false, 84 | groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, log = 1, not_in_creative_inventory = 1}, 85 | drop = "trees:"..name.."_large", 86 | drawtype = "nodebox", 87 | node_box = { 88 | type = "fixed", 89 | fixed = { 90 | {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25}, -- Base 91 | {-0.1875, -0.5, -0.375, 0.25, 0.375, -0.25}, -- NodeBox3 92 | {0.25, -0.5, -0.1875, 0.375, 0.1875, 0.1875}, -- NodeBox4 93 | {-0.375, -0.5, -0.25, -0.25, 0.25, 0.1875}, -- NodeBox5 94 | {-0.1875, -0.5, 0.25, 0.1875, 0.4375, 0.375}, -- NodeBox6 95 | {-0.0625, -0.5, 0.375, 0.125, 0, 0.4375}, -- NodeBox7 96 | }, 97 | }, 98 | }) 99 | 100 | -- Log 101 | minetest.register_node(items.log, { 102 | tree_type = name, 103 | description = def.basename.." Log", 104 | tiles = {def.center, def.sides}, 105 | paramtype = "light", 106 | paramtype2 = "facedir", 107 | is_ground_content = false, 108 | groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, log = 1, not_in_creative_inventory = 1}, 109 | drop = "trees:"..name.."_large", 110 | drawtype = "nodebox", 111 | node_box = { 112 | type = "connected", 113 | fixed = {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25}, 114 | connect_front = {-0.125, -0.125, -0.5, 0.1875, 0.1875, -0.25}, 115 | connect_back = {-0.1875, -0.125, 0.1875, 0.1875, 0.1875, 0.5}, 116 | connect_left = {-0.5, -0.125, -0.125, -0.25, 0.1875, 0.125}, 117 | connect_right = {0.25, -0.125, -0.125, 0.5, 0.1875, 0.1875}, 118 | }, 119 | connects_to = {"trees:"..name.."_leaf"}, 120 | }) 121 | 122 | -- Plank 123 | minetest.register_node(items.plank, { 124 | tree_type = name, 125 | description = def.basename.." Plank", 126 | tiles = {def.plank}, 127 | is_ground_content = false, 128 | groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 1, plank = 1}, 129 | }) 130 | 131 | -- [recipe] Plank 132 | minetest.register_craft({ 133 | type = "shapeless", 134 | output = items.plank.." 4", 135 | recipe = {"trees:"..name.."_large"}, 136 | }) 137 | 138 | -- Leaf 139 | minetest.register_node(items.leaf, { 140 | tree_type = name, 141 | description = def.basename.." Leaf", 142 | tiles = {def.leaf}, 143 | drawtype = "allfaces_optional", 144 | waving = 1, 145 | paramtype = "light", 146 | paramtype2 = "facedir", 147 | is_ground_content = false, 148 | groups = {snappy = 3, flammable = 2, leaves = 1}, 149 | }) 150 | 151 | -- Wall Node 152 | minetest.register_node(items.wall, { 153 | tree_type = name, 154 | description = def.basename.." Wall", 155 | drawtype = "nodebox", 156 | node_box = { 157 | type = "connected", 158 | fixed = {{-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}}, 159 | connect_front = {{-3/16, -1/2, -1/2, 3/16, 3/8, -1/4}}, 160 | connect_left = {{-1/2, -1/2, -3/16, -1/4, 3/8, 3/16}}, 161 | connect_back = {{-3/16, -1/2, 1/4, 3/16, 3/8, 1/2}}, 162 | connect_right = {{ 1/4, -1/2, -3/16, 1/2, 3/8, 3/16}}, 163 | }, 164 | collision_box = { 165 | type = "fixed", 166 | fixed = {{-1/4, -1/2, -1/4, 1/4, 0.9, 1/4}}, 167 | }, 168 | connects_to = {"group:wall", "group:plank", "group:log"}, 169 | paramtype = "light", 170 | is_ground_content = false, 171 | tiles = {def.sides}, 172 | walkable = true, 173 | groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wall = 1} 174 | }) 175 | 176 | -- [recipe] Wall 177 | minetest.register_craft({ 178 | output = items.wall.." 6", 179 | recipe = { 180 | {items.plank, items.plank, items.plank}, 181 | {items.plank, items.plank, items.plank}, 182 | }, 183 | }) 184 | 185 | -- Fence 186 | minetest.register_node(items.fence, { 187 | tree_type = name, 188 | description = def.basename.." Fence", 189 | inventory_image = "trees_fence_overlay.png^"..def.plank.. 190 | "^trees_fence_overlay.png^[makealpha:255,126,126", 191 | inventory_image = "trees_fence_overlay.png^"..def.plank.. 192 | "^trees_fence_overlay.png^[makealpha:255,126,126", 193 | tiles = {def.plank}, 194 | drawtype = "nodebox", 195 | node_box = { 196 | type = "connected", 197 | fixed = {{-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}}, 198 | connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8}, 199 | {-1/16,-5/16,-1/2,1/16,-3/16,-1/8}}, 200 | connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16}, 201 | {-1/2,-5/16,-1/16,-1/8,-3/16,1/16}}, 202 | connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2}, 203 | {-1/16,-5/16,1/8,1/16,-3/16,1/2}}, 204 | connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16}, 205 | {1/8,-5/16,-1/16,1/2,-3/16,1/16}}, 206 | }, 207 | collision_box = { 208 | type = "fixed", 209 | fixed = {{-1/4, -1/2, -1/4, 1/4, 0.9, 1/4}}, 210 | }, 211 | connects_to = {"group:fence", "group:plank", "group:log"}, 212 | sunlight_propagates = true, 213 | is_ground_content = false, 214 | paramtype = "light", 215 | groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fence = 1}, 216 | }) 217 | 218 | -- [recipe] Fence 219 | minetest.register_craft({ 220 | output = items.fence.." 4", 221 | recipe = { 222 | {items.plank, "trees:stick", items.plank}, 223 | {items.plank, "trees:stick", items.plank}, 224 | }, 225 | }) 226 | 227 | -- Decoration 228 | if def.mapgen and def.schematic then 229 | local mapgen = def.mapgen 230 | mapgen.deco_type = "schematic" 231 | mapgen.sidelen = mapgen.sidelen or 16 232 | mapgen.flags = "place_center_x, place_center_z" 233 | mapgen.rotation = "random" 234 | mapgen.schematic = path.."/"..def.schematic 235 | minetest.register_decoration(mapgen) 236 | end 237 | 238 | -- General 239 | def.name = name 240 | def.min_light = def.min_light or 13 241 | def.time = def.time or { 242 | start_min = 2400, 243 | start_max = 4800, 244 | retry_min = 240, 245 | retry_max = 600, 246 | } 247 | 248 | -- Add to table 249 | trees.registered[name] = def 250 | end 251 | 252 | -- [function] Get name 253 | function trees.get_name(pos) 254 | local node = minetest.get_node_or_nil(pos) 255 | if node then 256 | local def = minetest.registered_nodes[node.name] 257 | if def.tree_type and trees.registered[def.tree_type] then 258 | return def.tree_type 259 | end 260 | end 261 | end 262 | 263 | -- [function] Get definition 264 | function trees.get_def(pos) 265 | local node = minetest.get_node_or_nil(pos) 266 | if node then 267 | local def = minetest.registered_nodes[node.name] 268 | if def.tree_type and trees.registered[def.tree_type] then 269 | return trees.registered[def.tree_type] 270 | end 271 | end 272 | end 273 | 274 | -- [function] Can grow 275 | function trees.can_grow(pos) 276 | local def = trees.get_def(pos) 277 | if not def then return end 278 | 279 | local light = def.min_light 280 | 281 | local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z}) 282 | -- Check for node under 283 | if not node_under then 284 | return 285 | end 286 | 287 | local name_under = node_under.name 288 | -- Check if soil group 289 | if minetest.get_item_group(name_under, "soil") == 0 then 290 | return 291 | end 292 | 293 | local light_level = minetest.get_node_light(pos) 294 | if light and not light_level or light_level < light then 295 | return 296 | end 297 | 298 | return true 299 | end 300 | 301 | -- [function] Place tree 302 | function trees.place(name, pos) 303 | if trees.registered[name] then 304 | local tree = trees.registered[name] 305 | if tree.schematic then 306 | if tree.offset then 307 | pos = vector.add(tree.offset, pos) 308 | end 309 | 310 | return minetest.place_schematic(pos, path.."/"..tree.schematic, "random", 311 | nil, false) 312 | end 313 | end 314 | end 315 | 316 | -- [function] Grow tree 317 | function trees.grow(pos) 318 | if trees.can_grow(pos) then 319 | local name = trees.get_name(pos) 320 | local basename = trees.get_def(pos).basename 321 | -- Log message 322 | minetest.log("action", "A "..basename.." sapling grows into a tree at ".. 323 | minetest.pos_to_string(pos)) 324 | -- Place tree 325 | trees.place(name, pos) 326 | else 327 | local def = trees.get_def(pos) 328 | if def then 329 | minetest.get_node_timer(pos):start(math.random(def.time.retry_min, def.time.retry_max)) 330 | end 331 | end 332 | end 333 | 334 | --- 335 | --- Chatcommands 336 | --- 337 | 338 | -- [register chatcommand] Place tree 339 | minetest.register_chatcommand("place_tree", { 340 | description = "[DEBUG] Place tree", 341 | params = " ", 342 | privs = {debug=true}, 343 | func = function(name, param) 344 | local tname, p = string.match(param, "^([^ ]+) *(.*)$") 345 | local pos = minetest.string_to_pos(p) 346 | 347 | if not pos then 348 | pos = minetest.get_player_by_name(name):getpos() 349 | end 350 | 351 | return true, "Success: "..dump(trees.place(tname, pos)) 352 | end 353 | }) 354 | 355 | --- 356 | --- Load Trees 357 | --- 358 | 359 | dofile(minetest.get_modpath("trees").."/trees.lua") 360 | -------------------------------------------------------------------------------- /mods/gui/api.lua: -------------------------------------------------------------------------------- 1 | -- gui/api.lua 2 | 3 | gui.colors = "listcolors[#00000000;#00000010;#00000000;#68B259;#FFF]" 4 | gui.bg = "bgcolor[#00000000;false]" 5 | 6 | local forms = {} 7 | 8 | --- 9 | --- Helpers 10 | --- 11 | 12 | -- [local function] Preprocess 13 | local function pre(player, name, form, group) 14 | form = "size[9.5,9]"..form..gui.colors..gui.bg.."background[0,0;9.5,9;gui_formspec_bg.png]" 15 | 16 | local tab = gui.get_tab(name) 17 | local tabs = forms 18 | local group = group or gui.get_inv_group(player) 19 | if group then 20 | tabs = gui.get_tabs_by_group(group) 21 | end 22 | 23 | local vx, vy = -0.91, 0.5 24 | local hx, hy = 0.5, -0.96 25 | -- Generate tabs 26 | for _, f in pairs(tabs) do 27 | local x, y, r = vx, vy, "" 28 | local style = f.style or "vertical" 29 | local icon = f.icon or "gui_null.png" 30 | local tooltip = f.tooltip or "" 31 | local tab = { 32 | active = "gui_tab_active.png", 33 | inactive = "gui_tab_inactive.png", 34 | } 35 | local shift = { 36 | active = {x = 1, y = 0}, 37 | inactive = {x = 1, y = -1}, 38 | } 39 | 40 | if style == "horizontal" then 41 | x, y = hx, hy 42 | tab = { 43 | active = "gui_tab_horizontal_active.png", 44 | inactive = "gui_tab_horizontal_inactive.png", 45 | } 46 | shift = { 47 | active = {x = 0, y = 2}, 48 | inactive = {x = 0, y = 1}, 49 | } 50 | end 51 | 52 | local shifted_icon = "[combine:16x16:0,0="..tab.active..":"..shift.active.x..","..shift.active.y.."="..icon 53 | icon = "[combine:16x16:0,0="..tab.inactive..":"..shift.inactive.x..","..shift.inactive.y.."="..icon 54 | 55 | form = form .. "image_button["..x..","..y..";1,1;"..minetest.formspec_escape(icon) 56 | ..";".."tab_"..f.name..";;true;false;"..minetest.formspec_escape(shifted_icon).."]" 57 | .."tooltip[tab_"..f.name..";"..tooltip.."]" 58 | 59 | if style == "horizontal" then 60 | hx = x + 0.82 61 | elseif style == "vertical" then 62 | vy = y + 0.82 63 | end 64 | end 65 | 66 | return form 67 | end 68 | 69 | --- 70 | --- Callbacks 71 | --- 72 | 73 | -- [register] On join 74 | minetest.register_on_joinplayer(function(player) 75 | -- Set inventory size 76 | player:get_inventory():set_size("main", 9 * 3) 77 | -- Initialize creative inventory 78 | gui.init_creative_inv(player) 79 | end) 80 | 81 | -- [register] On receive fields 82 | minetest.register_on_player_receive_fields(function(player, formname, fields) 83 | if formname == "" then 84 | formname = player:get_attribute("inv_form") or "gui:inventory" 85 | end 86 | 87 | formname = formname:split(":") 88 | 89 | if formname[1] == "gui" and gui.get_tab(formname[2]) then 90 | -- Check for tab clicks 91 | for _, f in pairs(forms) do 92 | if fields["tab_"..f.name] then 93 | gui.set_current_tab(player, f.name) 94 | return 95 | end 96 | end 97 | 98 | local handle = gui.get_tab(formname[2]).handle 99 | if handle then 100 | handle(player:get_player_name(), fields) 101 | end 102 | end 103 | end) 104 | 105 | --- 106 | --- API 107 | --- 108 | 109 | -- [function] Register tab 110 | function gui.register_tab(name, def) 111 | def.name = name 112 | forms[#forms + 1] = def 113 | end 114 | 115 | -- [function] Get tab 116 | function gui.get_tab(name) 117 | for _, f in pairs(forms) do 118 | if f.name == name then 119 | return f 120 | end 121 | end 122 | end 123 | 124 | -- [function] Get tabs by group 125 | function gui.get_tabs_by_group(group) 126 | local tabs = {} 127 | for _, f in pairs(forms) do 128 | if f.groups[group] then 129 | tabs[#tabs + 1] = f 130 | end 131 | end 132 | return tabs 133 | end 134 | 135 | -- [function] Get group default tab 136 | function gui.get_group_default(group) 137 | local tabs = gui.get_tabs_by_group(group) 138 | if tabs then 139 | for _, f in pairs(tabs) do 140 | if f.default then 141 | return f 142 | end 143 | end 144 | end 145 | end 146 | 147 | -- [function] Set current tab 148 | function gui.set_current_tab(player, formname) 149 | if type(player) == "string" then 150 | player = minetest.get_player_by_name(player) 151 | end 152 | local name = player:get_player_name() 153 | 154 | if gui.get_tab(formname) then 155 | local f = gui.get_tab(formname) 156 | 157 | player:set_inventory_formspec(pre(player, f.name, f.get(name))) 158 | player:set_attribute("inv_form", "gui:"..f.name) 159 | end 160 | end 161 | 162 | -- [function] Get player inventory group 163 | function gui.get_inv_group(player) 164 | if type(player) == "string" then 165 | player = minetest.get_player_by_name(player) 166 | end 167 | 168 | local attr = player:get_attribute("inv_tab_group") 169 | if attr and attr ~= "" then 170 | return attr 171 | end 172 | end 173 | 174 | -- [function] Set tab group 175 | function gui.set_tab_group(player, group) 176 | if type(player) == "string" then 177 | player = minetest.get_player_by_name(player) 178 | end 179 | local name = player:get_player_name() 180 | 181 | -- Set attribute 182 | player:set_attribute("inv_tab_group", group) 183 | 184 | local default = gui.get_group_default(group) 185 | if default then 186 | player:set_inventory_formspec(pre(player, default.name, default.get(name), group)) 187 | player:set_attribute("inv_form", "gui:"..default.name) 188 | end 189 | end 190 | 191 | -- [function] Get itemslot background 192 | function gui.get_itemslot_bg(x, y, w, h, count) 193 | local num = 0 194 | local out = "" 195 | 196 | for j = 0, h - 1, 1 do 197 | for i = 0, w - 1, 1 do 198 | out = out .."image["..x+i..","..y+j..";1,1;gui_itemslot.png]" 199 | num = num + 1 200 | if count and num >= count then 201 | return out 202 | end 203 | end 204 | end 205 | 206 | return out 207 | end 208 | 209 | -- [function] Get hotbar itemslot background 210 | function gui.get_hotbar_itemslot_bg(x, y, w, h) 211 | local out = "" 212 | for i = 0, w - 1, 1 do 213 | for j = 0, h - 1, 1 do 214 | out = out .."image["..x+i..","..y+j..";1,1;gui_itemslot.png^gui_itemslot_dark.png]" 215 | end 216 | end 217 | return out 218 | end 219 | 220 | -- [function] Make inventory 221 | function gui.make_inv(x, y, w, h, location, name, hotbar, start, strict_count) 222 | start = start or "" 223 | 224 | if hotbar ~= false then 225 | hotbar = gui.get_hotbar_itemslot_bg(x, y, w, 1) 226 | else 227 | hotbar = "" 228 | end 229 | 230 | local count 231 | if strict_count then 232 | local inv 233 | local split = location:split(":") 234 | if location == "context" then 235 | inv = minetest.get_inventory({type = "node", pos = strict_count}) 236 | elseif location == "current_player" then 237 | if type(strict_count) == "userdata" then 238 | strict_count = strict_count:get_player_name() 239 | end 240 | 241 | inv = minetest.get_inventory({type = "player", name = strict_count}) 242 | elseif split and split[1] == "player" and split[2] then 243 | inv = minetest.get_inventory({type = "player", name = split[2]}) 244 | elseif split and split[1] == "nodemeta" and split[2] then 245 | local pos = minetest.string_to_pos(split[2]) 246 | if pos then 247 | inv = minetest.get_inventory({type = "node", pos = pos}) 248 | end 249 | elseif split and split[1] == "detached" and split[2] then 250 | inv = minetest.get_inventory({type = "detached", name = split[2]}) 251 | end 252 | 253 | if inv then 254 | local size = 0 255 | local list = inv:get_list(name) 256 | for _, i in pairs(list) do 257 | if i:is_known() and not i:is_empty() then 258 | size = size + 1 259 | end 260 | end 261 | 262 | if size and size > 0 then 263 | count = size 264 | end 265 | end 266 | end 267 | 268 | return "list["..location..";"..name..";"..x..","..y..";"..w..","..h..";"..start.."]" 269 | ..hotbar..gui.get_itemslot_bg(x, y, w, h, (count or nil)) 270 | end 271 | 272 | -- [function] Make button 273 | function gui.make_button(x, y, w, h, name, label, noclip, exit) 274 | local nc = tostring(noclip) or "false" 275 | 276 | local type = "image_button" 277 | if exit == true then 278 | type = "image_button_exit" 279 | end 280 | 281 | if w == 1 then 282 | return type.."["..x..","..y..";"..w..","..h..";gui_button_1w_inactive.png;" 283 | ..name..";"..label..";"..nc..";false;gui_button_1w_active.png]" 284 | elseif w == 2 then 285 | return type.."["..x..","..y..";"..w..","..h..";gui_button_2w_inactive.png;" 286 | ..name..";"..label..";"..nc..";false;gui_button_2w_active.png]" 287 | else 288 | return type.."["..x..","..y..";"..w..","..h..";gui_button_3w_inactive.png;" 289 | ..name..";"..label..";"..nc..";false;gui_button_3w_active.png]" 290 | end 291 | end 292 | 293 | --- 294 | --- Creative inventory 295 | --- 296 | 297 | -- Code adapted from Minetest Game. 298 | 299 | gui.creative_inventory = {} 300 | 301 | -- [function] Initialize creative inventory 302 | function gui.init_creative_inv(player) 303 | local player_name = player:get_player_name() 304 | gui.creative_inventory[player_name] = { 305 | size = 0, 306 | filter = "", 307 | start_i = 0 308 | } 309 | 310 | minetest.create_detached_inventory("creative_" .. player_name, { 311 | allow_move = function(inv, from_list, from_index, to_list, to_index, count, player2) 312 | if not to_list == "main" then 313 | return count 314 | else 315 | return 0 316 | end 317 | end, 318 | allow_put = function(inv, listname, index, stack, player2) 319 | return 0 320 | end, 321 | allow_take = function(inv, listname, index, stack, player2) 322 | return -1 323 | end, 324 | on_move = function(inv, from_list, from_index, to_list, to_index, count, player2) 325 | end, 326 | on_put = function(inv, listname, index, stack, player2) 327 | end, 328 | on_take = function(inv, listname, index, stack, player2) 329 | if stack and stack:get_count() > 0 then 330 | minetest.log("action", player_name .. " takes " .. stack:get_name().. " from creative inventory") 331 | end 332 | end, 333 | }, player_name) 334 | 335 | gui.update_creative_inv(player_name, minetest.registered_items) 336 | end 337 | 338 | -- [function] Update creative inventory 339 | function gui.update_creative_inv(player_name, content) 340 | local creative_list = {} 341 | local player_inv = minetest.get_inventory({type = "detached", name = "creative_" .. player_name}) 342 | local inv = gui.creative_inventory[player_name] 343 | if not inv then 344 | gui.init_creative_inv(minetest.get_player_by_name(player_name)) 345 | end 346 | 347 | for name, def in pairs(content) do 348 | if not (def.groups.not_in_creative_inventory == 1) and 349 | def.description and def.description ~= "" and 350 | (def.name:find(inv.filter, 1, true) or 351 | def.description:lower():find(inv.filter, 1, true)) then 352 | creative_list[#creative_list+1] = name 353 | end 354 | end 355 | 356 | table.sort(creative_list) 357 | player_inv:set_size("main", #creative_list) 358 | player_inv:set_list("main", creative_list) 359 | inv.size = #creative_list 360 | end 361 | 362 | -- Trash inventory 363 | local trash = minetest.create_detached_inventory("trash", { 364 | allow_put = function(inv, listname, index, stack, player) 365 | return stack:get_count() 366 | end, 367 | on_put = function(inv, listname) 368 | inv:set_list(listname, {}) 369 | end, 370 | }) 371 | trash:set_size("main", 1) 372 | -------------------------------------------------------------------------------- /game_api.md: -------------------------------------------------------------------------------- 1 | Eden API 2 | ======== 3 | GitHub Repo: https://github.com/RevDevGames/eden 4 | 5 | The Eden subgame allows you to extend even further in addition to the Minetest engine's built-in API through many custom APIs. For information on the Minetest API, visit https://github.com/minetest/minetest/blob/master/doc/lua_api.txt 6 | 7 | Please note: 8 | 9 | * [XYZ] refers to a section the Minetest API 10 | * [#ABC] refers to a section in this document 11 | * [pos] refers to a position table `{x = -5, y = 0, z = 200}` 12 | 13 | Eden API 14 | -------- 15 | The Eden mod API allows you to get information about the current subgame version and also ducuments overriden core Minetest functions with important changes. 16 | 17 | `eden.get_version()` 18 | 19 | * Returns a table containing fields `version`, `type` (release type), `core` (corresponding Minetest core version), `core_type` (correspending release type of Minetest core). 20 | 21 | `minetest.add_item(pos, item, random_velocity)` 22 | 23 | * Returns object if the item entity was successfully added to the world 24 | * `pos`: Positional vector 25 | * `item`: ItemString or ItemStack 26 | * `random_velocity`: Causes a random offset to be added to the initial position via velocity (default: `true`) 27 | 28 | Gamemode API 29 | ------------ 30 | The gamemode API allows registering new gamemodes to be used in-game. 31 | 32 | `gamemode.register(name, def)` 33 | 34 | * Register a new gamemode for use with `/gamemode` chatcommand 35 | * `name`: Name for gamemode 36 | * `def`: See [#Gamemode definition] 37 | 38 | `gamemode.set(player, gamemode)` 39 | 40 | * Set the gamemode of a player 41 | * Returns `true` if successful, otherwise, gamemode does not exist 42 | * `player`: PlayerRef 43 | * `gamemode`: Name of gamemode 44 | 45 | `gamemode.get(player)` 46 | 47 | * Get the gamemode of a player 48 | * If the player has no gamemode set, it will be automatically set depending on the `creative_enabled` setting in `minetest.conf` 49 | * `player`: PlayerRef or username 50 | 51 | `gamemode.def(name)` 52 | 53 | * Get gamemode definition 54 | * `name`: Name of gamemode 55 | 56 | `gamemode.can_interact(player)` 57 | 58 | * Returns `true` if the player can interact with objects in the world 59 | * `player`: PlayerRef or username 60 | 61 | #### Gamemode definition 62 | ```lua 63 | { 64 | tab_group = "creative", -- Group of tabs to be shown in inventory 65 | aliases = {"c", "1"}, -- Aliases that refer to the gamemode 66 | 67 | -- Gamemode-specific hand definition 68 | hand = { 69 | range = 10 -- Custom range 70 | on_use = function() ... end, -- Custom on_use 71 | full_punch_interval = 1.0, 72 | max_drop_level = 0, 73 | groupcaps = { 74 | fleshy = {times={[2]=2.00, [3]=1.00}, uses=0, maxlevel=1}, 75 | crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1}, 76 | snappy = {times={[3]=0.40}, uses=0, maxlevel=1}, 77 | oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, 78 | uses=0, maxlevel=3}, 79 | }, 80 | damage_groups = {fleshy=1}, 81 | }, 82 | 83 | stack_unlimited = true, -- Whether the player can place an infinite amount of blocks from a single itemstack 84 | item_drops = "auto", -- Automatically pick up item if not in inventory (used by creative), else drop item 85 | hud_flags = { hotbar = false }, -- Change HUD flags for gamemode 86 | privileges = { interact = false }, -- Enable/disable privileges for gamemode 87 | on_enable = function(player) 88 | -- Called when the gamemode is enabled for a player 89 | end, 90 | on_disable = function(player) 91 | -- Called when the player changes to another gamemode 92 | end, 93 | } 94 | ``` 95 | 96 | GUI API 97 | ------- 98 | The GUI API easily generates formstrings for custom elements and allows you to register extra inventory tabs/groups. 99 | 100 | `gui.register_tab(name, def)` 101 | 102 | * Register new tab 103 | * `name`: Name for tab 104 | * `def`: See [#Tab definition] 105 | 106 | `gui.get_tab(name)` 107 | 108 | * Get the definition of a tab 109 | * `name`: Name of tab 110 | 111 | `gui.set_current_tab(player, tabname)` 112 | 113 | * Set/update the tab displayed when the player opens the inventory 114 | * `player`: PlayerRef/Name of player 115 | * `tabname`: Name of previously registered tab 116 | 117 | `gui.get_itemslot_bg(x, y, w, h, count)` 118 | 119 | * Get the itemslot background for inventories 120 | * `x`, `y`: Placement on x and y axis 121 | * `w`, `h`: Inventory width, height 122 | * `count`: How many background images should be generated (from right-to-left, top-to-bottom) 123 | * If `count` is `nil` the full width and height specified is filled 124 | 125 | `gui.get_hotbar_itemslot_bg(x, y, w, h)` 126 | 127 | * Get background for hotbar row in inventories 128 | * `x`, `y`: Placement on x and y axis 129 | * `w`, `h`: Inventory width, height 130 | 131 | `gui.make_inv(x, y, w, h, location, name, hotbar, start, strict_count)` 132 | 133 | * Generate formstring for an inventory 134 | * `x`, `y`: Placement on x and y axis 135 | * `w`, `h`: Inventory width, height 136 | * `location`: Location of the inventory (e.g. `current_player`) 137 | * `name`: Name of the inventory (e.g. `main`) 138 | * `hotbar`: Boolean determinining whether the first row should be considered as connected to the hotbar 139 | * `start`: Integer determining at which itemstack index the formspec should begin to display the inventory contents 140 | * `strict_count`: Whether the number of item slot backgrounds should depend on the size or the number of items in the inventory 141 | * If the `location` is set to `context` and `strict_count` is used, `strict_count` should be a position, or if `location` is set to `current_player`, `strict_count` should be a player username 142 | 143 | `gui.make_button(x, y, w, h, name, label, noclip, exit)` 144 | 145 | * Generate formstring for a button 146 | * `x`, `y`: Placement on x and y axis 147 | * `w`, `h`: Inventory width, height __Note:__ Only widths of `1`, `2`, and `3` are supported 148 | * `name`: Name of button as returned in fields 149 | * `label`: Text shown on button 150 | * `noclip=true`: Allow button to be shown outside the formspec 151 | * `exit=true`: Exit formspec on button click 152 | 153 | `gui.get_tabs_by_group(group)` 154 | 155 | * Get all tabs with a specific group 156 | * `group`: Group name 157 | 158 | `gui.get_group_default(group)` 159 | 160 | * Get default tab of a specific group 161 | * `group`: Group name 162 | 163 | `gui.set_tab_group(player, group)` 164 | 165 | * Set the formspec tab group to be shown (allows player to choose between only tabs whose group matches rather than all tabs) 166 | * `player`: PlayerRef (or player name) 167 | * `group`: Group name 168 | 169 | `gui.init_creative_inv(player)` 170 | 171 | * Initialize detached creative inventory for a player 172 | * `player`: PlayerRef 173 | 174 | `gui.update_creative_inv(player_name, content)` 175 | 176 | * Update creative inventory for a player 177 | * `player_name`: Name of player 178 | * `content`: Table containing a list of nodes/craftitems 179 | 180 | #### Tab definition 181 | ```lua 182 | { 183 | style = "vertical" or "horizontal", 184 | -- ^ "vertical" causes the tab to be displayed as part of a 185 | -- vertical list (default), while horizontal causes the tab 186 | -- to be displayed as part of a horizontal list at the top 187 | -- of the formspec. 188 | icon = "tab_inventory.png", 189 | tooltip = "Inventory", 190 | default = true, -- Set tab to default 191 | groups = { survival = true, creative = false}, -- Tab groups allow grouping multiple tabs together 192 | get = function(name) -- Get formspec string (must return a formstring) 193 | return [[ 194 | label[0,0;Hello world!] 195 | ]] 196 | end, 197 | handle = function(name, fields) 198 | -- Handle submitted data 199 | end, 200 | } 201 | ``` 202 | 203 | Players API 204 | ----------- 205 | The players API allows getting or setting specifics related to the player including animation, model, nametag colour, and textures. 206 | 207 | `players.register_model(name, def)` 208 | 209 | * Register new model 210 | * `name`: Name for model 211 | * `def`: See [#Model definition] 212 | 213 | `players.get_animation(player)` 214 | 215 | * Returns a table containing fields `model`, `textures` and `animation`. 216 | * Any of the fields of the returned table may be nil. 217 | * `player`: PlayerRef 218 | 219 | `players.set_model(player, model_name)` 220 | 221 | * Change a player's model 222 | * `player`: PlayerRef 223 | * `model_name`: model registered with player_register_model() 224 | 225 | `players.set_textures(player, textures)` 226 | 227 | * Sets player textures 228 | * `player`: PlayerRef 229 | * `textures`: array of textures, If `textures` is nil, the default textures from the model def are used 230 | 231 | `players.set_animation(player, anim_name, speed)` 232 | 233 | * Sets player textures 234 | * `player`: PlayerRef 235 | * `textures`: array of textures, If `textures` is nil, the default textures from the model def are used 236 | 237 | `players.set_nametag_colour(player, colour)` 238 | 239 | * Sets nametag colour of a player 240 | * `player`: PlayerRef 241 | * `colour`: Table of colour attributes (`a`: alpha, `r`: red, `g`: green, `b`: blue) 242 | * If a colour attribute is not provided, it defaults to `255` 243 | 244 | #### Model definition 245 | ```lua 246 | { 247 | animation_speed = 30, -- Animation speed 248 | textures = {"character.png"}, -- Textures file 249 | animations = { 250 | -- Standard animations 251 | stand = { x= 0, y= 79, }, 252 | ... 253 | } 254 | } 255 | ``` 256 | 257 | Soil API 258 | -------- 259 | The soil API allows registering soils nodes (e.g grass/dirt). 260 | 261 | `soil.register(name, def)` 262 | 263 | * `name`: Name of soil (without modname) 264 | * `def`: See [Node definition (`register_node`)] 265 | * Unless overriden in definition, groups `crumbly` and `soil`, 266 | * `is_ground_content`, and `drops` are automatically set. 267 | 268 | Trees API 269 | --------- 270 | The trees API allows registering, checking, placing, and growing trees. 271 | 272 | `trees.register(name, def)` 273 | 274 | * Register a new tree along with all its nodes 275 | * `name`: Name of tree (as in a node's itemstring) 276 | * `def`: See [#Tree definition] 277 | 278 | `trees.get_name(pos)` 279 | 280 | * Returns the tree name of a node at a position 281 | * If the node at the position specified is not part of a valid tree, `nil` will be returned 282 | * `pos`: Position of node related to tree 283 | 284 | `trees.get_def(pos)` 285 | 286 | * Returns the original tree definition of a node at a position 287 | * If the node at the position specified is not part of a valid tree, `nil` will be returned 288 | * `pos`: Position of node related to tree 289 | 290 | `trees.can_grow(pos)` 291 | 292 | * Returns `true` if the sapling can grow 293 | * `pos`: Position of sapling 294 | 295 | `trees.place(name, pos)` 296 | 297 | * Place a tree 298 | * `name`: Name of tree (as in a node's itemstring) 299 | * `pos`: Position at which to place the tree 300 | 301 | `trees.grow(pos)` 302 | 303 | * Grow a tree from any of the tree's child nodes 304 | * Same as `trees.place` but requires that the target node be related to the tree and only executes if `trees.can_grow` returns `true` 305 | * If the tree cannot be grown, it will retry later 306 | * `pos`: Position of the tree's child node (e.g. sapling, leaf, trunk) 307 | 308 | #### Tree definition 309 | ```lua 310 | { 311 | basename = "Oak", -- Name to be concatenated for other nodes 312 | center = "trees_oak_log.png", -- Center (top/bottom) texture 313 | sides = "trees_oak_log_sides.png", -- Side texture 314 | plank = "trees_oak_plank.png", -- Plank texture 315 | sapling = "trees_oak_sapling.png", -- Sapling texture 316 | leaf = "trees_oak_leaf.png", -- Leaf texture 317 | offset = { x = -3, y = -1, z = -3}, -- Placement offset (x and z typically half the width and depth of the tree, y typically -1) 318 | schematic = "oak_tree.mts", -- Tree schematic file 319 | -- Mapgen definitions (minus those mentioned above - i.e. schematic) 320 | mapgen = { 321 | place_on = {"soil:dirt_with_grass"}, 322 | fill_ratio = 0.05, 323 | biomes = {"eden:grassland"}, 324 | y_min = 1, 325 | y_max = 200, 326 | }, 327 | } 328 | ``` 329 | 330 | Tools API 331 | --------- 332 | The tools API easily registers entire sets of tools. 333 | 334 | `tools.register(basename, basestack, def)` 335 | 336 | * Registers a set of tools depending on information provided 337 | * `basename`: Readable name to be used in tooltip 338 | * `basestack`: Name to be used in itemstack 339 | * `def`: See [#Tool definition] 340 | 341 | #### Tool Definition 342 | ```lua 343 | tools.register("Diamond", "diamond", { 344 | material = "ores:diamond", 345 | pick = {"tools_diamond_pick.png", { 346 | -- Capabilities 347 | }}, 348 | axe = {"tools_diamond_axe.png", { 349 | -- Capabilities 350 | }}, 351 | shovel = {"tools_diamond_shovel.png", { 352 | -- Capabilities 353 | }}, 354 | hoe = {"tools_diamond_hoe.png", { 355 | -- Capabilities 356 | }}, 357 | sword = {"tools_diamond_sword.png", { 358 | -- Capabilities 359 | }}, 360 | }) 361 | ``` 362 | 363 | Flora API 364 | --------- 365 | The flora API is meant to allow registration of plants and their characteristics. 366 | 367 | `flora.register(name, def)` 368 | 369 | * Registers a plant 370 | * `name`: Name of plant 371 | * `def`: See [#Plant definition] 372 | 373 | #### Plant definition 374 | ```lua 375 | flora.register("cactus", { 376 | real_physics = true, -- Controls whether the node requires an adjacent solid node 377 | node = { 378 | description = "Cactus", 379 | tiles = {"flora_cactus.png"}, 380 | ... 381 | }, 382 | decoration = { 383 | deco_type = "simple", 384 | place_on = "soil:sand", 385 | ... 386 | }, 387 | }) 388 | ``` 389 | -------------------------------------------------------------------------------- /mods/eden/item_entity.lua: -------------------------------------------------------------------------------- 1 | -- eden/item_entity.lua 2 | 3 | -- If item_entity_ttl is not set, enity will have default life time 4 | -- Setting it to -1 disables the feature 5 | local time_to_live = tonumber(minetest.settings:get("item_entity_ttl")) 6 | if not time_to_live then 7 | time_to_live = 900 8 | end 9 | 10 | --- 11 | --- Water flow functions by QwertyMine3 (MIT) 12 | --- Edited by TenPlus1, Rewritten by octacian 13 | --- 14 | 15 | local function to_unit_vector(dir_vector) 16 | local inv_roots = { 17 | [0] = 1, 18 | [1] = 1, 19 | [2] = 0.70710678118655, 20 | [4] = 0.5, 21 | [5] = 0.44721359549996, 22 | [8] = 0.35355339059327 23 | } 24 | 25 | local sum = dir_vector.x * dir_vector.x + dir_vector.z * dir_vector.z 26 | return { 27 | x = dir_vector.x * inv_roots[sum], 28 | y = dir_vector.y, 29 | z = dir_vector.z * inv_roots[sum] 30 | } 31 | end 32 | 33 | local function node_ok(pos) 34 | local node = minetest.get_node_or_nil(pos) 35 | if minetest.registered_nodes[node.name] then 36 | return node 37 | end 38 | end 39 | 40 | local function is_liquid(node) 41 | local def = minetest.registered_nodes[node.name] 42 | if def.liquidtype == "flowing" or def.liquidtype == "source" then 43 | return true 44 | end 45 | end 46 | 47 | local function quick_flow_logic(node, pos_testing, direction) 48 | local def = minetest.registered_nodes[node.name] 49 | if def.liquidtype == "flowing" then 50 | local node_testing = node_ok(pos_testing) 51 | if not is_liquid(node_testing) then 52 | return 0 53 | end 54 | 55 | local param2_testing = node_testing.param2 56 | if param2_testing < node.param2 then 57 | if (node.param2 - param2_testing) > 6 then 58 | return -direction 59 | else 60 | return direction 61 | end 62 | elseif param2_testing > node.param2 then 63 | if (param2_testing - node.param2) > 6 then 64 | return direction 65 | else 66 | return -direction 67 | end 68 | end 69 | end 70 | 71 | return 0 72 | end 73 | 74 | local function quick_flow(pos, node) 75 | local x, z = 0, 0 76 | if not minetest.registered_nodes[node.name].groups.liquid then 77 | return {x = 0, y = 0, z = 0} 78 | end 79 | 80 | x = x + quick_flow_logic(node, {x = pos.x - 1, y = pos.y, z = pos.z},-1) 81 | x = x + quick_flow_logic(node, {x = pos.x + 1, y = pos.y, z = pos.z}, 1) 82 | z = z + quick_flow_logic(node, {x = pos.x, y = pos.y, z = pos.z - 1},-1) 83 | z = z + quick_flow_logic(node, {x = pos.x, y = pos.y, z = pos.z + 1}, 1) 84 | 85 | return to_unit_vector({x = x, y = 0, z = z}) 86 | end 87 | 88 | --- 89 | --- END Water Flow 90 | --- 91 | 92 | local builtin_item = minetest.registered_entities["__builtin:item"] 93 | 94 | local item = { 95 | initial_properties = { 96 | hp_max = 1, 97 | physical = true, 98 | collide_with_objects = false, 99 | collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3}, 100 | visual = "wielditem", 101 | visual_size = {x = 0.4, y = 0.4}, 102 | textures = {""}, 103 | spritediv = {x = 1, y = 1}, 104 | initial_sprite_basepos = {x = 0, y = 0}, 105 | is_visible = false, 106 | }, 107 | 108 | on_punch = function() end, 109 | 110 | set_item = function(self, itemstring) 111 | self.itemstring = itemstring 112 | local stack = ItemStack(itemstring) 113 | local count = stack:get_count() 114 | local max_count = stack:get_stack_max() 115 | if count > max_count then 116 | count = max_count 117 | self.itemstring = stack:get_name().." "..max_count 118 | end 119 | local s = 0.2 + 0.1 * (count / max_count) 120 | local c = s - 0.05 121 | local itemtable = stack:to_table() 122 | local itemname = nil 123 | if itemtable then 124 | itemname = stack:to_table().name 125 | end 126 | self.object:set_properties({ 127 | is_visible = true, 128 | visual = "wielditem", 129 | textures = {itemname}, 130 | visual_size = {x = s, y = s}, 131 | collisionbox = {-c, -c, -c, c, c, c}, 132 | wield_item = itemstring, 133 | }) 134 | 135 | local itemdef = minetest.registered_items[stack:get_name()] 136 | if itemdef and itemdef.groups.flammable ~= 0 then 137 | self.flammable = itemdef.groups.flammable 138 | end 139 | 140 | --[[ NOTE: This has not yet been implemented in Minetest engine 141 | if itemdef and itemdef.type == "tool" or itemdef.type == "craft" then 142 | self.object:set_pitch(90) 143 | end 144 | ]]-- 145 | 146 | -- Set ID 147 | self.id = string.format("%04x%04x%04x%04x", 148 | math.random(2^16) - 1, math.random(2^16) - 1, 149 | math.random(2^16) - 1, math.random(2^16) - 1) 150 | end, 151 | 152 | burn_up = function(self) 153 | self.object:remove() 154 | local p = self.object:getpos() 155 | minetest.sound_play("eden_item_burn", { 156 | pos = p, 157 | max_hear_distance = 8, 158 | gain = math.random(0.5, 2) 159 | }) 160 | minetest.add_particlespawner({ 161 | amount = 3, 162 | time = 0.1, 163 | minpos = {x = p.x - 0.1, y = p.y + 0.1, z = p.z - 0.1 }, 164 | maxpos = {x = p.x + 0.1, y = p.y + 0.2, z = p.z + 0.1 }, 165 | minvel = {x = 0, y = 2.5, z = 0}, 166 | maxvel = {x = 0, y = 2.5, z = 0}, 167 | minacc = {x = -0.15, y = -0.02, z = -0.15}, 168 | maxacc = {x = 0.15, y = -0.01, z = 0.15}, 169 | minexptime = 4, 170 | maxexptime = 6, 171 | minsize = 5, 172 | maxsize = 5, 173 | collisiondetection = true, 174 | texture = "eden_item_smoke.png" 175 | }) 176 | end, 177 | 178 | on_step = function(self, dtime) 179 | local object = self.object 180 | local itemstring = self.itemstring 181 | local pos = object:getpos() 182 | local node = minetest.get_node_or_nil(pos) 183 | 184 | if not itemstring or itemstring == "" then 185 | object:remove() 186 | return 187 | end 188 | 189 | self.age = self.age + dtime 190 | if time_to_live > 0 and self.age > time_to_live then 191 | self.object:remove() 192 | return 193 | end 194 | local p = vector.new(pos) 195 | p.y = p.y - 0.5 196 | local tnode = minetest.get_node_or_nil(p) 197 | local nn = tnode.name 198 | -- If node is not registered or node is walkably solid and resting on nodebox 199 | local v = object:get_velocity() 200 | if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable and v.y == 0 then 201 | local own_stack = ItemStack(self.itemstring) 202 | -- Merge with close entities of the same item 203 | for _, object in ipairs(minetest.get_objects_inside_radius(p, 0.8)) do 204 | local obj = object:get_luaentity() 205 | if obj and obj.name == "__builtin:item" 206 | and self.id ~= obj.id then 207 | if self:try_merge_with(own_stack, object, obj) then 208 | return 209 | end 210 | end 211 | end 212 | object:set_velocity({x = 0, y = 0, z = 0}) 213 | object:set_acceleration({x = 0, y = 0, z = 0}) 214 | else 215 | if v.y == 0 then 216 | object:set_velocity({x = 0, y = 0, z = 0}) 217 | object:set_acceleration({x = 0, y = -10, z = 0}) 218 | end 219 | end 220 | 221 | -- Environment-based interactions 222 | if node and node.name ~= "air" then 223 | local def = minetest.registered_nodes[node.name] 224 | 225 | -- Burning 226 | if minetest.get_item_group(node.name, "lava") > 0 then 227 | if self.flammable then 228 | self:burn_up() 229 | return 230 | else -- else, Ignite after a maximum of 10 seconds 231 | self.ignite_timer = (self.ignite_timer or 0) + dtime 232 | 233 | if self.ignite_timer > math.random(2, 10) then 234 | self.ignite_timer = 0 235 | self:burn_up() 236 | return 237 | end 238 | end 239 | elseif self.flammable then 240 | -- Otherwise there'll be a chance based on its igniter value 241 | local burn_chance = self.flammable 242 | * minetest.get_item_group(node.name, "igniter") 243 | if burn_chance > 0 and math.random(0, burn_chance) ~= 0 then 244 | self:burn_up() 245 | return 246 | end 247 | end 248 | 249 | -- Move in flowing liquids 250 | if def.liquidtype == "flowing" then 251 | local vec = quick_flow(pos, node) 252 | if vec then 253 | object:set_velocity(vec) 254 | self.flowing = true 255 | end 256 | end 257 | 258 | -- Droplift 259 | if def.liquidtype == "none" and def.drawtype == "normal" then 260 | local new_pos = minetest.find_node_near(object:get_pos(), 1, "air") 261 | if new_pos then 262 | object:move_to(new_pos) 263 | else 264 | object:remove() 265 | return 266 | end 267 | end 268 | end 269 | 270 | -- Stop water flow 271 | if self.flowing and node then 272 | local def = minetest.registered_nodes[node.name] 273 | if def.liquidtype ~= "flowing" then 274 | local def = minetest.registered_nodes[node.name] 275 | object:setvelocity({x = 0, y = 0, z = 0}) 276 | object:move_to(vector.round(pos)) 277 | self.flowing = false 278 | end 279 | end 280 | 281 | -- Collection 282 | if self.age > 1 then 283 | local radius_magnet = 2 -- Magnet radius (minimum: 1.7) 284 | local radius_collect = 0.2 -- Collection radius 285 | local liquid_modifier = 2 286 | 287 | for _, player in ipairs(minetest.get_objects_inside_radius(pos, radius_magnet)) do 288 | if player:is_player() then 289 | if not gamemode.can_interact(player) then 290 | return 291 | end 292 | 293 | local inv = player:get_inventory() 294 | if inv and inv:room_for_item("main", ItemStack(itemstring)) then 295 | local ppos = player:getpos() 296 | ppos.y = ppos.y + 1.3 297 | 298 | if node then 299 | local def = minetest.registered_nodes[node.name] 300 | if def.liquidtype == "flowing" or def.liquidtype == "source" then 301 | radius_magnet = radius_magnet / liquid_modifier 302 | radius_collect = radius_collect / liquid_modifier 303 | end 304 | end 305 | 306 | if vector.distance(pos, ppos) <= radius_collect then 307 | inv:add_item("main", ItemStack(itemstring)) 308 | minetest.sound_play("eden_item_pickup", { 309 | pos = ppos, 310 | max_hear_distance = 8, 311 | }) 312 | object:remove() 313 | elseif math.floor(vector.distance(pos, ppos)) <= radius_magnet then 314 | local ok, blocker = minetest.line_of_sight(ppos, pos) 315 | if not ok and blocker then 316 | local node = minetest.get_node_or_nil(blocker) 317 | if node and node.name then 318 | local def = minetest.registered_nodes[node.name] 319 | if (def.walkable ~= nil and def.walkable == false) or 320 | (def.sunlight_propagates) or (def.drawtype == "nodebox") then 321 | ok = true 322 | end 323 | end 324 | end 325 | 326 | if ok then 327 | local vec = vector.subtract(ppos, pos) 328 | vec = vector.add(pos, vector.divide(vec, 2)) 329 | object:moveto(vec) 330 | end 331 | end 332 | end 333 | end 334 | end 335 | end 336 | end, 337 | } 338 | 339 | --- 340 | --- Function Overrides 341 | --- 342 | 343 | local add_item = minetest.add_item 344 | function minetest.add_item(pos, item, random_velocity) 345 | local obj = add_item(pos, item) 346 | 347 | if obj and random_velocity ~= false then 348 | local x = math.random(1, 5) 349 | if math.random(1, 2) == 1 then 350 | x = -x 351 | end 352 | local z = math.random(1, 5) 353 | if math.random(1, 2) == 1 then 354 | z = -z 355 | end 356 | 357 | obj:set_velocity({x = 1 / x, y = obj:get_velocity().y, z = 1 / z}) 358 | end 359 | 360 | return obj 361 | end 362 | 363 | function minetest.handle_node_drops(pos, drops, digger) 364 | if not digger or not digger:is_player() then 365 | return 366 | end 367 | 368 | if not gamemode.can_interact(digger) then 369 | return 370 | end 371 | 372 | local inv = digger:get_inventory() 373 | local mode = gamemode.def(gamemode.get(digger)) 374 | 375 | for _, item in ipairs(drops) do 376 | local count, name 377 | if type(item) == "string" then 378 | count = 1 379 | name = item 380 | else 381 | count = item:get_count() 382 | name = item:get_name() 383 | end 384 | 385 | if mode.item_drops == "auto" then 386 | item = ItemStack(item):get_name() 387 | if not inv:contains_item("main", item) then 388 | inv:add_item("main", item) 389 | end 390 | else 391 | for i=1, count do 392 | if ItemStack(name):is_known() then 393 | local obj = minetest.add_item(pos, name) 394 | if obj then 395 | obj:get_luaentity().age = 0.5 396 | obj:set_yaw(digger:get_look_horizontal()) 397 | end 398 | end 399 | end 400 | end 401 | end 402 | end 403 | 404 | function minetest.item_drop(itemstack, player, pos) 405 | -- Use modified item drop only if dropped by a player 406 | if player and player:is_player() then 407 | if not gamemode.can_interact(player) then 408 | return 409 | end 410 | 411 | local v = player:get_look_dir() 412 | local vel = player:get_player_velocity() 413 | local cs = itemstack:get_count() 414 | pos.y = pos.y + 1.3 415 | 416 | if not player:get_player_control().sneak then 417 | cs = 1 418 | end 419 | local item = itemstack:take_item(cs) 420 | local obj = minetest.add_item(pos, item, false) 421 | if obj then 422 | v.x = (v.x*5)+vel.x 423 | v.y = ((v.y*5)+2)+vel.y 424 | v.z = (v.z*5)+vel.z 425 | obj:setvelocity(v) 426 | obj:get_luaentity().dropped_by = player:get_player_name() 427 | obj:set_yaw(player:get_look_horizontal()) 428 | 429 | return itemstack 430 | end 431 | else -- else, Machine - use default item drop 432 | if minetest.add_item(pos, itemstack, false) then 433 | return itemstack 434 | end 435 | end 436 | end 437 | 438 | -- set defined item as new __builtin:item, with the old one as fallback table 439 | setmetatable(item, builtin_item) 440 | minetest.register_entity(":__builtin:item", item) 441 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | License of media (textures and sounds) 2 | -------------------------------------- 3 | Copyright (C) 2017 XtremeHacker 4 | See README.txt in each mod directory for information about other authors. 5 | 6 | Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) 7 | http://creativecommons.org/licenses/by-sa/3.0/ 8 | 9 | License of menu/header.png 10 | Copyright (C) 2017 octacian CC BY-SA 3.0 11 | 12 | 13 | License of source code 14 | ---------------------- 15 | Copyright (C) 2017 XtremeHacker 16 | See README.txt in each mod directory for information about other authors. 17 | 18 | GNU LESSER GENERAL PUBLIC LICENSE 19 | Version 2.1, February 1999 20 | 21 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 22 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 23 | Everyone is permitted to copy and distribute verbatim copies 24 | of this license document, but changing it is not allowed. 25 | 26 | [This is the first released version of the Lesser GPL. It also counts 27 | as the successor of the GNU Library Public License, version 2, hence 28 | the version number 2.1.] 29 | 30 | Preamble 31 | 32 | The licenses for most software are designed to take away your 33 | freedom to share and change it. By contrast, the GNU General Public 34 | Licenses are intended to guarantee your freedom to share and change 35 | free software--to make sure the software is free for all its users. 36 | 37 | This license, the Lesser General Public License, applies to some 38 | specially designated software packages--typically libraries--of the 39 | Free Software Foundation and other authors who decide to use it. You 40 | can use it too, but we suggest you first think carefully about whether 41 | this license or the ordinary General Public License is the better 42 | strategy to use in any particular case, based on the explanations below. 43 | 44 | When we speak of free software, we are referring to freedom of use, 45 | not price. Our General Public Licenses are designed to make sure that 46 | you have the freedom to distribute copies of free software (and charge 47 | for this service if you wish); that you receive source code or can get 48 | it if you want it; that you can change the software and use pieces of 49 | it in new free programs; and that you are informed that you can do 50 | these things. 51 | 52 | To protect your rights, we need to make restrictions that forbid 53 | distributors to deny you these rights or to ask you to surrender these 54 | rights. These restrictions translate to certain responsibilities for 55 | you if you distribute copies of the library or if you modify it. 56 | 57 | For example, if you distribute copies of the library, whether gratis 58 | or for a fee, you must give the recipients all the rights that we gave 59 | you. You must make sure that they, too, receive or can get the source 60 | code. If you link other code with the library, you must provide 61 | complete object files to the recipients, so that they can relink them 62 | with the library after making changes to the library and recompiling 63 | it. And you must show them these terms so they know their rights. 64 | 65 | We protect your rights with a two-step method: (1) we copyright the 66 | library, and (2) we offer you this license, which gives you legal 67 | permission to copy, distribute and/or modify the library. 68 | 69 | To protect each distributor, we want to make it very clear that 70 | there is no warranty for the free library. Also, if the library is 71 | modified by someone else and passed on, the recipients should know 72 | that what they have is not the original version, so that the original 73 | author's reputation will not be affected by problems that might be 74 | introduced by others. 75 | 76 | Finally, software patents pose a constant threat to the existence of 77 | any free program. We wish to make sure that a company cannot 78 | effectively restrict the users of a free program by obtaining a 79 | restrictive license from a patent holder. Therefore, we insist that 80 | any patent license obtained for a version of the library must be 81 | consistent with the full freedom of use specified in this license. 82 | 83 | Most GNU software, including some libraries, is covered by the 84 | ordinary GNU General Public License. This license, the GNU Lesser 85 | General Public License, applies to certain designated libraries, and 86 | is quite different from the ordinary General Public License. We use 87 | this license for certain libraries in order to permit linking those 88 | libraries into non-free programs. 89 | 90 | When a program is linked with a library, whether statically or using 91 | a shared library, the combination of the two is legally speaking a 92 | combined work, a derivative of the original library. The ordinary 93 | General Public License therefore permits such linking only if the 94 | entire combination fits its criteria of freedom. The Lesser General 95 | Public License permits more lax criteria for linking other code with 96 | the library. 97 | 98 | We call this license the "Lesser" General Public License because it 99 | does Less to protect the user's freedom than the ordinary General 100 | Public License. It also provides other free software developers Less 101 | of an advantage over competing non-free programs. These disadvantages 102 | are the reason we use the ordinary General Public License for many 103 | libraries. However, the Lesser license provides advantages in certain 104 | special circumstances. 105 | 106 | For example, on rare occasions, there may be a special need to 107 | encourage the widest possible use of a certain library, so that it becomes 108 | a de-facto standard. To achieve this, non-free programs must be 109 | allowed to use the library. A more frequent case is that a free 110 | library does the same job as widely used non-free libraries. In this 111 | case, there is little to gain by limiting the free library to free 112 | software only, so we use the Lesser General Public License. 113 | 114 | In other cases, permission to use a particular library in non-free 115 | programs enables a greater number of people to use a large body of 116 | free software. For example, permission to use the GNU C Library in 117 | non-free programs enables many more people to use the whole GNU 118 | operating system, as well as its variant, the GNU/Linux operating 119 | system. 120 | 121 | Although the Lesser General Public License is Less protective of the 122 | users' freedom, it does ensure that the user of a program that is 123 | linked with the Library has the freedom and the wherewithal to run 124 | that program using a modified version of the Library. 125 | 126 | The precise terms and conditions for copying, distribution and 127 | modification follow. Pay close attention to the difference between a 128 | "work based on the library" and a "work that uses the library". The 129 | former contains code derived from the library, whereas the latter must 130 | be combined with the library in order to run. 131 | 132 | GNU LESSER GENERAL PUBLIC LICENSE 133 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 134 | 135 | 0. This License Agreement applies to any software library or other 136 | program which contains a notice placed by the copyright holder or 137 | other authorized party saying it may be distributed under the terms of 138 | this Lesser General Public License (also called "this License"). 139 | Each licensee is addressed as "you". 140 | 141 | A "library" means a collection of software functions and/or data 142 | prepared so as to be conveniently linked with application programs 143 | (which use some of those functions and data) to form executables. 144 | 145 | The "Library", below, refers to any such software library or work 146 | which has been distributed under these terms. A "work based on the 147 | Library" means either the Library or any derivative work under 148 | copyright law: that is to say, a work containing the Library or a 149 | portion of it, either verbatim or with modifications and/or translated 150 | straightforwardly into another language. (Hereinafter, translation is 151 | included without limitation in the term "modification".) 152 | 153 | "Source code" for a work means the preferred form of the work for 154 | making modifications to it. For a library, complete source code means 155 | all the source code for all modules it contains, plus any associated 156 | interface definition files, plus the scripts used to control compilation 157 | and installation of the library. 158 | 159 | Activities other than copying, distribution and modification are not 160 | covered by this License; they are outside its scope. The act of 161 | running a program using the Library is not restricted, and output from 162 | such a program is covered only if its contents constitute a work based 163 | on the Library (independent of the use of the Library in a tool for 164 | writing it). Whether that is true depends on what the Library does 165 | and what the program that uses the Library does. 166 | 167 | 1. You may copy and distribute verbatim copies of the Library's 168 | complete source code as you receive it, in any medium, provided that 169 | you conspicuously and appropriately publish on each copy an 170 | appropriate copyright notice and disclaimer of warranty; keep intact 171 | all the notices that refer to this License and to the absence of any 172 | warranty; and distribute a copy of this License along with the 173 | Library. 174 | 175 | You may charge a fee for the physical act of transferring a copy, 176 | and you may at your option offer warranty protection in exchange for a 177 | fee. 178 | 179 | 2. You may modify your copy or copies of the Library or any portion 180 | of it, thus forming a work based on the Library, and copy and 181 | distribute such modifications or work under the terms of Section 1 182 | above, provided that you also meet all of these conditions: 183 | 184 | a) The modified work must itself be a software library. 185 | 186 | b) You must cause the files modified to carry prominent notices 187 | stating that you changed the files and the date of any change. 188 | 189 | c) You must cause the whole of the work to be licensed at no 190 | charge to all third parties under the terms of this License. 191 | 192 | d) If a facility in the modified Library refers to a function or a 193 | table of data to be supplied by an application program that uses 194 | the facility, other than as an argument passed when the facility 195 | is invoked, then you must make a good faith effort to ensure that, 196 | in the event an application does not supply such function or 197 | table, the facility still operates, and performs whatever part of 198 | its purpose remains meaningful. 199 | 200 | (For example, a function in a library to compute square roots has 201 | a purpose that is entirely well-defined independent of the 202 | application. Therefore, Subsection 2d requires that any 203 | application-supplied function or table used by this function must 204 | be optional: if the application does not supply it, the square 205 | root function must still compute square roots.) 206 | 207 | These requirements apply to the modified work as a whole. If 208 | identifiable sections of that work are not derived from the Library, 209 | and can be reasonably considered independent and separate works in 210 | themselves, then this License, and its terms, do not apply to those 211 | sections when you distribute them as separate works. But when you 212 | distribute the same sections as part of a whole which is a work based 213 | on the Library, the distribution of the whole must be on the terms of 214 | this License, whose permissions for other licensees extend to the 215 | entire whole, and thus to each and every part regardless of who wrote 216 | it. 217 | 218 | Thus, it is not the intent of this section to claim rights or contest 219 | your rights to work written entirely by you; rather, the intent is to 220 | exercise the right to control the distribution of derivative or 221 | collective works based on the Library. 222 | 223 | In addition, mere aggregation of another work not based on the Library 224 | with the Library (or with a work based on the Library) on a volume of 225 | a storage or distribution medium does not bring the other work under 226 | the scope of this License. 227 | 228 | 3. You may opt to apply the terms of the ordinary GNU General Public 229 | License instead of this License to a given copy of the Library. To do 230 | this, you must alter all the notices that refer to this License, so 231 | that they refer to the ordinary GNU General Public License, version 2, 232 | instead of to this License. (If a newer version than version 2 of the 233 | ordinary GNU General Public License has appeared, then you can specify 234 | that version instead if you wish.) Do not make any other change in 235 | these notices. 236 | 237 | Once this change is made in a given copy, it is irreversible for 238 | that copy, so the ordinary GNU General Public License applies to all 239 | subsequent copies and derivative works made from that copy. 240 | 241 | This option is useful when you wish to copy part of the code of 242 | the Library into a program that is not a library. 243 | 244 | 4. You may copy and distribute the Library (or a portion or 245 | derivative of it, under Section 2) in object code or executable form 246 | under the terms of Sections 1 and 2 above provided that you accompany 247 | it with the complete corresponding machine-readable source code, which 248 | must be distributed under the terms of Sections 1 and 2 above on a 249 | medium customarily used for software interchange. 250 | 251 | If distribution of object code is made by offering access to copy 252 | from a designated place, then offering equivalent access to copy the 253 | source code from the same place satisfies the requirement to 254 | distribute the source code, even though third parties are not 255 | compelled to copy the source along with the object code. 256 | 257 | 5. A program that contains no derivative of any portion of the 258 | Library, but is designed to work with the Library by being compiled or 259 | linked with it, is called a "work that uses the Library". Such a 260 | work, in isolation, is not a derivative work of the Library, and 261 | therefore falls outside the scope of this License. 262 | 263 | However, linking a "work that uses the Library" with the Library 264 | creates an executable that is a derivative of the Library (because it 265 | contains portions of the Library), rather than a "work that uses the 266 | library". The executable is therefore covered by this License. 267 | Section 6 states terms for distribution of such executables. 268 | 269 | When a "work that uses the Library" uses material from a header file 270 | that is part of the Library, the object code for the work may be a 271 | derivative work of the Library even though the source code is not. 272 | Whether this is true is especially significant if the work can be 273 | linked without the Library, or if the work is itself a library. The 274 | threshold for this to be true is not precisely defined by law. 275 | 276 | If such an object file uses only numerical parameters, data 277 | structure layouts and accessors, and small macros and small inline 278 | functions (ten lines or less in length), then the use of the object 279 | file is unrestricted, regardless of whether it is legally a derivative 280 | work. (Executables containing this object code plus portions of the 281 | Library will still fall under Section 6.) 282 | 283 | Otherwise, if the work is a derivative of the Library, you may 284 | distribute the object code for the work under the terms of Section 6. 285 | Any executables containing that work also fall under Section 6, 286 | whether or not they are linked directly with the Library itself. 287 | 288 | 6. As an exception to the Sections above, you may also combine or 289 | link a "work that uses the Library" with the Library to produce a 290 | work containing portions of the Library, and distribute that work 291 | under terms of your choice, provided that the terms permit 292 | modification of the work for the customer's own use and reverse 293 | engineering for debugging such modifications. 294 | 295 | You must give prominent notice with each copy of the work that the 296 | Library is used in it and that the Library and its use are covered by 297 | this License. You must supply a copy of this License. If the work 298 | during execution displays copyright notices, you must include the 299 | copyright notice for the Library among them, as well as a reference 300 | directing the user to the copy of this License. Also, you must do one 301 | of these things: 302 | 303 | a) Accompany the work with the complete corresponding 304 | machine-readable source code for the Library including whatever 305 | changes were used in the work (which must be distributed under 306 | Sections 1 and 2 above); and, if the work is an executable linked 307 | with the Library, with the complete machine-readable "work that 308 | uses the Library", as object code and/or source code, so that the 309 | user can modify the Library and then relink to produce a modified 310 | executable containing the modified Library. (It is understood 311 | that the user who changes the contents of definitions files in the 312 | Library will not necessarily be able to recompile the application 313 | to use the modified definitions.) 314 | 315 | b) Use a suitable shared library mechanism for linking with the 316 | Library. A suitable mechanism is one that (1) uses at run time a 317 | copy of the library already present on the user's computer system, 318 | rather than copying library functions into the executable, and (2) 319 | will operate properly with a modified version of the library, if 320 | the user installs one, as long as the modified version is 321 | interface-compatible with the version that the work was made with. 322 | 323 | c) Accompany the work with a written offer, valid for at 324 | least three years, to give the same user the materials 325 | specified in Subsection 6a, above, for a charge no more 326 | than the cost of performing this distribution. 327 | 328 | d) If distribution of the work is made by offering access to copy 329 | from a designated place, offer equivalent access to copy the above 330 | specified materials from the same place. 331 | 332 | e) Verify that the user has already received a copy of these 333 | materials or that you have already sent this user a copy. 334 | 335 | For an executable, the required form of the "work that uses the 336 | Library" must include any data and utility programs needed for 337 | reproducing the executable from it. However, as a special exception, 338 | the materials to be distributed need not include anything that is 339 | normally distributed (in either source or binary form) with the major 340 | components (compiler, kernel, and so on) of the operating system on 341 | which the executable runs, unless that component itself accompanies 342 | the executable. 343 | 344 | It may happen that this requirement contradicts the license 345 | restrictions of other proprietary libraries that do not normally 346 | accompany the operating system. Such a contradiction means you cannot 347 | use both them and the Library together in an executable that you 348 | distribute. 349 | 350 | 7. You may place library facilities that are a work based on the 351 | Library side-by-side in a single library together with other library 352 | facilities not covered by this License, and distribute such a combined 353 | library, provided that the separate distribution of the work based on 354 | the Library and of the other library facilities is otherwise 355 | permitted, and provided that you do these two things: 356 | 357 | a) Accompany the combined library with a copy of the same work 358 | based on the Library, uncombined with any other library 359 | facilities. This must be distributed under the terms of the 360 | Sections above. 361 | 362 | b) Give prominent notice with the combined library of the fact 363 | that part of it is a work based on the Library, and explaining 364 | where to find the accompanying uncombined form of the same work. 365 | 366 | 8. You may not copy, modify, sublicense, link with, or distribute 367 | the Library except as expressly provided under this License. Any 368 | attempt otherwise to copy, modify, sublicense, link with, or 369 | distribute the Library is void, and will automatically terminate your 370 | rights under this License. However, parties who have received copies, 371 | or rights, from you under this License will not have their licenses 372 | terminated so long as such parties remain in full compliance. 373 | 374 | 9. You are not required to accept this License, since you have not 375 | signed it. However, nothing else grants you permission to modify or 376 | distribute the Library or its derivative works. These actions are 377 | prohibited by law if you do not accept this License. Therefore, by 378 | modifying or distributing the Library (or any work based on the 379 | Library), you indicate your acceptance of this License to do so, and 380 | all its terms and conditions for copying, distributing or modifying 381 | the Library or works based on it. 382 | 383 | 10. Each time you redistribute the Library (or any work based on the 384 | Library), the recipient automatically receives a license from the 385 | original licensor to copy, distribute, link with or modify the Library 386 | subject to these terms and conditions. You may not impose any further 387 | restrictions on the recipients' exercise of the rights granted herein. 388 | You are not responsible for enforcing compliance by third parties with 389 | this License. 390 | 391 | 11. If, as a consequence of a court judgment or allegation of patent 392 | infringement or for any other reason (not limited to patent issues), 393 | conditions are imposed on you (whether by court order, agreement or 394 | otherwise) that contradict the conditions of this License, they do not 395 | excuse you from the conditions of this License. If you cannot 396 | distribute so as to satisfy simultaneously your obligations under this 397 | License and any other pertinent obligations, then as a consequence you 398 | may not distribute the Library at all. For example, if a patent 399 | license would not permit royalty-free redistribution of the Library by 400 | all those who receive copies directly or indirectly through you, then 401 | the only way you could satisfy both it and this License would be to 402 | refrain entirely from distribution of the Library. 403 | 404 | If any portion of this section is held invalid or unenforceable under any 405 | particular circumstance, the balance of the section is intended to apply, 406 | and the section as a whole is intended to apply in other circumstances. 407 | 408 | It is not the purpose of this section to induce you to infringe any 409 | patents or other property right claims or to contest validity of any 410 | such claims; this section has the sole purpose of protecting the 411 | integrity of the free software distribution system which is 412 | implemented by public license practices. Many people have made 413 | generous contributions to the wide range of software distributed 414 | through that system in reliance on consistent application of that 415 | system; it is up to the author/donor to decide if he or she is willing 416 | to distribute software through any other system and a licensee cannot 417 | impose that choice. 418 | 419 | This section is intended to make thoroughly clear what is believed to 420 | be a consequence of the rest of this License. 421 | 422 | 12. If the distribution and/or use of the Library is restricted in 423 | certain countries either by patents or by copyrighted interfaces, the 424 | original copyright holder who places the Library under this License may add 425 | an explicit geographical distribution limitation excluding those countries, 426 | so that distribution is permitted only in or among countries not thus 427 | excluded. In such case, this License incorporates the limitation as if 428 | written in the body of this License. 429 | 430 | 13. The Free Software Foundation may publish revised and/or new 431 | versions of the Lesser General Public License from time to time. 432 | Such new versions will be similar in spirit to the present version, 433 | but may differ in detail to address new problems or concerns. 434 | 435 | Each version is given a distinguishing version number. If the Library 436 | specifies a version number of this License which applies to it and 437 | "any later version", you have the option of following the terms and 438 | conditions either of that version or of any later version published by 439 | the Free Software Foundation. If the Library does not specify a 440 | license version number, you may choose any version ever published by 441 | the Free Software Foundation. 442 | 443 | 14. If you wish to incorporate parts of the Library into other free 444 | programs whose distribution conditions are incompatible with these, 445 | write to the author to ask for permission. For software which is 446 | copyrighted by the Free Software Foundation, write to the Free 447 | Software Foundation; we sometimes make exceptions for this. Our 448 | decision will be guided by the two goals of preserving the free status 449 | of all derivatives of our free software and of promoting the sharing 450 | and reuse of software generally. 451 | 452 | NO WARRANTY 453 | 454 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 455 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 456 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 457 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 458 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 459 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 460 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 461 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 462 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 463 | 464 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 465 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 466 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 467 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 468 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 469 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 470 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 471 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 472 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 473 | DAMAGES. 474 | 475 | END OF TERMS AND CONDITIONS 476 | 477 | How to Apply These Terms to Your New Libraries 478 | 479 | If you develop a new library, and you want it to be of the greatest 480 | possible use to the public, we recommend making it free software that 481 | everyone can redistribute and change. You can do so by permitting 482 | redistribution under these terms (or, alternatively, under the terms of the 483 | ordinary General Public License). 484 | 485 | To apply these terms, attach the following notices to the library. It is 486 | safest to attach them to the start of each source file to most effectively 487 | convey the exclusion of warranty; and each file should have at least the 488 | "copyright" line and a pointer to where the full notice is found. 489 | 490 | 491 | Copyright (C) 492 | 493 | This library is free software; you can redistribute it and/or 494 | modify it under the terms of the GNU Lesser General Public 495 | License as published by the Free Software Foundation; either 496 | version 2.1 of the License, or (at your option) any later version. 497 | 498 | This library is distributed in the hope that it will be useful, 499 | but WITHOUT ANY WARRANTY; without even the implied warranty of 500 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 501 | Lesser General Public License for more details. 502 | 503 | You should have received a copy of the GNU Lesser General Public 504 | License along with this library; if not, write to the Free Software 505 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 506 | 507 | Also add information on how to contact you by electronic and paper mail. 508 | 509 | You should also get your employer (if you work as a programmer) or your 510 | school, if any, to sign a "copyright disclaimer" for the library, if 511 | necessary. Here is a sample; alter the names: 512 | 513 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 514 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. 515 | 516 | , 1 April 1990 517 | Ty Coon, President of Vice 518 | 519 | That's all there is to it! 520 | --------------------------------------------------------------------------------