mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-26 01:51:40 +01:00
Add debug to chunk load tracking, clarify charging logic in commands
This commit is contained in:
parent
5bf9fdc6c9
commit
88ab30840b
@ -159,7 +159,7 @@ public class EventListen implements Listener {
|
||||
}
|
||||
};
|
||||
if (Messaging.isDebugging() && Setting.DEBUG_CHUNK_LOADS.asBoolean()) {
|
||||
new Exception().printStackTrace();
|
||||
new Exception("CITIZENS CHUNK LOAD DEBUG " + new ChunkCoord(event.getChunk())).printStackTrace();
|
||||
}
|
||||
if (event instanceof Cancellable) {
|
||||
runnable.run();
|
||||
@ -202,7 +202,7 @@ public class EventListen implements Listener {
|
||||
}
|
||||
}
|
||||
if (Messaging.isDebugging() && Setting.DEBUG_CHUNK_LOADS.asBoolean()) {
|
||||
new Exception().printStackTrace();
|
||||
new Exception("CITIZENS CHUNK UNLOAD DEBUG " + coord).printStackTrace();
|
||||
}
|
||||
if (loadChunk) {
|
||||
if (Messaging.isDebugging()) {
|
||||
|
@ -84,7 +84,7 @@ public class CommandTrait extends Trait {
|
||||
return id;
|
||||
}
|
||||
|
||||
private boolean checkPreconditions(Player player, Hand hand) {
|
||||
private boolean chargeCommandCosts(Player player, Hand hand) {
|
||||
if (cost > 0) {
|
||||
try {
|
||||
RegisteredServiceProvider<Economy> provider = Bukkit.getServicesManager()
|
||||
@ -249,9 +249,11 @@ public class CommandTrait extends Trait {
|
||||
if (info != null && !info.canUse(CommandTrait.this, player, command)) {
|
||||
return;
|
||||
}
|
||||
if (!charged && !checkPreconditions(player, hand)) {
|
||||
if (!charged) {
|
||||
charged = true;
|
||||
return;
|
||||
if (!chargeCommandCosts(player, hand)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
PermissionAttachment attachment = player.addAttachment(CitizensAPI.getPlugin());
|
||||
if (temporaryPermissions.size() > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user