Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

Commit ada04f2

Browse files
committed
2.9.7
* Used World#getMinHeight and World#getMaxHeight instead of hard-coded Y-values for certain abilities' cancellations (for 1.18 world height changes) * Added getters and setters to almost all abilities for improved data accessibility * Fixed many warnings and instances of poor style * Made almost all abilities adhere to standards concerning the possible cancellation of the AbilityStartEvent, so no irreversible changes take place if the event is cancelled * Converted all instances of Entity#setVelocity to the new GeneralMethods#setVelocity, which calls its own event * Removed unnecessary "time" variables that can be replaced with getStartTime() calls * Made FirePunch not static
1 parent 4f1d9c9 commit ada04f2

64 files changed

Lines changed: 5095 additions & 1568 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ Join our [Discord](https://discord.gg/gh9MfDmwZm) to discuss the plugin, suggest
55

66
## Changelog
77

8+
### 2.9.7
9+
- Used World#getMinHeight and World#getMaxHeight instead of hard-coded Y-values for certain abilities' cancellations (for 1.18 world height changes)
10+
- Added getters and setters to almost all abilities for improved data accessibility
11+
- Fixed many warnings and instances of poor style
12+
- Made almost all abilities adhere to standards concerning the possible cancellation of the AbilityStartEvent, so no irreversible changes take place if the event is cancelled
13+
- Converted all instances of Entity#setVelocity to the new GeneralMethods#setVelocity, which calls its own event
14+
- Removed unnecessary "time" variables that can be replaced with getStartTime() calls
15+
- Made FirePunch not static
16+
817
### 2.9.6.2
918
- Started using jitpack for ProjectKorra dependency
1019

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.jedk1</groupId>
66
<artifactId>jedcore</artifactId>
7-
<version>2.9.6.2-Spigot1.18-PK1.9.3</version>
7+
<version>2.9.7-Spigot1.18-PK1.9.3</version>
88
<packaging>jar</packaging>
99
<name>JedCore</name>
1010

src/com/jedk1/jedcore/JCManager.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package com.jedk1.jedcore;
22

3-
import com.jedk1.jedcore.ability.firebending.FirePunch;
4-
import com.jedk1.jedcore.ability.firebending.LightningBurst;
5-
import com.jedk1.jedcore.ability.waterbending.HealingWaters;
6-
import com.jedk1.jedcore.ability.waterbending.IcePassive;
7-
import com.jedk1.jedcore.util.RegenTempBlock;
8-
import com.jedk1.jedcore.util.TempFallingBlock;
3+
import org.bukkit.Bukkit;
94

10-
import org.bukkit.Bukkit;
5+
import com.jedk1.jedcore.ability.firebending.LightningBurst;
6+
import com.jedk1.jedcore.ability.waterbending.HealingWaters;
7+
import com.jedk1.jedcore.ability.waterbending.IcePassive;
8+
import com.jedk1.jedcore.util.RegenTempBlock;
9+
import com.jedk1.jedcore.util.TempFallingBlock;
1110

1211
public class JCManager implements Runnable {
1312

@@ -18,12 +17,11 @@ public JCManager(JedCore plugin) {
1817
}
1918

2019
public void run() {
21-
FirePunch.display(Bukkit.getServer());
2220
LightningBurst.progressAll();
2321

2422
HealingWaters.heal(Bukkit.getServer());
2523
IcePassive.handleSkating();
26-
//IceWall.progressAll();
24+
// IceWall.progressAll();
2725

2826
RegenTempBlock.manage();
2927
TempFallingBlock.manage();

src/com/jedk1/jedcore/JCMethods.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public static void registerCombos() {
7171

7272
/**
7373
* Gets the points of a line between two points.
74-
* @param start
75-
* @param end
74+
* @param startLoc
75+
* @param endLoc
7676
* @param points
7777
* @return locations
7878
*/
@@ -123,7 +123,7 @@ public static List<Location> getCirclePoints(Location location, int points, doub
123123
* @return
124124
*/
125125
public static List<Location> getVerticalCirclePoints(Location location, int points, double size, float yawOffset) {
126-
List<Location> locations = new ArrayList<Location>();
126+
List<Location> locations = new ArrayList<>();
127127
Location fakeLoc = location.clone();
128128
fakeLoc.setPitch(0);
129129
fakeLoc.setYaw(yawOffset);

src/com/jedk1/jedcore/ability/airbending/AirBlade.java

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public AirBlade(Player player) {
4545

4646
this.location = player.getEyeLocation().clone();
4747
this.direction = player.getEyeLocation().getDirection().clone();
48-
bPlayer.addCooldown(this);
48+
4949
start();
50+
if (!isRemoved())
51+
bPlayer.addCooldown(this);
5052
}
5153

5254
public void setFields() {
@@ -200,16 +202,60 @@ public String getDescription() {
200202
ConfigurationSection config = JedCoreConfig.getConfig(this.player);
201203
return "* JedCore Addon *\n" + config.getString("Abilities.Air.AirBlade.Description");
202204
}
203-
204-
@Override
205-
public void load() {
206205

206+
public Vector getDirection() {
207+
return direction;
207208
}
208209

209-
@Override
210-
public void stop() {
210+
public void setDirection(Vector direction) {
211+
this.direction = direction;
212+
}
213+
214+
public double getTravelled() {
215+
return travelled;
216+
}
211217

218+
public void setTravelled(double travelled) {
219+
this.travelled = travelled;
212220
}
221+
222+
public double getGrowth() {
223+
return growth;
224+
}
225+
226+
public void setGrowth(double growth) {
227+
this.growth = growth;
228+
}
229+
230+
public double getRange() {
231+
return range;
232+
}
233+
234+
public void setRange(double range) {
235+
this.range = range;
236+
}
237+
238+
public double getDamage() {
239+
return damage;
240+
}
241+
242+
public void setDamage(double damage) {
243+
this.damage = damage;
244+
}
245+
246+
public double getEntityCollisionRadius() {
247+
return entityCollisionRadius;
248+
}
249+
250+
public void setEntityCollisionRadius(double entityCollisionRadius) {
251+
this.entityCollisionRadius = entityCollisionRadius;
252+
}
253+
254+
@Override
255+
public void load() {}
256+
257+
@Override
258+
public void stop() {}
213259

214260
@Override
215261
public boolean isEnabled() {

src/com/jedk1/jedcore/ability/airbending/AirBreath.java

Lines changed: 128 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
public class AirBreath extends AirAbility implements AddonAbility {
2626

27-
private long time;
2827
private boolean isAvatar;
2928

3029
@Attribute(Attribute.COOLDOWN)
@@ -63,7 +62,6 @@ public AirBreath(Player player) {
6362
}
6463

6564
setFields();
66-
time = System.currentTimeMillis();
6765
isAvatar = bPlayer.isAvatarState();
6866
if (isAvatar && avatarAmplify) {
6967
range = avatarRange;
@@ -109,26 +107,21 @@ public void progress() {
109107
remove();
110108
return;
111109
}
112-
if (System.currentTimeMillis() < time + duration) {
110+
if (System.currentTimeMillis() < getStartTime() + duration) {
113111
playAirbendingSound(player.getLocation());
114112
createBeam();
115113
} else {
116114
bPlayer.addCooldown(this);
117115
remove();
118-
return;
119116
}
120-
return;
121117
}
122118

123119
private boolean isLocationSafe(Location loc) {
124120
Block block = loc.getBlock();
125121
if (GeneralMethods.isRegionProtectedFromBuild(player, "AirBreath", loc)) {
126122
return false;
127123
}
128-
if (!isTransparent(block)) {
129-
return false;
130-
}
131-
return true;
124+
return isTransparent(block);
132125
}
133126

134127
private void createBeam() {
@@ -146,15 +139,15 @@ private void createBeam() {
146139
if (!isLocationSafe(loc)) {
147140
if (!isTransparent(loc.getBlock())) {
148141
if (player.getLocation().getPitch() > 30) {
149-
player.setVelocity(player.getLocation().getDirection().multiply(-launch));
142+
GeneralMethods.setVelocity(this, player, player.getLocation().getDirection().multiply(-launch));
150143
}
151144
}
152145
return;
153146
}
154147

155148
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(loc, damageregion)) {
156149
if (entity.getEntityId() != player.getEntityId() && !(entity instanceof ArmorStand)) {
157-
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || ((entity instanceof Player) && Commands.invincible.contains(((Player) entity).getName()))){
150+
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || ((entity instanceof Player) && Commands.invincible.contains(entity.getName()))){
158151
continue;
159152
}
160153
if (entity instanceof LivingEntity) {
@@ -175,7 +168,7 @@ private void createBeam() {
175168
}
176169

177170
dir.multiply(knockback);
178-
entity.setVelocity(dir);
171+
GeneralMethods.setVelocity(this, entity, dir);
179172
}
180173
}
181174

@@ -206,7 +199,7 @@ public long getCooldown() {
206199

207200
@Override
208201
public Location getLocation() {
209-
return null;
202+
return player.getEyeLocation();
210203
}
211204

212205
@Override
@@ -240,15 +233,131 @@ public String getDescription() {
240233
return "* JedCore Addon *\n" + config.getString("Abilities.Air.AirBreath.Description");
241234
}
242235

243-
@Override
244-
public void load() {
245-
return;
236+
public long getDuration() {
237+
return duration;
246238
}
247239

248-
@Override
249-
public void stop() {
250-
return;
240+
public void setDuration(long duration) {
241+
this.duration = duration;
242+
}
243+
244+
public int getParticles() {
245+
return particles;
246+
}
247+
248+
public void setParticles(int particles) {
249+
this.particles = particles;
250+
}
251+
252+
public boolean isCoolLava() {
253+
return coolLava;
254+
}
255+
256+
public void setCoolLava(boolean coolLava) {
257+
this.coolLava = coolLava;
258+
}
259+
260+
public boolean canExtinguishFire() {
261+
return extinguishFire;
262+
}
263+
264+
public void setExtinguishFire(boolean extinguishFire) {
265+
this.extinguishFire = extinguishFire;
266+
}
267+
268+
public boolean canExtinguishMobs() {
269+
return extinguishMobs;
270+
}
271+
272+
public void setExtinguishMobs(boolean extinguishMobs) {
273+
this.extinguishMobs = extinguishMobs;
274+
}
275+
276+
public boolean isDamageEnabled() {
277+
return damageEnabled;
278+
}
279+
280+
public void setDamageEnabled(boolean damageEnabled) {
281+
this.damageEnabled = damageEnabled;
282+
}
283+
284+
public double getPlayerDamage() {
285+
return playerDamage;
286+
}
287+
288+
public void setPlayerDamage(double playerDamage) {
289+
this.playerDamage = playerDamage;
290+
}
291+
292+
public double getMobDamage() {
293+
return mobDamage;
294+
}
295+
296+
public void setMobDamage(double mobDamage) {
297+
this.mobDamage = mobDamage;
298+
}
299+
300+
public double getKnockback() {
301+
return knockback;
302+
}
303+
304+
public void setKnockback(double knockback) {
305+
this.knockback = knockback;
306+
}
307+
308+
public int getRange() {
309+
return range;
310+
}
311+
312+
public void setRange(int range) {
313+
this.range = range;
314+
}
315+
316+
public double getLaunch() {
317+
return launch;
318+
}
319+
320+
public void setLaunch(double launch) {
321+
this.launch = launch;
322+
}
323+
324+
public boolean canRegenOxygen() {
325+
return regenOxygen;
326+
}
327+
328+
public void setRegenOxygen(boolean regenOxygen) {
329+
this.regenOxygen = regenOxygen;
251330
}
331+
332+
public boolean isAvatarAmplify() {
333+
return avatarAmplify;
334+
}
335+
336+
public void setAvatarAmplify(boolean avatarAmplify) {
337+
this.avatarAmplify = avatarAmplify;
338+
}
339+
340+
public int getAvatarRange() {
341+
return avatarRange;
342+
}
343+
344+
public void setAvatarRange(int avatarRange) {
345+
this.avatarRange = avatarRange;
346+
}
347+
348+
public double getAvatarKnockback() {
349+
return avatarKnockback;
350+
}
351+
352+
public void setAvatarKnockback(double avatarKnockback) {
353+
this.avatarKnockback = avatarKnockback;
354+
}
355+
356+
@Override
357+
public void load() {}
358+
359+
@Override
360+
public void stop() {}
252361

253362
@Override
254363
public boolean isEnabled() {

0 commit comments

Comments
 (0)