diff --git a/mods/GAME/ITEMS/ItemsLoader/mod.conf b/mods/GAME/ITEMS/ItemsLoader/mod.conf index 0b66164..977e487 100644 --- a/mods/GAME/ITEMS/ItemsLoader/mod.conf +++ b/mods/GAME/ITEMS/ItemsLoader/mod.conf @@ -1,3 +1,3 @@ name = smc__game__items__items_loader description = Include this mod in your `depends` to ensure all items are registered -depends = smc__game__items__rocks, smc__game__items__log, +depends = smc__game__items__rocks, smc__game__items__log, smc__game__items__soils, smc__game__items__liquids diff --git a/mods/GAME/ITEMS/Liquids/init.lua b/mods/GAME/ITEMS/Liquids/init.lua new file mode 100644 index 0000000..06be1b4 --- /dev/null +++ b/mods/GAME/ITEMS/Liquids/init.lua @@ -0,0 +1,94 @@ +---@type Node.NodeDefinition +local defaultLiquidDef = { + settings = { + name = '', + tiles = {}, + waving = 3, + use_texture_alpha = "blend", + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquid_viscosity = 1, + groups = {water = 3, liquid = 3,} + } +} + +---@type Node +local defaultLiquid = Core.Node.Class:getExtended(defaultLiquidDef) + +local liquidFactory = defaultLiquid:getFactory() + +liquidFactory:registerItems({ + ---@type Node.NodeDefinition + { + settings = { + name = "liquids:water_source", + drawtype = "liquid", + tiles = { + { + name = "liquids_water_source.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + }, + }, + { + name = "liquids_water_source.png", + backface_culling = true, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + }, + }, + }, + liquidtype = "source", + liquid_alternative_flowing = "liquids:water_flowing", + liquid_alternative_source = "liquids:water_source", + } + }, + + ---@type Node.NodeDefinition + { + settings = { + name = "liquids:water_flowing", + drawtype = "flowingliquid", + tiles = {"default_water.png"}, + special_tiles = { + { + name = "default_water_flowing_animated.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 0.5, + }, + }, + { + name = "default_water_flowing_animated.png", + backface_culling = true, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 0.5, + }, + }, + }, + liquidtype = "flowing", + liquid_alternative_flowing = "liquids:water_flowing", + liquid_alternative_source = "liquids:water_source", + paramtype2 = "flowingliquid", + } + } +}, false) \ No newline at end of file diff --git a/mods/GAME/ITEMS/Liquids/mod.conf b/mods/GAME/ITEMS/Liquids/mod.conf new file mode 100644 index 0000000..b6655cb --- /dev/null +++ b/mods/GAME/ITEMS/Liquids/mod.conf @@ -0,0 +1,2 @@ +name = smc__game__items__liquids +depends = smc__core__node \ No newline at end of file diff --git a/mods/GAME/ITEMS/Liquids/textures/liquids_water_source.png b/mods/GAME/ITEMS/Liquids/textures/liquids_water_source.png new file mode 100644 index 0000000..34e1593 Binary files /dev/null and b/mods/GAME/ITEMS/Liquids/textures/liquids_water_source.png differ