Skript
Skript copied to clipboard
add environment expression
Description
This PR adds a way to get the environment of a world, (get if the world is an overworld, nether or end)
Target Minecraft Versions: any Requirements: none Related Issues: https://github.com/SkriptLang/Skript/issues/3673
Related issue:
- #3673
You also need to respect the original enum name. Normal is also not in the default.lang for the enum environments.normal.
A test can be added for this. The main world of the test runner is a super flat world, along with the end being enabled. A super flat is defined as normal and not custom, as environment is different from world generation, hence why normal should be an accepted enum.
test "world environment":
assert environment of world "world" is normal with "main overworld was not environment ""normal"""
assert environment of world "world_the_end" is the end with "world_the_end was not environment ""the end"""
set {_environment} to environment of world "world"
assert {_environment} is overworld with "environment of world didn't compare with a variable"
You also need to respect the original enum name. Normal is also not in the default.lang for the enum environments.normal.
A test can be added for this. The main world of the test runner is a super flat world, along with the end being enabled. A super flat is defined as normal and not custom, as environment is different from world generation, hence why normal should be an accepted enum.
test "world environment": assert environment of world "world" is normal with "main overworld was not environment ""normal""" assert environment of world "world_the_end" is the end with "world_the_end was not environment ""the end""" set {_environment} to environment of world "world" assert {_environment} is overworld with "environment of world didn't compare with a variable"
it is there, it's just called "overworld" as it makes more sense
it is there, it's just called "overworld" as it makes more sense
The type normal
refers to the sky (and a few other details like temperature etc), sure overworld works, but normal is the literal name used for the enum and if someone knows the Environment enum like me, I would instinctively use normal
.
The type
normal
refers to the sky (and a few other details like temperature etc), sure overworld works, but normal is the literal name used for the enum and if someone knows the Environment enum like me, I would instinctively usenormal
.
Should i replace overworld
with normal
or just add it?
The type
normal
refers to the sky (and a few other details like temperature etc), sure overworld works, but normal is the literal name used for the enum and if someone knows the Environment enum like me, I would instinctively usenormal
.Should i replace
overworld
withnormal
or just add it?
Just adding, overworld is fine as an aliases.
Wait a test script should be added. I wrote an example that's tested
oh right, i forgot to add that, ill do it later :grin: