Unicopia/src/main/java/com/minelittlepony/unicopia/ability/Abilities.java

37 lines
1.4 KiB
Java
Raw Normal View History

2020-04-15 17:22:29 +02:00
package com.minelittlepony.unicopia.ability;
import org.lwjgl.glfw.GLFW;
2020-04-15 17:22:29 +02:00
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.MutableRegistry;
import net.minecraft.util.registry.SimpleRegistry;
2020-04-15 17:22:29 +02:00
public interface Abilities {
MutableRegistry<Integer> KEYS_CODES = new SimpleRegistry<>();
MutableRegistry<Ability<?>> REGISTRY = new SimpleRegistry<>();
2020-04-15 17:22:29 +02:00
// unicorn
Ability<?> TELEPORT = register(new UnicornTeleportAbility(), "teleport", GLFW.GLFW_KEY_O);
Ability<?> CAST = register(new UnicornCastingAbility(), "cast", GLFW.GLFW_KEY_P);
2020-04-15 17:22:29 +02:00
// earth
Ability<?> GROW = register(new EarthPonyGrowAbility(), "grow", GLFW.GLFW_KEY_N);
Ability<?> STOMP = register(new EarthPonyStompAbility(), "stomp", GLFW.GLFW_KEY_M);
2020-04-15 17:22:29 +02:00
// pegasus
Ability<?> CARRY = register(new PegasusCarryAbility(), "carry", GLFW.GLFW_KEY_K);
Ability<?> CLOUD = register(new PegasusCloudInteractionAbility(), "cloud", GLFW.GLFW_KEY_J);
2020-04-15 17:22:29 +02:00
// changeling
Ability<?> FEED = register(new ChangelingFeedAbility(), "feed", GLFW.GLFW_KEY_O);
Ability<?> TRAP = register(new ChangelingTrapAbility(), "trap", GLFW.GLFW_KEY_L);
2020-04-15 17:22:29 +02:00
Ability<?> DISGUISE = register(new ChangelingDisguiseAbility(), "disguise", GLFW.GLFW_KEY_P);
2020-04-15 17:22:29 +02:00
static <T extends Ability<?>> T register(T power, String name, int keyCode) {
Identifier id = new Identifier("unicopia", name);
KEYS_CODES.add(id, keyCode);
return REGISTRY.add(id, power);
2020-04-15 17:22:29 +02:00
}
}