Search in sources :

Example 1 with Achievement

use of net.minecraft.achievement.Achievement in project StationAPI by ModificationStation.

the class AchievementListener method registerAchievements.

@EventListener
public void registerAchievements(AchievementRegisterEvent event) {
    testAchievementPage = new AchievementPageTest(SLTest.MODID, "testPage");
    testAchievement = new Achievement(69696969, "sltest:testAchievement", 0, 0, ItemListener.testItem, null);
    testAchievementChild = new Achievement(69696970, "sltest:testAchievementChild", 0, 2, ItemBase.goldenApple, testAchievement);
    event.achievements.add(testAchievement);
    event.achievements.add(testAchievementChild);
    testAchievementPage.addAchievements(testAchievement, testAchievementChild);
}
Also used : Achievement(net.minecraft.achievement.Achievement) EventListener(net.mine_diver.unsafeevents.listener.EventListener)

Example 2 with Achievement

use of net.minecraft.achievement.Achievement in project StationAPI by ModificationStation.

the class AchievementPageImpl method registerAchievements.

@EventListener(priority = ListenerPriority.HIGH)
private static void registerAchievements(AchievementRegisterEvent event) {
    AchievementPage page = new AchievementPage(MODID, "minecraft");
    List<Achievement> list = new ArrayList<>();
    for (Object o : Achievements.ACHIEVEMENTS) list.add((Achievement) o);
    page.addAchievements(list.toArray(new Achievement[0]));
}
Also used : AchievementPage(net.modificationstation.stationapi.api.client.gui.screen.menu.AchievementPage) Achievement(net.minecraft.achievement.Achievement) EventListener(net.mine_diver.unsafeevents.listener.EventListener)

Aggregations

EventListener (net.mine_diver.unsafeevents.listener.EventListener)2 Achievement (net.minecraft.achievement.Achievement)2 AchievementPage (net.modificationstation.stationapi.api.client.gui.screen.menu.AchievementPage)1