Jump to content

Recommended Posts

Posted

Is there any way to add a crafting/smelting recipe for a single player as opposed to globally for all players? I'm working on a research system that progressively unlocks crafting recipes as research is completed, but using GameRegistry.add... seems to apply globally to all players.

Posted

Is there any way to add a crafting/smelting recipe for a single player as opposed to globally for all players? I'm working on a research system that progressively unlocks crafting recipes as research is completed, but using GameRegistry.add... seems to apply globally to all players.

You will need to use your own crafting handler, or your own crafting block/te/container.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

Define "custom handler".

 

Use my own crafting handler in place of the default CraftingManager class. So a class very similar to the CraftingManager except it has the ability to determine of the item is craftable based upon the research that has been completed the by the player attempting to craft.

Posted

Read the tutorial I linked...

 

1. For that tutorial, would every recipe have to be a separate class that implements IRecipe? Or is there a simpler way to compress multiple recipes into a single class?

2. The property I would be looking for is not a property of the player, so would the best way to check for a match be to create use a Map<Player, List<IRecipe>> to map what players have access to which recipes?

3. Would it be a similar process for smelting recipes?

Posted

Ehm... what? You said in the original post it would be based on the player. What do you want instead?

 

It's kinda based on the player. Each player would have their own set of crafting recipes based on the research they have completed. So it's not a property of the player that can be obtained through an instance of a player. The recipes that are available are based on the researches that the player has completed.

 

So, for example, if a research correlates to the recipe for diamond pickaxe, a player who has completed the research would be able to craft it, but a player who has not completed the research would not be able to.

Posted

Ehm... what? You said in the original post it would be based on the player. What do you want instead?

 

It's kinda based on the player. Each player would have their own set of crafting recipes based on the research they have completed. So it's not a property of the player that can be obtained through an instance of a player. The recipes that are available are based on the researches that the player has completed.

 

So, for example, if a research correlates to the recipe for diamond pickaxe, a player who has completed the research would be able to craft it, but a player who has not completed the research would not be able to.

How do you expect to store this data if not with the player?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

Ehm... what? You said in the original post it would be based on the player. What do you want instead?

 

It's kinda based on the player. Each player would have their own set of crafting recipes based on the research they have completed. So it's not a property of the player that can be obtained through an instance of a player. The recipes that are available are based on the researches that the player has completed.

 

So, for example, if a research correlates to the recipe for diamond pickaxe, a player who has completed the research would be able to craft it, but a player who has not completed the research would not be able to.

How do you expect to store this data if not with the player?

 

Its associated with the player, not stored within the player. So players are associated with their completed researches in a Map object or something similar, since unless I'm mistaken, there is no way to store it directly within the PlayerEntity class.

Posted

Ehm... what? You said in the original post it would be based on the player. What do you want instead?

 

It's kinda based on the player. Each player would have their own set of crafting recipes based on the research they have completed. So it's not a property of the player that can be obtained through an instance of a player. The recipes that are available are based on the researches that the player has completed.

 

So, for example, if a research correlates to the recipe for diamond pickaxe, a player who has completed the research would be able to craft it, but a player who has not completed the research would not be able to.

How do you expect to store this data if not with the player?

 

Its associated with the player, not stored within the player. So players are associated with their completed researches in a Map object or something similar, since unless I'm mistaken, there is no way to store it directly within the PlayerEntity class.

The capability system is how you would store it, and if you stored it in a Map/List then how would it persist. Ie if I get off of my world and back on, how would I have my recipes.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

So the way to do this is in the recipe you check if the player trying to craft it has done the necessary research. If not, you return false from

matches

and suddenly they cannot use that recipe, it looks as if it does not exist.

 

So would I have to define my recipes using a custom version of the ShapedRecipe and ShapelessRecipe class in order to associate the recipe with a research and be able to check it?

Posted

Yes

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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



×
×
  • Create New...

Important Information

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