net.minecraft.stats.AchievementList Java Examples

The following examples show how to use net.minecraft.stats.AchievementList. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ContainerNewBrewingStand.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
@Override
public void onPickupFromSlot(EntityPlayer player, ItemStack stack) {
	if (stack.getItem() instanceof ItemPotion && stack.getItemDamage() > 0)
		player.addStat(AchievementList.potion, 1);

	super.onPickupFromSlot(player, stack);
}
 
Example #2
Source File: Achievements.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void init(){
	if(initDone)return;
	
	page = new AchievementPage(BaseMetals.NAME);
	AchievementPage.registerAchievementPage(page);
	
	this_is_new = makeAchievement("this_is_new",AchievementList.BUILD_FURNACE,0,0,Items.copper_ingot);
	blocktastic = makeAchievement("blocktastic",this_is_new,2,0,Blocks.copper_block);
	geologist = makeAchievement("geologist",this_is_new,4,2,Items.iron_crackhammer);
	metallurgy = makeAchievement("metallurgy",geologist,6,2,Items.brass_blend);
	brass_maker = makeAchievement("brass_maker",metallurgy,9,3,Items.brass_ingot);
	bronze_maker = makeAchievement("bronze_maker",metallurgy,9,4,Items.bronze_ingot);
	cupronickel_maker = makeAchievement("cupronickel_maker",metallurgy,9,5,Items.cupronickel_ingot);
	electrum_maker = makeAchievement("electrum_maker",metallurgy,9,6,Items.electrum_ingot);
	steel_maker = makeAchievement("steel_maker",metallurgy,9,7,Items.steel_ingot);
	invar_maker = makeAchievement("invar_maker",metallurgy,9,8,Items.invar_ingot);
	mithril_maker = makeAchievement("mithril_maker",metallurgy,11,10,Items.mithril_ingot);
	aquarium_maker = makeAchievement("aquarium_maker",metallurgy,11,12,Items.aquarium_ingot);
	demon_slayer = makeAchievement("demon_slayer",AchievementList.PORTAL,-5,5,Items.coldiron_sword);
	angel_of_death = makeAchievement("angel_of_death",mithril_maker,11,11,Items.mithril_sword);
	scuba_diver = makeAchievement("scuba_diver",aquarium_maker,11,13,Items.aquarium_sword);
	scuba_diver.setSpecial();
	juggernaut = makeAchievement("juggernaut",AchievementList.PORTAL,-7,3,Items.adamantine_helmet);
	juggernaut.setSpecial();
	moon_boots = makeAchievement("moon_boots",AchievementList.THE_END,-2,6,Items.starsteel_boots);
	moon_boots.setSpecial();
	
	
	initDone = true;
}
 
Example #3
Source File: GuiInventoryTFC.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
public GuiInventoryTFC(EntityPlayer player)
{
	super(player.inventoryContainer);
	this.allowUserInput = true;
	player.addStat(AchievementList.OPEN_INVENTORY, 1);
	xSize = 176;
	ySize = 102 + PlayerInventory.invYSize;
	this.player = player;
}
 
Example #4
Source File: SlotFirepitOutput.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
/**
 * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
 */
@Override
protected void onCrafting(ItemStack stack)
{
	stack.onCrafting(this.player.world, this.player, this.removeCount);

	if (!this.player.world.isRemote)
	{
		int i = this.removeCount;
		float f = FurnaceRecipes.instance().getSmeltingExperience(stack);

		if (f == 0.0F)
		{
			i = 0;
		}
		else if (f < 1.0F)
		{
			int j = MathHelper.floor((float)i * f);

			if (j < MathHelper.ceil((float)i * f) && Math.random() < (double)((float)i * f - (float)j))
			{
				++j;
			}

			i = j;
		}

		while (i > 0)
		{
			int k = EntityXPOrb.getXPSplit(i);
			i -= k;
			this.player.world.spawnEntity(new EntityXPOrb(this.player.world, this.player.posX, this.player.posY + 0.5D, this.player.posZ + 0.5D, k));
		}
	}

	this.removeCount = 0;

	net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerSmeltedEvent(player, stack);

	if (stack.getItem() == Items.IRON_INGOT)
	{
		this.player.addStat(AchievementList.ACQUIRE_IRON);
	}

	if (stack.getItem() == Items.COOKED_FISH)
	{
		this.player.addStat(AchievementList.COOK_FISH);
	}
}
 
Example #5
Source File: SlotCraftingTFC.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
/**
 * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
 */
@Override
protected void onCrafting(ItemStack stack)
{
	if (this.amountCrafted > 0)
	{
		stack.onCrafting(this.player.world, this.player, this.amountCrafted);
		net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(this.player, stack, craftMatrix);
	}

	this.amountCrafted = 0;

	if (stack.getItem() == Item.getItemFromBlock(Blocks.CRAFTING_TABLE))
	{
		this.player.addStat(AchievementList.BUILD_WORK_BENCH);
	}

	if (stack.getItem() instanceof ItemPickaxe)
	{
		this.player.addStat(AchievementList.BUILD_PICKAXE);
	}

	if (stack.getItem() == Item.getItemFromBlock(Blocks.FURNACE))
	{
		this.player.addStat(AchievementList.BUILD_FURNACE);
	}

	if (stack.getItem() instanceof ItemHoe)
	{
		this.player.addStat(AchievementList.BUILD_HOE);
	}

	if (stack.getItem() == Items.BREAD)
	{
		this.player.addStat(AchievementList.MAKE_BREAD);
	}

	if (stack.getItem() == Items.CAKE)
	{
		this.player.addStat(AchievementList.BAKE_CAKE);
	}

	if (stack.getItem() instanceof ItemPickaxe && ((ItemPickaxe)stack.getItem()).getToolMaterial() != Item.ToolMaterial.WOOD)
	{
		this.player.addStat(AchievementList.BUILD_BETTER_PICKAXE);
	}

	if (stack.getItem() instanceof ItemSword)
	{
		this.player.addStat(AchievementList.BUILD_SWORD);
	}

	if (stack.getItem() == Item.getItemFromBlock(Blocks.ENCHANTING_TABLE))
	{
		this.player.addStat(AchievementList.ENCHANTMENTS);
	}

	if (stack.getItem() == Item.getItemFromBlock(Blocks.BOOKSHELF))
	{
		this.player.addStat(AchievementList.BOOKCASE);
	}
}