[INTENDED] Add getRecordResource on your records
sidben opened this issue ยท 3 comments
Hello there! I'm the author of the Redstone Jukebox mod, right now I'm working on making my mod compatible with records from other mods.
The way I'm doing it is by reading the "getRecordResource" of the ItemRecord. On your mod it's returning empty. I noticed you didn't override that property, you think it would be possible to return that property?
The code I'm using is the following:
public void playRecordAt(World world, int x, int y, int z, ItemRecord record, boolean showName, float volumeExtender)
{
...
final ResourceLocation resource = record.getRecordResource("records." + record.recordName);
...
If you see that this will cause you problems, let me know and I'll find another way.
getRecordResource doesn't use damage values, so it's impossible to return anything sensible through it. HEE should handle the compatibility itself, as long as you're extending both vanilla jukebox classes.
If you need to replay the disk, if it returns an empty resource then call onItemUse on the Item; make sure world, itemstack and xyz are correct, the rest doesn't matter. Let me know if I overlooked something there.