/* * Decompiled with CFR 0.152. * * Could not load the following classes: * cpw.mods.fml.common.eventhandler.SubscribeEvent * mods.flammpfeil.slashblade.ItemSlashBlade * mods.flammpfeil.slashblade.ItemSlashBlade$ComboSequence * mods.flammpfeil.slashblade.specialeffect.ISpecialEffect * mods.flammpfeil.slashblade.specialeffect.SpecialEffects * mods.flammpfeil.slashblade.util.SlashBladeEvent$OnUpdateEvent * mods.flammpfeil.slashblade.util.SlashBladeHooks * net.minecraft.entity.Entity * net.minecraft.entity.player.EntityPlayer * net.minecraft.item.ItemStack * net.minecraft.nbt.NBTTagCompound * net.minecraft.potion.Potion * net.minecraft.potion.PotionEffect * net.minecraft.world.World */ package net.lrsoft.foxbladeex.hypersystem; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import mods.flammpfeil.slashblade.ItemSlashBlade; import mods.flammpfeil.slashblade.specialeffect.ISpecialEffect; import mods.flammpfeil.slashblade.specialeffect.SpecialEffects; import mods.flammpfeil.slashblade.util.SlashBladeEvent; import mods.flammpfeil.slashblade.util.SlashBladeHooks; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class HS_basic implements ISpecialEffect { private static final String EffectKey = "HS_potion"; private boolean useBlade(ItemSlashBlade.ComboSequence sequence) { if (sequence.useScabbard) { return false; } if (sequence == ItemSlashBlade.ComboSequence.None) { return false; } return sequence != ItemSlashBlade.ComboSequence.Noutou; } @SubscribeEvent public void onUpdateItemSlashBlade(SlashBladeEvent.OnUpdateEvent event) { if (!SpecialEffects.isPlayer((Entity)event.entity)) { return; } EntityPlayer player = (EntityPlayer)event.entity; World world = player.field_70170_p; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)event.blade); if (!this.useBlade(ItemSlashBlade.getComboSequence((NBTTagCompound)tag))) { return; } switch (SpecialEffects.isEffective((EntityPlayer)player, (ItemStack)event.blade, (ISpecialEffect)this)) { case None: { player.func_70690_d(new PotionEffect(Potion.field_76420_g.func_76396_c(), 25, 1)); return; } case NonEffective: { if (player.func_70681_au().nextInt(4) == 0) break; player.func_70690_d(new PotionEffect(Potion.field_76420_g.func_76396_c(), 100, 2)); player.func_70690_d(new PotionEffect(Potion.field_76424_c.func_76396_c(), 100, 2)); return; } case Effective: { player.func_70690_d(new PotionEffect(Potion.field_76420_g.func_76396_c(), 50, 2)); player.func_70690_d(new PotionEffect(Potion.field_76432_h.func_76396_c(), 50, 2)); player.func_70690_d(new PotionEffect(Potion.field_76424_c.func_76396_c(), 50, 2)); } } } public void register() { SlashBladeHooks.EventBus.register((Object)this); } public int getDefaultRequiredLevel() { return 40; } public String getEffectKey() { return EffectKey; } }