add armor specs to rainbow armor, add technic armor mod, add redef mod, add technic recycle mod
|
@ -6,26 +6,35 @@ local S = minetest.get_translator(rainbow_ore.modname)
|
|||
minetest.register_tool("rainbow_ore:rainbow_ore_helmet", {
|
||||
description = S("Rainbow Helmet"),
|
||||
inventory_image = "rainbow_ore_helmet_inv.png",
|
||||
groups = {armor_head=20, armor_heal=17, armor_use=40},
|
||||
groups = {armor_head=20, armor_heal=17, armor_use=40, armor_fire=1},
|
||||
armor_groups = {fleshy=20},
|
||||
wear = 0,
|
||||
damage_groups = {cracky=2, snappy=1, level=3},
|
||||
})
|
||||
minetest.register_tool("rainbow_ore:rainbow_ore_chestplate", {
|
||||
description = S("Rainbow Chestplate"),
|
||||
inventory_image = "rainbow_ore_chestplate_inv.png",
|
||||
groups = {armor_torso=25, armor_heal=17, armor_use=40},
|
||||
groups = {armor_torso=25, armor_heal=17, armor_use=40, armor_fire=1},
|
||||
armor_groups = {fleshy=25},
|
||||
damage_groups = {cracky=2, snappy=1, level=3},
|
||||
wear = 0,
|
||||
})
|
||||
minetest.register_tool("rainbow_ore:rainbow_ore_leggings", {
|
||||
description = S("Rainbow Leggings"),
|
||||
inventory_image = "rainbow_ore_leggings_inv.png",
|
||||
groups = {armor_legs=25, armor_heal=17, armor_use=40},
|
||||
groups = {armor_legs=25, armor_heal=17, armor_use=40, armor_fire=1},
|
||||
armor_groups = {fleshy=25},
|
||||
damage_groups = {cracky=2, snappy=1, level=3},
|
||||
wear = 0,
|
||||
|
||||
})
|
||||
minetest.register_tool("rainbow_ore:rainbow_ore_boots", {
|
||||
description = S("Rainbow Boots"),
|
||||
inventory_image = "rainbow_ore_boots_inv.png",
|
||||
groups = {armor_feet=20, armor_heal=17, armor_use=40},
|
||||
groups = {armor_feet=20, armor_heal=17, armor_use=40, physics_speed=1, physics_jump=0.5, armor_fire=1},
|
||||
wear = 0,
|
||||
damage_groups = {cracky=2, snappy=1, level=3},
|
||||
armor_groups = {fleshy=20},
|
||||
})
|
||||
|
||||
|
||||
|
|
21
mods/redef/LICENSE.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) “Linuxdirk”
|
||||
|
||||
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.
|
86
mods/redef/README.md
Normal file
|
@ -0,0 +1,86 @@
|
|||
Changes smaller things that are issues for [Minetest Game](https://github.com/minetest/minetest_game), and some well-known mods that are technically fixable but won’t be fixed due to several non-technical reasons.
|
||||
|
||||
## Configuration
|
||||
|
||||
All configuration options are set to values intended by the redefinitions. For changing or disabling the values set the corresponding options to the preferred values or to the value that disables the redefinition.
|
||||
|
||||
The configurations can be set in the global config file used for the server, as well as in a world-specific configuration file located at `./worlds/worldname/_redef.conf`. Global settings overwrite the given defaults and world-specific settings overwrite the global settings and defaults.
|
||||
|
||||
### 3D Ladders
|
||||
|
||||

|
||||
|
||||
* setting: `redef_3d_ladders = true`
|
||||
* disable: set to `false`
|
||||
* fixes: [mtg2423]
|
||||
* default: no 3D ladders
|
||||
|
||||
Redefining the 2D ladders so that they use a 3D model. No new textures are needed since he normal textures are used. Only works properly if using the 16x16 default textures or texture packs that use the same size and shape for the ladders.
|
||||
|
||||
### Maximum Stack Size
|
||||
|
||||

|
||||
|
||||
* setting: `redef_stack_max = 100`
|
||||
* disable: set to 0
|
||||
* fixes: [mtg1843], [mtg5730], [mtg1724], [mt394]
|
||||
* default: stack size at 99
|
||||
|
||||
It changes the maximum stack size of all registered things whose stack size is 99 to the given `redef_stack_max` value. Unfortunately the maximum stack size of 99 is hardcoded in some places and can’t be changed using a mod.
|
||||
|
||||
### Grass Box Height
|
||||
|
||||

|
||||
|
||||
* setting: `redef_grass_box_height = 2`
|
||||
* disable: set to 0
|
||||
* fixes: [mtg1980]
|
||||
* default: various heights for grass selection boxes
|
||||
|
||||
Make grass selection box x/16 high for easy building or punching through regardless of actual height of the box.
|
||||
|
||||
### Aligned Textures
|
||||
|
||||

|
||||
|
||||
* setting: `redef_aligned_textures = true`
|
||||
* disable: set to `false`
|
||||
* fixes: [mtg2287], [mtg1931], [mt5222]
|
||||
* default: textures not aligned for most relevant nodes
|
||||
|
||||
This fixes the texture orientation of stairs and slabs regardless of how they were defined to achieve a clean look. This redefinition also world-alignes moreblocks nodes that are nodeboxes (world-alignment of textures only works on nodeboxes).
|
||||
|
||||
### Proper Rotation
|
||||
|
||||

|
||||
|
||||
* setting: `redef_proper_rotation = true`
|
||||
* disable: set to `false`
|
||||
* fixes: [moreblocks138] for example
|
||||
* default: slabs and stairs do not align properly on placement
|
||||
|
||||
Moreblocks re-implements all stairs and slabs for unknown reason and thus breaking their placement and auto-rotation. By enabling this, the original functionality is replicated. This also addresses weird placement of *bakedclay* mod’s objects.
|
||||
|
||||
### Show Steps (slabs and stairs)
|
||||
|
||||

|
||||
|
||||
* setting: `redef_show_steps = true`
|
||||
* disable: set to `false`
|
||||
* fixes: [moreblocks141] for example
|
||||
* default: slabs and stairs are hidden in creative inventory
|
||||
|
||||
This mainly exists to prevent crashing the server when setting `moreblocks.stairsplus_in_creative_inventory = true` (see example issue). But what this does in general is removing the `not_in_creative_inventory` group from all nodes that have `stair = 1` or `slab = 1` group set. In result all stairs and slabs are shown in creative inventory.
|
||||
|
||||
|
||||
[mtg2423]: https://github.com/minetest/minetest_game/issues/2423
|
||||
[mtg1843]: https://github.com/minetest/minetest/pull/1843
|
||||
[mtg5730]: https://github.com/minetest/minetest/issues/5730
|
||||
[mtg1724]: https://github.com/minetest/minetest_game/issues/1724
|
||||
[mt394]: https://github.com/minetest/minetest/issues/394
|
||||
[mtg1980]: https://github.com/minetest/minetest_game/issues/1980
|
||||
[mtg2287]: https://github.com/minetest/minetest_game/issues/2287
|
||||
[mtg1931]: https://github.com/minetest/minetest_game/issues/1931
|
||||
[mt5222]: https://github.com/minetest/minetest/issues/5222
|
||||
[moreblocks138]: https://github.com/minetest-mods/moreblocks/issues/138
|
||||
[moreblocks141]: https://github.com/minetest-mods/moreblocks/issues/141
|
42
mods/redef/init.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
local modpath = core.get_modpath('redef')
|
||||
local path = modpath..DIR_DELIM..'redefinitions'..DIR_DELIM
|
||||
local worldpath = core.get_worldpath()..DIR_DELIM
|
||||
|
||||
-- Get aconfiguration value or return a default
|
||||
--
|
||||
-- This function takes an unprefixed value, automatically prefixes it and
|
||||
-- tries to get the value from the global configuration or the world-specific
|
||||
-- configuration. If the option is not found in any of those the given default
|
||||
-- value is returned.
|
||||
--
|
||||
-- @param value The unprefixed option to get
|
||||
-- @param default The default value in case the option is not found
|
||||
-- @return mixed The value
|
||||
local g = function (value, default)
|
||||
local global_value = core.settings:get('redef_'..value) or default
|
||||
|
||||
local world_config_path = worldpath..DIR_DELIM..'_redef.conf'
|
||||
local world_config = Settings(world_config_path)
|
||||
local world_value = world_config:get('redef_'..value)
|
||||
|
||||
return world_value or global_value
|
||||
end
|
||||
|
||||
|
||||
core.register_on_mods_loaded(function()
|
||||
local redefinitions = {
|
||||
['3D Ladders'] = core.is_yes(g('3d_ladders', true)),
|
||||
['Aligned Textures'] = core.is_yes(g('aligned_textures', true)),
|
||||
['Grass Box Height'] = tonumber(g('grass_box_height', 2)) >= 1,
|
||||
['Maximum Stack Size'] = tonumber(g('stack_max', 100)) >= 1,
|
||||
['Proper Rotation'] = core.is_yes(g('proper_rotation', true)),
|
||||
['Show Steps'] = core.is_yes(g('show_steps', true))
|
||||
}
|
||||
|
||||
for name,use in pairs(redefinitions) do
|
||||
if use == true then
|
||||
dofile(path..name:lower():gsub(' ', '_')..'.lua')
|
||||
core.log('info', '[redef] Applied redefinition “'..name..'”')
|
||||
end
|
||||
end
|
||||
end)
|
16
mods/redef/mod.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
name = redef
|
||||
title = Minor Redefinitions
|
||||
depends = default
|
||||
description = """
|
||||
Changes smaller things that are issues for Minetest Game that are technically fixable but won’t be fixed due to several non-technical reasons.
|
||||
|
||||
The following redefinitions are applied by default:
|
||||
|
||||
* 3D Ladders (only works with default ladder texture shape)
|
||||
* Maximum stack size set to 100
|
||||
* Grass selection box height set to 2
|
||||
* World-aligned textures for all stairs and slabs
|
||||
* Properly rotate nodes from some well-known mods
|
||||
"""
|
||||
release = 28636
|
||||
author = Linuxdirk
|
31
mods/redef/redefinitions/3d_ladders.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
local ladders = {
|
||||
{'ladder_wood', 'default_ladder_wood.png', 'default_wood.png'},
|
||||
{'ladder_steel', 'default_ladder_steel.png', 'default_steel_block.png'}
|
||||
}
|
||||
|
||||
|
||||
for l,def in pairs(ladders) do
|
||||
core.override_item('default:'..def[1], {
|
||||
tiles = { def[2], def[2], def[3], def[3], def[3], def[3] },
|
||||
use_texture_alpha = 'clip',
|
||||
drawtype = 'nodebox',
|
||||
paramtype = 'light',
|
||||
node_box = {
|
||||
type = 'fixed',
|
||||
fixed = {
|
||||
{-0.375, -0.5, -0.5, -0.25, -0.375, 0.5}, -- strut_1
|
||||
{0.25, -0.5, -0.5, 0.375, -0.375, 0.5}, -- strut_2
|
||||
{-0.4375, -0.5, 0.3125, 0.4375, -0.375, 0.4375}, -- rung_1
|
||||
{-0.4375, -0.5, 0.0625, 0.4375, -0.375, 0.1875}, -- rung_2
|
||||
{-0.4375, -0.5, -0.1875, 0.4375, -0.375, -0.0625}, -- rung_3
|
||||
{-0.4375, -0.5, -0.4375, 0.4375, -0.375, -0.3125} -- rung_4
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = 'wallmounted',
|
||||
wall_top = {-0.4375, 0.375, -0.5, 0.4375, 0.5, 0.5},
|
||||
wall_side = {-0.5, -0.5, -0.4375, -0.375, 0.5, 0.4375},
|
||||
wall_bottom = {-0.4375, -0.5, -0.5, 0.4375, -0.375, 0.5}
|
||||
}
|
||||
})
|
||||
end
|
29
mods/redef/redefinitions/aligned_textures.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
for id,definition in pairs(core.registered_nodes) do
|
||||
local groups = definition.groups
|
||||
local origin = definition.mod_origin
|
||||
local circular_saw = id == 'moreblocks:circular_saw'
|
||||
|
||||
local stair_or_slab = groups.stair or groups.slab
|
||||
local moreblocks_object = origin == 'moreblocks' and not circular_saw
|
||||
|
||||
if stair_or_slab or moreblocks_object then
|
||||
local tiles = definition.tiles
|
||||
local target_tiles = {}
|
||||
|
||||
for index,_ in pairs(tiles) do
|
||||
if type(tiles[index]) == 'table' then
|
||||
tiles[index].align_style = 'world'
|
||||
target_tiles[index] = tiles[index]
|
||||
else
|
||||
target_tiles[index] = {
|
||||
name = tiles[index],
|
||||
align_style = 'world'
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
core.override_item(id, {
|
||||
tiles = target_tiles
|
||||
})
|
||||
end
|
||||
end
|
37
mods/redef/redefinitions/grass_box_height.lua
Normal file
|
@ -0,0 +1,37 @@
|
|||
local height = core.settings:get('redef_grass_box_height') or '2'
|
||||
local target = -0.5 + (tonumber(height) * 0.0625)
|
||||
|
||||
|
||||
local grass_nodes = {
|
||||
'default:junglegrass',
|
||||
'default:dry_grass_1',
|
||||
'default:dry_grass_2',
|
||||
'default:dry_grass_3',
|
||||
'default:dry_grass_4',
|
||||
'default:dry_grass_5',
|
||||
'default:grass_1',
|
||||
'default:grass_2',
|
||||
'default:grass_3',
|
||||
'default:grass_4',
|
||||
'default:grass_5',
|
||||
}
|
||||
|
||||
|
||||
for _,grass in pairs(grass_nodes) do
|
||||
local current_box = core.registered_nodes[grass].selection_box.fixed
|
||||
if (current_box[5] > target) then
|
||||
core.override_item(grass, {
|
||||
selection_box = {
|
||||
type = 'fixed',
|
||||
fixed = {
|
||||
current_box[1],
|
||||
current_box[2],
|
||||
current_box[3],
|
||||
current_box[4],
|
||||
target,
|
||||
current_box[6]
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
24
mods/redef/redefinitions/maximum_stack_size.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
local _stack_max = tonumber(core.settings:get('redef_stack_max') or 100)
|
||||
local all_objects = {}
|
||||
|
||||
-- Get the things that have to be altered.
|
||||
for w,what in pairs({'items', 'nodes', 'craftitems', 'tools'}) do
|
||||
for name,definition in pairs(core['registered_'..what]) do
|
||||
if definition.stack_max == 99 then
|
||||
table.insert(all_objects, name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Set stack size to the given value.
|
||||
for _,name in pairs(all_objects) do
|
||||
core.override_item(name, {
|
||||
stack_max = _stack_max
|
||||
})
|
||||
end
|
||||
|
||||
-- Set Luanti default values in case mods or something within the engine
|
||||
-- will use them after the above code ran.
|
||||
core.craftitemdef_default.stack_max = _stack_max
|
||||
core.nodedef_default.stack_max = _stack_max
|
||||
core.noneitemdef_default.stack_max = _stack_max
|
150
mods/redef/redefinitions/proper_rotation.lua
Normal file
|
@ -0,0 +1,150 @@
|
|||
local override_item = core.override_item
|
||||
local pointed_thing_to_face_pos = core.pointed_thing_to_face_pos
|
||||
local dir_to_facedir = core.dir_to_facedir
|
||||
local is_creative_enabled = core.is_creative_enabled
|
||||
local item_place_node = core.item_place_node
|
||||
|
||||
local stairs = {}
|
||||
local slabs = {}
|
||||
local slopes = {}
|
||||
|
||||
|
||||
-- Correct stairs placement
|
||||
--
|
||||
-- Derived from the original stairs on_place function of Minetest Game.
|
||||
--
|
||||
-- @param itemstack An itemstack according to Luanti API
|
||||
-- @param placer A placer object according to Luanti API
|
||||
-- @param pointed_thing A pointed_thing according to Luanti API
|
||||
-- @return mixed itemstack and position according to Luanti API
|
||||
local properly_rotate = function (itemstack, placer, pointed_thing)
|
||||
local under = pointed_thing.under
|
||||
local above = pointed_thing.above
|
||||
local param2 = 0
|
||||
|
||||
if placer then
|
||||
local placer_pos = placer:get_pos()
|
||||
local finepos = pointed_thing_to_face_pos(placer, pointed_thing)
|
||||
local fpos = finepos.y % 1
|
||||
|
||||
local under_above = under.y - 1 == above.y
|
||||
local fpos_perimeter = (fpos > 0 and fpos < 0.5)
|
||||
local fpos_limit = (fpos < -0.5 and fpos > -0.999999999)
|
||||
|
||||
if placer_pos then
|
||||
param2 = dir_to_facedir(vector.subtract(above, placer_pos))
|
||||
end
|
||||
|
||||
if under_above or fpos_perimeter or fpos_limit then
|
||||
param2 = param2 + 20
|
||||
if param2 == 21 then
|
||||
param2 = 23
|
||||
elseif param2 == 23 then
|
||||
param2 = 21
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return core.item_place(itemstack, placer, pointed_thing, param2)
|
||||
end
|
||||
|
||||
|
||||
-- Correct slabs placement
|
||||
--
|
||||
-- Derived from the original stairs on_place function of Minetest Game.
|
||||
--
|
||||
-- @param itemstack An itemstack according to LuantI API
|
||||
-- @param placer A placer object according to Luanti API
|
||||
-- @param pointed_thing A pointed_thing according to Luanti API
|
||||
-- @return mixed itemstack and position according to Luanti API
|
||||
local on_place_slabs = function (itemstack, placer, pointed_thing)
|
||||
local under = core.get_node(pointed_thing.under)
|
||||
local wield_item = itemstack:get_name()
|
||||
local player_name = placer and placer:get_player_name() or ''
|
||||
|
||||
-- Special behavior if placed on a slab
|
||||
if under and under.name:find(':slab_') then
|
||||
local pt_above = pointed_thing.above
|
||||
local pt_under = pointed_thing.under
|
||||
local fdir = dir_to_facedir(vector.subtract(pt_above, pt_under), true)
|
||||
local p2 = under.param2
|
||||
|
||||
-- Slab placement based on upside-down slabs or below slabs
|
||||
--
|
||||
-- ┌────────┐
|
||||
-- │ │
|
||||
-- ┢━━━━━━━━┪ <-- Slab A (bottom half of the node seen sideways)
|
||||
-- ┃ ┃
|
||||
-- ┈┈┈┈┣━━━━━━━━┫┈┈┈┈
|
||||
-- ┃ ┃
|
||||
-- ┡━━━━━━━━┩ <-- Slab B (top half of the node, seen sideways)
|
||||
-- │ │
|
||||
-- └────────┘
|
||||
--
|
||||
-- Slabs A and B are rotated according slab B or A on placement so that
|
||||
-- slabs placed on regular slabs from below automatically become
|
||||
-- upside-down slabs and slabs placed on top of upside-down slabs are
|
||||
-- not rotated into the same position.
|
||||
if p2 >= 20 and fdir == 8 then p2 = p2 - 20 end -- Slab A rotation
|
||||
if p2 <= 3 and fdir == 4 then p2 = p2 + 20 end -- Slab B rotation
|
||||
|
||||
-- Place node usind the calculated rotation
|
||||
item_place_node(ItemStack(wield_item), placer, pointed_thing, p2)
|
||||
|
||||
-- Remove one item if not in creative and return the itemstack
|
||||
if not is_creative_enabled(player_name) then itemstack:take_item() end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- When not placed on a slab just properly rotate the slab
|
||||
return properly_rotate(itemstack, placer, pointed_thing)
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- Determine all stairs and slabs and put them into the respective tables.
|
||||
for name,definition in pairs(core.registered_nodes) do
|
||||
local from_moreblocks = definition.mod_origin == 'moreblocks'
|
||||
local from_bakedclay = definition.mod_origin == 'bakedclay'
|
||||
local mod_origin = from_moreblocks or from_bakedclay
|
||||
|
||||
local stair = string.match(name, ':stair_') ~= nil
|
||||
local slab = string.match(name, ':slab_') ~= nil
|
||||
local slope = string.match(name, ':slope_') ~= nil
|
||||
|
||||
if stair and mod_origin then table.insert(stairs, name) end
|
||||
if slab and mod_origin then table.insert(slabs, name) end
|
||||
if slope and mod_origin then table.insert(slopes, name) end
|
||||
end
|
||||
|
||||
|
||||
-- Iterate over all stairs and override the broken on_place function.
|
||||
for _,name in pairs(stairs) do
|
||||
override_item(name, {
|
||||
on_place = function (itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then return itemstack end
|
||||
return properly_rotate(itemstack, placer, pointed_thing)
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
-- Iterate over all slopes and override the broken on_place function.
|
||||
for _,name in pairs(slopes) do
|
||||
override_item(name, {
|
||||
on_place = function (itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then return itemstack end
|
||||
return properly_rotate(itemstack, placer, pointed_thing)
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
-- Iterate over all slabs and override the broken on_place function.
|
||||
for _,name in pairs(slabs) do
|
||||
override_item(name, {
|
||||
on_place = function (itemstack, placer, pointed_thing)
|
||||
return on_place_slabs(itemstack, placer, pointed_thing)
|
||||
end
|
||||
})
|
||||
end
|
23
mods/redef/redefinitions/show_steps.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
local override_item = core.override_item
|
||||
local registered_nodes = table.copy(core.registered_nodes)
|
||||
local relevant_nodes = {}
|
||||
|
||||
|
||||
-- Determine all stairs and slabs by their respective groups and add them to
|
||||
-- the table of nodes to handle.
|
||||
for name,definition in pairs(registered_nodes) do
|
||||
local groups = definition.groups or {}
|
||||
local relevant = ((groups.stair == 1) or (groups.slab == 1))
|
||||
if relevant then
|
||||
table.insert(relevant_nodes, name)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Iterate over all stairs and slabs and remove the not_in_creative_inventory
|
||||
-- group to show them in the creative inventory again.
|
||||
for _,name in pairs(relevant_nodes) do
|
||||
local groups = registered_nodes[name].groups
|
||||
groups.not_in_creative_inventory = nil
|
||||
override_item(name, { groups = groups })
|
||||
end
|
BIN
mods/redef/screenshot.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
mods/redef/screenshots/redef_3d_ladders.png
Normal file
After Width: | Height: | Size: 286 KiB |
BIN
mods/redef/screenshots/redef_aligned_textures.png
Normal file
After Width: | Height: | Size: 231 KiB |
BIN
mods/redef/screenshots/redef_grass_box_height.png
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
mods/redef/screenshots/redef_proper_rotation.png
Normal file
After Width: | Height: | Size: 97 KiB |
BIN
mods/redef/screenshots/redef_show_steps.png
Normal file
After Width: | Height: | Size: 101 KiB |
BIN
mods/redef/screenshots/redef_stack_max.png
Normal file
After Width: | Height: | Size: 44 KiB |
62
mods/redef/settingtypes.txt
Normal file
|
@ -0,0 +1,62 @@
|
|||
# This will render ladders in 3D using a nodebox.
|
||||
#
|
||||
# Please note that this will only work properly when
|
||||
# using the default textures or when the texture pack
|
||||
# uses the same shape of ladders than the default
|
||||
# texture pack!
|
||||
#
|
||||
# Fixes https://github.com/minetest/minetest/issues/2423
|
||||
redef_3d_ladders (Render ladders in 3D) bool true
|
||||
|
||||
# Alter the maximum stack size.
|
||||
#
|
||||
# By default Minetest Game uses an arbitrary set max
|
||||
# stack size of 99. When setting this value to any
|
||||
# value the STACK_MAX size will be changed to that
|
||||
# value in most places.
|
||||
#
|
||||
# Please note that 99 is hardcoded on some places and
|
||||
# still will be 99 even if set different here.
|
||||
#
|
||||
# Fixes https://forum.minetest.net/viewtopic.php?t=16817
|
||||
redef_stack_max (Maximum stack size) int 100
|
||||
|
||||
# Set the grass selection box to a lower height.
|
||||
#
|
||||
# Grass nodeboxes might be too high. This can disturb
|
||||
# Building or punching mobs or other players. This
|
||||
# Setting allows to reduce the selection boxes of
|
||||
# all grass types to the given value. Set to 0 to
|
||||
# leave the selection box unaltered.
|
||||
#
|
||||
# If a selection box is smaller than the given value
|
||||
# it remains unaltered.
|
||||
#
|
||||
# Fixes https://github.com/minetest/minetest_game/issues/1980
|
||||
redef_grass_box_height (Grass selection box height x/16) int 2
|
||||
|
||||
# World-aligned textures for stairs, slabs, etc.
|
||||
#
|
||||
# By default the most critical nodes are not
|
||||
# properly aligned. This fixes it.
|
||||
#
|
||||
# Fixes:
|
||||
#
|
||||
# https://github.com/minetest/minetest_game/issues/2287
|
||||
# https://github.com/minetest/minetest_game/issues/1931
|
||||
# https://github.com/minetest/minetest/issues/5222
|
||||
redef_aligned_textures (Use world-aligned textures) bool true
|
||||
|
||||
|
||||
# Proper rotation of shaped nodes
|
||||
#
|
||||
# Grass nodeboxes might be too high. This can disturb
|
||||
# The moreblocks (for example) introduces a custom, not
|
||||
# properly working rotation mechanism. This redefinition
|
||||
# fixes that and replaces it with a mechanism that is
|
||||
# derived from the one that is used by “Minetest Game”.
|
||||
#
|
||||
# Fixes:
|
||||
#
|
||||
# https://github.com/minetest-mods/moreblocks/issues/138
|
||||
redef_proper_rotation (Properly rotate shaped nodes) bool true
|
BIN
mods/redef/sources/comparison_screenshot_template.xcf
Normal file
BIN
mods/redef/sources/ladder.nbe
Normal file
BIN
mods/redef/sources/screenshot.xcf
Normal file
10
mods/technic_armor/.github/workflows/luacheck.yml
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
name: luacheck
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
luacheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@main
|
||||
- name: Luacheck
|
||||
uses: lunarmodules/luacheck@master
|
4
mods/technic_armor/.luacheckrc
Normal file
|
@ -0,0 +1,4 @@
|
|||
globals = {
|
||||
"armor",
|
||||
"minetest",
|
||||
}
|
4
mods/technic_armor/LICENSE.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
License Source Code: Copyright (C) 2013-2018 Stuart Jones - LGPL v2.1
|
||||
|
||||
License Textures: poet-nohit and numberZero - 2015-2018 WTFPL
|
||||
|
14
mods/technic_armor/README.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Technic Armor [technic_armor]
|
||||
|
||||
[](https://github.com/mt-mods/technic_armor/actions)
|
||||
[](https://content.minetest.net/packages/mt-mods/technic_armor/)
|
||||
|
||||
Adds armor made from lead, brass, cast iron, carbon steel, stainless steel, tin and silver.
|
||||
|
||||

|
||||
|
||||
## License
|
||||
|
||||
Code: LGPL v2.1
|
||||
|
||||
Textures: WTFPL (by poet-nohit and numberZero)
|
142
mods/technic_armor/init.lua
Normal file
|
@ -0,0 +1,142 @@
|
|||
|
||||
-- Use 3d_armor translator to take advantage of existing translations for armor parts
|
||||
local S = minetest.get_translator("3d_armor")
|
||||
|
||||
local materials = {}
|
||||
|
||||
if minetest.get_modpath("technic_worldgen") then
|
||||
materials.lead = {
|
||||
name = S("Lead"),
|
||||
craft_item = "technic:lead_ingot",
|
||||
armor = 1.6,
|
||||
heal = 0,
|
||||
use = 500,
|
||||
radiation = 88
|
||||
}
|
||||
materials.brass = {
|
||||
name = S("Brass"),
|
||||
craft_item = "technic:brass_ingot",
|
||||
armor = 1.8,
|
||||
heal = 0,
|
||||
use = 650,
|
||||
radiation = 43
|
||||
}
|
||||
materials.cast = {
|
||||
name = S("Cast Iron"),
|
||||
craft_item = "technic:cast_iron_ingot",
|
||||
armor = 2.5,
|
||||
heal = 8,
|
||||
use = 200,
|
||||
radiation = 40
|
||||
}
|
||||
materials.carbon = {
|
||||
name = S("Carbon Steel"),
|
||||
craft_item = "technic:carbon_steel_ingot",
|
||||
armor = 2.7,
|
||||
heal = 10,
|
||||
use = 100,
|
||||
radiation = 40
|
||||
}
|
||||
materials.stainless = {
|
||||
name = S("Stainless Steel"),
|
||||
craft_item = "technic:stainless_steel_ingot",
|
||||
armor = 2.7,
|
||||
heal = 10,
|
||||
use = 75,
|
||||
radiation = 40
|
||||
}
|
||||
end
|
||||
|
||||
if minetest.get_modpath("moreores") then
|
||||
materials.silver = {
|
||||
name = S("Silver"),
|
||||
craft_item = "moreores:silver_ingot",
|
||||
armor = 1.8,
|
||||
heal = 6,
|
||||
use = 650,
|
||||
radiation = 53
|
||||
}
|
||||
end
|
||||
|
||||
if minetest.get_modpath("default") then
|
||||
materials.tin = {
|
||||
name = S("Tin"),
|
||||
craft_item = "default:tin_ingot",
|
||||
armor = 1.6,
|
||||
heal = 0,
|
||||
use = 750,
|
||||
radiation = 37
|
||||
}
|
||||
end
|
||||
|
||||
local parts = {
|
||||
helmet = {
|
||||
name = S("Helmet"),
|
||||
place = "head",
|
||||
level = 5,
|
||||
radlevel = 0.10,
|
||||
craft = {{1, 1, 1}, {1, 0, 1}}
|
||||
},
|
||||
chestplate = {
|
||||
name = S("Chestplate"),
|
||||
place = "torso",
|
||||
level = 8,
|
||||
radlevel = 0.35,
|
||||
craft = {{1, 0, 1}, {1, 1, 1}, {1, 1, 1}}
|
||||
},
|
||||
leggings = {
|
||||
name = S("Leggings"),
|
||||
place = "legs",
|
||||
level = 7,
|
||||
radlevel = 0.15,
|
||||
craft = {{1, 1, 1}, {1, 0, 1}, {1, 0, 1}}
|
||||
},
|
||||
boots = {
|
||||
name = S("Boots"),
|
||||
place = "feet",
|
||||
level = 4,
|
||||
radlevel = 0.10,
|
||||
craft = {{1, 0, 1}, {1, 0, 1}}
|
||||
}
|
||||
}
|
||||
|
||||
if minetest.get_modpath("shields") then
|
||||
parts.shield = {
|
||||
name = S("Shield"),
|
||||
place = "shield",
|
||||
level = 5,
|
||||
radlevel = 0.00,
|
||||
craft = {{1, 1, 1}, {1, 1, 1}, {0, 1, 0}}
|
||||
}
|
||||
end
|
||||
|
||||
local function make_recipe(template, material)
|
||||
local recipe = {}
|
||||
for i, row in ipairs(template) do
|
||||
recipe[i] = {}
|
||||
for j, item in ipairs(row) do
|
||||
recipe[i][j] = item == 0 and "" or material
|
||||
end
|
||||
end
|
||||
return recipe
|
||||
end
|
||||
|
||||
for material, m in pairs(materials) do
|
||||
for part, p in pairs(parts) do
|
||||
local name = "technic_armor:"..part.."_"..material
|
||||
armor:register_armor(name, {
|
||||
description = S("@1 @2", m.name, p.name),
|
||||
inventory_image = "technic_armor_inv_"..part.."_"..material..".png",
|
||||
groups = {
|
||||
["armor_"..p.place] = math.floor(p.level * m.armor),
|
||||
armor_heal = m.heal,
|
||||
armor_use = m.use,
|
||||
armor_radiation = math.floor(p.radlevel * m.radiation)
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = name,
|
||||
recipe = make_recipe(p.craft, m.craft_item),
|
||||
})
|
||||
end
|
||||
end
|
7
mods/technic_armor/mod.conf
Normal file
|
@ -0,0 +1,7 @@
|
|||
name = technic_armor
|
||||
description = Adds armor made from lead, brass, cast iron, carbon steel, stainless steel, tin and silver
|
||||
depends = 3d_armor
|
||||
optional_depends = default, moreores, technic_worldgen
|
||||
release = 24351
|
||||
author = mt-mods
|
||||
title = Technic Armor
|
BIN
mods/technic_armor/screenshot.png
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
mods/technic_armor/textures/technic_armor_boots_brass.png
Normal file
After Width: | Height: | Size: 304 B |
After Width: | Height: | Size: 238 B |
BIN
mods/technic_armor/textures/technic_armor_boots_carbon.png
Normal file
After Width: | Height: | Size: 217 B |
After Width: | Height: | Size: 153 B |
BIN
mods/technic_armor/textures/technic_armor_boots_cast.png
Normal file
After Width: | Height: | Size: 304 B |
BIN
mods/technic_armor/textures/technic_armor_boots_cast_preview.png
Normal file
After Width: | Height: | Size: 238 B |
BIN
mods/technic_armor/textures/technic_armor_boots_lead.png
Normal file
After Width: | Height: | Size: 257 B |
BIN
mods/technic_armor/textures/technic_armor_boots_lead_preview.png
Normal file
After Width: | Height: | Size: 190 B |
BIN
mods/technic_armor/textures/technic_armor_boots_silver.png
Normal file
After Width: | Height: | Size: 278 B |
After Width: | Height: | Size: 181 B |
BIN
mods/technic_armor/textures/technic_armor_boots_stainless.png
Normal file
After Width: | Height: | Size: 437 B |
After Width: | Height: | Size: 190 B |
BIN
mods/technic_armor/textures/technic_armor_boots_tin.png
Normal file
After Width: | Height: | Size: 297 B |
BIN
mods/technic_armor/textures/technic_armor_boots_tin_preview.png
Normal file
After Width: | Height: | Size: 238 B |
BIN
mods/technic_armor/textures/technic_armor_chestplate_brass.png
Normal file
After Width: | Height: | Size: 490 B |
After Width: | Height: | Size: 344 B |
BIN
mods/technic_armor/textures/technic_armor_chestplate_carbon.png
Normal file
After Width: | Height: | Size: 464 B |
After Width: | Height: | Size: 281 B |
BIN
mods/technic_armor/textures/technic_armor_chestplate_cast.png
Normal file
After Width: | Height: | Size: 490 B |
After Width: | Height: | Size: 344 B |
BIN
mods/technic_armor/textures/technic_armor_chestplate_lead.png
Normal file
After Width: | Height: | Size: 545 B |
After Width: | Height: | Size: 316 B |
BIN
mods/technic_armor/textures/technic_armor_chestplate_silver.png
Normal file
After Width: | Height: | Size: 479 B |
After Width: | Height: | Size: 273 B |
After Width: | Height: | Size: 539 B |
After Width: | Height: | Size: 299 B |
BIN
mods/technic_armor/textures/technic_armor_chestplate_tin.png
Normal file
After Width: | Height: | Size: 477 B |
After Width: | Height: | Size: 327 B |
BIN
mods/technic_armor/textures/technic_armor_helmet_brass.png
Normal file
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 211 B |
BIN
mods/technic_armor/textures/technic_armor_helmet_carbon.png
Normal file
After Width: | Height: | Size: 282 B |
After Width: | Height: | Size: 136 B |
BIN
mods/technic_armor/textures/technic_armor_helmet_cast.png
Normal file
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 211 B |
BIN
mods/technic_armor/textures/technic_armor_helmet_lead.png
Normal file
After Width: | Height: | Size: 337 B |
After Width: | Height: | Size: 146 B |
BIN
mods/technic_armor/textures/technic_armor_helmet_silver.png
Normal file
After Width: | Height: | Size: 299 B |
After Width: | Height: | Size: 148 B |
BIN
mods/technic_armor/textures/technic_armor_helmet_stainless.png
Normal file
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 152 B |
BIN
mods/technic_armor/textures/technic_armor_helmet_tin.png
Normal file
After Width: | Height: | Size: 430 B |
BIN
mods/technic_armor/textures/technic_armor_helmet_tin_preview.png
Normal file
After Width: | Height: | Size: 207 B |
BIN
mods/technic_armor/textures/technic_armor_inv_boots_brass.png
Normal file
After Width: | Height: | Size: 143 B |
BIN
mods/technic_armor/textures/technic_armor_inv_boots_carbon.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
mods/technic_armor/textures/technic_armor_inv_boots_cast.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
mods/technic_armor/textures/technic_armor_inv_boots_lead.png
Normal file
After Width: | Height: | Size: 167 B |
BIN
mods/technic_armor/textures/technic_armor_inv_boots_silver.png
Normal file
After Width: | Height: | Size: 143 B |
After Width: | Height: | Size: 163 B |
BIN
mods/technic_armor/textures/technic_armor_inv_boots_tin.png
Normal file
After Width: | Height: | Size: 143 B |
After Width: | Height: | Size: 150 B |
After Width: | Height: | Size: 152 B |
After Width: | Height: | Size: 152 B |
After Width: | Height: | Size: 192 B |
After Width: | Height: | Size: 150 B |
After Width: | Height: | Size: 176 B |
BIN
mods/technic_armor/textures/technic_armor_inv_chestplate_tin.png
Normal file
After Width: | Height: | Size: 150 B |
BIN
mods/technic_armor/textures/technic_armor_inv_helmet_brass.png
Normal file
After Width: | Height: | Size: 140 B |
BIN
mods/technic_armor/textures/technic_armor_inv_helmet_carbon.png
Normal file
After Width: | Height: | Size: 145 B |
BIN
mods/technic_armor/textures/technic_armor_inv_helmet_cast.png
Normal file
After Width: | Height: | Size: 145 B |
BIN
mods/technic_armor/textures/technic_armor_inv_helmet_lead.png
Normal file
After Width: | Height: | Size: 171 B |
BIN
mods/technic_armor/textures/technic_armor_inv_helmet_silver.png
Normal file
After Width: | Height: | Size: 140 B |
After Width: | Height: | Size: 161 B |
BIN
mods/technic_armor/textures/technic_armor_inv_helmet_tin.png
Normal file
After Width: | Height: | Size: 140 B |
BIN
mods/technic_armor/textures/technic_armor_inv_leggings_brass.png
Normal file
After Width: | Height: | Size: 137 B |
After Width: | Height: | Size: 141 B |
BIN
mods/technic_armor/textures/technic_armor_inv_leggings_cast.png
Normal file
After Width: | Height: | Size: 141 B |
BIN
mods/technic_armor/textures/technic_armor_inv_leggings_lead.png
Normal file
After Width: | Height: | Size: 170 B |
After Width: | Height: | Size: 137 B |
After Width: | Height: | Size: 163 B |
BIN
mods/technic_armor/textures/technic_armor_inv_leggings_tin.png
Normal file
After Width: | Height: | Size: 137 B |
BIN
mods/technic_armor/textures/technic_armor_inv_shield_brass.png
Normal file
After Width: | Height: | Size: 471 B |