Skip to content

Commit

Permalink
2.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Aztlon committed Apr 11, 2023
1 parent 6b56886 commit 04b6ccc
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 40 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ Join our [Discord](https://discord.gg/gh9MfDmwZm) to discuss the plugin, suggest

## Changelog

### 2.13.0
- Added support for Spigot 1.16 (Dreig-Michihi)
- Fixed ElementSphere Water crash
- Added water bubbles to ElementSphere Water underwater
- Added FireShots hand swapping by tapping sneak (Dreig-Michihi)
- Added configurable pointer for bending board, with "> " as default, to fix flickering (Dreig-Michihi)
- Fixed MetalFragments hoppers dupe (Dreig-Michihi)
- Added item crack particles to MetalFragments (Dreig-Michihi)
- Optimized MetalFragments (Dreig-Michihi)
- Fixed error resulting from ambiguous ability names like EarthKick that are shared with other popular addons (Dreig-Michihi)
- Optimized extinguishing for AirBreath (Dreig-Michihi)
- Fixed bug where Combustion couldn't start when a previous Combustion was still reverting (Dreig-Michihi)
- Improved Combustion charge-up and cooldown add times (Dreig-Michihi)
- Fixed FirePunch allowing multiple instances (Dreig-Michihi)
- Fixed Fissure reversion (StrangeOne101)
- Fixed lava immunity bug (StrangeOne101)
- Fixed AirSlam using SwiftStream's instructions (MKieburtz)

### 2.12.1
- Fixed URL being outdated in /b version
- Fixed IceWall not working on snow and ice blocks from the config
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.jedk1</groupId>
<artifactId>jedcore</artifactId>
<version>2.12.2-Spigot1.18-PK1.11.0</version>
<version>2.13.0-PK1.11.1</version>
<packaging>jar</packaging>
<name>JedCore</name>

Expand Down
14 changes: 5 additions & 9 deletions src/com/jedk1/jedcore/JCMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public class JCMethods {
}
}};

private static List<String> worlds = new ArrayList<String>();
private static List<String> combos = new ArrayList<String>();
private static List<String> worlds = new ArrayList<>();
private static List<String> combos = new ArrayList<>();

public static List<String> getDisabledWorlds() {
return JCMethods.worlds;
Expand All @@ -61,10 +61,8 @@ public static List<String> getDisabledWorlds() {
public static void registerDisabledWorlds() {
worlds.clear();
List<String> registeredworlds = ProjectKorra.plugin.getConfig().getStringList("Properties.DisabledWorlds");
if (registeredworlds != null && !registeredworlds.isEmpty()) {
for (String s : registeredworlds) {
worlds.add(s);
}
if (!registeredworlds.isEmpty()) {
worlds.addAll(registeredworlds);
}
}

Expand All @@ -78,9 +76,7 @@ public static List<String> getCombos() {

public static void registerCombos() {
combos.clear();
for (String s : ComboManager.getComboAbilities().keySet()) {
combos.add(s);
}
combos.addAll(ComboManager.getComboAbilities().keySet());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.region.RegionProtection;
import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.ParticleEffect;

import org.bukkit.Location;
import org.bukkit.Material;
Expand Down Expand Up @@ -49,9 +50,6 @@ public ESWater(Player player) {
if (bPlayer.isOnCooldown("ESWater")) {
return;
}
if (RegionProtection.isRegionProtected(this, player.getTargetBlock(getTransparentMaterialSet(), (int) range).getLocation())) {
return;
}
setFields();
location = player.getEyeLocation().clone().add(player.getEyeLocation().getDirection().multiply(1));
start();
Expand Down Expand Up @@ -92,7 +90,7 @@ private void advanceAttack() {
if (!player.isDead())
direction = GeneralMethods.getDirection(player.getLocation(), GeneralMethods.getTargetedLocation(player, range, Material.WATER)).normalize();
location = location.add(direction.clone().multiply(1));
if(RegionProtection.isRegionProtected(this, location)){
if (RegionProtection.isRegionProtected(this, location)){
travelled = range;
return;
}
Expand All @@ -102,6 +100,8 @@ private void advanceAttack() {
}

WaterAbility.playWaterbendingSound(location);
if (isWater(location.getBlock()))
ParticleEffect.WATER_BUBBLE.display(location, 3, 0.5, 0.5, 0.5);
new RegenTempBlock(location.getBlock(), Material.WATER, Material.WATER.createBlockData(bd -> ((Levelled) bd).setLevel(0)), 100L);

for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, 2.5)) {
Expand Down
7 changes: 3 additions & 4 deletions src/com/jedk1/jedcore/ability/earthbending/EarthKick.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void progress() {
}

private void launchBlocks() {
if (EarthAbility.getMovedEarth().containsKey(block)){
if (getMovedEarth().containsKey(block)) {
block.setType(Material.AIR);
}
if (block.getType() != Material.AIR) {
Expand All @@ -125,10 +125,9 @@ private void launchBlocks() {
}

location.setPitch(0);
Vector direction = location.getDirection();
location.add(direction.clone().multiply(1.0));
location.add(location.getDirection());

if (!ElementalAbility.isAir(location.getBlock().getType())) {
if (!isAir(location.getBlock().getType())) {
location.setY(location.getY() + 1.0);
}

Expand Down
1 change: 0 additions & 1 deletion src/com/jedk1/jedcore/ability/earthbending/EarthLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class EarthLine extends EarthAbility implements AddonAbility {
private boolean allowChangeDirection;
private CompositeRemovalPolicy removalPolicy;


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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public void progress() {
fb.getLocation().getBlock().setBlockData(fb.getBlockData());
}
}
for (ListIterator<Item> iterator = thrownFragments.listIterator(); iterator.hasNext(); ) {
for (ListIterator<Item> iterator = thrownFragments.listIterator(); iterator.hasNext();) {
Item f = iterator.next();

boolean touchedLiving = false;
Expand Down
2 changes: 1 addition & 1 deletion src/com/jedk1/jedcore/ability/firebending/Combustion.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public Combustion(Player player) {
return;
}

if(hasAbility(player, Combustion.class)){
if (hasAbility(player, Combustion.class)) {
Combustion c = getAbility(player, Combustion.class);
if (c.state instanceof ChargeState)
return;
Expand Down
27 changes: 15 additions & 12 deletions src/com/jedk1/jedcore/ability/firebending/FireShots.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class FireShots extends FireAbility implements AddonAbility {
private double damage;
@Attribute("CollisionRadius")
private double collisionRadius;
private Boolean flameInMainHand = null;
private Boolean flameInMainHand = null;

public int amount;

Expand All @@ -57,6 +57,9 @@ public FireShots(Player player){
return;
}

if (!player.hasGravity())
player.setGravity(true);

setFields();

amount = startAmount;
Expand Down Expand Up @@ -234,14 +237,14 @@ public static void fireShot(Player player) {
}
}

public static void swapHands(Player player) {
FireShots fs = getAbility(player, FireShots.class);
if (fs == null)
return;
if (fs.flameInMainHand == null)
fs.flameInMainHand = true;
else fs.flameInMainHand = !fs.flameInMainHand;
}
public static void swapHands(Player player) {
FireShots fs = getAbility(player, FireShots.class);
if (fs == null)
return;
if (fs.flameInMainHand == null)
fs.flameInMainHand = true;
else fs.flameInMainHand = !fs.flameInMainHand;
}

public void fireShot() {
if (amount >= 1) {
Expand All @@ -253,9 +256,9 @@ public void fireShot() {
}

public Location getRightHandPos() {
return (player.getMainHand()==MainHand.RIGHT == ((flameInMainHand == null) || flameInMainHand) ?
GeneralMethods.getRightSide(player.getLocation(), .55) :
GeneralMethods.getLeftSide(player.getLocation(), .55)).add(0, 1.2, 0);
return (player.getMainHand()==MainHand.RIGHT == ((flameInMainHand == null) || flameInMainHand) ?
GeneralMethods.getRightSide(player.getLocation(), .55) :
GeneralMethods.getLeftSide(player.getLocation(), .55)).add(0, 1.2, 0);
}

private void displayFireBalls() {
Expand Down
3 changes: 2 additions & 1 deletion src/com/jedk1/jedcore/configuration/JedCoreConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,8 @@ private void loadConfigCore() {
config.addDefault("Abilities.Fire.FireShots.Enabled", true);
config.addDefault("Abilities.Fire.FireShots.Description", "To use, tap Sneak (Default: Shift) to summon a "
+ "FireBalls at your hand, then Left Click to shoot off each ball! "
+ "Each shot will follow the cursor until it runs out or hits something!");
+ "Each shot will follow the cursor until it runs out or hits something! "
+ "Tap Sneak again to switch your main hand.");
config.addDefault("Abilities.Fire.FireShots.Cooldown", 3000);
config.addDefault("Abilities.Fire.FireShots.Range", 50);
config.addDefault("Abilities.Fire.FireShots.FireBalls", 4);
Expand Down
2 changes: 1 addition & 1 deletion src/com/jedk1/jedcore/listener/AbilityListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public void onPlayerSneak(PlayerToggleSneakEvent event) {
return;
}

if(player.isSneaking() && bPlayer.canBendIgnoreCooldowns(coreAbil)){
if (player.isSneaking() && bPlayer.canBendIgnoreCooldowns(coreAbil)) {
if (coreAbil instanceof FireAbility && bPlayer.isElementToggled(Element.FIRE)) {
if (abilClass.equals(FireShots.class)) {
FireShots.swapHands(player);
Expand Down
4 changes: 2 additions & 2 deletions src/com/jedk1/jedcore/listener/JCListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ public void onChat(AsyncPlayerChatEvent event){
}

@EventHandler(priority = EventPriority.NORMAL)
public void onItemPickup(InventoryPickupItemEvent event){
if(event.getItem().getPickupDelay()>=Short.MAX_VALUE) {
public void onItemPickup(InventoryPickupItemEvent event) {
if (event.getItem().getPickupDelay() >= Short.MAX_VALUE) {
event.setCancelled(true);
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/com/jedk1/jedcore/scoreboard/BendingBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class BendingBoard {
toggled = new Config(new File("/board/players.yml"));

List<String> uuids = toggled.getConfig().getStringList("Players");
if (uuids != null && !uuids.isEmpty()) {
if (!uuids.isEmpty()) {
if (!uuids.get(0).matches("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[34][0-9a-fA-F]{3}-[89ab][0-9a-fA-F]{3}-[0-9a-fA-F]{12}")) {
toggled.getConfig().set("Players", new ArrayList<String>());
toggled.saveConfig();
Expand Down Expand Up @@ -110,8 +110,7 @@ public static void updateOnline() {

public static void toggle(Player player) {
if (!enabled) return;
List<String> uuids = new ArrayList<>();
uuids.addAll(toggled.getConfig().getStringList("Players"));
List<String> uuids = new ArrayList<>(toggled.getConfig().getStringList("Players"));
if (uuids.contains(player.getUniqueId().toString())) {
uuids.remove(player.getUniqueId().toString());
disabled.remove(player.getUniqueId());
Expand Down

0 comments on commit 04b6ccc

Please sign in to comment.