Added semifluidgenerator

This commit is contained in:
Gig 2015-05-03 23:13:45 +01:00
parent afc750993c
commit f0d0d2738e
3 changed files with 84 additions and 1 deletions

View file

@ -61,7 +61,7 @@ public class BlockAlloySmelter extends BlockMachineBase {
this.blockIcon = icon.registerIcon("techreborn:machine/machine_side");
this.iconFront = icon.registerIcon("techreborn:machine/electric_alloy_furnace_front_off");
this.iconTop = icon.registerIcon("techreborn:machine/machine_top");
this.iconBottom = icon.registerIcon("techreborn:machine/machine_bottem");
this.iconBottom = icon.registerIcon("techreborn:machine/machine_bottom");
}
@SideOnly(Side.CLIENT)

View file

@ -0,0 +1,78 @@
package techreborn.blocks;
import net.minecraft.block.Block;
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.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.TileAlloySmelter;
import techreborn.tiles.TileBlastFurnace;
import techreborn.tiles.TileMachineCasing;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockSemiFluidGenerator extends BlockMachineBase {
@SideOnly(Side.CLIENT)
private IIcon iconFront;
@SideOnly(Side.CLIENT)
private IIcon iconTop;
@SideOnly(Side.CLIENT)
private IIcon iconBottom;
public BlockSemiFluidGenerator(Material material)
{
super(material);
setBlockName("techreborn.semifluidgenerator");
}
@Override
public TileEntity createNewTileEntity(World world, int p_149915_2_)
{
return new TileAlloySmelter();
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ)
{
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.alloySmelterID, world, x, y,
z);
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister icon)
{
this.blockIcon = icon.registerIcon("techreborn:machine/semifluid_generator_side");
this.iconFront = icon.registerIcon("techreborn:machine/semifluid_generator_side");
this.iconTop = icon.registerIcon("techreborn:machine/machine_top");
this.iconBottom = icon.registerIcon("techreborn:machine/machine_bottem");
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata)
{
return metadata == 0 && side == 3 ? this.iconFront
: side == 1 ? this.iconTop :
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop
: (side == metadata ? this.iconFront : this.blockIcon));
}
}

View file

@ -23,6 +23,7 @@ import techreborn.blocks.BlockOre;
import techreborn.blocks.BlockQuantumChest;
import techreborn.blocks.BlockQuantumTank;
import techreborn.blocks.BlockRollingMachine;
import techreborn.blocks.BlockSemiFluidGenerator;
import techreborn.blocks.BlockStorage;
import techreborn.blocks.BlockThermalGenerator;
import techreborn.client.TechRebornCreativeTab;
@ -67,6 +68,7 @@ public class ModBlocks {
public static Block DieselGenerator;
public static Block IndustrialElectrolyzer;
public static Block MagicalAbsorber;
public static Block Semifluidgenerator;
public static Block ore;
public static Block storage;
@ -162,6 +164,9 @@ public class ModBlocks {
MagicalAbsorber = new BlockMagicEnergyAbsorber(Material.rock);
GameRegistry.registerBlock(MagicalAbsorber, "magicrnergyabsorber");
Semifluidgenerator = new BlockSemiFluidGenerator(Material.rock);
GameRegistry.registerBlock(Semifluidgenerator, "semifluidgenerator");
registerOreDict();
}