part 1 of MythicEnchants support

This commit is contained in:
Joshua 2021-04-04 02:23:59 -05:00
parent eb32b59f25
commit 4ffc001900
5 changed files with 46 additions and 10 deletions

View File

@ -172,6 +172,11 @@
<scope>system</scope>
<systemPath>${basedir}/lib/BossShopPro.jar</systemPath>
</dependency>
<dependency>
<groupId>io.lumine</groupId>
<artifactId>MythicEnchants</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.bekvon.bukkit</groupId>
<artifactId>Residence</artifactId>

View File

@ -27,6 +27,7 @@ import net.Indyuce.mmoitems.comp.itemglow.ItemGlowListener;
import net.Indyuce.mmoitems.comp.itemglow.NoGlowListener;
import net.Indyuce.mmoitems.comp.mmocore.MMOCoreMMOLoader;
import net.Indyuce.mmoitems.comp.mmoinventory.MMOInventorySupport;
import net.Indyuce.mmoitems.comp.mythicenchants.MythicEnchantsSupport;
import net.Indyuce.mmoitems.comp.mythicmobs.LootsplosionListener;
import net.Indyuce.mmoitems.comp.mythicmobs.MythicMobsLoader;
import net.Indyuce.mmoitems.comp.parse.IridescentParser;
@ -92,6 +93,7 @@ public class MMOItems extends LuminePlugin {
private HologramSupport hologramSupport;
private VaultSupport vaultSupport;
private RPGHandler rpgPlugin;
private MythicEnchantsSupport mythicEnchantsSupport;
@Override
public void load() {
@ -128,6 +130,9 @@ public class MMOItems extends LuminePlugin {
if (Bukkit.getPluginManager().getPlugin("mcMMO") != null)
statManager.register(McMMOHook.disableMcMMORepair);
if (Bukkit.getPluginManager().getPlugin("MythicEnchants") != null)
mythicEnchantsSupport = new MythicEnchantsSupport();
}
@Override
public void enable() {
@ -504,6 +509,10 @@ public class MMOItems extends LuminePlugin {
return vaultSupport != null && vaultSupport.getPermissions() != null;
}
public MythicEnchantsSupport getMythicEnchantsSupport(){
return this.mythicEnchantsSupport;
}
public boolean hasEconomy() {
return vaultSupport != null && vaultSupport.getEconomy() != null;
}

View File

@ -65,5 +65,7 @@ public class Musket extends UntargetedWeapon {
getNBTItem(), trace.getHit());
trace.draw(loc, vec, 2, Color.BLACK);
getPlayer().getWorld().playSound(getPlayer().getLocation(), Sound.ENTITY_ZOMBIE_ATTACK_IRON_DOOR, 2, 2);
}
}

View File

@ -1,18 +1,15 @@
package net.Indyuce.mmoitems.api.player;
import java.text.DecimalFormat;
import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.bukkit.ChatColor;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import io.lumine.mythic.lib.api.item.NBTItem;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.data.AbilityData;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
import io.lumine.mythic.lib.api.item.NBTItem;
import org.bukkit.ChatColor;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import java.text.DecimalFormat;
public abstract class RPGPlayer {
private final PlayerData playerData;
@ -91,7 +88,7 @@ public abstract class RPGPlayer {
*/
public boolean canUse(NBTItem item, boolean message) { return canUse(item, message, false); }
/**
/**g
* If this item can be used by this player
* @param message Should the player be notified that they cant use the item?
* <p>Use for active checks (the player actually clicking)</p>

View File

@ -0,0 +1,23 @@
package net.Indyuce.mmoitems.comp.mythicenchants;
import io.lumine.mythicenchants.enchants.MythicEnchant;
import io.lumine.mythicenchants.util.MythicEnchantsHelper;
import io.lumine.xikage.mythicmobs.adapters.AbstractPlayer;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
public class MythicEnchantsSupport {
public MythicEnchantsSupport() {}
public void reparseWeapon(AbstractPlayer player) {
MythicEnchantsHelper.reparseWeapon(player);
}
public boolean handleEnchant(ItemStack item, Enchantment enchant, int level) {
if(enchant instanceof MythicEnchant) {
((MythicEnchant)enchant).applyToItem(item, level);
return true;
}
return false;
}
}