Skip to content

Commit

Permalink
Bump version tag to 2.7.0-beta1 (#5390)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLimeGlass authored Mar 10, 2023
1 parent 9291132 commit f4ad063
Show file tree
Hide file tree
Showing 74 changed files with 159 additions and 83 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
groupid=ch.njol
name=skript
version=2.7.0-dev
version=2.7.0-beta1
jarName=Skript.jar
testEnv=java17/paper-1.19.3
testEnvJavaVersion=17
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 @@ -37,7 +37,7 @@ public EnumSerializer(Class<T> c) {
}

/**
* Enum serialization has been using String serialization since Skript (INSERT VERSION)
* Enum serialization has been using String serialization since Skript (2.7)
*/
@Override
@Deprecated
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ch/njol/skript/classes/data/BukkitClasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -1485,14 +1485,14 @@ public String toVariableNameString(EnchantmentOffer eo) {
.user("(world ?)?environments?")
.name("World Environment")
.description("Represents the environment of a world.")
.since("INSERT VERSION"));
.since("2.7"));

if (Skript.classExists("io.papermc.paper.world.MoonPhase")) {
Classes.registerClass(new EnumClassInfo<>(MoonPhase.class, "moonphase", "moon phases")
.user("(lunar|moon) ?phases?")
.name("Moon Phase")
.description("Represents the phase of a moon.")
.since("INSERT VERSION")
.since("2.7")
.requiredPlugins("Paper 1.16+"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public Number[] executeSimple(Object[][] params) {
}
}.description("Rounds a number, i.e. returns the closest integer to the argument. Place a second argument to define the decimal placement.")
.examples("round(2.34) = 2", "round(2) = 2", "round(2.99) = 3", "round(2.5) = 3")
.since("2.2, INSERT VERSION (decimal placement)"));
.since("2.2, 2.7 (decimal placement)"));

Functions.registerFunction(new SimpleJavaFunction<Long>("ceil", numberParam, DefaultClasses.LONG, true) {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@Description("Checks whether or not respawn anchors work in a world.")
@Examples("respawn anchors work in world \"world_nether\"")
@RequiredPlugins("Minecraft 1.16+")
@Since("INSERT VERSION")
@Since("2.7")
public class CondAnchorWorks extends Condition {

static {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/conditions/CondIsFrozen.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"if player is frozen:",
"\tkill player"
})
@Since("INSERT VERSION")
@Since("2.7")
public class CondIsFrozen extends PropertyCondition<Entity> {

static {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/conditions/CondIsGliding.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@Name("Is Gliding")
@Description("Checks whether a living entity is gliding.")
@Examples("if player is gliding")
@Since("INSERT VERSION")
@Since("2.7")
public class CondIsGliding extends PropertyCondition<LivingEntity> {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@Name("Is Invisible")
@Description("Checks whether a living entity is invisible.")
@Examples("target entity is invisible")
@Since("INSERT VERSION")
@Since("2.7")
public class CondIsInvisible extends PropertyCondition<LivingEntity> {

static {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/conditions/CondIsOp.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@Name("Is Operator")
@Description("Checks whether a player is a server operator.")
@Examples("player is an operator")
@Since("INSERT VERSION")
@Since("2.7")
public class CondIsOp extends PropertyCondition<OfflinePlayer> {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"\telse:",
"\t\tcancel event"
})
@Since("INSERT VERSION")
@Since("2.7")
@RequiredPlugins("1.16.5+, Paper 1.19.2+ (blockdata)")
public class CondIsPreferredTool extends Condition {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"birch wood is stackable",
"torch is stackable"
})
@Since("INSERT VERSION")
@Since("2.7")
public class CondIsStackable extends PropertyCondition<ItemStack> {

static {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/conditions/CondIsValid.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@Name("Is Valid")
@Description("Checks whether an entity has died or been despawned for some other reason.")
@Examples("if event-entity is valid")
@Since("INSERT VERSION")
@Since("2.7")
public class CondIsValid extends PropertyCondition<Entity> {

static {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/conditions/CondIsWithin.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"\tcancel event",
"\tsend \"Back up!\" to attacker and victim",
})
@Since("INSERT VERSION")
@Since("2.7")
@RequiredPlugins("MC 1.17+ (within block)")
public class CondIsWithin extends Condition {

Expand Down
79 changes: 79 additions & 0 deletions src/main/java/ch/njol/skript/conditions/CondIsWithinLocation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* This file is part of Skript.
*
* Skript is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Skript is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Skript. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright Peter Güttinger, SkriptLang team and contributors
*/
package ch.njol.skript.conditions;

import org.bukkit.Location;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;

import ch.njol.skript.conditions.base.PropertyCondition;
import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Examples;
import ch.njol.skript.doc.Name;
import ch.njol.skript.doc.Since;
import ch.njol.skript.lang.Condition;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.util.AABB;
import ch.njol.util.Kleenean;

@Name("Is Within Location")
@Description({
"Whether a location is within two other locations forming a cuboid.",
"Using the <a href='conditions.html#CondCompare'>is between</a> condition will refer to a straight line between locations."
})
@Examples({
"if player's location is within {_loc1} and {_loc2}:",
"\tsend \"You are in a PvP zone!\" to player"
})
@Since("2.7")
public class CondIsWithinLocation extends Condition {

static {
PropertyCondition.register(CondIsWithinLocation.class, "within %location% and %location%", "locations");
}

private Expression<Location> locsToCheck, loc1, loc2;

@Override
@SuppressWarnings("unchecked")
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
setNegated(matchedPattern == 1);
locsToCheck = (Expression<Location>) exprs[0];
loc1 = (Expression<Location>) exprs[1];
loc2 = (Expression<Location>) exprs[2];
return true;
}

@Override
public boolean check(Event event) {
Location one = loc1.getSingle(event);
Location two = loc2.getSingle(event);
if (one == null || two == null || one.getWorld() != two.getWorld())
return false;
AABB box = new AABB(one, two);
return locsToCheck.check(event, box::contains, isNegated());
}

@Override
public String toString(@Nullable Event event, boolean debug) {
return locsToCheck.toString(event, debug) + " is within " + loc1.toString(event, debug) + " and " + loc2.toString(event, debug);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"player has played on this server before",
"player hasn't played before"
})
@Since("1.4, INSERT VERSION (multiple players)")
@Since("1.4, 2.7 (multiple players)")
public class CondPlayedBefore extends Condition {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"\tbroadcast \"%player% is respawning in their bed! So cozy!\""
})
@RequiredPlugins("Minecraft 1.16+")
@Since("INSERT VERSION")
@Since("2.7")
@Events("respawn")
public class CondRespawnLocation extends Condition {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/conditions/CondWillHatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"\t\tsend \"Better luck next time!\" to the player"
})
@Events("Egg Throw")
@Since("INSERT VERSION")
@Since("2.7")
public class CondWillHatch extends Condition {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"\t\tcancel event",
"\t\tsend \"You can't PVP in spawn.\""
})
@Since("INSERT VERSION")
@Since("2.7")
public class CondWithinRadius extends Condition {

static {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/effects/EffContinue.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"\tif loop-value does not have permission \"moderator\":",
"\t\tcontinue # filter out non moderators",
"\tbroadcast \"%loop-player% is a moderator!\" # Only moderators get broadcast"})
@Since("2.2-dev37, INSERT VERSION (while loops)")
@Since("2.2-dev37, 2.7 (while loops)")
public class EffContinue extends Effect {

static {
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/ch/njol/skript/effects/EffEquip.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;

/**
* @author Peter Güttinger
*/
@Name("Equip")
@Description("Equips or unequips an entity with some given armor. This will replace any armor that the entity is wearing.")
@Examples({
Expand All @@ -58,7 +55,7 @@
"unequip all armor from player",
"unequip player's armor"
})
@Since("1.0, INSERT VERSION (multiple entities, unequip)")
@Since("1.0, 2.7 (multiple entities, unequip)")
public class EffEquip extends Effect {

static {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/effects/EffInvisible.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"When setting an entity to invisible while using an invisibility potion on it, the potion will be overridden and when it runs out the entity keeps its invisibility."
})
@Examples("make target entity invisible")
@Since("INSERT VERSION")
@Since("2.7")
public class EffInvisible extends Effect {

static {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/effects/EffKnockback.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"knockback player north",
"knock victim (vector from attacker to victim) with strength 10"
})
@Since("INSERT VERSION")
@Since("2.7")
@RequiredPlugins("Paper 1.19.2+")
public class EffKnockback extends Effect {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/effects/EffLook.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"",
"force {_enderman} to face the block 3 meters above {_location} at head rotation speed 100.5 and max head pitch -40"
})
@Since("INSERT VERSION")
@Since("2.7")
@RequiredPlugins("Paper 1.17+, Paper 1.19.1+ (Players & Look Anchors)")
public class EffLook extends Effect {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/effects/EffMakeEggHatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"\tmake the egg hatch"
})
@Events("Egg Throw")
@Since("INSERT VERSION")
@Since("2.7")
public class EffMakeEggHatch extends Effect {

static {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/effects/EffPathfind.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"make all cows stop pathfinding",
"make event-entity pathfind towards player at speed 1"
})
@Since("INSERT VERSION")
@Since("2.7")
@RequiredPlugins("Paper")
public class EffPathfind extends Effect {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/effects/EffStopSound.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"stop all sound for all players",
"stop sound in record category"
})
@Since("2.4, INSERT VERSION (stop all sounds)")
@Since("2.4, 2.7 (stop all sounds)")
@RequiredPlugins("MC 1.17.1 (stop all sounds)")
public class EffStopSound extends Effect {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/events/EvtDamage.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class EvtDamage extends SkriptEvent {
Skript.registerEvent("Damage", EvtDamage.class, EntityDamageEvent.class, "damag(e|ing) [of %-entitydata%] [by %-entitydata%]")
.description("Called when an entity receives damage, e.g. by an attack from another entity, lava, fire, drowning, fall, suffocation, etc.")
.examples("on damage:", "on damage of a player:", "on damage of player by zombie:")
.since("1.0, INSERT VERSION (by entity)");
.since("1.0, 2.7 (by entity)");
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class EvtExperienceChange extends SkriptEvent {
"\tset {_xp} to event-experience",
"\tbroadcast \"%{_xp}%\""
)
.since("INSERT VERSION");
.since("2.7");
EventValues.registerEventValue(PlayerExpChangeEvent.class, Experience.class, new Getter<Experience, PlayerExpChangeEvent>() {
@Override
@Nullable
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/events/EvtItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class EvtItem extends SkriptEvent {
"on entity drop of an egg:",
"\tif event-entity is a chicken:",
"\t\tset item of event-dropped item to a diamond")
.since("<i>unknown</i> (before 2.1), INSERT VERSION (entity)");
.since("<i>unknown</i> (before 2.1), 2.7 (entity)");
if (hasPrepareCraftEvent) { // Must be loaded before CraftItemEvent
Skript.registerEvent("Prepare Craft", EvtItem.class, PrepareItemCraftEvent.class, "[player] (preparing|beginning) craft[ing] [[of] %-itemtypes%]")
.description("Called just before displaying crafting result to player. Note that setting the result item might or might not work due to Bukkit bugs.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class EvtPlayerChunkEnter extends SkriptEvent {
.examples(
"on player enters a chunk:",
"\tsend \"You entered a chunk: %past event-chunk% -> %event-chunk%!\" to player"
).since("INSERT VERSION");
).since("2.7");
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/events/EvtSpectate.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class EvtSpectate extends SkriptEvent {
.description("Called with a player starts, stops or swaps spectating an entity.")
.examples("on player start spectating of a zombie:")
.requiredPlugins("Paper")
.since("INSERT VERSION");
.since("2.7");
}

private Literal<EntityData<?>> datas;
Expand Down
Loading

0 comments on commit f4ad063

Please sign in to comment.