Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Kangalia

Members
  • Posts

    3
  • Joined

  • Last visited

Kangalia's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thank you! I managed to get this working finally after puzzling through it, and your answer gave me a good place to start. I ended up using a combination of several for loops and an int array which was filled with the values of my "weight" json attribute for each recipe. Iterating through each recipe in my main list, I could add to a new array several repeats of the same number for the weight, and this number would correlate to a specific recipe in the main list. E.g. if the weight for the recipe in index 0 was 5, then 0 would be added to the array 5 times. My random number would then be chosen from this new array, and the recipe fetched from the main list using it. This works like an absolute charm. Hope this helps anyone else that might stumble on this thread!
  2. Update to this. I've managed to get the machine to produce an output depending on a randomly generated number using the Random and SecureRandom java classes. However, I still can't figure out how to do the weighting.
  3. Hi there. I'm trying to make one of my custom machines to choose a specific custom recipe depending on a percentage chance assigned to each recipe. This percentage chance will be based on one of the ingredients. For example, ingredient 1 + ingredient 2 has a 30% to produce output 1, 20% for output 2, and 50% for output 3. However, if you do ingredient 1 + ingredient 3, they'd have a 15% chance for output 1, 10% for output 2, and 75% for output 3. I have no idea how to go about this. Cureently I have implemented the machine (including tile entity, screen, container, etc.) as as well as the RecipeType and Serialiser. My machine currently works to produce one output 100% of the time. It would be hugely appreciated if I could get, if not a solution, then maybe some ideas for implementing this, as I've been working on this for several days now and have completely run dry on ideas. Thanks!
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.