-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
91 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/com/artillexstudios/axsellwands/hooks/protection/TownyHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.artillexstudios.axsellwands.hooks.protection; | ||
|
||
import com.palmergames.bukkit.towny.object.TownyPermission; | ||
import com.palmergames.bukkit.towny.utils.PlayerCacheUtil; | ||
import org.bukkit.Location; | ||
import org.bukkit.Material; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class TownyHook implements ProtectionHook { | ||
|
||
public boolean canPlayerBuildAt(@NotNull Player player, @NotNull Location location) { | ||
return PlayerCacheUtil.getCachePermission(player, location, Material.STONE, TownyPermission.ActionType.BUILD); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/artillexstudios/axsellwands/hooks/shop/DynamicShop3Hook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.artillexstudios.axsellwands.hooks.shop; | ||
|
||
import me.sat7.dynamicshop.DynaShopAPI; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
public class DynamicShop3Hook implements PricesHook { | ||
|
||
@Override | ||
public void setup() { | ||
} | ||
|
||
@Override | ||
public double getPrice(ItemStack it) { | ||
double most = -1.0D; | ||
for (String str : DynaShopAPI.getShops()) { | ||
most = Math.max(DynaShopAPI.getBuyPrice(str, it), most); | ||
} | ||
if (most == -1.0D) return most; | ||
return most * it.getAmount(); | ||
} | ||
|
||
@Override | ||
public double getPrice(Player player, ItemStack it) { | ||
return getPrice(it); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,6 @@ softdepend: | |
- WorldGuard | ||
- SuperiorSkyblock2 | ||
- IridiumSkyBlock | ||
- HuskTowns | ||
- HuskTowns | ||
- Towny | ||
- DynamicShop |