Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import net.codingarea.challenges.plugin.Challenges;
import org.bukkit.plugin.java.JavaPlugin;

/**
* @author anweisen | https://github.com/anweisen
* @since 2.0
*/

public final class MongoConnector extends JavaPlugin {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
import java.util.List;
import java.util.function.Supplier;

/**
* @author anweisen | https://github.com/anweisen
* @since 2.0
*/
public final class ChallengeAPI {

private ChallengeAPI() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@

import javax.annotation.Nonnull;

/**
* @author anweisen | https://github.com/anweisen
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 1.0
*/
@Getter
public final class Challenges extends BukkitModule {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
import java.util.Map.Entry;
import java.util.UUID;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
@Getter
@ToString
public class CustomChallenge extends Setting {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

import java.util.*;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class ChallengeExecutionData {

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

import java.util.function.Supplier;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public abstract class ChallengeSetting implements IChallengeSetting {

private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
import java.util.LinkedHashMap;
import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class CustomSettingsLoader {

@Getter
Expand Down Expand Up @@ -114,7 +110,7 @@
continue;
}
}
if (trigger1.getClass().isAnnotationPresent(FallbackNames.class)) {

Check notice on line 113 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/CustomSettingsLoader.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Duplicated code fragment

Duplicated code
FallbackNames fallbackName = trigger1.getClass().getAnnotation(FallbackNames.class);
String[] fallbackNames = fallbackName.value();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* @author sehrschlechtYT | https://github.com/sehrschlechtYT
* @since 2.2.3
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface FallbackNames {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import net.codingarea.challenges.plugin.challenges.custom.settings.sub.SubSettingsBuilder;
import org.bukkit.Material;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public interface IChallengeSetting {

SubSettingsBuilder getSubSettingsBuilder();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package net.codingarea.challenges.plugin.challenges.custom.settings;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public enum SettingType {

CONDITION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
import java.util.LinkedHashMap;
import java.util.function.Supplier;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public abstract class ChallengeAction extends ChallengeSetting implements
IChallengeAction {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

import java.util.function.Supplier;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public abstract class EntityTargetAction extends ChallengeAction implements IEntityTargetAction {

public EntityTargetAction(String name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public interface IChallengeAction {

IRandom random = IRandom.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
import java.util.List;
import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 1.0
*/
public interface IEntityTargetAction extends IChallengeAction {

static List<Entity> getTargets(Entity triggerTarget, Map<String, String[]> subActions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
import java.util.Map;
import java.util.function.Supplier;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public abstract class PlayerTargetAction extends EntityTargetAction {

public PlayerTargetAction(String name, SubSettingsBuilder subSettingsBuilder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class AddPermanentEffectAction extends PlayerTargetAction {

PermanentEffectOnDamageChallenge instance = AbstractChallenge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class BoostEntityInAirAction extends EntityTargetAction {

public BoostEntityInAirAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class CancelEventAction extends ChallengeAction {

public static boolean inCanceling;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.3
*/
public class ChangeWorldBorderAction extends ChallengeAction {

public ChangeWorldBorderAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class ClearInventoryAction extends PlayerTargetAction {

public ClearInventoryAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class DamageEntityAction extends EntityTargetAction {

public DamageEntityAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class DropRandomItemAction extends PlayerTargetAction {

public DropRandomItemAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
import java.util.List;
import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.2
*/
public class ExecuteCommandAction extends PlayerTargetAction {

// Static because cannot be accessed before super has been called
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class FreezeAction extends EntityTargetAction {

FreezeChallenge instance = AbstractChallenge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@

import net.codingarea.challenges.plugin.challenges.custom.settings.action.EntityTargetAction;
import net.codingarea.challenges.plugin.challenges.type.helper.SubSettingsHelper;
import net.codingarea.challenges.plugin.utils.bukkit.misc.version.MinecraftVersion;

Check warning on line 5 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/HealEntityAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Unused import

Unused import `import net.codingarea.challenges.plugin.utils.bukkit.misc.version.MinecraftVersion;`
import net.codingarea.challenges.plugin.utils.bukkit.misc.wrapper.AttributeWrapper;
import net.codingarea.challenges.plugin.utils.item.DefaultItem;
import net.codingarea.challenges.plugin.utils.item.ItemBuilder;
import net.codingarea.challenges.plugin.utils.misc.MinecraftNameWrapper;
import org.bukkit.Material;
import org.bukkit.attribute.Attribute;

Check warning on line 11 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/HealEntityAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Unused import

Unused import `import org.bukkit.attribute.Attribute;`
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class HealEntityAction extends EntityTargetAction {

public HealEntityAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class HungerPlayerAction extends PlayerTargetAction {

public HungerPlayerAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class InvertHealthAction extends PlayerTargetAction {

public InvertHealthAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class JumpAndRunAction extends ChallengeAction {

public JumpAndRunAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class KillEntityAction extends EntityTargetAction {

public KillEntityAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class ModifyMaxHealthAction extends PlayerTargetAction {

public ModifyMaxHealthAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
import java.util.Map;
import java.util.stream.Collectors;

/**
* @author sehrschlechtYT | https://github.com/sehrschlechtYT
* @since 2.2.2
*/
@RequireVersion(MinecraftVersion.V1_19)
@FallbackNames({"place_random_structure"})
public class PlaceStructureAction extends EntityTargetAction {
Expand Down Expand Up @@ -47,11 +43,11 @@
}

structureKey = structureKeys.get(IRandom.singleton().nextInt(structureKeys.size()));
if (structureKey == StructureType.VILLAGE.getKey()) {

Check warning on line 46 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/PlaceStructureAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Deprecated API usage

'org.bukkit.StructureType' is deprecated since version 1.19
structureKey = villageKeys.get(IRandom.singleton().nextInt(villageKeys.size()));
}
} else {
StructureType structureType = StructureType.getStructureTypes().get(structureString);

Check warning on line 50 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/PlaceStructureAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Deprecated API usage

'org.bukkit.StructureType' is deprecated since version 1.19

Check warning on line 50 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/PlaceStructureAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Deprecated API usage

'org.bukkit.StructureType' is deprecated since version 1.19
structureKey = getStructureKey(structureType);
}

Expand All @@ -63,11 +59,11 @@
}

private void reloadStructureKeys() {
structureKeys = StructureType.getStructureTypes().values().stream()

Check warning on line 62 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/PlaceStructureAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Deprecated API usage

'org.bukkit.StructureType' is deprecated since version 1.19
.map(StructureType::getKey)

Check warning on line 63 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/PlaceStructureAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Deprecated API usage

'org.bukkit.StructureType' is deprecated since version 1.19
.collect(Collectors.toList());

structureKeys.remove(StructureType.OCEAN_RUIN.getKey());

Check warning on line 66 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/PlaceStructureAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Deprecated API usage

'org.bukkit.StructureType' is deprecated since version 1.19
structureKeys.add(NamespacedKey.minecraft("ocean_ruin_cold"));
structureKeys.add(NamespacedKey.minecraft("ocean_ruin_warm"));

Expand All @@ -79,12 +75,12 @@
villageKeys.add(NamespacedKey.minecraft("village_taiga"));
}

private NamespacedKey getStructureKey(StructureType structureType) {

Check warning on line 78 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/PlaceStructureAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Deprecated API usage

'org.bukkit.StructureType' is deprecated since version 1.19
if (structureType == StructureType.OCEAN_RUIN) {

Check warning on line 79 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/PlaceStructureAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Deprecated API usage

'org.bukkit.StructureType' is deprecated since version 1.19
List<NamespacedKey> oceanRuins = Arrays.asList(NamespacedKey.minecraft("ocean_ruin_cold"), NamespacedKey.minecraft("ocean_ruin_warm"));
return oceanRuins.get(IRandom.singleton().nextInt(oceanRuins.size()));
}
if (structureType == StructureType.VILLAGE) {

Check warning on line 83 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/PlaceStructureAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Deprecated API usage

'org.bukkit.StructureType' is deprecated since version 1.19
return villageKeys.get(IRandom.singleton().nextInt(villageKeys.size()));
}
return structureType.getKey();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class PotionEffectAction extends EntityTargetAction {

public PotionEffectAction(String name) {
Expand All @@ -28,7 +24,7 @@
LivingEntity livingEntity = (LivingEntity) entity;
try {

PotionEffectType effectType = PotionEffectType.getByName(subActions.get("potion_type")[0]);

Check warning on line 27 in plugin/src/main/java/net/codingarea/challenges/plugin/challenges/custom/settings/action/impl/PotionEffectAction.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Deprecated API usage

'getByName(java.lang.String)' is deprecated since version 1.20.3
if (effectType == null) return;
PotionEffect effect = effectType.createEffect(Integer.parseInt(subActions.get("length")[0]) * 20 + 1,
Integer.parseInt(subActions.get("amplifier")[0]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.3
*/
public class RandomHotBarAction extends PlayerTargetAction {

public RandomHotBarAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
import javax.annotation.Nonnull;
import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class RandomItemAction extends ChallengeAction {

public RandomItemAction(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
import java.util.Map;
import java.util.stream.Collectors;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class RandomMobAction extends EntityTargetAction {

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@

import java.util.Map;

/**
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 2.1.0
*/
public class RandomPotionEffectAction extends EntityTargetAction {

public RandomPotionEffectAction(String name) {
Expand Down
Loading
Loading