mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-21 12:32:12 +00:00
cleanup
This commit is contained in:
1 parent
68c9653932
commit
170a499cab
13 files changed
+82
-170
No files matched your search
@@ -25,8 +25,7 @@ public abstract class BlockBaseContainer extends BlockContainer {
|
||||
|
||||
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, float hardness) {
|
||||
super(material);
|
||||
|
||||
setBlockName(ModInformation.modid + ".module.base." + unlocName);
|
||||
setBlockName(ModInformation.modid + "." + unlocName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
setStepSound(soundType);
|
||||
setHardness(hardness);
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
package tombenpotter.emt.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import tombenpotter.emt.common.tile.TileEntityEMT;
|
||||
|
||||
public abstract class BlockEMT 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];
|
||||
|
||||
protected BlockEMT(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@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);
|
||||
if (side == 0) {
|
||||
return this.bottom[i];
|
||||
}
|
||||
else if (side == 1) {
|
||||
return this.top[i];
|
||||
}
|
||||
else if (side != tile.facing) {
|
||||
return this.side[i];
|
||||
}
|
||||
else if (tile.isOn) {
|
||||
return this.frontOn[i];
|
||||
}
|
||||
else {
|
||||
return this.frontOff[i];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if (side < 1) {
|
||||
return this.bottom[meta];
|
||||
}
|
||||
if (side == 1) {
|
||||
return this.top[meta];
|
||||
}
|
||||
if (side == 3) {
|
||||
return this.frontOff[meta];
|
||||
}
|
||||
return this.side[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
@@ -24,10 +24,10 @@ import tombenpotter.emt.common.tile.TileEntityIndustrialWandRecharge;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockEMTMachines extends BlockEMT {
|
||||
public class BlockEMTMachines extends BlockBaseContainer {
|
||||
|
||||
public BlockEMTMachines() {
|
||||
super(Material.iron);
|
||||
public BlockEMTMachines(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -80,8 +80,7 @@ public class BlockEMTMachines extends BlockEMT {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
public Item getItemDropped(int meta, Random random, int fortune){
|
||||
return IC2Items.getItem("machine").getItem();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ import java.util.List;
|
||||
|
||||
public class BlockEMTSolars extends BlockBaseContainer {
|
||||
|
||||
public BlockEMTSolars() {
|
||||
super("solars", Material.iron, soundTypeMetal, 4.0F);
|
||||
public BlockEMTSolars(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,7 +109,6 @@ public class BlockEMTSolars extends BlockBaseContainer {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i <= 15; i++) {
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
|
||||
@@ -21,8 +21,8 @@ import java.util.List;
|
||||
|
||||
public class BlockEMTSolars2 extends BlockBaseContainer {
|
||||
|
||||
public BlockEMTSolars2() {
|
||||
super("solars.2", Material.iron, soundTypeMetal, 4.0F);
|
||||
public BlockEMTSolars2(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,8 +21,8 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
|
||||
public BlockEssentiaGenerators() {
|
||||
super("generator.essentia.2", Material.iron, soundTypeMetal, 4.0F);
|
||||
public BlockEssentiaGenerators(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,8 +24,9 @@ public class BlockPortableNode extends BlockAiry {
|
||||
|
||||
public IIcon[] texture = new IIcon[1];
|
||||
|
||||
public BlockPortableNode() {
|
||||
public BlockPortableNode(String name) {
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
setBlockName(ModInformation.modid + "." + name);
|
||||
setBlockUnbreakable();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,9 @@ import java.util.Random;
|
||||
|
||||
public class BlockShield extends Block {
|
||||
|
||||
public BlockShield() {
|
||||
public BlockShield(String name) {
|
||||
super(Material.rock);
|
||||
setBlockName(ModInformation.modid + "." + name);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setHardness(1F);
|
||||
this.setResistance(10000000000000000000000000000000000000F);
|
||||
|
||||
@@ -109,8 +109,8 @@ public class EntityShield extends Entity implements IProjectile {
|
||||
ePosZ *= 0.05000000074505806D;
|
||||
ePosX *= (double) (1.0F - this.entityCollisionReduction);
|
||||
ePosZ *= (double) (1.0F - this.entityCollisionReduction);
|
||||
this.addVelocity(-ePosX * 1000, 0.0D, -ePosZ * 1000);
|
||||
entity.addVelocity(ePosX * 1000, 0.0D, ePosZ * 1000);
|
||||
this.addVelocity(-ePosX * 100, 0.0D, -ePosZ * 100);
|
||||
entity.addVelocity(ePosX * 100, 0.0D, ePosZ * 100);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,22 +30,22 @@ public class BlockRegistry {
|
||||
public static Block emtSolars2;
|
||||
|
||||
public static void registerBlocks() {
|
||||
portableNode = new BlockPortableNode().setBlockName(ModInformation.modid + ".portablenode");
|
||||
portableNode = new BlockPortableNode("portablenode");
|
||||
GameRegistry.registerBlock(portableNode, "PortableNode");
|
||||
|
||||
shield = new BlockShield().setBlockName(ModInformation.modid + ".shield");
|
||||
shield = new BlockShield("shield");
|
||||
GameRegistry.registerBlock(shield, "ShieldBlock");
|
||||
|
||||
emtSolars = new BlockEMTSolars().setBlockName(ModInformation.modid + ".emtsolars");
|
||||
emtSolars = new BlockEMTSolars("solar");
|
||||
GameRegistry.registerBlock(emtSolars, ItemBlockEMTSolars.class, "EMTSolars");
|
||||
|
||||
emtSolars2 = new BlockEMTSolars2().setBlockName(ModInformation.modid + ".emtsolars2");
|
||||
emtSolars2 = new BlockEMTSolars2("solar2");
|
||||
GameRegistry.registerBlock(emtSolars2, ItemBlockEMTSolars2.class, "EMTSolars2");
|
||||
|
||||
emtMachines = new BlockEMTMachines().setBlockName(ModInformation.modid + ".emtmachines").setHardness(2.F);
|
||||
emtMachines = new BlockEMTMachines("machine");
|
||||
GameRegistry.registerBlock(emtMachines, ItemBlockEMTMachines.class, "EMTMachines");
|
||||
|
||||
essentiaGens = new BlockEssentiaGenerators().setBlockName(ModInformation.modid + ".essentiaGens");
|
||||
essentiaGens = new BlockEssentiaGenerators("essentia");
|
||||
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@ public class ItemBase extends Item {
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack)
|
||||
{
|
||||
public String getItemStackDisplayName(ItemStack stack){
|
||||
return (EMTTextHelper.GREEN + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user