mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-03-23 12:17:12 +01:00
29 lines
905 B
Java
29 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);
|
|
}
|
|
}
|