add "Interaction" result action string check

fixes container interactions being logged as block removals
This commit is contained in:
speed 2020-12-01 18:53:28 -05:00
parent 4898bcf7b5
commit 8ed35aba2b

View File

@ -333,10 +333,14 @@ public class CoreProtectBridge extends FreedomService
{ {
s = " placed "; s = " placed ";
} }
else else if (result.getActionString().equals("Removal"))
{ {
s = " broke "; s = " broke ";
} }
else
{
s = " interacted with ";
}
if (result.isRolledBack()) if (result.isRolledBack())
{ {
@ -365,9 +369,15 @@ public class CoreProtectBridge extends FreedomService
{ {
if (data.hasInspection()) if (data.hasInspection())
{ {
BlockState placedBlock = block.getRelative(event.getBlockFace()).getState(); BlockState blockState = block.getRelative(event.getBlockFace()).getState();
Block placedBlock = blockState.getBlock();
event.setCancelled(true); event.setCancelled(true);
List<String[]> lookup = coreProtect.blockLookup(placedBlock.getBlock(), -1); List<String[]> lookup = coreProtect.blockLookup(placedBlock, -1);
if (lookup.isEmpty())
{
lookup = coreProtect.blockLookup(block, -1);
}
int cooldownTime = 3; int cooldownTime = 3;
@ -414,10 +424,14 @@ public class CoreProtectBridge extends FreedomService
{ {
s = " placed "; s = " placed ";
} }
else else if (result.getActionString().equals("Removal"))
{ {
s = " broke "; s = " broke ";
} }
else
{
s = " interacted with ";
}
if (result.isRolledBack()) if (result.isRolledBack())
{ {