mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-03-09 12:49:06 +01:00
part 1 of MythicEnchants support
This commit is contained in:
parent
eb32b59f25
commit
4ffc001900
5
pom.xml
5
pom.xml
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user