From 9f4cc443c537cb3f25a27b90bdfee0a2181661c5 Mon Sep 17 00:00:00 2001 From: Vanic Date: Sat, 11 Oct 2025 16:59:32 +0300 Subject: [PATCH] Create liquids mod --- mods/GAME/ITEMS/ItemsLoader/mod.conf | 2 +- mods/GAME/ITEMS/Liquids/init.lua | 94 ++++++++++++++++++ mods/GAME/ITEMS/Liquids/mod.conf | 2 + .../Liquids/textures/liquids_water_source.png | Bin 0 -> 4341 bytes 4 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 mods/GAME/ITEMS/Liquids/init.lua create mode 100644 mods/GAME/ITEMS/Liquids/mod.conf create mode 100644 mods/GAME/ITEMS/Liquids/textures/liquids_water_source.png 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 0000000000000000000000000000000000000000..34e15930db27ae8160231f1819db197238bd5325 GIT binary patch literal 4341 zcmbW3Pl%RP6vprO@#Q!Ug4rSv2}_6;5v{|>k&&4}MrvrG8!=k670d`hlnBC=tE8f> zTfwaaty{U)wTp70D~XYy?(e+c?{en$e$jZ~eeb>JJm)#jJ@v*U>C-?8G@7J#VdAkmi%iHUxCJ%pm_j+B-zF6H_E#=;=mA^iFrLK>CzOlVk z%GI|^x$$i&FRJUt@1heN~-H zUv6%lUixGCjlt2QgqZzeF;9vH?|=&e99h1AtWIAZi8lhl{T8gA z6Z1R>a%p8n22UgVNC*{m z#4NIlK#+-J>zvGdW;NxJgt5*Q`*ncoYt| zc~g){cAh>SR3xW+H<1uzL4XR9u&gNWHG(6rT?$Ngj~Ty+EG`m3l1A^BQP9klCx6t4RQu#GFjtt{wp8g+j`+AZ+|3BzS+9`NM z$QrY}ML!4N+9|N`e3^UinP=;p*_voF0Bn(>{v=-N|3Tiuu8%X7sgUmhKGr6w&~5!GU|)$o zV7VuQXLy5eH*u^QdqplLiSuyQSM)%T&OGL>=OU_YH<6@V#g0o(Ld54iGT!b%z5|fC zX0BP)HDf!4%+8z#BMH;z1;dBBb_$u@>SI0=86j<_(03fbn5m2y1=>wSP9L;UfSG4y z`l5+B**)iEz@7$k%y|2cgfs7%wU!IuL#fSt=goUR{qo@Z3-~urpIy6q>f$&50Hrb9 AE&u=k literal 0 HcmV?d00001