Jump to content

[SOLVED] Issue With My Mod Breaking Crock Pot


Recommended Posts

My character has a follower that lets you store stuff in it (like chester), but now when I try to use the crock pot it has nine slots just like a chest instead of the four vertical slots it's supposed to have. It still functions like a crock pot except for the fact that you have to fill all nine spaces with an ingredient to cook.

This is what it looks like when I open a crock pot with my mod on that server:

crockpotbroken.png

This has been frustrating me for quite sometime now and I can't seem to figure out how to fix it. Can someone help me?

Edited by beforeidecay96
Link to comment
Share on other sites

Well, I was right on the money.

Remove this from modmain:

local containers = GLOBAL.require("containers")
local oldwidgetsetup = containers.widgetsetup

containers.widgetsetup = function(container, prefab, data)
    prefab = "treasurechest" --replace with ur container prefab name
    oldwidgetsetup(container, prefab, data)
end 

local containers = GLOBAL.require("containers")
local oldwidgetsetup = containers.widgetsetup

containers.widgetsetup = function(container, prefab)    
	if not prefab and container.inst.prefab == "treasurechest" then        
		prefab = "chester"    
	end    
	oldwidgetsetup(container, prefab)
end

And in summonlector, you have:

	if not TheWorld.ismastersim then
		return inst
	end

	-- code, code, code

	if not TheWorld.ismastersim then	
		inst.OnEntityReplicated = function(inst) 
			inst.replica.container:WidgetSetup("chester") 
		end	
		return inst
	end

So the function returns before setting up the widget correctly.

Move the content of the second IF inside the first.

Link to comment
Share on other sites

That fixed the issue with the crock pot, but now I messed something up with my follower. It won't spawn it when I log in to the server. I'm not entirely sure what I did that would cause it to mess up. :(

Never mind, I fixed it. It all works now! Thank you so much for the help! ^-^

 

 

Edited by beforeidecay96
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...