Posted November 28, 20168 yr 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.
November 28, 20168 yr 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.
November 28, 20168 yr Author Is it possible to make the vanilla crafting table use a custom handler? And if so, how?
November 28, 20168 yr Author 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.
November 28, 20168 yr Author 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?
November 28, 20168 yr Author 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.
November 28, 20168 yr 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.
November 28, 20168 yr Author 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.
November 28, 20168 yr 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.
November 28, 20168 yr Author 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?
November 28, 20168 yr 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.