summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extranodes/init.lua1
-rw-r--r--extranodes/plastic_block.lua27
-rw-r--r--extranodes/textures/technic_plastic_blocks.pngbin0 -> 222 bytes
-rw-r--r--extranodes/textures/technic_plastic_bricks.pngbin0 -> 263 bytes
-rw-r--r--extranodes/textures/technic_plastic_cross.pngbin0 -> 329 bytes
-rw-r--r--extranodes/textures/technic_plastic_siding.pngbin0 -> 193 bytes
-rw-r--r--extranodes/textures/technic_plastic_siding_2.pngbin0 -> 195 bytes
-rw-r--r--extranodes/textures/technic_plastic_siding_3.pngbin0 -> 187 bytes
-rw-r--r--extranodes/textures/technic_plastic_tiles.pngbin0 -> 315 bytes
-rw-r--r--extranodes/textures/technic_plastic_waves.pngbin0 -> 242 bytes
-rw-r--r--technic/tools/spray_painter.lua30
11 files changed, 58 insertions, 0 deletions
diff --git a/extranodes/init.lua b/extranodes/init.lua
index edaa41a..d986b6e 100644
--- a/extranodes/init.lua
+++ b/extranodes/init.lua
@@ -10,6 +10,7 @@ dofile(path.."/trampoline.lua")
dofile(path.."/extratubes.lua")
dofile(path.."/extramesecons.lua")
dofile(path.."/lox.lua")
+dofile(path.."/plastic_block.lua")
if minetest.get_modpath("ethereal") and minetest.get_modpath("flowers") then
dofile(path.."/antishroom.lua")
diff --git a/extranodes/plastic_block.lua b/extranodes/plastic_block.lua
new file mode 100644
index 0000000..d426c26
--- /dev/null
+++ b/extranodes/plastic_block.lua
@@ -0,0 +1,27 @@
+local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
+
+local plastic_nodes = {
+ {node = "plastic_siding", name = S("Plastic Siding"), tiles = {"technic_plastic_siding.png"}},
+ {node = "plastic_siding_2", name = S("Plastic Siding 2"), tiles = {"technic_plastic_siding_2.png"}},
+ {node = "plastic_siding_3", name = S("Plastic Siding 3"), tiles = {"technic_plastic_siding_3.png"}},
+ {node = "plastic_bricks", name = S("Plastic Bricks"), tiles = {"technic_plastic_bricks.png"}},
+ {node = "plastic_blocks", name = S("Plastic Blocks"), tiles = {"technic_plastic_blocks.png"}},
+ {node = "plastic_cross", name = S("Plastic Cross"), tiles = {"technic_plastic_cross.png"}},
+ {node = "plastic_waves", name = S("Plastic Waves"), tiles = {"technic_plastic_waves.png"}},
+ {node = "plastic_tiles", name = S("Plastic Tiles"), tiles = {"technic_plastic_tiles.png"}},
+}
+
+for _,n in pairs(plastic_nodes) do
+
+ minetest.register_node (":technic:" .. n.node, {
+ description = n.name,
+ drawtype = "normal",
+ tiles = n.tiles,
+ drop = "technic:plastic_siding",
+ groups = {dig_immediate = 2, paintable_plastic_block = 1},
+ paramtype = "light",
+ paramtype2 = "colorwallmounted",
+ palette = "technic_paint_palette.png",
+ })
+
+end
diff --git a/extranodes/textures/technic_plastic_blocks.png b/extranodes/textures/technic_plastic_blocks.png
new file mode 100644
index 0000000..7a7bc6c
--- /dev/null
+++ b/extranodes/textures/technic_plastic_blocks.png
Binary files differ
diff --git a/extranodes/textures/technic_plastic_bricks.png b/extranodes/textures/technic_plastic_bricks.png
new file mode 100644
index 0000000..79d082a
--- /dev/null
+++ b/extranodes/textures/technic_plastic_bricks.png
Binary files differ
diff --git a/extranodes/textures/technic_plastic_cross.png b/extranodes/textures/technic_plastic_cross.png
new file mode 100644
index 0000000..3257d2f
--- /dev/null
+++ b/extranodes/textures/technic_plastic_cross.png
Binary files differ
diff --git a/extranodes/textures/technic_plastic_siding.png b/extranodes/textures/technic_plastic_siding.png
new file mode 100644
index 0000000..464c94c
--- /dev/null
+++ b/extranodes/textures/technic_plastic_siding.png
Binary files differ
diff --git a/extranodes/textures/technic_plastic_siding_2.png b/extranodes/textures/technic_plastic_siding_2.png
new file mode 100644
index 0000000..4e81797
--- /dev/null
+++ b/extranodes/textures/technic_plastic_siding_2.png
Binary files differ
diff --git a/extranodes/textures/technic_plastic_siding_3.png b/extranodes/textures/technic_plastic_siding_3.png
new file mode 100644
index 0000000..081ae9c
--- /dev/null
+++ b/extranodes/textures/technic_plastic_siding_3.png
Binary files differ
diff --git a/extranodes/textures/technic_plastic_tiles.png b/extranodes/textures/technic_plastic_tiles.png
new file mode 100644
index 0000000..e4aed57
--- /dev/null
+++ b/extranodes/textures/technic_plastic_tiles.png
Binary files differ
diff --git a/extranodes/textures/technic_plastic_waves.png b/extranodes/textures/technic_plastic_waves.png
new file mode 100644
index 0000000..c71e52c
--- /dev/null
+++ b/extranodes/textures/technic_plastic_waves.png
Binary files differ
diff --git a/technic/tools/spray_painter.lua b/technic/tools/spray_painter.lua
index 1fa9c5a..116d971 100644
--- a/technic/tools/spray_painter.lua
+++ b/technic/tools/spray_painter.lua
@@ -127,6 +127,36 @@ local function spray_paint(itemstack, user, pointed_thing, ptype)
local target = minetest.get_node_or_nil(pointed_thing.under)
+ -- if pointing at plastic blocks
+
+ if target and minetest.get_item_group(target.name, "paintable_plastic_block") > 0 then
+
+ local p2 = target.param2
+ local orientation = p2 % 8
+ local cindex = (p2 - orientation) / 8
+ local new_cindex = cindex + 1
+ if new_cindex < color_modes[meta.mode].index - 1 then
+ new_cindex = color_modes[meta.mode].index - 1
+ end
+ if new_cindex > color_modes[meta.mode].index + (color_modes[meta.mode].n - 1) - 1 then
+ new_cindex = color_modes[meta.mode].index - 1
+ end
+
+ minetest.swap_node(pointed_thing.under, {
+ name = target.name,
+ param2 = new_cindex*8 + orientation
+ })
+
+ if not technic.creative_mode then
+ meta.charge = meta.charge - spray_painter_cpa
+ technic.set_RE_wear(itemstack, meta.charge, spray_painter_max_charge)
+ itemstack:set_metadata(minetest.serialize(meta))
+ end
+
+
+ return itemstack
+ end
+
-- if the tool is pointed at a layer of paint -> cycling colors