1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Added CoreProtect logging for the Explosive Pickaxe

This commit is contained in:
John000708 2017-02-06 19:28:06 +01:00
parent de4f779a64
commit 0d2ff61387
2 changed files with 19 additions and 0 deletions

View File

@ -2008,6 +2008,7 @@ public class SlimefunSetup {
Block b = e.getBlock().getRelative(x, y, z); Block b = e.getBlock().getRelative(x, y, z);
if (b.getType() != Material.AIR && !StringUtils.equals(b.getType().toString(), explosiveblacklist)) { if (b.getType() != Material.AIR && !StringUtils.equals(b.getType().toString(), explosiveblacklist)) {
if (CSCoreLib.getLib().getProtectionManager().canBuild(e.getPlayer().getUniqueId(), b)) { if (CSCoreLib.getLib().getProtectionManager().canBuild(e.getPlayer().getUniqueId(), b)) {
if (SlimefunStartup.instance.isCoreProtectInstalled()) SlimefunStartup.instance.getCoreProtectAPI().logRemoval(e.getPlayer().getName(), b.getLocation(), b.getType(), b.getData());
b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType()); b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType());
SlimefunItem sfItem = BlockStorage.check(b); SlimefunItem sfItem = BlockStorage.check(b);
boolean allow = true; boolean allow = true;

View File

@ -16,6 +16,8 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines.AutoEnchanter; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines.AutoEnchanter;
import net.coreprotect.CoreProtect;
import net.coreprotect.CoreProtectAPI;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -100,8 +102,11 @@ public class SlimefunStartup extends JavaPlugin {
public static TickerTask ticker; public static TickerTask ticker;
private CoreProtectAPI coreProtectAPI;
private boolean clearlag = false; private boolean clearlag = false;
private boolean exoticGarden = false; private boolean exoticGarden = false;
private boolean coreProtect = false;
// Supported Versions of Minecraft // Supported Versions of Minecraft
final String[] supported = {"v1_9_", "v1_10_", "v1_11_", "PluginBukkitBridge"}; final String[] supported = {"v1_9_", "v1_10_", "v1_11_", "PluginBukkitBridge"};
@ -376,6 +381,8 @@ public class SlimefunStartup extends JavaPlugin {
clearlag = getServer().getPluginManager().isPluginEnabled("ClearLag"); clearlag = getServer().getPluginManager().isPluginEnabled("ClearLag");
coreProtect = getServer().getPluginManager().isPluginEnabled("CoreProtect");
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new BukkitRunnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(this, new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
@ -385,6 +392,9 @@ public class SlimefunStartup extends JavaPlugin {
if (clearlag) new ClearLaggIntegration(this); if (clearlag) new ClearLaggIntegration(this);
if (coreProtect) coreProtectAPI = ((CoreProtect)getServer().getPluginManager().getPlugin("CoreProtect")).getAPI();
SlimefunGuide.creative_research = config.getBoolean("options.allow-free-creative-research"); SlimefunGuide.creative_research = config.getBoolean("options.allow-free-creative-research");
AutoEnchanter.max_emerald_enchantments = config.getInt("options.emerald-enchantment-limit"); AutoEnchanter.max_emerald_enchantments = config.getInt("options.emerald-enchantment-limit");
@ -598,4 +608,12 @@ public class SlimefunStartup extends JavaPlugin {
public boolean isExoticGardenInstalled () { public boolean isExoticGardenInstalled () {
return exoticGarden; return exoticGarden;
} }
public boolean isCoreProtectInstalled() {
return coreProtect;
}
public CoreProtectAPI getCoreProtectAPI() {
return coreProtectAPI;
}
} }