Skip to content

Commit

Permalink
Javadocs and deprecation of API
Browse files Browse the repository at this point in the history
  • Loading branch information
Geolykt committed Nov 1, 2020
1 parent 7b63a71 commit 3fef4f4
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 3 deletions.
2 changes: 1 addition & 1 deletion resources/patches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ recipe:
misc:
arborist-doGoldenAppleDrop: true
nerfs:
siphonRatio: 0.5
siphonRatio: 0.5 # Will be removed in v3.0.0! USe the power of the enchantment instead.
siphonsubstractAmour: true
shredCoolDownOnLaser: true
# Specifies the reader / writer for enchantments. They can be divided into two main categories, NBT getters and Lore getters, NBT getters are more stable, however can bork other plugins and are inefficent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void onEnable() {
Spectral.SEARCH_FACES = ALL_SEARCH_FACES;
Pierce.SEARCH_FACES = ALL_SEARCH_FACES;

Storage.ANTICHEAT_ADAPTER.onEnable();
// Storage.ANTICHEAT_ADAPTER.onEnable();

Laser.colorKey = new NamespacedKey(this, "laserCol");

Expand Down
11 changes: 10 additions & 1 deletion src/main/java/de/geolykt/enchantments_plus/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class Storage {
* It's currently only used by the `/ench version` command.
* @since 1.0.0
*/
public static final String DISTRIBUTION = "Git";
public static final String DISTRIBUTION = "self-compiled";

/**
* A coled text-based logo for the plugin, used mainly for command responses, but can be used for other stuff. <br>
Expand Down Expand Up @@ -57,6 +57,15 @@ public class Storage {
public static String version = "";

public static final CompatibilityAdapter COMPATIBILITY_ADAPTER = new CompatibilityAdapter();

/**
* @deprecated Not used, at all.
* The anticheat adapter used for the plugin, however while it is planned that it's functions are added eventually in one shape or
* form, it is currently (v2.2.0) absolutely not used and only remains for upwards compatibillity. Who know's maybe it will even
* be removed?
* @since 1.1.0
*/
@Deprecated
public static AbstractAnticheatAdapter ANTICHEAT_ADAPTER = new None();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,48 @@

import de.geolykt.enchantments_plus.CustomEnchantment;
import de.geolykt.enchantments_plus.enums.Action;
import de.geolykt.enchantments_plus.enums.BaseEnchantments;

public abstract class AbstractAnticheatAdapter {

protected boolean isPseudoCode = true;

/**
* Notifies the Adapter that it should load it's routines and prepare whatever stuff it needs to prepare.
* This can range to stuff like loading or searching for dependency classes
*
* @since 1.1.0
*/
public void onEnable() {
if (isPseudoCode) {
Bukkit.getLogger().severe("Please note that Enchantments+ integrations with your current Anticheat hasn't been tested"
+ " and may be borked.");
}
}

/**
* @deprecated The CustomEnchantment instances are subject to removal in v3.0.0.
* Notifies the adapter that an enchantment was fired.
*
* @param enchantment The enchantment that was fired.
* @param level The level of the enchantment
* @param source the source of the enchantment
* @param why The action that was performed that caused the event to be fired
* @implNote This is currently not used, at all
* @since 1.1.0
*/
@Deprecated
public abstract void onEnchantmentFire(CustomEnchantment enchantment, Integer level, Player source, Action why);

/**
* Notifies the adapter that an enchantment was fired.
*
* @param enchantment The enchantment that was fired.
* @param level The level of the enchantment
* @param source the source of the enchantment
* @param why The action that was performed that caused the event to be fired
* @implNote This is currently not used, at all
* @since 2.2.0
*/
public abstract void onEnchantmentFire(BaseEnchantments enchantment, Integer level, Player source, Action why);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import de.geolykt.enchantments_plus.CustomEnchantment;
import de.geolykt.enchantments_plus.enums.Action;
import de.geolykt.enchantments_plus.enums.BaseEnchantments;

public class None extends AbstractAnticheatAdapter {

Expand All @@ -15,8 +16,14 @@ public None() {
public void onEnable() {}

@Override
@Deprecated
public void onEnchantmentFire(CustomEnchantment enchantment, Integer level, Player source, Action why) {
return;
}

@Override
public void onEnchantmentFire(BaseEnchantments enchantment, Integer level, Player source, Action why) {
return;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@
public class Siphon extends CustomEnchantment {

public static final int ID = 53;

/**
* @deprecated This is basically a needless alternative to the power parameter. Will be removed in v3.0.0
* A multiplier for the damage taken to health added conversion.
* Please note that there are other multipliers and the power of the enchantment should be used instead.
* @since 1.0
*/
@Deprecated
public static double ratio = 0.5;

public static boolean calcAmour = true;

@Override
Expand Down

0 comments on commit 3fef4f4

Please sign in to comment.