Merge branch 'development'
This commit is contained in:
commit
bc941a98b9
2 changed files with 298 additions and 312 deletions
|
@ -21,11 +21,9 @@ import calclavia.lib.render.block.BlockRenderingHandler;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* The block for the actual conveyor belt!
|
||||
/** The block for the actual conveyor belt!
|
||||
*
|
||||
* @author Calclavia, DarkGuardsman
|
||||
*/
|
||||
* @author Calclavia, DarkGuardsman */
|
||||
public class BlockConveyorBelt extends BlockTile
|
||||
{
|
||||
public BlockConveyorBelt(int id)
|
||||
|
@ -38,13 +36,9 @@ public class BlockConveyorBelt extends BlockTile
|
|||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity t = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (t != null && t instanceof TileConveyorBelt)
|
||||
{
|
||||
TileConveyorBelt tileEntity = (TileConveyorBelt) t;
|
||||
tileEntity.mechanicalNode.reconstruct();
|
||||
}
|
||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
||||
if (tile instanceof TileConveyorBelt)
|
||||
((TileConveyorBelt) tile).mechanicalNode.reconstruct();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -218,7 +212,7 @@ public class BlockConveyorBelt extends BlockTile
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
int original = world.getBlockMetadata(x, y, z);
|
||||
int change = 2;
|
||||
|
@ -246,7 +240,7 @@ public class BlockConveyorBelt extends BlockTile
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
|
||||
public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TileConveyorBelt tileEntity = (TileConveyorBelt) world.getBlockTileEntity(x, y, z);
|
||||
|
||||
|
@ -348,7 +342,7 @@ public class BlockConveyorBelt extends BlockTile
|
|||
|
||||
/** Returns the TileEntity used by this block. */
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1)
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
{
|
||||
return new TileConveyorBelt();
|
||||
}
|
||||
|
|
|
@ -87,15 +87,6 @@ public class TileConveyorBelt extends TileMechanical implements IBelt, IRotatabl
|
|||
didRefresh = true;
|
||||
}
|
||||
}
|
||||
else if (tile instanceof INodeProvider)
|
||||
{
|
||||
MechanicalNode mechanical = ((INodeProvider) tile).getNode(MechanicalNode.class, dir.getOpposite());
|
||||
|
||||
if (mechanical != null)
|
||||
{
|
||||
connections.put(mechanical, dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote)
|
||||
|
@ -109,7 +100,7 @@ public class TileConveyorBelt extends TileMechanical implements IBelt, IRotatabl
|
|||
{
|
||||
return from != getDirection() || from != getDirection().getOpposite();
|
||||
}
|
||||
}.setLoad(0.5f);
|
||||
}.setLoad(0.15f);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,9 +131,10 @@ public class TileConveyorBelt extends TileMechanical implements IBelt, IRotatabl
|
|||
/* PROCESSES IGNORE LIST AND REMOVES UNNEED ENTRIES */
|
||||
Iterator<Entity> it = this.ignoreList.iterator();
|
||||
|
||||
List<Entity> effect_list = this.getAffectedEntities();
|
||||
while (it.hasNext())
|
||||
{
|
||||
if (!this.getAffectedEntities().contains(it.next()))
|
||||
if (!effect_list.contains(it.next()))
|
||||
{
|
||||
it.remove();
|
||||
}
|
||||
|
@ -150,7 +142,7 @@ public class TileConveyorBelt extends TileMechanical implements IBelt, IRotatabl
|
|||
|
||||
if (this.worldObj.isRemote)
|
||||
{
|
||||
if (this.ticks % 10 == 0 && this.worldObj.isRemote && this.worldObj.getBlockId(this.xCoord - 1, this.yCoord, this.zCoord) != Mechanical.blockConveyorBelt.blockID && this.worldObj.getBlockId(xCoord, yCoord, zCoord - 1) != Mechanical.blockConveyorBelt.blockID)
|
||||
if (this.ticks % 10 == 0 && this.worldObj.getBlockId(this.xCoord - 1, this.yCoord, this.zCoord) != Mechanical.blockConveyorBelt.blockID && this.worldObj.getBlockId(xCoord, yCoord, zCoord - 1) != Mechanical.blockConveyorBelt.blockID)
|
||||
{
|
||||
worldObj.playSound(this.xCoord, this.yCoord, this.zCoord, Reference.PREFIX + "conveyor", 0.5f, 0.5f + 0.15f * (float) getMoveVelocity(), true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue