Jump to content

Recommended Posts

Posted

Hi, I'm the developer of the ResearchCraft mod here, and I have to edit some base classes for it to work. As I don't like editing base classes, I've tried removing all those edits and doing it with reflection. It works in SSP by removing and adding them again, but I have a problem in SMP, where I need the recipes to be enabled for some users and disabled for some others. The problem is that it isn't possible to remove a recipe from a client while not removing it from the other clients. What happens is that if you remove the recipe from the client, you can't see the recipe being craftable, but you can still craft it as it is in the server recipe list, and removing them from the server, removes them from all clients.

 

So what I need is a small hook to enable or disable recipes for each player instead of the full server.

Posted

Love your ResearchCraft mod, ran across it recently and was actually thinking of adding it to a new server.

 

As for the researching and such, a couple of things.

 

There is a crafting hook that calls your own function to handle crafting if a recipe does not already exist.

I might propose to just remove all the existing recipes and make your own hook to handle all recipes instead, unsure how to link to a person as I am not looking at it, but there should be some way to see who is doing it.

Be alerted that non-players doing crafting (like BC's autocraftingtable) exist, and you may need to consider them and how they should work.

Posted

Can you link your mod I like the ideal of restricted crafting. Also to solve your issue try using the hook like overlord described then make a nbt saver that list what a player can craft. Creat a function to load the list for the player and compare it to what is being crafted. This way you have a per player list that can be run threw without effecting other players.

Posted

using player api but for what your doing you can just make a new nbt file that stores somewhere that saves a string list. Other than that i don't know anything about the hook just assumed it existed because overmind was talking about it. Your could just try your same method you use ssp but make a crafting manager that that works per player.

Posted

OK, so I have been searching the hook you stated, but after looking into all forge hooks, I can say there is NOT such hook (or it is very VERY difficult to find). There is a hook to handle when an item is taken from crafting (which actually is repeated in FML), but it doesn't allow you to block crafting such item.

 

The solution for this isn't going to be easy, as it would only affect the basic crafting GUI. The only way to retrieve the player is with SlotCrafting, which hasn't got a generic way of retrieving it, so I have to deal with Container.getSlot(number), and that number may differ between crafting containers.

 

To sum up, there is actually no generic way to check who is crafting something, and I can't find a solution.

Posted

The one I am speaking of would not 'block' an item, rather you would want to clear the crafting manager and have all crafting recipes go through your function instead.  Hmm, look at any mod source that has recipe items that use damage up as they are crafted from, it is that same hook.

 

Maybe Lex has a better idea when next he comes around?

Posted

There should be a forge hook list, just to keep it simple to search hooks.

 

About the hook. Still can't find it. I have been searching in ForgeHooks, MinecraftForge, CraftingManager, ContainerWorkbench and InventoryCrafting with no luck.

 

Even then, having to handle the recipes in my mod would have serious compatibility issues, and I'd have to make it compatible with every conflicting mod by hand.

Posted

There is no hook for that because it's stupid and thats not how the recipe system works.

However, you can write your own replacements for the crafting table to allow you to filter the recipies all you want.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Ya there is no generic way to do it, you'd have to replace SlotCrafting and do it that route.

However, forge is always up for incoperating well designed hooks.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Dear Brunoe Quick Hack (Team) Thank you so much for your remarkable help in recovering my funds after I was scammed. As a busy surgeon and single mother to three children, the loss was overwhelming.Web-Site: Brunoequickhack.COM Your team's hard work, expertise, and unwavering support gave me hope and helped restore my financial stability. I admire your professionalism and the way you genuinely care about your clients. I highly recommend your services to anyone who has fallen prey to scammers. You are truly life savers. Whats-App: +1705-(7842)-635 With heartfelt thanks, Contact information: BrunoequickhackATgmail.cOM Dear Brunoe Quick Hack (Team) Thank you so much for your remarkable help in recovering my funds after I was scammed. As a busy surgeon and single mother to three children, the loss was overwhelming.Web-Site: Brunoequickhack.COM Your team's hard work, expertise, and unwavering support gave me hope and helped restore my financial stability. I admire your professionalism and the way you genuinely care about your clients. I highly recommend your services to anyone who has fallen prey to scammers. You are truly life savers. Whats-App: +1705-(7842)-635 With heartfelt thanks, Contact information: BrunoequickhackATgmail.cOM
    • ok i tried to disable the last mod's i installed and it is some of then, so now im going to do the classic enable and disable trick to find out which mod cause the crash. thanks for the help  
    • ok  make it work (java not being recognize) by downloading the zip putting it in the java folder and manually setting the path but is still give the same crush report https://pastebin.com/PPmR6jN0
    • Install this one: https://www.azul.com/downloads/?version=java-17-lts&os=windows&architecture=x86-64-bit&package=jdk#zulu After installation, set the java version in your Launcher / Java settings
    • it say it requires java 17 so when i go to install it is say "the installer has encounter an unexpected error installing this package." error code 2503 and 2502. https://pastebin.com/AL6AHMM9
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.