forked from LogBlock/LogBlock
Added diode and noteblock logging.
Fixed cake logging.
This commit is contained in:
@@ -74,6 +74,8 @@ public class BlockChange implements LookupCacheElement
|
|||||||
msg.append("pressed " + materialName(type));
|
msg.append("pressed " + materialName(type));
|
||||||
else if (type == 92)
|
else if (type == 92)
|
||||||
msg.append("ate a piece of " + materialName(type));
|
msg.append("ate a piece of " + materialName(type));
|
||||||
|
else if (type == 25 || type == 93 || type == 94)
|
||||||
|
msg.append("changed " + materialName(type));
|
||||||
} else if (type == 0)
|
} else if (type == 0)
|
||||||
msg.append("destroyed " + materialName(replaced, data));
|
msg.append("destroyed " + materialName(replaced, data));
|
||||||
else if (replaced == 0)
|
else if (replaced == 0)
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package de.diddiz.LogBlock;
|
package de.diddiz.LogBlock;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
@@ -43,12 +44,35 @@ class LBPlayerListener extends PlayerListener
|
|||||||
if (!event.isCancelled() && wcfg != null && (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK)) {
|
if (!event.isCancelled() && wcfg != null && (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK)) {
|
||||||
final int type = event.getClickedBlock().getTypeId();
|
final int type = event.getClickedBlock().getTypeId();
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
if (wcfg.isLogging(Logging.SWITCHINTERACT) && (type == 69 || type == 77))
|
final Location loc = event.getClickedBlock().getLocation();
|
||||||
consumer.queueBlock(player.getName(), event.getClickedBlock().getLocation(), type, type, (byte)0);
|
switch (type) {
|
||||||
else if (wcfg.isLogging(Logging.DOORINTERACT) && (type == 64 || type == 96 || type == 107 && event.getAction() == Action.RIGHT_CLICK_BLOCK))
|
case 69:
|
||||||
consumer.queueBlock(player.getName(), event.getClickedBlock().getLocation(), type, type, (byte)((event.getClickedBlock().getData() & 4) / 4));
|
case 77:
|
||||||
else if (wcfg.isLogging(Logging.CAKEEAT) && type == 92 && player.getHealth() < player.getMaxHealth())
|
if (wcfg.isLogging(Logging.SWITCHINTERACT))
|
||||||
consumer.queueBlock(player.getName(), event.getClickedBlock().getLocation(), type, type, (byte)0);
|
consumer.queueBlock(player.getName(), loc, type, type, (byte)0);
|
||||||
|
break;
|
||||||
|
case 107:
|
||||||
|
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||||
|
break;
|
||||||
|
case 64:
|
||||||
|
case 96:
|
||||||
|
if (wcfg.isLogging(Logging.DOORINTERACT))
|
||||||
|
consumer.queueBlock(player.getName(), loc, type, type, (byte)((event.getClickedBlock().getData() & 4) / 4));
|
||||||
|
break;
|
||||||
|
case 92:
|
||||||
|
if (wcfg.isLogging(Logging.CAKEEAT) && player.getFoodLevel() < 20)
|
||||||
|
consumer.queueBlock(player.getName(), loc, 92, 92, (byte)0);
|
||||||
|
break;
|
||||||
|
case 25:
|
||||||
|
if (wcfg.isLogging(Logging.NOTEBLOCKINTERACT))
|
||||||
|
consumer.queueBlock(player.getName(), loc, 25, 25, (byte)0);
|
||||||
|
break;
|
||||||
|
case 93:
|
||||||
|
case 94:
|
||||||
|
if (wcfg.isLogging(Logging.DIODEINTERACT) && event.getAction() == Action.RIGHT_CLICK_BLOCK)
|
||||||
|
consumer.queueBlock(player.getName(), loc, type, type, (byte)0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
package de.diddiz.LogBlock;
|
package de.diddiz.LogBlock;
|
||||||
|
|
||||||
public enum Logging {
|
public enum Logging {
|
||||||
BLOCKPLACE(true), BLOCKBREAK(true), SIGNTEXT, TNTEXPLOSION(true), CREEPEREXPLOSION(true), GHASTFIREBALLEXPLOSION(true), MISCEXPLOSION, FIRE(true), LEAVESDECAY, LAVAFLOW, WATERFLOW, CHESTACCESS, KILL, CHAT, SNOWFORM, SNOWFADE, DOORINTERACT, SWITCHINTERACT, CAKEEAT, ENDERMEN;
|
BLOCKPLACE(true), BLOCKBREAK(true), SIGNTEXT, TNTEXPLOSION(true), CREEPEREXPLOSION(true), GHASTFIREBALLEXPLOSION(true), MISCEXPLOSION, FIRE(true), LEAVESDECAY, LAVAFLOW, WATERFLOW, CHESTACCESS, KILL, CHAT, SNOWFORM, SNOWFADE, DOORINTERACT, SWITCHINTERACT, CAKEEAT, ENDERMEN, NOTEBLOCKINTERACT, DIODEINTERACT;
|
||||||
|
|
||||||
public static int length = Logging.values().length;
|
public static int length = Logging.values().length;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user