diff --git a/CHANGELOG.md b/CHANGELOG.md index 46e1790..bc39819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [Dec 22nd] Unnamed Minor Update + +Game Changes: + +- Bugfixes + +Code Changes: + +- Document some functions + ## [Dec 2nd - Dec 22nd] Major Update: The Greatest Update **THIS UPDATE CONTAINS BREAKING CHANGES!!** diff --git a/mods/ITEMS/pyutest_electricity/components/delayer.lua b/mods/ITEMS/pyutest_electricity/components/delayer.lua index 6280e78..160e86a 100644 --- a/mods/ITEMS/pyutest_electricity/components/delayer.lua +++ b/mods/ITEMS/pyutest_electricity/components/delayer.lua @@ -44,7 +44,7 @@ PyuTest.make_electricity_device("pyutest_electricity:delayer", "Delayer", { end) core.register_craft({ - output = "pyutest_electricity:button", + output = "pyutest_electricity:delayer", recipe = { { "group:cobble", "group:cobble", "group:cobble" }, { "group:cobble", "pyutest_ores:zinc_ingot", "group:cobble" }, diff --git a/mods/ITEMS/pyutest_electricity/devices/noteblock.lua b/mods/ITEMS/pyutest_electricity/devices/noteblock.lua index 6d6aaeb..6e298dc 100644 --- a/mods/ITEMS/pyutest_electricity/devices/noteblock.lua +++ b/mods/ITEMS/pyutest_electricity/devices/noteblock.lua @@ -33,6 +33,7 @@ local function after_place_node(pos) local meta = core.get_meta(pos) meta:set_int(NOTE_POSITION_KEY, #NOTES) + meta:set_string("infotext", string.format("Note: %d", meta:get_int(NOTE_POSITION_KEY))) end local function play_sound(pos) @@ -72,24 +73,14 @@ PyuTest.make_electricity_device("pyutest_electricity:note_block", "Note Block", meta:set_int(NOTE_POSITION_KEY, ppos + 1) end + meta:set_string("infotext", string.format("Note: %d", meta:get_int(NOTE_POSITION_KEY))) + play_sound(pos) end }, function (pos, node, sender_pos) play_sound(pos) end) -core.register_abm({ - label = "Note Block infotext", - nodenames = {"pyutest_electricity:note_block"}, - interval = 1, - chance = 1, - action = function (pos) - local meta = core.get_meta(pos) - - meta:set_string("infotext", string.format("Note: %d", meta:get_int(NOTE_POSITION_KEY))) - end -}) - core.register_craft({ output = "pyutest_electricity:note_block", recipe = { diff --git a/mods/ITEMS/pyutest_potions/api.lua b/mods/ITEMS/pyutest_potions/api.lua index a3c746b..461a678 100644 --- a/mods/ITEMS/pyutest_potions/api.lua +++ b/mods/ITEMS/pyutest_potions/api.lua @@ -13,20 +13,6 @@ PyuTest.make_potion = function (name, desc, options) PyuTest.potion_recipes[options.craft] = name end - PyuTest.make_projectile(e_id, { - visual = "sprite", - textures = {texture}, - }, { - _slowdown = false, - }, { - on_hit_node = function (self, pos, node) - splash(pos + vector.new(0, 1, 0)) - end, - on_hit_object = function (self, object) - splash(self.object:get_pos(), self.object) - end - }) - local function drink(itemstack, user, pointed_thing) if user == nil or not user:is_player() then return @@ -43,10 +29,10 @@ PyuTest.make_potion = function (name, desc, options) return itemstack end - local function splash(pos, obj) + local function splash(pos) local rad = options.radius or 2 for o in core.objects_inside_radius(pos, rad) do - if o ~= obj then + if o:is_valid() then if o:is_player() then if options.action_splash then options.action_splash(o) @@ -85,6 +71,20 @@ PyuTest.make_potion = function (name, desc, options) return itemstack end + PyuTest.make_projectile(e_id, { + visual = "sprite", + textures = {texture}, + }, { + _slowdown = false, + }, { + on_hit_node = function (self, pos, node) + splash(pos + vector.new(0, 1, 0)) + end, + on_hit_object = function (self, object) + splash(self.object:get_pos()) + end, + }) + PyuTest.make_item(name, desc, { potion = 1 }, texture, { diff --git a/mods/ITEMS/pyutest_potions/potions.lua b/mods/ITEMS/pyutest_potions/potions.lua index 0bbdc54..5d5a7cf 100644 --- a/mods/ITEMS/pyutest_potions/potions.lua +++ b/mods/ITEMS/pyutest_potions/potions.lua @@ -37,7 +37,8 @@ PyuTest.make_potion("pyutest_potions:instant_damage", "Instant Damage Potion", { end, action_splash = function (object) PyuTest.deal_damage(object, 6, PyuTest.DAMAGE_TYPES.magic()) - end + end, + craft = "pyutest_tools:stone_sword" }) PyuTest.make_potion("pyutest_potions:instant_health", "Instant Health Potion", {