Fixed queueBlockReplace not merging in all cases.

This commit is contained in:
Robin Kupper
2011-04-27 12:27:12 +02:00
parent 36050383ec
commit e5ed36ff60

View File

@ -74,12 +74,21 @@ public class Consumer extends TimerTask implements Runnable
* @param after Blockstate of the block after actually being placed.
*/
public void queueBlockReplace(String playerName, BlockState before, BlockState after) {
if (before.getRawData() == 0) {
queueBlock(playerName, new Location(before.getWorld(), before.getX(), before.getY(), before.getZ()), before.getTypeId(), after.getTypeId(), after.getRawData());
} else {
queueBlockBreak(playerName, before);
queueBlockPlace(playerName, after);
}
queueBlockReplace(playerName, new Location(before.getWorld(), before.getX(), before.getY(), before.getZ()), before.getTypeId(), before.getRawData(), after.getTypeId(), after.getRawData());
}
/**
* @param before Blockstate of the block before actually being destroyed.
*/
public void queueBlockReplace(String playerName, BlockState before, int typeAfter, byte dataAfter) {
queueBlockReplace(playerName, new Location(before.getWorld(), before.getX(), before.getY(), before.getZ()), before.getTypeId(), before.getRawData(), typeAfter, dataAfter);
}
/**
* @param after Blockstate of the block after actually being placed.
*/
public void queueBlockReplace(String playerName, int typeBefore, byte dataBefore, BlockState after) {
queueBlockReplace(playerName, new Location(after.getWorld(), after.getX(), after.getY(), after.getZ()), typeBefore, dataBefore, after.getTypeId(), after.getRawData());
}
public void queueBlockReplace(String playerName, Location loc, int typeBefore, byte dataBefore, int typeAfter, byte dataAfter) {
@ -91,22 +100,6 @@ public class Consumer extends TimerTask implements Runnable
}
}
/**
* @param before Blockstate of the block before actually being destroyed.
*/
public void queueBlockReplace(String playerName, BlockState before, int typeAfter, byte dataAfter) {
queueBlockBreak(playerName, before);
queueBlockPlace(playerName, new Location(before.getWorld(), before.getX(), before.getY(), before.getZ()), typeAfter, dataAfter);
}
/**
* @param after Blockstate of the block after actually being placed.
*/
public void queueBlockReplace(String playerName, int typeBefore, byte dataBefore, BlockState after) {
queueBlockBreak(playerName, new Location(after.getWorld(), after.getX(), after.getY(), after.getZ()), typeBefore, dataBefore);
queueBlockPlace(playerName, after);
}
/**
* Logs any block change. Don't try to combine broken and placed blocks. Queue two block changes or use the queueBLockReplace methods.
*/