mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-03-25 05:00:55 +01:00
30 lines
905 B
Java
30 lines
905 B
Java
|
package com.minelittlepony.api.events;
|
||
|
|
||
|
import net.fabricmc.fabric.api.event.Event;
|
||
|
import net.fabricmc.fabric.api.event.EventFactory;
|
||
|
import net.minecraft.entity.Entity;
|
||
|
import net.minecraft.util.Identifier;
|
||
|
|
||
|
import org.jetbrains.annotations.Nullable;
|
||
|
|
||
|
import com.minelittlepony.api.pony.Pony;
|
||
|
|
||
|
/**
|
||
|
* Event for mods that want to replace the skin being used by a pony.
|
||
|
*/
|
||
|
public interface PonySkinResolver {
|
||
|
Event<PonySkinResolver> EVENT = EventFactory.createArrayBacked(PonySkinResolver.class, listeners -> (entity, pony, result) -> {
|
||
|
for (PonySkinResolver event : listeners) {
|
||
|
result = event.onPonySkinResolving(entity, pony, result);
|
||
|
}
|
||
|
return result;
|
||
|
});
|
||
|
|
||
|
@Nullable
|
||
|
Identifier onPonySkinResolving(Entity entity, PonyLookup ponyLookup, @Nullable Identifier previousResult);
|
||
|
|
||
|
interface PonyLookup {
|
||
|
Pony getPony(Identifier skin);
|
||
|
}
|
||
|
}
|