mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-18 13:21:41 +01:00
Lets record BP when player places block in any situation if bp is set
This commit is contained in:
parent
751b57095f
commit
a9540c784e
@ -1202,7 +1202,6 @@ public class Jobs extends JavaPlugin {
|
||||
if (bp != null) {
|
||||
Long time = bp.getTime();
|
||||
Integer cd = getBpManager().getBlockDelayTime(block);
|
||||
|
||||
if (time != -1L) {
|
||||
if (time < System.currentTimeMillis() && bp.getAction() != DBAction.DELETE) {
|
||||
getBpManager().add(block, cd);
|
||||
@ -1218,6 +1217,10 @@ public class Jobs extends JavaPlugin {
|
||||
getBpManager().add(block, cd);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Lets add protection in any case
|
||||
getBpManager().add(block, cd);
|
||||
|
||||
} else if (bp.isPaid().booleanValue() && bp.getTime() == -1L && cd != null && cd == -1) {
|
||||
getBpManager().add(block, cd);
|
||||
return false;
|
||||
|
@ -2,6 +2,7 @@ package com.gamingmesh.jobs.commands.list;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
@ -53,6 +54,15 @@ public class bp implements Cmd {
|
||||
}
|
||||
}
|
||||
changedBlocks.add(l.getBlock());
|
||||
|
||||
if (Version.isCurrentEqualOrHigher(Version.v1_15_R1)) {
|
||||
if (bp.getAction() == DBAction.DELETE)
|
||||
player.sendBlockChange(l, CMIMaterial.RED_STAINED_GLASS.getMaterial().createBlockData());
|
||||
else if (time == -1)
|
||||
player.sendBlockChange(l, CMIMaterial.BLACK_STAINED_GLASS.getMaterial().createBlockData());
|
||||
else
|
||||
player.sendBlockChange(l, CMIMaterial.WHITE_STAINED_GLASS.getMaterial().createBlockData());
|
||||
} else {
|
||||
if (bp.getAction() == DBAction.DELETE)
|
||||
player.sendBlockChange(l, CMIMaterial.RED_STAINED_GLASS.getMaterial(), (byte) 14);
|
||||
else if (time == -1)
|
||||
@ -63,6 +73,7 @@ public class bp implements Cmd {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changedBlocks.isEmpty())
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.bp.output.notFound"));
|
||||
|
Loading…
Reference in New Issue
Block a user