Hardcore Ender Expansion

Hardcore Ender Expansion

2M Downloads

[INTENDED] Add getRecordResource on your records

sidben opened this issue ยท 3 comments

commented

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.

commented

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.

commented

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.

commented

Hmm, I did some tests and damage value is indeed a problem. I'll try to work something out. Calling the onItemUse is a good idea, but I need to override some vanilla behaviour so I made my own class very similar. I'll see what I can do, thanks!