Imported from trollstream "ContentDB"

master
OldCoder 2022-09-04 22:01:05 -07:00
commit bf42aead8a
640 changed files with 26414 additions and 0 deletions

6
game.conf Normal file
View File

@ -0,0 +1,6 @@
name = newplanet
description = A new planet to explore
release = 1.2
author = Hi_World

BIN
menu/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

BIN
menu/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

28
mods/creative/README.txt Normal file
View File

@ -0,0 +1,28 @@
Minetest 0.4 mod: creative
==========================
Implements creative mode.
Switch on by using the "creative_mode" setting.
Registered items that
- have a description, and
- do not have the group not_in_creative_inventory
are added to the creative inventory.
License of source code and media files:
---------------------------------------
Copyright (C) 2012 Perttu Ahola (celeron55) <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/

View File

@ -0,0 +1 @@
default

189
mods/creative/init.lua Normal file
View File

@ -0,0 +1,189 @@
-- minetest/creative/init.lua
creative_inventory = {}
creative_inventory.creative_inventory_size = 0
if minetest.settings:get_bool("creative_mode") then
-- Create detached creative inventory after loading all mods
minetest.after(0, function()
local inv = minetest.create_detached_inventory("creative", {
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return count
end,
allow_put = function(inv, listname, index, stack, player)
return 0
end,
allow_take = function(inv, listname, index, stack, player)
return -1
end,
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
end,
on_put = function(inv, listname, index, stack, player)
end,
on_take = function(inv, listname, index, stack, player)
print(player:get_player_name().." takes item from creative inventory; listname="..dump(listname)..", index="..dump(index)..", stack="..dump(stack))
if stack then
print("stack:get_name()="..dump(stack:get_name())..", stack:get_count()="..dump(stack:get_count()))
end
end,
})
local creative_list = {}
for name,def in pairs(minetest.registered_items) do
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0)
and def.description and def.description ~= "" then
creative_list[#creative_list+1] = name
end
end
table.sort(creative_list)
inv:set_size("main", #creative_list)
inv:set_list("main", creative_list)
creative_inventory.creative_inventory_size = #creative_list
print("creative inventory size: "..dump(creative_inventory.creative_inventory_size))
end)
-- Create the trash field
local trash = minetest.create_detached_inventory("creative_trash", {
-- Allow the stack to be placed and remove it in on_put()
-- This allows the creative inventory to restore the stack
allow_put = function(inv, listname, index, stack, player)
return stack:get_count()
end,
on_put = function(inv, listname, index, stack, player)
inv:set_stack(listname, index, "")
end,
})
trash:set_size("main", 1)
creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
pagenum = math.floor(pagenum)
local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1)
player:set_inventory_formspec("size[13,7.5]"..
--"image[6,0.6;1,2;player.png]"..
"list[current_player;main;5,3.5;8,4;]"..
"list[current_player;craft;8,0;3,3;]"..
"list[current_player;craftpreview;12,1;1,1;]"..
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]"..
"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]"..
"button[0.3,6.5;1.6,1;creative_prev;<<]"..
"button[2.7,6.5;1.6,1;creative_next;>>]"..
"listring[current_player;main]"..
"listring[current_player;craft]"..
"listring[current_player;main]"..
"listring[detached:creative;main]"..
"label[5,1.5;Trash:]"..
"list[detached:creative_trash;main;5,2;1,1;]")
end
minetest.register_on_joinplayer(function(player)
creative_inventory.set_creative_formspec(player, 0, 1)
end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
-- Figure out current page from formspec
local current_page = 0
local formspec = player:get_inventory_formspec()
local start_i = string.match(formspec, "list%[detached:creative;main;[%d.]+,[%d.]+;[%d.]+,[%d.]+;(%d+)%]")
start_i = tonumber(start_i) or 0
if fields.creative_prev then
start_i = start_i - 4*6
end
if fields.creative_next then
start_i = start_i + 4*6
end
if start_i < 0 then
start_i = start_i + 4*6
end
if start_i >= creative_inventory.creative_inventory_size then
start_i = start_i - 4*6
end
if start_i < 0 or start_i >= creative_inventory.creative_inventory_size then
start_i = 0
end
creative_inventory.set_creative_formspec(player, start_i, start_i / (6*4) + 1)
end)
local digtime = 0.15
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 0}
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=1.5},
range = 10,
tool_capabilities = {
full_punch_interval = 0.5,
groupcaps = {
crumbly = caps,
cracky = caps,
snappy = caps,
choppy = caps,
oddly_breakable_by_hand = caps,
},
damage_groups = {fleshy=1},
},
})
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
return true
end)
function minetest.handle_node_drops(pos, drops, digger)
if not digger or not digger:is_player() then
return
end
local inv = digger:get_inventory()
if inv then
for _,item in ipairs(drops) do
item = ItemStack(item):get_name()
if not inv:contains_item("main", item) then
inv:add_item("main", item)
end
end
end
end
minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, player, pointed_thing)
local hp = player:get_hp()
player:set_hp(hp + hp_change)
return itemstack
end)
--
-- Allow crative players to remove liquids the fast way
--
local water_source_groups = minetest.registered_nodes["default:water_source"].groups
water_source_groups.dig_immediate = 3
minetest.override_item("default:water_source", {
diggable = true,
groups = water_source_groups,
drop = "default:water_source"
})
local water_flowing_groups = minetest.registered_nodes["default:water_flowing"].groups
water_flowing_groups.dig_immediate = 3
minetest.override_item("default:water_flowing", {
diggable = true,
groups = water_flowing_groups,
})
local lava_source_groups = minetest.registered_nodes["default:lava_source"].groups
lava_source_groups.dig_immediate = 3
minetest.override_item("default:lava_source", {
diggable = true,
groups = lava_source_groups,
drop = "default:lava_source"
})
local lava_flowing_groups = minetest.registered_nodes["default:lava_flowing"].groups
lava_flowing_groups.dig_immediate = 3
minetest.override_item("default:lava_flowing", {
diggable = true,
groups = lava_flowing_groups,
})
end

22
mods/cube_mobs/README.md Normal file
View File

@ -0,0 +1,22 @@
## Cube Mobs for Minetest ##
This mod uses mobkit and includes a number of simple looking box mobs with varying attacks. I created this to have a satisfying spread of mobs to fight against in survival. Graphics are probably placeholder for now, but mobs probably won't look to much more advanced than cubes. This will be part of a game I'm working on, but wanted to go ahead and release for feedback / other people to mess around with - let me know what you think!
**Current Mobs:**
* Box: Standard jump attack
* Small Box: Quicker, lower hp
* Digging Box: When it hits the player, it digs 3x3 nodes one space beneath the player.
* Shooter Box: Shoots projectiles at player from afar.
* Fire Box: Spawns fire on the ground on a path to the player
* Spike Box: Spawns spikes on the ground on a path to the player
**Todo List:**
* Create more hostile mobs, and give all mobs slightly better names
* Neutral cube mobs that have some utility / interaction.
* Improve spawning method, maybe ABM? Also add spawn restrictions per mob.
* Update graphics / sounds
* Handle cooldowns better for Mob abilities - they can do them again after getting punched currently.
* Include more item drops (Default items, or creating a couple more)
**Release History:**
* v0.1 - 5/24/20

376
mods/cube_mobs/api.lua Normal file
View File

@ -0,0 +1,376 @@
local abs = math.abs
local pi = math.pi
local floor = math.floor
local ceil = math.ceil
local random = math.random
local sqrt = math.sqrt
local max = math.max
local min = math.min
local tan = math.tan
local pow = math.pow
local sign = function(x)
return (x<0) and -1 or 1
end
local function lava_dmg(self,dmg) -- from mobkit
node_lava = node_lava or minetest.registered_nodes[minetest.registered_aliases.mapgen_lava_source]
if node_lava then
local pos=self.object:get_pos()
local box = self.object:get_properties().collisionbox
local pos1={x=pos.x+box[1],y=pos.y+box[2],z=pos.z+box[3]}
local pos2={x=pos.x+box[4],y=pos.y+box[5],z=pos.z+box[6]}
local nodes=mobkit.get_nodes_in_area(pos1,pos2)
if nodes[node_lava] then mobkit.hurt(self,dmg) end
end
end
local function sensors() -- from mobkit, needed by custom actfunc_cube
local timer = 2
local pulse = 1
return function(self)
timer=timer-self.dtime
if timer < 0 then
pulse = pulse + 1 -- do full range every third scan
local range = self.view_range
if pulse > 2 then
pulse = 1
else
range = self.view_range*0.5
end
local pos = self.object:get_pos()
--local tim = minetest.get_us_time()
self.nearby_objects = minetest.get_objects_inside_radius(pos, range)
--minetest.chat_send_all(minetest.get_us_time()-tim)
for i,obj in ipairs(self.nearby_objects) do
if obj == self.object then
table.remove(self.nearby_objects,i)
break
end
end
timer=2
end
end
end
-- altered from mobkit.actfunc , so that textures for self.visual=cube showed correctly, and adding cooldown
function cube_mobkit.actfunc(self, staticdata, dtime_s)
self.logic = self.logic or self.brainfunc
self.physics = self.physics or mobkit.physics
self.lqueue = {}
self.hqueue = {}
self.nearby_objects = {}
self.nearby_players = {}
self.pos_history = {}
self.path_dir = 1
self.time_total = 0
self.water_drag = self.water_drag or 1
local sdata = minetest.deserialize(staticdata)
if sdata then
for k,v in pairs(sdata) do
self[k] = v
end
end
if self.timeout and self.timeout>0 and dtime_s > self.timeout and next(self.memory)==nil then
self.object:remove()
end
if not self.memory then -- this is the initial activation
self.memory = {}
-- texture variation
if #self.textures > 1 then self.texture_no = math.random(#self.textures) end
end
-- apply texture
if self.texture_no and self.visual~="cube" then
local props = {}
props.textures = {self.textures[self.texture_no]}
self.object:set_properties(props)
end
--hp
self.max_hp = self.max_hp or 10
self.hp = self.hp or self.max_hp
--armor
if type(self.armor_groups) ~= 'table' then
self.armor_groups={}
end
self.armor_groups.immortal = 1
self.object:set_armor_groups(self.armor_groups)
self.oxygen = self.oxygen or self.lung_capacity
self.lastvelocity = {x=0,y=0,z=0}
self.sensefunc=sensors()
end
function cube_mobkit.hq_hunt(self,prty,tgtobj)
local func = function(self)
if not mobkit.is_alive(tgtobj) then return true end
if mobkit.is_queue_empty_low(self) and self.isonground then
local pos = mobkit.get_stand_pos(self)
local opos = tgtobj:get_pos()
local dist = vector.distance(pos,opos)
if dist > self.view_range then
return true
elseif dist > (self.attack.range or cube_mobkit.DEFAULT_ATTACK_RANGE) then
mobkit.goto_next_waypoint(self,opos)
else
cube_mobkit.hq_attack(self,prty+1,tgtobj)
end
end
end
mobkit.queue_high(self,func,prty)
end
function cube_mobkit.hq_attack(self,prty,tgtobj)
local func = function(self)
if not mobkit.is_alive(tgtobj) then return true end
if mobkit.is_queue_empty_low(self) then
local pos = mobkit.get_stand_pos(self)
-- local tpos = tgtobj:get_pos()
local tpos = mobkit.get_stand_pos(tgtobj)
local dist = vector.distance(pos,tpos)
if dist > (self.attack.range or 3) then
return true
else
mobkit.lq_turn2pos(self,tpos)
local height = tgtobj:is_player() and 0.35 or tgtobj:get_luaentity().height*0.6
if (abs(tpos.y-pos.y)<(self.attack.range or cube_mobkit.DEFAULT_ATTACK_RANGE)/2) then
if self.on_attack_init then
self.on_attack_init(self,tgtobj)
else
cube_mobkit.lq_jumpattack(self,math.max(tpos.y+height-pos.y,.25),tgtobj)
end
else
mobkit.lq_dumbwalk(self,mobkit.pos_shift(tpos,{x=math.random()-0.5,z=math.random()-0.5}))
end
end
end
end
mobkit.queue_high(self,func,prty)
end
function cube_mobkit.lq_jumpattack(self,height,target)
local phase=1
local timer=0.5
local yaw = self.object:get_yaw()
local func=function(self)
if not mobkit.is_alive(target) then return true end
if self.isonground then
if phase==1 then -- collision bug workaround
local vel = self.object:get_velocity()
vel.y = -mobkit.gravity*math.sqrt(height*2/-mobkit.gravity)
self.object:set_velocity(vel)
phase=2
else
mobkit.lq_idle(self,0.3)
return true
end
elseif phase==2 then
-- local dir = minetest.yaw_to_dir(self.object:get_yaw())
local tgtpos = target:get_pos()
local pos = self.object:get_pos()
local dir = vector.normalize(vector.subtract(tgtpos,pos))
local vy = self.object:get_velocity().y
dir=vector.multiply(dir,self.attack.speed)
dir.y=vy
self.object:set_velocity(dir)
phase=3
-- stop moving forward after certain amount of time ( avoids jumping too far off cliffs / caves)
local stop_moving = function()
if(phase==3) then
local vel = self.object:get_velocity()
self.object:set_velocity({x=0;y=vel.y;z=0})
end
end
minetest.after(.5,stop_moving)
elseif phase==3 then -- in air
local tgtpos = target:get_pos()
local pos = self.object:get_pos()
-- calculate attack spot
local yaw = self.object:get_yaw()
local dir = minetest.yaw_to_dir(yaw)
-- keep moving forward (in case you hit a block below the player while jumping towards them)
local vel = self.object:get_velocity()
dir = vector.multiply(dir,self.attack.speed)
dir.y = vel.y
self.object:set_velocity(dir)
local height = target:is_player() and 1 or target:get_luaentity().height*0.6
tgtpos.y=tgtpos.y+height
local dist_to_player = vector.length(vector.subtract(tgtpos,pos))
if dist_to_player<(self.attack.melee_range or cube_mobkit.DEFAULT_MELEE_RANGE) then --bite
target:punch(self.object,1,self.attack)
-- bounce off
local vy = self.object:get_velocity().y
self.object:set_velocity({x=dir.x*-.5,y=vy,z=dir.z*-.5})
-- play attack sound if defined
mobkit.make_sound(self,'attack')
if self.on_attack_hit then
self.on_attack_hit(self,target)
end
phase=4
end
end
end
mobkit.queue_low(self,func)
end
function cube_mobkit.box_brain(self)
-- vitals should be checked every step
if mobkit.timer(self,1) then
lava_dmg(self,6)
end
mobkit.vitals(self)
-- if self.object:get_hp() <=100 then
if self.hp <= 0 then
if self.on_death then self.on_death(self) end
if self.drops then
for _,v in pairs(self.drops) do
local rnd = math.random(1,255)
if v.prob>=rnd then
local qty = math.random(v.min,v.max)
local item = minetest.add_item(self.object:get_pos(), ItemStack(v.name.." "..qty))
item:set_velocity({x=math.random(-2,2),y=5,z=math.random(-2,2)})
end
end
end
mobkit.clear_queue_high(self) -- cease all activity
mobkit.hq_die(self) -- kick the bucket
return
end
local prty = mobkit.get_queue_priority(self)
if mobkit.timer(self,1) then -- decision making needn't happen every engine step
if prty < 20 and self.isinliquid then
mobkit.hq_liquid_recovery(self,20)
return
end
local pos=self.object:get_pos()
if prty < 9 then
local plyr = mobkit.get_nearby_player(self)
if plyr and vector.distance(pos,plyr:get_pos()) < 20 then -- if player close
cube_mobkit.hq_hunt(self,10,plyr)
end
end
-- fool around
if mobkit.is_queue_empty_high(self) then
mobkit.hq_roam(self,0)
end
end
end
cube_mobkit.shoot = function(self, target, shot_name,cooldown)
local func = function(self)
if not mobkit.is_alive(target) then return true end
local pos = self.object:get_pos()
local tgtpos = target:get_pos()
local dist_to_player = vector.length(vector.subtract(tgtpos,pos))
if dist_to_player<self.attack.range then --shoot if in range and visible
local shot = minetest.add_entity(pos, shot_name)
local shot_speed = 25
local height = target:is_player() and 0.75 or target:get_luaentity().height*0.6
-- predict target position we need to aim at based on shot speed and player distance
local travel_time_to_player = dist_to_player/shot_speed
local tgtvel
if(target:is_player()) then
tgtvel = target:get_player_velocity()
else
tgtvel = target:get_velocity()
end
tgtvel.y=0 -- don't over-interpolate y (jumping / gravity affect it too much)
local prediction = vector.multiply(tgtvel,travel_time_to_player*0.75)
local pred_tgtpos = vector.add(tgtpos,prediction)
pred_tgtpos.y = pred_tgtpos.y+height
local dir = vector.normalize(vector.subtract(pred_tgtpos,pos))
local velocity = vector.multiply(dir,shot_speed)
shot:set_velocity(velocity)
end
mobkit.lq_idle(self,cooldown) -- wait before acting again
return true
end
mobkit.queue_low(self,func)
end
cube_mobkit.fill_path = function(self, target, nodename,cooldown,fill_freq)
local func = function(self)
if not mobkit.is_alive(target) then return true end
local pos1 = self.object:get_pos()
local pos2 = target:get_pos()
fill_freq = fill_freq or 1 -- fill all path nodes by default
local path_to_target = minetest.find_path(pos1,pos2,1,2,2,"A*_noprefetch")
-- fill path with node, if the node below is walkable
if path_to_target and #path_to_target>0 then
for k,pos in pairs(path_to_target) do
local floornode = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
if minetest.registered_nodes[floornode.name].walkable and k%fill_freq==0 then
minetest.set_node(pos,{name=nodename})
end
end
mobkit.lq_idle(self,cooldown) -- wait before acting again
else
mobkit.lq_dumbwalk(self,mobkit.pos_shift(pos2,{x=math.random()-0.5,z=math.random()-0.5}))
end
return true
end
mobkit.queue_low(self,func)
end
cube_mobkit.on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
if mobkit.is_alive(self) then
local punch_interval = tool_capabilities.full_punch_interval or 1.4
-- only hit if you're at 50% punch charge
if(time_from_last_punch>=punch_interval/2 ) then
mobkit.hurt(self,tool_capabilities.damage_groups.fleshy or 1)
mobkit.make_sound(self,'attack')
if type(puncher)=='userdata' and puncher:is_player() then -- if hit by a player
mobkit.clear_queue_high(self) -- abandon whatever they've been doing
cube_mobkit.hq_hunt(self,10,puncher) -- get revenge
-- only knockback if not jumpattacking (not going too much over max speed)
if vector.length(self.object:get_velocity())<=self.max_speed*1.1 then
local hvel = vector.multiply(vector.normalize({x=dir.x,y=0,z=dir.z}),2)
self.object:set_velocity({x=hvel.x,y=2,z=hvel.z})
end
end
end
end
end

21
mods/cube_mobs/init.lua Normal file
View File

@ -0,0 +1,21 @@
-- Created by Xanthus using mobkit
-- V 0.1
cube_mobkit = {} -- includes altered functions similar to those found in mobkit (cube_mobkit.lq_jumpattack)
cube_mobkit.mob_names = {} -- list of names used for spawning. add mob names to the list after registering
cube_mobkit.DEFAULT_MELEE_RANGE = 1.5 -- how close the mob needs to be during melee attack to hit by default
cube_mobkit.DEFAULT_ATTACK_RANGE = 3 -- how close the mob needs to initiate an attack by default
local path = minetest.get_modpath("cube_mobs")
dofile(path .. "/api.lua")
dofile(path .. "/spawns.lua")
dofile(path .. "/items.lua")
dofile(path .. "/nodes.lua")
dofile(path .. "/mobs/box.lua")
dofile(path .. "/mobs/box_small.lua")
dofile(path .. "/mobs/box_shoot.lua")
dofile(path .. "/mobs/box_dig.lua")
--dofile(path .. "/mobs/box_spike.lua")
dofile(path .. "/mobs/box_fire.lua")

6
mods/cube_mobs/items.lua Normal file
View File

@ -0,0 +1,6 @@
minetest.register_craftitem("cube_mobs:bits", {
description = "Food Bits",
image ="cube_mobs_bits.png",
on_use = minetest.item_eat(3),
groups = { meat=1, eatable=1 },
})

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2020 Xanthus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,40 @@
minetest.register_entity("cube_mobs:box",{
-- common props
physical = true,
collide_with_objects = false,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
visual_size = {x = 1, y = 1},
textures = {"cube_mobs_box_side.png","cube_mobs_box_side.png","cube_mobs_box_side.png","cube_mobs_box_side.png","cube_mobs_box_front.png","cube_mobs_box_side.png"},
spritediv = {x = 1, y = 1},
initial_sprite_basepos = {x = 0, y = 0},
static_save = true,
makes_footstep_sound = true,
on_step = mobkit.stepfunc, -- required
on_activate = cube_mobkit.actfunc, -- required
get_staticdata = mobkit.statfunc,
-- api props
springiness=0,
buoyancy = 0.75, -- portion of hitbox submerged
max_speed = 5,
jump_height = 1.26,
view_range = 24,
lung_capacity = 10, -- seconds
max_hp = 10,
timeout=600,
attack={melee_range=1.5,speed=8, damage_groups={fleshy=4}},
sounds = {
attack='player_damage',
},
brainfunc = cube_mobkit.box_brain,
on_punch= function(self, puncher, time_from_last_punch, tool_capabilities, dir)
cube_mobkit.on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
end,
drops = { {name="cube_mobs:bits", min=1, max=2,prob=255/3} }
})
cube_mobkit.mob_names[#cube_mobkit.mob_names+1] = "cube_mobs:box"

View File

@ -0,0 +1,57 @@
minetest.register_entity("cube_mobs:box_dig",{
-- common props
physical = true,
collide_with_objects = false,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
visual_size = {x = 1, y = 1},
textures = {"cube_mobs_box_dig_side.png","cube_mobs_box_dig_side.png","cube_mobs_box_dig_side.png","cube_mobs_box_dig_side.png","cube_mobs_box_dig_front.png","cube_mobs_box_dig_side.png"},
spritediv = {x = 1, y = 1},
initial_sprite_basepos = {x = 0, y = 0},
static_save = true,
makes_footstep_sound = true,
on_step = mobkit.stepfunc, -- required
on_activate = cube_mobkit.actfunc, -- required
get_staticdata = mobkit.statfunc,
-- api props
springiness=0,
buoyancy = 0.75, -- portion of hitbox submerged
max_speed = 5,
jump_height = 1.26,
view_range = 24,
lung_capacity = 10, -- seconds
max_hp = 20,
timeout=600,
attack={melee_range=1.5,speed = 10, damage_groups={fleshy=3}},
sounds = {
attack='player_damage',
},
brainfunc = cube_mobkit.box_brain,
on_punch= function(self, puncher, time_from_last_punch, tool_capabilities, dir)
cube_mobkit.on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
end,
-- dig on attack hitting
on_attack_hit=function(self, target)
local pos=target:get_pos()
pos.y=pos.y-.8
for dx=-1,1 do
for dz=-1,1 do
minetest.remove_node({x=pos.x+dx,y=pos.y,z=pos.z+dz})
end
end
end,
drops = {
{name="cube_mobs:bits", min=1, max=1,prob=255/4},
{name="default:coal_lump", min=1, max=3,prob=255/2},
{name="default:tin_lump", min=1, max=1,prob=255/10},
{name="default:copper_lump", min=1, max=1,prob=255/6},
},
})
cube_mobkit.mob_names[#cube_mobkit.mob_names+1] = "cube_mobs:box_dig"

View File

@ -0,0 +1,51 @@
if minetest.get_modpath("fire") then
minetest.register_entity("cube_mobs:box_fire",{
-- common props
hp_max = 10,
physical = true,
collide_with_objects = false,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
visual_size = {x = 1, y = 1},
textures = {"cube_mobs_box_fire_side.png","cube_mobs_box_fire_side.png","cube_mobs_box_fire_side.png","cube_mobs_box_fire_side.png","cube_mobs_box_fire_front.png","cube_mobs_box_fire_side.png"},
spritediv = {x = 1, y = 1},
initial_sprite_basepos = {x = 0, y = 0},
static_save = true,
makes_footstep_sound = true,
on_step = mobkit.stepfunc, -- required
on_activate = cube_mobkit.actfunc, -- required
get_staticdata = mobkit.statfunc,
-- api props
springiness=0,
buoyancy = 0.75, -- portion of hitbox submerged
max_speed = 4,
jump_height = 1.26,
view_range = 24,
lung_capacity = 10, -- seconds
max_hp = 10,
timeout=600,
attack={range=10,speed = 1, damage_groups={fleshy=0}},
sounds = {
attack='player_damage',
},
brainfunc = cube_mobkit.box_brain,
on_punch= function(self, puncher, time_from_last_punch, tool_capabilities, dir)
cube_mobkit.on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
end,
on_attack_init=function(self,target)
cube_mobkit.fill_path(self,target,"fire:basic_flame",3)
end,
drops = {
{name="cube_mobs:bits", min=1, max=1,prob=255/4},
{name="default:coal_lump", min=2, max=4,prob=255},
}
})
cube_mobkit.mob_names[#cube_mobkit.mob_names+1] = "cube_mobs:box_fire"
end

View File

@ -0,0 +1,95 @@
minetest.register_entity("cube_mobs:box_shoot",{
-- common props
hp_max = 10,
physical = true,
collide_with_objects = false,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
visual_size = {x = 1, y = 1},
textures = {"cube_mobs_box_shoot_side.png","cube_mobs_box_shoot_side.png","cube_mobs_box_shoot_side.png","cube_mobs_box_shoot_side.png","cube_mobs_box_shoot_front.png","cube_mobs_box_shoot_side.png"},
spritediv = {x = 1, y = 1},
initial_sprite_basepos = {x = 0, y = 0},
static_save = true,
makes_footstep_sound = true,
on_step = mobkit.stepfunc, -- required
on_activate = cube_mobkit.actfunc, -- required
get_staticdata = mobkit.statfunc,
-- api props
springiness=0,
buoyancy = 0.75, -- portion of hitbox submerged
max_speed = 4,
jump_height = 1.26,
view_range = 24,
lung_capacity = 10, -- seconds
max_hp = 10,
timeout=600,
attack={range=10, speed = 1, damage_groups={fleshy=0}},
sounds = {
attack='player_damage',
},
brainfunc = cube_mobkit.box_brain,
on_punch= function(self, puncher, time_from_last_punch, tool_capabilities, dir)
cube_mobkit.on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
end,
on_attack_init=function(self,target)
cube_mobkit.shoot(self,target,"cube_mobs:shot",1)
end,
drops = {
{name="cube_mobs:bits", min=1, max=1,prob=255/4},
}
})
minetest.register_entity("cube_mobs:shot", {
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
visual = "cube",
visual_size = {x = .3, y = .3, z=.3},
textures = {"cube_mobs_box_shoot_side.png","cube_mobs_box_shoot_side.png","cube_mobs_box_shoot_side.png","cube_mobs_box_shoot_side.png","cube_mobs_box_shoot_side.png","cube_mobs_box_shoot_side.png"},
velocity=10,
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 2},
}, nil)
end ,
timeout = 5,
on_activate = function (self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1})
end,
on_step= function(self, dtime)
-- time out
self.timeout = self.timeout-dtime
if self.timeout<=0 then
self.object:remove() ;
return
end
--stop if hit node
local pos = self.object:get_pos()
local node = minetest.get_node(pos)
if minetest.registered_nodes[node.name].walkable then
self.object:remove() ; -- print ("hit node")
return
end
-- hurt player
for _,player in pairs(minetest.get_objects_inside_radius(pos, 1.25)) do
if player:is_player() then
self:hit_player(player)
self.object:remove() ; -- print ("hit player")
return
end
end
end,
})
cube_mobkit.mob_names[#cube_mobkit.mob_names+1] = "cube_mobs:box_shoot"

View File

@ -0,0 +1,40 @@
minetest.register_entity("cube_mobs:box_small",{
-- common props
physical = true,
collide_with_objects = false,
collisionbox = {-0.33, -0.25, -0.33, 0.33, 0.33, 0.33},
visual = "cube",
visual_size = {x = .5, y = .5, z= .5},
textures = {"cube_mobs_box_side.png","cube_mobs_box_side.png","cube_mobs_box_side.png","cube_mobs_box_side.png","cube_mobs_box_front.png","cube_mobs_box_side.png"},
spritediv = {x = 1, y = 1},
initial_sprite_basepos = {x = 0, y = 0},
static_save = true,
makes_footstep_sound = true,
on_step = mobkit.stepfunc, -- required
on_activate = cube_mobkit.actfunc, -- required
get_staticdata = mobkit.statfunc,
-- api props
springiness=0,
buoyancy = 0.75, -- portion of hitbox submerged
max_speed = 8,
jump_height = 1.26,
view_range = 24,
lung_capacity = 10, -- seconds
max_hp = 4,
timeout=600,
attack={melee_range=.75,speed = 10, damage_groups={fleshy=2}},
sounds = {
attack='player_damage',
},
brainfunc = cube_mobkit.box_brain,
on_punch= function(self, puncher, time_from_last_punch, tool_capabilities, dir)
cube_mobkit.on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
end,
drops = { {name="cube_mobs:bits", min=1, max=1,prob=255/4} }
})
cube_mobkit.mob_names[#cube_mobkit.mob_names+1] = "cube_mobs:box_small"

View File

@ -0,0 +1,51 @@
minetest.register_entity("cube_mobs:box_spike",{
-- common props
hp_max = 10,
physical = true,
collide_with_objects = false,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
visual_size = {x = 1, y = 1},
textures = {"cube_mobs_box_spike_side.png","cube_mobs_box_spike_side.png","cube_mobs_box_spike_side.png","cube_mobs_box_spike_side.png","cube_mobs_box_spike_front.png","cube_mobs_box_spike_side.png"},
spritediv = {x = 1, y = 1},
initial_sprite_basepos = {x = 0, y = 0},
static_save = true,
makes_footstep_sound = true,
on_step = mobkit.stepfunc, -- required
on_activate = cube_mobkit.actfunc, -- required
get_staticdata = mobkit.statfunc,
-- api props
springiness=0,
buoyancy = 0.75, -- portion of hitbox submerged
max_speed = 4,
jump_height = 1.26,
view_range = 24,
lung_capacity = 10, -- seconds
max_hp = 10,
timeout=600,
attack={range=10,speed = 1, damage_groups={fleshy=0}},
sounds = {
attack='player_damage',
},
brainfunc = cube_mobkit.box_brain,
on_punch= function(self, puncher, time_from_last_punch, tool_capabilities, dir)
cube_mobkit.on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
end,
on_attack_init=function(self,target)
cube_mobkit.fill_path(self,target,"cube_mobs:spikes",3,2)
end,
drops = {
{name="cube_mobs:bits", min=1, max=1,prob=255/4},
{name="default:coal_lump", min=1, max=3,prob=255/2},
{name="default:tin_lump", min=1, max=1,prob=255/10},
{name="default:copper_lump", min=1, max=1,prob=255/6},
},
})
cube_mobkit.mob_names[#cube_mobkit.mob_names+1] = "cube_mobs:box_spike"

7
mods/cube_mobs/mod.conf Normal file
View File

@ -0,0 +1,7 @@
name = cube_mobs
title = Cube Mobs
author = Xanthus
release = 3897
description = Adds various cube mobs with different abilities using mobkit.
depends = default,mobkit
optional_depends = fire

158
mods/cube_mobs/nodes.lua Normal file
View File

@ -0,0 +1,158 @@
minetest.register_node("cube_mobs:spikes", {
description="Spikes",
drawtype = "plantlike",
tiles = {"dangerous_nodes_spikes.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
drop = "cube_mobs:spikes",
inventory_image = "dangerous_nodes_spikes.png",
wield_image = "dangerous_nodes_spikes.png",
groups = {
cracky = 3, attached_node = 1,
},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {
{-.5, -0.5, -.5, .5, 0, .5},
},
},
collision_box = {
type = "fixed",
fixed = {
{-1, -0.5, -1, 1, 0, 1},
},
},
})
minetest.register_node("cube_mobs:spikes_bloody", {
description="Spikes (bloody)",
drawtype = "plantlike",
tiles = {"dangerous_nodes_spikes_bloody.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
drop = "cube_mobs:spikes",
inventory_image = "dangerous_nodes_spikes_bloody.png",
wield_image = "dangerous_nodes_spikes_bloody.png",
groups = {
cracky = 3, attached_node = 1,
},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {
{-.5, -0.5, -.5, .5, 0, .5},
},
},
collision_box = {
type = "fixed",
fixed = {
{-1, -0.5, -1, 1, 0, 1},
},
},
})
-- custom spike and poison damage so it happens instantly, then dps after. Also bloodies spike.
local dangerous_nodes_players = {}
minetest.register_globalstep( function(dtime)
for _,player in pairs(minetest.get_connected_players()) do
local player_name = player:get_player_name()
if(dangerous_nodes_players[player_name]==nil) then
dangerous_nodes_players[player_name] = {playerObj=player, hurt_timer=0, pos={0,0,0}, poison_timer=0, poison_tick=0}
end
local p = dangerous_nodes_players[player_name]
-- don't hurt until time has passed, unless you are hitting a different spike
local pos = player:get_pos()
pos={x=math.ceil(pos.x-.5),y=math.ceil(pos.y),z=math.ceil(pos.z-.5)}
local footnode = minetest.get_node(pos)
local headnode = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
if footnode.name:find("cube_mobs:spike") and (p.hurt_timer<=0 or vector.distance(pos,p.pos)>=1) then
p.hurt_timer = 2 -- per two seconds
p.pos=pos
if player:get_hp() > 0 then
local dmg = 3+player:get_player_velocity().y*-.25 -- bonus damage from falling onto them
player:set_hp(player:get_hp()-dmg)
end
minetest.set_node(pos,{name="cube_mobs:spikes_bloody"})
else
if p.hurt_timer>0 then p.hurt_timer=p.hurt_timer-dtime end
end
if headnode.name:find("cube_mobs:poison") then p.poison_tick = 3 end -- poison will hit 3 times after leaving
if p.poison_tick>0 and p.poison_timer<=0 then
p.poison_timer = 2 -- per two seconds
p.poison_tick = p.poison_tick-1
if minetest.get_modpath("hudbars") ~= nil then
if(p.poison_tick>0) then
hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hbhunger_bar_health_poison.png")
else
-- Reset HUD bar color
hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png")
end
end
if player:get_hp()-1 > 0 then
player:set_hp(player:get_hp()-1)
end
else
if p.poison_timer>0 then p.poison_timer=p.poison_timer-dtime end
end
end
end)
minetest.register_on_leaveplayer(function(player, timed_out)
dangerous_nodes_players[player:get_player_name()]=nil
end)
minetest.register_on_respawnplayer(function(player)
dangerous_nodes_players[player:get_player_name()]=nil
-- Reset HUD bar color
if minetest.get_modpath("hudbars") ~= nil then
hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png")
end
end)
--poison
minetest.register_node("cube_mobs:poison", {
description="Poison Gas",
drawtype = "plantlike",
tiles = {
{
name = "dangerous_nodes_poison_animated.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
floodable = true,
drop = "",
inventory_image = "dangerous_nodes_poison.png",
wield_image = "dangerous_nodes_poison.png",
groups = {
cracky = 3, catchable=1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -0,0 +1,15 @@
# This file contains settings of wildlife that can be changed in
# minetest.conf
# Chance of spawning a mob when there are no other
# mobs in active_block_range around player
# must be float from 0 to 1
# 1 is always, 0 is never
cube_mobs_spawn_chance (Spawn chance) float 0.3
# Base spawn chance is reduced by this factor
# for each mob within active_block_range
# must be float from 0 to 1
# greater number is greater reduction
cube_mobs_spawn_reduction (Spawn chance reduction) float 0.2

93
mods/cube_mobs/spawns.lua Normal file
View File

@ -0,0 +1,93 @@
-- todo: chances / weighted spawning
local num_spawns = 0
local abr = minetest.get_mapgen_setting('active_block_range')
local spawn_rate = 1 - math.max(math.min(minetest.settings:get('cube_mobs_spawn_chance') or 0.1,1),0)
local spawn_reduction = minetest.settings:get('cube_mobs_spawn_reduction') or 0.1
local spawn_timer = 5 -- try to spawn every 5 seconds
local function spawnstep(dtime)
if spawn_timer<=0 then
spawn_timer = 5
for _,plyr in ipairs(minetest.get_connected_players()) do
local vel = plyr:get_player_velocity()
local spd = vector.length(vel)
local chance = spawn_rate * 1/(spd*0.75+1) -- chance is quadrupled for speed=4
local player_name = plyr:get_player_name()
local yaw
if spd > 1 then
-- spawn in the front arc
yaw = plyr:get_look_horizontal() + math.random()*0.35 - 0.75
else
-- random yaw
yaw = math.random()*math.pi*2 - math.pi
end
local pos = plyr:get_pos()
local cave_modifier = 1
if pos.y<-8 then
cave_modifier = .5
end
local dir = vector.multiply(minetest.yaw_to_dir(yaw),abr*16*cave_modifier)
local pos2 = vector.add(pos,dir)
pos2.y=pos2.y-5
-- pos2 is center of where we want to search
-- pos_spawn_start and pos_spawn_end define corners
local pos_spawn_start = {x=pos2.x-10,y=pos2.y-10,z=pos2.z-10}
local pos_spawn_end = {x=pos2.x+10,y=pos2.y+10,z=pos2.z+10}
local nodenames={"group:soil","group:crumbly"}
local potential_spawns = minetest.find_nodes_in_area_under_air(pos_spawn_start, pos_spawn_end, nodenames)
if #potential_spawns == 0 then
return
end
-- find spawn furthest from player
local pos_spawn = potential_spawns[1]
for _,v in pairs(potential_spawns) do
local dist = vector.distance(v,pos)
if dist>vector.distance(pos_spawn,pos) then
pos_spawn = v
end
end
pos_spawn.y=pos_spawn.y+1 -- move above floor
local objs = minetest.get_objects_inside_radius(pos,abr*16*cave_modifier+5)
for _,obj in ipairs(objs) do -- count mobs in abrange
if not obj:is_player() then
local luaent = obj:get_luaentity()
if luaent and luaent.name:find('cube_mobs:') then
chance=chance + (1-chance)*spawn_reduction -- chance reduced for every mob in range
local mob_pos = obj:get_pos()
end
end
end
if chance < math.random() then
local mobname = cube_mobkit.mob_names[math.random(#cube_mobkit.mob_names)]
objs = minetest.get_objects_inside_radius(pos_spawn,abr*16*cave_modifier-2)
for _,obj in ipairs(objs) do -- do not spawn if another player around
if obj:is_player() then
return
end
end
-- minetest.chat_send_all("Spawned at:"..floor(pos_spawn.x).." "..floor(pos_spawn.y).." "..floor(pos_spawn.z))
minetest.add_entity(pos_spawn,mobname) -- spawn
num_spawns = num_spawns + 1
end
end
else
spawn_timer = spawn_timer - dtime
end
end
minetest.register_globalstep(spawnstep)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

198
mods/default/README.txt Normal file
View File

@ -0,0 +1,198 @@
Minetest 0.4 mod: default
==========================
License of source code:
-----------------------
Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
-----------------------
Everything not listed in here:
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
Originating from work by kddekadenz/Dogers:
default_grass_footstep.{1,2,3}.ogg
default_dig_crumbly.{1,2}.ogg
Cisoun (CC BY-SA 4.0):
default_dirt.png
default_sand.png
default_wood.png
default_ladder.png
default_furnace_fire*
wieldhand.png
player.png
player_back.png
VanessaE (CC BY-SA 4.0):
default_nc_rb.png
default_torch_animated.png
default_torch_on_floor_animated.png
default_torch_on_floor.png
default_torch.png
default_torch_on_ceiling.png
default_torch_on_floor.png
Calinou (CC BY-SA):
default_brick.png
default_tool_steelsword.png
MirceaKitsune (CC BY-SA 4.0):
character.x
Jordach (CC BY-SA 3.0):
character.png
Zeg9 (CC BY-SA 3.0):
default_coal_block.png
default_gravel.png
kaeza (CC BY-SA 4.0):
bubble.png
Casimir (CC BY-SA 4.0)
default_junglesapling.png
default_jungleleaves.png
default_mineral_mese.png
default_mese_crystal.png
default_mese_crystal_fragment.png
default_mese_block.png
default_mineral_coal.png
default_coal_lump.png
default_mineral_iron.png
default_iron_lump.png
default_steel_ingot.png
default_mineral_copper.png
default_copper_lump.png
default_copper_ingot.png
default_copper_block.png
default_glass.png
default_furnace*
default_tool_copperpick.png
default_tool_copperaxe.png
default_tool_coppershovel.png
default_tool_coppersword.png
heart.png
default_sapling.png
default_paper.png
default_desert_stone.png
default_stone.png
crack_anylenght.png
default_dry_shrub.png
default_nc_back.png
default_nc_front.png
default_nc_side.png
default_apple.png
default_fence.png
default_torch_on_ceiling_animated.png
gui_hotbar*
default_cactus_fig.png (based on work by toby109tt)
default_seaweed_top.png (based on work by Gambit)
default_coral_purple.png (based on work by Pithydon)
default_tin_block.png
default_tin_ingot.png
default_tin_lump.png
default_mineral_tin.png
default_bronze_ingot.png
default_stone_crumbled.png (based on work by Gambit)
Gambit (CC BY-SA 4.0)
default_book.png
default_cactus_side.png
default_cactus_top.png
default_grass_*
default_junglegrass.png
default_sign_wall.png
default_snow.png
default_snowball.png
default_snow_side.png
default_tree.png
default_tree_top.png
default_chest_front.png
default_chest_lock.png
default_chest_side.png
default_chest_top.png
default_lava.png
default_lava_flowing_animated.png
default_lava_source_animated.png
default_stone_brick.png
default_brick.png
default_seaweed.png
default_sandstone.png
BlockMen (CC BY 3.0)
default_water.png
default_water_source_animated.png
default_water_flowing_animated.png
default_tool_mesepick.png
default_tool_steelaxe.png
default_tool_steelpick.png
default_tool_steelshovel.png
default_tool_stoneaxe.png
default_tool_stonepick.png
default_tool_stoneshovel.png
default_tool_woodaxe.png
default_tool_woodpick.png
default_tool_woodshovel.png
default_stick.png
WisdomFire (CC BY-SA 3.0)
default_jungletree.png
default_jungletree_top.png
PilzAdam (CC BY-SA 3.0)
default_ice.png
kilbith (CC BY-SA 3.0)
default_steel_block.png
default_bronze_block.png
default_cobble.png
default_mossycobble.png
xssheep MC PixelPerfection texture pack, converted by sofar (CC BY-SA 4.0)
default_leaves.png
default_papyrus.png
default_granite.png
tobyplowy (aka toby109tt) (CC BY 3.0)
default_grass.png
default_grass_side.png
default_grass_footsteps.png
default_cactus_fig_item.png
default_clay.png
default_clay_lump.png
Rath (CC BY-SA 3.0)
default_molten_rock*
Pithydon (CC BY-SA 3.0)
default_coral_brown.png
default_coral_orange.png
default_coral_skeleton.png
Mossmanikin (CC BY-SA 3.0):
default_fern_*.png
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
2: http://www.freesound.org/people/Tomlija/sounds/97669/
3: http://www.freesound.org/people/lsprice/sounds/88808/
n3b http://opengameart.org/users/n3b (CC BY)
player_damage.1.ogg
player_damage.2.ogg
Tool breaking sounds
default_tool_breaks - https://opengameart.org/content/35-wooden-crackshitsdestructions - CC0

69
mods/default/aliases.lua Normal file
View File

@ -0,0 +1,69 @@
-- aliases (Minetest 0.4 mod)
-- Provides alias for most default items
minetest.register_alias("stone", "default:stone")
minetest.register_alias("dirt", "default:dirt")
minetest.register_alias("sand", "default:sand")
minetest.register_alias("gravel", "default:gravel")
minetest.register_alias("sandstone", "default:sandstone")
minetest.register_alias("clay", "default:clay")
minetest.register_alias("brick", "default:brick")
minetest.register_alias("tree", "default:tree")
minetest.register_alias("jungletree", "default:jungletree")
minetest.register_alias("junglegrass", "default:junglegrass")
minetest.register_alias("junglesapling", "default:junglesapling")
minetest.register_alias("leaves", "default:leaves")
minetest.register_alias("cactus", "default:cactus")
minetest.register_alias("papyrus", "default:papyrus")
minetest.register_alias("bookshelf", "default:bookshelf")
minetest.register_alias("glass", "default:glass")
minetest.register_alias("fence", "default:fence_wood")
minetest.register_alias("rail", "default:rail")
minetest.register_alias("ladder", "default:ladder")
minetest.register_alias("wood", "default:wood")
minetest.register_alias("mese", "default:mese")
minetest.register_alias("cloud", "default:cloud")
minetest.register_alias("water", "default:water_source")
minetest.register_alias("lava", "default:lava_source")
minetest.register_alias("torch", "default:torch")
minetest.register_alias("sign", "default:sign_wall")
minetest.register_alias("furnace", "default:furnace")
minetest.register_alias("chest", "default:chest")
minetest.register_alias("locked_chest", "default:chest_locked")
minetest.register_alias("cobble", "default:cobble")
minetest.register_alias("mossycobble", "default:mossycobble")
minetest.register_alias("steelblock", "default:steelblock")
minetest.register_alias("nyanrat", "default:nyancat")
minetest.register_alias("rainbow", "default:nyancat_rainbow")
minetest.register_alias("sapling", "default:sapling")
minetest.register_alias("apple", "default:apple")
minetest.register_alias("snow", "default:snow")
minetest.register_alias("dirt_with_snow", "default:dirt_with_snow")
minetest.register_alias("woodpick", "default:pick_wood")
minetest.register_alias("stonepick", "default:pick_stone")
minetest.register_alias("steelpick", "default:pick_steel")
minetest.register_alias("mesepick", "default:pick_mese")
minetest.register_alias("woodshovel", "default:shovel_wood")
minetest.register_alias("stoneshovel", "default:shovel_stone")
minetest.register_alias("steelshovel", "default:shovel_steel")
minetest.register_alias("woodaxe", "default:axe_wood")
minetest.register_alias("stoneaxe", "default:axe_stone")
minetest.register_alias("steelaxe", "default:axe_steel")
minetest.register_alias("woodsword", "default:sword_wood")
minetest.register_alias("stonesword", "default:sword_stone")
minetest.register_alias("steelsword", "default:sword_steel")
minetest.register_alias("stick", "default:stick")
minetest.register_alias("paper", "default:paper")
minetest.register_alias("book", "default:book")
minetest.register_alias("coal", "default:coal_lump")
minetest.register_alias("iron", "default:iron_lump")
minetest.register_alias("clay_lump", "default:clay_lump")
minetest.register_alias("steel", "default:steel_ingot")
minetest.register_alias("clay_brick", "default:clay_brick")
-- Old node names
minetest.register_alias("default:small_stone", "default:stone_crumbled")
minetest.register_alias("default:mese_block", "default:mese")
minetest.register_alias("default:nyancat_rainbow", "default:rainbow")

234
mods/default/biomes.lua Normal file
View File

@ -0,0 +1,234 @@
minetest.clear_registered_biomes()
-- Below 0
minetest.register_biome({
name = "Sea_Dirt",
node_top = "default:dirt", depth_top = 3,
node_riverbed = "default:dirt", depth_riverbed = 2,
y_min = -32000, y_max = 0,
heat_point = 30, humidity_point = 40,
})
minetest.register_biome({
name = "Sea_Sand",
node_top = "default:sand", depth_top = 3,
node_riverbed = "default:sand", depth_riverbed = 2,
y_min = -32000, y_max = 5,
heat_point = 90, humidity_point = 40,
})
minetest.register_biome({
name = "Sea_Desert_Sand",
node_top = "default:desert_sand", depth_top = 3,
node_filler = "default:desert_stone", depth_filler = 3,
node_riverbed = "default:desert_sand", depth_riverbed = 2,
y_min = -32000, y_max = 5,
heat_point = 110, humidity_point = -60,
})
minetest.register_biome({
name = "Sea_Gravel",
node_top = "default:gravel", depth_top = 3,
node_filler = "default:stone", depth_filler = 3,
node_riverbed = "default:gravel", depth_riverbed = 2,
y_min = -32000, y_max = 5,
heat_point = 30, humidity_point = -60,
})
-- Over 0
-- Woods
minetest.register_biome({
name = "Conifer",
node_top = "default:dirt_with_snow", depth_top = 1,
node_filler = "default:dirt", depth_filler = 2,
node_riverbed = "default:dirt", depth_riverbed = 2,
y_min = 1, y_max = 32000,
heat_point = 00, humidity_point = 70,
})
-- Transition Conifer-Tree
minetest.register_biome({
name = "CT",
node_top = "default:dirt_with_grass", depth_top = 1,
node_filler = "default:dirt", depth_filler = 2,
node_riverbed = "default:dirt", depth_riverbed = 2,
y_min = 1, y_max = 32000,
heat_point = 25, humidity_point = 75,
})
minetest.register_biome({
name = "Tree",
node_top = "default:dirt_with_grass", depth_top = 1,
node_filler = "default:dirt", depth_filler = 3,
node_riverbed = "default:dirt", depth_riverbed = 2,
y_min = 1, y_max = 32000,
heat_point = 50, humidity_point = 80,
})
-- Transition Tree-Jungle
minetest.register_biome({
name = "TJ",
node_top = "default:dirt_with_grass", depth_top = 1,
node_filler = "default:dirt", depth_filler = 4,
node_riverbed = "default:dirt", depth_riverbed = 2,
y_min = 1, y_max = 32000,
heat_point = 90, humidity_point = 75,
})
minetest.register_biome({
name = "Jungle",
node_top = "default:dirt_with_grass", depth_top = 1,
node_filler = "default:dirt", depth_filler = 4,
node_riverbed = "default:dirt", depth_riverbed = 2,
y_min = 1, y_max = 32000,
heat_point = 100, humidity_point = 70,
})
minetest.register_biome({
name = "Desert",
node_top = "default:desert_sand", depth_top = 3,
node_filler = "default:desert_stone", depth_filler = 8,
node_riverbed = "default:sand", depth_riverbed = 2,
y_min = 1, y_max = 32000,
heat_point = 120, humidity_point = -45,
})
-- Special Biomes
minetest.register_biome({
name = "Glacier",
node_top = "default:snowblock", depth_top = 2,
node_filler = "default:ice", depth_filler = 32,
node_water_top = "default:ice", depth_water_top = 3,
node_riverbed = "default:gravel", depth_riverbed = 2,
node_river_water = "default:ice",
y_min = 1, y_max = 32000,
heat_point = -20, humidity_point = -30,
})
minetest.register_biome({
name = "Gravel_Ice",
node_top = "default:gravel", depth_top = 3,
node_dust = "default:snow",
node_water_top = "default:ice", depth_water_top = 3,
node_riverbed = "default:gravel", depth_riverbed = 2,
node_river_water = "default:ice",
y_min = 1, y_max = 32000,
heat_point = -40, humidity_point = -40,
})
minetest.register_biome({
name = "Gravel_Desert",
node_top = "default:gravel", depth_top = 3,
node_filler = "default:desert_stone", depth_filler = 3,
node_riverbed = "default:gravel", depth_riverbed = 2,
y_min = 1, y_max = 32000,
heat_point = 160, humidity_point = -20,
})
-- Decoration
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.00,
scale = 0.020,
spread = {x = 250, y = 250, z = 250},
seed = 153,
octaves = 3,
persist = 0.66
},
biomes = {"Conifer", "CT"},
flags = "place_center_x, place_center_z",
schematic = minetest.get_modpath("default").."/schematics/conifer_conifertree_1.mts",
y_min = 0,
y_max = 32000,
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.00,
scale = 0.010,
spread = {x = 250, y = 250, z = 250},
seed = 154,
octaves = 3,
persist = 0.66
},
biomes = {"Conifer", "CT"},
flags = "place_center_x, place_center_z",
schematic = minetest.get_modpath("default").."/schematics/conifer_conifertree_2.mts",
y_min = 0,
y_max = 32000,
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.00,
scale = 0.030,
spread = {x = 250, y = 250, z = 250},
seed = 538,
octaves = 3,
persist = 0.66
},
biomes = {"Tree", "CT", "TJ"},
flags = "place_center_x, place_center_z",
schematic = minetest.get_modpath("default").."/schematics/default_tree.mts",
rotation = "random",
y_min = 0,
y_max = 32000,
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.05,
scale = 0.020,
spread = {x = 250, y = 250, z = 250},
seed = 539,
octaves = 3,
persist = 0.66
},
biomes = {"Tree", "CT", "TJ"},
flags = "place_center_x, place_center_z",
schematic = minetest.get_modpath("default").."/schematics/default_apple_tree.mts",
rotation = "random",
y_min = 0,
y_max = 32000,
})
minetest.register_decoration({
deco_type = "schematic",
place_on = "default:dirt_with_grass",
sidelen = 16,
noise_params = {
offset = 0.00,
scale = 0.030,
spread = {x = 250, y = 250, z = 250},
seed = 680,
octaves = 3,
persist = 0.66
},
biomes = {"Jungle", "TJ"},
flags = "place_center_x, place_center_z",
schematic = minetest.get_modpath("default").."/schematics/default_jungletree.mts",
rotation = "random",
y_min = 0,
y_max = 32000,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass", "default:cactus"},
sidelen = 16,
fill_ratio = 0.15,
biomes = {"Jungle", "TJ"},
decoration = {"default:junglegrass"},
y_min = 0,
y_max = 32000,
})

802
mods/default/crafting.lua Normal file
View File

@ -0,0 +1,802 @@
-- mods/default/crafting.lua
--
-- Crafting definition
--
minetest.register_craft({
output = 'default:wood 2',
recipe = {
{'group:tree'},
}
})
minetest.register_craft({
output = 'default:stick 4',
recipe = {
{'group:wood'},
}
})
minetest.register_craft({
output = 'default:stick 6',
recipe = {
{'group:leaves'},
{'group:leaves'},
{'group:leaves'},
}
})
minetest.register_craft({
output = 'default:stick 6',
recipe = {
{'default:dry_shrub'},
{'default:dry_shrub'},
{'default:dry_shrub'},
}
})
minetest.register_craft({
output = 'default:fence_wood 2',
recipe = {
{'group:stick', 'group:stick', 'group:stick'},
{'group:stick', 'group:stick', 'group:stick'},
}
})
minetest.register_craft({
output = 'default:sign_wall 6',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
{'', 'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:torch 4',
recipe = {
{'default:coal_lump'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:pick_wood',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'', 'group:stick', ''},
{'', 'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_wood',
recipe = {
{'group:tree_horizontal', 'group:tree_horizontal', 'group:tree_horizontal'},
{'', 'group:stick', ''},
{'', 'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_stone',
recipe = {
{'group:stone', 'group:stone', 'group:stone'},
{'', 'group:stick', ''},
{'', 'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_copper',
recipe = {
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
{'', 'group:stick', ''},
{'', 'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_bronze',
recipe = {
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
{'', 'group:stick', ''},
{'', 'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_steel',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', 'group:stick', ''},
{'', 'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_mese',
recipe = {
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'', 'group:stick', ''},
{'', 'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:shovel_wood',
recipe = {
{'group:tree'},
{'group:stick'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_wood',
recipe = {
{'group:tree_horizontal'},
{'group:stick'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_stone',
recipe = {
{'default:stone'},
{'group:stick'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_copper',
recipe = {
{'default:copper_ingot'},
{'group:stick'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_bronze',
recipe = {
{'default:bronze_ingot'},
{'group:stick'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_steel',
recipe = {
{'default:steel_ingot'},
{'group:stick'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:axe_wood',
recipe = {
{'group:tree', 'group:stick'},
{'group:tree', 'group:stick'},
{'', 'group:stick'},
}
})
minetest.register_craft({
output = 'default:axe_wood',
recipe = {
{'group:tree_horizontal', 'group:stick'},
{'group:tree_horizontal', 'group:stick'},
{'', 'group:stick'},
}
})
minetest.register_craft({
output = 'default:axe_stone',
recipe = {
{'group:stone', 'group:stone'},
{'group:stone', 'group:stick'},
{'', 'group:stick'},
}
})
minetest.register_craft({
output = 'default:axe_copper',
recipe = {
{'default:copper_ingot', 'group:stick'},
{'default:copper_ingot', 'group:stick'},
{'', 'group:stick'},
}
})
minetest.register_craft({
output = 'default:axe_bronze',
recipe = {
{'default:bronze_ingot', 'group:stick'},
{'default:bronze_ingot', 'group:stick'},
{'', 'group:stick'},
}
})
minetest.register_craft({
output = 'default:axe_steel',
recipe = {
{'default:steel_ingot', 'group:stick'},
{'default:steel_ingot', 'group:stick'},
{'', 'group:stick'},
}
})
minetest.register_craft({
output = 'default:sword_wood',
recipe = {
{'group:tree'},
{'group:tree'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:sword_wood',
recipe = {
{'group:tree_horizontal'},
{'group:tree_horizontal'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:sword_stone',
recipe = {
{'group:stone'},
{'group:stone'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:sword_copper',
recipe = {
{'default:copper_ingot'},
{'default:copper_ingot'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:sword_bronze',
recipe = {
{'default:bronze_ingot'},
{'default:bronze_ingot'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:sword_steel',
recipe = {
{'default:steel_ingot'},
{'default:steel_ingot'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'default:rail 15',
recipe = {
{'default:steel_ingot', '', 'default:steel_ingot'},
{'default:steel_ingot', 'group:stick', 'default:steel_ingot'},
{'default:steel_ingot', '', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'default:chest',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', '', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:chest_locked',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', 'default:steel_ingot', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:furnace',
recipe = {
{'group:stone', 'group:stone', 'group:stone'},
{'group:stone', '', 'group:stone'},
{'group:stone', 'group:stone', 'group:stone'},
}
})
minetest.register_craft({
output = 'default:clay_furnace',
recipe = {
{'default:clay', 'default:clay', 'default:clay'},
{'default:clay', '', 'default:clay'},
{'default:clay', 'default:clay', 'default:clay'},
}
})
minetest.register_craft({
output = 'default:coalblock',
recipe = {
{'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
{'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
{'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
}
})
minetest.register_craft({
output = 'default:coal_lump 9',
recipe = {
{'default:coalblock'},
}
})
minetest.register_craft({
output = 'default:steelblock',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'default:steel_ingot 9',
recipe = {
{'default:steelblock'},
}
})
minetest.register_craft({
output = 'default:copperblock',
recipe = {
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
}
})
minetest.register_craft({
output = 'default:copper_ingot 9',
recipe = {
{'default:copperblock'},
}
})
minetest.register_craft({
output = 'default:tinblock',
recipe = {
{'default:tin_ingot', 'default:tin_ingot', 'default:tin_ingot'},
{'default:tin_ingot', 'default:tin_ingot', 'default:tin_ingot'},
{'default:tin_ingot', 'default:tin_ingot', 'default:tin_ingot'},
}
})
minetest.register_craft({
output = 'default:tin_ingot 9',
recipe = {
{'default:tinblock'},
}
})
minetest.register_craft({
output = "default:bronze_ingot",
recipe = {
{"default:copper_ingot", "default:tin_ingot"},
}
})
minetest.register_craft({
output = 'default:bronzeblock',
recipe = {
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
}
})
minetest.register_craft({
output = 'default:bronze_ingot 9',
recipe = {
{'default:bronzeblock'},
}
})
minetest.register_craft({
output = 'default:sandstone',
recipe = {
{'default:sand', 'default:sand'},
{'default:sand', 'default:sand'},
}
})
minetest.register_craft({
output = 'default:sand 4',
recipe = {
{'default:sandstone'},
}
})
minetest.register_craft({
output = 'default:clay',
recipe = {
{'default:clay_lump', 'default:clay_lump'},
{'default:clay_lump', 'default:clay_lump'},
}
})
minetest.register_craft({
output = 'default:clay_lump 4',
recipe = {
{'default:clay'},
}
})
minetest.register_craft({
output = 'default:brick',
recipe = {
{'default:clay_brick', 'default:clay_brick'},
{'default:clay_brick', 'default:clay_brick'},
}
})
minetest.register_craft({
output = 'default:clay_brick 4',
recipe = {
{'default:brick'},
}
})
minetest.register_craft({
output = 'default:stone_crumbled 4',
recipe = {
{'default:stone'},
}
})
minetest.register_craft({
output = 'default:stone',
recipe = {
{'default:stone_crumbled', 'default:stone_crumbled'},
{'default:stone_crumbled', 'default:stone_crumbled'},
}
})
minetest.register_craft({
output = 'default:paper',
recipe = {
{'default:papyrus', 'default:papyrus', 'default:papyrus'},
}
})
minetest.register_craft({
output = 'default:book',
recipe = {
{'default:paper'},
{'default:paper'},
{'default:paper'},
}
})
minetest.register_craft({
output = 'default:bookshelf',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'default:book', 'default:book', 'default:book'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:ladder 2',
recipe = {
{'group:stick', '', 'group:stick'},
{'group:stick', 'group:stick', 'group:stick'},
{'group:stick', '', 'group:stick'},
}
})
minetest.register_craft({
output = 'default:mese',
recipe = {
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
}
})
minetest.register_craft({
output = 'default:mese_crystal',
recipe = {
{'default:mese_crystal_fragment', 'default:mese_crystal_fragment', 'default:mese_crystal_fragment'},
{'default:mese_crystal_fragment', 'default:mese_crystal_fragment', 'default:mese_crystal_fragment'},
{'default:mese_crystal_fragment', 'default:mese_crystal_fragment', 'default:mese_crystal_fragment'},
}
})
minetest.register_craft({
output = 'default:mese_crystal 9',
recipe = {
{'default:mese'},
}
})
minetest.register_craft({
output = 'default:mese_crystal_fragment 9',
recipe = {
{'default:mese_crystal'},
}
})
minetest.register_craft({
output = 'default:stonebrick',
recipe = {
{'default:stone', 'default:stone'},
{'default:stone', 'default:stone'},
}
})
minetest.register_craft({
output = 'default:snowblock',
recipe = {
{'default:snow', 'default:snow', 'default:snow'},
{'default:snow', 'default:snow', 'default:snow'},
{'default:snow', 'default:snow', 'default:snow'},
}
})
minetest.register_craft({
output = 'default:snow 9',
recipe = {
{'default:snowblock'},
}
})
--
-- Crafting (tool repair)
--
minetest.register_craft({
type = "toolrepair",
additional_wear = -0.02,
})
--
-- Cooking recipes
--
minetest.register_craft({
type = "cooking",
output = "default:glass",
recipe = "group:sand",
})
minetest.register_craft({
type = "cooking",
output = "default:stone",
recipe = "default:stone",
})
minetest.register_craft({
type = "cooking",
output = "default:stone",
recipe = "default:mossystone",
})
minetest.register_craft({
type = "cooking",
output = "default:steel_ingot",
recipe = "default:iron_lump",
cooktime = 10,
})
minetest.register_craft({
type = "cooking",
output = "default:copper_ingot",
recipe = "default:copper_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:tin_ingot",
recipe = "default:tin_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:clay_brick",
recipe = "default:clay_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:coal_lump",
recipe = "group:tree",
})
--
-- Fuels
--
minetest.register_craft({
type = "fuel",
recipe = "group:tree",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:junglegrass",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "group:leaves",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:cactus",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:papyrus",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:bookshelf",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_wood",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:ladder",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "group:wood",
burntime = 7,
})
minetest.register_craft({
type = "fuel",
recipe = "default:lava_source",
burntime = 60,
})
minetest.register_craft({
type = "fuel",
recipe = "default:torch",
burntime = 4,
})
minetest.register_craft({
type = "fuel",
recipe = "default:sign_wall",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:chest",
burntime = 20,
})
minetest.register_craft({
type = "fuel",
recipe = "default:chest_locked",
burntime = 20,
})
minetest.register_craft({
type = "fuel",
recipe = "default:nyancat",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:nyancat_rainbow",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:sapling",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:apple",
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "default:coal_lump",
burntime = 40,
})
minetest.register_craft({
type = "fuel",
recipe = "default:coalblock",
burntime = 360,
})
minetest.register_craft({
type = "fuel",
recipe = "default:junglesapling",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:pick_wood",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:shovel_wood",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:axe_wood",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:sword_wood",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:dry_shrub",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fern_1",
burntime = 2,
})

View File

@ -0,0 +1,93 @@
-- mods/default/craftitems.lua
--
-- Crafting items
--
minetest.register_craftitem("default:stick", {
description = "Stick",
inventory_image = "default_stick.png",
groups = {stick=1},
})
minetest.register_craftitem("default:diamond", {
description = "Diamond",
inventory_image = "Diamond.png",
})
minetest.register_craftitem("default:paper", {
description = "Paper",
inventory_image = "default_paper.png",
})
minetest.register_craftitem("default:book", {
description = "Book",
inventory_image = "default_book.png",
})
minetest.register_craftitem("default:coal_lump", {
description = "Coal Lump",
inventory_image = "default_coal_lump.png",
})
minetest.register_craftitem("default:iron_lump", {
description = "Iron Lump",
inventory_image = "default_iron_lump.png",
})
minetest.register_craftitem("default:tin_lump", {
description = "Tin Lump",
inventory_image = "default_tin_lump.png",
})
minetest.register_craftitem("default:copper_lump", {
description = "Copper Lump",
inventory_image = "default_copper_lump.png",
})
minetest.register_craftitem("default:mese_crystal", {
wield_scale = {x=1,y=1,z=0},
description = "Mese Crystal",
inventory_image = "default_mese_crystal.png",
})
minetest.register_craftitem("default:clay_lump", {
description = "Clay Lump",
inventory_image = "default_clay_lump.png",
})
minetest.register_craftitem("default:steel_ingot", {
description = "Steel Ingot",
inventory_image = "default_steel_ingot.png",
groups = {metal_ingot=1},
})
minetest.register_craftitem("default:copper_ingot", {
description = "Copper Ingot",
inventory_image = "default_copper_ingot.png",
groups = {metal_ingot=1},
})
minetest.register_craftitem("default:tin_ingot", {
description = "Tin Ingot",
inventory_image = "default_tin_ingot.png",
groups = {metal_ingot=1},
})
minetest.register_craftitem("default:bronze_ingot", {
description = "Bronze Ingot",
inventory_image = "default_bronze_ingot.png",
groups = {metal_ingot=1},
})
minetest.register_craftitem("default:mese_crystal_fragment", {
wield_scale = {x=1,y=1,z=0},
description = "Mese Crystal Fragment",
inventory_image = "default_mese_crystal_fragment.png",
})
minetest.register_craftitem("default:clay_brick", {
description = "Clay Brick",
inventory_image = "default_clay_brick.png",
})

1
mods/default/depends.txt Normal file
View File

@ -0,0 +1 @@
player_api?

317
mods/default/functions.lua Normal file
View File

@ -0,0 +1,317 @@
-- mods/default/functions.lua
--
-- Default node sounds
--
function default.node_sound_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="", gain=1.0}
table.dug = table.dug or
{name="default_dug_node", gain=0.5}
table.place = table.place or
{name="default_place_node", gain=0.5}
return table
end
function default.node_sound_stone_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_hard_footstep", gain=0.3}
default.node_sound_defaults(table)
return table
end
function default.node_sound_dirt_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="", gain=0.2}
--table.dug = table.dug or
-- {name="default_dirt_break", gain=0.5}
default.node_sound_defaults(table)
return table
end
function default.node_sound_sand_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_grass_footstep", gain=0.2}
--table.dug = table.dug or
-- {name="default_dirt_break", gain=0.25}
table.dug = table.dug or
{name="", gain=0.25}
default.node_sound_defaults(table)
return table
end
function default.node_sound_wood_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_hard_footstep", gain=0.4}
default.node_sound_defaults(table)
return table
end
function default.node_sound_leaves_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_dig_crumbly", gain=0.2}
table.dig = table.dig or
{name="default_dig_crumbly", gain=0.4}
table.dug = table.dug or
{name="", gain=1.0}
default.node_sound_defaults(table)
return table
end
function default.node_sound_glass_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_hard_footstep", gain=0.3}
table.dug = table.dug or
{name="default_break_glass", gain=0.5}
default.node_sound_defaults(table)
return table
end
function default.node_sound_metal_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_metal_footstep", gain = 0.4}
table.dig = table.dig or
{name = "default_dig_metal", gain = 0.5}
table.dug = table.dug or
{name = "default_dug_metal", gain = 0.5}
table.place = table.place or
{name = "default_place_node_metal", gain = 0.5}
default.node_sound_defaults(table)
return table
end
--
-- Grow grass
--
minetest.register_abm({
label = "Grass spread",
nodenames = {"default:dirt"},
neighbors = {"default:dirt_with_grass", "default:dirt_with_grass_footsteps"},
interval = 2,
chance = 200,
catch_up = false,
action = function(pos, node)
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light")
and nodedef.liquidtype == "none"
and (minetest.get_node_light(above) or 0) >= 11 then
if name == "default:snow" or name == "default:snowblock" then
minetest.set_node(pos, {name = "default:dirt_with_snow"})
else
minetest.set_node(pos, {name = "default:dirt_with_grass"})
end
end
end
})
minetest.register_abm({
label = "Grass new",
nodenames = {"group:flora"},
neighbors = {"default:dirt"},
interval = 2,
chance = 20,
catch_up = false,
action = function(pos, node)
local under = {x=pos.x, y=pos.y-1, z=pos.z}
local name = minetest.get_node(under).name
if name == "default:dirt" then
minetest.set_node(under, {name = "default:dirt_with_grass"})
end
end
})
minetest.register_abm({
label = "Grass covered",
nodenames = {
"default:dirt_with_grass",
"default:dirt_with_snow",
},
interval = 8,
chance = 100,
catch_up = false,
action = function(pos, node)
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or
nodedef.paramtype == "light") and
nodedef.liquidtype == "none") then
minetest.set_node(pos, {name = "default:dirt"})
end
end
})
--
-- Lavacooling
--
default.cool_lava = function(pos, node)
if node.name == "default:lava_source" then
minetest.set_node(pos, {name = "default:molten_rock"})
else -- Lava flowing
minetest.set_node(pos, {name = "default:stone"})
end
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end
minetest.register_abm({
label = "Lava cooling",
nodenames = {"default:lava_source", "default:lava_flowing"},
neighbors = {"group:cools_lava", "group:water"},
interval = 1,
chance = 2,
catch_up = false,
action = function(...)
default.cool_lava(...)
end,
})
minetest.register_abm({
label = "Molten rock cooling",
nodenames = {"default:molten_rock"},
neighbors = {"group:cools_lava", "group:water"},
interval = 11,
chance = 50,
catch_up = false,
action = function(pos, node)
minetest.set_node(pos, {name = "default:stone"})
end,
})
--
-- Papyrus and cactus growing
--
function default.grow_cactus(pos, node)
pos.y = pos.y - 1
local node = minetest.get_node(pos)
if minetest.get_item_group(node.name, "sand") == 0 then
return
end
pos.y = pos.y + 1
local height = 0
node = minetest.get_node(pos)
while node.name == "default:cactus" and height < 5 do
height = height + 1
pos.y = pos.y + 1
node = minetest.get_node(pos)
end
if node.name ~= "air" then return end
-- Increased chance for figs to grow the taller the cactus is.
if height < math.random(2, 5) then
minetest.set_node(pos, {name="default:cactus"})
else
minetest.set_node(pos, {name="default:cactus_fig"})
end
return true
end
function default.grow_papyrus(pos, node)
pos.y = pos.y - 1
local node = minetest.get_node(pos)
if minetest.get_item_group(node.name, "soil") == 0 then
return
end
if not minetest.find_node_near(pos, 3, {"group:water"}) then
return
end
pos.y = pos.y + 1
node = minetest.get_node(pos)
local height = 0
while node.name == "default:papyrus" and height < 5 do
height = height + 1
pos.y = pos.y + 1
node = minetest.get_node(pos)
end
if height < math.random(0, 5) and node.name == "air" then
minetest.set_node(pos, {name="default:papyrus"})
return true
end
end
minetest.register_abm({
nodenames = {"default:coral_brown", "default:coral_orange", "default:coral_purple"},
neighbors = {"air"},
interval = 17,
chance = 5,
catch_up = false,
action = function(pos, node)
if not minetest.find_node_near(pos, 1, "group:water") then
minetest.set_node(pos, {name = "default:coral_skeleton"})
end
end,
})
-- Wrapping the functions in abm action is necessary to make overriding them possible.
minetest.register_abm({
label = "Grow cactus",
nodenames = {"default:cactus"},
neighbors = {"group:sand"},
interval = 70,
chance = 30,
action = function(...)
default.grow_cactus(...)
end,
})
minetest.register_abm({
label = "Grow cactus from fig",
nodenames = {"default:cactus_fig"},
neighbors = {"group:sand"},
interval = 7,
chance = 3,
action = function(pos, node)
local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z})
if minetest.get_item_group(node_under.name, "sand") ~= 0 then
minetest.set_node(pos, {name="default:cactus"})
end
end,
})
minetest.register_abm({
label = "Grow papyrus",
nodenames = {"default:papyrus"},
neighbors = {"default:dirt", "default:dirt_with_grass", "default:papyrus_roots"},
interval = 40,
chance = 30,
action = function(...)
default.grow_papyrus(...)
end,
})
-- Dig upwards
function default.dig_up(pos, node, digger)
if digger == nil then return end
local np = {x = pos.x, y = pos.y + 1, z = pos.z}
local nn = minetest.get_node(np)
if nn.name == node.name then
minetest.node_dig(np, nn, digger)
end
end
-- Rotate symmetric nodes
function default.rotate_horizontal(pos)
local node = minetest.get_node(pos)
if node.param2 == 2 then
node.param2 = 0
elseif node.param2 == 3 then
node.param2 = 1
else
return
end
minetest.set_node(pos, node)
end

497
mods/default/furnace.lua Normal file
View File

@ -0,0 +1,497 @@
--
-- Formspecs
--
local function active_formspec(fuel_percent, item_percent)
local formspec =
"size[8,8.5]"..
"list[current_name;src;2.5,3;1,1;]"..
"list[current_name;fuel;3.5,1.5;1,1;]"..
"image[3.5,0.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-fuel_percent)..":default_furnace_fire_fg.png]"..
"image[3.5,3;1,1;gui_furnace_arrow_bg.png^[lowpart:"..
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]"..
"list[current_name;dst;4.5,3;1,1;]"..
"list[current_player;main;0,4.75;8,4;]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
"listring[current_name;fuel]"..
"listring[current_player;main]"
return formspec
end
local inactive_formspec =
"size[8,8.5]"..
"list[current_name;src;2.5,3;1,1;]"..
"list[current_name;fuel;3.5,1.5;1,1;]"..
"image[3.5,0.5;1,1;default_furnace_fire_bg.png]"..
"image[3.5,3;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"list[current_name;dst;4.5,3;1,1;]"..
"list[current_player;main;0,4.75;8,4;]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
"listring[current_name;fuel]"..
"listring[current_player;main]"
--
-- Node callback functions that are the same for active and inactive furnace
--
local function can_dig(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("fuel") and inv:is_empty("dst") and inv:is_empty("src")
end
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if listname == "fuel" then
if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then
if inv:is_empty("src") then
meta:set_string("infotext", "Furnace is empty")
end
return stack:get_count()
else
return 0
end
elseif listname == "src" then
return stack:get_count()
elseif listname == "dst" then
return 0
end
end
local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local stack = inv:get_stack(from_list, from_index)
return allow_metadata_inventory_put(pos, to_list, to_index, stack, player)
end
local function allow_metadata_inventory_take(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
return stack:get_count()
end
local function swap_node(pos, name)
local node = minetest.get_node(pos)
if node.name == name then
return
end
node.name = name
minetest.swap_node(pos, node)
end
local function furnace_node_timer(pos, elapsed)
-- Inizialize metadata
local meta = minetest.get_meta(pos)
local fuel_time = meta:get_float("fuel_time") or 0
local src_time = meta:get_float("src_time") or 0
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
local inv = meta:get_inventory()
local srclist, fuellist
local cookable, cooked
local fuel
local update = true
while elapsed > 0 and update do
update = false
srclist = inv:get_list("src")
fuellist = inv:get_list("fuel")
-- Cooking
-- Check if we have cookable content
local aftercooked
cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
cookable = cooked.time ~= 0
local el = math.min(elapsed, fuel_totaltime - fuel_time)
if cookable then -- fuel lasts long enough, adjust el to cooking duration
el = math.min(el, cooked.time - src_time)
end
-- Check if we have enough fuel to burn
if fuel_time < fuel_totaltime then
-- The furnace is currently active and has enough fuel
fuel_time = fuel_time + el
-- If there is a cookable item then check if it is ready yet
if cookable then
src_time = src_time + el
if src_time >= cooked.time then
-- Place result in dst list if possible
if inv:room_for_item("dst", cooked.item) then
inv:add_item("dst", cooked.item)
inv:set_stack("src", 1, aftercooked.items[1])
src_time = src_time - cooked.time
update = true
end
else
-- Item could not be cooked: probably missing fuel
update = true
end
end
else
-- Furnace ran out of fuel
if cookable then
-- We need to get new fuel
local afterfuel
fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
if fuel.time == 0 then
-- No valid fuel in fuel list
fuel_totaltime = 0
src_time = 0
else
-- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1])
update = true
fuel_totaltime = fuel.time + (fuel_totaltime - fuel_time)
end
else
-- We don't need to get new fuel since there is no cookable item
fuel_totaltime = 0
src_time = 0
end
fuel_time = 0
end
elapsed = elapsed - el
end
if fuel and fuel_totaltime > fuel.time then
fuel_totaltime = fuel.time
end
if srclist[1]:is_empty() then
src_time = 0
end
--
-- Update formspec, infotext and node
--
local formspec = inactive_formspec
local item_state
local item_percent = 0
if cookable then
item_percent = math.floor(src_time / cooked.time * 100)
if item_percent > 100 then
item_state = "100% (output full)"
else
item_state = item_percent .. "%"
end
else
if srclist[1]:is_empty() then
item_state = "Empty"
else
item_state = "Not cookable"
end
end
local fuel_state = "Empty"
local active = "inactive "
local result = false
if fuel_totaltime ~= 0 then
active = "active "
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
fuel_state = fuel_percent .. "%"
formspec = active_formspec(fuel_percent, item_percent)
swap_node(pos, "default:furnace_active")
-- make sure timer restarts automatically
result = true
else
if not fuellist[1]:is_empty() then
fuel_state = "0%"
end
swap_node(pos, "default:furnace")
-- stop timer on the inactive furnace
minetest.get_node_timer(pos):stop()
end
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
-- Set meta values
meta:set_float("fuel_totaltime", fuel_totaltime)
meta:set_float("fuel_time", fuel_time)
meta:set_float("src_time", src_time)
meta:set_string("formspec", formspec)
meta:set_string("infotext", infotext)
return result
end
--
-- Node definitions
--
-- Stone furnace
minetest.register_node("default:furnace", {
description = "Furnace",
tiles = {
"default_furnace_top.png", "default_furnace_bottom.png",
"default_furnace_side.png", "default_furnace_side.png",
"default_furnace_side.png", "default_furnace_front.png"
},
paramtype2 = "facedir",
groups = {cracky=3},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
can_dig = can_dig,
on_timer = furnace_node_timer,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", inactive_formspec)
local inv = meta:get_inventory()
inv:set_size('src', 1)
inv:set_size('fuel', 1)
inv:set_size('dst', 1)
end,
on_metadata_inventory_move = function(pos)
minetest.get_node_timer(pos):start(1.0)
end,
on_metadata_inventory_put = function(pos)
-- start timer function, it will sort out whether furnace can burn or not.
minetest.get_node_timer(pos):start(1.0)
end,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
})
minetest.register_node("default:furnace_active", {
description = "Furnace",
tiles = {
"default_furnace_top.png", "default_furnace_bottom.png",
"default_furnace_side.png", "default_furnace_side.png",
"default_furnace_side.png",
{
image = "default_furnace_front_active.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}
},
paramtype2 = "facedir",
light_source = 8,
drop = "default:furnace",
groups = {cracky=3, not_in_creative_inventory=1},
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_timer = furnace_node_timer,
can_dig = can_dig,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
})
-- Clay furnace
-- TODO: One function for all
local function clay_furnace_node_timer(pos, elapsed)
-- Inizialize metadata
local meta = minetest.get_meta(pos)
local fuel_time = meta:get_float("fuel_time") or 0
local src_time = meta:get_float("src_time") or 0
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
local inv = meta:get_inventory()
local srclist, fuellist
local cookable, cooked
local fuel
local update = true
while elapsed > 0 and update do
update = false
srclist = inv:get_list("src")
fuellist = inv:get_list("fuel")
-- Cooking
-- Check if we have cookable content
local aftercooked
cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
cookable = cooked.time ~= 0
local el = math.min(elapsed, fuel_totaltime - fuel_time)
if cookable then -- fuel lasts long enough, adjust el to cooking duration
el = math.min(el, cooked.time - src_time)
end
-- Check if we have enough fuel to burn
if fuel_time < fuel_totaltime then
-- The furnace is currently active and has enough fuel
fuel_time = fuel_time + el
-- If there is a cookable item then check if it is ready yet
if cookable then
src_time = src_time + el
if src_time >= cooked.time then
-- Place result in dst list if possible
if inv:room_for_item("dst", cooked.item) then
inv:add_item("dst", cooked.item)
inv:set_stack("src", 1, aftercooked.items[1])
src_time = src_time - cooked.time
update = true
end
else
-- Item could not be cooked: probably missing fuel
update = true
end
end
else
-- Furnace ran out of fuel
if cookable then
-- We need to get new fuel
local afterfuel
fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
if fuel.time == 0 then
-- No valid fuel in fuel list
fuel_totaltime = 0
src_time = 0
else
-- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1])
update = true
fuel_totaltime = fuel.time + (fuel_totaltime - fuel_time)
end
else
-- We don't need to get new fuel since there is no cookable item
fuel_totaltime = 0
src_time = 0
end
fuel_time = 0
end
elapsed = elapsed - el
end
if fuel and fuel_totaltime > fuel.time then
fuel_totaltime = fuel.time
end
if srclist[1]:is_empty() then
src_time = 0
end
--
-- Update formspec, infotext and node
--
local formspec = inactive_formspec
local item_state
local item_percent = 0
if cookable then
item_percent = math.floor(src_time / cooked.time * 100)
if item_percent > 100 then
item_state = "100% (output full)"
else
item_state = item_percent .. "%"
end
else
if srclist[1]:is_empty() then
item_state = "Empty"
else
item_state = "Not cookable"
end
end
local fuel_state = "Empty"
local active = "inactive "
local result = false
if fuel_totaltime ~= 0 then
active = "active "
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
fuel_state = fuel_percent .. "%"
formspec = active_formspec(fuel_percent, item_percent)
swap_node(pos, "default:clay_furnace_active")
-- make sure timer restarts automatically
result = true
else
if not fuellist[1]:is_empty() then
fuel_state = "0%"
end
swap_node(pos, "default:clay_furnace")
-- stop timer on the inactive furnace
minetest.get_node_timer(pos):stop()
end
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
-- Set meta values
meta:set_float("fuel_totaltime", fuel_totaltime)
meta:set_float("fuel_time", fuel_time)
meta:set_float("src_time", src_time)
meta:set_string("formspec", formspec)
meta:set_string("infotext", infotext)
return result
end
minetest.register_node("default:clay_furnace", {
description = "Clay Furnace",
tiles = {
"default_clay_furnace_side.png", "default_clay_furnace_side.png",
"default_clay_furnace_side.png", "default_clay_furnace_side.png",
"default_clay_furnace_side.png", "default_clay_furnace_front.png"
},
paramtype2 = "facedir",
drop = "",
groups = {cracky=3},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
can_dig = can_dig,
on_timer = clay_furnace_node_timer,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", inactive_formspec)
local inv = meta:get_inventory()
inv:set_size('src', 1)
inv:set_size('fuel', 1)
inv:set_size('dst', 1)
end,
on_metadata_inventory_move = function(pos)
minetest.get_node_timer(pos):start(1.0)
end,
on_metadata_inventory_put = function(pos)
-- start timer function, it will sort out whether furnace can burn or not.
minetest.get_node_timer(pos):start(1.0)
end,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
})
minetest.register_node("default:clay_furnace_active", {
description = "Clay Furnace",
tiles = {
"default_clay_furnace_side.png", "default_clay_furnace_side.png",
"default_clay_furnace_side.png", "default_clay_furnace_side.png",
"default_clay_furnace_side.png",
{
image = "default_clay_furnace_front_active.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}
},
paramtype2 = "facedir",
light_source = 5,
drop = "",
groups = {cracky=3, not_in_creative_inventory=1},
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_timer = clay_furnace_node_timer,
can_dig = can_dig,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
})

51
mods/default/gui.lua Normal file
View File

@ -0,0 +1,51 @@
-- Hud alignment
local health_bar_definition =
{
hud_elem_type = "statbar",
position = { x=0.5, y=1 },
text = "heart.png",
number = 20,
direction = 0,
size = {x=16, y=16},
offset = {x=(-9*24)-12, y=-(48+24+8)},
}
core.hud_replace_builtin("health", health_bar_definition)
-- GUI related stuff
default.gui_bg = "bgcolor[#080808BB;true]"
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
function default.get_hotbar_bg(x,y)
local out = ""
for i=0,7,1 do
out = out .."image["..x+i..","..y..";1,1;gui_hb_bg.png]"
end
return out
end
default.gui_survival_form = "size[8,7.5]"..
-- default.gui_bg..
-- default.gui_bg_img..
-- default.gui_slots..
"list[current_player;main; 0,3.5; 8,1;]"..
"list[current_player;main; 0,4.75; 8,3; 8]"..
"list[current_player;craft; 3,0; 3,3;]"..
"list[current_player;craftpreview; 7,1; 1,1;]"..
-- "image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"listring[current_player;main]"..
"listring[current_player;craft]"..
default.get_hotbar_bg(0,4.25)
minetest.register_on_joinplayer(function(player)
-- set GUI
if not minetest.settings:get_bool("creative_mode") then
player:set_inventory_formspec(default.gui_survival_form)
end
player:hud_set_hotbar_image("gui_hotbar.png")
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
end)

39
mods/default/init.lua Normal file
View File

@ -0,0 +1,39 @@
-- Minetest 0.4 mod: default
-- See README.txt for licensing and other information.
-- Definitions made by this mod that other mods can use too
default = {}
default.player_attached = {}
default.LIGHT_MAX = 14
default.COUSHION = -10 -- Falling damage gets reduced by 10 percent.
-- Define default max stack
local stack = minetest.settings:get("stack_max")
if not stack then
stack = 60
end
minetest.nodedef_default.stack_max = stack
minetest.craftitemdef_default.stack_max = stack
minetest.nodedef_default.liquid_range = 2
minetest.register_on_joinplayer(function(player)
local physics = player:get_physics_override()
physics.jump = 1.25
player:set_physics_override(physics)
end)
-- Load files
dofile(minetest.get_modpath("default").."/gui.lua")
dofile(minetest.get_modpath("default").."/functions.lua")
dofile(minetest.get_modpath("default").."/nodes.lua")
dofile(minetest.get_modpath("default").."/furnace.lua")
dofile(minetest.get_modpath("default").."/tools.lua")
dofile(minetest.get_modpath("default").."/craftitems.lua")
dofile(minetest.get_modpath("default").."/crafting.lua")
if minetest.get_mapgen_setting("mg_name") ~= "v6" then
dofile(minetest.get_modpath("default").."/biomes.lua")
end
dofile(minetest.get_modpath("default").."/mapgen.lua")
dofile(minetest.get_modpath("default").."/leafdecay.lua")
dofile(minetest.get_modpath("default").."/trees.lua")
dofile(minetest.get_modpath("default").."/aliases.lua")

113
mods/default/leafdecay.lua Normal file
View File

@ -0,0 +1,113 @@
-- minetest/default/leafdecay.lua
default.leafdecay_trunk_cache = {}
default.leafdecay_enable_cache = true
-- Spread the load of finding trunks
default.leafdecay_trunk_find_allow_accumulator = 0
minetest.register_globalstep(function(dtime)
local finds_per_second = 5000
default.leafdecay_trunk_find_allow_accumulator =
math.floor(dtime * finds_per_second)
end)
local function leafupdate(p0)
for xi = -1, 1 do
for yi = -1, 1 do
for zi = -1, 1 do
if xi == 0 and yi == 0 and zi == 0 then return end
local p1 = {x=p0.x + xi, y=p0.y + yi, z=p0.z + zi}
local node = minetest.get_node(p1)
local n_def = minetest.registered_nodes[node.name]
if not n_def then return end
local range = minetest.registered_nodes[node.name].groups.leafdecay
if range then
minetest.after(math.random(1,8), default.leafdecay, p1)
end
end
end
end
end
default.leafdecay = function(p0)
--print("leafdecay ABM at "..p0.x..", "..p0.y..", "..p0.z..")")
local node = minetest.get_node(p0)
local do_preserve = false
local def = minetest.registered_nodes[node.name]
local range = def.groups.leafdecay
if not range or range == 0 then return end
local trunk = def.trunk or "group:tree"
local n0 = minetest.get_node(p0)
if n0.param2 ~= 0 then
--print("param2 ~= 0")
return
end
local p0_hash = nil
if default.leafdecay_enable_cache then
p0_hash = minetest.hash_node_position(p0)
local trunkp = default.leafdecay_trunk_cache[p0_hash]
if trunkp then
local n = minetest.get_node(trunkp)
local reg = minetest.registered_nodes[n.name]
-- Assume ignore is a trunk, to make the thing work at the border of the active area
if n.name == "ignore" then return end
if n.name == trunk then return end
if trunk == "group:tree" and (reg and reg.groups.tree and reg.groups.tree ~= 0) then return end
--print("cached trunk is invalid")
-- Cache is invalid
table.remove(default.leafdecay_trunk_cache, p0_hash)
end
end
if default.leafdecay_trunk_find_allow_accumulator <= 0 then
return
end
default.leafdecay_trunk_find_allow_accumulator =
default.leafdecay_trunk_find_allow_accumulator - 1
-- Assume ignore is a trunk, to make the thing work at the border of the active area
local p1 = minetest.find_node_near(p0, range, {"ignore", trunk})
if p1 then
do_preserve = true
if default.leafdecay_enable_cache then
--print("caching trunk")
-- Cache the trunk
default.leafdecay_trunk_cache[p0_hash] = {p1, trunk}
end
end
if not do_preserve then
-- Drop stuff other than the node itself
local itemstacks = minetest.get_node_drops(n0.name)
for _, itemname in ipairs(itemstacks) do
if itemname ~= n0.name then
local p_drop = {
x = math.floor(p0.x + 0.5),
y = math.floor(p0.y + 0.5),
z = math.floor(p0.z + 0.5),
}
spawn_falling_node(p_drop, {name=itemname})
end
end
-- Remove node
minetest.remove_node(p0)
minetest.check_for_falling(p0)
leafupdate(p0)
end
end
minetest.register_abm({
label = "leafdecay",
nodenames = {"group:leafdecay"},
neighbors = {"air", "group:liquid"},
-- A low interval and a high inverse chance spreads the load
interval = 5,
chance = 90,
action = function(p0, node, _, _)
default.leafdecay(p0)
end
})
minetest.register_on_dignode(function(pos, oldnode, digger)
if minetest.get_item_group(oldnode.name, "tree") then
leafupdate(pos)
end
end)

492
mods/default/mapgen.lua Normal file
View File

@ -0,0 +1,492 @@
-- mods/default/mapgen.lua
--
-- Aliases for map generator outputs
--
minetest.register_alias("mapgen_air", "air")
minetest.register_alias("mapgen_stone", "default:stone")
minetest.register_alias("mapgen_water_source", "default:water_source")
minetest.register_alias("mapgen_river_water_source", "default:river_water_source")
minetest.register_alias("mapgen_dirt", "default:dirt")
minetest.register_alias("mapgen_sand", "default:sand")
minetest.register_alias("mapgen_gravel", "default:gravel")
minetest.register_alias("mapgen_lava_source", "default:lava_source")
minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
minetest.register_alias("mapgen_dirt_with_snow", "default:dirt_with_snow")
minetest.register_alias("mapgen_snow", "default:snow")
minetest.register_alias("mapgen_snowblock", "default:snowblock")
minetest.register_alias("mapgen_ice", "default:ice")
-- Flora
minetest.register_alias("mapgen_tree", "default:tree")
minetest.register_alias("mapgen_leaves", "default:leaves")
minetest.register_alias("mapgen_apple", "default:apple")
minetest.register_alias("mapgen_jungletree", "default:jungletree")
minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves")
minetest.register_alias("mapgen_junglegrass", "default:junglegrass")
-- Dungeons
minetest.register_alias("mapgen_cobble", "default:cobble")
minetest.register_alias("mapgen_mossycobble", "default:mossycobble")
minetest.register_alias("mapgen_desert_sand", "default:desert_sand")
minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
minetest.register_alias("mapgen_stair_cobble", "stairsplus:stair_cobble")
minetest.register_alias("mapgen_sandstone", "default:sandstone")
minetest.register_alias("mapgen_sandstonebrick", "default:sandstone")
minetest.register_alias("mapgen_stair_sandstone", "stairsplus:stair_sandstone")
--
-- Ore generation
--
minetest.register_ore({
ore_type = "sheet",
ore = "default:granite",
wherein = {"default:stone", "default:desert_stone"},
column_height_min = 1,
column_height_max = 8,
column_midpoint_factor = 0.3,
noise_params = {
offset = -1.3,
scale = 3,
spread = {x=100, y=100, z=100},
seed = 79533,
octaves = 3,
persist = 0.5,
flags = "eased",
},
noise_threshold = 1.6,
y_min = -31000,
y_max = 64,
})
minetest.register_ore({
ore_type = "sheet",
ore = "default:sandstone",
wherein = {"default:stone", "default:desert_stone"},
column_height_min = 1,
column_height_max = 10,
column_midpoint_factor = 0.3,
noise_params = {
offset = -1.3,
scale = 3,
spread = {x=100, y=100, z=100},
seed = 18953,
octaves = 3,
persist = 0.5,
flags = "eased",
},
noise_threshold = 1.6,
y_min = -31000,
y_max = 64,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:gravel",
wherein = {"default:dirt", "default:stone"},
clust_scarcity = 16*16*16,
clust_num_ores = 48,
clust_size = 4,
y_max = 31000,
y_min = -31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:sand",
wherein = {"default:dirt", "default:stone"},
clust_scarcity = 22*22*22,
clust_num_ores = 48,
clust_size = 4,
y_max = 31000,
y_min = -31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:ice",
wherein = {"default:stone"},
clust_scarcity = 30*30*30,
clust_num_ores = 96,
clust_size = 5,
y_max = -512,
y_min = -31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 12*12*12,
clust_num_ores = 8,
clust_size = 3,
y_min = -31000,
y_max = 64,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 17*17*17,
clust_num_ores = 5,
clust_size = 3,
y_min = -127,
y_max = -64,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 14*14*14,
clust_num_ores = 5,
clust_size = 3,
y_min = -31000,
y_max = -128,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 25*25*25,
clust_num_ores = 20,
clust_size = 6,
y_min = -31000,
y_max = -64,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
wherein = "default:stone",
clust_scarcity = 25*25*25,
clust_num_ores = 3,
clust_size = 2,
y_min = -511,
y_max = -256,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
wherein = "default:stone",
clust_scarcity = 20*20*20,
clust_num_ores = 5,
clust_size = 3,
y_min = -31000,
y_max = -512,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_diamond",
wherein = "default:stone",
clust_scarcity = 20*20*20,
clust_num_ores = 5,
clust_size = 3,
y_min = -31000,
y_max = -512,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:mese",
wherein = "default:stone",
clust_scarcity = 42*42*42,
clust_num_ores = 3,
clust_size = 2,
y_min = -31000,
y_max = -1024,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 10*10*10,
clust_num_ores = 3,
clust_size = 3,
y_min = -127,
y_max = 16,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 12*12*12,
clust_num_ores = 5,
clust_size = 3,
y_min = -1023,
y_max = -128,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 14*14*14,
clust_num_ores = 3,
clust_size = 3,
y_min = -1023,
y_max = 0,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 14*14*14,
clust_num_ores = 5,
clust_size = 3,
y_min = -31000,
y_max = -1024,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 16*16*16,
clust_num_ores = 3,
clust_size = 3,
y_min = -31000,
y_max = -1024,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:coalblock",
wherein = "default:stone",
clust_scarcity = 16*16*16,
clust_num_ores = 32,
clust_size = 4,
y_min = -4096,
y_max = -2048,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:clay",
wherein = "default:sand",
clust_scarcity = 20*20*20,
clust_num_ores = 32,
clust_size = 6,
y_max = 0,
y_min = -10,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:clay",
wherein = "default:dirt",
clust_scarcity = 20*20*20,
clust_num_ores = 32,
clust_size = 6,
y_max = 16,
y_min = -10,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_crumbled",
wherein = "default:stone",
clust_scarcity = 11*11*11,
clust_num_ores = 20,
clust_size = 4,
y_min = -32,
y_max = 1024,
})
function default.make_papyrus(pos, size)
for y=0,size-1 do
local p = {x=pos.x, y=pos.y+y, z=pos.z}
local nn = minetest.get_node(p).name
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
minetest.set_node(p, {name="default:papyrus"})
else
return
end
end
end
function default.register_mgv6_decorations()
-- Cacti
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:desert_sand"},
sidelen = 16,
noise_params = {
offset = -0.012,
scale = 0.024,
spread = {x = 100, y = 100, z = 100},
seed = 230,
octaves = 3,
persist = 0.6
},
y_min = 1,
y_max = 300,
decoration = "default:cactus",
height = 3,
height_max = 5,
})
-- Long grasses
for length = 1, 5 do
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.06,
spread = {x = 100, y = 100, z = 100},
seed = 329,
octaves = 3,
persist = 0.8
},
y_min = 1,
y_max = 300,
decoration = "default:grass_"..length,
})
end
-- Ferns
for length = 1, 3 do
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.04,
spread = {x = 100, y = 100, z = 100},
seed = 800+length,
octaves = 3,
persist = 0.65
},
y_min = 6,
y_max = 31000,
decoration = "default:fern_" .. length,
})
end
-- Dry shrubs
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:desert_sand"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.035,
spread = {x = 100, y = 100, z = 100},
seed = 329,
octaves = 3,
persist = 0.6
},
y_min = 1,
y_max = 300,
decoration = "default:dry_shrub",
})
-- Corals
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:sand"},
sidelen = 16,
noise_params = {
offset = -0.5,
scale = 0.60,
spread = {x = 100, y = 100, z = 100},
seed = 7013,
octaves = 3,
persist = 0.1,
},
y_min = -64,
y_max = -2,
decoration = "default:coral_brown",
height = 1,
height_max = 2,
flags = "force_placement",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:sand"},
sidelen = 16,
noise_params = {
offset = -0.5,
scale = 0.64,
spread = {x = 100, y = 100, z = 100},
seed = 7013,
octaves = 3,
persist = 0.1,
},
y_min = -64,
y_max = -2,
decoration = "default:coral_orange",
height = 1,
height_max = 2,
flags = "force_placement",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:sand"},
sidelen = 16,
noise_params = {
offset = -0.5,
scale = 0.63,
spread = {x = 100, y = 100, z = 100},
seed = 7013,
octaves = 3,
persist = 0.1,
},
y_min = -64,
y_max = -2,
decoration = "default:coral_purple",
height = 1,
height_max = 2,
flags = "force_placement",
})
-- Seaweed
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt"},
-- Same params as grass.
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.06,
spread = {x = 100, y = 100, z = 100},
seed = 329,
octaves = 3,
persist = 0.8
},
y_min = -64,
y_max = -2,
-- We use a schematic to replace the dirt.
schematic = {
size = {x = 1, y = 1, z = 1},
data = { {name = "default:seaweed"} },
},
flags = "force_placement",
})
end
default.register_mgv6_decorations()

1189
mods/default/nodes.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,236 @@
local _ = {name = "air", prob = 0}
local L = {name = "conifer:leaves_1"}
local T = {name = "conifer:tree", force_place = true}
local t = {name = "conifer:tree", force_place = false}
local conifer_data = {
yslice_prob = {
{ypos = 6, prob = 127},
{ypos = 7, prob = 127},
{ypos = 9, prob = 127},
{ypos = 13, prob = 127},
{ypos = 17, prob = 127},
},
size = {
y = 23,
x = 9,
z = 9
},
data = {
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, L, L, L, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, L, L, L, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, t, _, _, _, _,
_, _, _, _, t, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, L, _, _, _, _,
_, L, L, L, L, L, L, L, _,
_, _, L, L, L, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, L, L, L, L, L, L, L, _,
_, _, L, L, L, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, L, L, L, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, t, t, t, _, _, _,
_, _, _, t, T, t, _, _, _,
_, _, _, _, T, _, _, _, _,
_, _, _, _, T, _, _, _, _,
_, _, _, _, T, _, _, _, _,
_, _, _, _, T, _, _, _, _,
_, _, _, _, T, _, _, _, _,
_, _, _, _, T, _, _, _, _,
_, _, _, L, T, L, _, _, _,
L, L, L, L, T, L, L, L, L,
_, L, L, L, T, L, L, L, _,
_, _, L, L, T, L, L, _, _,
_, _, _, L, T, L, _, _, _,
L, L, L, L, T, L, L, L, L,
_, L, L, L, T, L, L, L, _,
_, _, L, L, T, L, L, _, _,
_, _, _, L, T, L, _, _, _,
_, L, L, L, T, L, L, L, _,
_, _, L, L, T, L, L, _, _,
_, _, _, L, T, L, _, _, _,
_, _, L, L, T, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, t, _, _, _, _,
_, _, _, _, t, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, L, _, _, _, _,
_, L, L, L, L, L, L, L, _,
_, _, L, L, L, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, L, L, L, L, L, L, L, _,
_, _, L, L, L, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, L, L, L, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, L, L, L, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, L, L, L, L, L, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, L, L, L, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, L, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _,
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,69 @@
local _ = {name = "air", prob = 0}
local L = {name = "default:leaves"}
local T = {name = "default:tree", forceaplace = true}
local t = {name = "default:tree", forceaplace = false}
local A = {name = "default:apple", prob = 16}
return {
yslice_prob = {
{ypos = 2, prob = 127},
{ypos = 3, prob = 127},
{ypos = 9, prob = 127},
},
size = {
y = 9,
x = 5,
z = 5
},
data = {
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
A, A, A, _, _,
L, L, L, _, _,
L, L, L, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, A, A, A, _,
A, L, L, L, _,
L, L, L, L, _,
L, L, L, L, _,
_, L, L, L, _,
_, _, t, _, _,
_, _, T, _, _,
_, _, T, _, _,
_, _, T, _, _,
_, A, T, A, A,
_, L, T, L, L,
_, L, T, L, L,
_, L, L, L, _,
_, L, L, L, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, A, A, A, A,
_, L, L, L, L,
_, L, L, L, L,
_, L, L, L, _,
_, L, L, L, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, A, A,
_, _, _, L, L,
_, _, _, L, L,
_, _, _, _, _,
_, _, _, _, _,
}
}

Binary file not shown.

View File

@ -0,0 +1,139 @@
local _ = {name = "air", prob = 0}
local L = {name = "default:jungleleaves"}
local T = {name = "default:jungletree", force_place = true}
local t = {name = "default:jungletree", prob = 127, force_place = false}
return {
yslice_prob = {
{ypos = 6, prob = 127},
{ypos = 7, prob = 127},
{ypos = 8, prob = 127},
{ypos = 9, prob = 127},
{ypos = 16, prob = 127},
},
size = {
y = 16,
x = 7,
z = 7
},
data = {
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, L, L, L, _,
_, _, _, L, L, L, L,
_, _, _, L, L, L, L,
_, _, _, L, L, L, L,
_, _, _, _, _, L, L,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, L, L, L, _,
_, _, _, L, L, L, L,
L, L, _, L, L, L, L,
L, L, L, L, L, L, L,
L, L, L, L, L, L, L,
_, _, L, L, L, L, _,
_, _, t, t, t, _, _,
_, _, t, t, t, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
L, L, L, L, L, L, _,
L, L, L, L, L, L, _,
L, L, L, L, L, L, _,
L, L, L, L, L, L, _,
L, L, L, L, L, L, _,
_, _, L, L, L, L, _,
_, _, t, t, t, _, _,
_, _, t, T, t, _, _,
_, _, _, T, _, _, _,
_, _, _, T, _, _, _,
_, _, _, T, _, _, _,
_, _, _, T, _, _, _,
_, _, _, T, _, _, _,
_, _, _, T, _, _, _,
_, _, _, T, _, _, _,
_, _, _, T, _, _, _,
L, L, L, T, L, L, _,
L, L, L, T, L, L, _,
L, L, L, T, L, L, L,
L, L, L, L, L, L, L,
L, L, L, L, L, L, _,
_, _, L, L, L, L, _,
_, _, t, t, t, _, _,
_, _, t, t, t, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, L, L, L, L, L,
L, L, L, L, L, L, L,
L, L, L, L, L, L, L,
_, _, L, L, L, L, L,
_, _, L, L, L, L, L,
_, _, L, L, L, L, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, L, L, L,
_, _, _, L, L, L, L,
_, _, _, L, L, _, _,
_, _, _, L, L, L, L,
_, _, _, L, L, L, L,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, _, _, _, _,
_, _, _, L, L, _, _,
_, _, _, L, L, _, _,
_, _, _, _, _, _, _,
}
}

Binary file not shown.

View File

@ -0,0 +1,68 @@
local _ = {name = "air", prob = 0}
local L = {name = "default:leaves"}
local T = {name = "default:tree", force_place = true}
local t = {name = "default:tree", force_place = false}
return {
yslice_prob = {
{ypos = 2, prob = 127},
{ypos = 3, prob = 127},
{ypos = 9, prob = 127},
},
size = {
y = 9,
x = 5,
z = 5
},
data = {
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
L, L, L, _, _,
L, L, L, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, L, L, L, _,
L, L, L, L, _,
L, L, L, L, _,
_, L, L, L, _,
_, _, t, _, _,
_, _, T, _, _,
_, _, T, _, _,
_, _, T, _, _,
_, _, T, _, _,
_, L, T, L, L,
_, L, T, L, L,
_, L, L, L, _,
_, L, L, L, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, L, L, L, L,
_, L, L, L, L,
_, L, L, L, _,
_, L, L, L, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
_, _, _, L, L,
_, _, _, L, L,
_, _, _, _, _,
_, _, _, _, _,
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Some files were not shown because too many files have changed in this diff Show More