Compare commits
	
		
			6 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 4d20404380 | ||
|  | 1011023d6c | ||
|  | f341d63b01 | ||
|  | ef92eceeb6 | ||
|  | 4ef1892dbe | ||
|  | c227ceb798 | 
							
								
								
									
										10
									
								
								.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@master | ||||
|       - name: Luacheck | ||||
|         uses: lunarmodules/luacheck@master | ||||
							
								
								
									
										9
									
								
								.luacheckrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,9 @@ | ||||
| read_globals = { | ||||
| 	"minetest", | ||||
| 	"unifieddyes", | ||||
| 	"default" | ||||
| } | ||||
|  | ||||
| globals = { | ||||
| 	"unifiedbricks" | ||||
| } | ||||
| @@ -1,4 +0,0 @@ | ||||
| default | ||||
| bucket | ||||
| unifieddyes | ||||
| vessels | ||||
| @@ -1 +0,0 @@ | ||||
| This mod allows the user to re-color default bricks using Unified Dyes, and provides some pattern variations as well. | ||||
							
								
								
									
										153
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						| @@ -16,7 +16,7 @@ minetest.register_alias("unifieddyes:lightgrey","unifieddyes:lightgrey_paint") | ||||
| minetest.register_alias("unifieddyes:grey","unifieddyes:grey_paint") | ||||
| minetest.register_alias("unifieddyes:darkgrey","unifieddyes:darkgrey_paint") | ||||
|  | ||||
| HUES = { | ||||
| local HUES = { | ||||
| 	"red", | ||||
| 	"orange", | ||||
| 	"yellow", | ||||
| @@ -35,25 +35,18 @@ HUES = { | ||||
| 	"lightgrey", | ||||
| 	"white" | ||||
| } | ||||
| TYPES = { | ||||
| 	"clayblock_", | ||||
| 	"clay_", | ||||
| 	"brick_", | ||||
| 	"brickblock_", | ||||
| 	"multicolor_" | ||||
| } | ||||
| SATURATION = { | ||||
| local SATURATION = { | ||||
| 	"_s50", | ||||
| 	"" | ||||
| } | ||||
| DARKNESS = { | ||||
| local DARKNESS = { | ||||
| 	"dark_", | ||||
| 	"medium_", | ||||
| 	"", | ||||
| 	"light_" | ||||
| } | ||||
| --formal versions | ||||
| FORMALHUES = { | ||||
| local FORMALHUES = { | ||||
| 	"Red", | ||||
| 	"Orange", | ||||
| 	"Yellow", | ||||
| @@ -72,18 +65,11 @@ FORMALHUES = { | ||||
| 	"Light grey", | ||||
| 	"White" | ||||
| } | ||||
| FORMALTYPES = { | ||||
| 	" clay", | ||||
| 	" clay lump", | ||||
| 	" brick", | ||||
| 	" bricks", | ||||
| 	" multicolor bricks" | ||||
| } | ||||
| FORMALSATURATION = { | ||||
| local FORMALSATURATION = { | ||||
| 	" (low saturation)", | ||||
| 	"" | ||||
| } | ||||
| FORMALDARKNESS = { | ||||
| local FORMALDARKNESS = { | ||||
| 	"Dark ", | ||||
| 	"Medium ", | ||||
| 	"Bright ", | ||||
| @@ -103,21 +89,17 @@ minetest.register_node("unifiedbricks:brickblock", { | ||||
| 	paramtype = "light", | ||||
| 	paramtype2 = "color", | ||||
| 	palette = "unifieddyes_palette_extended.png", | ||||
| 	place_param2 = 240, | ||||
| 	is_ground_content = true, | ||||
| 	is_ground_content = false, | ||||
| 	groups = {cracky=3, not_in_creative_inventory=1, ud_param2_colorable = 1}, | ||||
| 	sounds = default.node_sound_stone_defaults(), | ||||
| 	on_construct = unifieddyes.on_construct, | ||||
| 	after_place_node = unifieddyes.recolor_on_place, | ||||
| 	after_dig_node = unifieddyes.after_dig_node, | ||||
| 	drop = "default:brick" | ||||
| 	on_dig = unifieddyes.on_dig, | ||||
| }) | ||||
|  | ||||
| minetest.override_item("default:brick", { | ||||
| 	ud_replacement_node = "unifiedbricks:brickblock", | ||||
| 	palette = "unifieddyes_palette_extended.png", | ||||
| 	airbrush_replacement_node = "unifiedbricks:brickblock", | ||||
| 	groups = {cracky = 3, ud_param2_colorable = 1}, | ||||
| 	after_place_node = unifieddyes.recolor_on_place | ||||
| }) | ||||
|  | ||||
| minetest.register_node("unifiedbricks:clayblock", { | ||||
| @@ -127,23 +109,19 @@ minetest.register_node("unifiedbricks:clayblock", { | ||||
| 	}, | ||||
| 	paramtype2 = "color", | ||||
| 	palette = "unifieddyes_palette_extended.png", | ||||
| 	place_param2 = 240, | ||||
| 	is_ground_content = true, | ||||
| 	is_ground_content = false, | ||||
| 	groups = {crumbly=3, not_in_creative_inventory=1, ud_param2_colorable = 1}, | ||||
| 		sounds = default.node_sound_dirt_defaults({ | ||||
| 			footstep = "", | ||||
| 		}), | ||||
| 	on_construct = unifieddyes.on_construct, | ||||
| 	after_place_node = unifieddyes.recolor_on_place, | ||||
| 	after_dig_node = unifieddyes.after_dig_node, | ||||
| 	drop = "default:clay" | ||||
| 	on_dig = unifieddyes.on_dig, | ||||
| }) | ||||
|  | ||||
| minetest.override_item("default:clay", { | ||||
| 	ud_replacement_node = "unifiedbricks:clayblock", | ||||
| 	palette = "unifieddyes_palette_extended.png", | ||||
| 	airbrush_replacement_node = "unifiedbricks:clayblock", | ||||
| 	groups = {crumbly = 3, ud_param2_colorable = 1}, | ||||
| 	after_place_node = unifieddyes.recolor_on_place, | ||||
| }) | ||||
|  | ||||
| minetest.register_node("unifiedbricks:brickblock_multicolor_dark", { | ||||
| @@ -152,19 +130,16 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_dark", { | ||||
| 		"unifiedbricks_brickblock_multicolor_dark.png", | ||||
| 	}, | ||||
| 	overlay_tiles = { | ||||
| 		{ name = "unifiedbricks_mortar2.png", color = "white" } | ||||
| 		{ name = "unifiedbricks_mortar.png", color = "white" } | ||||
| 	}, | ||||
| 	paramtype = "light", | ||||
| 	paramtype2 = "color", | ||||
| 	palette = "unifieddyes_palette_extended.png", | ||||
| 	place_param2 = 240, | ||||
| 	is_ground_content = true, | ||||
| 	is_ground_content = false, | ||||
| 	groups = {cracky=3, ud_param2_colorable = 1}, | ||||
| 	sounds = default.node_sound_stone_defaults(), | ||||
| 	on_construct = unifieddyes.on_construct, | ||||
| 	after_place_node = unifieddyes.recolor_on_place, | ||||
| 	after_dig_node = unifieddyes.after_dig_node, | ||||
| 	drop = "unifiedbricks:brickblock_multicolor_dark" | ||||
| 	on_dig = unifieddyes.on_dig, | ||||
| }) | ||||
|  | ||||
| minetest.register_node("unifiedbricks:brickblock_multicolor_medium", { | ||||
| @@ -173,19 +148,16 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_medium", { | ||||
| 		"unifiedbricks_brickblock_multicolor_medium.png" | ||||
| 	}, | ||||
| 	overlay_tiles = { | ||||
| 		{ name = "unifiedbricks_mortar3.png", color = "white" } | ||||
| 		{ name = "unifiedbricks_mortar.png", color = "white" } | ||||
| 	}, | ||||
| 	paramtype = "light", | ||||
| 	paramtype2 = "color", | ||||
| 	palette = "unifieddyes_palette_extended.png", | ||||
| 	place_param2 = 240, | ||||
| 	is_ground_content = true, | ||||
| 	is_ground_content = false, | ||||
| 	groups = {cracky=3, ud_param2_colorable = 1}, | ||||
| 	sounds = default.node_sound_stone_defaults(), | ||||
| 	on_construct = unifieddyes.on_construct, | ||||
| 	after_place_node = unifieddyes.recolor_on_place, | ||||
| 	after_dig_node = unifieddyes.after_dig_node, | ||||
| 	drop = "unifiedbricks:brickblock_multicolor_medium" | ||||
| 	on_dig = unifieddyes.on_dig, | ||||
| }) | ||||
|  | ||||
| minetest.register_node("unifiedbricks:brickblock_multicolor_light", { | ||||
| @@ -194,19 +166,16 @@ minetest.register_node("unifiedbricks:brickblock_multicolor_light", { | ||||
| 		"unifiedbricks_brickblock_multicolor_light.png" | ||||
| 	}, | ||||
| 	overlay_tiles = { | ||||
| 		{ name = "unifiedbricks_mortar4.png", color = "white" } | ||||
| 		{ name = "unifiedbricks_mortar.png", color = "white" } | ||||
| 	}, | ||||
| 	paramtype = "light", | ||||
| 	paramtype2 = "color", | ||||
| 	palette = "unifieddyes_palette_extended.png", | ||||
| 	place_param2 = 240, | ||||
| 	is_ground_content = true, | ||||
| 	is_ground_content = false, | ||||
| 	groups = {cracky=3, ud_param2_colorable = 1}, | ||||
| 	sounds = default.node_sound_stone_defaults(), | ||||
| 	on_construct = unifieddyes.on_construct, | ||||
| 	after_place_node = unifieddyes.recolor_on_place, | ||||
| 	after_dig_node = unifieddyes.after_dig_node, | ||||
| 	drop ="unifiedbricks:brickblock_multicolor_light" | ||||
| 	on_dig = unifieddyes.on_dig, | ||||
| }) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| @@ -242,6 +211,61 @@ minetest.register_craft( { | ||||
| 	}, | ||||
| }) | ||||
|  | ||||
| unifieddyes.register_color_craft({ | ||||
| 	output = "unifiedbricks:brickblock", | ||||
| 	palette = "extended", | ||||
| 	neutral_node = "default:brick", | ||||
| 	type = "shapeless", | ||||
| 	recipe = { | ||||
| 		"NEUTRAL_NODE", | ||||
| 		"MAIN_DYE" | ||||
| 	} | ||||
| }) | ||||
|  | ||||
| unifieddyes.register_color_craft({ | ||||
| 	output = "unifiedbricks:clayblock", | ||||
| 	palette = "extended", | ||||
| 	neutral_node = "default:clay", | ||||
| 	type = "shapeless", | ||||
| 	recipe = { | ||||
| 		"NEUTRAL_NODE", | ||||
| 		"MAIN_DYE" | ||||
| 	} | ||||
| }) | ||||
|  | ||||
| unifieddyes.register_color_craft({ | ||||
| 	output = "unifiedbricks:brickblock_multicolor_dark", | ||||
| 	palette = "extended", | ||||
| 	neutral_node = "unifiedbricks:brickblock_multicolor_dark", | ||||
| 	type = "shapeless", | ||||
| 	recipe = { | ||||
| 		"NEUTRAL_NODE", | ||||
| 		"MAIN_DYE" | ||||
| 	} | ||||
| }) | ||||
|  | ||||
| unifieddyes.register_color_craft({ | ||||
| 	output = "unifiedbricks:brickblock_multicolor_medium", | ||||
| 	palette = "extended", | ||||
| 	neutral_node = "unifiedbricks:brickblock_multicolor_medium", | ||||
| 	type = "shapeless", | ||||
| 	recipe = { | ||||
| 		"NEUTRAL_NODE", | ||||
| 		"MAIN_DYE" | ||||
| 	} | ||||
| }) | ||||
|  | ||||
| unifieddyes.register_color_craft({ | ||||
| 	output = "unifiedbricks:brickblock_multicolor_light", | ||||
| 	palette = "extended", | ||||
| 	neutral_node = "unifiedbricks:brickblock_multicolor_light", | ||||
| 	type = "shapeless", | ||||
| 	recipe = { | ||||
| 		"NEUTRAL_NODE", | ||||
| 		"MAIN_DYE" | ||||
| 	} | ||||
| }) | ||||
|  | ||||
| -- static nodes | ||||
|  | ||||
| unifiedbricks.register_old_static_block = function(name, formalname, blocktype) | ||||
| @@ -263,8 +287,8 @@ table.insert(unifiedbricks.old_static_list, "unifiedbricks:multicolor_lightgrey" | ||||
| for i = 1,17 do | ||||
| 	for j = 1,4 do | ||||
| 		if i > 12 then | ||||
| 			formalname = FORMALHUES[i] | ||||
| 			name = HUES[i] | ||||
| 			local formalname = FORMALHUES[i] | ||||
| 			local name = HUES[i] | ||||
| 			if j == 1 then | ||||
| 				unifiedbricks.register_old_static_block(name, formalname, "clayblock") | ||||
| 			elseif j == 4 then | ||||
| @@ -272,6 +296,7 @@ for i = 1,17 do | ||||
| 			end | ||||
| 		else | ||||
| 			for k = 1,4 do | ||||
| 				local formalname, name | ||||
| 				if k == 4 then | ||||
| 					formalname = FORMALDARKNESS[k] .. FORMALHUES[i] | ||||
| 					name = DARKNESS[k] .. HUES[i] | ||||
| @@ -346,24 +371,4 @@ minetest.register_lbm({ | ||||
| 	end | ||||
| }) | ||||
|  | ||||
| minetest.register_lbm({ | ||||
| 	name = "unifiedbricks:recolor_bricks", | ||||
| 	label = "Convert 89-color bricks to use UD extended palette", | ||||
| 	run_at_every_load = false, | ||||
| 	nodenames = { | ||||
| 		"unifiedbricks:clayblock", | ||||
| 		"unifiedbricks:brickblock", | ||||
| 		"unifiedbricks:brickblock_multicolor_dark", | ||||
| 		"unifiedbricks:brickblock_multicolor_medium", | ||||
| 		"unifiedbricks:brickblock_multicolor_light", | ||||
| 	}, | ||||
| 	action = function(pos, node) | ||||
| 		local meta = minetest.get_meta(pos) | ||||
| 		if meta:get_string("palette") ~= "ext" then | ||||
| 			minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] }) | ||||
| 			meta:set_string("palette", "ext") | ||||
| 		end | ||||
| 	end | ||||
| }) | ||||
|  | ||||
| print("[UnifiedBricks] Loaded!") | ||||
|   | ||||
							
								
								
									
										2
									
								
								mod.conf
									
									
									
									
									
								
							
							
						
						| @@ -1 +1,3 @@ | ||||
| name = unifiedbricks | ||||
| description = This mod allows the user to re-color default bricks using Unified Dyes, and provides some pattern variations as well. | ||||
| depends = default, bucket, unifieddyes, vessels | ||||
|   | ||||
| Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 110 B | 
| Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 264 B | 
| Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 170 B | 
| Before Width: | Height: | Size: 247 B | 
| Before Width: | Height: | Size: 247 B | 
| Before Width: | Height: | Size: 247 B |