From 2cba27071645db16d545a0dd82f19fc19ce4ee05 Mon Sep 17 00:00:00 2001
From: Efnilite <35348263+Efnilite@users.noreply.github.com>
Date: Tue, 21 Jan 2025 23:35:01 +0100
Subject: [PATCH] init commit
---
.../skript/conditions/CondResourcePack.java | 17 ++++-----
.../conditions/CondRespawnLocation.java | 9 ++---
.../njol/skript/conditions/CondWillHatch.java | 6 +---
.../njol/skript/effects/EffCancelDrops.java | 18 ++++------
.../njol/skript/effects/EffKeepInventory.java | 17 ++++-----
.../njol/skript/effects/EffMakeEggHatch.java | 6 +---
.../effects/EffPlayerInfoVisibility.java | 16 +++------
.../expressions/ExprAbsorbedBlocks.java | 23 +++++-------
.../expressions/ExprAppliedEnchantments.java | 17 ++++-----
.../njol/skript/expressions/ExprAttacked.java | 29 +++++++--------
.../njol/skript/expressions/ExprAttacker.java | 24 +++++--------
.../njol/skript/expressions/ExprClicked.java | 35 ++++++++-----------
.../njol/skript/expressions/ExprCommand.java | 21 +++++------
.../skript/expressions/ExprCommandSender.java | 11 ++----
.../ch/njol/skript/expressions/ExprDrops.java | 10 ++----
.../skript/expressions/ExprEnchantItem.java | 17 ++++-----
.../expressions/ExprEnchantingExpCost.java | 15 +++-----
.../expressions/ExprEnchantmentBonus.java | 15 +++-----
.../expressions/ExprEnchantmentOffer.java | 28 ++++++---------
.../skript/expressions/ExprExperience.java | 2 +-
.../expressions/ExprExplodedBlocks.java | 23 +++++-------
.../expressions/ExprExplosionBlockYield.java | 15 +++-----
.../expressions/ExprExplosionYield.java | 15 +++-----
.../expressions/ExprFertilizedBlocks.java | 21 ++++-------
.../skript/expressions/ExprFinalDamage.java | 15 +++-----
.../skript/expressions/ExprHealAmount.java | 15 +++-----
.../skript/expressions/ExprHealReason.java | 9 ++---
.../njol/skript/expressions/ExprHealth.java | 2 +-
.../skript/expressions/ExprHoverList.java | 2 +-
.../ch/njol/skript/expressions/ExprLevel.java | 17 ++++-----
.../skript/expressions/ExprLevelProgress.java | 15 +++-----
.../skript/expressions/ExprMaxHealth.java | 16 +++------
.../njol/skript/expressions/ExprMessage.java | 2 +-
.../njol/skript/expressions/ExprPortal.java | 25 ++++++-------
.../expressions/ExprProtocolVersion.java | 16 +++------
.../skript/expressions/ExprReadiedArrow.java | 8 ++---
.../skript/expressions/ExprSentCommands.java | 2 +-
.../njol/skript/expressions/ExprWeather.java | 2 +-
.../elements/ExprFurnaceEventItems.java | 2 +-
.../furnace/elements/ExprFurnaceSlot.java | 8 ++---
40 files changed, 198 insertions(+), 368 deletions(-)
diff --git a/src/main/java/ch/njol/skript/conditions/CondResourcePack.java b/src/main/java/ch/njol/skript/conditions/CondResourcePack.java
index 1d1c208766c..e88ee287974 100644
--- a/src/main/java/ch/njol/skript/conditions/CondResourcePack.java
+++ b/src/main/java/ch/njol/skript/conditions/CondResourcePack.java
@@ -1,20 +1,15 @@
package ch.njol.skript.conditions;
-import org.bukkit.event.Event;
-import org.bukkit.event.player.PlayerResourcePackStatusEvent;
-import org.bukkit.event.player.PlayerResourcePackStatusEvent.Status;
-import org.jetbrains.annotations.Nullable;
-
import ch.njol.skript.Skript;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Since;
+import ch.njol.skript.doc.*;
import ch.njol.skript.lang.Condition;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
+import org.bukkit.event.Event;
+import org.bukkit.event.player.PlayerResourcePackStatusEvent;
+import org.bukkit.event.player.PlayerResourcePackStatusEvent.Status;
+import org.jetbrains.annotations.Nullable;
@Name("Resource Pack")
@Description("Checks state of the resource pack in a resource pack request response event.")
@@ -22,7 +17,7 @@
" if the resource pack wasn't accepted:",
" kick the player due to \"You have to install the resource pack to play in this server!\""})
@Since("2.4")
-@Events("resource pack request response")
+@Events("Resource Pack Request Response")
public class CondResourcePack extends Condition {
static {
diff --git a/src/main/java/ch/njol/skript/conditions/CondRespawnLocation.java b/src/main/java/ch/njol/skript/conditions/CondRespawnLocation.java
index 56199bea961..be80857a76b 100644
--- a/src/main/java/ch/njol/skript/conditions/CondRespawnLocation.java
+++ b/src/main/java/ch/njol/skript/conditions/CondRespawnLocation.java
@@ -1,12 +1,7 @@
package ch.njol.skript.conditions;
import ch.njol.skript.Skript;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.RequiredPlugins;
-import ch.njol.skript.doc.Since;
+import ch.njol.skript.doc.*;
import ch.njol.skript.lang.Condition;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
@@ -24,7 +19,7 @@
})
@RequiredPlugins("Minecraft 1.16+")
@Since("2.7")
-@Events("respawn")
+@Events("Respawn")
public class CondRespawnLocation extends Condition {
static {
diff --git a/src/main/java/ch/njol/skript/conditions/CondWillHatch.java b/src/main/java/ch/njol/skript/conditions/CondWillHatch.java
index dfdc5d4854c..b66b12c2e1d 100644
--- a/src/main/java/ch/njol/skript/conditions/CondWillHatch.java
+++ b/src/main/java/ch/njol/skript/conditions/CondWillHatch.java
@@ -1,11 +1,7 @@
package ch.njol.skript.conditions;
import ch.njol.skript.Skript;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Since;
+import ch.njol.skript.doc.*;
import ch.njol.skript.lang.Condition;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
diff --git a/src/main/java/ch/njol/skript/effects/EffCancelDrops.java b/src/main/java/ch/njol/skript/effects/EffCancelDrops.java
index 685b2d4e046..237b0f42ded 100644
--- a/src/main/java/ch/njol/skript/effects/EffCancelDrops.java
+++ b/src/main/java/ch/njol/skript/effects/EffCancelDrops.java
@@ -1,21 +1,15 @@
package ch.njol.skript.effects;
-import org.bukkit.event.Event;
-import org.bukkit.event.block.BlockBreakEvent;
-import org.bukkit.event.entity.EntityDeathEvent;
-import org.jetbrains.annotations.Nullable;
-
import ch.njol.skript.Skript;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.RequiredPlugins;
-import ch.njol.skript.doc.Since;
+import ch.njol.skript.doc.*;
import ch.njol.skript.lang.Effect;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
+import org.bukkit.event.Event;
+import org.bukkit.event.block.BlockBreakEvent;
+import org.bukkit.event.entity.EntityDeathEvent;
+import org.jetbrains.annotations.Nullable;
@Name("Cancel Drops")
@Description("Cancels drops of items or experiences in a death or block break event. " +
@@ -29,7 +23,7 @@
"\tcancel the experience drops"})
@Since("2.4")
@RequiredPlugins("1.12.2 or newer (cancelling item drops of blocks)")
-@Events({"death", "break / mine"})
+@Events({"Death", "Break / Mine"})
public class EffCancelDrops extends Effect {
private static final boolean CAN_CANCEL_BLOCK_ITEM_DROPS = Skript.methodExists(BlockBreakEvent.class, "setDropItems", boolean.class);
diff --git a/src/main/java/ch/njol/skript/effects/EffKeepInventory.java b/src/main/java/ch/njol/skript/effects/EffKeepInventory.java
index 3ed179e28ba..ae60c23e309 100644
--- a/src/main/java/ch/njol/skript/effects/EffKeepInventory.java
+++ b/src/main/java/ch/njol/skript/effects/EffKeepInventory.java
@@ -1,20 +1,15 @@
package ch.njol.skript.effects;
-import org.bukkit.event.Event;
-import org.bukkit.event.entity.EntityDeathEvent;
-import org.bukkit.event.entity.PlayerDeathEvent;
-import org.jetbrains.annotations.Nullable;
-
import ch.njol.skript.Skript;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Since;
+import ch.njol.skript.doc.*;
import ch.njol.skript.lang.Effect;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
+import org.bukkit.event.Event;
+import org.bukkit.event.entity.EntityDeathEvent;
+import org.bukkit.event.entity.PlayerDeathEvent;
+import org.jetbrains.annotations.Nullable;
@Name("Keep Inventory / Experience")
@Description("Keeps the inventory or/and experiences of the dead player in a death event.")
@@ -24,7 +19,7 @@
"\t\tkeep the inventory and experiences"
})
@Since("2.4")
-@Events("death")
+@Events("Death")
public class EffKeepInventory extends Effect {
static {
diff --git a/src/main/java/ch/njol/skript/effects/EffMakeEggHatch.java b/src/main/java/ch/njol/skript/effects/EffMakeEggHatch.java
index 44f10a91b99..9a75d297575 100644
--- a/src/main/java/ch/njol/skript/effects/EffMakeEggHatch.java
+++ b/src/main/java/ch/njol/skript/effects/EffMakeEggHatch.java
@@ -1,11 +1,7 @@
package ch.njol.skript.effects;
import ch.njol.skript.Skript;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Since;
+import ch.njol.skript.doc.*;
import ch.njol.skript.lang.Effect;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
diff --git a/src/main/java/ch/njol/skript/effects/EffPlayerInfoVisibility.java b/src/main/java/ch/njol/skript/effects/EffPlayerInfoVisibility.java
index b07182bad1a..5538c7b634f 100644
--- a/src/main/java/ch/njol/skript/effects/EffPlayerInfoVisibility.java
+++ b/src/main/java/ch/njol/skript/effects/EffPlayerInfoVisibility.java
@@ -1,20 +1,14 @@
package ch.njol.skript.effects;
-import org.bukkit.event.Event;
-import org.jetbrains.annotations.Nullable;
-
-import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
import ch.njol.skript.Skript;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.RequiredPlugins;
-import ch.njol.skript.doc.Since;
+import ch.njol.skript.doc.*;
import ch.njol.skript.lang.Effect;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
+import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
+import org.bukkit.event.Event;
+import org.jetbrains.annotations.Nullable;
@Name("Player Info Visibility")
@Description({"Sets whether all player related information is hidden in the server list.",
@@ -28,7 +22,7 @@
"reveal all player related info"})
@Since("2.3")
@RequiredPlugins("Paper 1.12.2 or newer")
-@Events("server list ping")
+@Events("Server List Ping")
public class EffPlayerInfoVisibility extends Effect {
static {
diff --git a/src/main/java/ch/njol/skript/expressions/ExprAbsorbedBlocks.java b/src/main/java/ch/njol/skript/expressions/ExprAbsorbedBlocks.java
index c436a0474c6..8c3ce542b9b 100644
--- a/src/main/java/ch/njol/skript/expressions/ExprAbsorbedBlocks.java
+++ b/src/main/java/ch/njol/skript/expressions/ExprAbsorbedBlocks.java
@@ -1,19 +1,7 @@
package ch.njol.skript.expressions;
-import java.util.Iterator;
-import java.util.List;
-
-import org.bukkit.block.BlockState;
-import org.bukkit.event.Event;
-import org.bukkit.event.block.SpongeAbsorbEvent;
-import org.jetbrains.annotations.Nullable;
-
import ch.njol.skript.Skript;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Since;
+import ch.njol.skript.doc.*;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.ExpressionType;
import ch.njol.skript.lang.SkriptParser.ParseResult;
@@ -21,10 +9,17 @@
import ch.njol.skript.log.ErrorQuality;
import ch.njol.skript.util.BlockStateBlock;
import ch.njol.util.Kleenean;
+import org.bukkit.block.BlockState;
+import org.bukkit.event.Event;
+import org.bukkit.event.block.SpongeAbsorbEvent;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Iterator;
+import java.util.List;
@Name("Absorbed blocks")
@Description("The blocks absorbed by a sponge block.")
-@Events("sponge absorb")
+@Events("Sponge Absorb")
@Examples("the absorbed blocks")
@Since("2.5")
public class ExprAbsorbedBlocks extends SimpleExpression {
diff --git a/src/main/java/ch/njol/skript/expressions/ExprAppliedEnchantments.java b/src/main/java/ch/njol/skript/expressions/ExprAppliedEnchantments.java
index f2b0b79ee11..d107b3a9939 100644
--- a/src/main/java/ch/njol/skript/expressions/ExprAppliedEnchantments.java
+++ b/src/main/java/ch/njol/skript/expressions/ExprAppliedEnchantments.java
@@ -1,17 +1,8 @@
package ch.njol.skript.expressions;
-import org.bukkit.enchantments.Enchantment;
-import org.bukkit.event.Event;
-import org.bukkit.event.enchantment.EnchantItemEvent;
-import org.jetbrains.annotations.Nullable;
-
import ch.njol.skript.Skript;
import ch.njol.skript.classes.Changer.ChangeMode;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Since;
+import ch.njol.skript.doc.*;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.ExpressionType;
import ch.njol.skript.lang.SkriptParser.ParseResult;
@@ -20,13 +11,17 @@
import ch.njol.skript.util.EnchantmentType;
import ch.njol.util.Kleenean;
import ch.njol.util.coll.CollectionUtils;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.event.Event;
+import org.bukkit.event.enchantment.EnchantItemEvent;
+import org.jetbrains.annotations.Nullable;
@Name("Applied Enchantments")
@Description({"The applied enchantments in an enchant event.",
" Deleting or removing the applied enchantments will prevent the item's enchantment."})
@Examples({"on enchant:",
"\tset the applied enchantments to sharpness 10 and fire aspect 5"})
-@Events("enchant")
+@Events("Enchant")
@Since("2.5")
public class ExprAppliedEnchantments extends SimpleExpression {
diff --git a/src/main/java/ch/njol/skript/expressions/ExprAttacked.java b/src/main/java/ch/njol/skript/expressions/ExprAttacked.java
index 5b2ed4e51cb..32f90c16e47 100644
--- a/src/main/java/ch/njol/skript/expressions/ExprAttacked.java
+++ b/src/main/java/ch/njol/skript/expressions/ExprAttacked.java
@@ -1,8 +1,16 @@
package ch.njol.skript.expressions;
-import java.lang.reflect.Array;
-
+import ch.njol.skript.Skript;
+import ch.njol.skript.doc.*;
+import ch.njol.skript.entity.EntityData;
import ch.njol.skript.lang.EventRestrictedSyntax;
+import ch.njol.skript.lang.Expression;
+import ch.njol.skript.lang.ExpressionType;
+import ch.njol.skript.lang.SkriptParser.ParseResult;
+import ch.njol.skript.lang.util.SimpleExpression;
+import ch.njol.skript.log.ErrorQuality;
+import ch.njol.skript.registrations.Classes;
+import ch.njol.util.Kleenean;
import ch.njol.util.coll.CollectionUtils;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
@@ -15,20 +23,7 @@
import org.bukkit.event.vehicle.VehicleEvent;
import org.jetbrains.annotations.Nullable;
-import ch.njol.skript.Skript;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Since;
-import ch.njol.skript.entity.EntityData;
-import ch.njol.skript.lang.Expression;
-import ch.njol.skript.lang.ExpressionType;
-import ch.njol.skript.lang.SkriptParser.ParseResult;
-import ch.njol.skript.lang.util.SimpleExpression;
-import ch.njol.skript.log.ErrorQuality;
-import ch.njol.skript.registrations.Classes;
-import ch.njol.util.Kleenean;
+import java.lang.reflect.Array;
@Name("Attacked")
@Description("The victim of a damage event, e.g. when a player attacks a zombie this expression represents the zombie. " +
@@ -37,7 +32,7 @@
"\tvictim is a creeper",
"\tdamage the attacked by 1 heart"})
@Since("1.3, 2.6.1 (projectile hit event)")
-@Events({"damage", "death", "projectile hit"})
+@Events({"Damage", "Death", "Projectile hit"})
public class ExprAttacked extends SimpleExpression implements EventRestrictedSyntax {
private static final boolean SUPPORT_PROJECTILE_HIT = Skript.methodExists(ProjectileHitEvent.class, "getHitEntity");
diff --git a/src/main/java/ch/njol/skript/expressions/ExprAttacker.java b/src/main/java/ch/njol/skript/expressions/ExprAttacker.java
index bf1e6d9f20e..5398198e94a 100644
--- a/src/main/java/ch/njol/skript/expressions/ExprAttacker.java
+++ b/src/main/java/ch/njol/skript/expressions/ExprAttacker.java
@@ -1,6 +1,14 @@
package ch.njol.skript.expressions;
+import ch.njol.skript.Skript;
+import ch.njol.skript.doc.*;
import ch.njol.skript.lang.EventRestrictedSyntax;
+import ch.njol.skript.lang.Expression;
+import ch.njol.skript.lang.ExpressionType;
+import ch.njol.skript.lang.SkriptParser.ParseResult;
+import ch.njol.skript.lang.util.SimpleExpression;
+import ch.njol.skript.registrations.Classes;
+import ch.njol.util.Kleenean;
import ch.njol.util.coll.CollectionUtils;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Projectile;
@@ -12,20 +20,6 @@
import org.bukkit.event.vehicle.VehicleDestroyEvent;
import org.jetbrains.annotations.Nullable;
-import ch.njol.skript.Skript;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Since;
-import ch.njol.skript.lang.Expression;
-import ch.njol.skript.lang.ExpressionType;
-import ch.njol.skript.lang.SkriptParser.ParseResult;
-import ch.njol.skript.lang.util.SimpleExpression;
-import ch.njol.skript.log.ErrorQuality;
-import ch.njol.skript.registrations.Classes;
-import ch.njol.util.Kleenean;
-
/**
* @author Peter Güttinger
*/
@@ -37,7 +31,7 @@
" health of attacker is less than or equal to 2",
" damage victim by 1 heart"})
@Since("1.3")
-@Events({"damage", "death", "destroy"})
+@Events({"Damage", "Death", "Destroy"})
public class ExprAttacker extends SimpleExpression implements EventRestrictedSyntax {
static {
diff --git a/src/main/java/ch/njol/skript/expressions/ExprClicked.java b/src/main/java/ch/njol/skript/expressions/ExprClicked.java
index 536da33b70f..16705a91cdb 100644
--- a/src/main/java/ch/njol/skript/expressions/ExprClicked.java
+++ b/src/main/java/ch/njol/skript/expressions/ExprClicked.java
@@ -1,7 +1,18 @@
package ch.njol.skript.expressions;
-import java.lang.reflect.Array;
-
+import ch.njol.skript.Skript;
+import ch.njol.skript.aliases.ItemType;
+import ch.njol.skript.doc.*;
+import ch.njol.skript.entity.EntityData;
+import ch.njol.skript.lang.Expression;
+import ch.njol.skript.lang.ExpressionType;
+import ch.njol.skript.lang.Literal;
+import ch.njol.skript.lang.SkriptParser.ParseResult;
+import ch.njol.skript.lang.util.SimpleExpression;
+import ch.njol.skript.util.slot.InventorySlot;
+import ch.njol.skript.util.slot.Slot;
+import ch.njol.util.Kleenean;
+import ch.njol.util.coll.CollectionUtils;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
@@ -15,23 +26,7 @@
import org.bukkit.inventory.Inventory;
import org.jetbrains.annotations.Nullable;
-import ch.njol.skript.Skript;
-import ch.njol.skript.aliases.ItemType;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Events;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Since;
-import ch.njol.skript.entity.EntityData;
-import ch.njol.skript.lang.Expression;
-import ch.njol.skript.lang.ExpressionType;
-import ch.njol.skript.lang.Literal;
-import ch.njol.skript.lang.SkriptParser.ParseResult;
-import ch.njol.skript.lang.util.SimpleExpression;
-import ch.njol.skript.util.slot.InventorySlot;
-import ch.njol.skript.util.slot.Slot;
-import ch.njol.util.Kleenean;
-import ch.njol.util.coll.CollectionUtils;
+import java.lang.reflect.Array;
@Name("Clicked Block/Entity/Inventory/Slot")
@Description("The clicked block, entity, inventory, inventory slot, inventory click type or inventory action.")
@@ -41,7 +36,7 @@
"\tshow the inventory of the clicked block to the player"
})
@Since("1.0, 2.2-dev35 (more clickable things)")
-@Events({"click", "inventory click"})
+@Events({"Click", "Inventory Click"})
public class ExprClicked extends SimpleExpression