aboutsummaryrefslogtreecommitdiff
path: root/assets/blender/gleis/texturen/uv.png
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-11-27 10:41:22 +0100
committerorwell96 <orwell@bleipb.de>2019-12-04 10:09:19 +0100
commite0662b2971e7d138fafff4ad709829656c8782e0 (patch)
tree94d469338db6bef7001e9a8d8350ef39fee93f6e /assets/blender/gleis/texturen/uv.png
parent3db3f24857464e7b58234f3ae5ee3449961879df (diff)
downloadadvtrains-e0662b2971e7d138fafff4ad709829656c8782e0.tar.gz
advtrains-e0662b2971e7d138fafff4ad709829656c8782e0.tar.bz2
advtrains-e0662b2971e7d138fafff4ad709829656c8782e0.zip
use group:wood in bumper recipe (H#120)
Diffstat (limited to 'assets/blender/gleis/texturen/uv.png')
0 files changed, 0 insertions, 0 deletions
136' href='#n136'>136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
-- helper

core.register_async_dofile(core.get_modpath(core.get_current_modname()) ..
	DIR_DELIM .. "inside_async_env.lua")

local function deepequal(a, b)
	if type(a) == "function" then
		return type(b) == "function"
	elseif type(a) ~= "table" then
		return a == b
	elseif type(b) ~= "table" then
		return false
	end
	for k, v in pairs(a) do
		if not deepequal(v, b[k]) then
			return false
		end
	end
	for k, v in pairs(b) do
		if not deepequal(a[k], v) then
			return false
		end
	end
	return true
end

-- Object Passing / Serialization

local test_object = {
	name = "stairs:stair_glass",
	type = "node",
	groups = {oddly_breakable_by_hand = 3, cracky = 3, stair = 1},
	description = "Glass Stair",
	sounds = {
		dig = {name = "default_glass_footstep", gain = 0.5},
		footstep = {name = "default_glass_footstep", gain = 0.3},
		dug = {name = "default_break_glass", gain = 1}
	},
	node_box = {
		fixed = {
			{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
			{-0.5, 0, 0, 0.5, 0.5, 0.5}
		},
		type = "fixed"
	},
	tiles = {
		{name = "stairs_glass_split.png", backface_culling = true},
		{name = "default_glass.png", backface_culling = true},
		{name = "stairs_glass_stairside.png^[transformFX", backface_culling = true}
	},
	on_place = function(itemstack, placer)
		return core.is_player(placer)
	end,
	sunlight_propagates = true,
	is_ground_content = false,
	light_source = 0,
}

local function test_object_passing()
	local tmp = core.serialize_roundtrip(test_object)
	assert(deepequal(test_object, tmp))

	local circular_key = {"foo", "bar"}
	circular_key[circular_key] = true
	tmp = core.serialize_roundtrip(circular_key)
	assert(tmp[1] == "foo")
	assert(tmp[2] == "bar")
	assert(tmp[tmp] == true)

	local circular_value = {"foo"}
	circular_value[2] = circular_value
	tmp = core.serialize_roundtrip(circular_value)
	assert(tmp[1] == "foo")
	assert(tmp[2] == tmp)

	-- Two-segment cycle
	local cycle_seg_1, cycle_seg_2 = {}, {}
	cycle_seg_1[1] = cycle_seg_2
	cycle_seg_2[1] = cycle_seg_1
	tmp = core.serialize_roundtrip(cycle_seg_1)
	assert(tmp[1][1] == tmp)

	-- Duplicated value without a cycle
	local acyclic_dup_holder = {}