Jump to content

Recommended Posts

Posted

I have been getting into modding recently and have no idea how to even get started adding items to loot tables. I might be able to figure out how to make one, but when it comes to simply removing or adding to them in my mod i cannot seem to figure it out. Does anybody have any forbidden loot table knowledge they could share with me?

Posted

What are you trying to do?

Create your own loot table, or modify an existing loot table?

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.

Posted

From existing loot tables.

 

Ok.

 

Subscribe to the LootTableLoadEvent.

 

And then do magic.

 

And by magic, I mean I figured most of this out by trial and error and a single existing post on the forums.

 

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/farming/FarmingEventHandler.java#L285

with references to

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/util/LootUtils.java

 

If anyone else has any advice on how to do this better, I'm all ears.  My biggest complaint/issue with the loot table system is that in order to detect a given loot table, I need to compare strings.

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.

Posted

My biggest complaint/issue with the loot table system is that in order to detect a given loot table, I need to compare strings.
And how would you do that differently? Use an number-based ID?

 

I don't have an alternative. I don't know. But I can still not like it.

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.

Posted

The other thing that I had trouble with, was being able to see the JSON equivalent of what I was doing.

That is, I couldn't figure out how to write my changes to a file.  I'm sure there's a way, I just couldn't figure out how.

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.

Posted

The other thing that I had trouble with, was being able to see the JSON equivalent of what I was doing.

That is, I couldn't figure out how to write my changes to a file.  I'm sure there's a way, I just couldn't figure out how.

Reflectively get the value of LootTableManager#GSON_INSTANCE and call Gson#toJson() with it, passing in the LootTable that you want serialised.

Posted

Ah, cool.  I'll try and remember that.

I'm done doing my manipulation, and everything works the way I want, but there was a lot of poking around in the dark.

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.