Skip to content

Commit

Permalink
release: 1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Sep 10, 2023
1 parent 8c4fcb2 commit dac3ee8
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies {
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.20"))
compileOnly("com.plotsquared:PlotSquared-Core")
compileOnly("com.plotsquared:PlotSquared-Bukkit")
compileOnly("com.github.TechFortress:GriefPrevention:16.18")
}

java {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pluginVersion=1.3.2
pluginVersion=1.3.3
1 change: 1 addition & 0 deletions src/main/java/io/th0rgal/protectionlib/ProtectionLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public static void init(JavaPlugin plugin) {
handleCompatibility("Lands", plugin, (m, p) -> new LandsCompat(m, p));
handleCompatibility("PlotSquared", plugin, (m, p) -> new PlotSquaredCompat(m, p));
handleCompatibility("CrashClaim", plugin, (m, p) -> new CrashClaimCompat(m, p));
handleCompatibility("GriefPrevention", plugin, (m, p) -> new GriefPreventionCompat(m, p));
}

public static boolean canBuild(Player player, Location target) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package io.th0rgal.protectionlib.compatibilities;

import io.th0rgal.protectionlib.ProtectionCompatibility;
import me.ryanhamshire.GriefPrevention.GriefPrevention;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

public class GriefPreventionCompat extends ProtectionCompatibility {

public GriefPreventionCompat(JavaPlugin mainPlugin, Plugin plugin) {
super(mainPlugin, plugin);
}

/**
* @param player Player looking to place a block
* @param target Place where the player seeks to place a block
* @return true if he can put the block
*/
@Override
public boolean canBuild(Player player, Location target) {
return GriefPrevention.instance.allowBuild(player, target) == null;
}

/**
* @param player Player looking to break a block
* @param target Place where the player seeks to break a block
* @return true if he can break the block
*/
@Override
public boolean canBreak(Player player, Location target) {
return GriefPrevention.instance.allowBreak(player, target.getBlock(), target) == null;
}

/**
* @param player Player looking to interact with a block
* @param target Place where the player seeks to interact with a block
* @return true if he can interact with the block
*/
@Override
public boolean canInteract(Player player, Location target) {
return GriefPrevention.instance.allowBuild(player, target) == null;
}

/**
* @param player Player looking to use an item
* @param target Place where the player seeks to use an item at a location
* @return true if he can use the item at the location
*/
@Override
public boolean canUse(Player player, Location target) {
return GriefPrevention.instance.allowBuild(player, target) == null;
}
}

0 comments on commit dac3ee8

Please sign in to comment.