Adding Citadel support and finally fixing brew colors for 1.12

This commit is contained in:
ProgrammerDan
2017-07-26 14:36:50 -04:00
parent 851160fbac
commit 5089b24dac
10 changed files with 115 additions and 16 deletions
+21
View File
@@ -22,6 +22,7 @@ import org.bukkit.material.Wood;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import com.dre.brewery.integration.CitadelBarrel;
import com.dre.brewery.integration.GriefPreventionBarrel;
import com.dre.brewery.integration.LWCBarrel;
import com.dre.brewery.integration.LogBlockBarrel;
@@ -179,6 +180,26 @@ public class Barrel implements InventoryHolder {
}
}
}
if (event != null && P.p.useCitadel) {
Plugin plugin = P.p.getServer().getPluginManager().getPlugin("Citadel");
if (plugin != null) {
try {
if (isSign(event.getClickedBlock())) {
return CitadelBarrel.checkAccess(player, getSignOfSpigot());
} else {
return CitadelBarrel.checkAccess(player, spigot);
}
} catch (Throwable e) {
P.p.errorLog("Failed to Check Citadel for Container Access Permissions!");
P.p.errorLog("Brewery was tested with version 3.9.1 of Citadel!");
P.p.errorLog("Disable Citadel support in the config and do /brew reload");
e.printStackTrace();
P.p.msg(player, "&cError opening Barrel, please report to an admin!");
return false;
}
}
}
return true;
}