Advanced Peripherals

Advanced Peripherals

29M Downloads

[v0.7.25r] RS Bridge Method `craftItem` Not Crafting Lava Bucket

Peekofwar opened this issue ยท 13 comments

commented

Describe

In the previous version, my RS stock manager was able to queue items to be crafted (although the getItem method was bugged in that version so it would actually endlessly queue items), however in this version, while I'm able to fetch information about the items, I'm unable to craft items through the peripheral.

Despite being able to manually queue minecraft:lava_bucket in the RS system directly, I am unable to do so from the RS bridge peripheral. The function simply returns false every time I try to queue one. Furthermore, the getItem function indicates that the item is not craftable.

image
image
image

Strangely, I was able to craft mekanism:basic_universal_cable for some reason... as well as minecraft:stone
image

Strangely, other items are also not considered craftable for some reason...
image

I'm failing to pick up a pattern here. Strangely, after changing literally nothing, the program suddenly queued mekanism:enriched_redstone
image

I'm wondering if it's related to the pattern being in a crafter that's attached to a mekanism:advanced_fluid_tank

Steps to reproduce

  1. Attach a crafter to a mekanism:advanced_fluid_tank
  2. Insert a recipe that calls for an minecraft:iron_bucket and 1 B of lava
  3. Attempt to craft through the RS bridge
  4. Attempt to craft directly in the system if it's not working in the bridge

Multiplayer?

Yes

Version

1.18.2-0.7.25r (Latest 1.18)

Minecraft, Forge and maybe other related mods versions

Forge v40.1.92
Computercraft: Tweaked v1.101.0
Mekanism v10.2.5.465

Screenshots or Videos

No response

Crashlog/log

No response

commented

image

You forgot the minecraft: at the name
minecraft:lava_bucket
Does it return isCraftable true if you fix that?

commented

No, I don't believe the minecraft: was missing at any point. Neither in the program or in my testing. I did run a test without the minecraft: to see what it did.

This is from my program's config file (which I have not modified since December 12th of last year):
image

Re-ran that Lua command with minecraft: and it returns the same thing:
image

If your curious about my program:

local item_list_path = "/.program_data/rs_stock_manager/stocklist.lua"

local rs_device = "right" -- todo: make this a config option

local version = "1.0.2"

local item_list = {}
local load_item_list; function load_item_list(forceedit,forcenew)
	if fs.exists(item_list_path) and not forcenew then
		local file = fs.open(item_list_path,"r")
		item_list = textutils.unserialise(file.readAll())
		file.close()
		if type(item_list) == "nil" then
			load_item_list(false,true)
		end
		--require("cc.pretty").pretty_print(item_list)
	else
		print("Generating new list...")
		sleep(2)
		local file = fs.open(item_list_path,"w")
		file.writeLine("--[[")
		file.writeLine("  RS Stock Manager Item List")
		file.writeLine("")
		file.writeLine("  format:")
		file.writeLine("  {name = \"mod_name:item_name\", quantity = number},")
		file.writeLine("  example:")
		file.writeLine("  {name = \"mekanism:enriched_redstone\", quantity = 16,},")
		file.writeLine("]]")
		file.writeLine("")
		file.writeLine("{")
		file.writeLine("  ")
		file.writeLine("}")
		file.close()
		shell.run("edit "..item_list_path)
		load_item_list()
	end
end
load_item_list()
local function main()
	local isError = false
	local isPWRError = false
	local rs = peripheral.wrap(rs_device)
	print("RS Stock Manager running...")
	print("Version: "..version)
	while true do
		if peripheral.isPresent(rs_device) then
			if rs.getEnergyStorage() > 0 then
				if isPWRError then isPWRError = false print("RS system power restored.") end
				if isError then print("RS Bridge online!") isError = false end
				if #item_list < 1 then error("Item list is empty!",0) end
				for i=1, #item_list do
					if item_list[i] then
						local item = item_list[i].name
						local minimal = item_list[i].quantity
						local data = rs.getItem({name=item})
						local quantity = data and data.amount or 0
						local required = minimal - quantity
						--print(item,minimal,quantity)
						if not rs.isItemCrafting(item) then
							if rs.isItemCraftable({name=item}) then
								if quantity < minimal then
									local result = rs.craftItem({name=item,count=required})
									if result then
										item_list[i].isError = false
										print("Queueing "..required.." "..item)
									elseif not item_list[i].isError then
										item_list[i].isError = true
										printError("Cannot queue "..required.." "..item)
									end
								elseif item_list[i].isError == true then
									item_list[i].isError = false
								end
							else
								printError("Pattern missing for "..item)
								table.remove(item_list,i)
							end
						end
					end
				end
			else
				if not isPWRError then printError("/// RS SYSTEM POWER FAILURE! ///") end
				isPWRError = true
			end
		elseif not isError then
			isError = true
			printError("RS Bridge device is offline!")
		end
		sleep(2.5)
	end
end
main()

Also, this returns true...
image

commented
mc_ap_lava_bucket.mp4

To clarify, as far as I know, this was working properly in 19r before I updated.

commented

This is weird
Maybe some issue with comparing the stacks on the rs side

I'll work on that today!

commented

AdvancedPeripherals-0.7.26r.zip

Could you install this version and enable debug mode in the config file config/Advancedperipherals/general.toml?
This should print some information about the craft state into the console when you run craftItem

Unzip the file before using it

commented

This is it trying to queue lava buckets:

[12:55:16] [Server thread/WARN] [Advanced Peripherals/]: [DEBUG] Schedule chunk manager cleanup
[12:55:18] [Server thread/INFO] [Advanced Peripherals/]: [DEBUG] Crafting Result of 'minecraft:air':NO_PATTERN
[12:55:21] [Server thread/INFO] [Advanced Peripherals/]: [DEBUG] Crafting Result of 'mekanism:enriched_carbon':OK
[12:55:22] [Server thread/INFO] [Advanced Peripherals/]: [DEBUG] Crafting Result of 'minecraft:air':NO_PATTERN

I'm recording as well... Ran across an anomaly where it temporarily stopped being able to queue carbon...

latest.log.txt

https://youtu.be/PApgLx95doI (video processing...)

commented
[12:55:18] [Server thread/INFO] [Advanced Peripherals/]: [DEBUG] Crafting Result of 'minecraft:air':NO_PATTERN
[12:55:21] [Server thread/INFO] [Advanced Peripherals/]: [DEBUG] Crafting Result of 'mekanism:enriched_carbon':OK
[12:55:22] [Server thread/INFO] [Advanced Peripherals/]: [DEBUG] Crafting Result of 'minecraft:air':NO_PATTERN```

I guess the first and the third are lava buckets?
commented

Correct.
However. during my testing, I encountered a temporary anomaly where enriched carbon stopped queueing despite having sufficient resources.

commented

It stopped queueing mekanism:enriched_carbon again...
image

commented

https://youtu.be/PApgLx95doI Video has finished processing and can now be viewed properly

commented

Found the issue.
If the item is not in the system, it can't be crafted

commented

I noticed it started crafting enriched carbon after I manually queued up a bunch... Then after a while it stopped. That does line up with what I'm seeing.

commented

AdvancedPeripherals-0.7.26r.zip

This file contains the fix if you want to test it
I'll update today or tomorrow

Unzip the file before using it