Updated laser medium to its new texture logic

This commit is contained in:
LemADEC 2015-09-27 02:19:06 +02:00
parent 8093b64e7c
commit 627a333589
7 changed files with 13 additions and 47 deletions

View file

@ -1,13 +1,10 @@
package cr0s.warpdrive.block;
import java.util.Random;
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.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
@ -27,25 +24,22 @@ public class BlockLaserMedium extends BlockContainer {
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
iconBuffer = new IIcon[16];
iconBuffer[ 0] = par1IconRegister.registerIcon("warpdrive:laserMediumSide0");
iconBuffer[ 1] = par1IconRegister.registerIcon("warpdrive:laserMediumSide1");
iconBuffer[ 2] = par1IconRegister.registerIcon("warpdrive:laserMediumSide2");
iconBuffer[ 3] = par1IconRegister.registerIcon("warpdrive:laserMediumSide3");
iconBuffer[ 4] = par1IconRegister.registerIcon("warpdrive:laserMediumSide4");
iconBuffer[ 5] = par1IconRegister.registerIcon("warpdrive:laserMediumSide5");
iconBuffer[ 6] = par1IconRegister.registerIcon("warpdrive:laserMediumSide6");
iconBuffer[ 7] = par1IconRegister.registerIcon("warpdrive:laserMediumSide7");
iconBuffer[ 8] = par1IconRegister.registerIcon("warpdrive:laserMediumSide8");
iconBuffer[ 9] = par1IconRegister.registerIcon("warpdrive:laserMediumSide9");
iconBuffer[10] = par1IconRegister.registerIcon("warpdrive:laserMediumSide10");
iconBuffer[11] = par1IconRegister.registerIcon("warpdrive:laserMediumTopBottom");
iconBuffer = new IIcon[9];
iconBuffer[0] = par1IconRegister.registerIcon("warpdrive:laserMediumSide0");
iconBuffer[1] = par1IconRegister.registerIcon("warpdrive:laserMediumSide1");
iconBuffer[2] = par1IconRegister.registerIcon("warpdrive:laserMediumSide2");
iconBuffer[3] = par1IconRegister.registerIcon("warpdrive:laserMediumSide3");
iconBuffer[4] = par1IconRegister.registerIcon("warpdrive:laserMediumSide4");
iconBuffer[5] = par1IconRegister.registerIcon("warpdrive:laserMediumSide5");
iconBuffer[6] = par1IconRegister.registerIcon("warpdrive:laserMediumSide6");
iconBuffer[7] = par1IconRegister.registerIcon("warpdrive:laserMediumSide7");
iconBuffer[8] = par1IconRegister.registerIcon("warpdrive:laserMediumTopBottom");
}
@Override
public IIcon getIcon(int side, int metadata) {
if (side == 0 || side == 1) {
return iconBuffer[11];
return iconBuffer[8];
}
return iconBuffer[metadata];
@ -56,33 +50,17 @@ public class BlockLaserMedium extends BlockContainer {
return new TileEntityLaserMedium();
}
/**
* Returns the quantity of items to drop on block destruction.
*/
@Override
public int quantityDropped(Random par1Random) {
return 1;
}
/**
* Returns the ID of the items to drop on destruction.
*/
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
return Item.getItemFromBlock(this);
}
/**
* Called upon block activation (right click on the block.)
*/
@Override
public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
return false;
}
if (entityPlayer.getHeldItem() == null) {
TileEntity tileEntity = par1World.getTileEntity(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity != null && tileEntity instanceof TileEntityAbstractEnergy) {
WarpDrive.addChatMessage(entityPlayer, ((TileEntityAbstractEnergy) tileEntity).getStatus());
return true;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB