Fixed motor wrench rotation and tweaked pipe render

This commit is contained in:
Calclavia 2014-03-17 21:35:32 +08:00
parent 3e8345485d
commit 7bea838a12
9 changed files with 209 additions and 222 deletions

View file

@ -62,9 +62,7 @@ public class TileGutter extends TilePressureNode
node = new FluidGravityNode(this) node = new FluidGravityNode(this)
{ {
@Override @Override
public void recache() public void doRecache()
{
synchronized (connections)
{ {
connections.clear(); connections.clear();
byte previousConnections = renderSides; byte previousConnections = renderSides;
@ -105,7 +103,6 @@ public class TileGutter extends TilePressureNode
sendRenderUpdate(); sendRenderUpdate();
} }
} }
}
}; };
} }

View file

@ -3,6 +3,7 @@ package resonantinduction.electrical.generator;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.Reference; import resonantinduction.core.Reference;
import universalelectricity.api.UniversalElectricity; import universalelectricity.api.UniversalElectricity;
import calclavia.lib.prefab.block.BlockRotatable; import calclavia.lib.prefab.block.BlockRotatable;
@ -38,6 +39,12 @@ public class BlockMotor extends BlockRotatable
return false; return false;
} }
@Override
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
{
return doRotateBlock(world, x, y, z, ForgeDirection.getOrientation(side));
}
@Override @Override
public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
{ {

View file

@ -42,9 +42,7 @@ public class TileConveyorBelt extends TileMechanical implements IBelt, IRotatabl
mechanicalNode = new PacketMechanicalNode(this) mechanicalNode = new PacketMechanicalNode(this)
{ {
@Override @Override
public void recache() public void doRecache()
{
synchronized (connections)
{ {
connections.clear(); connections.clear();
@ -105,7 +103,6 @@ public class TileConveyorBelt extends TileMechanical implements IBelt, IRotatabl
markRefresh = true; markRefresh = true;
} }
} }
}
@Override @Override
public boolean canConnect(ForgeDirection from, Object source) public boolean canConnect(ForgeDirection from, Object source)

View file

@ -104,9 +104,7 @@ public class PartGear extends PartMechanical implements IMultiBlockStructure<Par
} }
@Override @Override
public void recache() public void doRecache()
{
synchronized (connections)
{ {
connections.clear(); connections.clear();
@ -189,7 +187,6 @@ public class PartGear extends PartMechanical implements IMultiBlockStructure<Par
} }
} }
} }
}
/** /**
* Can this gear be connected BY the source? * Can this gear be connected BY the source?

View file

@ -86,9 +86,7 @@ public class PartGearShaft extends PartMechanical
} }
@Override @Override
public void recache() public void doRecache()
{
synchronized (connections)
{ {
connections.clear(); connections.clear();
@ -130,7 +128,6 @@ public class PartGearShaft extends PartMechanical
} }
} }
} }
}
@Override @Override
public boolean canConnect(ForgeDirection from, Object source) public boolean canConnect(ForgeDirection from, Object source)

View file

@ -199,9 +199,7 @@ public class MechanicalNode extends Node<INodeProvider, TickingGrid, MechanicalN
* Recache the connections. This is the default connection implementation. * Recache the connections. This is the default connection implementation.
*/ */
@Override @Override
public void recache() public void doRecache()
{
synchronized (connections)
{ {
connections.clear(); connections.clear();
@ -220,7 +218,6 @@ public class MechanicalNode extends Node<INodeProvider, TickingGrid, MechanicalN
} }
} }
} }
}
public World world() public World world()
{ {

View file

@ -47,10 +47,9 @@ public class PartPipe extends PartFramedNode<EnumPipeMaterial, FluidPressureNode
node = new FluidPressureNode(this) node = new FluidPressureNode(this)
{ {
@Override @Override
public void recache() public void doRecache()
{
synchronized (connections)
{ {
connections.clear(); connections.clear();
if (world() != null) if (world() != null)
@ -90,7 +89,6 @@ public class PartPipe extends PartFramedNode<EnumPipeMaterial, FluidPressureNode
} }
} }
} }
}
@Override @Override
public boolean canConnect(ForgeDirection from, Object source) public boolean canConnect(ForgeDirection from, Object source)

View file

@ -59,7 +59,7 @@ public class RenderPipe implements ISimpleItemRenderer
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glTranslatef((float) x + 0.35f, (float) y + 0.35f, (float) z + 0.35f); GL11.glTranslatef((float) x + 0.35f, (float) y + 0.35f, (float) z + 0.35f);
GL11.glScalef(0.3f, 0.3f, 0.3f); GL11.glScalef(0.33f, 0.33f, 0.33f);
GL11.glCallList(displayList[(int) (renderPercentage * (FluidRenderUtility.DISPLAY_STAGES - 1))]); GL11.glCallList(displayList[(int) (renderPercentage * (FluidRenderUtility.DISPLAY_STAGES - 1))]);
@ -99,7 +99,7 @@ public class RenderPipe implements ISimpleItemRenderer
break; break;
} }
GL11.glScalef(0.3f, 0.3f, 0.3f); GL11.glScalef(0.33f, 0.33f, 0.33f);
GL11.glCallList(displayList[(int) (renderPercentage * (FluidRenderUtility.DISPLAY_STAGES - 1))]); GL11.glCallList(displayList[(int) (renderPercentage * (FluidRenderUtility.DISPLAY_STAGES - 1))]);
GL11.glPopAttrib(); GL11.glPopAttrib();

View file

@ -201,9 +201,7 @@ public class FluidPressureNode extends Node<IPressureNodeProvider, TickingGrid,
* Recache the connections. This is the default connection implementation. * Recache the connections. This is the default connection implementation.
*/ */
@Override @Override
public void recache() public void doRecache()
{
synchronized (connections)
{ {
connections.clear(); connections.clear();
@ -222,7 +220,6 @@ public class FluidPressureNode extends Node<IPressureNodeProvider, TickingGrid,
} }
} }
} }
}
public World world() public World world()
{ {