From 5df7c4dc59525266dfcaac65a81f4305ff64e626 Mon Sep 17 00:00:00 2001 From: Looki2000 Date: Sat, 4 Feb 2023 17:52:56 +0100 Subject: [PATCH 1/3] I spent over an hour moving player hotbar in i3 inventory to the bottom. --- mods/i3/src/gui.lua | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/mods/i3/src/gui.lua b/mods/i3/src/gui.lua index 365e6c6..83056f0 100644 --- a/mods/i3/src/gui.lua +++ b/mods/i3/src/gui.lua @@ -135,19 +135,35 @@ local function get_inv_slots(data, fs) local spacing = legacy_inventory and 0.25 or 0.1 local size = 1 + -- for hotbar on the bottom + local inv_hitbar_y = inv_y + (legacy_inventory and 3.75 or 3.45 - spacing) + fs"style_type[box;colors=#77777710,#77777710,#777,#777]" for i = 0, hotbar_len - 1 do - box(i * size + inv_x + (i * spacing), inv_y, size, size, "") + --box(i * size + inv_x + (i * spacing), inv_y, size, size, "") + + -- for hotbar on the bottom + box(i * size + inv_x + (i * spacing), inv_hitbar_y, size, size, "") end fs("style_type[list;size=%f;spacing=%f]", size, spacing) - fs("list[current_player;main;%f,%f;%u,1;]", inv_x, inv_y, hotbar_len) + + -- inventory grid + --fs("list[current_player;main;%f,%f;%u,%u;%u]", inv_x, inv_y + (legacy_inventory and 1.25 or 1.15), hotbar_len, data.inv_size / hotbar_len, hotbar_len) + + -- inventory grid on the top + fs("list[current_player;main;%f,%f;%u,%u;%u]", inv_x, inv_y, hotbar_len, data.inv_size / hotbar_len, hotbar_len) + + fs("style_type[list;size=%f;spacing=%f,%f]", size, spacing, legacy_inventory and 0.15 or spacing) - fs("list[current_player;main;%f,%f;%u,%u;%u]", inv_x, inv_y + (legacy_inventory and 1.25 or 1.15), - hotbar_len, data.inv_size / hotbar_len, hotbar_len) + -- hotbar + --fs("list[current_player;main;%f,%f;%u,1;]", inv_x, inv_y, hotbar_len) + + -- hotbar on the bottom of the inventory grid + fs("list[current_player;main;%f,%f;%u,1;]", inv_x, inv_hitbar_y, hotbar_len) fs"style_type[list;size=1;spacing=0.15]" fs"listring[current_player;craft]listring[current_player;main]" From a601906435ea38f8e65d9a7f96dafe464311a113 Mon Sep 17 00:00:00 2001 From: Looki2000 Date: Sat, 4 Feb 2023 21:23:55 +0100 Subject: [PATCH 2/3] removed water source from player creative inventory --- mods/amogus_blocks/init.lua | 2 +- mods/amogus_generator/init.lua | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mods/amogus_blocks/init.lua b/mods/amogus_blocks/init.lua index f39d73e..a061d36 100644 --- a/mods/amogus_blocks/init.lua +++ b/mods/amogus_blocks/init.lua @@ -295,7 +295,7 @@ minetest.register_node("amogus_blocks:water_source", { liquid_alternative_source = "amogus_blocks:water_source", liquid_viscosity = 1, post_effect_color = {a = 103, r = 30, g = 60, b = 90}, - groups = {water = 3, liquid = 3, cools_lava = 1} + groups = {water = 3, liquid = 3, cools_lava = 1, not_in_creative_inventory = 1}, }) minetest.register_node("amogus_blocks:water_flowing", { diff --git a/mods/amogus_generator/init.lua b/mods/amogus_generator/init.lua index 40fe4d9..1beeea1 100644 --- a/mods/amogus_generator/init.lua +++ b/mods/amogus_generator/init.lua @@ -69,7 +69,9 @@ minetest.register_ore({ clust_size = 1, y_max = 31000, y_min = -31000, -})minetest.register_ore({ +}) + +minetest.register_ore({ ore_type = "scatter", ore = "amogus_blocks:gold_ore", wherein = "amogus_blocks:stone", @@ -78,7 +80,9 @@ minetest.register_ore({ clust_size = 1, y_max = 31000, y_min = -31000, -})minetest.register_ore({ +}) + +minetest.register_ore({ ore_type = "scatter", ore = "amogus_blocks:obsusian", wherein = "amogus_blocks:stone", @@ -87,7 +91,9 @@ minetest.register_ore({ clust_size = 1, y_max = 31000, y_min = -31000, -})minetest.register_ore({ +}) + +minetest.register_ore({ ore_type = "scatter", ore = "amogus_blocks:iron_ore", wherein = "amogus_blocks:stone", @@ -531,6 +537,8 @@ minetest.register_decoration({ schematic = "/schematics/STATUE_GIANT.mts", }) + +-- wtf is this?? --minetest.register_on_generated(function(minp, maxp, seed) -- for x = minp.x, maxp.x do -- for y = minp.y, maxp.y do From 4ff9fe733b9934938b552e56c593ab461fefabd5 Mon Sep 17 00:00:00 2001 From: Looki2000 Date: Sun, 5 Feb 2023 02:17:27 +0100 Subject: [PATCH 3/3] added sussy imposter shaped water bucket and empty bucket with sussy random names --- mods/amogus_blocks/init.lua | 68 +----- mods/amogus_general/init.lua | 8 +- mods/amogus_items/init.lua | 251 ++++++++++++++++++++ mods/amogus_items/textures/empty_bucket.png | Bin 0 -> 754 bytes mods/amogus_items/textures/water_bucket.png | Bin 0 -> 777 bytes 5 files changed, 256 insertions(+), 71 deletions(-) create mode 100644 mods/amogus_items/textures/empty_bucket.png create mode 100644 mods/amogus_items/textures/water_bucket.png diff --git a/mods/amogus_blocks/init.lua b/mods/amogus_blocks/init.lua index a061d36..467c4f7 100644 --- a/mods/amogus_blocks/init.lua +++ b/mods/amogus_blocks/init.lua @@ -26,7 +26,7 @@ minetest.register_node("amogus_blocks:tv", { }, paramtype2 = "facedir", drop = { -- amogus_items:capacitor amogus_items:pcb - -- drop two items + -- drop two items max_items = 2, items = { {items = {'amogus_items:capacitor'}, rarity = 1}, @@ -199,72 +199,6 @@ minetest.register_node("amogus_blocks:wood", { }) --- OLD water. not flowing. throwing massive amounts of errors. - ---minetest.register_node("amogus_blocks:water", { --- description = "Water", --- drawtype = "liquid", --- tiles = { --- { --- name = "water.png", --- --animation = { --- -- type = "vertical_frames", --- -- aspect_w = 16, --- -- aspect_h = 16, --- -- length = 2.0, --- --}, --- }, --- --{ --- -- name = "water.png", --- -- animation = { --- -- type = "vertical_frames", --- -- aspect_w = 16, --- -- aspect_h = 16, --- -- length = 2.0, --- -- }, --- --}, --- }, --- --special_tiles = { --- -- -- New-style water source material (mostly unused) --- -- { --- -- name = "water.png", --- -- backface_culling = false, --- -- animation = { --- -- type = "vertical_frames", --- -- aspect_w = 16, --- -- aspect_h = 16, --- -- length = 2.0, --- -- }, --- -- }, --- -- -- New-style flowing water material (mostly unused) --- -- { --- -- name = "water.png", --- -- backface_culling = true, --- -- animation = { --- -- type = "vertical_frames", --- -- aspect_w = 16, --- -- aspect_h = 16, --- -- length = 0.8, --- -- }, --- -- }, --- --}, --- alpha = 160, --- paramtype = "light", --- walkable = false, --- pointable = false, --- diggable = false, --- --buildable_to = true, --- drowning = 1, --- liquidtype = "source", --- --liquid_alternative_flowing = "amogus_blocks:water_flowing", --- --liquid_alternative_source = "amogus_blocks:water_source", --- liquid_viscosity = 1, --- post_effect_color = {a = 103, r = 30, g = 60, b = 90}, --- groups = {water = 3, liquid = 3, puts_out_fire = 1}, ---}) - - - minetest.register_node("amogus_blocks:water_source", { description = "Water Source", drawtype = "liquid", diff --git a/mods/amogus_general/init.lua b/mods/amogus_general/init.lua index a700304..539834d 100644 --- a/mods/amogus_general/init.lua +++ b/mods/amogus_general/init.lua @@ -3,10 +3,10 @@ minetest.register_on_joinplayer(function(player) --player:set_sky({r=0, g=0, b=0}, "plain", {}) -- play music in loop without position - -- minetest.sound_play("amogus_incomming", { - -- to_player = player:get_player_name(), - -- loop = true, - --gain = 1 + --minetest.sound_play("amogus_incomming", { + -- to_player = player:get_player_name(), + -- loop = true, + -- gain = 1 --}) end) diff --git a/mods/amogus_items/init.lua b/mods/amogus_items/init.lua index 11b62ec..fe5ff86 100644 --- a/mods/amogus_items/init.lua +++ b/mods/amogus_items/init.lua @@ -427,3 +427,254 @@ minetest.register_entity("amogus_items:dynamite_entity", { self.object:remove() end }) + + +-- below is modified code from bucket mod from minetest_game. (Minetest 0.4 mod: bucket) +-- original is licensed under: +-- GNU Lesser General Public License, version 2.1 +-- Copyright (C) 2011-2016 Kahrl +-- Copyright (C) 2011-2016 celeron55, Perttu Ahola +-- Copyright (C) 2011-2016 Various Minetest developers and contributors + +minetest.register_alias("empty_bucket", "amogus_items:empty_bucket") +minetest.register_alias("water_bucket", "amogus_items:water_bucket") + +minetest.register_craft({ + output = "bucket:empty_bucket 1", + recipe = { + {"amogus_items:iron_ingot", "", "amogus_items:iron_ingot"}, + {"", "amogus_items:iron_ingot", ""}, + } +}) + +bucket = {} +bucket.liquids = {} + +local function check_protection(pos, name, text) + if minetest.is_protected(pos, name) then + minetest.log("action", (name ~= "" and name or "A mod") + .. " tried to " .. text + .. " at protected position " + .. minetest.pos_to_string(pos) + .. " with a bucket") + minetest.record_protection_violation(pos, name) + return true + end + return false +end + + +-- Register a new liquid +-- source = name of the source node +-- flowing = name of the flowing node +-- itemname = name of the new bucket item (or nil if liquid is not takeable) +-- inventory_image = texture of the new bucket item (ignored if itemname == nil) +-- name = text description of the bucket item +-- groups = (optional) groups of the bucket item, for example {water_bucket = 1} +-- force_renew = (optional) bool. Force the liquid source to renew if it has a +-- source neighbour, even if defined as 'liquid_renewable = false'. +-- Needed to avoid creating holes in sloping rivers. +-- This function can be called from any mod (that depends on bucket). +function bucket.register_liquid(source, flowing, itemname, inventory_image, name, + groups, force_renew) + bucket.liquids[source] = { + source = source, + flowing = flowing, + itemname = itemname, + force_renew = force_renew, + } + bucket.liquids[flowing] = bucket.liquids[source] + + if itemname ~= nil then + minetest.register_craftitem(itemname, { + description = name, + inventory_image = inventory_image, + stack_max = 1, + liquids_pointable = true, + groups = groups, + + on_place = function(itemstack, user, pointed_thing) + -- Must be pointing to node + if pointed_thing.type ~= "node" then + return + end + + local node = minetest.get_node_or_nil(pointed_thing.under) + local ndef = node and minetest.registered_nodes[node.name] + + -- Call on_rightclick if the pointed node defines it + if ndef and ndef.on_rightclick and + not (user and user:is_player() and + user:get_player_control().sneak) then + return ndef.on_rightclick( + pointed_thing.under, + node, user, + itemstack) + end + + local lpos + + -- Check if pointing to a buildable node + if ndef and ndef.buildable_to then + -- buildable; replace the node + lpos = pointed_thing.under + else + -- not buildable to; place the liquid above + -- check if the node above can be replaced + + lpos = pointed_thing.above + node = minetest.get_node_or_nil(lpos) + local above_ndef = node and minetest.registered_nodes[node.name] + + if not above_ndef or not above_ndef.buildable_to then + -- do not remove the bucket with the liquid + return itemstack + end + end + + if check_protection(lpos, user + and user:get_player_name() + or "", "place "..source) then + return + end + + minetest.set_node(lpos, {name = source}) + return ItemStack("amogus_items:empty_bucket") + end + }) + end +end + +-- random prefixes for names +local bucket_names_prefixes = { + "Sussy", + "Sussy wussy", + "Sus", + "Imposterous", + "This is", + "I wonder what is the", + "You probably need", + "Big", + "Cursed", + "I want that", + "Very funny", + "Suspicious", + "SuspicioususUSSuS", + "SuspiciousususSuSuSsSSuS", + "AAAAA!! IT'S AGAIN THAT", + "Fantastick", + "I don't know what is that", + "This is propably the longest item name you will ever see and btw this item is called", + "I like", + "Whatever that is, I've got my own", + "A", + "Wonderful", + "Respectful", + "Amogus shaped", + "Impostor shaped", + "Imposter shaped", + "Sussy shaped" +} + +-- random name +local empty_bucket_names = { + "Bmpty Eucket", + "Bupty Emcket", + "Emptt Buckey", + "Emckty Bupet" +} + + +minetest.register_craftitem("amogus_items:empty_bucket", { + -- random name + --description = (empty_bucket_names[math.random(1, #empty_bucket_names)]), + description = (bucket_names_prefixes[math.random(1, #bucket_names_prefixes)] .. " " .. empty_bucket_names[math.random(1, #empty_bucket_names)]), + inventory_image = "empty_bucket.png", + groups = {tool = 1}, + liquids_pointable = true, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type == "object" then + pointed_thing.ref:punch(user, 1.0, { full_punch_interval=1.0 }, nil) + return user:get_wielded_item() + elseif pointed_thing.type ~= "node" then + -- do nothing if it's neither object nor node + return + end + -- Check if pointing to a liquid source + local node = minetest.get_node(pointed_thing.under) + local liquiddef = bucket.liquids[node.name] + local item_count = user:get_wielded_item():get_count() + + if liquiddef ~= nil + and liquiddef.itemname ~= nil + and node.name == liquiddef.source then + if check_protection(pointed_thing.under, + user:get_player_name(), + "take ".. node.name) then + return + end + + -- default set to return filled bucket + local giving_back = liquiddef.itemname + + -- check if holding more than 1 empty bucket + if item_count > 1 then + + -- if space in inventory add filled bucked, otherwise drop as item + local inv = user:get_inventory() + if inv:room_for_item("main", {name=liquiddef.itemname}) then + inv:add_item("main", liquiddef.itemname) + else + local pos = user:get_pos() + pos.y = math.floor(pos.y + 0.5) + minetest.add_item(pos, liquiddef.itemname) + end + + -- set to return empty buckets minus 1 + giving_back = "amogus_items:empty_bucket "..tostring(item_count-1) + + end + + -- force_renew requires a source neighbour + local source_neighbor = false + if liquiddef.force_renew then + source_neighbor = + minetest.find_node_near(pointed_thing.under, 1, liquiddef.source) + end + if not (source_neighbor and liquiddef.force_renew) then + minetest.add_node(pointed_thing.under, {name = "air"}) + end + + return ItemStack(giving_back) + else + -- non-liquid nodes will have their on_punch triggered + local node_def = minetest.registered_nodes[node.name] + if node_def then + node_def.on_punch(pointed_thing.under, node, user, pointed_thing) + end + return user:get_wielded_item() + end + end, +}) + + +-- random name +local water_bucket_names = { + "Bater Wucket", + "Buter Wacket", + "Watet Bucker", + "Wacker Butet" +} + + +bucket.register_liquid( + "amogus_blocks:water_source", + "amogus_blocks:water_flowing", + "amogus_items:water_bucket", + "water_bucket.png", + -- random name + (bucket_names_prefixes[math.random(1, #bucket_names_prefixes)] .. " " .. water_bucket_names[math.random(1, #water_bucket_names)]), + {tool = 1, water_bucket = 1} +) + +-- end of modifed code from bucket mod from minetest_game \ No newline at end of file diff --git a/mods/amogus_items/textures/empty_bucket.png b/mods/amogus_items/textures/empty_bucket.png new file mode 100644 index 0000000000000000000000000000000000000000..98a95b935e498508858b386d3ddb795b828b757b GIT binary patch literal 754 zcmVEX>4Tx04R}tkv&MmP!xqvQ>7vm2Rn#3WT;LSMMWGXibb$c+6t{Yn7s54nlvOS zE{=k0!NH%!s)LKOt`4q(Aov5~>f)s6A|>9J6k5di;PO7sd*|@py@1fDFwN?k05sh; zQ*lYm=2pefD+F`{RO2$Uj6`}d1K;&^j{x8AVm!4C(LTvt4P<6LxE;F%FKlbR=v5R1hQRyvrKOpSP&II3zoGr4P0EeHDwRD+yMrk4B3=jDM%$03c&jrjVT8V+ycF8Uf){hIDG&z)T`wi;NTD# zEmHQn&%b**`}XghR{wqgB+PP%dHJu#00009a7bBm001r{001r{0eGc9b^rhY6iGxu zR5;6}lfA8lFbsuH!Ud6vA_aR;F#s%p7$f7*umd#>h#CnA!5ARXP^1YGuX+*T=Tcl( zwqt+CkrUuYBX`LtiuSvFUDxCl5Jk}*$1%#XyZ~(5zJP84N+|$9k|bEy6^tEX>4Tx04R}tkv&MmP!xqvQ>7vm2Rn#3WT;LSMMWGXibb$c+6t{Yn7s54nlvOS zE{=k0!NH%!s)LKOt`4q(Aov5~>f)s6A|>9J6k5di;PO7sd*|@py@1fDFwN?k05sh; zQ*lYm=2pefD+F`{RO2$Uj6`}d1K;&^j{x8AVm!4C(LTvt4P<6LxE;F%FKlbR=v5R1hQRyvrKOpSP&II3zoGr4P0EeHDwRD+yMrk4B3=jDM%$03c&jrjVT8V+ycF8Uf){hIDG&z)T`wi;NTD# zEmHQn&%b**`}XghR{wqgB+PP%dHJu#00009a7bBm001r{001r{0eGc9b^rhYD@jB_ zR5;6}lRav~KoEsLue>U@i9xssL6r_*aHRvt7YHtV2pu3tNFCJp1}R*t(c)SV5bPBK zDTENgMGB!pX%eAdyYRrm&M^Dlo1cX{Z7~%Lf}oj-YpoYI0fHcCcDo&M9FG8`lp~-? zfV!>$_$t9m>h zN6g(4t^y2Y`@WAchBQra9EY+juaB{_=gt4Py8hgUy32k6yR~%q;73%+00000NkvXX Hu0mjf8WvXn literal 0 HcmV?d00001