Posted April 13, 20169 yr Part of my mod requires iterating through the Item Registry and getting all their subtypes and I was planning on using the Item object's getSubItems method, but that doesn't exist server side. Is there something I can use server-side to get all the subtypes of an Item object? I like trains.
April 13, 20169 yr Author I'm making a mod that gets all the available items and their recipes and send them to the client to be stored in text files as JSON. This mod will be part of my replacement to my http://mcresourcecalculator.info/ website which I made ~2 years ago. Now I know I could collect the items and recipes client side but I considered that to be potentially problematic because a client can have more mods installed than the server it is connected to and I'm not sure how I'd deal with that. The whole process is kicked off by a chat command rather than at startup in the postInit event (or similar) because of mods like MineTweaker. I like trains.
April 13, 20169 yr Author On previous servers I've played on, we've tweaked the pack by simply disabling mods server side and leaving them installed client side. If an admin were to use my mod in such a setup, the mods that have been removed server-side would have their items and recipes show up in the data files which I wouldn't want. Filtering the items I would be easy if I could get the server-side list of installed mods, but filtering recipes I suspect would be difficult. I like trains.
April 13, 20169 yr Author I guess I really don't have much of a choice in the matter. Is it possible to have client-side only commands or some sort of manual trigger that doesn't require that my mod be installed server side that can kick the whole process off? I like trains.
April 13, 20169 yr Author Would I register one of these in preInit, postInit, or someplace else? I like trains.
April 14, 20169 yr I'm making a mod that gets all the available items and their recipes... Then you don't want getSubItems anyway. That would give you several types of fish, none of which has a recipe (unless you include smelting/cooking). If I understand your goal of resource management, then you really do want recipes... on the server. Start with the server's authoritative recipe list and let it lead you to the items both input and output. You might desire some sorting at the end, but that's what maps are for. If that's not right, then I must not grok your purpose. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
April 14, 20169 yr Author That would give you several types of fish, none of which has a recipe (unless you include smelting/cooking). Not so. Botania lets you transmute one type of fish into another, and some fish are used as ingredients in recipes. For example to make Thaumcraft's Boots of the Traveller you need some sort of fish. So my mod would need to know about all the different sorts of fish for those recipes to be valid. Although I'd probably cull the transmutation recipes because those would cause infinite recursion issues. If I understand your goal of resource management, then you really do want recipes... on the server. Start with the server's authoritative recipe list and let it lead you to the items both input and output. You might desire some sorting at the end, but that's what maps are for. If that's not right, then I must not grok your purpose. Yes this is correct and why I wanted to get all the stuff server side since it's authoritative. The main problem is that the recipe list could get quite large and would need to be split up across multiple packets since packets have a limit of 1 megabyte. I'd need a way to break the big recipe list into 1048572B blocks and somehow make the receiver smart enough to rebuild the list client side. I like trains.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.