2013-03-08 00:25:48 +00:00
|
|
|
/*
|
|
|
|
* Forge Mod Loader
|
|
|
|
* Copyright (c) 2012-2013 cpw.
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
* are made available under the terms of the GNU Lesser Public License v2.1
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
2013-06-29 17:33:14 +00:00
|
|
|
*
|
2013-03-08 00:25:48 +00:00
|
|
|
* Contributors:
|
|
|
|
* cpw - implementation
|
|
|
|
*/
|
|
|
|
|
2014-09-23 05:01:24 +00:00
|
|
|
package net.minecraftforge.fml.common.registry;
|
2012-08-19 14:13:15 +00:00
|
|
|
|
2013-07-08 20:59:52 +00:00
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Collections;
|
2012-08-19 14:13:15 +00:00
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Random;
|
2014-09-20 00:24:36 +00:00
|
|
|
import org.apache.commons.lang3.Validate;
|
|
|
|
|
2012-12-09 05:41:16 +00:00
|
|
|
import net.minecraft.entity.passive.EntityVillager;
|
2014-09-20 00:24:36 +00:00
|
|
|
import net.minecraft.entity.passive.EntityVillager.*;
|
|
|
|
import net.minecraft.init.Blocks;
|
|
|
|
import net.minecraft.init.Items;
|
|
|
|
import net.minecraft.item.EnumDyeColor;
|
2012-12-09 04:21:03 +00:00
|
|
|
import net.minecraft.item.Item;
|
2014-09-20 00:24:36 +00:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.util.EnumFacing;
|
2013-07-08 20:59:52 +00:00
|
|
|
import net.minecraft.util.ResourceLocation;
|
2015-11-13 07:32:08 +00:00
|
|
|
import net.minecraft.world.gen.structure.StructureComponent;
|
2013-12-03 04:46:42 +00:00
|
|
|
import net.minecraft.world.gen.structure.StructureVillagePieces;
|
2015-11-13 07:32:08 +00:00
|
|
|
import net.minecraft.world.gen.structure.StructureVillagePieces.PieceWeight;
|
|
|
|
import net.minecraft.world.gen.structure.StructureVillagePieces.Village;
|
2014-09-23 05:01:24 +00:00
|
|
|
import net.minecraftforge.fml.common.FMLLog;
|
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
2012-08-23 05:40:03 +00:00
|
|
|
|
2012-09-15 19:49:08 +00:00
|
|
|
import com.google.common.collect.Lists;
|
2012-08-23 05:40:03 +00:00
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
2012-08-19 14:13:15 +00:00
|
|
|
/**
|
|
|
|
* Registry for villager trading control
|
|
|
|
*
|
|
|
|
* @author cpw
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class VillagerRegistry
|
|
|
|
{
|
|
|
|
private static final VillagerRegistry INSTANCE = new VillagerRegistry();
|
|
|
|
|
2012-08-19 15:23:29 +00:00
|
|
|
private Map<Class<?>, IVillageCreationHandler> villageCreationHandlers = Maps.newHashMap();
|
2012-09-15 19:49:08 +00:00
|
|
|
private List<Integer> newVillagerIds = Lists.newArrayList();
|
2013-06-29 17:33:14 +00:00
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
private Map<Integer, ResourceLocation> newVillagers;
|
2012-08-19 14:13:15 +00:00
|
|
|
|
2014-09-20 00:24:36 +00:00
|
|
|
private VillagerRegistry()
|
|
|
|
{
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
|
2012-08-19 14:30:24 +00:00
|
|
|
/**
|
2013-01-22 02:37:29 +00:00
|
|
|
* Allow access to the {@link net.minecraft.world.gen.structure.StructureVillagePieces} array controlling new village
|
2012-08-19 14:30:24 +00:00
|
|
|
* creation so you can insert your own new village pieces
|
|
|
|
*
|
|
|
|
* @author cpw
|
|
|
|
*
|
|
|
|
*/
|
2012-08-19 14:13:15 +00:00
|
|
|
public interface IVillageCreationHandler
|
|
|
|
{
|
2012-08-19 14:30:24 +00:00
|
|
|
/**
|
2013-01-22 02:37:29 +00:00
|
|
|
* Called when {@link net.minecraft.world.gen.structure.MapGenVillage} is creating a new village
|
2012-08-19 14:30:24 +00:00
|
|
|
*
|
|
|
|
* @param random
|
|
|
|
* @param i
|
|
|
|
*/
|
2013-12-03 04:46:42 +00:00
|
|
|
StructureVillagePieces.PieceWeight getVillagePieceWeight(Random random, int i);
|
2012-08-19 15:23:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The class of the root structure component to add to the village
|
|
|
|
*/
|
|
|
|
Class<?> getComponentClass();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-01-22 02:37:29 +00:00
|
|
|
* Build an instance of the village component {@link net.minecraft.world.gen.structure.StructureVillagePieces}
|
2012-08-19 15:23:29 +00:00
|
|
|
* @param villagePiece
|
|
|
|
* @param startPiece
|
|
|
|
* @param pieces
|
|
|
|
* @param random
|
|
|
|
* @param p1
|
|
|
|
* @param p2
|
|
|
|
* @param p3
|
2014-09-20 00:24:36 +00:00
|
|
|
* @param facing
|
2012-08-19 15:23:29 +00:00
|
|
|
* @param p5
|
|
|
|
*/
|
2015-11-13 07:32:08 +00:00
|
|
|
Village buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List<StructureComponent> pieces, Random random, int p1,
|
2014-09-20 00:24:36 +00:00
|
|
|
int p2, int p3, EnumFacing facing, int p5);
|
2012-08-19 14:13:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static VillagerRegistry instance()
|
|
|
|
{
|
|
|
|
return INSTANCE;
|
|
|
|
}
|
|
|
|
|
2013-06-29 17:33:14 +00:00
|
|
|
/**
|
|
|
|
* Register your villager id
|
|
|
|
* @param id
|
|
|
|
*/
|
2015-03-15 20:22:28 +00:00
|
|
|
@Deprecated // Doesn't work at all.
|
2013-06-29 17:33:14 +00:00
|
|
|
public void registerVillagerId(int id)
|
|
|
|
{
|
|
|
|
if (newVillagerIds.contains(id))
|
|
|
|
{
|
|
|
|
FMLLog.severe("Attempt to register duplicate villager id %d", id);
|
|
|
|
throw new RuntimeException();
|
|
|
|
}
|
|
|
|
newVillagerIds.add(id);
|
|
|
|
}
|
2012-08-19 14:30:24 +00:00
|
|
|
/**
|
|
|
|
* Register a new skin for a villager type
|
|
|
|
*
|
|
|
|
* @param villagerId
|
|
|
|
* @param villagerSkin
|
|
|
|
*/
|
2013-06-29 17:33:14 +00:00
|
|
|
@SideOnly(Side.CLIENT)
|
2015-03-15 20:22:28 +00:00
|
|
|
@Deprecated // Doesn't work at all.
|
2013-06-29 17:33:14 +00:00
|
|
|
public void registerVillagerSkin(int villagerId, ResourceLocation villagerSkin)
|
2012-08-19 14:13:15 +00:00
|
|
|
{
|
2013-06-29 17:33:14 +00:00
|
|
|
if (newVillagers == null)
|
2012-08-19 14:13:15 +00:00
|
|
|
{
|
2013-06-29 17:33:14 +00:00
|
|
|
newVillagers = Maps.newHashMap();
|
2012-08-19 14:13:15 +00:00
|
|
|
}
|
|
|
|
newVillagers.put(villagerId, villagerSkin);
|
|
|
|
}
|
|
|
|
|
2012-08-19 14:30:24 +00:00
|
|
|
/**
|
|
|
|
* Register a new village creation handler
|
|
|
|
*
|
|
|
|
* @param handler
|
|
|
|
*/
|
|
|
|
public void registerVillageCreationHandler(IVillageCreationHandler handler)
|
|
|
|
{
|
2012-08-19 15:23:29 +00:00
|
|
|
villageCreationHandlers.put(handler.getComponentClass(), handler);
|
2012-08-19 14:30:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback to setup new villager types
|
|
|
|
*
|
|
|
|
* @param villagerType
|
|
|
|
* @param defaultSkin
|
|
|
|
*/
|
2013-06-29 17:33:14 +00:00
|
|
|
@SideOnly(Side.CLIENT)
|
2015-03-15 20:22:28 +00:00
|
|
|
@Deprecated // Doesn't work at all.
|
2013-06-29 17:33:14 +00:00
|
|
|
public static ResourceLocation getVillagerSkin(int villagerType, ResourceLocation defaultSkin)
|
2012-08-19 14:13:15 +00:00
|
|
|
{
|
2013-07-16 17:32:29 +00:00
|
|
|
if (instance().newVillagers != null && instance().newVillagers.containsKey(villagerType))
|
2012-08-19 14:13:15 +00:00
|
|
|
{
|
|
|
|
return instance().newVillagers.get(villagerType);
|
|
|
|
}
|
|
|
|
return defaultSkin;
|
|
|
|
}
|
2013-01-22 02:37:29 +00:00
|
|
|
|
2013-01-07 22:55:17 +00:00
|
|
|
/**
|
|
|
|
* Returns a list of all added villager types
|
2013-01-22 02:37:29 +00:00
|
|
|
*
|
2013-01-07 22:55:17 +00:00
|
|
|
* @return newVillagerIds
|
|
|
|
*/
|
2015-03-15 20:22:28 +00:00
|
|
|
@Deprecated // Doesn't work at all.
|
2013-01-07 22:55:17 +00:00
|
|
|
public static Collection<Integer> getRegisteredVillagers()
|
|
|
|
{
|
|
|
|
return Collections.unmodifiableCollection(instance().newVillagerIds);
|
|
|
|
}
|
2012-08-19 14:13:15 +00:00
|
|
|
|
2015-11-13 07:32:08 +00:00
|
|
|
public static void addExtraVillageComponents(List<PieceWeight> list, Random random, int i)
|
2012-08-19 14:13:15 +00:00
|
|
|
{
|
2015-11-13 07:32:08 +00:00
|
|
|
List<StructureVillagePieces.PieceWeight> parts = list;
|
2012-08-19 15:23:29 +00:00
|
|
|
for (IVillageCreationHandler handler : instance().villageCreationHandlers.values())
|
2012-08-19 14:13:15 +00:00
|
|
|
{
|
2012-08-19 15:23:29 +00:00
|
|
|
parts.add(handler.getVillagePieceWeight(random, i));
|
2012-08-19 14:13:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-13 07:32:08 +00:00
|
|
|
public static Village getVillageComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List<StructureComponent> pieces, Random random,
|
2014-09-20 00:24:36 +00:00
|
|
|
int p1, int p2, int p3, EnumFacing facing, int p5)
|
2012-08-19 15:23:29 +00:00
|
|
|
{
|
2014-09-20 00:24:36 +00:00
|
|
|
return instance().villageCreationHandlers.get(villagePiece.villagePieceClass).buildComponent(villagePiece, startPiece, pieces, random, p1, p2, p3, facing, p5);
|
2012-08-19 15:23:29 +00:00
|
|
|
}
|
|
|
|
|
2014-09-20 00:24:36 +00:00
|
|
|
public void register(VillagerProfession prof)
|
|
|
|
{
|
2015-03-15 20:22:28 +00:00
|
|
|
register(prof, -1);
|
|
|
|
}
|
2015-11-27 03:38:21 +00:00
|
|
|
@SuppressWarnings("deprecation")
|
2015-03-15 20:22:28 +00:00
|
|
|
private void register(VillagerProfession prof, int id)
|
|
|
|
{
|
|
|
|
professions.register(id, prof.name, prof);
|
2014-09-20 00:24:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private boolean hasInit = false;
|
2015-03-15 20:22:28 +00:00
|
|
|
private FMLControlledNamespacedRegistry<VillagerProfession> professions = GameData.createRegistry("villagerprofessions", VillagerProfession.class, 0, 1024);
|
2014-09-23 02:30:14 +00:00
|
|
|
|
2012-08-23 05:40:03 +00:00
|
|
|
|
2014-09-20 00:24:36 +00:00
|
|
|
private void init()
|
2012-08-23 05:40:03 +00:00
|
|
|
{
|
2014-09-20 00:24:36 +00:00
|
|
|
if (hasInit)
|
|
|
|
return;
|
|
|
|
|
|
|
|
VillagerProfession prof = new VillagerProfession("minecraft:farmer", "minecraft:textures/entity/villager/farmer.png");
|
|
|
|
{
|
2015-03-15 20:22:28 +00:00
|
|
|
register(prof, 0);
|
2014-09-23 02:30:14 +00:00
|
|
|
(new VillagerCareer(prof, "farmer" )).init(VanillaTrades.trades[0][0]);
|
|
|
|
(new VillagerCareer(prof, "fisherman" )).init(VanillaTrades.trades[0][1]);
|
|
|
|
(new VillagerCareer(prof, "shepherd" )).init(VanillaTrades.trades[0][2]);
|
|
|
|
(new VillagerCareer(prof, "fletcher" )).init(VanillaTrades.trades[0][3]);
|
2014-09-20 00:24:36 +00:00
|
|
|
}
|
|
|
|
prof = new VillagerProfession("minecraft:librarian", "minecraft:textures/entity/villager/librarian.png");
|
|
|
|
{
|
2015-03-15 20:22:28 +00:00
|
|
|
register(prof, 1);
|
2014-09-23 02:30:14 +00:00
|
|
|
(new VillagerCareer(prof, "librarian")).init(VanillaTrades.trades[1][0]);
|
2014-09-20 00:24:36 +00:00
|
|
|
}
|
|
|
|
prof = new VillagerProfession("minecraft:priest", "minecraft:textures/entity/villager/priest.png");
|
|
|
|
{
|
2015-03-15 20:22:28 +00:00
|
|
|
register(prof, 2);
|
2014-09-23 02:30:14 +00:00
|
|
|
(new VillagerCareer(prof, "cleric")).init(VanillaTrades.trades[2][0]);
|
2014-09-20 00:24:36 +00:00
|
|
|
}
|
|
|
|
prof = new VillagerProfession("minecraft:smith", "minecraft:textures/entity/villager/smith.png");
|
2012-08-23 05:40:03 +00:00
|
|
|
{
|
2015-03-15 20:22:28 +00:00
|
|
|
register(prof, 3);
|
2014-09-23 02:30:14 +00:00
|
|
|
(new VillagerCareer(prof, "armor" )).init(VanillaTrades.trades[3][0]);
|
|
|
|
(new VillagerCareer(prof, "weapon")).init(VanillaTrades.trades[3][1]);
|
|
|
|
(new VillagerCareer(prof, "tool" )).init(VanillaTrades.trades[3][2]);
|
2014-09-20 00:24:36 +00:00
|
|
|
}
|
|
|
|
prof = new VillagerProfession("minecraft:butcher", "minecraft:textures/entity/villager/butcher.png");
|
|
|
|
{
|
2015-03-15 20:22:28 +00:00
|
|
|
register(prof, 4);
|
2014-09-23 02:30:14 +00:00
|
|
|
(new VillagerCareer(prof, "butcher")).init(VanillaTrades.trades[4][0]);
|
|
|
|
(new VillagerCareer(prof, "leather")).init(VanillaTrades.trades[4][1]);
|
2012-08-23 05:40:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-20 00:24:36 +00:00
|
|
|
public static class VillagerProfession
|
2012-08-23 05:40:03 +00:00
|
|
|
{
|
2014-09-20 00:24:36 +00:00
|
|
|
private ResourceLocation name;
|
2015-11-27 03:38:21 +00:00
|
|
|
//private ResourceLocation texture;
|
2014-09-20 00:24:36 +00:00
|
|
|
private List<VillagerCareer> careers = Lists.newArrayList();
|
2015-03-15 20:22:28 +00:00
|
|
|
private RegistryDelegate<VillagerProfession> delegate = GameData.getRegistry("villagerprofessions", VillagerProfession.class).getDelegate(this, VillagerProfession.class);
|
2014-09-20 00:24:36 +00:00
|
|
|
|
|
|
|
public VillagerProfession(String name, String texture)
|
2012-08-23 05:40:03 +00:00
|
|
|
{
|
2014-09-20 00:24:36 +00:00
|
|
|
this.name = new ResourceLocation(name);
|
2015-11-27 03:38:21 +00:00
|
|
|
//this.texture = new ResourceLocation(texture);
|
2015-03-15 20:22:28 +00:00
|
|
|
((RegistryDelegate.Delegate<VillagerProfession>)delegate).setName(name);
|
2014-09-20 00:24:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void register(VillagerCareer career)
|
|
|
|
{
|
|
|
|
Validate.isTrue(!careers.contains(career), "Attempted to register career that is already registered.");
|
|
|
|
Validate.isTrue(career.profession == this, "Attempted to register career for the wrong profession.");
|
2015-11-27 03:38:21 +00:00
|
|
|
//career.id = careers.size();
|
2014-09-20 00:24:36 +00:00
|
|
|
careers.add(career);
|
2012-08-23 05:40:03 +00:00
|
|
|
}
|
|
|
|
}
|
2012-09-15 19:49:08 +00:00
|
|
|
|
2014-09-20 00:24:36 +00:00
|
|
|
public static class VillagerCareer
|
2012-09-15 19:49:08 +00:00
|
|
|
{
|
2014-09-20 00:24:36 +00:00
|
|
|
private VillagerProfession profession;
|
|
|
|
private String name;
|
2015-11-27 03:38:21 +00:00
|
|
|
//private int id;
|
2014-09-20 00:24:36 +00:00
|
|
|
public VillagerCareer(VillagerProfession parent, String name)
|
|
|
|
{
|
|
|
|
this.profession = parent;
|
|
|
|
this.name = name;
|
|
|
|
parent.register(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
private VillagerCareer init(EntityVillager.ITradeList[][] traids)
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean equals(Object o)
|
|
|
|
{
|
|
|
|
if (o == this) return true;
|
|
|
|
if (!(o instanceof VillagerCareer)) return false;
|
|
|
|
VillagerCareer oc = (VillagerCareer)o;
|
|
|
|
return name.equals(oc.name) && profession == oc.profession;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hook called when spawning a Villager, sets it's profession to a random registered profession.
|
|
|
|
*
|
|
|
|
* @param entity The new entity
|
|
|
|
* @param rand The world's RNG
|
|
|
|
*/
|
|
|
|
public static void setRandomProfession(EntityVillager entity, Random rand)
|
|
|
|
{
|
2015-11-27 03:38:21 +00:00
|
|
|
//int count = INSTANCE.professions.getKeys().size();
|
|
|
|
//int prof = rand.nextInt(count);
|
2014-09-20 00:24:36 +00:00
|
|
|
//TODO: Grab id range from internal registry
|
|
|
|
entity.setProfession(rand.nextInt(5));
|
2012-09-15 19:49:08 +00:00
|
|
|
}
|
2014-09-20 00:24:36 +00:00
|
|
|
|
|
|
|
//TODO: Figure out a good generic system for this. Put on hold for Patches.
|
2014-09-23 02:30:14 +00:00
|
|
|
|
|
|
|
private static class VanillaTrades
|
|
|
|
{
|
|
|
|
//This field is moved from EntityVillager over to here.
|
|
|
|
//Moved to inner class to stop static initializer issues.
|
|
|
|
//It is nasty I know but it's vanilla.
|
|
|
|
private static final ITradeList[][][][] trades =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.wheat, new PriceInfo(18, 22)),
|
|
|
|
new EmeraldForItems(Items.potato, new PriceInfo(15, 19)),
|
|
|
|
new EmeraldForItems(Items.carrot, new PriceInfo(15, 19)),
|
|
|
|
new ListItemForEmeralds(Items.bread, new PriceInfo(-4, -2))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Item.getItemFromBlock(Blocks.pumpkin), new PriceInfo(8, 13)),
|
|
|
|
new ListItemForEmeralds(Items.pumpkin_pie, new PriceInfo(-3, -2))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Item.getItemFromBlock(Blocks.melon_block), new PriceInfo(7, 12)),
|
|
|
|
new ListItemForEmeralds(Items.apple, new PriceInfo(-5, -7))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListItemForEmeralds(Items.cookie, new PriceInfo(-6, -10)),
|
|
|
|
new ListItemForEmeralds(Items.cake, new PriceInfo(1, 1))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.string, new PriceInfo(15, 20)),
|
|
|
|
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
|
2014-09-30 09:20:56 +00:00
|
|
|
new ItemAndEmeraldToItem(Items.fish, new PriceInfo(6, 6), Items.cooked_fish, new PriceInfo(6, 6))
|
2014-09-23 02:30:14 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListEnchantedItemForEmeralds(Items.fishing_rod, new PriceInfo(7, 8))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Item.getItemFromBlock(Blocks.wool), new PriceInfo(16, 22)),
|
|
|
|
new ListItemForEmeralds(Items.shears, new PriceInfo(3, 4))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 0), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 1), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 2), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 3), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 4), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 5), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 6), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 7), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 8), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 9), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 10), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 11), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 12), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 13), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 14), new PriceInfo(1, 2)),
|
|
|
|
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 15), new PriceInfo(1, 2))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.string, new PriceInfo(15, 20)),
|
|
|
|
new ListItemForEmeralds(Items.arrow, new PriceInfo(-12, -8))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListItemForEmeralds(Items.bow, new PriceInfo(2, 3)),
|
|
|
|
new ItemAndEmeraldToItem(Item.getItemFromBlock(Blocks.gravel), new PriceInfo(10, 10), Items.flint, new PriceInfo(6, 10))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.paper, new PriceInfo(24, 36)),
|
|
|
|
new ListEnchantedBookForEmeralds()
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.book, new PriceInfo(8, 10)),
|
|
|
|
new ListItemForEmeralds(Items.compass, new PriceInfo(10, 12)),
|
|
|
|
new ListItemForEmeralds(Item.getItemFromBlock(Blocks.bookshelf), new PriceInfo(3, 4))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.written_book, new PriceInfo(2, 2)),
|
|
|
|
new ListItemForEmeralds(Items.clock, new PriceInfo(10, 12)),
|
|
|
|
new ListItemForEmeralds(Item.getItemFromBlock(Blocks.glass), new PriceInfo(-5, -3))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListEnchantedBookForEmeralds()
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListEnchantedBookForEmeralds()
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListItemForEmeralds(Items.name_tag, new PriceInfo(20, 22))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.rotten_flesh, new PriceInfo(36, 40)),
|
|
|
|
new EmeraldForItems(Items.gold_ingot, new PriceInfo(8, 10))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListItemForEmeralds(Items.redstone, new PriceInfo(-4, -1)),
|
2014-12-02 02:28:18 +00:00
|
|
|
new ListItemForEmeralds(new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()),
|
2014-09-23 02:30:14 +00:00
|
|
|
new PriceInfo(-2, -1))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListItemForEmeralds(Items.ender_eye, new PriceInfo(7, 11)),
|
|
|
|
new ListItemForEmeralds(Item.getItemFromBlock(Blocks.glowstone), new PriceInfo(-3, -1))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListItemForEmeralds(Items.experience_bottle, new PriceInfo(3, 11))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
|
|
|
|
new ListItemForEmeralds(Items.iron_helmet, new PriceInfo(4, 6))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.iron_ingot, new PriceInfo(7, 9)),
|
|
|
|
new ListItemForEmeralds(Items.iron_chestplate, new PriceInfo(10, 14))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.diamond, new PriceInfo(3, 4)),
|
|
|
|
new ListEnchantedItemForEmeralds(Items.diamond_chestplate, new PriceInfo(16, 19))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListItemForEmeralds(Items.chainmail_boots, new PriceInfo(5, 7)),
|
|
|
|
new ListItemForEmeralds(Items.chainmail_leggings, new PriceInfo(9, 11)),
|
|
|
|
new ListItemForEmeralds(Items.chainmail_helmet, new PriceInfo(5, 7)),
|
|
|
|
new ListItemForEmeralds(Items.chainmail_chestplate, new PriceInfo(11, 15))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
|
|
|
|
new ListItemForEmeralds(Items.iron_axe, new PriceInfo(6, 8))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.iron_ingot, new PriceInfo(7, 9)),
|
|
|
|
new ListEnchantedItemForEmeralds(Items.iron_sword, new PriceInfo(9, 10))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.diamond, new PriceInfo(3, 4)),
|
|
|
|
new ListEnchantedItemForEmeralds(Items.diamond_sword, new PriceInfo(12, 15)),
|
|
|
|
new ListEnchantedItemForEmeralds(Items.diamond_axe, new PriceInfo(9, 12))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
|
|
|
|
new ListEnchantedItemForEmeralds(Items.iron_shovel, new PriceInfo(5, 7))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.iron_ingot, new PriceInfo(7, 9)),
|
|
|
|
new ListEnchantedItemForEmeralds(Items.iron_pickaxe, new PriceInfo(9, 11))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.diamond, new PriceInfo(3, 4)),
|
|
|
|
new ListEnchantedItemForEmeralds(Items.diamond_pickaxe, new PriceInfo(12, 15))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.porkchop, new PriceInfo(14, 18)),
|
|
|
|
new EmeraldForItems(Items.chicken, new PriceInfo(14, 18))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
|
|
|
|
new ListItemForEmeralds(Items.cooked_porkchop, new PriceInfo(-7, -5)),
|
|
|
|
new ListItemForEmeralds(Items.cooked_chicken, new PriceInfo(-8, -6))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new EmeraldForItems(Items.leather, new PriceInfo(9, 12)),
|
|
|
|
new ListItemForEmeralds(Items.leather_leggings, new PriceInfo(2, 4))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListEnchantedItemForEmeralds(Items.leather_chestplate, new PriceInfo(7, 12))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
new ListItemForEmeralds(Items.saddle, new PriceInfo(8, 10))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2012-08-19 14:13:15 +00:00
|
|
|
}
|