Implemented a 1/4 sec place delay for block placer
This commit is contained in:
parent
911a8bbcf3
commit
c9cb078db4
1 changed files with 13 additions and 3 deletions
|
@ -32,6 +32,7 @@ public class TilePlacer extends TileInventory implements IRotatable, IPacketRece
|
||||||
{
|
{
|
||||||
private boolean doWork = false;
|
private boolean doWork = false;
|
||||||
private boolean autoPullItems = false;
|
private boolean autoPullItems = false;
|
||||||
|
private byte place_delay = 0;
|
||||||
private InternalInventoryHandler invHandler;
|
private InternalInventoryHandler invHandler;
|
||||||
private ForgeDirection renderItemSide_a;
|
private ForgeDirection renderItemSide_a;
|
||||||
private ForgeDirection renderItemSide_b;
|
private ForgeDirection renderItemSide_b;
|
||||||
|
@ -82,10 +83,17 @@ public class TilePlacer extends TileInventory implements IRotatable, IPacketRece
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (doWork)
|
if (doWork)
|
||||||
{//TODO implement block break speed, and a minor delay
|
{
|
||||||
doWork();
|
if (place_delay < Byte.MAX_VALUE)
|
||||||
doWork = false;
|
place_delay++;
|
||||||
|
|
||||||
|
if (place_delay >= 5)
|
||||||
|
{//TODO implement block break speed, and a minor delay
|
||||||
|
doWork();
|
||||||
|
doWork = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void work()
|
public void work()
|
||||||
|
@ -93,6 +101,7 @@ public class TilePlacer extends TileInventory implements IRotatable, IPacketRece
|
||||||
if (isIndirectlyPowered())
|
if (isIndirectlyPowered())
|
||||||
{
|
{
|
||||||
doWork = true;
|
doWork = true;
|
||||||
|
place_delay = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,6 +112,7 @@ public class TilePlacer extends TileInventory implements IRotatable, IPacketRece
|
||||||
{
|
{
|
||||||
decrStackSize(0, 1);
|
decrStackSize(0, 1);
|
||||||
markUpdate();
|
markUpdate();
|
||||||
|
doWork = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue