2020-04-15 17:22:29 +02:00
|
|
|
package com.minelittlepony.unicopia.ability;
|
|
|
|
|
2020-04-25 22:03:36 +02:00
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
|
2020-04-25 15:37:17 +02:00
|
|
|
import org.lwjgl.glfw.GLFW;
|
2020-04-15 17:22:29 +02:00
|
|
|
|
2020-04-25 15:37:17 +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
|
|
|
|
2020-04-25 15:37:17 +02:00
|
|
|
public interface Abilities {
|
2020-04-25 22:03:36 +02:00
|
|
|
Map<Identifier, Integer> KEYS_CODES = new HashMap<>();
|
2020-04-25 15:37:17 +02:00
|
|
|
MutableRegistry<Ability<?>> REGISTRY = new SimpleRegistry<>();
|
2020-04-15 17:22:29 +02:00
|
|
|
|
2020-04-25 15:46:29 +02:00
|
|
|
// unicorn / alicorn
|
2020-04-25 15:37:17 +02:00
|
|
|
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
|
|
|
|
2020-04-25 15:46:29 +02:00
|
|
|
// earth / alicorn
|
2020-04-25 15:37:17 +02:00
|
|
|
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
|
|
|
|
2020-04-25 15:46:29 +02:00
|
|
|
// pegasus / bat / alicorn / changeling
|
|
|
|
Ability<?> CARRY = register(new CarryAbility(), "carry", GLFW.GLFW_KEY_K);
|
|
|
|
|
|
|
|
// pegasus / alicorn
|
2020-04-25 15:37:17 +02:00
|
|
|
Ability<?> CLOUD = register(new PegasusCloudInteractionAbility(), "cloud", GLFW.GLFW_KEY_J);
|
2020-04-15 17:22:29 +02:00
|
|
|
|
2020-04-25 15:37:17 +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
|
|
|
|
2020-04-25 15:37:17 +02:00
|
|
|
Ability<?> DISGUISE = register(new ChangelingDisguiseAbility(), "disguise", GLFW.GLFW_KEY_P);
|
2020-04-15 17:22:29 +02:00
|
|
|
|
2020-04-25 15:37:17 +02:00
|
|
|
static <T extends Ability<?>> T register(T power, String name, int keyCode) {
|
|
|
|
Identifier id = new Identifier("unicopia", name);
|
2020-04-25 22:03:36 +02:00
|
|
|
KEYS_CODES.put(id, keyCode);
|
2020-04-25 15:37:17 +02:00
|
|
|
return REGISTRY.add(id, power);
|
2020-04-15 17:22:29 +02:00
|
|
|
}
|
|
|
|
}
|