Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Aura Skills not recognizing Wand modified Blocks #84

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>dev.aurelium</groupId>
<artifactId>auraskills-api-bukkit</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.github.Mooy1</groupId>
<artifactId>InfinityLib</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag;
import me.gallowsdove.foxymachines.FoxyMachines;
import me.gallowsdove.foxymachines.Items;
import me.gallowsdove.foxymachines.utils.AuraSkillsCompat;
import me.gallowsdove.foxymachines.utils.SimpleLocation;
import me.gallowsdove.foxymachines.utils.Utils;
import org.bukkit.*;
Expand Down Expand Up @@ -123,7 +124,12 @@ protected ItemUseHandler onUse() {
if (removeItemCharge(e.getItem(), getCostPerBlock() * locs.size())) {
inventory.removeItem(blocks);
for (Location loc : locs) {
Bukkit.getScheduler().runTask(FoxyMachines.getInstance(), () -> loc.getBlock().setType(material));
Bukkit.getScheduler().runTask(FoxyMachines.getInstance(), () -> {
loc.getBlock().setType(material);
if (Utils.isAuraSkillsLoaded()) {
AuraSkillsCompat.addPlacedBlock(loc.getBlock());
}
});
}
} else {
player.sendMessage(ChatColor.RED + "Your item doesn't have enough energy for that!");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package me.gallowsdove.foxymachines.utils;

import dev.aurelium.auraskills.api.AuraSkillsBukkitProvider;
import dev.aurelium.auraskills.api.region.Regions;
import org.bukkit.block.Block;

public class AuraSkillsCompat {
public static void addPlacedBlock(Block block) {
Regions regions = AuraSkillsBukkitProvider.getInstance().getRegions();
if (regions != null) {
regions.addPlacedBlock(block);
}
}
}
5 changes: 5 additions & 0 deletions src/main/java/me/gallowsdove/foxymachines/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.Bukkit;

import javax.annotation.Nonnull;

public class Utils {
private Utils() {}

public static boolean isAuraSkillsLoaded() {
return Bukkit.getPluginManager().isPluginEnabled("AuraSkills");
}

public static void dealDamageBypassingArmor(LivingEntity entity, double damage) {
if (damage >= 0) {
if (entity.getAbsorptionAmount() >= 0) {
Expand Down
20 changes: 3 additions & 17 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@
## CHANGE this to the name of your plugin.
name: FoxyMachines
main: me.gallowsdove.foxymachines.FoxyMachines

## CHANGE this to your username.
author: GallowsDove

## CHANGE this to a meaninful but short description of your plugin.
description: Adds tools, machines, items, armor, weapons, bosses and more!

## CHANGE this to the path of the class that extends JavaPlugin.
main: me.gallowsdove.foxymachines.FoxyMachines

## You can change this to link to your website or repository. You can also remove this line if you want to.
website: https://github.com/GallowsDove/FoxyMachines

## This is required and marks Slimefun as a plugin dependency.
depend: [Slimefun]

## This value is automatically replaced by the version specified in your pom.xml file, do not change this.
softdepend: [AuraSkills]
version: ${project.version}

## This is the minimum minecraft version required to run your plugin.
api-version: 1.16

## Commands
commands:
foxymachines:
description: foxymachines main command
usage: /foxymachines <subcommand>
aliases: [fm, foxy]

## Permissions
permissions:
foxymachines.bypass-chunk-loader-limit:
description: Allows a player with the permission to place an unlimited amount of chunk loaders
Expand All @@ -39,4 +25,4 @@ permissions:
default: op
foxymachines.info:
description: Gives players access to basic FoxyMachines commands. Should never be revoked.
default: true
default: true
Loading