mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
add "Interaction" result action string check
fixes container interactions being logged as block removals
This commit is contained in:
parent
4898bcf7b5
commit
8ed35aba2b
@ -333,10 +333,14 @@ public class CoreProtectBridge extends FreedomService
|
||||
{
|
||||
s = " placed ";
|
||||
}
|
||||
else
|
||||
else if (result.getActionString().equals("Removal"))
|
||||
{
|
||||
s = " broke ";
|
||||
}
|
||||
else
|
||||
{
|
||||
s = " interacted with ";
|
||||
}
|
||||
|
||||
if (result.isRolledBack())
|
||||
{
|
||||
@ -365,9 +369,15 @@ public class CoreProtectBridge extends FreedomService
|
||||
{
|
||||
if (data.hasInspection())
|
||||
{
|
||||
BlockState placedBlock = block.getRelative(event.getBlockFace()).getState();
|
||||
BlockState blockState = block.getRelative(event.getBlockFace()).getState();
|
||||
Block placedBlock = blockState.getBlock();
|
||||
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;
|
||||
|
||||
@ -414,10 +424,14 @@ public class CoreProtectBridge extends FreedomService
|
||||
{
|
||||
s = " placed ";
|
||||
}
|
||||
else
|
||||
else if (result.getActionString().equals("Removal"))
|
||||
{
|
||||
s = " broke ";
|
||||
}
|
||||
else
|
||||
{
|
||||
s = " interacted with ";
|
||||
}
|
||||
|
||||
if (result.isRolledBack())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user