-
-
Notifications
You must be signed in to change notification settings - Fork 402
Literal Number Max+Min Values #8008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Absolutionism
wants to merge
4
commits into
SkriptLang:dev/feature
Choose a base branch
from
Absolutionism:dev/LiteralNumberValues
base: dev/feature
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ava/ch/njol/skript/expressions/LitAt.java → ...n/java/ch/njol/skript/literals/LitAt.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...h/njol/skript/expressions/LitConsole.java → ...a/ch/njol/skript/literals/LitConsole.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/ch/njol/skript/literals/LitDoubleMaxValue.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ch.njol.skript.literals; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Example; | ||
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.SimpleLiteral; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.event.Event; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Name("Maximum Double Value") | ||
@Description("A number representing the maximum value of a double number type.") | ||
@Example("if {_number} >= maximum double value:") | ||
@Since("INSERT VERSION") | ||
public class LitDoubleMaxValue extends SimpleLiteral<Double> { | ||
|
||
static { | ||
Skript.registerExpression(LitDoubleMaxValue.class, Double.class, ExpressionType.SIMPLE, "max[imum] double value"); | ||
} | ||
|
||
public LitDoubleMaxValue() { | ||
super(Double.MAX_VALUE, false); | ||
} | ||
|
||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event event, boolean debug) { | ||
return "max double value"; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/ch/njol/skript/literals/LitDoubleMinValue.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ch.njol.skript.literals; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Example; | ||
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.SimpleLiteral; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.event.Event; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Name("Minimum Double Value") | ||
@Description("A number representing the minimum value of a double number type.") | ||
@Example("if {_number} <= minimum double value:") | ||
@Since("INSERT VERSION") | ||
public class LitDoubleMinValue extends SimpleLiteral<Double> { | ||
|
||
static { | ||
Skript.registerExpression(LitDoubleMinValue.class, Double.class, ExpressionType.SIMPLE, "min[imum] double value"); | ||
} | ||
|
||
public LitDoubleMinValue() { | ||
super(Double.MIN_VALUE, false); | ||
} | ||
|
||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event event, boolean debug) { | ||
return "min double value"; | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
.../njol/skript/expressions/LitEternity.java → .../ch/njol/skript/literals/LitEternity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/ch/njol/skript/literals/LitFloatMaxValue.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ch.njol.skript.literals; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Example; | ||
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.SimpleLiteral; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.event.Event; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Name("Maximum Float Value") | ||
@Description("A number representing the maximum value of a float number type.") | ||
@Example("if {_number} >= maximum float value:") | ||
@Since("INSERT VERSION") | ||
public class LitFloatMaxValue extends SimpleLiteral<Float> { | ||
|
||
static { | ||
Skript.registerExpression(LitFloatMaxValue.class, Float.class, ExpressionType.SIMPLE, "max[imum] float value"); | ||
} | ||
|
||
public LitFloatMaxValue() { | ||
super(Float.MAX_VALUE, false); | ||
} | ||
|
||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event event, boolean debug) { | ||
return "max float value"; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/ch/njol/skript/literals/LitFloatMinValue.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ch.njol.skript.literals; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Example; | ||
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.SimpleLiteral; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.event.Event; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Name("Minimum Float Value") | ||
@Description("A number representing the minimum value of a float number type.") | ||
@Example("if {_number} <= minimum float value:") | ||
@Since("INSERT VERSION") | ||
public class LitFloatMinValue extends SimpleLiteral<Float> { | ||
|
||
static { | ||
Skript.registerExpression(LitFloatMinValue.class, Float.class, ExpressionType.SIMPLE, "min[imum] float value"); | ||
} | ||
|
||
public LitFloatMinValue() { | ||
super(Float.MIN_VALUE, false); | ||
} | ||
|
||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event event, boolean debug) { | ||
return "min float value"; | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
.../njol/skript/expressions/LitInfinity.java → .../ch/njol/skript/literals/LitInfinity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ch.njol.skript.literals; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Example; | ||
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.SimpleLiteral; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.event.Event; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Name("Maximum Integer Value") | ||
@Description("A number representing the maximum value of an integer number type.") | ||
@Example("if {_number} >= maximum integer value:") | ||
@Since("INSERT VERSION") | ||
public class LitIntMaxValue extends SimpleLiteral<Integer> { | ||
|
||
static { | ||
Skript.registerExpression(LitIntMaxValue.class, Integer.class, ExpressionType.SIMPLE, "max[imum] integer value"); | ||
} | ||
|
||
public LitIntMaxValue() { | ||
super(Integer.MAX_VALUE, false); | ||
} | ||
|
||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event event, boolean debug) { | ||
return "max integer value"; | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ch.njol.skript.literals; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Example; | ||
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.SimpleLiteral; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.event.Event; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Name("Minimum Integer Value") | ||
@Description("A number representing the minimum value of an integer number type.") | ||
@Example("if {_number} <= minimum integer value:") | ||
@Since("INSERT VERSION") | ||
public class LitIntMinValue extends SimpleLiteral<Integer> { | ||
|
||
static { | ||
Skript.registerExpression(LitIntMinValue.class, Integer.class, ExpressionType.SIMPLE, "min[imum] integer value"); | ||
} | ||
|
||
public LitIntMinValue() { | ||
super(Integer.MIN_VALUE, false); | ||
} | ||
|
||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event event, boolean debug) { | ||
return "min integer value"; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/ch/njol/skript/literals/LitLongMaxValue.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ch.njol.skript.literals; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Example; | ||
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.SimpleLiteral; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.event.Event; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Name("Maximum Long Value") | ||
@Description("A number representing the maximum value of a long number type.") | ||
@Example("if {_number} >= maximum long value:") | ||
@Since("INSERT VERSION") | ||
public class LitLongMaxValue extends SimpleLiteral<Long> { | ||
|
||
static { | ||
Skript.registerExpression(LitLongMaxValue.class, Long.class, ExpressionType.SIMPLE, "max[imum] long value"); | ||
} | ||
|
||
public LitLongMaxValue() { | ||
super(Long.MAX_VALUE, false); | ||
} | ||
|
||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event event, boolean debug) { | ||
return "max long value"; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/ch/njol/skript/literals/LitLongMinValue.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ch.njol.skript.literals; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Example; | ||
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.SimpleLiteral; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.event.Event; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Name("Minimum Long Value") | ||
@Description("A number representing the minimum value of a long number type.") | ||
@Example("if {_number} <= minimum long value:") | ||
@Since("INSERT VERSION") | ||
public class LitLongMinValue extends SimpleLiteral<Long> { | ||
|
||
static { | ||
Skript.registerExpression(LitLongMinValue.class, Long.class, ExpressionType.SIMPLE, "min[imum] long value"); | ||
} | ||
|
||
public LitLongMinValue() { | ||
super(Long.MIN_VALUE, false); | ||
} | ||
|
||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event event, boolean debug) { | ||
return "min long value"; | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...va/ch/njol/skript/expressions/LitNaN.java → .../java/ch/njol/skript/literals/LitNaN.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ript/expressions/LitNegativeInfinity.java → .../skript/literals/LitNegativeInfinity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...h/njol/skript/expressions/LitNewLine.java → ...a/ch/njol/skript/literals/LitNewLine.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package ch.njol.skript.expressions; | ||
package ch.njol.skript.literals; | ||
|
||
import org.bukkit.event.Event; | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.