mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 03:15:07 +00:00
Added achievement logic to the relic items.
This commit is contained in:
1 parent
c907ee68b4
commit
0ab208a9ee
6 files changed
+60
-1
No files matched your search
@@ -13,6 +13,7 @@ package vazkii.botania.common.achievement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import vazkii.botania.api.item.IRelic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -26,6 +27,9 @@ public class AchievementMod extends Achievement {
|
||||
super("achievement.botania:" + name, "botania:" + name, x, y, icon, parent);
|
||||
achievements.add(this);
|
||||
registerStat();
|
||||
|
||||
if(icon.getItem() instanceof IRelic)
|
||||
((IRelic) icon.getItem()).setBindAchievement(this);
|
||||
}
|
||||
|
||||
public AchievementMod(String name, int x, int y, Item icon, Achievement parent) {
|
||||
|
||||
@@ -56,6 +56,14 @@ public final class ModAchievements {
|
||||
public static Achievement superCorporeaRequest;
|
||||
public static Achievement pinkinator;
|
||||
|
||||
public static Achievement relicInfiniteFruit;
|
||||
public static Achievement relicExcaliber;
|
||||
public static Achievement relicFlugelEye;
|
||||
public static Achievement relicThorRing;
|
||||
public static Achievement relicOdinRing;
|
||||
public static Achievement relicLokiRing;
|
||||
public static Achievement relicAesirRing;
|
||||
|
||||
public static Achievement desuGun;
|
||||
|
||||
public static void init() {
|
||||
@@ -95,6 +103,14 @@ public final class ModAchievements {
|
||||
superCorporeaRequest = new AchievementMod(LibAchievementNames.SUPER_CORPOREA_REQUEST, -3, -5, ModBlocks.corporeaIndex, null).setSpecial();
|
||||
pinkinator = new AchievementMod(LibAchievementNames.PINKINATOR, -5, -5, ModItems.pinkinator, null).setSpecial();
|
||||
|
||||
relicInfiniteFruit = new AchievementMod(LibAchievementNames.RELIC_INFINITE_FRUIT, -9, 4, ModItems.infiniteFruit, null);
|
||||
relicExcaliber = new AchievementMod(LibAchievementNames.RELIC_EXCALIBER, -7, 7, ModItems.excaliber, null);
|
||||
relicFlugelEye = new AchievementMod(LibAchievementNames.RELIC_FLUGEL_EYE, -5, 4, ModItems.flugelEye, null);
|
||||
relicThorRing = new AchievementMod(LibAchievementNames.RELIC_THOR_RING, -7, 3, ModItems.thorRing, null);
|
||||
relicOdinRing = new AchievementMod(LibAchievementNames.RELIC_ODIN_RING, -9, 6, ModItems.odinRing, null);
|
||||
relicLokiRing = new AchievementMod(LibAchievementNames.RELIC_LOKI_RING, -5, 6, ModItems.lokiRing, null);
|
||||
relicAesirRing = new AchievementMod(LibAchievementNames.RELIC_AESIR_RING, -7, 5, ModItems.aesirRing, null).setSpecial();
|
||||
|
||||
ItemStack desu = new ItemStack(ModItems.manaGun);
|
||||
desu.setStackDisplayName("desu gun");
|
||||
desuGun = new AchievementMod(LibAchievementNames.DESU_GUN, -8, -2, desu, null).setSpecial();
|
||||
@@ -106,3 +122,4 @@ public final class ModAchievements {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,11 +10,17 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.relic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import baubles.api.BaubleType;
|
||||
import vazkii.botania.api.item.IWireframeCoordinateListProvider;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemAesirRing extends ItemRelicBauble {
|
||||
public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordinateListProvider {
|
||||
|
||||
public ItemAesirRing() {
|
||||
super(LibItemNames.AESIR_RING);
|
||||
@@ -25,4 +31,9 @@ public class ItemAesirRing extends ItemRelicBauble {
|
||||
return BaubleType.RING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ChunkCoordinates> getWireframesToDraw(EntityPlayer player, ItemStack stack) {
|
||||
return ((IWireframeCoordinateListProvider) ModItems.lokiRing).getWireframesToDraw(player, stack);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -65,8 +65,12 @@ public class ItemRelic extends ItemMod implements IRelic {
|
||||
}
|
||||
|
||||
public static void updateRelic(ItemStack stack, EntityPlayer player) {
|
||||
if(stack == null || !(stack.getItem() instanceof IRelic))
|
||||
return;
|
||||
|
||||
String soulbind = getSoulbindUsernameS(stack);
|
||||
if(soulbind.isEmpty()) {
|
||||
player.addStat(((IRelic) stack.getItem()).getBindAchievement(), 1);
|
||||
bindToPlayer(player, stack);
|
||||
soulbind = getSoulbindUsernameS(stack);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,14 @@ public final class LibAchievementNames {
|
||||
public static final String SUPER_CORPOREA_REQUEST = "superCorporeaRequest";
|
||||
public static final String PINKINATOR = "pinkinator";
|
||||
|
||||
public static final String RELIC_INFINITE_FRUIT = "infiniteFruit";
|
||||
public static final String RELIC_EXCALIBER = "excaliber";
|
||||
public static final String RELIC_FLUGEL_EYE = "flugelEye";
|
||||
public static final String RELIC_THOR_RING = "thorRing";
|
||||
public static final String RELIC_ODIN_RING = "odinRing";
|
||||
public static final String RELIC_LOKI_RING = "lokiRing";
|
||||
public static final String RELIC_AESIR_RING = "aesirRing";
|
||||
|
||||
public static final String DESU_GUN = "desuGun";
|
||||
|
||||
}
|
||||
@@ -389,6 +389,21 @@ achievement.botania:superCorporeaRequest.desc=Successfuly request 50,000 or more
|
||||
achievement.botania:pinkinator=Decorator
|
||||
achievement.botania:pinkinator.desc=Put to use The Pinkinator
|
||||
|
||||
achievement.botania:infiniteFruit=Innocentia
|
||||
achievement.botania:infiniteFruit.desc=Be rewarded The Fruit of Grisaia for a heroic feat
|
||||
achievement.botania:excaliber=Streaming Heart
|
||||
achievement.botania:excaliber.desc=Be rewarded the Holy Sword Excaliber for a heroic feat
|
||||
achievement.botania:flugelEye=Angel of Death
|
||||
achievement.botania:flugelEye.desc=Be rewarded the Eye of the Flügel for a heroic feat
|
||||
achievement.botania:thorRing=One Step Layered
|
||||
achievement.botania:thorRing.desc=Be rewarded the Ring of Thor for a heroic feat
|
||||
achievement.botania:odinRing=Lost Time Memory
|
||||
achievement.botania:odinRing.desc=Be rewarded the Ring of Odin for a heroic feat
|
||||
achievement.botania:lokiRing=Arithmetic
|
||||
achievement.botania:lokiRing.desc=Be rewarded the Ring of Loki for a heroic feat
|
||||
achievement.botania:aesirRing=As the Gods Say
|
||||
achievement.botania:aesirRing.desc=Create the Ring of the Aesir
|
||||
|
||||
achievement.botania:desuGun=Two-Faced Lovers
|
||||
achievement.botania:desuGun.desc=ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
# ^ Don't localize
|
||||
|
||||
Reference in new issue
Block a user