Little more work on Achievements
This commit is contained in:
parent
5101abc541
commit
ae4f3b5814
2 changed files with 24 additions and 7 deletions
|
@ -13,15 +13,15 @@ public class TRAchievements {
|
|||
public static AchievementPage techrebornPage;
|
||||
public static int pageIndex;
|
||||
|
||||
public static Achievement orePickUp;
|
||||
public static Achievement thermalgenCraft;
|
||||
public static Achievement centrifugeCraft;
|
||||
public static Achievement ore_PickUp;
|
||||
public static Achievement thermalgen_Craft;
|
||||
public static Achievement centrifuge_Craft;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
orePickUp = new AchievementMod(AchievementNames.ORE_PICKUP, 0, 0, new ItemStack(ModBlocks.ore,1, 0), null);
|
||||
centrifugeCraft = new AchievementMod(AchievementNames.CENTRIFUGE_CRAFT, 1, 1, new ItemStack(ModBlocks.centrifuge), orePickUp);
|
||||
thermalgenCraft = new AchievementMod("thermalgen_craft", 2, 1, new ItemStack(ModBlocks.thermalGenerator), null);
|
||||
ore_PickUp = new AchievementMod("ore_PickUp", 0, 0, new ItemStack(ModBlocks.ore, 1, 0), null);
|
||||
centrifuge_Craft = new AchievementMod("centrifuge_Craft", 1, 1, ModBlocks.centrifuge, ore_PickUp);
|
||||
thermalgen_Craft = new AchievementMod("thermalgen_Craft", 2, 1, ModBlocks.thermalGenerator, ore_PickUp);
|
||||
|
||||
pageIndex = AchievementPage.getAchievementPages().size();
|
||||
techrebornPage = new AchievementPage(ModInfo.MOD_NAME, AchievementMod.achievements.toArray(new Achievement[AchievementMod.achievements.size()]));
|
||||
|
|
|
@ -1,14 +1,31 @@
|
|||
package techreborn.itemblocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemMultiTexture;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import techreborn.achievement.ICraftAchievement;
|
||||
import techreborn.achievement.IPickupAchievement;
|
||||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class ItemBlockOre extends ItemMultiTexture {
|
||||
public class ItemBlockOre extends ItemMultiTexture implements IPickupAchievement, ICraftAchievement{
|
||||
|
||||
public ItemBlockOre(Block block) {
|
||||
super(ModBlocks.ore, ModBlocks.ore, BlockOre.types);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return field_150939_a instanceof ICraftAchievement ? ((ICraftAchievement) field_150939_a).getAchievementOnCraft(stack, player, matrix) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item) {
|
||||
return field_150939_a instanceof IPickupAchievement ? ((IPickupAchievement) field_150939_a).getAchievementOnPickup(stack, player, item) : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue