mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 08:25:07 +00:00
Catch any exception for custom worldguard flag register (#993)
## Misc. Changes * Changes exception for WorldGuard bending flag * Skip jukeboxes for TempBlocks to prevent invalid record type when trying to revert them
This commit is contained in:
parent
0faa8b6398
commit
e1c977ca7d
2 changed files with 3 additions and 4 deletions
|
@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.hooks;
|
|||
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagConflictException;
|
||||
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
|
||||
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
|
@ -12,8 +11,8 @@ public class WorldGuardFlag {
|
|||
final FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry();
|
||||
try {
|
||||
registry.register(new StateFlag("bending", false));
|
||||
} catch (final FlagConflictException e) {
|
||||
ProjectKorra.log.severe("unable to register bending WorldGuard Flag");
|
||||
} catch (final Exception e) {
|
||||
ProjectKorra.log.severe("Unable to register bending WorldGuard Flag");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class TempBlock {
|
|||
instances.put(block, temp);
|
||||
} else {
|
||||
this.state = block.getState();
|
||||
if (this.state instanceof Container) {
|
||||
if (this.state instanceof Container || this.state.getType() == Material.JUKEBOX) {
|
||||
return;
|
||||
}
|
||||
instances.put(block, this);
|
||||
|
|
Loading…
Reference in a new issue