Use high-res bucket if avail and use loops
|
@ -0,0 +1,41 @@
|
|||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [git] - 2019-07-02
|
||||
(poikilos)
|
||||
### Added
|
||||
- Add craftitems (8 Slime + Empty Bucket = 1 Liquid Slime Bucket).
|
||||
- Use high-res bucket image generation if available (from Bucket_Game).
|
||||
|
||||
### Changed
|
||||
- Rename "slimenodes_slime_solid_*.png" to
|
||||
"slimenodes_block_solid_*.png".
|
||||
- Put everything in loops to make code more maintainable (less
|
||||
redundant).
|
||||
- Make slime bucket cost more (7) glue to craft.
|
||||
|
||||
## [git] - 2018-02-16
|
||||
(poikilos)
|
||||
### Added
|
||||
- Add physics.
|
||||
- Solid is bouncy.
|
||||
- All bouncy slime nodes stop fall damage (-100%; not sure how with
|
||||
liquid slime--engine ignores damage reduction for liquid at high
|
||||
speeds).
|
||||
- Liquid is liquid-like.
|
||||
- Make buckets for all types so collectors are not needed (and so
|
||||
storage is nerfed to one per inventory slot).
|
||||
- Make recipes for all types (only if you have `mesecons_materials:glue`
|
||||
or `technic:glue` since the recipe requires glue).
|
||||
|
||||
### Changed
|
||||
- Make all liquid blocks behave like each other and all solid blocks
|
||||
behave like each other (though levels differ).
|
||||
- Change sounds so liquid and solid each use a different one of the dug
|
||||
sounds. This doesn't seem to work unless using slime collectors.
|
||||
- Slime collectors cannot be crafted since holding stacks of slime would
|
||||
allow overpowered griefing. They can still be given administratively,
|
||||
but in multiplayer they should only be used for cleanup so they aren't
|
||||
traded or otherwise abused later.
|
26
README.md
|
@ -2,24 +2,18 @@
|
|||
(minetest mod)\
|
||||
Make bouncy solid slime and non-flowing liquid slime in minetest!
|
||||
|
||||
## Changes in poikilos fork
|
||||
* added physics
|
||||
* solid is bouncy
|
||||
* all bouncy slime nodes stop fall damage (-100%; not sure how with liquid slime)
|
||||
* liquid is liquid-like
|
||||
* made buckets for all types so collectors are not needed and storage is nerfed by 1 per inventory slot
|
||||
* made recipes for all types (only if you have meseconds installed, since uses glue)
|
||||
* made all liquid blocks behave like each other and all solid blocks behave like each other (though levels differ)
|
||||
* changed sounds so liquid and solid each use a different one of the dug sounds, but this doesn't seem to work unless using slime collectors
|
||||
* slime collectors cannot be crafted since holding stacks of slime would allow overpowered griefing (they can still be given administratively, but in multiplayer they should only be used for cleanup so they aren't traded or otherwise abused later)
|
||||
|
||||
Changes in poikilos fork: see CHANGELOG.md
|
||||
|
||||
## Authors
|
||||
* [original version](https://forum.minetest.net/viewtopic.php?t=10423): Wuzzy
|
||||
* sound: Wuzzy
|
||||
* full bucket graphics: poikilos (Jake Gustafson), based on empty bucket by ElementW (CC BY-SA 3.0)
|
||||
* all other graphics: Wuzzy
|
||||
|
||||
- [original version](https://forum.minetest.org/viewtopic.php?t=10423)
|
||||
(`https://repo.or.cz/minetest_slimenodes.git`):
|
||||
Wuzzy
|
||||
- sound:
|
||||
Wuzzy
|
||||
- bucket graphics:
|
||||
poikilos (Jake Gustafson), ElementW (CC BY-SA 3.0)
|
||||
- all other graphics:
|
||||
Wuzzy
|
||||
|
||||
## License
|
||||
code: see included [license.txt](https://github.com/poikilos/slimenodes/blob/master/license.txt)
|
||||
|
|
126
buckets.lua
|
@ -17,74 +17,64 @@
|
|||
-- source neighbour, even if defined as 'liquid_renewable = false'.
|
||||
-- Needed to avoid creating holes in sloping rivers.
|
||||
-- This function can be called from any mod (that depends on bucket).
|
||||
-- - OldCoder (Bucket_Game)
|
||||
|
||||
if rawget(_G, "bucket") and bucket.register_liquid then
|
||||
|
||||
-- craftitems.lua defines slimenodesColorNames
|
||||
if rawget(_G, "bucket") and bucket.register_bucket_hash then
|
||||
for index = 1, #slimenodesColorNames do
|
||||
local descPart = slimenodesColorNames[index]
|
||||
local namePart = descPart:lower()
|
||||
local liquid_bh = {}
|
||||
liquid_bh.bucket_node = "slimenodes:bucket_slime_liquid_" .. namePart
|
||||
liquid_bh.desc = "Liquid " .. descPart .. " Slime Bucket"
|
||||
liquid_bh.source_node = "slimenodes:slime_liquid_" .. namePart
|
||||
liquid_bh.flowing_node = "slimenodes:slime_liquid_" .. namePart -- .. "_slope"
|
||||
liquid_bh.force_renew = false
|
||||
-- groups = -- TODO?
|
||||
-- liquid_bh.inventory_image = "slimenodes_block_liquid_" .. namePart .. ".png"
|
||||
liquid_bh.invsource_image = "slimenodes_block_liquid_" .. namePart .. ".png"
|
||||
bucket.register_bucket_hash(liquid_bh)
|
||||
-- rawget(_G, "ocutil") and bucket.register_node_bucketable then
|
||||
--ocutil.register_node_bucketable ("slimenodes:bucket_slime_solid_" .. namePart, {
|
||||
--description = "Solid " .. descPart .. " Slime Bucket" ,
|
||||
--bucket_base = "slimenodes:slime_solid_" .. namePart ,
|
||||
--tiles = {"slimenodes_block_solid_" .. namePart .. ".png"} ,
|
||||
--groups = {fall_damage_add_percent=-100, disable_jump=1, puts_out_fire=1, cools_lava=1, liquid=3, slimey=3} , -- and levels? see init.lua
|
||||
--sounds = {
|
||||
--dug = {name="slimenodes_dig", gain=0.6},
|
||||
--place = {name="slimenodes_place", gain=0.6},
|
||||
--},
|
||||
--})
|
||||
local solid_bh = {}
|
||||
solid_bh.bucket_node = "slimenodes:bucket_slime_solid_" .. namePart
|
||||
solid_bh.desc = "Solid " .. descPart .. " Slime Bucket"
|
||||
solid_bh.source_node = "slimenodes:slime_solid_" .. namePart
|
||||
solid_bh.flowing_node = "slimenodes:slime_solid_" .. namePart -- .. "_slope"
|
||||
solid_bh.force_renew = false
|
||||
-- groups = -- TODO?
|
||||
-- solid_bh.inventory_image = "slimenodes_block_solid_" .. namePart .. ".png"
|
||||
solid_bh.invsource_image = "slimenodes_block_solid_" .. namePart .. ".png"
|
||||
bucket.register_bucket_hash(solid_bh)
|
||||
end
|
||||
elseif rawget(_G, "bucket") and bucket.register_liquid then
|
||||
-- source, flowing, itemname, inventory image, name, groups, force_renew
|
||||
bucket.register_liquid(
|
||||
"slimenodes:slime_liquid_cyan",
|
||||
"slimenodes:slime_liquid_cyan",
|
||||
"slimenodes:bucket_slime_liquid_cyan",
|
||||
"slimenodes_bucket_slime_liquid_cyan.png",
|
||||
"Liquid Cyan Slime Bucket"
|
||||
)
|
||||
bucket.register_liquid(
|
||||
"slimenodes:slime_solid_cyan",
|
||||
"slimenodes:slime_solid_cyan",
|
||||
"slimenodes:bucket_slime_solid_cyan",
|
||||
"slimenodes_bucket_slime_solid_cyan.png",
|
||||
"Solid Cyan Slime Bucket"
|
||||
)
|
||||
|
||||
bucket.register_liquid(
|
||||
"slimenodes:slime_liquid_green",
|
||||
"slimenodes:slime_liquid_green",
|
||||
"slimenodes:bucket_slime_liquid_green",
|
||||
"slimenodes_bucket_slime_liquid_green.png",
|
||||
"Liquid Green Slime Bucket"
|
||||
)
|
||||
bucket.register_liquid(
|
||||
"slimenodes:slime_solid_green",
|
||||
"slimenodes:slime_solid_green",
|
||||
"slimenodes:bucket_slime_solid_green",
|
||||
"slimenodes_bucket_slime_solid_green.png",
|
||||
"Solid Green Slime Bucket"
|
||||
)
|
||||
|
||||
bucket.register_liquid(
|
||||
"slimenodes:slime_liquid_orange",
|
||||
"slimenodes:slime_liquid_orange",
|
||||
"slimenodes:bucket_slime_liquid_orange",
|
||||
"slimenodes_bucket_slime_liquid_orange.png",
|
||||
"Liquid Orange Slime Bucket"
|
||||
)
|
||||
bucket.register_liquid(
|
||||
"slimenodes:slime_solid_orange",
|
||||
"slimenodes:slime_solid_orange",
|
||||
"slimenodes:bucket_slime_solid_orange",
|
||||
"slimenodes_bucket_slime_solid_orange.png",
|
||||
"Solid Orange Slime Bucket"
|
||||
)
|
||||
|
||||
bucket.register_liquid(
|
||||
"slimenodes:slime_liquid_violet",
|
||||
"slimenodes:slime_liquid_violet",
|
||||
"slimenodes:bucket_slime_liquid_violet",
|
||||
"slimenodes_bucket_slime_liquid_violet.png",
|
||||
"Liquid Violet Slime Bucket"
|
||||
)
|
||||
bucket.register_liquid(
|
||||
"slimenodes:slime_solid_violet",
|
||||
"slimenodes:slime_solid_violet",
|
||||
"slimenodes:bucket_slime_solid_violet",
|
||||
"slimenodes_bucket_slime_solid_violet.png",
|
||||
"Solid Violet Slime Bucket"
|
||||
)
|
||||
|
||||
-- minetest.register_craft({
|
||||
-- type = "fuel",
|
||||
-- recipe = "bucket:bucket_lava",
|
||||
-- burntime = 60,
|
||||
-- replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}},
|
||||
-- })
|
||||
|
||||
for index = 1, #slimenodesColorNames do
|
||||
local descPart = slimenodesColorNames[index]
|
||||
local namePart = descPart:lower()
|
||||
bucket.register_liquid(
|
||||
"slimenodes:slime_liquid_" .. namePart,
|
||||
"slimenodes:slime_liquid_" .. namePart,
|
||||
"slimenodes:bucket_slime_liquid_" .. namePart,
|
||||
"slimenodes_bucket_slime_liquid_" .. namePart .. ".png",
|
||||
"Liquid "..descPart.." Slime Bucket"
|
||||
)
|
||||
bucket.register_liquid(
|
||||
"slimenodes:slime_solid_" .. namePart,
|
||||
"slimenodes:slime_solid_" .. namePart,
|
||||
"slimenodes:bucket_slime_solid_" .. namePart,
|
||||
"slimenodes_bucket_slime_solid_" .. namePart .. ".png",
|
||||
"Solid "..descPart.." Slime Bucket"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
for index = 1, #slimenodesColorNames do
|
||||
descPart = slimenodesColorNames[index]
|
||||
namePart = descPart:lower()
|
||||
minetest.register_craftitem("slimenodes:slime_" .. namePart, {
|
||||
description = descPart .. " Slime",
|
||||
inventory_image = "slimenodes_drop_" .. namePart .. ".png",
|
||||
stack_max = 8,
|
||||
})
|
||||
end
|
366
init.lua
|
@ -6,179 +6,217 @@ else
|
|||
S = function(s) return s end
|
||||
end
|
||||
|
||||
minetest.register_node("slimenodes:slime_liquid_cyan", {
|
||||
description = S("Cyan liquid slime"),
|
||||
inventory_image = minetest.inventorycube("slimenodes_slime_liquid_cyan.png"),
|
||||
drawtype = "liquid",
|
||||
tiles = { "slimenodes_slime_liquid_cyan.png" },
|
||||
special_tiles = {
|
||||
{
|
||||
name = "slimenodes_slime_liquid_cyan.png",
|
||||
backface_culling = false
|
||||
},
|
||||
},
|
||||
alpha = 120,
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = true,
|
||||
buildable_to = false,
|
||||
drop = "slimenodes:slime_liquid_cyan",
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "slimenodes:slime_liquid_cyan",
|
||||
liquid_alternative_source = "slimenodes:slime_liquid_cyan",
|
||||
liquid_viscosity = 1,
|
||||
liquid_range = 0,
|
||||
liquid_renewable = false,
|
||||
liquids_pointable = true,
|
||||
drowning = 0,
|
||||
post_effect_color = {a=16, r=0, g=255, b=255},
|
||||
groups = {fall_damage_add_percent=-100, disable_jump=1, puts_out_fire=1, cools_lava=1, liquid=3, slimey=3},
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dig", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
}
|
||||
})
|
||||
slimenodesColorNames = { "Cyan", "Green", "Orange", "Violet" }
|
||||
slimenodesParams = {}
|
||||
slimenodesParams["cyan"] = {}
|
||||
slimenodesParams["cyan"].alpha = 120
|
||||
slimenodesParams["cyan"].liquid_viscosity = 1
|
||||
slimenodesParams["cyan"].post_effect_color = {a=16, r=0, g=255, b=255}
|
||||
slimenodesParams["green"] = {}
|
||||
slimenodesParams["green"].alpha = 170
|
||||
slimenodesParams["green"].liquid_viscosity = 2
|
||||
slimenodesParams["green"].post_effect_color = {a=64, r=100, g=200, b=100}
|
||||
slimenodesParams["orange"] = {}
|
||||
slimenodesParams["orange"].alpha = 200
|
||||
slimenodesParams["orange"].liquid_viscosity = 4
|
||||
slimenodesParams["orange"].post_effect_color = {a=96, r=200, g=100, b=0}
|
||||
slimenodesParams["violet"] = {}
|
||||
slimenodesParams["violet"].alpha = 220
|
||||
slimenodesParams["violet"].liquid_viscosity = 6
|
||||
slimenodesParams["violet"].post_effect_color = {a=128, r=50, g=0, b=200}
|
||||
|
||||
minetest.register_node("slimenodes:slime_liquid_green", {
|
||||
description = S("Green liquid slime"),
|
||||
inventory_image = minetest.inventorycube("slimenodes_slime_liquid_green.png"),
|
||||
drawtype = "liquid",
|
||||
tiles = { "slimenodes_slime_liquid_green.png" },
|
||||
special_tiles = { { name = "slimenodes_slime_liquid_green.png", backface_culling = false } },
|
||||
alpha = 170,
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = true,
|
||||
buildable_to = false,
|
||||
drop = "slimenodes:slime_liquid_green",
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "slimenodes:slime_liquid_green",
|
||||
liquid_alternative_source = "slimenodes:slime_liquid_green",
|
||||
liquid_viscosity = 2,
|
||||
liquid_range = 0,
|
||||
liquid_renewable = false,
|
||||
liquids_pointable = true,
|
||||
drowning = 0,
|
||||
post_effect_color = {a=64, r=100, g=200, b=100},
|
||||
groups = {fall_damage_add_percent=-100, disable_jump=1, puts_out_fire=1, cools_lava=1, liquid=3, slimey=3, level=1},
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dig", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
}
|
||||
})
|
||||
if not deepcopy then
|
||||
-- See http://lua-users.org/wiki/CopyTable
|
||||
function deepcopy(orig)
|
||||
local orig_type = type(orig)
|
||||
local copy
|
||||
if orig_type == 'table' then
|
||||
copy = {}
|
||||
for orig_key, orig_value in next, orig, nil do
|
||||
copy[deepcopy(orig_key)] = deepcopy(orig_value)
|
||||
end
|
||||
setmetatable(copy, deepcopy(getmetatable(orig)))
|
||||
else -- number, string, boolean, etc
|
||||
copy = orig
|
||||
end
|
||||
return copy
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("slimenodes:slime_liquid_orange", {
|
||||
description = S("Orange liquid slime"),
|
||||
inventory_image = minetest.inventorycube("slimenodes_slime_liquid_orange.png"),
|
||||
drawtype = "liquid",
|
||||
tiles = { "slimenodes_slime_liquid_orange.png" },
|
||||
special_tiles = { { name = "slimenodes_slime_liquid_orange.png", backface_culling = false } },
|
||||
alpha = 200,
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = true,
|
||||
buildable_to = false,
|
||||
drop = "slimenodes:slime_liquid_orange",
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "slimenodes:slime_liquid_orange",
|
||||
liquid_alternative_source = "slimenodes:slime_liquid_orange",
|
||||
liquid_viscosity = 4,
|
||||
liquid_range = 0,
|
||||
liquid_renewable = false,
|
||||
liquids_pointable = true,
|
||||
drowning = 0,
|
||||
post_effect_color = {a=96, r=200, g=100, b=0},
|
||||
groups = {fall_damage_add_percent=-100, disable_jump=1, puts_out_fire=1, cools_lava=1, liquid=3, slimey=3, level=2},
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dig", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
}
|
||||
})
|
||||
if not level1copy then
|
||||
-- See http://lua-users.org/wiki/CopyTable
|
||||
function level1copy(orig)
|
||||
local orig_type = type(orig)
|
||||
local copy
|
||||
if orig_type == 'table' then
|
||||
copy = {}
|
||||
for orig_key, orig_value in next, orig, nil do
|
||||
copy[orig_key] = orig_value
|
||||
end
|
||||
else -- number, string, boolean, etc
|
||||
copy = orig
|
||||
end
|
||||
return copy
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("slimenodes:slime_liquid_violet", {
|
||||
description = S("Violet liquid slime"),
|
||||
inventory_image = minetest.inventorycube("slimenodes_slime_liquid_violet.png"),
|
||||
drawtype = "liquid",
|
||||
tiles = { "slimenodes_slime_liquid_violet.png" },
|
||||
special_tiles = { { name = "slimenodes_slime_liquid_violet.png", backface_culling = false } },
|
||||
alpha = 220,
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = true,
|
||||
buildable_to = false,
|
||||
drop = "slimenodes:slime_liquid_violet",
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "slimenodes:slime_liquid_violet",
|
||||
liquid_alternative_source = "slimenodes:slime_liquid_violet",
|
||||
liquid_viscosity = 6,
|
||||
liquid_range = 0,
|
||||
liquid_renewable = false,
|
||||
liquids_pointable = true,
|
||||
drowning = 0,
|
||||
post_effect_color = {a=128, r=50, g=0, b=200},
|
||||
groups = {fall_damage_add_percent=-100, disable_jump=1, puts_out_fire=1, cools_lava=1, liquid=3, slimey=3, level=3},
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dig", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
}
|
||||
})
|
||||
dofile(minetest.get_modpath("slimenodes").."/craftitems.lua")
|
||||
|
||||
minetest.register_node("slimenodes:slime_solid_cyan", {
|
||||
description = S("Cyan solid slime"),
|
||||
tiles = { "slimenodes_slime_solid_cyan.png" },
|
||||
walkable = true,
|
||||
groups = {bouncy=90, fall_damage_add_percent=-100, slimey=3, level=1},
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dug", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
footstep = {name="slimenodes_step", gain=0.2},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("slimenodes:slime_solid_green", {
|
||||
description = S("Green solid slime"),
|
||||
tiles = { "slimenodes_slime_solid_green.png" },
|
||||
walkable = true,
|
||||
groups = {bouncy=90, fall_damage_add_percent=-100, slimey=3, level=2},
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dug", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
footstep = {name="slimenodes_step", gain=0.3},
|
||||
-- craftitems.lua defines slimenodesColorNames
|
||||
local slimeNodeLevel = 0
|
||||
local slimenodesLiqDef = nil
|
||||
for index = 1, #slimenodesColorNames do
|
||||
descPart = slimenodesColorNames[index]
|
||||
namePart = descPart:lower()
|
||||
local snLName = "slimenodes:slime_liquid_" .. namePart
|
||||
local snSName = "slimenodes:slime_solid_" .. namePart
|
||||
slimenodesLiqDef = {
|
||||
drawtype = "liquid",
|
||||
alpha = 120,
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = true,
|
||||
buildable_to = false,
|
||||
liquidtype = "source",
|
||||
liquid_viscosity = 1,
|
||||
liquid_range = 0,
|
||||
liquid_renewable = false,
|
||||
liquids_pointable = true,
|
||||
drowning = 0,
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dig", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
}
|
||||
}
|
||||
})
|
||||
if nil then -- rawget(_G, "default") and default.register_water then
|
||||
print("slimenodes is using default.register_water...")
|
||||
-- Liquid:
|
||||
local def = {
|
||||
alpha = slimenodesLiqDef.alpha,
|
||||
basename = "slimenodes:slime_liquid_" .. namePart,
|
||||
light = -1 ,
|
||||
liquid_viscosity = slimenodesLiqDef.liquid_viscosity,
|
||||
liquid_range = slimenodesLiqDef.liquid_range,
|
||||
sounds = slimenodesLiqDef.sounds,
|
||||
drowning = slimenodesLiqDef.drowning,
|
||||
}
|
||||
if slimenodesParams[namePart]
|
||||
and slimenodesParams[namePart].post_effect_color then
|
||||
def.post_effect_color = slimenodesParams[namePart].post_effect_color
|
||||
else
|
||||
def.post_effect_color = nil
|
||||
end
|
||||
default.register_water(def)
|
||||
|
||||
minetest.register_node("slimenodes:slime_solid_orange", {
|
||||
description = S("Orange solid slime"),
|
||||
tiles = { "slimenodes_slime_solid_orange.png" },
|
||||
walkable = true,
|
||||
groups = {bouncy=90, fall_damage_add_percent=-100, slimey=3, level=2},
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dug", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
footstep = {name="slimenodes_step", gain=0.35},
|
||||
}
|
||||
})
|
||||
-- Solid:
|
||||
local def = {
|
||||
alpha = slimenodesLiqDef.alpha,
|
||||
basename = snSName,
|
||||
light = -1 ,
|
||||
liquid_range = 0,
|
||||
sounds = slimenodesLiqDef.sounds,
|
||||
}
|
||||
if slimenodesParams[namePart].post_effect_color then
|
||||
def.post_effect_color = slimenodesParams[namePart].post_effect_color
|
||||
end
|
||||
default.register_water(def)
|
||||
else
|
||||
print("slimenodes is using register_node...")
|
||||
-- Liquid:
|
||||
-- -- why does this commented version of the code cause a block that
|
||||
-- -- tries to flow but has CONTENT_IGNORE error?
|
||||
--local def = slimenodesLiqDef
|
||||
--def.description = S("Liquid " .. descPart .. " Slime Block")
|
||||
--def.inventory_image = minetest.inventorycube(
|
||||
--"slimenodes_block_liquid_" .. namePart .. ".png"
|
||||
--)
|
||||
--def.tiles = { "slimenodes_block_liquid_" .. namePart .. ".png" }
|
||||
--def.special_tiles = {
|
||||
--{
|
||||
--name = "slimenodes_block_liquid_" .. namePart .. ".png",
|
||||
--backface_culling = false
|
||||
--},
|
||||
--}
|
||||
--def.drop = snLName
|
||||
---- liquid_alternative_flowing = "slimenodes:slime_liquid_" .. namePart .. "_slope"
|
||||
--liquid_alternative_flowing = snLName
|
||||
--liquid_alternative_source = snLName
|
||||
--if slimenodesParams[namePart].post_effect_color then
|
||||
--def.post_effect_color = slimenodesParams[namePart].post_effect_color
|
||||
--end
|
||||
--if slimenodesParams[namePart].alpha then
|
||||
--def.alpha = slimenodesParams[namePart].alpha
|
||||
--end
|
||||
--if slimenodesParams[namePart].liquid_viscosity then
|
||||
--def.liquid_viscosity = slimenodesParams[namePart].liquid_viscosity
|
||||
--end
|
||||
--def.groups = {fall_damage_add_percent=-100, disable_jump=1, puts_out_fire=1, cools_lava=1, liquid=3, slimey=3}
|
||||
--if slimeNodeLevel > 0 then
|
||||
--def.groups.level = slimeNodeLevel
|
||||
--end
|
||||
--minetest.register_node(snLName, def)
|
||||
minetest.register_node(snLName, {
|
||||
description = S("Liquid " .. descPart .. " Slime Block"),
|
||||
inventory_image = minetest.inventorycube("slimenodes_block_liquid_" .. namePart .. ".png"),
|
||||
drawtype = "liquid",
|
||||
tiles = { "slimenodes_block_liquid_" .. namePart .. ".png" },
|
||||
special_tiles = {
|
||||
{
|
||||
name = "slimenodes_block_liquid_" .. namePart .. ".png",
|
||||
backface_culling = false
|
||||
},
|
||||
},
|
||||
alpha = slimenodesParams[namePart].alpha or 120,
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = true,
|
||||
buildable_to = false,
|
||||
drop = snLName,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = snLName,
|
||||
liquid_alternative_source = snLName,
|
||||
liquid_viscosity = slimenodesParams[namePart].liquid_viscosity or 1,
|
||||
liquid_range = 0,
|
||||
liquid_renewable = false,
|
||||
liquids_pointable = true,
|
||||
drowning = 0,
|
||||
post_effect_color = deepcopy(slimenodesParams[namePart].post_effect_color) or {a=16, r=128, g=128, b=128},
|
||||
groups = {fall_damage_add_percent=-100, disable_jump=1, puts_out_fire=1, cools_lava=1, liquid=3, slimey=3},
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dig", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("slimenodes:slime_solid_violet", {
|
||||
description = S("Violet solid slime"),
|
||||
tiles = { "slimenodes_slime_solid_violet.png" },
|
||||
walkable = true,
|
||||
groups = {bouncy=90, fall_damage_add_percent=-30, slimey=3, level=3},
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dug", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
footstep = {name="slimenodes_step", gain=0.4},
|
||||
}
|
||||
})
|
||||
|
||||
-- Solid:
|
||||
local solidGroups = {bouncy=90, fall_damage_add_percent=-100, slimey=3,}
|
||||
if slimeNodeLevel > 0 then
|
||||
solidGroups.level = slimeNodeLevel
|
||||
end
|
||||
|
||||
minetest.register_node(snSName, {
|
||||
description = S("Solid " .. descPart .. " Slime Block"),
|
||||
tiles = { "slimenodes_block_solid_" .. namePart .. ".png" },
|
||||
walkable = true,
|
||||
groups = solidGroups,
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dug", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
footstep = {name="slimenodes_step", gain=0.2},
|
||||
}
|
||||
})
|
||||
|
||||
end
|
||||
if slimeNodeLevel <= 3 then
|
||||
slimeNodeLevel = slimeNodeLevel + 1
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_tool("slimenodes:collector_lvl1", {
|
||||
description = S("Slime collector level 1"),
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
Cyan liquid slime = Türkiser Flüssigschleim
|
||||
Cyan solid slime = Türkiser Festschleim
|
||||
Green liquid slime = Grüner Flüssigschleim
|
||||
Green solid slime = Grüner Festschleim
|
||||
Orange liquid slime = Orange Flüssigschleim
|
||||
Orange solid slime = Orange Festschleim
|
||||
Slime collector level 1 = Schleimsammler Stufe 1
|
||||
Slime collector level 2 = Schleimsammler Stufe 2
|
||||
Slime collector level 3 = Schleimsammler Stufe 3
|
||||
Slime collector level 4 = Schleimsammler Stufe 4
|
||||
Violet liquid slime = Violetter Flüssigschleim
|
||||
Violet solid slime = Violetter Festschleim
|
||||
Liquid Cyan Slime Block = Cyan-blauer flüssiger Schleimblock
|
||||
Solid Cyan Slime Block = Cyan-blauer fester Schleimblock
|
||||
Cyan Slime = Cyan Schleim
|
||||
Liquid Green Slime Block = Grüner flüssiger Schleimblock
|
||||
Solid Green Slime Block = Grüner fester Schleimblock
|
||||
Green Slime = Grüner Schleim
|
||||
Liquid Orange Slime Block = Orange flüssiger Schleimblock
|
||||
Solid Orange Slime Block = Orangefarbener fester Schleimblock
|
||||
Orange Slime = Orange Schleim
|
||||
Liquid Violet Slime Block = Violetter flüssiger Schleimblock
|
||||
Solid Violet Slime Block = Violetter fester Schleimblock
|
||||
Violet Slime = Violetter Schleim
|
||||
Slime Collector Level 1 = Schleimsammler Stufe 1
|
||||
Slime Collector Level 2 = Schleimsammler Stufe 2
|
||||
Slime Collector Level 3 = Schleimsammler Stufe 3
|
||||
Slime Collector Level 4 = Schleimsammler Stufe 4
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
Cyan liquid slime =
|
||||
Cyan solid slime =
|
||||
Green liquid slime =
|
||||
Green solid slime =
|
||||
Orange liquid slime =
|
||||
Orange solid slime =
|
||||
Slime collector level 1 =
|
||||
Slime collector level 2 =
|
||||
Slime collector level 3 =
|
||||
Slime collector level 4 =
|
||||
Violet liquid slime =
|
||||
Violet solid slime =
|
||||
Liquid Cyan Slime Block =
|
||||
Solid Cyan Slime Block =
|
||||
Cyan Slime =
|
||||
Liquid Green Slime Block =
|
||||
Solid Green Slime Block =
|
||||
Green Slime =
|
||||
Liquid Orange Slime Block =
|
||||
Solid Orange Slime Block =
|
||||
Orange Slime =
|
||||
Liquid Violet Slime Block =
|
||||
Solid Violet Slime Block =
|
||||
Violet Slime =
|
||||
Slime Collector Level 1 =
|
||||
Slime Collector Level 2 =
|
||||
Slime Collector Level 3 =
|
||||
Slime Collector Level 4 =
|
||||
|
|
104
recipes.lua
|
@ -1,62 +1,64 @@
|
|||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 10,
|
||||
output = "slimenodes:bucket_slime_solid_cyan",
|
||||
recipe = "slimenodes:bucket_slime_liquid_cyan"
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 10,
|
||||
output = "slimenodes:bucket_slime_solid_green",
|
||||
recipe = "slimenodes:bucket_slime_liquid_green"
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 10,
|
||||
output = "slimenodes:bucket_slime_solid_orange",
|
||||
recipe = "slimenodes:bucket_slime_liquid_orange"
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 10,
|
||||
output = "slimenodes:bucket_slime_solid_violet",
|
||||
recipe = "slimenodes:bucket_slime_liquid_violet"
|
||||
})
|
||||
-- craftitems.lua defines slimenodesColorNames
|
||||
for index = 1, #slimenodesColorNames do
|
||||
local descPart = slimenodesColorNames[index]
|
||||
local namePart = descPart:lower()
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 10,
|
||||
output = "slimenodes:bucket_slime_solid_" .. namePart,
|
||||
recipe = "slimenodes:bucket_slime_liquid_" .. namePart
|
||||
})
|
||||
end
|
||||
|
||||
local mesecons_materials = minetest.get_modpath("mesecons_materials")
|
||||
local technic = minetest.get_modpath("technic")
|
||||
|
||||
local glue_fullname = nil
|
||||
local glue_s = nil
|
||||
|
||||
if mesecons_materials then
|
||||
glue_fullname = "mesecons_materials:glue"
|
||||
glue_s = "mesecons_materials:glue"
|
||||
elseif technic then
|
||||
glue_fullname = "technic:glue"
|
||||
glue_s = "technic:glue"
|
||||
end
|
||||
if glue_fullname then
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "slimenodes:bucket_slime_liquid_cyan",
|
||||
recipe = {"bucket:bucket_water", glue_fullname, "dye:cyan"},
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "slimenodes:bucket_slime_liquid_green",
|
||||
recipe = {"bucket:bucket_water", glue_fullname, "dye:green"},
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "slimenodes:bucket_slime_liquid_orange",
|
||||
recipe = {"bucket:bucket_water", glue_fullname, "dye:orange"},
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "slimenodes:bucket_slime_liquid_violet",
|
||||
recipe = {"bucket:bucket_water", glue_fullname, "dye:violet"},
|
||||
})
|
||||
if glue_s then
|
||||
-- craftitems.lua defines slimenodesColorNames
|
||||
for index = 1, #slimenodesColorNames do
|
||||
local descPart = slimenodesColorNames[index]
|
||||
local namePart = descPart:lower()
|
||||
local thisDye = "dye:" .. namePart
|
||||
if minetest.registered_items[thisDye] then
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "slimenodes:bucket_slime_liquid_" .. namePart,
|
||||
recipe = {
|
||||
glue_s, glue_s, glue_s,
|
||||
glue_s, thisDye, glue_s,
|
||||
glue_s, "bucket:bucket_water", glue_s,
|
||||
},
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
for index = 1, #slimenodesColorNames do
|
||||
local descPart = slimenodesColorNames[index]
|
||||
local namePart = descPart:lower()
|
||||
local frag = "slimenodes:slime_" .. namePart
|
||||
local bucketName = "slimenodes:bucket_slime_liquid_" .. namePart
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = bucketName,
|
||||
recipe = {
|
||||
frag, frag, frag,
|
||||
frag, frag, frag,
|
||||
frag, "bucket:bucket_empty", frag,
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = {frag..' 8', "bucket:bucket_empty"},
|
||||
recipe = {
|
||||
{bucketName},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
Before Width: | Height: | Size: 590 B After Width: | Height: | Size: 590 B |
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 648 B After Width: | Height: | Size: 648 B |
Before Width: | Height: | Size: 600 B After Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 522 B After Width: | Height: | Size: 522 B |
Before Width: | Height: | Size: 505 B After Width: | Height: | Size: 505 B |
Before Width: | Height: | Size: 638 B After Width: | Height: | Size: 638 B |
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 547 B |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 6.3 KiB |