Fix mundane component being really really really thirsty (#1218)
This commit is contained in:
parent
beb71e4c41
commit
33d6cdb3a9
8 changed files with 154 additions and 242 deletions
|
@ -1,137 +0,0 @@
|
|||
package WayofTime.bloodmagic.item;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemComponent extends Item implements IVariantProvider {
|
||||
public static final String REAGENT_WATER = "reagentWater";
|
||||
public static final String REAGENT_LAVA = "reagentLava";
|
||||
public static final String REAGENT_AIR = "reagentAir";
|
||||
public static final String REAGENT_FASTMINER = "reagentFastMiner";
|
||||
public static final String REAGENT_VOID = "reagentVoid";
|
||||
public static final String REAGENT_GROWTH = "reagentGrowth";
|
||||
public static final String REAGENT_AFFINITY = "reagentAffinity";
|
||||
public static final String REAGENT_SIGHT = "reagentSight";
|
||||
public static final String REAGENT_BINDING = "reagentBinding";
|
||||
public static final String REAGENT_SUPPRESSION = "reagentSuppression";
|
||||
public static final String COMPONENT_FRAME_PART = "frameParts";
|
||||
public static final String REAGENT_BLOODLIGHT = "reagentBloodLight";
|
||||
public static final String REAGENT_MAGNETISM = "reagentMagnetism";
|
||||
public static final String REAGENT_HASTE = "reagentHaste";
|
||||
public static final String REAGENT_COMPRESSION = "reagentCompression";
|
||||
public static final String REAGENT_BRIDGE = "reagentBridge";
|
||||
public static final String REAGENT_SEVERANCE = "reagentSeverance";
|
||||
public static final String REAGENT_TELEPOSITION = "reagentTeleposition";
|
||||
public static final String REAGENT_TRANSPOSITION = "reagentTransposition";
|
||||
public static final String SAND_IRON = "ironSand";
|
||||
public static final String SAND_GOLD = "goldSand";
|
||||
public static final String SAND_COAL = "coalSand";
|
||||
public static final String PLANT_OIL = "plantOil";
|
||||
public static final String SULFUR = "sulfur";
|
||||
public static final String SALTPETER = "saltpeter";
|
||||
public static final String NEURO_TOXIN = "neurotoxin";
|
||||
public static final String ANTISEPTIC = "antiseptic";
|
||||
public static final String REAGENT_HOLDING = "reagentHolding";
|
||||
public static final String CATALYST_LENGTH_1 = "mundaneLength";
|
||||
public static final String CATALYST_POWER_1 = "mundanePower";
|
||||
public static final String REAGENT_CLAW = "reagentClaw";
|
||||
public static final String REAGENT_BOUNCE = "reagentBounce";
|
||||
public static final String REAGENT_FROST = "reagentFrost";
|
||||
private static ArrayList<String> names = new ArrayList<String>();
|
||||
|
||||
public ItemComponent() {
|
||||
super();
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + ".baseComponent.");
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(BloodMagic.TAB_BM);
|
||||
|
||||
buildItemList();
|
||||
}
|
||||
|
||||
private void buildItemList() {
|
||||
names.add(0, REAGENT_WATER);
|
||||
names.add(1, REAGENT_LAVA);
|
||||
names.add(2, REAGENT_AIR);
|
||||
names.add(3, REAGENT_FASTMINER);
|
||||
names.add(4, REAGENT_VOID);
|
||||
names.add(5, REAGENT_GROWTH);
|
||||
names.add(6, REAGENT_AFFINITY);
|
||||
names.add(7, REAGENT_SIGHT);
|
||||
names.add(8, REAGENT_BINDING);
|
||||
names.add(9, REAGENT_SUPPRESSION);
|
||||
names.add(10, COMPONENT_FRAME_PART);
|
||||
names.add(11, REAGENT_BLOODLIGHT);
|
||||
names.add(12, REAGENT_MAGNETISM);
|
||||
names.add(13, REAGENT_HASTE);
|
||||
names.add(14, REAGENT_COMPRESSION);
|
||||
names.add(15, REAGENT_BRIDGE);
|
||||
names.add(16, REAGENT_SEVERANCE);
|
||||
names.add(17, REAGENT_TELEPOSITION);
|
||||
names.add(18, REAGENT_TRANSPOSITION);
|
||||
names.add(19, SAND_IRON);
|
||||
names.add(20, SAND_GOLD);
|
||||
names.add(21, SAND_COAL);
|
||||
names.add(22, PLANT_OIL);
|
||||
names.add(23, SULFUR);
|
||||
names.add(24, SALTPETER);
|
||||
names.add(25, NEURO_TOXIN);
|
||||
names.add(26, ANTISEPTIC);
|
||||
names.add(27, REAGENT_HOLDING);
|
||||
names.add(28, CATALYST_LENGTH_1);
|
||||
names.add(29, CATALYST_POWER_1);
|
||||
names.add(30, REAGENT_CLAW);
|
||||
names.add(31, REAGENT_BOUNCE);
|
||||
names.add(32, REAGENT_FROST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName(stack) + names.get(stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
|
||||
if (!isInCreativeTab(creativeTab))
|
||||
return;
|
||||
|
||||
for (int i = 0; i < names.size(); i++)
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pair<Integer, String>> getVariants() {
|
||||
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||
for (String name : names)
|
||||
ret.add(new ImmutablePair<Integer, String>(names.indexOf(name), "type=" + name));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static ItemStack getStack(String name) {
|
||||
return new ItemStack(RegistrarBloodMagicItems.COMPONENT, 1, names.indexOf(name));
|
||||
}
|
||||
|
||||
public static ItemStack getStack(String key, int stackSize) {
|
||||
ItemStack stack = getStack(key);
|
||||
stack.setCount(stackSize);
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ArrayList<String> getNames() {
|
||||
return names;
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ import WayofTime.bloodmagic.apibutnotreally.util.helper.NBTHelper;
|
|||
import WayofTime.bloodmagic.apibutnotreally.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.client.IMeshProvider;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.ItemComponent;
|
||||
import WayofTime.bloodmagic.item.types.ComponentTypes;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerRepairing;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeElytra;
|
||||
|
@ -97,7 +97,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) {
|
||||
return ItemStack.areItemsEqual(repair, ItemComponent.getStack(ItemComponent.REAGENT_BINDING));
|
||||
return ItemStack.areItemsEqual(repair, ComponentTypes.REAGENT_BINDING.getStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue