Skip to content

Commit

Permalink
1.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
BenceX100 committed Aug 24, 2024
1 parent c60e6d5 commit 5b6300d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.artillexstudios</groupId>
<artifactId>AxSellwands</artifactId>
<version>1.6.3</version>
<version>1.6.4</version>
<packaging>jar</packaging>

<name>AxSellwands</name>
Expand Down Expand Up @@ -156,7 +156,7 @@
<dependency>
<groupId>com.artillexstudios.axapi</groupId>
<artifactId>axapi</artifactId>
<version>1.4.329</version>
<version>1.4.332</version>
<scope>compile</scope>
<classifier>all</classifier>
</dependency>
Expand Down Expand Up @@ -350,6 +350,12 @@
<version>3.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.william278.huskclaims</groupId>
<artifactId>huskclaims-bukkit</artifactId>
<version>1.3.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.palmergames.bukkit.towny</groupId>
<artifactId>towny</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.artillexstudios.axsellwands.hooks.other.Placeholders;
import com.artillexstudios.axsellwands.hooks.protection.BentoBoxHook;
import com.artillexstudios.axsellwands.hooks.protection.GriefPreventionHook;
import com.artillexstudios.axsellwands.hooks.protection.HuskClaimsHook;
import com.artillexstudios.axsellwands.hooks.protection.HuskTownsHook;
import com.artillexstudios.axsellwands.hooks.protection.IridiumSkyBlockHook;
import com.artillexstudios.axsellwands.hooks.protection.KingdomsXHook;
Expand Down Expand Up @@ -101,6 +102,11 @@ public static void setupHooks() {
Bukkit.getConsoleSender().sendMessage(StringUtils.formatToString("&#33FF33[AxSellwands] Hooked into HuskTowns!"));
}

if (HOOKS.getBoolean("hook-settings.HuskClaims.register", true) && Bukkit.getPluginManager().getPlugin("HuskClaims") != null) {
PROTECTION_HOOKS.add(new HuskClaimsHook());
Bukkit.getConsoleSender().sendMessage(StringUtils.formatToString("&#33FF33[AxSellwands] Hooked into HuskClaims!"));
}

if (HOOKS.getBoolean("hook-settings.Towny.register", true) && Bukkit.getPluginManager().getPlugin("Towny") != null) {
PROTECTION_HOOKS.add(new TownyHook());
Bukkit.getConsoleSender().sendMessage(StringUtils.formatToString("&#33FF33[AxSellwands] Hooked into Towny!"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.artillexstudios.axsellwands.hooks.protection;

import net.william278.huskclaims.api.HuskClaimsAPI;
import net.william278.huskclaims.libraries.cloplib.operation.OperationType;
import net.william278.huskclaims.position.Position;
import net.william278.huskclaims.user.OnlineUser;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

public class HuskClaimsHook implements ProtectionHook {

public boolean canPlayerBuildAt(@NotNull Player player, @NotNull Location location) {
var huskClaims = HuskClaimsAPI.getInstance();
final OnlineUser user = huskClaims.getOnlineUser(player.getUniqueId());
final Position position = huskClaims.getPosition(location.getX(), location.getY(), location.getZ(), location.getWorld().getName());
return huskClaims.isOperationAllowed(user, OperationType.BLOCK_BREAK, position);
}
}
3 changes: 2 additions & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ softdepend:
- HuskTowns
- Towny
- DynamicShop
- ExcellentShop
- ExcellentShop
- HuskClaims

0 comments on commit 5b6300d

Please sign in to comment.