Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15d53aeea2 | ||
|
|
d2d2190950 | ||
|
|
0d00ff00cb | ||
|
|
9a5bdf55ca | ||
|
|
0a571dd576 | ||
|
|
30befc896c |
No files matched your search
@@ -2,7 +2,7 @@ minecraft_version=1.7.10
|
||||
forge_version=10.13.4.1614-1.7.10
|
||||
forgeDep_version=10.13.4.1614
|
||||
|
||||
mod_version=2.3.1.1_beta
|
||||
mod_version=2.3.1.3_beta
|
||||
|
||||
#Comment out this line to get rid of the appendix
|
||||
#mod_appendix=beta
|
||||
|
||||
@@ -207,6 +207,7 @@ enderio.vibrantCrystal.name=Vibrant Crystal
|
||||
enderio.enderCrystal.name=Ender Crystal
|
||||
enderio.attractorCrystal.name=Enticing Crystal
|
||||
enderio.weatherCrystal.name=Weather Crystal
|
||||
|
||||
enderio.darkGrindingBall.name=Dark Steel Ball
|
||||
enderio.electricalGrindingBall.name=Electrical Steel Ball
|
||||
enderio.energeticGrindingBall.name=Energetic Alloy Ball
|
||||
@@ -216,6 +217,7 @@ enderio.conductiveGrindingBall.name=Conductive Iron Ball
|
||||
enderio.pulsatingGrindingBall.name=Pulsating Iron Ball
|
||||
enderio.soulariumGrindingBall.name=Soularium Ball
|
||||
enderio.endSteelGrindingBall.name=End Steel Ball
|
||||
|
||||
enderio.darkGrindingBall.tooltip.detailed.line1=SAG Mill Grinding Ball
|
||||
enderio.darkGrindingBall.tooltip.detailed.line2=Main Output
|
||||
enderio.darkGrindingBall.tooltip.detailed.line3=Bonus Output
|
||||
@@ -250,6 +252,23 @@ enderio.darkSteel.name=Dark Steel
|
||||
enderio.soularium.name=Soularium
|
||||
enderio.endSteel.name=End Steel
|
||||
enderio.endSteelNugget.name=End Steel Nugget
|
||||
|
||||
enderio.crudeSteel.name=Crude Steel
|
||||
enderio.crystallineAlloy.name=Crystalline Alloy
|
||||
enderio.melodicAlloy.name=Melodic Alloy
|
||||
enderio.stellarAlloy.name=Stellar Alloy
|
||||
enderio.crystallinePinkSlime.name=Crystalline Pink Slime
|
||||
enderio.energeticSilver.name=Energetic Silver
|
||||
enderio.vividAlloy.name=Vivid Alloy
|
||||
|
||||
enderio.crudeSteelGrindingBall.name=Crude Steel Grinding Ball
|
||||
enderio.crystallineAlloyGrindingBall.name=Crystalline Alloy Grinding Ball
|
||||
enderio.melodicAlloyGrindingBall.name=Melodic Alloy Grinding Ball
|
||||
enderio.stellarAlloyGrindingBall.name=Stellar Alloy Grinding Ball
|
||||
enderio.crystallinePinkSlimeGrindingBall.name=Crystalline Pink Slime Grinding Ball
|
||||
enderio.energeticSilverGrindingBall.name=Energetic Silver Grinding Ball
|
||||
enderio.vividAlloyGrindingBall.name=Vivid Alloy Grinding Ball
|
||||
|
||||
enderio.precientCrystal.name=Precient Crystal
|
||||
enderio.pulsatingPowder.name=Grains of Piezallity
|
||||
enderio.vibrantPowder.name=Grains of Vibrancy
|
||||
@@ -280,6 +299,14 @@ tile.enderio.darkSteel.name=Dark Steel Block
|
||||
tile.enderio.soularium.name=Soularium Block
|
||||
tile.enderio.endSteel.name=End Steel Block
|
||||
|
||||
tile.enderio.crudeSteel.name=Crude Steel Block
|
||||
tile.enderio.crystallineAlloy.name=Crystalline Alloy Block
|
||||
tile.enderio.melodicAlloy.name=Melodic Alloy Block
|
||||
tile.enderio.stellarAlloy.name=Stellar Alloy Block
|
||||
tile.enderio.crystallinePinkSlime.name=Crystalline Pink Slime Block
|
||||
tile.enderio.energeticSilver.name=Energetic Silver Block
|
||||
tile.enderio.vividAlloy.name=Vivid Alloy Block
|
||||
|
||||
//Powder / Ingot
|
||||
enderio.powderCoal.name=Coal Powder
|
||||
enderio.powderIron.name=Iron Powder
|
||||
|
||||
|
After Width: | Height: | Size: 657 B |
|
After Width: | Height: | Size: 493 B |
|
After Width: | Height: | Size: 592 B |
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"animation": {
|
||||
"interpolate": true,
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 500
|
||||
},
|
||||
{
|
||||
"index": 0,
|
||||
"time": 100
|
||||
},
|
||||
{
|
||||
"index": 1,
|
||||
"time": 20
|
||||
},
|
||||
{
|
||||
"index": 0,
|
||||
"time": 100
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 499 B |
|
After Width: | Height: | Size: 419 B |
|
After Width: | Height: | Size: 541 B |
|
After Width: | Height: | Size: 481 B |
|
After Width: | Height: | Size: 550 B |
|
After Width: | Height: | Size: 607 B |
|
After Width: | Height: | Size: 470 B |
|
After Width: | Height: | Size: 572 B |
|
After Width: | Height: | Size: 538 B |
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"animation": {
|
||||
"interpolate": true,
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 500
|
||||
},
|
||||
{
|
||||
"index": 0,
|
||||
"time": 100
|
||||
},
|
||||
{
|
||||
"index": 1,
|
||||
"time": 20
|
||||
},
|
||||
{
|
||||
"index": 0,
|
||||
"time": 100
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 654 B |
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"animation": {
|
||||
"interpolate": true,
|
||||
"frames": [
|
||||
{
|
||||
"index": 0,
|
||||
"time": 500
|
||||
},
|
||||
{
|
||||
"index": 0,
|
||||
"time": 100
|
||||
},
|
||||
{
|
||||
"index": 1,
|
||||
"time": 20
|
||||
},
|
||||
{
|
||||
"index": 0,
|
||||
"time": 100
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 656 B |
|
After Width: | Height: | Size: 584 B |
|
After Width: | Height: | Size: 479 B |
|
After Width: | Height: | Size: 546 B |
|
After Width: | Height: | Size: 474 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 642 B |
|
After Width: | Height: | Size: 585 B |
@@ -152,6 +152,9 @@ import crazypants.enderio.material.ItemMaterial;
|
||||
import crazypants.enderio.material.ItemPowderIngot;
|
||||
import crazypants.enderio.material.MaterialRecipes;
|
||||
import crazypants.enderio.material.OreDictionaryPreferences;
|
||||
import crazypants.enderio.material.endergy.BlockIngotStorageEndergy;
|
||||
import crazypants.enderio.material.endergy.ItemAlloyEndergy;
|
||||
import crazypants.enderio.material.endergy.ItemGrindingBallEndergy;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.rail.BlockEnderRail;
|
||||
import crazypants.enderio.teleport.ItemTravelStaff;
|
||||
@@ -195,13 +198,16 @@ public class EnderIO {
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
public static ItemAlloy itemAlloy;
|
||||
public static ItemAlloy itemGrindingBall;
|
||||
public static ItemGrindingBall itemGrindingBall;
|
||||
public static ItemAlloyEndergy itemAlloyEndergy;
|
||||
public static ItemGrindingBallEndergy itemGrindingBallEndergy;
|
||||
public static BlockFusedQuartz blockFusedQuartz;
|
||||
public static ItemFusedQuartzFrame itemFusedQuartzFrame;
|
||||
public static ItemMachinePart itemMachinePart;
|
||||
public static ItemPowderIngot itemPowderIngot;
|
||||
public static ItemMaterial itemMaterial;
|
||||
public static BlockIngotStorage blockIngotStorage;
|
||||
public static BlockIngotStorageEndergy blockIngotStorageEndergy;
|
||||
public static BlockDarkSteelBars blockDarkIronBars;
|
||||
public static BlockSoulariumBars blockSoulariumBars;
|
||||
public static BlockEndSteelBars blockEndSteelBars;
|
||||
@@ -456,6 +462,8 @@ public class EnderIO {
|
||||
itemMaterial = ItemMaterial.create();
|
||||
itemAlloy = ItemAlloy.create();
|
||||
itemGrindingBall = ItemGrindingBall.create();
|
||||
itemAlloyEndergy = ItemAlloyEndergy.create();
|
||||
itemGrindingBallEndergy = ItemGrindingBallEndergy.create();
|
||||
itemPowderIngot = ItemPowderIngot.create();
|
||||
|
||||
registerFluids();
|
||||
@@ -470,6 +478,7 @@ public class EnderIO {
|
||||
itemSoulVessel = ItemSoulVessel.create();
|
||||
|
||||
blockIngotStorage = BlockIngotStorage.create();
|
||||
blockIngotStorageEndergy = BlockIngotStorageEndergy.create();
|
||||
|
||||
blockDarkIronBars = BlockDarkSteelBars.create();
|
||||
blockSoulariumBars = BlockSoulariumBars.create();
|
||||
|
||||
@@ -31,7 +31,9 @@ public enum ModObject {
|
||||
// Materials
|
||||
itemBasicCapacitor,
|
||||
itemAlloy,
|
||||
itemAlloyEndergy,
|
||||
itemGrindingBall,
|
||||
itemGrindingBallEndergy,
|
||||
itemMaterial,
|
||||
itemMachinePart,
|
||||
itemPowderIngot,
|
||||
@@ -88,6 +90,7 @@ public enum ModObject {
|
||||
blockDarkSteelLadder,
|
||||
blockReinforcedObsidian,
|
||||
blockIngotStorage,
|
||||
blockIngotStorageEndergy,
|
||||
|
||||
// Painter
|
||||
blockPainter,
|
||||
|
||||
@@ -45,6 +45,7 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
boolean sticky = false;
|
||||
FuzzyMode fuzzyMode = FuzzyMode.DISABLED;
|
||||
|
||||
int numItems;
|
||||
ItemStack[] items;
|
||||
|
||||
final List<int[]> oreIds;
|
||||
@@ -74,6 +75,7 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
|
||||
public ItemFilter(int numItems, boolean isAdvanced) {
|
||||
this.isAdvanced = isAdvanced;
|
||||
this.numItems = numItems;
|
||||
items = new ItemStack[numItems];
|
||||
oreIds = new ArrayList<int[]>(numItems);
|
||||
for(int i=0;i<numItems;i++) {
|
||||
@@ -248,6 +250,7 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
nbtRoot.setBoolean("sticky", sticky);
|
||||
nbtRoot.setBoolean("isAdvanced", isAdvanced);
|
||||
nbtRoot.setByte("fuzzyMode", (byte) fuzzyMode.ordinal());
|
||||
nbtRoot.setInteger("numItems", numItems);
|
||||
|
||||
int i = 0;
|
||||
for (ItemStack item : items) {
|
||||
@@ -279,8 +282,10 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
sticky = nbtRoot.getBoolean("sticky");
|
||||
isAdvanced = nbtRoot.getBoolean("isAdvanced");
|
||||
fuzzyMode = FuzzyMode.values()[nbtRoot.getByte("fuzzyMode") & 255];
|
||||
numItems = nbtRoot.getInteger("numItems");
|
||||
|
||||
if(numItems<10 && isAdvanced) numItems = 10;
|
||||
|
||||
int numItems = items.length;
|
||||
items = new ItemStack[numItems];
|
||||
oreIds.clear();
|
||||
for(int i=0;i<numItems;i++) {
|
||||
|
||||
@@ -4,7 +4,7 @@ public interface IDarkSteelItem {
|
||||
|
||||
int getIngotsRequiredForFullRepair();
|
||||
|
||||
public interface IEndSteelItem extends IDarkSteelItem{
|
||||
public interface IEndSteelItem extends IDarkSteelItem {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ public class ItemDarkSteelArmor extends ItemArmor implements IEnergyContainerIte
|
||||
@Override
|
||||
@Method(modid = "Thaumcraft")
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelHelmet) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 0)) {
|
||||
return 0;
|
||||
}
|
||||
return GogglesOfRevealingUpgrade.isUpgradeEquipped(player) ? 5 : 0;
|
||||
@@ -318,7 +318,7 @@ public class ItemDarkSteelArmor extends ItemArmor implements IEnergyContainerIte
|
||||
@Override
|
||||
@Method(modid = "Forestry")
|
||||
public boolean canSeePollination(EntityPlayer player, ItemStack armor, boolean doSee) {
|
||||
if(armor == null || armor.getItem() != DarkSteelItems.itemDarkSteelHelmet) {
|
||||
if(armor == null || DarkSteelItems.isArmorPart(armor.getItem(), 0)) {
|
||||
return false;
|
||||
}
|
||||
return NaturalistEyeUpgrade.isUpgradeEquipped(player);
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ApiaristArmorUpgrade extends AbstractUpgrade {
|
||||
|
||||
@Override
|
||||
public boolean hasUpgrade(ItemStack stack) {
|
||||
return super.hasUpgrade(stack) && stack.getItem() instanceof ItemDarkSteelArmor;
|
||||
return super.hasUpgrade(stack) && DarkSteelItems.isArmorPart(stack.getItem(), slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package crazypants.enderio.material.endergy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
public enum AlloyEndergy {
|
||||
|
||||
CRUDE_STEEL("crudeSteel", 2.0f),
|
||||
CRYSTALLINE_ALLOY("crystallineAlloy", 6.0f),
|
||||
MELODIC_ALLOY("melodicAlloy", 5.0f),
|
||||
STELLAR_ALLOY("stellarAlloy", 10.0f),
|
||||
CRYSTALLINE_PINK_SLIME("crystallinePinkSlime", 7.0f),
|
||||
ENERGETIC_SILVER("energeticSilver", 7.0f),
|
||||
VIVID_ALLOY("vividAlloy", 4.0f);
|
||||
|
||||
|
||||
public final String unlocalisedName;
|
||||
public final String iconKey;
|
||||
private final List<String> oreIngots = new ArrayList<String>();
|
||||
private final List<String> oreBlocks = new ArrayList<String>();
|
||||
private final float hardness;
|
||||
|
||||
private AlloyEndergy(String baseName, float hardness, String oreDictName) {
|
||||
this.unlocalisedName = "enderio." + baseName;
|
||||
this.iconKey = "enderio:" + baseName;
|
||||
if(oreDictName != null) {
|
||||
this.oreIngots.add("ingot" + StringUtils.capitalize(oreDictName));
|
||||
this.oreBlocks.add("block" + StringUtils.capitalize(oreDictName));
|
||||
}
|
||||
this.oreIngots.add("ingot" + StringUtils.capitalize(baseName));
|
||||
this.oreBlocks.add("block" + StringUtils.capitalize(baseName));
|
||||
this.hardness = hardness;
|
||||
}
|
||||
|
||||
private AlloyEndergy(String baseName, float hardness) {
|
||||
this(baseName, hardness, null);
|
||||
}
|
||||
|
||||
public float getHardness() {
|
||||
return hardness;
|
||||
}
|
||||
|
||||
public ItemStack getStackIngot() {
|
||||
return getStackIngot(1);
|
||||
}
|
||||
|
||||
public ItemStack getStackIngot(int size) {
|
||||
return new ItemStack(EnderIO.itemAlloyEndergy, size, ordinal());
|
||||
}
|
||||
|
||||
public ItemStack getStackBall(int size) {
|
||||
return new ItemStack(EnderIO.itemGrindingBallEndergy, size, ordinal());
|
||||
}
|
||||
|
||||
public ItemStack getStackBlock() {
|
||||
return getStackBlock(1);
|
||||
}
|
||||
|
||||
public ItemStack getStackBlock(int size) {
|
||||
return new ItemStack(EnderIO.blockIngotStorageEndergy, size, ordinal());
|
||||
}
|
||||
|
||||
public String getOreIngot() {
|
||||
return oreIngots.get(0);
|
||||
}
|
||||
|
||||
public String getOreBlock() {
|
||||
return oreBlocks.get(0);
|
||||
}
|
||||
|
||||
public List<String> getOreIngots() {
|
||||
return oreIngots;
|
||||
}
|
||||
|
||||
public List<String> getOreBlocks() {
|
||||
return oreBlocks;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package crazypants.enderio.material.endergy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
public class BlockIngotStorageEndergy extends BlockEio implements IAdvancedTooltipProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public static BlockIngotStorageEndergy create() {
|
||||
BlockIngotStorageEndergy res = new BlockIngotStorageEndergy();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
private BlockIngotStorageEndergy() {
|
||||
super(ModObject.blockIngotStorageEndergy.unlocalisedName, null, Material.iron);
|
||||
setStepSound(soundTypeMetal);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
GameRegistry.registerBlock(this, BlockItemIngotStorageEndergy.class, ModObject.blockIngotStorageEndergy.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
icons = new IIcon[AlloyEndergy.values().length];
|
||||
for (AlloyEndergy alloy : AlloyEndergy.values()) {
|
||||
icons[alloy.ordinal()] = register.registerIcon(alloy.iconKey + "Block");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
meta = MathHelper.clamp_int(meta, 0, AlloyEndergy.values().length - 1);
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World world, int x, int y, int z) {
|
||||
return world.getBlockMetadata(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(World world, int x, int y, int z) {
|
||||
return AlloyEndergy.values()[world.getBlockMetadata(x, y, z)].getHardness();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) {
|
||||
return getBlockHardness(world, x, y, z) * 2.0f; // vanilla default is / 5.0f, this means hardness*2 = resistance
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
list.add(EnderIO.lang.localize("tooltip.isBeaconBase"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package crazypants.enderio.material.endergy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockItemIngotStorageEndergy extends ItemBlock {
|
||||
|
||||
public BlockItemIngotStorageEndergy(Block block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return "tile." + AlloyEndergy.values()[stack.getItemDamage()].unlocalisedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (AlloyEndergy alloy : AlloyEndergy.values()) {
|
||||
list.add(new ItemStack(this, 1, alloy.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package crazypants.enderio.material.endergy;
|
||||
|
||||
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 net.minecraft.util.MathHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
public class ItemAlloyEndergy extends Item {
|
||||
|
||||
static final boolean useNuggets = false;
|
||||
|
||||
protected final IIcon[] icons;
|
||||
protected final int numItems;
|
||||
|
||||
public static ItemAlloyEndergy create() {
|
||||
ItemAlloyEndergy alloy = new ItemAlloyEndergy();
|
||||
alloy.init();
|
||||
return alloy;
|
||||
}
|
||||
|
||||
protected ItemAlloyEndergy() {
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setUnlocalizedName(ModObject.itemAlloyEndergy.unlocalisedName);
|
||||
|
||||
numItems = AlloyEndergy.values().length;
|
||||
if(useNuggets) {
|
||||
numItems = numItems * 2;
|
||||
}
|
||||
icons = new IIcon[numItems];
|
||||
}
|
||||
|
||||
private void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemAlloyEndergy.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
damage = MathHelper.clamp_int(damage, 0, numItems - 1);
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
int numAlloys = AlloyEndergy.values().length;
|
||||
for (int i = 0; i < numAlloys; i++) {
|
||||
icons[i] = IIconRegister.registerIcon(AlloyEndergy.values()[i].iconKey);
|
||||
}
|
||||
if(useNuggets) {
|
||||
for (int i = 0; i < numAlloys; i++) {
|
||||
icons[i + numAlloys] = IIconRegister.registerIcon(AlloyEndergy.values()[i].iconKey + "Nugget");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, numItems - 1);
|
||||
if(i < AlloyEndergy.values().length) {
|
||||
return AlloyEndergy.values()[i].unlocalisedName;
|
||||
} else {
|
||||
return AlloyEndergy.values()[i - AlloyEndergy.values().length].unlocalisedName + "Nugget";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < numItems; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package crazypants.enderio.material.endergy;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.ModObject;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ItemGrindingBallEndergy extends ItemAlloyEndergy {
|
||||
|
||||
public static ItemGrindingBallEndergy create() {
|
||||
ItemGrindingBallEndergy ball = new ItemGrindingBallEndergy();
|
||||
ball.init();
|
||||
return ball;
|
||||
}
|
||||
|
||||
private ItemGrindingBallEndergy() {
|
||||
setUnlocalizedName(ModObject.itemGrindingBallEndergy.unlocalisedName);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemGrindingBallEndergy.unlocalisedName);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
damage = MathHelper.clamp_int(damage, 0, numItems - 1);
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
int numAlloys = AlloyEndergy.values().length;
|
||||
for (int i = 0; i < numAlloys; i++)
|
||||
icons[i] = IIconRegister.registerIcon(AlloyEndergy.values()[i].iconKey+"GrindingBall");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, numItems - 1);
|
||||
return AlloyEndergy.values()[i].unlocalisedName+"GrindingBall";
|
||||
}
|
||||
}
|
||||