mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-18 19:29:29 +00:00
Solar panels and buildscript cleanup
This commit is contained in:
1 parent
0166b8b26c
commit
bc0f99cd33
29 files changed
+613
-617
No files matched your search
@@ -1,11 +1,13 @@
|
||||
package emt.block;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -16,22 +18,45 @@ import net.minecraft.world.World;
|
||||
|
||||
public abstract class BlockBaseContainer extends BlockContainer {
|
||||
|
||||
public IIcon[] top = new IIcon[16];
|
||||
public IIcon[] bottom = new IIcon[16];
|
||||
public IIcon[] side = new IIcon[16];
|
||||
public IIcon[] frontOff = new IIcon[16];
|
||||
public IIcon[] frontOn = new IIcon[16];
|
||||
@SideOnly(Side.CLIENT)
|
||||
IconSet[] iconSets;
|
||||
|
||||
public int instance;
|
||||
public int countOfMetas;
|
||||
|
||||
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, float hardness) {
|
||||
this(unlocName, material, soundType, 1, hardness);
|
||||
}
|
||||
|
||||
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas, float hardness) {
|
||||
this(unlocName, material, soundType, countOfMetas, 0, hardness);
|
||||
}
|
||||
|
||||
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas, int curInstance, float hardness) {
|
||||
super(material);
|
||||
setBlockName(EMT.MOD_ID + "." + unlocName);
|
||||
setCreativeTab(EMT.TAB);
|
||||
setStepSound(soundType);
|
||||
setHardness(hardness);
|
||||
this.setBlockName(EMT.MOD_ID + "." + unlocName);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
this.setStepSound(soundType);
|
||||
this.setHardness(hardness);
|
||||
|
||||
this.countOfMetas = countOfMetas;
|
||||
this.instance = curInstance;
|
||||
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||
iconSets = new IconSet[countOfMetas];
|
||||
|
||||
for (int meta = 0; meta < countOfMetas; meta++) {
|
||||
iconSets[meta] = new IconSet();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IconSet[] getIconSets() {
|
||||
return iconSets;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -39,37 +64,54 @@ public abstract class BlockBaseContainer extends BlockContainer {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) {
|
||||
TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z);
|
||||
int i = access.getBlockMetadata(x, y, z);
|
||||
int meta = access.getBlockMetadata(x, y, z);
|
||||
|
||||
IconSet set = iconSets[meta];
|
||||
|
||||
if (side == 0) {
|
||||
return this.bottom[i];
|
||||
return set.bottom;
|
||||
}
|
||||
else if (side == 1) {
|
||||
return this.top[i];
|
||||
return set.top;
|
||||
}
|
||||
else if (side != tile.facing) {
|
||||
return this.side[i];
|
||||
return set.side;
|
||||
}
|
||||
else if (tile.isOn) {
|
||||
return this.frontOn[i];
|
||||
if (set.frontOn != null) {
|
||||
return set.frontOn;
|
||||
}
|
||||
|
||||
if (set.frontOff != null) {
|
||||
return set.frontOff;
|
||||
}
|
||||
|
||||
return set.side;
|
||||
}
|
||||
else {
|
||||
return this.frontOff[i];
|
||||
if (set.frontOff != null) {
|
||||
return set.frontOff;
|
||||
}
|
||||
|
||||
return set.side;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
IconSet set = iconSets[meta];
|
||||
|
||||
if (side < 1) {
|
||||
return this.bottom[meta];
|
||||
return set.bottom;
|
||||
}
|
||||
if (side == 1) {
|
||||
return this.top[meta];
|
||||
return set.top;
|
||||
}
|
||||
if (side == 3) {
|
||||
return this.frontOff[meta];
|
||||
return set.frontOff;
|
||||
}
|
||||
return this.side[meta];
|
||||
|
||||
return set.side;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,18 +119,36 @@ public abstract class BlockBaseContainer extends BlockContainer {
|
||||
int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z);
|
||||
|
||||
if (facing == 0)
|
||||
tile.facing = 2;
|
||||
else if (facing == 1)
|
||||
tile.facing = 5;
|
||||
else if (facing == 2)
|
||||
tile.facing = 3;
|
||||
else if (facing == 3)
|
||||
tile.facing = 4;
|
||||
switch (facing) {
|
||||
case 0:
|
||||
tile.facing = 2;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
tile.facing = 5;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
tile.facing = 3;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
tile.facing = 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static class IconSet {
|
||||
public IIcon top;
|
||||
public IIcon bottom;
|
||||
public IIcon side;
|
||||
public IIcon frontOff;
|
||||
public IIcon frontOn;
|
||||
}
|
||||
}
|
||||
@@ -22,31 +22,26 @@ import org.lwjgl.opengl.GL11;
|
||||
public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
|
||||
public BlockEssentiaGenerators(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, 4.0F);
|
||||
super(name, Material.iron, soundTypeMetal, 5, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.blockIcon = ri.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
super.registerBlockIcons(ir);
|
||||
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
this.top[i] = ri.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/top");
|
||||
for (int meta = 0; meta < 5; meta++) {
|
||||
iconSets[meta].top = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/top");
|
||||
iconSets[meta].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/top");
|
||||
iconSets[meta].side = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/side");
|
||||
}
|
||||
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
this.bottom[i] = ri.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/top");
|
||||
}
|
||||
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
this.side[i] = ri.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/side");
|
||||
}
|
||||
|
||||
this.frontOff[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/potentiafront");
|
||||
this.frontOff[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/ignisfront");
|
||||
this.frontOff[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/auramfront");
|
||||
this.frontOff[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/arborfront");
|
||||
this.frontOff[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
|
||||
iconSets[0].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/potentiafront");
|
||||
iconSets[1].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/ignisfront");
|
||||
iconSets[2].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/auramfront");
|
||||
iconSets[3].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/arborfront");
|
||||
iconSets[4].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -26,28 +26,30 @@ import emt.tile.TileEntityIndustrialWandRecharge;
|
||||
public class BlockMachines extends BlockBaseContainer {
|
||||
|
||||
public BlockMachines(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, 4.0F);
|
||||
super(name, Material.iron, soundTypeMetal, 2, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
super.registerBlockIcons(ir);
|
||||
|
||||
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
|
||||
this.top[0] = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
this.top[1] = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
iconSets[0].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
iconSets[1].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
|
||||
this.bottom[0] = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
|
||||
this.bottom[1] = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
|
||||
iconSets[0].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
|
||||
iconSets[1].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
|
||||
|
||||
this.side[0] = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
|
||||
this.side[1] = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
|
||||
iconSets[0].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
|
||||
iconSets[1].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
|
||||
|
||||
this.frontOff[0] = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
|
||||
this.frontOff[1] = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfront");
|
||||
iconSets[0].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
|
||||
iconSets[1].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfront");
|
||||
|
||||
this.frontOn[0] = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
|
||||
this.frontOn[1] = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfrontactive");
|
||||
iconSets[0].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
|
||||
iconSets[1].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfrontactive");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -84,15 +86,15 @@ public class BlockMachines extends BlockBaseContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
dropItems(world, x, y, z);
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z) {
|
||||
Random rand = new Random();
|
||||
|
||||
Random rand = world.rand;
|
||||
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (!(tileEntity instanceof IInventory)) {
|
||||
return;
|
||||
|
||||
@@ -3,13 +3,20 @@ package emt.block;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.block.BlockBaseContainer.IconSet;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import emt.tile.solar.air.TileEntityAirSolar;
|
||||
import emt.tile.solar.air.TileEntityDoubleAirSolar;
|
||||
import emt.tile.solar.air.TileEntityTripleAirSolar;
|
||||
import emt.tile.solar.compressed.TileEntityCompressedSolar;
|
||||
import emt.tile.solar.compressed.TileEntityDoubleCompressedSolar;
|
||||
import emt.tile.solar.compressed.TileEntityTripleCompressedSolar;
|
||||
import emt.tile.solar.dark.TileEntityDarkSolar;
|
||||
import emt.tile.solar.dark.TileEntityDoubleDarkSolar;
|
||||
import emt.tile.solar.dark.TileEntityTripleDarkSolar;
|
||||
import emt.tile.solar.earth.TileEntityDoubleEarthSolar;
|
||||
import emt.tile.solar.earth.TileEntityEarthSolar;
|
||||
import emt.tile.solar.earth.TileEntityTripleEarthSolar;
|
||||
import emt.tile.solar.fire.TileEntityDoubleFireSolar;
|
||||
import emt.tile.solar.fire.TileEntityFireSolar;
|
||||
import emt.tile.solar.fire.TileEntityTripleFireSolar;
|
||||
@@ -26,151 +33,197 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSolars extends BlockBaseContainer {
|
||||
|
||||
public BlockSolars(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, 4.0F);
|
||||
public BlockSolars(String name, int countOfMetas, int instance) {
|
||||
super(name, Material.iron, soundTypeMetal, countOfMetas, instance, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.top[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
this.top[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/doublesolartop");
|
||||
this.top[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/triplesolartop");
|
||||
this.top[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
this.top[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/doublesolartop");
|
||||
this.top[5] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/triplesolartop");
|
||||
this.top[6] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
this.top[7] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/doublesolartop");
|
||||
this.top[8] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/triplesolartop");
|
||||
this.top[9] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
this.top[10] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/doublesolartop");
|
||||
this.top[11] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/triplesolartop");
|
||||
this.top[12] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
this.top[13] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/doublesolartop");
|
||||
this.top[14] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/triplesolartop");
|
||||
this.top[15] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
IIcon solarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
IIcon doubleSolarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/doublesolartop");
|
||||
IIcon tripleSolarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/triplesolartop");
|
||||
IIcon bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
|
||||
this.bottom[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[5] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[6] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[7] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[8] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[9] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[10] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[11] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[12] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[13] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[14] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[15] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
if(instance == 0) {
|
||||
iconSets[0].top = solarTop;
|
||||
iconSets[1].top = doubleSolarTop;
|
||||
iconSets[2].top = tripleSolarTop;
|
||||
iconSets[3].top = solarTop;
|
||||
iconSets[4].top = doubleSolarTop;
|
||||
iconSets[5].top = tripleSolarTop;
|
||||
iconSets[6].top = solarTop;
|
||||
iconSets[7].top = doubleSolarTop;
|
||||
iconSets[8].top = tripleSolarTop;
|
||||
iconSets[9].top = solarTop;
|
||||
iconSets[10].top = doubleSolarTop;
|
||||
iconSets[11].top = tripleSolarTop;
|
||||
iconSets[12].top = solarTop;
|
||||
iconSets[13].top = doubleSolarTop;
|
||||
iconSets[14].top = tripleSolarTop;
|
||||
iconSets[15].top = solarTop;
|
||||
|
||||
iconSets[0].bottom = bottom;
|
||||
iconSets[1].bottom = bottom;
|
||||
iconSets[2].bottom = bottom;
|
||||
iconSets[3].bottom = bottom;
|
||||
iconSets[4].bottom = bottom;
|
||||
iconSets[5].bottom = bottom;
|
||||
iconSets[6].bottom = bottom;
|
||||
iconSets[7].bottom = bottom;
|
||||
iconSets[8].bottom = bottom;
|
||||
iconSets[9].bottom = bottom;
|
||||
iconSets[10].bottom = bottom;
|
||||
iconSets[11].bottom = bottom;
|
||||
iconSets[12].bottom = bottom;
|
||||
iconSets[13].bottom = bottom;
|
||||
iconSets[14].bottom = bottom;
|
||||
iconSets[15].bottom = bottom;
|
||||
|
||||
IIcon side = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/side");
|
||||
IIcon waterSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/water/waterside");
|
||||
IIcon darkSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/dark/darkside");
|
||||
IIcon orderSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/order/orderside");
|
||||
IIcon fireSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/fire/fireside");
|
||||
IIcon airSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
|
||||
|
||||
iconSets[0].side = side;
|
||||
iconSets[1].side = side;
|
||||
iconSets[2].side = side;
|
||||
iconSets[3].side = waterSide;
|
||||
iconSets[4].side = waterSide;
|
||||
iconSets[5].side = waterSide;
|
||||
iconSets[6].side = darkSide;
|
||||
iconSets[7].side = darkSide;
|
||||
iconSets[8].side = darkSide;
|
||||
iconSets[9].side = orderSide;
|
||||
iconSets[10].side = orderSide;
|
||||
iconSets[11].side = orderSide;
|
||||
iconSets[12].side = fireSide;
|
||||
iconSets[13].side = fireSide;
|
||||
iconSets[14].side = fireSide;
|
||||
iconSets[15].side = airSide;
|
||||
}
|
||||
if(instance == 1) {
|
||||
iconSets[0].top = doubleSolarTop;
|
||||
iconSets[1].top = tripleSolarTop;
|
||||
iconSets[2].top = solarTop;
|
||||
iconSets[3].top = doubleSolarTop;
|
||||
iconSets[4].top = tripleSolarTop;
|
||||
|
||||
this.frontOff[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/side");
|
||||
this.frontOff[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/side");
|
||||
this.frontOff[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/side");
|
||||
this.frontOff[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/water/waterside");
|
||||
this.frontOff[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/water/waterside");
|
||||
this.frontOff[5] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/water/waterside");
|
||||
this.frontOff[6] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/dark/darkside");
|
||||
this.frontOff[7] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/dark/darkside");
|
||||
this.frontOff[8] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/dark/darkside");
|
||||
this.frontOff[9] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/order/orderside");
|
||||
this.frontOff[10] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/order/orderside");
|
||||
this.frontOff[11] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/order/orderside");
|
||||
this.frontOff[12] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/fire/fireside");
|
||||
this.frontOff[13] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/fire/fireside");
|
||||
this.frontOff[14] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/fire/fireside");
|
||||
this.frontOff[15] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
|
||||
iconSets[0].bottom = bottom;
|
||||
iconSets[1].bottom = bottom;
|
||||
iconSets[2].bottom = bottom;
|
||||
iconSets[3].bottom = bottom;
|
||||
iconSets[4].bottom = bottom;
|
||||
|
||||
this.side[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/side");
|
||||
this.side[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/side");
|
||||
this.side[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/side");
|
||||
this.side[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/water/waterside");
|
||||
this.side[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/water/waterside");
|
||||
this.side[5] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/water/waterside");
|
||||
this.side[6] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/dark/darkside");
|
||||
this.side[7] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/dark/darkside");
|
||||
this.side[8] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/dark/darkside");
|
||||
this.side[9] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/order/orderside");
|
||||
this.side[10] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/order/orderside");
|
||||
this.side[11] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/order/orderside");
|
||||
this.side[12] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/fire/fireside");
|
||||
this.side[13] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/fire/fireside");
|
||||
this.side[14] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/fire/fireside");
|
||||
this.side[15] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
|
||||
IIcon airSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
|
||||
IIcon earthSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
|
||||
|
||||
iconSets[0].side = airSide;
|
||||
iconSets[1].side = airSide;
|
||||
iconSets[2].side = earthSide;
|
||||
iconSets[3].side = earthSide;
|
||||
iconSets[4].side = earthSide;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i <= 15; i++) {
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
if (instance == 0) {
|
||||
for (int meta = 0; meta < 16; meta++) {
|
||||
list.add(new ItemStack(id, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
if (instance == 1) {
|
||||
for (int meta = 0; meta < 5; meta++) {
|
||||
list.add(new ItemStack(id, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if (side < 1) {
|
||||
return iconSets[meta].bottom;
|
||||
}
|
||||
if (side == 1) {
|
||||
return iconSets[meta].top;
|
||||
}
|
||||
|
||||
return iconSets[meta].side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
if (meta == 0) {
|
||||
return new TileEntityCompressedSolar();
|
||||
if (instance == 0) {
|
||||
switch (meta) {
|
||||
case 0:
|
||||
return new TileEntityCompressedSolar();
|
||||
case 1:
|
||||
return new TileEntityDoubleCompressedSolar();
|
||||
case 2:
|
||||
return new TileEntityTripleCompressedSolar();
|
||||
case 3:
|
||||
return new TileEntityWaterSolar();
|
||||
case 4:
|
||||
return new TileEntityDoubleWaterSolar();
|
||||
case 5:
|
||||
return new TileEntityTripleWaterSolar();
|
||||
case 6:
|
||||
return new TileEntityDarkSolar();
|
||||
case 7:
|
||||
return new TileEntityDoubleDarkSolar();
|
||||
case 8:
|
||||
return new TileEntityTripleDarkSolar();
|
||||
case 9:
|
||||
return new TileEntityOrderSolar();
|
||||
case 10:
|
||||
return new TileEntityDoubleOrderSolar();
|
||||
case 11:
|
||||
return new TileEntityTripleOrderSolar();
|
||||
case 12:
|
||||
return new TileEntityFireSolar();
|
||||
case 13:
|
||||
return new TileEntityDoubleFireSolar();
|
||||
case 14:
|
||||
return new TileEntityTripleFireSolar();
|
||||
case 15:
|
||||
return new TileEntityAirSolar();
|
||||
}
|
||||
}
|
||||
if (meta == 1) {
|
||||
return new TileEntityDoubleCompressedSolar();
|
||||
}
|
||||
if (meta == 2) {
|
||||
return new TileEntityTripleCompressedSolar();
|
||||
}
|
||||
if (meta == 3) {
|
||||
return new TileEntityWaterSolar();
|
||||
}
|
||||
if (meta == 4) {
|
||||
return new TileEntityDoubleWaterSolar();
|
||||
}
|
||||
if (meta == 5) {
|
||||
return new TileEntityTripleWaterSolar();
|
||||
}
|
||||
if (meta == 6) {
|
||||
return new TileEntityDarkSolar();
|
||||
}
|
||||
if (meta == 7) {
|
||||
return new TileEntityDoubleDarkSolar();
|
||||
}
|
||||
if (meta == 8) {
|
||||
return new TileEntityTripleDarkSolar();
|
||||
}
|
||||
if (meta == 9) {
|
||||
return new TileEntityOrderSolar();
|
||||
}
|
||||
if (meta == 10) {
|
||||
return new TileEntityDoubleOrderSolar();
|
||||
}
|
||||
if (meta == 11) {
|
||||
return new TileEntityTripleOrderSolar();
|
||||
}
|
||||
if (meta == 12) {
|
||||
return new TileEntityFireSolar();
|
||||
}
|
||||
if (meta == 13) {
|
||||
return new TileEntityDoubleFireSolar();
|
||||
}
|
||||
if (meta == 14) {
|
||||
return new TileEntityTripleFireSolar();
|
||||
}
|
||||
if (meta == 15) {
|
||||
return new TileEntityAirSolar();
|
||||
|
||||
if (instance == 1) {
|
||||
|
||||
switch (meta) {
|
||||
case 0:
|
||||
return new TileEntityDoubleAirSolar();
|
||||
case 1:
|
||||
return new TileEntityTripleAirSolar();
|
||||
case 2:
|
||||
return new TileEntityEarthSolar();
|
||||
case 3:
|
||||
return new TileEntityDoubleEarthSolar();
|
||||
case 4:
|
||||
return new TileEntityTripleEarthSolar();
|
||||
}
|
||||
}
|
||||
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
package emt.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.tile.solar.air.TileEntityDoubleAirSolar;
|
||||
import emt.tile.solar.air.TileEntityTripleAirSolar;
|
||||
import emt.tile.solar.earth.TileEntityDoubleEarthSolar;
|
||||
import emt.tile.solar.earth.TileEntityEarthSolar;
|
||||
import emt.tile.solar.earth.TileEntityTripleEarthSolar;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
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.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSolars2 extends BlockBaseContainer {
|
||||
|
||||
public BlockSolars2(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.top[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
this.top[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
this.top[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
this.top[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/doublesolartop");
|
||||
this.top[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/triplesolartop");
|
||||
|
||||
this.bottom[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
this.bottom[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
|
||||
this.frontOff[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
|
||||
this.frontOff[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
|
||||
this.frontOff[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
|
||||
this.frontOff[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
|
||||
this.frontOff[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
|
||||
|
||||
this.side[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
|
||||
this.side[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
|
||||
this.side[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
|
||||
this.side[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
|
||||
this.side[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i <= 4; i++) {
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
if (meta == 0) {
|
||||
return new TileEntityDoubleAirSolar();
|
||||
}
|
||||
if (meta == 1) {
|
||||
return new TileEntityTripleAirSolar();
|
||||
}
|
||||
if (meta == 2) {
|
||||
return new TileEntityEarthSolar();
|
||||
}
|
||||
if (meta == 3) {
|
||||
return new TileEntityDoubleEarthSolar();
|
||||
}
|
||||
if (meta == 4) {
|
||||
return new TileEntityTripleEarthSolar();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
}
|
||||
@@ -7,13 +7,11 @@ import emt.block.BlockMachines;
|
||||
import emt.block.BlockPortableNode;
|
||||
import emt.block.BlockShield;
|
||||
import emt.block.BlockSolars;
|
||||
import emt.block.BlockSolars2;
|
||||
import emt.item.block.ItemBlockElectricCloud;
|
||||
import emt.item.block.ItemBlockEssentiaGenerator;
|
||||
import emt.item.block.ItemBlockEssentiaGenerators;
|
||||
import emt.item.block.ItemBlockMachines;
|
||||
import emt.item.block.ItemBlockSolars;
|
||||
import emt.item.block.ItemBlockSolars2;
|
||||
import ic2.api.item.IC2Items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Block.SoundType;
|
||||
@@ -35,11 +33,11 @@ public class EMTBlocks {
|
||||
shield = new BlockShield("shield");
|
||||
GameRegistry.registerBlock(shield, "ShieldBlock");
|
||||
|
||||
emtSolars = new BlockSolars("solar");
|
||||
emtSolars = new BlockSolars("solar", 16, 0);
|
||||
GameRegistry.registerBlock(emtSolars, ItemBlockSolars.class, "EMTSolars");
|
||||
|
||||
emtSolars2 = new BlockSolars2("solar2");
|
||||
GameRegistry.registerBlock(emtSolars2, ItemBlockSolars2.class, "EMTSolars2");
|
||||
emtSolars2 = new BlockSolars("solar2", 5, 1);
|
||||
GameRegistry.registerBlock(emtSolars2, ItemBlockSolars.class, "EMTSolars2");
|
||||
|
||||
emtMachines = new BlockMachines("machine");
|
||||
GameRegistry.registerBlock(emtMachines, ItemBlockMachines.class, "EMTMachines");
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.List;
|
||||
|
||||
public class ItemMaterials extends Item {
|
||||
|
||||
public IIcon[] icon = new IIcon[25];
|
||||
public IIcon[] icon = new IIcon[16];
|
||||
|
||||
public ItemMaterials() {
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
|
||||
@@ -34,6 +34,7 @@ import ic2.core.util.Keyboard;
|
||||
import ic2.core.util.StackUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -67,19 +68,18 @@ import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
|
||||
public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
|
||||
IIcon iconNONE;
|
||||
IIcon iconJETPACK;
|
||||
IIcon iconTHAUMIUM;
|
||||
IIcon iconNANO;
|
||||
IIcon iconQUANTUM;
|
||||
Random rnd;
|
||||
|
||||
public final byte NONE = 0;
|
||||
public final byte JETPACK = 1;
|
||||
public final byte THAUMIUM = 2;
|
||||
public final byte NANO = 3;
|
||||
public final byte QUANTUM = 4;
|
||||
|
||||
private IIcon iconNONE;
|
||||
private IIcon iconJETPACK;
|
||||
private IIcon iconTHAUMIUM;
|
||||
private IIcon iconNANO;
|
||||
private IIcon iconQUANTUM;
|
||||
|
||||
protected static ArrayList<Integer> potionRemovalCost = new ArrayList<Integer>();
|
||||
public static AudioSource audioSource;
|
||||
private static boolean lastJetpackUsed = false;
|
||||
@@ -88,7 +88,6 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
super(internalName, InternalName.quantum, armorType, 2000000, 12000.0D, 4);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
rnd = new Random();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -100,25 +99,26 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
iconNANO = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_n");
|
||||
iconQUANTUM = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_q");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
return "item." + EMT.MOD_ID + ".chestplates.infusedQuantum";
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack)
|
||||
{
|
||||
return (StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return (StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityLivingFallEvent(LivingFallEvent event) {
|
||||
if ((IC2.platform.isSimulating()) && ((event.entity instanceof EntityLivingBase))) {
|
||||
EntityLivingBase entity = (EntityLivingBase) event.entity;
|
||||
ItemStack armor = entity.getEquipmentInSlot(1);
|
||||
|
||||
if ((armor != null) && (armor.getItem() == this)) {
|
||||
int fallDamage = Math.max((int) event.distance - 10, 0);
|
||||
double energyCost = getEnergyPerDamage() * fallDamage;
|
||||
|
||||
if (energyCost <= ElectricItem.manager.getCharge(armor)) {
|
||||
ElectricItem.manager.discharge(armor, energyCost, Integer.MAX_VALUE, true, false, false);
|
||||
event.setCanceled(true);
|
||||
@@ -154,16 +154,16 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
byte wing = nbt.getByte("wing");
|
||||
|
||||
if (!world.isRemote) {
|
||||
|
||||
for (Object effect : player.getActivePotionEffects()) {
|
||||
if(potionRemovalCost.contains(new Integer(((PotionEffect)effect).getPotionID()))){
|
||||
IC2.platform.removePotion(player, ((PotionEffect)effect).getPotionID());
|
||||
|
||||
for (PotionEffect effect : (Collection<PotionEffect>) player.getActivePotionEffects()) {
|
||||
if (potionRemovalCost.contains(effect.getPotionID())) {
|
||||
IC2.platform.removePotion(player, effect.getPotionID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ItemStack currentStack = player.inventory.getCurrentItem();
|
||||
Item currentItem = currentStack == null? null : player.inventory.getCurrentItem().getItem();
|
||||
|
||||
Item currentItem = currentStack == null ? null : player.inventory.getCurrentItem().getItem();
|
||||
|
||||
if (nbt.hasKey("useother")) {
|
||||
String useother = nbt.getString("useother");
|
||||
if (useother.equals("Jetpack")) {
|
||||
@@ -283,21 +283,20 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nbt.setBoolean("unequip", false);
|
||||
}
|
||||
|
||||
|
||||
if ((IC2.keyboard.isJumpKeyDown(player) && wing == JETPACK) || (hoverMode && player.motionY < -0.029999999329447746D)) {
|
||||
jetpackUsed = useJetpack(player, hoverMode, itemStack);
|
||||
}
|
||||
|
||||
if (wing == THAUMIUM)
|
||||
useWing(player, itemStack, world, 0.15f, 0.7f, 0.5f, 0, false);
|
||||
useWings(player, itemStack, world, 0.15f, 0.7f, 0.5f, 0, false);
|
||||
if (wing == NANO)
|
||||
useWing(player, itemStack, world, 0.25f, 0.6f, 0.3f, 5, true);
|
||||
useWings(player, itemStack, world, 0.25f, 0.6f, 0.3f, 5, true);
|
||||
if (wing == QUANTUM)
|
||||
useWing(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
|
||||
useWings(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
|
||||
|
||||
if ((IC2.platform.isSimulating()) && (toggleTimer > 0)) {
|
||||
toggleTimer = (byte) (toggleTimer - 1);
|
||||
@@ -340,16 +339,16 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
|
||||
switch (wing) {
|
||||
case JETPACK:
|
||||
return iconJETPACK;
|
||||
case THAUMIUM:
|
||||
return iconTHAUMIUM;
|
||||
case NANO:
|
||||
return iconNANO;
|
||||
case QUANTUM:
|
||||
return iconQUANTUM;
|
||||
default:
|
||||
return iconNONE;
|
||||
case JETPACK:
|
||||
return iconJETPACK;
|
||||
case THAUMIUM:
|
||||
return iconTHAUMIUM;
|
||||
case NANO:
|
||||
return iconNANO;
|
||||
case QUANTUM:
|
||||
return iconQUANTUM;
|
||||
default:
|
||||
return iconNONE;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return iconNONE;
|
||||
@@ -362,16 +361,16 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
|
||||
switch (wing) {
|
||||
case JETPACK:
|
||||
return iconJETPACK;
|
||||
case THAUMIUM:
|
||||
return iconTHAUMIUM;
|
||||
case NANO:
|
||||
return iconNANO;
|
||||
case QUANTUM:
|
||||
return iconQUANTUM;
|
||||
default:
|
||||
return iconNONE;
|
||||
case JETPACK:
|
||||
return iconJETPACK;
|
||||
case THAUMIUM:
|
||||
return iconTHAUMIUM;
|
||||
case NANO:
|
||||
return iconNANO;
|
||||
case QUANTUM:
|
||||
return iconQUANTUM;
|
||||
default:
|
||||
return iconNONE;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return iconNONE;
|
||||
@@ -392,16 +391,16 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
|
||||
switch (wing) {
|
||||
case JETPACK:
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_jetpack.png";
|
||||
case THAUMIUM:
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_t.png";
|
||||
case NANO:
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_n.png";
|
||||
case QUANTUM:
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_q.png";
|
||||
default:
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum.png";
|
||||
case JETPACK:
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_jetpack.png";
|
||||
case THAUMIUM:
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_t.png";
|
||||
case NANO:
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_n.png";
|
||||
case QUANTUM:
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_q.png";
|
||||
default:
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum.png";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -436,20 +435,26 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
|
||||
public boolean useJetpack(EntityPlayer player, boolean hoverMode, ItemStack stack) {
|
||||
int jetpackMaxCharge = 30000;
|
||||
ItemStack jetpack = stack;
|
||||
if (ElectricItem.manager.getCharge(stack) <= 0)
|
||||
return false;
|
||||
float power = 1.0F;
|
||||
float dropPercentage = 0.05F;
|
||||
|
||||
if (ElectricItem.manager.getCharge(stack) <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (((float) ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) <= dropPercentage) {
|
||||
power = (float) (power * (ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) * dropPercentage);
|
||||
}
|
||||
|
||||
if (IC2.keyboard.isForwardKeyDown(player)) {
|
||||
float retruster = 3.5F;
|
||||
|
||||
if (hoverMode) {
|
||||
retruster = 0.5F;
|
||||
}
|
||||
|
||||
float forwardpower = power * retruster * 2.0F;
|
||||
|
||||
if (forwardpower > 0.0F) {
|
||||
player.moveFlying(0.0F, 0.4F * forwardpower, 0.02F);
|
||||
}
|
||||
@@ -458,14 +463,17 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
int worldHeight = IC2.getWorldHeight(player.worldObj);
|
||||
|
||||
double y = player.posY;
|
||||
|
||||
if (y > worldHeight - 25) {
|
||||
if (y > worldHeight) {
|
||||
y = worldHeight;
|
||||
}
|
||||
power = (float) (power * ((worldHeight - y) / 25.0D));
|
||||
}
|
||||
|
||||
double prevmotion = player.motionY;
|
||||
player.motionY = Math.min(player.motionY + power * 0.2F, 0.6000000238418579D);
|
||||
|
||||
if (hoverMode) {
|
||||
float maxHoverY = -0.025F;
|
||||
if (IC2.keyboard.isSneakKeyDown(player)) {
|
||||
@@ -492,34 +500,42 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
return true;
|
||||
}
|
||||
|
||||
void useWing(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount, boolean isElectric) {
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount, boolean isElectric) {
|
||||
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
|
||||
boolean isJumping = IC2.keyboard.isJumpKeyDown(player);
|
||||
nbtData.setBoolean("isJumping", isJumping);
|
||||
nbt.setBoolean("isJumping", isJumping);
|
||||
|
||||
if (isJumping) {
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", true);
|
||||
nbtData.setByte("f", (byte) (f + 1));
|
||||
if (f > 7)
|
||||
nbtData.setByte("f", (byte) 7);
|
||||
byte f = nbt.getByte("f");
|
||||
|
||||
nbt.setBoolean("isHolding", true);
|
||||
nbt.setByte("f", (byte) (f + 1));
|
||||
|
||||
if (f > 7) {
|
||||
nbt.setByte("f", (byte) 7);
|
||||
}
|
||||
}
|
||||
else if (nbtData.getBoolean("isHolding")) {
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", false);
|
||||
else if (nbt.getBoolean("isHolding")) {
|
||||
byte f = nbt.getByte("f");
|
||||
nbt.setBoolean("isHolding", false);
|
||||
player.motionY = motionY * f;
|
||||
if(isElectric)
|
||||
|
||||
if (isElectric) {
|
||||
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
|
||||
}
|
||||
|
||||
if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) {
|
||||
player.motionX /= motionXZ;
|
||||
player.motionZ /= motionXZ;
|
||||
}
|
||||
|
||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
world.spawnParticle("cloud", player.posX - 1 + (rnd.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (rnd.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
world.spawnParticle("cloud", player.posX - 1 + (world.rand.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (world.rand.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
}
|
||||
|
||||
nbtData.setByte("f", (byte) 0);
|
||||
nbt.setByte("f", (byte) 0);
|
||||
}
|
||||
|
||||
if (isJumping && !player.onGround && player.motionY < 0) {
|
||||
@@ -531,7 +547,11 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
}
|
||||
|
||||
if (EMTConfigHandler.impactOfRain) {
|
||||
if ((world.getBiomeGenForCoords((int) player.posX, (int) player.posZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky((int) player.posX, (int) player.posY, (int) player.posZ) && world.isRaining() && !player.capabilities.isCreativeMode) {
|
||||
int playerX = MathHelper.floor_double(player.posX);
|
||||
int playerY = MathHelper.floor_double(player.posY);
|
||||
int playerZ = MathHelper.floor_double(player.posZ);
|
||||
|
||||
if ((world.getBiomeGenForCoords(playerX, playerZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky(playerX, playerY, playerZ) && world.isRaining() && !player.capabilities.isCreativeMode) {
|
||||
player.motionY += -0.05;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
useWing(player, stack, world, 0.09f, 0.9f, 0.9f, 0);
|
||||
useWings(player, stack, world, 0.09f, 0.9f, 0.9f, 0);
|
||||
}
|
||||
|
||||
public void useWing(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount) {
|
||||
public void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount) {
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
boolean isJmuping = nbtData.getBoolean("isJumping");
|
||||
boolean isHolding = nbtData.getBoolean("isHolding");
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.useWing(player, stack, world, 0.25f, 0.6f, 0.3f, 5);
|
||||
this.useWings(player, stack, world, 0.25f, 0.6f, 0.3f, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ItemQuantumWing extends ItemNanoWing {
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.useWing(player, stack, world, 0.33f, 0.5f, 0.2f, 7);
|
||||
this.useWings(player, stack, world, 0.33f, 0.5f, 0.2f, 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,6 +56,6 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.useWing(player, stack, world, 0.15f, 0.7f, 0.5f, 0);
|
||||
this.useWings(player, stack, world, 0.15f, 0.7f, 0.5f, 0);
|
||||
}
|
||||
}
|
||||
@@ -9,176 +9,248 @@ import static emt.util.EMTTextHelper.localize;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import emt.block.BlockBaseContainer;
|
||||
import emt.block.BlockSolars;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTTextHelper;
|
||||
|
||||
public class ItemBlockSolars extends ItemBlock {
|
||||
|
||||
public ItemBlockSolars(Block id) {
|
||||
super(id);
|
||||
int instance;
|
||||
|
||||
public ItemBlockSolars(Block block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
instance = ((BlockBaseContainer) block).instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "compressed";
|
||||
break;
|
||||
|
||||
if (instance == 0) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "compressed";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "doublecompressed";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = "triplecompressed";
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
name = "water";
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
name = "doublewater";
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
name = "triplewater";
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
name = "dark";
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
name = "doubledark";
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
name = "tripledark";
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
name = "order";
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
name = "doubleorder";
|
||||
break;
|
||||
}
|
||||
case 11: {
|
||||
name = "tripleorder";
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
name = "fire";
|
||||
break;
|
||||
}
|
||||
case 13: {
|
||||
name = "doublefire";
|
||||
break;
|
||||
}
|
||||
case 14: {
|
||||
name = "triplefire";
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
name = "air";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "doublecompressed";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = "triplecompressed";
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
name = "water";
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
name = "doublewater";
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
name = "triplewater";
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
name = "dark";
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
name = "doubledark";
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
name = "tripledark";
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
name = "order";
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
name = "doubleorder";
|
||||
break;
|
||||
}
|
||||
case 11: {
|
||||
name = "tripleorder";
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
name = "fire";
|
||||
break;
|
||||
}
|
||||
case 13: {
|
||||
name = "doublefire";
|
||||
break;
|
||||
}
|
||||
case 14: {
|
||||
name = "triplefire";
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
name = "air";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
|
||||
if (instance == 1) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "doubleair";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "tripleair";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = "earth";
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
name = "doubleearth";
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
name = "tripleearth";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
public int getMetadata(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
list.add(EMTConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
list.add(EMTConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
list.add(EMTConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean advancedItemTooltips) {
|
||||
if (instance == 0) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
list.add(EMTConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
list.add(EMTConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
list.add(EMTConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
|
||||
case 11: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
case 11: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 13: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 14: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.lava"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
list.add(localize("tooltip.EMT.forget"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 12: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 13: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 14: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.lava"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
list.add(localize("tooltip.EMT.forget"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (instance == 1) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
list.add(localize("tooltip.EMT.forget"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
package emt.item.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import static emt.util.EMTTextHelper.localize;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTTextHelper;
|
||||
|
||||
public class ItemBlockSolars2 extends ItemBlock {
|
||||
|
||||
public ItemBlockSolars2(Block id) {
|
||||
super(id);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "doubleair";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "tripleair";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = "earth";
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
name = "doubleearth";
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
name = "tripleearth";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
list.add(localize("tooltip.EMT.forget"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user