1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-08 00:11:28 +01:00

Add meta at first break of it and after breaking

This commit is contained in:
Zrips 2016-08-04 17:42:25 +03:00
parent abd18fae7d
commit a0f95b9108

View File

@ -255,9 +255,12 @@ public class JobsPaymentListener implements Listener {
if (block.getType() == Material.FURNACE && block.hasMetadata(this.furnaceOwnerMetadata))
block.removeMetadata(this.furnaceOwnerMetadata, this.plugin);
if (Jobs.getGCManager().useBlockProtection)
if (Jobs.getGCManager().useBlockProtection) {
if (block.getState().hasMetadata(BlockMetadata))
return;
if (Jobs.getPistonProtectionListener().CheckBlock(block))
block.getState().setMetadata(BlockMetadata, new FixedMetadataValue(this.plugin, true));
}
if (Jobs.getGCManager().useBlockTimer)
if (Jobs.getPistonProtectionListener().checkVegybreak(block, event.getPlayer()))
@ -360,9 +363,12 @@ public class JobsPaymentListener implements Listener {
return;
// Block place/break protection
if (Jobs.getGCManager().useBlockProtection)
if (Jobs.getGCManager().useBlockProtection) {
if (block.getState().hasMetadata(BlockMetadata))
return;
if (Jobs.getPistonProtectionListener().CheckBlock(block))
block.getState().setMetadata(BlockMetadata, new FixedMetadataValue(this.plugin, true));
}
if (Jobs.getGCManager().WaterBlockBreake)
block.getState().setMetadata(PlacedBlockMetadata, new FixedMetadataValue(this.plugin, true));