Renamed TileMeta to TileRotation

This commit is contained in:
modmuss50 2015-09-19 09:31:24 +01:00
parent aacc73102d
commit 148715111f
34 changed files with 54 additions and 68 deletions

View file

@ -55,7 +55,7 @@ public class BlockChunkLoader extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -55,7 +55,7 @@ public class BlockDigitalChest extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -6,7 +6,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockElectricCraftingTable extends BlockMachineBase {
@ -36,7 +35,7 @@ public class BlockElectricCraftingTable extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -6,7 +6,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockFusionCoil extends BlockMachineBase {
@ -36,7 +35,7 @@ public class BlockFusionCoil extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -6,7 +6,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockFusionControlComputer extends BlockMachineBase {
@ -36,7 +35,7 @@ public class BlockFusionControlComputer extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -6,7 +6,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockHighlyAdvancedMachine extends BlockMachineBase {
@ -36,7 +35,7 @@ public class BlockHighlyAdvancedMachine extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -11,7 +11,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.ChunkCache;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.TechRebornCreativeTab;
@ -64,7 +63,7 @@ public class BlockMachineBase extends BlockContainer {
}
world.setBlockMetadataWithNotify(x, y, z, b, 2);
setTileMeta(world, x, y, z, b);
setTileRotation(world, x, y, z, b);
}
@ -77,16 +76,16 @@ public class BlockMachineBase extends BlockContainer {
.floor_double((double) (player.rotationYaw * 4.0F / 360F) + 0.5D) & 3;
if (l == 0) {
setTileMeta(world, x, y, z, 2);
setTileRotation(world, x, y, z, 2);
}
if (l == 1) {
setTileMeta(world, x, y, z, 5);
setTileRotation(world, x, y, z, 5);
}
if (l == 2) {
setTileMeta(world, x, y, z, 3);
setTileRotation(world, x, y, z, 3);
}
if (l == 3) {
setTileMeta(world, x, y, z, 4);
setTileRotation(world, x, y, z, 4);
}
super.onBlockPlacedBy(world, x, y, z, player, itemstack);
}
@ -142,20 +141,20 @@ public class BlockMachineBase extends BlockContainer {
}
}
public void setTileMeta(World world, int x, int y, int z, int meta){
public void setTileRotation(World world, int x, int y, int z, int meta){
if(world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileMachineBase){
((TileMachineBase) world.getTileEntity(x, y, z)).setMeta(meta);
((TileMachineBase) world.getTileEntity(x, y, z)).setRotation(meta);
}
}
public int getTileMeta(World world, int x, int y, int z){
public int getTileRotation(World world, int x, int y, int z){
if(world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileMachineBase){
return ((TileMachineBase) world.getTileEntity(x, y, z)).getMeta();
return ((TileMachineBase) world.getTileEntity(x, y, z)).getRotation();
}
return 0;
}
public int getTileMeta(IBlockAccess blockAccess, int x, int y, int z){
return blockAccess.getTileEntity(x, y, z) != null ? getTileMeta(blockAccess.getTileEntity(x, y,z).getWorldObj(), x, y, z) : 0;
public int getTileRotation(IBlockAccess blockAccess, int x, int y, int z){
return blockAccess.getTileEntity(x, y, z) != null ? getTileRotation(blockAccess.getTileEntity(x, y, z).getWorldObj(), x, y, z) : 0;
}
}

View file

@ -44,7 +44,7 @@ public class BlockMetalShelf extends BlockMachineBase {
@Override
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta((World) blockAccess, x, y, z);
int metadata = getTileRotation((World) blockAccess, x, y, z);
return metadata == 0 && side == 3 ? this.iconFrontEmpty
: side == 1 ? this.iconTop :
side == 0 ? this.iconBottom : (side == 0 ? this.iconTop

View file

@ -6,7 +6,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockSupercondensator extends BlockMachineBase {
@ -36,7 +35,7 @@ public class BlockSupercondensator extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -6,7 +6,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockWoodenshelf extends BlockMachineBase {
@ -36,7 +35,7 @@ public class BlockWoodenshelf extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -60,7 +60,7 @@ public class BlockAlloyFurnace extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -64,7 +64,7 @@ public class BlockAlloySmelter extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -64,7 +64,7 @@ public class BlockAssemblingMachine extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -64,7 +64,7 @@ public class BlockBlastFurnace extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -14,7 +14,6 @@ import net.minecraft.world.World;
import techreborn.Core;
import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.packets.PacketAesu;
import techreborn.tiles.TileCentrifuge;
import java.util.Random;
@ -68,7 +67,7 @@ public class BlockCentrifuge extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (blockAccess.getBlockMetadata(x, y, z) == 1) {
if(side == 1){
return this.iconTopOn;

View file

@ -59,7 +59,7 @@ public class BlockChargeBench extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -64,7 +64,7 @@ public class BlockChemicalReactor extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -8,7 +8,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.blocks.BlockMachineBase;
import java.util.Random;
@ -41,7 +40,7 @@ public class BlockDistillationTower extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
return metadata == 0 && side == 3 ? this.iconFront
: side == 1 ? this.iconTop :
side == 0 ? this.iconBottom : (side == 0 ? this.iconTop

View file

@ -68,7 +68,7 @@ public class BlockGrinder extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -64,7 +64,7 @@ public class BlockImplosionCompressor extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -65,7 +65,7 @@ public class BlockIndustrialElectrolyzer extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -64,7 +64,7 @@ public class BlockIndustrialSawmill extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -64,7 +64,7 @@ public class BlockLathe extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -48,7 +48,7 @@ public class BlockMatterFabricator extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconOn;
} else {

View file

@ -64,7 +64,7 @@ public class BlockPlateCuttingMachine extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFrontOn;
}

View file

@ -60,7 +60,7 @@ public class BlockRollingMachine extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
return metadata == 0 && side == 3 ? this.iconFront
: side == 1 ? this.iconTop :
side == 0 ? this.iconBottom : (side == 0 ? this.iconTop

View file

@ -8,7 +8,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.blocks.BlockMachineBase;
import java.util.Random;
@ -41,7 +40,7 @@ public class BlockVacuumFreezer extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
return metadata == 0 && side == 3 ? this.iconFront
: side == 1 ? this.iconTop :
side == 0 ? this.iconBottom : (side == 0 ? this.iconTop

View file

@ -4,9 +4,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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.world.IBlockAccess;
@ -59,7 +57,7 @@ public class BlockAesu extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -4,9 +4,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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.world.IBlockAccess;
@ -44,7 +42,7 @@ public class BlockIDSU extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -42,7 +42,7 @@ public class BlockLesu extends BlockMachineBase {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta(blockAccess, x, y, z);
int metadata = getTileRotation(blockAccess, x, y, z);
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
return this.iconFront;
}

View file

@ -41,7 +41,7 @@ public class BlockLesuStorage extends BlockMachineBase {
@Override
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileMeta((World) blockAccess, x, y, z);
int metadata = getTileRotation((World) blockAccess, x, y, z);
return metadata == 0 && side == 3 ? this.iconFront
: side == 1 ? this.iconTop :
side == 0 ? this.iconBottom : (side == 0 ? this.iconTop