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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
package gtPlusPlus.xmod.forestry.bees.items.output;
import static gregtech.api.enums.Mods.GTPlusPlus;
import static gregtech.api.recipe.RecipeMaps.extractorRecipes;
import static gregtech.api.util.GTRecipeBuilder.TICKS;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.Tabs;
import gregtech.api.enums.GTValues;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.xmod.forestry.bees.handler.GTPPPropolisType;
import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
public class GTPPPropolis extends Item {
@SideOnly(Side.CLIENT)
private IIcon secondIcon;
public GTPPPropolis() {
super();
this.setCreativeTab(Tabs.tabApiculture);
this.setHasSubtypes(true);
this.setUnlocalizedName("gtpp.propolis");
GameRegistry.registerItem(this, "gtpp.propolis", GTPlusPlus.ID);
}
public ItemStack getStackForType(GTPPPropolisType type) {
return new ItemStack(this, 1, type.mID);
}
public ItemStack getStackForType(GTPPPropolisType type, int count) {
return new ItemStack(this, count, type.mID);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list) {
for (GTPPPropolisType type : GTPPPropolisType.values()) {
if (type.mShowInList) {
list.add(this.getStackForType(type));
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
this.itemIcon = par1IconRegister.registerIcon("forestry:propolis.0");
}
@Override
public IIcon getIcon(ItemStack stack, int pass) {
return itemIcon;
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass) {
return GTPPPropolisType.get(stack.getItemDamage())
.getColours();
}
@Override
public String getItemStackDisplayName(ItemStack stack) {
return GTPPPropolisType.get(stack.getItemDamage())
.getName();
}
public static void initPropolisRecipes() {
ItemStack tDrop;
Logger.BEES("Processing recipes for " + GTPP_Bees.sPropolisMappings.size() + " Propolis.");
for (GTPPPropolisType aProp : GTPP_Bees.sPropolisMappings.values()) {
tDrop = aProp.getStackForType(1);
if (addProcess(
tDrop,
aProp.mMaterial.getDust(1),
Math.min(Math.max(10000 - (aProp.mMaterial.vTier * 625), 100), 10000),
aProp.mMaterial.vTier * 20 * 15,
aProp.mMaterial.vVoltageMultiplier)) {
Logger.BEES("Added Propolis extraction recipe for: " + aProp.getName());
} else {
Logger.BEES("Failed to add Propolis extraction recipe for: " + aProp.getName());
}
}
}
public static boolean addProcess(ItemStack tDrop, ItemStack aOutput, int aChance, int aDuration, int aEUt) {
if (aOutput == null) {
return false;
}
GTValues.RA.stdBuilder()
.itemInputs(tDrop)
.itemOutputs(aOutput)
.outputChances(aChance)
.duration(aDuration * TICKS)
.eut(aEUt)
.addTo(extractorRecipes);
return true;
}
}
|