mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-13 17:04:02 +00:00
Refractored Code
+added Solar Factory -removed unnessecary solar and essentia generator classes +started gtnh researches +added tooltip clearance on solars (maximal output) Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
This commit is contained in:
1 parent
980df8516a
commit
0fecf28b65
397 files changed
+8693
-9288
No files matched your search
@@ -3,7 +3,7 @@ package emt.block;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.tile.generator.*;
|
||||
import emt.tile.generator.TileEntityBaseGenerator;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntitySmokeFX;
|
||||
@@ -20,88 +20,73 @@ import java.util.Random;
|
||||
|
||||
public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
|
||||
private static int subtypes=6;
|
||||
|
||||
public BlockEssentiaGenerators(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, subtypes, 4.0F);
|
||||
}
|
||||
private static int subtypes = 6;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
super.registerBlockIcons(ir);
|
||||
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
public BlockEssentiaGenerators(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, subtypes, 4.0F);
|
||||
}
|
||||
|
||||
for (int meta = 0; meta < subtypes; 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");
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
super.registerBlockIcons(ir);
|
||||
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
|
||||
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");
|
||||
iconSets[5].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
|
||||
}
|
||||
for (int meta = 0; meta < subtypes; 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");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
list.add(new ItemStack(id, 1, 1));
|
||||
list.add(new ItemStack(id, 1, 2));
|
||||
list.add(new ItemStack(id, 1, 3));
|
||||
list.add(new ItemStack(id, 1, 4));
|
||||
list.add(new ItemStack(id, 1, 5));
|
||||
}
|
||||
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");
|
||||
iconSets[5].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
switch (meta) {
|
||||
case 0:
|
||||
return new TileEntityPotentiaGenerator();
|
||||
case 1:
|
||||
return new TileEntityIgnisGenerator();
|
||||
case 2:
|
||||
return new TileEntityAuramGenerator();
|
||||
case 3:
|
||||
return new TileEntityArborGenerator();
|
||||
case 4:
|
||||
return new TileEntityAerGenerator();
|
||||
case 5:
|
||||
return new TileEntityLucrumGenerator();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
list.add(new ItemStack(id, 1, 1));
|
||||
list.add(new ItemStack(id, 1, 2));
|
||||
list.add(new ItemStack(id, 1, 3));
|
||||
list.add(new ItemStack(id, 1, 4));
|
||||
list.add(new ItemStack(id, 1, 5));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||
TileEntityBaseGenerator te = (TileEntityBaseGenerator) world.getTileEntity(x, y, z);
|
||||
if (te.isActive) {
|
||||
int color = te.aspect.getColor();
|
||||
float r = (float) (color >> 16 & 0xff) / 255F;
|
||||
float g = (float) (color >> 8 & 0xff) / 255F;
|
||||
float b = (float) (color & 0xff) / 255F;
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
return new TileEntityBaseGenerator(meta);
|
||||
}
|
||||
|
||||
EntitySmokeFX fx = new EntitySmokeFX(world, x + 0.5f, y + 1.1, z + 0.5f, 0, 0.1, 0, 3);
|
||||
fx.setRBGColorF(r, g, b);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2, float f3)
|
||||
{
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
if (world.isRemote) {
|
||||
return true;
|
||||
}
|
||||
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||
if (tileentity != null) {
|
||||
player.openGui(emt.EMT.instance, 1, world, i, j, k);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||
TileEntityBaseGenerator te = (TileEntityBaseGenerator) world.getTileEntity(x, y, z);
|
||||
if (te.isActive) {
|
||||
int color = te.aspect.getColor();
|
||||
float r = (float) (color >> 16 & 0xff) / 255F;
|
||||
float g = (float) (color >> 8 & 0xff) / 255F;
|
||||
float b = (float) (color & 0xff) / 255F;
|
||||
|
||||
EntitySmokeFX fx = new EntitySmokeFX(world, x + 0.5f, y + 1.1, z + 0.5f, 0, 0.1, 0, 3);
|
||||
fx.setRBGColorF(r, g, b);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2, float f3) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
if (world.isRemote) {
|
||||
return true;
|
||||
}
|
||||
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||
if (tileentity != null) {
|
||||
player.openGui(emt.EMT.instance, 1, world, i, j, k);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user