Skip to content

Commit

Permalink
Merge branch 'dev/patch' into patch/legacy-aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
sovdeeth authored Sep 19, 2024
2 parents bdd14c6 + 96dce83 commit 3253c9b
Show file tree
Hide file tree
Showing 795 changed files with 813 additions and 1,002 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ dependencies {
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.2'

implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.21-R0.1-SNAPSHOT'
implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.annotation', version: '2.2.700'
implementation group: 'com.google.code.findbugs', name: 'findbugs', version: '3.0.1'
implementation group: 'com.sk89q.worldguard', name: 'worldguard-legacy', version: '7.0.0-SNAPSHOT'
implementation group: 'net.milkbowl.vault', name: 'Vault', version: '1.7.3', {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/ScriptLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import ch.njol.util.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;
import org.skriptlang.skript.lang.script.Script;
import org.skriptlang.skript.lang.structure.Structure;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/SkriptAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.regex.Pattern;

import org.bukkit.plugin.java.JavaPlugin;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.localization.Language;
import ch.njol.skript.util.Utils;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/SkriptCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;
import org.skriptlang.skript.lang.script.Script;

import java.io.File;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/SkriptEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.plugin.EventExecutor;
import org.bukkit.plugin.RegisteredListener;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/aliases/Aliases.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.io.UncheckedIOException;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/aliases/AliasesMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.List;

import org.bukkit.Material;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.entity.EntityData;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/aliases/AliasesParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Map;
import java.util.function.Function;

import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.Skript;
import ch.njol.skript.aliases.AliasesProvider.Variation;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/aliases/AliasesProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import com.google.gson.Gson;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/aliases/ItemType.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import java.io.NotSerializableException;
import java.io.StreamCorruptedException;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/ch/njol/skript/aliases/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
*
* @author Peter Güttinger
*/
@NonNullByDefault({DefaultLocation.PARAMETER, DefaultLocation.RETURN_TYPE, DefaultLocation.FIELD})
package ch.njol.skript.aliases;

import org.eclipse.jdt.annotation.DefaultLocation;
import org.eclipse.jdt.annotation.NonNullByDefault;

2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/bukkitutil/BukkitUnsafe.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.bukkit.Material;
import org.bukkit.UnsafeValues;
import org.bukkit.inventory.ItemStack;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import com.google.common.io.ByteStreams;
import com.google.gson.GsonBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.Skript;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ch.njol.skript.Skript;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/bukkitutil/ItemUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import java.util.HashMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.bukkit.entity.Mob;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import com.destroystokyo.paper.entity.ai.Goal;
import com.destroystokyo.paper.entity.ai.GoalKey;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/bukkitutil/PlayerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.bukkit.block.data.BlockData;
import org.bukkit.entity.FallingBlock;
import org.bukkit.inventory.ItemStack;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.aliases.ItemFlags;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

/**
* Manages setting blocks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import ch.njol.skript.aliases.MatchQuality;
import ch.njol.yggdrasil.YggdrasilSerializable.YggdrasilExtendedSerializable;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

/**
* Contains all data block has that is needed for comparisions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.StreamCorruptedException;
import java.util.Map;
Expand Down Expand Up @@ -131,7 +131,7 @@ public Fields serialize() {
}

@Override
public void deserialize(@NonNull Fields fields) throws StreamCorruptedException {
public void deserialize(@NotNull Fields fields) throws StreamCorruptedException {
String data = fields.getObject("data", String.class);
boolean isDefault = fields.getPrimitive("isDefault", Boolean.class);
if (data == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*
* Copyright Peter Güttinger, SkriptLang team and contributors
*/
@NonNullByDefault({DefaultLocation.PARAMETER, DefaultLocation.RETURN_TYPE, DefaultLocation.FIELD})
package ch.njol.skript.bukkitutil.block;

import org.eclipse.jdt.annotation.DefaultLocation;
import org.eclipse.jdt.annotation.NonNullByDefault;

3 changes: 0 additions & 3 deletions src/main/java/ch/njol/skript/bukkitutil/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
*
* @author Peter Güttinger
*/
@NonNullByDefault({DefaultLocation.PARAMETER, DefaultLocation.RETURN_TYPE, DefaultLocation.FIELD})
package ch.njol.skript.bukkitutil;

import org.eclipse.jdt.annotation.DefaultLocation;
import org.eclipse.jdt.annotation.NonNullByDefault;

Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*
* Copyright Peter Güttinger, SkriptLang team and contributors
*/
@NonNullByDefault({DefaultLocation.PARAMETER, DefaultLocation.RETURN_TYPE, DefaultLocation.FIELD})
package ch.njol.skript.bukkitutil.sounds;

import org.eclipse.jdt.annotation.DefaultLocation;
import org.eclipse.jdt.annotation.NonNullByDefault;

2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/classes/ChainedConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package ch.njol.skript.classes;

import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import org.skriptlang.skript.lang.converter.Converters;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/classes/Changer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package ch.njol.skript.classes;

import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.classes.data.DefaultChangers;
import ch.njol.skript.lang.Expression;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ch/njol/skript/classes/ClassInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import ch.njol.util.coll.iterator.ArrayIterator;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Arrays;
import java.util.HashSet;
Expand Down Expand Up @@ -516,7 +516,7 @@ public Set<String> after() {
// === GENERAL ===

@Override
@NonNull
@NotNull
public String toString() {
return getName().getSingular();
}
Expand All @@ -526,7 +526,7 @@ public String toString(final int flags) {
}

@Override
@NonNull
@NotNull
public String toString(final @Nullable Event event, final boolean debug) {
if (debug)
return codeName + " (" + c.getCanonicalName() + ")";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.yggdrasil.Fields;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/classes/Converter.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import ch.njol.skript.lang.Debuggable;
import ch.njol.skript.registrations.Classes;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;
import org.skriptlang.skript.lang.converter.Converters;

import java.util.Arrays;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/classes/EnumClassInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import ch.njol.skript.lang.DefaultExpression;
import ch.njol.skript.lang.ParseContext;
import ch.njol.skript.util.EnumUtils;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

/**
* This class can be used for an easier writing of ClassInfos that are enums,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/classes/EnumSerializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.io.StreamCorruptedException;

import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.yggdrasil.ClassResolver;
import ch.njol.yggdrasil.Fields;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/classes/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package ch.njol.skript.classes;

import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.lang.ParseContext;
import ch.njol.skript.lang.parser.ParserInstance;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/classes/Serializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import org.bukkit.Bukkit;
import org.bukkit.World;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.Skript;
import ch.njol.skript.SkriptAPIException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

/**
* @author Peter Güttinger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.potion.PotionEffectType;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.Skript;
import ch.njol.skript.aliases.ItemType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;
import ch.njol.skript.util.Contract;

import java.math.BigDecimal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ public class DefaultOperations {
return left.doubleValue() * right.doubleValue();
});
Arithmetics.registerOperation(Operator.DIVISION, Number.class, (left, right) -> left.doubleValue() / right.doubleValue());
Arithmetics.registerOperation(Operator.EXPONENTIATION, Number.class, (left, right) -> {
if (Utils.isInteger(left, right) && right.longValue() >= 0)
return (long) Math.pow(left.longValue(), right.longValue());
return Math.pow(left.doubleValue(), right.doubleValue());
});
Arithmetics.registerOperation(Operator.EXPONENTIATION, Number.class, (left, right) -> Math.pow(left.doubleValue(), right.doubleValue()));
Arithmetics.registerDifference(Number.class, (left, right) -> {
if (Utils.isInteger(left, right))
return Math.abs(left.longValue() - right.longValue());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/classes/data/JavaClasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import ch.njol.skript.util.Utils;
import ch.njol.util.StringUtils;
import ch.njol.yggdrasil.Fields;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.eclipse.jdt.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

import ch.njol.skript.Skript;
import ch.njol.skript.aliases.Aliases;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/ch/njol/skript/classes/data/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
*
* @author Peter Güttinger
*/
@NonNullByDefault({DefaultLocation.PARAMETER, DefaultLocation.RETURN_TYPE, DefaultLocation.FIELD})
package ch.njol.skript.classes.data;

import org.eclipse.jdt.annotation.DefaultLocation;
import org.eclipse.jdt.annotation.NonNullByDefault;

Loading

0 comments on commit 3253c9b

Please sign in to comment.