Java Code Examples for net.minecraft.init.Items#emerald()

The following examples show how to use net.minecraft.init.Items#emerald() . These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
@Override
public QuestData generateQuestFor(EntityPlayer player, Province province) {
	Province locationProvince = chooseRandomProvince(province, player.world, true);
	if (locationProvince == null) {
		return null;
	}
	QuestData data = new QuestData();
	data.setCiv(province.civilization);
	data.setPlayer(player);
	data.setProvinceId(province.id);
	data.setQuestId(UUID.randomUUID());
	data.setQuestType(ID);
	data.setCompleted(false);
	setLocationId(data, locationProvince.id);
	setDistance(data, (int) Math.round(player.getPosition().getDistance(locationProvince.chunkX * 16, (int) player.posY, locationProvince.chunkZ * 16)));
	setRewardRep(data, 5 + (getDistance(data) / 50));

	List<ItemStack> rewards = new ArrayList<ItemStack>(1);
	ItemStack emeralds = new ItemStack(Items.EMERALD, 8 + (getDistance(data) / 200));
	rewards.add(emeralds);
	setRewardItems(data, rewards);

	return data;
}
 
Example 2
@Override
public QuestData generateQuestFor(EntityPlayer player, Province questProvince) {
	Province deliverToProvince = chooseRandomProvince(questProvince, player.world, true);
	if (deliverToProvince == null) {
		return null;
	}
	QuestData data = new QuestData();
	data.setCiv(questProvince.civilization);
	data.setPlayer(player);
	data.setProvinceId(questProvince.id);
	data.setQuestId(UUID.randomUUID());
	data.setQuestType(ID);
	data.setCompleted(false);
	setDeliverToProvinceId(data, deliverToProvince.id);
	setDistance(data, (int) Math.round(player.getPosition().getDistance(deliverToProvince.chunkX * 16, (int) player.posY, deliverToProvince.chunkZ * 16)));
	setRewardRep(data, 5 + (getDistance(data) / 50));

	List<ItemStack> rewards = new ArrayList<ItemStack>(1);
	ItemStack emeralds = new ItemStack(Items.EMERALD, 4 + (getDistance(data) / 200));
	rewards.add(emeralds);
	setRewardItems(data, rewards);

	return data;
}
 
Example 3
private void handleReturnStolenItem(EntityPlayer player, Province province, IVillageLordInventory inventory, ItemStack stack) {
	inventory.setDonationItem(ItemStack.EMPTY);
	ItemStack emeralds = new ItemStack(Items.EMERALD, 2 + player.world.rand.nextInt(3));
	List<ItemStack> l = new ArrayList<ItemStack>(1);
	l.add(emeralds);
	inventory.setReturnItems(l);
	PlayerCivilizationCapabilityImpl.get(player).adjustReputation(province.civilization, 2 + player.world.rand.nextInt(3));
}
 
Example 4
@Override
public QuestData generateQuestFor(EntityPlayer player, Province province) {

	Random rand = player.getEntityWorld().rand;

	DataWrapper q = new DataWrapper();
	q.data.setCiv(province.civilization);
	q.data.setPlayer(player);
	q.data.setProvinceId(province.id);
	q.data.setQuestId(UUID.randomUUID());
	q.data.setQuestType(ID);
	q.data.setCompleted(false);

	int roll = rand.nextInt(10);

	q.setMobType(rand.nextInt(MOB_TYPES.length));
	q.setCurrentAmount(0);
	q.setRewardRep(0);
	q.setTargetAmount(10 + roll);

	ItemStack emeralds = new ItemStack(Items.EMERALD, q.getTargetAmount() / 6);
	List<ItemStack> rewardItems = new ArrayList<ItemStack>();
	rewardItems.add(emeralds);
	setRewardItems(q.data, rewardItems);

	return q.data;
}
 
Example 5
@Override
public QuestData generateQuestFor(EntityPlayer player, Province province) {

	Random rand = player.getEntityWorld().rand;

	DataWrapper q = new DataWrapper();
	q.data.setCiv(province.civilization);
	q.data.setPlayer(player);
	q.data.setProvinceId(province.id);
	q.data.setQuestId(UUID.randomUUID());
	q.data.setQuestType(ID);
	q.data.setCompleted(false);

	int roll = rand.nextInt(100);

	q.setCropType(rand.nextInt(CROP_TYPES.length));
	q.setCurrentAmount(0);
	q.setRewardRep(0);
	q.setTargetAmount(MathHelper.clamp(roll, 32, 100));
	
	ItemStack emeralds = new ItemStack(Items.EMERALD, MathHelper.clamp(q.getTargetAmount() / 32, 1, 4));
	List<ItemStack> rewardItems = new ArrayList<ItemStack>();
	rewardItems.add(emeralds);
	setRewardItems(q.data, rewardItems);

	return q.data;
}
 
Example 6
@Override
public QuestData generateQuestFor(EntityPlayer player, Province questProvince) {
	Random rand = player.world.rand;
	QuestData data = new QuestData();
	data.setCiv(questProvince.civilization);
	data.setPlayer(player);
	data.setProvinceId(questProvince.id);
	data.setQuestId(UUID.randomUUID());
	data.setQuestType(ID);
	data.setCompleted(false);

	setMaxDepth(data, 30);
	setMinDepth(data, 0);

	int roll = rand.nextInt(20);
	setTargetAmount(data, 10 + roll);

	setBlockType(data, rand.nextInt(BLOCK_TYPES.length));

	setRewardRep(data, 5 + (roll / 5));
	List<ItemStack> rewards = new ArrayList<ItemStack>(1);
	ItemStack emeralds = new ItemStack(Items.EMERALD, 4 + (roll / 10));
	rewards.add(emeralds);
	setRewardItems(data, rewards);

	return data;
}