mirror of
https://github.com/songoda/EpicBuckets.git
synced 2024-11-13 05:45:16 +01:00
Support for many Faction plugins + shop opens by default
This commit is contained in:
parent
ebe2bcdf0a
commit
76d6f7a5e3
9
pom.xml
9
pom.xml
@ -2,7 +2,7 @@
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>EpicBuckets</artifactId>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>1.2</version>
|
||||
<version>1.2.3</version>
|
||||
<build>
|
||||
<defaultGoal>clean package</defaultGoal>
|
||||
<plugins>
|
||||
@ -197,10 +197,9 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.massivecraft</groupId>
|
||||
<artifactId>factions</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>provided</scope>
|
||||
<groupId>me.markeh</groupId>
|
||||
<artifactId>factionsframework</artifactId>
|
||||
<version>1.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.massivecraft</groupId>
|
||||
|
@ -9,7 +9,7 @@ import com.songoda.epicbuckets.util.ChatUtil;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandAlias("epicbuckets|eb|genbucket")
|
||||
@CommandAlias("epicbuckets|eb|genbucket|gen")
|
||||
public class CommandGenbucket extends BaseCommand {
|
||||
|
||||
private EpicBuckets epicBuckets;
|
||||
@ -27,7 +27,7 @@ public class CommandGenbucket extends BaseCommand {
|
||||
}
|
||||
|
||||
@Subcommand("help")
|
||||
@CatchUnknown @Default
|
||||
@CatchUnknown
|
||||
public void doHelp(CommandSender sender) {
|
||||
sender.sendMessage(ChatUtil.colorString("&3&lEpicBuckets"));
|
||||
sender.sendMessage(ChatUtil.colorString("&f/epicbuckets help: &7shows this help"));
|
||||
@ -38,6 +38,7 @@ public class CommandGenbucket extends BaseCommand {
|
||||
}
|
||||
|
||||
@Subcommand("shop")
|
||||
@Default
|
||||
@Description("Opens up the Genbucket shop")
|
||||
public void shop(Player player) {
|
||||
if (!permCheck(player, "genbucket.shop")) return;
|
||||
|
@ -86,13 +86,12 @@ public class GenbucketManager {
|
||||
}
|
||||
|
||||
public boolean canPlaceGenbucket(Player player, Location location) {
|
||||
boolean factionsMassiveCraftCheck = RegionMassiveCraftFactions.canBuild(player, location);
|
||||
boolean factionsCheck = RegionFactions.canBuild(player, location);
|
||||
boolean griefPreventionCheck = RegionGriefPrevention.canBuild(player, location);
|
||||
boolean worldGuardCheck = RegionWorldGuard.canBuild(player, location);
|
||||
boolean worldBorderCheck = RegionWorldBorder.isOutsideOfBorder(location);
|
||||
|
||||
if (!factionsMassiveCraftCheck || !griefPreventionCheck || !worldGuardCheck || worldBorderCheck) {
|
||||
player.sendMessage(ChatUtil.colorPrefix(epicBuckets.getLocale().getMessage("event.place.nothere")));
|
||||
if (!factionsCheck || !griefPreventionCheck || !worldGuardCheck || worldBorderCheck) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.songoda.epicbuckets.regionhandler;
|
||||
|
||||
import com.songoda.epicbuckets.EpicBuckets;
|
||||
import me.markeh.factionsframework.entities.FPlayers;
|
||||
import me.markeh.factionsframework.entities.Faction;
|
||||
import me.markeh.factionsframework.entities.Factions;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class RegionFactions {
|
||||
|
||||
public static boolean canBuild(Player player, Location location) {
|
||||
if (!EpicBuckets.getInstance().getConfigManager().isSupportFactions()) return true;
|
||||
|
||||
Faction f = Factions.getFactionAt(location);
|
||||
|
||||
if (f.isNone()) return EpicBuckets.getInstance().getConfigManager().isGensInWilderness();
|
||||
|
||||
if (FPlayers.getBySender(player).getFaction().isNone()) return false;
|
||||
if (FPlayers.getBySender(player).getFaction().getId().equals(f.getId())) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user