blob: ad49741726ff73ea4a51039288f78a5e5db462b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
package gtPlusPlus.plugin.villagers;
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.util.ResourceLocation;
public class VillagerObject {
public final int mID;
public final String mName;
public final IVillageTradeHandler mCustomTrade;
public VillagerObject(
int aID,
String aName,
Object aProfession,
Object aCareer,
Object aSkin,
IVillageTradeHandler aCustomTrade) {
mID = aID;
mName = aName;
mCustomTrade = aCustomTrade;
// Register Custom Trade to Registry.
if (aCustomTrade != null) {
Core_VillagerAdditions.mVillagerTrades.put(
new Pair<Integer, IVillageTradeHandler>(7735 + aID, aCustomTrade));
}
// Register Skin to Registry.
if (aSkin != null) {
if (aSkin instanceof String) {
String s = (String) aSkin;
aSkin = new ResourceLocation(CORE.MODID + ":" + "textures/entity/villager/" + s + ".png");
}
if (aSkin instanceof ResourceLocation) {
Core_VillagerAdditions.mVillagerSkins.put(aID, (ResourceLocation) aSkin);
}
}
VillagerUtils.registerNewVillager(aID, this);
}
}
|