Remove experimental painting completely
|
@ -1 +0,0 @@
|
||||||
mcl_core?
|
|
|
@ -1 +0,0 @@
|
||||||
Decorative paintings which you can placed on walls.
|
|
|
@ -1,151 +0,0 @@
|
||||||
-- TODO: Move all textures to mcl_paintings when finished
|
|
||||||
|
|
||||||
-- Intllib
|
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP .. "/intllib.lua")
|
|
||||||
|
|
||||||
minetest.register_craftitem("mcl_paintings:painting", {
|
|
||||||
description = S("Painting"),
|
|
||||||
_doc_items_longdesc = S("Paintings are decorations which can be placed on walls. THIS ITEM IS INCOMPLETE."),
|
|
||||||
wield_image = "gemalde_node.png",
|
|
||||||
inventory_image = "gemalde_node.png",
|
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
|
||||||
if pointed_thing.type ~= "node" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local under = pointed_thing.under
|
|
||||||
local above = pointed_thing.above
|
|
||||||
|
|
||||||
-- Use pointed node's on_rightclick function first, if present
|
|
||||||
local node_under = minetest.get_node(under)
|
|
||||||
if placer and not placer:get_player_control().sneak then
|
|
||||||
if minetest.registered_nodes[node_under.name] and minetest.registered_nodes[node_under.name].on_rightclick then
|
|
||||||
return minetest.registered_nodes[node_under.name].on_rightclick(under, node_under, placer, itemstack) or itemstack
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Can only be placed on side
|
|
||||||
if under.y ~= above.y then
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
-- Can only be placed on solid nodes
|
|
||||||
if minetest.get_item_group(node_under.name, "solid") == 0 then
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Spawn painting and rotate
|
|
||||||
local painting = minetest.add_entity(above, "mcl_paintings:painting")
|
|
||||||
local yaw = minetest.dir_to_yaw(vector.direction(under, above))
|
|
||||||
painting:set_yaw(yaw)
|
|
||||||
|
|
||||||
if not minetest.settings:get_bool("creative_mode") then
|
|
||||||
itemstack:take_item()
|
|
||||||
end
|
|
||||||
return itemstack
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- List of painting IDs, indexed by size.
|
|
||||||
-- Outer index: Width in node lengths
|
|
||||||
-- Inner index: Height in node lengths
|
|
||||||
local paintings = {
|
|
||||||
[1] = {
|
|
||||||
[1] = { 1, 2, 3, 4, 5, 6, 7 }, -- 1×1
|
|
||||||
[2] = { 8, 9, 10, 11, 12 }, -- 1×2
|
|
||||||
},
|
|
||||||
[2] = {
|
|
||||||
[1] = { 13, 14}, -- 2×1
|
|
||||||
[2] = { 15, 16, 17, 18, 19, 20 }, -- 2×2
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
[4] = { 25, 26 }, -- 3×4
|
|
||||||
},
|
|
||||||
[4] = {
|
|
||||||
[2] = { 21 }, -- 4×2
|
|
||||||
[4] = { 22, 23, 24 }, -- 4×4
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Returns a random painting ID for the given size.
|
|
||||||
-- x: Width in node lenghts
|
|
||||||
-- y: Height in node lengths
|
|
||||||
local function select_painting(x, y)
|
|
||||||
if paintings[x] then
|
|
||||||
local pool = paintings[x][y]
|
|
||||||
if paintings[x][y] then
|
|
||||||
local p = math.random(1, #pool)
|
|
||||||
return p
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns the texture table for the given painting ID
|
|
||||||
local get_textures = function(painting_id)
|
|
||||||
return {
|
|
||||||
"gemalde_bg.png",
|
|
||||||
"gemalde_bg.png",
|
|
||||||
"gemalde_bg.png",
|
|
||||||
"gemalde_bg.png",
|
|
||||||
"gemalde_"..tostring(painting_id)..".png",
|
|
||||||
"gemalde_bg.png"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Painting entitty.
|
|
||||||
-- Can be killed.
|
|
||||||
-- Breaks and drops as item if punched.
|
|
||||||
--
|
|
||||||
minetest.register_entity("mcl_paintings:painting", {
|
|
||||||
physical = false,
|
|
||||||
collide_with_objects = true,
|
|
||||||
hp_max = 1,
|
|
||||||
-- TODO: Fix visual
|
|
||||||
visual = "cube",
|
|
||||||
visual_size = { x=1, y=1 },
|
|
||||||
textures = get_textures(1),
|
|
||||||
|
|
||||||
_painting = nil, -- Holds the current painting ID. Initially nil for random painting
|
|
||||||
|
|
||||||
get_staticdata = function(self)
|
|
||||||
local out = { _painting = self._painting }
|
|
||||||
return minetest.serialize(out)
|
|
||||||
end,
|
|
||||||
on_activate = function(self, staticdata)
|
|
||||||
if staticdata and staticdata ~= "" then
|
|
||||||
local inp = minetest.deserialize(staticdata)
|
|
||||||
self._painting = inp._painting
|
|
||||||
end
|
|
||||||
-- Initial spawn. Select random painting
|
|
||||||
if not self._painting then
|
|
||||||
self._painting = select_painting(1, 1)
|
|
||||||
end
|
|
||||||
self.object:set_properties({textures = get_textures(self._painting)})
|
|
||||||
end,
|
|
||||||
on_punch = function(self, puncher)
|
|
||||||
if not puncher or not puncher:is_player() or self._removed then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- Drop painting as item on ground
|
|
||||||
if not minetest.settings:get_bool("creative_mode") then
|
|
||||||
minetest.add_item(self.object:getpos(), "mcl_paintings:painting")
|
|
||||||
end
|
|
||||||
self._removed = true
|
|
||||||
self.object:remove()
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
--[[
|
|
||||||
-- TODO: Add crafting when this mod works better
|
|
||||||
if minetest.get_modpath("mcl_core") then
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "mcl_paintings:painting",
|
|
||||||
recipe = {
|
|
||||||
{"mcl_core:stick", "mcl_core:stick", "mcl_core:stick"},
|
|
||||||
{"mcl_core:stick", "group:wool", "mcl_core:stick"},
|
|
||||||
{"mcl_core:stick", "mcl_core:stick", "mcl_core:stick"},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
]]
|
|
|
@ -1,45 +0,0 @@
|
||||||
|
|
||||||
-- Fallback functions for when `intllib` is not installed.
|
|
||||||
-- Code released under Unlicense <http://unlicense.org>.
|
|
||||||
|
|
||||||
-- Get the latest version of this file at:
|
|
||||||
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
|
||||||
|
|
||||||
local function format(str, ...)
|
|
||||||
local args = { ... }
|
|
||||||
local function repl(escape, open, num, close)
|
|
||||||
if escape == "" then
|
|
||||||
local replacement = tostring(args[tonumber(num)])
|
|
||||||
if open == "" then
|
|
||||||
replacement = replacement..close
|
|
||||||
end
|
|
||||||
return replacement
|
|
||||||
else
|
|
||||||
return "@"..open..num..close
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
|
||||||
end
|
|
||||||
|
|
||||||
local gettext, ngettext
|
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
if intllib.make_gettext_pair then
|
|
||||||
-- New method using gettext.
|
|
||||||
gettext, ngettext = intllib.make_gettext_pair()
|
|
||||||
else
|
|
||||||
-- Old method using text files.
|
|
||||||
gettext = intllib.Getter()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Fill in missing functions.
|
|
||||||
|
|
||||||
gettext = gettext or function(msgid, ...)
|
|
||||||
return format(msgid, ...)
|
|
||||||
end
|
|
||||||
|
|
||||||
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
|
||||||
return format(n==1 and msgid or msgid_plural, ...)
|
|
||||||
end
|
|
||||||
|
|
||||||
return gettext, ngettext
|
|
|
@ -1 +0,0 @@
|
||||||
name = mcl_paintings
|
|
Before Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 330 B |
Before Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 468 B |
Before Width: | Height: | Size: 415 B |
Before Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 498 B |
Before Width: | Height: | Size: 230 B |
Before Width: | Height: | Size: 501 B |
Before Width: | Height: | Size: 687 B |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 362 B |
Before Width: | Height: | Size: 298 B |
Before Width: | Height: | Size: 205 B |
Before Width: | Height: | Size: 229 B |
|
@ -8,6 +8,5 @@ mcl_chests
|
||||||
mcl_observers
|
mcl_observers
|
||||||
doc_identifier
|
doc_identifier
|
||||||
mobs_mc
|
mobs_mc
|
||||||
mcl_paintings
|
|
||||||
mcl_comparators
|
mcl_comparators
|
||||||
mcl_minecarts
|
mcl_minecarts
|
||||||
|
|
|
@ -11,7 +11,6 @@ local wip_items = {
|
||||||
"mcl_observers:observer_on",
|
"mcl_observers:observer_on",
|
||||||
"mcl_chests:trapped_chest",
|
"mcl_chests:trapped_chest",
|
||||||
"mobs_mc:totem",
|
"mobs_mc:totem",
|
||||||
"mcl_paintings:painting",
|
|
||||||
"mcl_comparators:comparator_off_comp",
|
"mcl_comparators:comparator_off_comp",
|
||||||
"mcl_minecarts:hopper_minecart",
|
"mcl_minecarts:hopper_minecart",
|
||||||
"mcl_minecarts:command_block_minecart",
|
"mcl_minecarts:command_block_minecart",
|
||||||
|
|
|
@ -11,7 +11,6 @@ Source path,Source file,Target path,Target file,xs,ys,xl,yl,xt,yt,Blacklisted?
|
||||||
/assets/minecraft/textures/items,bucket_water.png,/mods/ITEMS/mcl_buckets/textures,bucket_water.png,,,,,,,
|
/assets/minecraft/textures/items,bucket_water.png,/mods/ITEMS/mcl_buckets/textures,bucket_water.png,,,,,,,
|
||||||
/assets/minecraft/textures/items,bucket_water.png,/mods/ITEMS/mcl_buckets/textures,bucket_river_water.png,,,,,,,
|
/assets/minecraft/textures/items,bucket_water.png,/mods/ITEMS/mcl_buckets/textures,bucket_river_water.png,,,,,,,
|
||||||
/assets/minecraft/textures/items,bucket_lava.png,/mods/ITEMS/mcl_buckets/textures,bucket_lava.png,,,,,,,
|
/assets/minecraft/textures/items,bucket_lava.png,/mods/ITEMS/mcl_buckets/textures,bucket_lava.png,,,,,,,
|
||||||
/assets/minecraft/textures/items,painting.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_node.png,,,,,,,
|
|
||||||
/assets/minecraft/textures/items,item_frame.png,/mods/ITEMS/itemframes/textures,itemframes_frame.png,,,,,,,
|
/assets/minecraft/textures/items,item_frame.png,/mods/ITEMS/itemframes/textures,itemframes_frame.png,,,,,,,
|
||||||
/assets/minecraft/textures/blocks,anvil_base.png,/mods/ITEMS/mcl_anvils/textures,mcl_anvils_anvil_base.png,,,,,,,
|
/assets/minecraft/textures/blocks,anvil_base.png,/mods/ITEMS/mcl_anvils/textures,mcl_anvils_anvil_base.png,,,,,,,
|
||||||
/assets/minecraft/textures/blocks,anvil_top_damaged_0.png,/mods/ITEMS/mcl_anvils/textures,mcl_anvils_anvil_top_damaged_0.png,,,,,,,
|
/assets/minecraft/textures/blocks,anvil_top_damaged_0.png,/mods/ITEMS/mcl_anvils/textures,mcl_anvils_anvil_top_damaged_0.png,,,,,,,
|
||||||
|
@ -870,32 +869,6 @@ Source path,Source file,Target path,Target file,xs,ys,xl,yl,xt,yt,Blacklisted?
|
||||||
/assets/minecraft/textures/blocks,fence_gate_oak.png,/mods/ITEMS/mcl_fences/textures,mcl_fences_fence_gate_oak.png,,,,,,,
|
/assets/minecraft/textures/blocks,fence_gate_oak.png,/mods/ITEMS/mcl_fences/textures,mcl_fences_fence_gate_oak.png,,,,,,,
|
||||||
/assets/minecraft/textures/blocks,fence_gate_spruce.png,/mods/ITEMS/mcl_fences/textures,mcl_fences_fence_gate_spruce.png,,,,,,,
|
/assets/minecraft/textures/blocks,fence_gate_spruce.png,/mods/ITEMS/mcl_fences/textures,mcl_fences_fence_gate_spruce.png,,,,,,,
|
||||||
/assets/minecraft/textures/entity,sign.png,/mods/ITEMS/mcl_signs/textures,mcl_signs_sign.png,,,,,,,
|
/assets/minecraft/textures/entity,sign.png,/mods/ITEMS/mcl_signs/textures,mcl_signs_sign.png,,,,,,,
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_1.png,0,0,16,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_2.png,16,0,16,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_3.png,32,0,16,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_4.png,48,0,16,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_5.png,64,0,16,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_6.png,80,0,16,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_7.png,96,0,16,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_8.png,0,32,32,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_9.png,32,32,32,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_10.png,64,32,32,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_11.png,96,32,32,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_12.png,128,32,32,16,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_13.png,0,64,16,32,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_14.png,16,64,16,32,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_15.png,0,128,32,32,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_16.png,32,128,32,32,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_17.png,64,128,32,32,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_18.png,96,128,32,32,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_19.png,128,128,32,32,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_20.png,160,128,32,32,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_21.png,0,96,64,32,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_22.png,0,192,64,64,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_23.png,64,192,64,64,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_24.png,128,192,64,64,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_25.png,192,64,64,48,0,0,y
|
|
||||||
/assets/minecraft/textures/painting,paintings_kristoffer_zetterstrand.png,/mods/ENTITIES/mcl_paintings/textures,gemalde_26.png,192,112,64,48,0,0,y
|
|
||||||
/assets/minecraft/textures/entity,banner_base.png,/mods/ITEMS/mcl_banners/textures,mcl_banners_banner_base.png,,,,,,,
|
/assets/minecraft/textures/entity,banner_base.png,/mods/ITEMS/mcl_banners/textures,mcl_banners_banner_base.png,,,,,,,
|
||||||
/assets/minecraft/textures/entity/banner,base.png,/mods/ITEMS/mcl_banners/textures,mcl_banners_base.png,,,,,,,
|
/assets/minecraft/textures/entity/banner,base.png,/mods/ITEMS/mcl_banners/textures,mcl_banners_base.png,,,,,,,
|
||||||
/assets/minecraft/textures/items,banner_base.png,/mods/ITEMS/mcl_banners/textures,mcl_banners_item_base.png,,,,,,,
|
/assets/minecraft/textures/items,banner_base.png,/mods/ITEMS/mcl_banners/textures,mcl_banners_item_base.png,,,,,,,
|
||||||
|
|
|