From f2af77b9b74176444e4314d913a90955dd0dd2b8 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 26 Jun 2018 21:28:36 +0200 Subject: [PATCH] Resolved compile errors, LB removed LogBlock support removed --- pom.xml | 23 +++++++++++++++---- .../limitedcreative/FeatureMetrics.java | 15 ++++++------ .../blockstate/BlockStateCommand.java | 2 +- .../worldedit/LCEditSession_LogBlock.java | 7 +++--- .../limits/PlayerListener.java | 4 ++-- .../regions/RegionsCommand.java | 4 ++-- 6 files changed, 33 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index e361688..ac5fa81 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ UTF-8 - 1.4-SNAPSHOT + 1.7.0 1.7.2-R0.1-SNAPSHOT @@ -43,8 +43,8 @@ - bukkit-repo - http://repo.bukkit.org/content/groups/public + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ @@ -67,6 +67,13 @@ http://repo.md-5.net/content/groups/public/ + + + + de-jas-rep + http://repo.ja-s.de/mvn + + @@ -84,7 +91,7 @@ com.sk89q worldguard - 5.8-SNAPSHOT + 6.1 @@ -128,6 +135,12 @@ coreprotect 2.0.8 + + + org.mcstats + metrics + R6 + @@ -253,4 +266,4 @@ - + diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/FeatureMetrics.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/FeatureMetrics.java index b3c3d11..8c92f19 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/FeatureMetrics.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/FeatureMetrics.java @@ -6,19 +6,18 @@ import org.bukkit.event.Listener; import de.jaschastarke.bukkit.lib.CoreModule; import de.jaschastarke.bukkit.tools.stats.IStatistics; -import de.jaschastarke.bukkit.tools.stats.MCStatsMetrics; -import de.jaschastarke.bukkit.tools.stats.MCStatsMetrics.Graph; import de.jaschastarke.bukkit.tools.stats.PiwikStatistics; import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.ModuleEntry; import de.jaschastarke.modularize.ModuleEntry.ModuleState; +import org.mcstats.Metrics; public class FeatureMetrics extends CoreModule implements Listener { public FeatureMetrics(LimitedCreative plugin) { super(plugin); } private IStatistics metric; - private MCStatsMetrics mcstats = null; + private Metrics mcstats = null; @Override public void onEnable() { @@ -26,12 +25,12 @@ public class FeatureMetrics extends CoreModule implements Liste metric = new PiwikStatistics(plugin); if (mcstats == null) { try { - mcstats = new MCStatsMetrics(plugin); + mcstats = new Metrics(plugin); - Graph moduleGraph = mcstats.createGraph("Module Usage"); + Metrics.Graph moduleGraph = mcstats.createGraph("Module Usage"); for (final ModuleEntry mod : plugin.getModules()) { if (mod.getModule() instanceof CoreModule) { - moduleGraph.addPlotter(new MCStatsMetrics.Plotter(((CoreModule) mod.getModule()).getName()) { + moduleGraph.addPlotter(new Metrics.Plotter(((CoreModule) mod.getModule()).getName()) { @Override public int getValue() { return mod.getState() == ModuleState.ENABLED ? 1 : 0; @@ -39,9 +38,9 @@ public class FeatureMetrics extends CoreModule implements Liste }); } } - Graph depGraph = mcstats.createGraph("Dependencies"); + Metrics.Graph depGraph = mcstats.createGraph("Dependencies"); for (final String dep : plugin.getDescription().getSoftDepend()) { - depGraph.addPlotter(new MCStatsMetrics.Plotter(dep) { + depGraph.addPlotter(new Metrics.Plotter(dep) { @Override public int getValue() { return plugin.getServer().getPluginManager().isPluginEnabled(dep) ? 1 : 0; diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateCommand.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateCommand.java index 6a28282..7d5bd9a 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateCommand.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateCommand.java @@ -223,7 +223,7 @@ public class BlockStateCommand extends BukkitCommand implements IHelpDescribed { return false; } - if (Bukkit.getServer().getOnlinePlayers().length > (context.isPlayer() ? 1 : 0)) { + if (Bukkit.getServer().getOnlinePlayers().size() > (context.isPlayer() ? 1 : 0)) { context.responseFormatted(ChatFormattings.ERROR, L("command.blockstate.migrate_useronline_error")); return true; } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/worldedit/LCEditSession_LogBlock.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/worldedit/LCEditSession_LogBlock.java index 00b90b4..2866995 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/worldedit/LCEditSession_LogBlock.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/worldedit/LCEditSession_LogBlock.java @@ -10,11 +10,10 @@ import com.sk89q.worldedit.patterns.Pattern; import com.sk89q.worldedit.regions.Region; import de.diddiz.LogBlock.LogBlock; -import de.diddiz.worldedit.LogBlockEditSession; import de.jaschastarke.minecraft.limitedcreative.blockstate.DBModel.DBTransaction; -public class LCEditSession_LogBlock extends LogBlockEditSession { - private LCEditSessionFactory factory; +public class LCEditSession_LogBlock { //The superclass got deleted at: https://github.com/LogBlock/LogBlock/commit/fa1e1b777a9da062d10d7c3c1906520e4d39eba8 +/* private LCEditSessionFactory factory; private LocalPlayer player; public LCEditSession_LogBlock(LCEditSessionFactory factory, LocalWorld world, int maxBlocks, BlockBag blockBag, LocalPlayer player) { @@ -94,5 +93,5 @@ public class LCEditSession_LogBlock extends LogBlockEditSession { } } return success; - } + }*/ } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java index 5f4628f..e876678 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java @@ -224,8 +224,8 @@ public class PlayerListener implements Listener { EntityDamageByEntityEvent event = (EntityDamageByEntityEvent) rawevent; Entity source = event.getDamager(); - if (source instanceof Projectile) - source = ((Projectile) source).getShooter(); + if (source instanceof Projectile && ((Projectile) source).getShooter() instanceof Entity) + source = (Entity) ((Projectile) source).getShooter(); if (source instanceof Player) { Player player = (Player) source; diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionsCommand.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionsCommand.java index b4e517f..cca0709 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionsCommand.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionsCommand.java @@ -238,12 +238,12 @@ public class RegionsCommand extends BukkitCommand implements IHelpDescribed { ProtectedRegion region = null; if (params.getArgumentCount() == 0 && context.isPlayer()) { - RegionManager mgr = getWorldGuard().getGlobalRegionManager().get(context.getPlayer().getWorld()); + RegionManager mgr = getWorldGuard().getRegionManager(context.getPlayer().getWorld()); ApplicableRegionSet set = mgr.getApplicableRegions(context.getPlayer().getLocation()); if (set.size() > 0) { region = set.iterator().next(); } else { - region = getWorldGuard().getGlobalRegionManager().get(w).getRegionExact(GLOBAL_REGION); + region = getWorldGuard().getRegionManager(w).getRegion(GLOBAL_REGION); } } else { int rpc = params.getArgumentCount() > 1 ? 1 : 0;