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

    • Hi, i'm really having problems trying to set the texture to my custom item. I thought i'm doing everything correctly, but all i see is the missing texture block for my item. I am trying this for over a week now and getting really frustrated. The only time i could make the texture work, was when i used an older Forge version (52.0.1) for Minecraft (1.21.4). Was there a fundamental change for textures and models somewhere between versions that i'm missing? I started with Forge 54.1.0 and had this problem, so in my frustration i tried many things: Upgrading to Forge 54.1.1, created multiple new projects, workspaces, redownloaded everything and setting things up multiple times, as it was suggested in an older thread. Therea are no errors in the console logs, but maybe i'm blind, so i pasted the console logs to pastebin anyway: https://pastebin.com/zAM8RiUN The only time i see an error is when i change the models JSON file to an incorrect JSON which makes sense and that suggests to me it is actually reading the JSON file.   I set the github repository to public, i would be so thankful if anyone could take a look and tell me what i did wrong: https://github.com/xLorkin/teleport_pug_forge   As a note: i'm pretty new to modding, this is my first mod ever. But i'm used to programming. I had some up and downs, but through reading the documentation, using google and experimenting, i could solve all other problems. I only started modding for Minecraft because my son is such a big fan and wanted this mod.
    • Please read the FAQ (link in orange bar at top of page), and post logs as described there.
    • Hello fellow Minecrafters! I recently returned to Minecraft and realized I needed a wiki that displays basic information easily and had great user navigation. That’s why I decided to build: MinecraftSearch — a site by a Minecraft fan, for Minecraft fans. Key Features So Far Straight-to-the-Point Info: No extra fluff; just the essentials on items, mobs, recipes, loot and more. Clean & Intuitive Layout: Easy navigation so you spend less time scrolling and more time playing. Optimized Search: Search for anything—items, mobs, blocks—and get results instantly. What I’m Thinking of Adding More data/information: Catch chances for fishing rod, traveling villager trades, biomes info and a lot more. The website is still under development and need a lot more data added. Community Contributions: Potential for user-uploaded tips for items/mobs/blocks in the future. Feature Requests Welcome: Your ideas could shape how the wiki evolves! You can see my roadmap at the About page https://minecraftsearch.com/about I’d love for you to check out MinecraftSearch and see if it helps you find the info you need faster. Feedback is crucial—I want to develop this further based on what the community needs most, so please let me know what you think. Thanks, and happy crafting!
    • Instructions on how to install newer Java can be found in the FAQ
    • That's just plain wrong... newer versions are much better optimised and start a lot faster than 1.8.9, both Forge and Minecraft itself. Comparing Fabric 1.21 with Forge 1.8 is like comparing apples and oranges... one's brand new and the other's over a decade old.
  • Topics

×
×
  • Create New...

Important Information

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