This commit is contained in:
Brianna O'Keefe 2019-03-14 13:40:40 -04:00
parent 8b8446b615
commit d683e0b87b
10 changed files with 61 additions and 41 deletions

View File

@ -1,7 +1,7 @@
package com.songoda.epicspawners.hook.hooks;
package com.songoda.epichoppers.hook.hooks;
import com.songoda.epicspawners.hook.HookType;
import com.songoda.epicspawners.hook.ProtectionPluginHook;
import com.songoda.epichoppers.hook.HookType;
import com.songoda.epichoppers.hook.ProtectionPluginHook;
import com.wasteofplastic.askyblock.ASkyBlock;
import com.wasteofplastic.askyblock.ASkyBlockAPI;
import com.wasteofplastic.askyblock.Island;

View File

@ -1,7 +1,7 @@
package com.songoda.epicspawners.hook.hooks;
package com.songoda.epichoppers.hook.hooks;
import com.songoda.epicspawners.hook.HookType;
import com.songoda.epicspawners.hook.ProtectionPluginHook;
import com.songoda.epichoppers.hook.HookType;
import com.songoda.epichoppers.hook.ProtectionPluginHook;
import me.markeh.factionsframework.FactionsFramework;
import me.markeh.factionsframework.entities.FPlayer;
import me.markeh.factionsframework.entities.FPlayers;

View File

@ -1,7 +1,7 @@
package com.songoda.epicspawners.hook.hooks;
package com.songoda.epichoppers.hook.hooks;
import com.songoda.epicspawners.hook.HookType;
import com.songoda.epicspawners.hook.ProtectionPluginHook;
import com.songoda.epichoppers.hook.HookType;
import com.songoda.epichoppers.hook.ProtectionPluginHook;
import me.ryanhamshire.GriefPrevention.Claim;
import me.ryanhamshire.GriefPrevention.GriefPrevention;
import org.bukkit.Location;
@ -30,7 +30,7 @@ public class HookGriefPrevention implements ProtectionPluginHook {
@Override
public boolean canBuild(Player player, Location location) {
Claim claim = griefPrevention.dataStore.getClaimAt(location, false, null);
return claim != null && claim.allowBuild(player, Material.MOB_SPAWNER) == null;
return claim != null && claim.allowBuild(player, Material.HOPPER) == null;
}
@Override

View File

@ -1,7 +1,7 @@
package com.songoda.epicspawners.hook.hooks;
package com.songoda.epichoppers.hook.hooks;
import com.songoda.epicspawners.hook.HookType;
import com.songoda.epicspawners.hook.ProtectionPluginHook;
import com.songoda.epichoppers.hook.HookType;
import com.songoda.epichoppers.hook.ProtectionPluginHook;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

View File

@ -1,9 +1,10 @@
package com.songoda.epicspawners.hook.hooks;
package com.songoda.epichoppers.hook.hooks;
import com.intellectualcrafters.plot.api.PlotAPI;
import com.plotsquared.bukkit.BukkitMain;
import com.songoda.epicspawners.hook.HookType;
import com.songoda.epicspawners.hook.ProtectionPluginHook;
import com.github.intellectualsites.plotsquared.api.PlotAPI;
import com.github.intellectualsites.plotsquared.bukkit.BukkitMain;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.songoda.epichoppers.hook.HookType;
import com.songoda.epichoppers.hook.ProtectionPluginHook;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
@ -28,13 +29,25 @@ public class HookPlotSquared implements ProtectionPluginHook {
@Override
public boolean canBuild(Player player, Location location) {
return plotSquared.getPlot(location) != null && plotSquared.isInPlot(player)
&& plotSquared.getPlot(location) == plotSquared.getPlot(player);
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
new com.github.intellectualsites.plotsquared.plot.object.Location(location.getWorld().getName(),
location.getBlockX(), location.getBlockY(), location.getBlockZ());
Plot plot = plotLocation.getPlot();
return plot != null
&& plot.getOwners().contains(player.getUniqueId())
&& plot.getMembers().contains(player.getUniqueId());
}
@Override
public boolean isInClaim(Location location) {
return plotSquared.getPlot(location) != null;
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
new com.github.intellectualsites.plotsquared.plot.object.Location(location.getWorld().getName(),
location.getBlockX(), location.getBlockY(), location.getBlockZ());
Plot plot = plotLocation.getPlot();
return plot != null;
}
@Override

View File

@ -1,10 +1,10 @@
package com.songoda.epicspawners.hook.hooks;
package com.songoda.epichoppers.hook.hooks;
import br.net.fabiozumbi12.RedProtect.Bukkit.API.RedProtectAPI;
import br.net.fabiozumbi12.RedProtect.Bukkit.RedProtect;
import br.net.fabiozumbi12.RedProtect.Bukkit.Region;
import com.songoda.epicspawners.hook.HookType;
import com.songoda.epicspawners.hook.ProtectionPluginHook;
import com.songoda.epichoppers.hook.HookType;
import com.songoda.epichoppers.hook.ProtectionPluginHook;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

View File

@ -1,7 +1,7 @@
package com.songoda.epicspawners.hook.hooks;
package com.songoda.epichoppers.hook.hooks;
import com.songoda.epicspawners.hook.HookType;
import com.songoda.epicspawners.hook.ProtectionPluginHook;
import com.songoda.epichoppers.hook.HookType;
import com.songoda.epichoppers.hook.ProtectionPluginHook;
import me.goodandevil.skyblock.SkyBlock;
import me.goodandevil.skyblock.island.Island;
import org.bukkit.Location;

View File

@ -1,12 +1,12 @@
package com.songoda.epicspawners.hook.hooks;
package com.songoda.epichoppers.hook.hooks;
import com.palmergames.bukkit.towny.Towny;
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.TownyUniverse;
import com.songoda.epicspawners.hook.HookType;
import com.songoda.epicspawners.hook.ProtectionPluginHook;
import com.songoda.epicspawners.utils.Debugger;
import com.songoda.epichoppers.hook.HookType;
import com.songoda.epichoppers.hook.ProtectionPluginHook;
import com.songoda.epichoppers.utils.Debugger;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

View File

@ -1,7 +1,7 @@
package com.songoda.epicspawners.hook.hooks;
package com.songoda.epichoppers.hook.hooks;
import com.songoda.epicspawners.hook.HookType;
import com.songoda.epicspawners.hook.ProtectionPluginHook;
import com.songoda.epichoppers.hook.HookType;
import com.songoda.epichoppers.hook.ProtectionPluginHook;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;

View File

@ -1,23 +1,28 @@
package com.songoda.epicspawners.hook.hooks;
package com.songoda.epichoppers.hook.hooks;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldguard.WorldGuard;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.songoda.epicspawners.hook.HookType;
import com.songoda.epicspawners.hook.ProtectionPluginHook;
import com.sk89q.worldguard.protection.ApplicableRegionSet;
import com.sk89q.worldguard.protection.flags.Flags;
import com.sk89q.worldguard.protection.regions.RegionQuery;
import com.songoda.epichoppers.hook.HookType;
import com.songoda.epichoppers.hook.ProtectionPluginHook;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class HookWorldGuard implements ProtectionPluginHook {
private final WorldGuardPlugin worldGuard;
private final WorldGuard worldGuard;
public HookWorldGuard() {
this.worldGuard = WorldGuardPlugin.inst();
this.worldGuard = WorldGuard.getInstance();
}
@Override
public JavaPlugin getPlugin() {
return worldGuard;
return WorldGuardPlugin.inst();
}
@Override
@ -27,7 +32,9 @@ public class HookWorldGuard implements ProtectionPluginHook {
@Override
public boolean canBuild(Player player, Location location) {
return worldGuard.canBuild(player, location);
RegionQuery q = worldGuard.getPlatform().getRegionContainer().createQuery();
ApplicableRegionSet ars = q.getApplicableRegions(BukkitAdapter.adapt(player.getLocation()));
return ars.testState(WorldGuardPlugin.inst().wrapPlayer(player), Flags.BUILD);
}
@Override