SHARE
TWEET

Untitled

a guest Feb 18th, 2020 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package lucraft.mods.heroes.speedsterheroes.abilities;
  2.  
  3. import javafx.stage.Screen;
  4. import lucraft.mods.heroes.speedsterheroes.SpeedsterHeroes;
  5. import lucraft.mods.heroes.speedsterheroes.client.render.SHRenderer;
  6. import lucraft.mods.heroes.speedsterheroes.superpower.SpeedforcePlayerHandler;
  7. import lucraft.mods.lucraftcore.superpowers.abilities.AbilityAction;
  8. import lucraft.mods.lucraftcore.superpowers.Superpower;
  9. import lucraft.mods.lucraftcore.superpowers.SuperpowerHandler;
  10. import net.minecraft.client.Minecraft;
  11. import net.minecraft.client.gui.screen.Screen;
  12. import net.minecraft.entity.player.PlayerEntity;
  13. import net.minecraftforge.api.distmarker.Dist;
  14. import net.minecraftforge.api.distmarker.OnlyIn;
  15. import org.lwjgl.system.CallbackI;
  16.  
  17. public class AbilityAccelerate extends AbilityAction {
  18.  
  19.     public AbilityAccelerate(PlayerEntity player) {
  20.         super(player);
  21.     }
  22.  
  23.     @Override
  24.     @OnlyIn(Dist.CLIENT)
  25.     public void drawIcon(Minecraft mc, Screen gui, int x, int y) {
  26.         SHRenderer.drawIcon(mc, gui, x, y, 0, 4);
  27.     }
  28.    
  29.     @Override
  30.     public boolean checkConditions() {
  31.         SpeedforcePlayerHandler data = SuperpowerHandler.getSpecificSuperpowerPlayerHandler(player, SpeedforcePlayerHandler.class);
  32.         return data != null && data.isInSpeed;
  33.     }
  34.    
  35.     @Override
  36.     public boolean showInAbilityBar() {
  37.         return checkConditions();
  38.     }
  39.    
  40.     @Override
  41.     public Superpower getDependentSuperpower() {
  42.         return SpeedsterHeroes.speedforce;
  43.     }
  44.    
  45.     @Override
  46.     public void action() {
  47.         SuperpowerHandler.getSpecificSuperpowerPlayerHandler(player, SpeedforcePlayerHandler.class).increaseDecreaseSpeedLevel(true);
  48.     }
  49.  
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top