mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 06:29:41 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -8,51 +8,50 @@ import net.minecraftforge.common.util.EnumHelper;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
|
||||
public abstract class EnchantInterface extends Enchantment{
|
||||
public abstract class EnchantInterface extends Enchantment {
|
||||
|
||||
private static EnumEnchantmentType CustomNpcsType;
|
||||
|
||||
public static EnchantInterface Damage;
|
||||
public static EnchantInterface Poison;
|
||||
public static EnchantInterface Confusion;
|
||||
public static EnchantInterface Infinite;
|
||||
|
||||
private Class[] classes;
|
||||
public static EnchantInterface Damage;
|
||||
public static EnchantInterface Poison;
|
||||
public static EnchantInterface Confusion;
|
||||
public static EnchantInterface Infinite;
|
||||
|
||||
protected EnchantInterface(int par2, Class... obs) {
|
||||
super(ConfigMain.EnchantStartId++, par2, CustomNpcsType);
|
||||
classes = obs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canApply(ItemStack par1ItemStack){
|
||||
if(par1ItemStack.getItem() == null)
|
||||
return false;
|
||||
for(Class cls : classes){
|
||||
if(cls.isInstance(par1ItemStack.getItem()))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
private Class[] classes;
|
||||
|
||||
protected EnchantInterface(int par2, Class... obs) {
|
||||
super(ConfigMain.EnchantStartId++, par2, CustomNpcsType);
|
||||
classes = obs;
|
||||
}
|
||||
|
||||
public static void load(){
|
||||
if(!ConfigMain.DisableEnchants){
|
||||
CustomNpcsType = EnumHelper.addEnchantmentType("customnpcs_enchants");
|
||||
try{
|
||||
Damage = new EnchantDamage();
|
||||
Poison = new EnchantPoison();
|
||||
Confusion = new EnchantConfusion();
|
||||
Infinite = new EnchantInfinite();
|
||||
}
|
||||
catch(Exception e){
|
||||
LogWriter.except(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int getLevel(EnchantInterface enchant, ItemStack stack) {
|
||||
if(ConfigMain.DisableEnchants || enchant == null)
|
||||
return 0;
|
||||
return EnchantmentHelper.getEnchantmentLevel(enchant.effectId, stack);
|
||||
}
|
||||
@Override
|
||||
public boolean canApply(ItemStack par1ItemStack) {
|
||||
if (par1ItemStack.getItem() == null)
|
||||
return false;
|
||||
for (Class cls : classes) {
|
||||
if (cls.isInstance(par1ItemStack.getItem()))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void load() {
|
||||
if (!ConfigMain.DisableEnchants) {
|
||||
CustomNpcsType = EnumHelper.addEnchantmentType("customnpcs_enchants");
|
||||
try {
|
||||
Damage = new EnchantDamage();
|
||||
Poison = new EnchantPoison();
|
||||
Confusion = new EnchantConfusion();
|
||||
Infinite = new EnchantInfinite();
|
||||
} catch (Exception e) {
|
||||
LogWriter.except(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int getLevel(EnchantInterface enchant, ItemStack stack) {
|
||||
if (ConfigMain.DisableEnchants || enchant == null)
|
||||
return 0;
|
||||
return EnchantmentHelper.getEnchantmentLevel(enchant.effectId, stack);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user