reduced fps lag in runner

This commit is contained in:
Chiss 2014-11-23 14:47:28 +11:00
parent 50b2870705
commit d4a127b8ad

View File

@ -127,6 +127,8 @@ public class Runner extends SoloGame implements IThrown
return; return;
_blocks.put(block, System.currentTimeMillis()); _blocks.put(block, System.currentTimeMillis());
block.setTypeIdAndData(159, (byte) 14, false);
} }
@EventHandler @EventHandler
@ -179,60 +181,8 @@ public class Runner extends SoloGame implements IThrown
{ {
Block block = blockIterator.next(); Block block = blockIterator.next();
// if (!UtilTime.elapsed(_blocks.get(block), 120)) if (!UtilTime.elapsed(_blocks.get(block), 600))
// continue;
blockIterator.remove();
//Degrade
if (block.getTypeId() == 98)
{
if (block.getData() == 0)
{
readd.add(block);
block.setData((byte)2);
continue; continue;
}
}
//Degrade
if (block.getTypeId() == 35 || block.getTypeId() == 159)
{
if (block.getData() == 3)
{
readd.add(block);
block.setData((byte)5);
continue;
}
if (block.getData() == 5)
{
readd.add(block);
block.setData((byte)4);
continue;
}
if (block.getData() == 4)
{
readd.add(block);
block.setData((byte)1);
continue;
}
if (block.getData() == 1)
{
readd.add(block);
block.setData((byte)14);
continue;
}
else if (block.getData() != 14)
{
readd.add(block);
block.setData((byte)3);
continue;
}
}
//Fall //Fall
int id = block.getTypeId(); int id = block.getTypeId();
@ -240,13 +190,78 @@ public class Runner extends SoloGame implements IThrown
MapUtil.QuickChangeBlockAt(block.getLocation(), Material.AIR); MapUtil.QuickChangeBlockAt(block.getLocation(), Material.AIR);
FallingBlock ent = block.getWorld().spawnFallingBlock(block.getLocation(), id, data); FallingBlock ent = block.getWorld().spawnFallingBlock(block.getLocation(), id, data);
Manager.GetProjectile().AddThrow(ent, null, this, -1, true, false, false, false, 1d); Manager.GetProjectile().AddThrow(ent, null, this, -1, true, false, false, false, 1d);
}
//Re-add blockIterator.remove();
for (Block block : readd)
{
_blocks.put(block, System.currentTimeMillis());
} }
//
//// if (!UtilTime.elapsed(_blocks.get(block), 120))
//// continue;
//
// blockIterator.remove();
//
// //Degrade
// if (block.getTypeId() == 98)
// {
// if (block.getData() == 0)
// {
// readd.add(block);
// block.setData((byte)2);
// continue;
// }
// }
//
// //Degrade
// if (block.getTypeId() == 35 || block.getTypeId() == 159)
// {
// if (block.getData() == 3)
// {
// readd.add(block);
// block.setData((byte)5);
// continue;
// }
//
// if (block.getData() == 5)
// {
// readd.add(block);
// block.setData((byte)4);
// continue;
// }
//
// if (block.getData() == 4)
// {
// readd.add(block);
// block.setData((byte)1);
// continue;
// }
//
// if (block.getData() == 1)
// {
// readd.add(block);
// block.setData((byte)14);
// continue;
// }
//
// else if (block.getData() != 14)
// {
// readd.add(block);
// block.setData((byte)3);
// continue;
// }
// }
//
// //Fall
// int id = block.getTypeId();
// byte data = block.getData();
// MapUtil.QuickChangeBlockAt(block.getLocation(), Material.AIR);
// FallingBlock ent = block.getWorld().spawnFallingBlock(block.getLocation(), id, data);
// Manager.GetProjectile().AddThrow(ent, null, this, -1, true, false, false, false, 1d);
// }
//
// //Re-add
// for (Block block : readd)
// {
// _blocks.put(block, System.currentTimeMillis());
// }
} }
@EventHandler @EventHandler