Skip to content

Commit

Permalink
Merge pull request #2 from PrimordialMoros/java8
Browse files Browse the repository at this point in the history
Merge version 1.2
  • Loading branch information
PrimordialMoros authored Aug 3, 2020
2 parents e7e5f3c + 73ef217 commit 6f58bf2
Show file tree
Hide file tree
Showing 32 changed files with 1,185 additions and 1,132 deletions.
3 changes: 3 additions & 0 deletions COMPILING.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Hyperion is compiled and tested with Java 11+.

To compile using Java 8 go to pom.xml and replace `<release>11</release>` with `<source>1.8</source><target>1.8</target>`
6 changes: 3 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Hyperion
Addon plugin for ProjectKorra

Includes BendingBoard

## Abilities
### Air
* AirWheel (combo)
* Evade
### Earth
* EarthCling (passive)
* EarthGlove
Expand All @@ -17,7 +18,6 @@ Includes BendingBoard
### Fire
* Bolt
* Combustion
* Fireball
* FireWave (combo)
### Water
* FrostBreath
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>com.github.primordialmoros.hyperion</groupId>
<artifactId>hyperion</artifactId>
<name>Hyperion</name>
<version>1.1</version>
<version>1.2</version>
<properties>
<authorName>Moros</authorName>
<main>Hyperion</main>
Expand Down
8 changes: 2 additions & 6 deletions src/com/github/primordialmoros/hyperion/Hyperion.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@

package com.github.primordialmoros.hyperion;

import com.github.primordialmoros.hyperion.board.BendingBoardManager;
import com.github.primordialmoros.hyperion.commands.BoardCommand;
import com.github.primordialmoros.hyperion.commands.HyperionCommand;
import com.github.primordialmoros.hyperion.configuration.ConfigManager;
import com.github.primordialmoros.hyperion.listeners.AbilityListener;
import com.github.primordialmoros.hyperion.listeners.CoreListener;
import com.github.primordialmoros.hyperion.methods.CoreMethods;
import com.github.primordialmoros.hyperion.util.BendingFallingBlock;
import com.github.primordialmoros.hyperion.util.MetricsLite;
import com.github.primordialmoros.hyperion.util.TempArmorStand;
import org.bukkit.plugin.java.JavaPlugin;

Expand All @@ -45,10 +44,9 @@ public void onEnable() {
version = getDescription().getVersion();
author = getDescription().getAuthors().get(0);

new MetricsLite(this, 8212);
new ConfigManager();
new HyperionCommand();
new BoardCommand();
BendingBoardManager.setup();
CoreMethods.loadAbilities();

getServer().getPluginManager().registerEvents(new AbilityListener(), this);
Expand All @@ -61,15 +59,13 @@ public void onEnable() {
public void onDisable() {
BendingFallingBlock.removeAll();
TempArmorStand.removeAll();
BendingBoardManager.saveChanges();
getServer().getScheduler().cancelTasks(this);
}

public static void reload() {
Hyperion.getPlugin().reloadConfig();
BendingFallingBlock.removeAll();
TempArmorStand.removeAll();
BendingBoardManager.reload();
CoreMethods.loadAbilities();
getLog().info("Hyperion Reloaded.");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/*
* Copyright 2016, 2017, 2020 Moros <https://github.com/PrimordialMoros>
*
* This file is part of Hyperion.
*
* Hyperion is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Hyperion is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Hyperion. If not, see <https://www.gnu.org/licenses/>.
*/

package com.github.primordialmoros.hyperion.abilities.airbending;

import com.github.primordialmoros.hyperion.Hyperion;
import com.projectkorra.projectkorra.ability.AddonAbility;
import com.projectkorra.projectkorra.ability.AirAbility;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;

public class Evade extends AirAbility implements AddonAbility {
private Vector direction;

private long cooldown;

private double angleStep;

public Evade(Player player) {
super(player);

if (!player.isOnGround() || player.getEyeLocation().getBlock().isLiquid() || hasAbility(player, Evade.class) || !bPlayer.canBend(this)) {
return;
}

cooldown = Hyperion.getPlugin().getConfig().getLong("Abilities.Air.Evade.Cooldown");
direction = player.getEyeLocation().getDirection().setY(0).normalize().multiply(-0.2);

angleStep = Math.PI / 10;
if (player.getEyeLocation().getDirection().getY() >= 0) angleStep = -angleStep;

player.setVelocity(player.getVelocity().add(new Vector(0, 0.1, 0)));

bPlayer.addCooldown(this);
player.setNoDamageTicks(5);
start();
}

@Override
public void progress() {
if (!bPlayer.canBendIgnoreCooldowns(this) || getCurrentTick() > getStartTick() + 10) {
remove();
return;
}
for (int i = 0; i < 2; i++) {
player.setVelocity(player.getVelocity().add(direction.clone()));
direction.rotateAroundY(angleStep);
playAirbendingParticles(player.getLocation().add(0, 1, 0), 2, 0, 0, 0);
}
}

@Override
public boolean isEnabled() {
return Hyperion.getPlugin().getConfig().getBoolean("Abilities.Air.Evade.Enabled");
}

@Override
public String getName() {
return "Evade";
}

@Override
public String getDescription() {
return Hyperion.getPlugin().getConfig().getString("Abilities.Air.Evade.Description");
}

@Override
public String getAuthor() {
return Hyperion.getAuthor();
}

@Override
public String getVersion() {
return Hyperion.getVersion();
}

@Override
public boolean isHarmlessAbility() {
return true;
}

@Override
public boolean isSneakAbility() {
return false;
}

@Override
public long getCooldown() {
return cooldown;
}

@Override
public Location getLocation() {
return player.getLocation();
}

@Override
public void load() {
}

@Override
public void stop() {
}

@Override
public void remove() {
player.setNoDamageTicks(0);
super.remove();
}
}
Loading

0 comments on commit 6f58bf2

Please sign in to comment.