forked from mtcontrib/x_enchanting
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
693ace14c2 | |||
f4ed507897 | |||
01703cb0a3 | |||
c5c53b63ee | |||
4a0b45f472 |
@ -18,8 +18,6 @@ Adds Enchanting Mechanics and API.
|
|||||||
* mesh node model
|
* mesh node model
|
||||||
* mesh entity model and animations
|
* mesh entity model and animations
|
||||||
|
|
||||||
NOTE: item inventory/wield image will not be adjusted until this feature is supported by MT engine, see: https://github.com/minetest/minetest/issues/5686
|
|
||||||
|
|
||||||
## How To
|
## How To
|
||||||
|
|
||||||
### Enchanting Setup
|
### Enchanting Setup
|
||||||
@ -178,6 +176,7 @@ end
|
|||||||
## Optional Dependencies
|
## Optional Dependencies
|
||||||
|
|
||||||
- xdecor (adjusts conflicting recipe)
|
- xdecor (adjusts conflicting recipe)
|
||||||
|
- item_drop (make sure fortune will execute before item_drop mod overrides `handle_node_drops`)
|
||||||
|
|
||||||
## License:
|
## License:
|
||||||
|
|
||||||
|
23
api.lua
23
api.lua
@ -309,9 +309,9 @@ end
|
|||||||
---Find element v of t satisfying f(v)
|
---Find element v of t satisfying f(v)
|
||||||
local function tableFind(t, f)
|
local function tableFind(t, f)
|
||||||
for _, v in ipairs(t) do
|
for _, v in ipairs(t) do
|
||||||
if f(v) then
|
if f(v) then
|
||||||
return v
|
return v
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -552,6 +552,23 @@ function XEnchanting.set_enchanted_tool(self, pos, itemstack, level, player_name
|
|||||||
stack_meta:set_int('is_enchanted', 1)
|
stack_meta:set_int('is_enchanted', 1)
|
||||||
stack_meta:set_string('x_enchanting', minetest.serialize(final_enchantments_meta))
|
stack_meta:set_string('x_enchanting', minetest.serialize(final_enchantments_meta))
|
||||||
|
|
||||||
|
|
||||||
|
if tool_def and tool_def.inventory_image and tool_def.inventory_image ~= '' then
|
||||||
|
stack_meta:set_string('inventory_image', tool_def.inventory_image .. '^((' .. tool_def.inventory_image .. '^[contrast:127:127)^[mask:x_enchanting_glint.png^[opacity:80)')
|
||||||
|
end
|
||||||
|
|
||||||
|
if tool_def and tool_def.inventory_overlay and tool_def.inventory_overlay ~= '' then
|
||||||
|
stack_meta:set_string('inventory_overlay', tool_def.inventory_overlay .. '^((' .. tool_def.inventory_overlay .. '^[contrast:127:127)^[mask:x_enchanting_glint.png^[opacity:80)')
|
||||||
|
end
|
||||||
|
|
||||||
|
if tool_def and tool_def.wield_image and tool_def.wield_image ~= '' then
|
||||||
|
stack_meta:set_string('wield_image', tool_def.wield_image .. '^((' .. tool_def.wield_image .. '^[contrast:127:127)^[mask:x_enchanting_glint.png^[opacity:80)')
|
||||||
|
end
|
||||||
|
|
||||||
|
if tool_def and tool_def.wield_overlay and tool_def.wield_overlay ~= '' then
|
||||||
|
stack_meta:set_string('wield_overlay', tool_def.wield_overlay .. '^((' .. tool_def.wield_overlay .. '^[contrast:127:127)^[mask:x_enchanting_glint.png^[opacity:80)')
|
||||||
|
end
|
||||||
|
|
||||||
inv:set_stack('item', 1, itemstack)
|
inv:set_stack('item', 1, itemstack)
|
||||||
|
|
||||||
local trade_stack = inv:get_stack('trade', 1)
|
local trade_stack = inv:get_stack('trade', 1)
|
||||||
|
2
mod.conf
2
mod.conf
@ -1,6 +1,6 @@
|
|||||||
name = x_enchanting
|
name = x_enchanting
|
||||||
description = Adds Enchanting Mechanics and API.
|
description = Adds Enchanting Mechanics and API.
|
||||||
depends =
|
depends =
|
||||||
optional_depends = xdecor
|
optional_depends = xdecor, item_drop
|
||||||
supported_games = minetest_game
|
supported_games = minetest_game
|
||||||
min_minetest_version = 5.4
|
min_minetest_version = 5.4
|
||||||
|
@ -31,6 +31,7 @@ minetest.register_node('x_enchanting:table', {
|
|||||||
drawtype = 'mesh',
|
drawtype = 'mesh',
|
||||||
mesh = 'x_enchanting_table.obj',
|
mesh = 'x_enchanting_table.obj',
|
||||||
tiles = { 'x_enchanting_table.png' },
|
tiles = { 'x_enchanting_table.png' },
|
||||||
|
use_texture_alpha = 'clip',
|
||||||
paramtype = 'light',
|
paramtype = 'light',
|
||||||
paramtype2 = 'facedir',
|
paramtype2 = 'facedir',
|
||||||
walkable = true,
|
walkable = true,
|
||||||
|
BIN
textures/x_enchanting_glint.png
Normal file
BIN
textures/x_enchanting_glint.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 365 B |
Reference in New Issue
Block a user