This commit is contained in:
Henry Mao 2013-02-12 12:19:04 +08:00
parent b1d5ea505c
commit 366d784a06
9 changed files with 33 additions and 46 deletions

View file

@ -1,6 +1,6 @@
package assemblyline.api;
public interface ICraneStructure extends ICraneConnectable
{
}
package assemblyline.api;
public interface ICraneStructure extends ICraneConnectable
{
}

View file

@ -1,6 +1,11 @@
package assemblyline.client.render;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL11.GL_LIGHTING;
import static org.lwjgl.opengl.GL11.glEnable;
import static org.lwjgl.opengl.GL11.glPopMatrix;
import static org.lwjgl.opengl.GL11.glPushMatrix;
import static org.lwjgl.opengl.GL11.glRotatef;
import static org.lwjgl.opengl.GL11.glTranslated;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import assemblyline.client.model.ModelCraneController;

View file

@ -89,25 +89,11 @@ public class RenderCrate extends TileEntitySpecialRenderer
GL11.glPopMatrix();
}
/*
switch (tileEntity.getTier())
{
default:
{
itemName = "\u00a7a" + itemName;
break;
}
case 1:
{
itemName = "\u00a74" + itemName;
break;
}
case 2:
{
itemName = "\u00a79" + itemName;
break;
}
}*/
* switch (tileEntity.getTier()) { default: { itemName = "\u00a7a" + itemName;
* break; } case 1: { itemName = "\u00a74" + itemName;
*
* break; } case 2: { itemName = "\u00a79" + itemName; break; } }
*/
this.renderText(itemName, side, 0.02f, x, y - 0.35f, z);

View file

@ -9,7 +9,6 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.UniversalElectricity;
import universalelectricity.core.implement.IItemElectric;
import universalelectricity.core.vector.Vector3;

View file

@ -1,6 +1,5 @@
package assemblyline.common.machine.crane;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;

View file

@ -18,12 +18,12 @@ public class CraneHelper
* The maximum size that a crane can be
*/
public static final int MAX_SIZE = 64;
public static boolean isCraneBlock(World world, int x, int y, int z)
{
return world.getBlockTileEntity(x, y, z) != null && world.getBlockTileEntity(x, y, z) instanceof ICraneConnectable;
}
public static boolean isCraneStructureBlock(World world, int x, int y, int z)
{
return world.getBlockTileEntity(x, y, z) != null && world.getBlockTileEntity(x, y, z) instanceof ICraneStructure;
@ -38,7 +38,7 @@ public class CraneHelper
return false;
}
public static ForgeDirection rotateClockwise(ForgeDirection direction)
{
if (direction == ForgeDirection.NORTH)
@ -51,7 +51,7 @@ public class CraneHelper
return ForgeDirection.NORTH;
return ForgeDirection.UNKNOWN;
}
public static ForgeDirection rotateCounterClockwise(ForgeDirection direction)
{
if (direction == ForgeDirection.NORTH)

View file

@ -10,7 +10,7 @@ public class TileEntityCraneController extends TileEntityAssemblyNetwork impleme
int width, height, depth;
boolean isCraneValid;
long ticks;
public TileEntityCraneController()
{
super();
@ -18,7 +18,7 @@ public class TileEntityCraneController extends TileEntityAssemblyNetwork impleme
isCraneValid = false;
ticks = 0;
}
@Override
public void updateEntity()
{
@ -28,12 +28,12 @@ public class TileEntityCraneController extends TileEntityAssemblyNetwork impleme
validateCrane();
}
}
public boolean isCraneValid()
{
return isCraneValid;
}
private void validateCrane()
{
isCraneValid = false;
@ -46,7 +46,7 @@ public class TileEntityCraneController extends TileEntityAssemblyNetwork impleme
isCraneValid = isFrameValid();
}
}
private boolean isFrameValid()
{
for (int x = Math.min(0, width); x <= Math.max(0, width); x++)
@ -79,7 +79,7 @@ public class TileEntityCraneController extends TileEntityAssemblyNetwork impleme
}
return true;
}
/**
* Find x size and store in this.width
*/
@ -107,13 +107,13 @@ public class TileEntityCraneController extends TileEntityAssemblyNetwork impleme
x--;
}
}
width = x; //can be negative
width = x; // can be negative
if (width < 0)
width++;
if (width > 0)
width--;
}
/**
* Find y size and store in this.height
*/
@ -132,7 +132,7 @@ public class TileEntityCraneController extends TileEntityAssemblyNetwork impleme
}
height = y - 1;
}
/**
* Find x size and store in this.depth
*/
@ -160,7 +160,7 @@ public class TileEntityCraneController extends TileEntityAssemblyNetwork impleme
z--;
}
}
depth = z; //can be negative
depth = z; // can be negative
if (depth < 0)
depth++;
if (depth > 0)
@ -179,7 +179,7 @@ public class TileEntityCraneController extends TileEntityAssemblyNetwork impleme
return true;
return false;
}
@Override
public void writeToNBT(NBTTagCompound nbt)
{
@ -189,7 +189,7 @@ public class TileEntityCraneController extends TileEntityAssemblyNetwork impleme
nbt.setInteger("depth", depth);
nbt.setBoolean("isValid", isCraneValid);
}
@Override
public void readFromNBT(NBTTagCompound nbt)
{

View file

@ -1,7 +1,6 @@
package assemblyline.common.machine.crane;
import net.minecraftforge.common.ForgeDirection;
import assemblyline.api.ICraneConnectable;
import assemblyline.api.ICraneStructure;
import assemblyline.common.machine.TileEntityAssemblyNetwork;

View file

@ -5,7 +5,6 @@ import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;