Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9100efb
simple start (adds WorldModule)
AnOwlBe Jul 15, 2026
00bdd2f
Bunch of stuff (still not done)
AnOwlBe Jul 16, 2026
2cb52de
more work
AnOwlBe Jul 19, 2026
daf6f00
tests still fail for some reason
AnOwlBe Jul 19, 2026
cb5217a
fixes tests failing
AnOwlBe Jul 21, 2026
2b2ff72
adds more tests and fixes bugs during testing
AnOwlBe Jul 21, 2026
ced0fbb
Merge branch 'dev/feature' into WorldUpdates
AnOwlBe Jul 21, 2026
34a8679
should fix junit tests failing + adds more missing world events
AnOwlBe Jul 21, 2026
da75b81
whoops
AnOwlBe Jul 21, 2026
0e10f94
forgot ]
AnOwlBe Jul 21, 2026
d39769a
forgot ) not ]
AnOwlBe Jul 21, 2026
649adb6
istg if this doesn't fix tests failing
AnOwlBe Jul 21, 2026
7aed75b
istg if this doesn't fix tests failing [2x]
AnOwlBe Jul 21, 2026
c9a7f5c
oh
AnOwlBe Jul 21, 2026
24dfd3b
forgot _
AnOwlBe Jul 21, 2026
313847b
forgot _ again
AnOwlBe Jul 21, 2026
f66c56d
this better work
AnOwlBe Jul 21, 2026
21bdbe9
debug to figure out gamerules in 1.21.5
AnOwlBe Jul 21, 2026
1e9a585
/.
AnOwlBe Jul 21, 2026
bb9bae9
should fix tests
AnOwlBe Jul 21, 2026
ffa94ce
inverted logic
AnOwlBe Jul 21, 2026
ce9429b
guess cannot have tests for gamerules
AnOwlBe Jul 21, 2026
f139c29
parse if
AnOwlBe Jul 21, 2026
25498b1
parse if
AnOwlBe Jul 21, 2026
6316357
split
AnOwlBe Jul 23, 2026
e07bd8f
Apply suggestions from code review
AnOwlBe Jul 23, 2026
2bdaa3c
removes in world for weather event
AnOwlBe Jul 23, 2026
578f78c
Attempt at fixing gradlew.bat
AnOwlBe Jul 27, 2026
92f6527
PortalCreateEvent
AnOwlBe Jul 28, 2026
50a9296
infobuilder automatically appends `the`
AnOwlBe Jul 30, 2026
5f3a2fd
Merge branch 'dev/feature' into WorldUpdates
AnOwlBe Jul 30, 2026
b3d6b26
requested changes
AnOwlBe Jul 30, 2026
0a31d85
Merge remote-tracking branch 'origin/WorldUpdates' into WorldUpdates
AnOwlBe Jul 30, 2026
e7095ef
small code cleanup
AnOwlBe Jul 31, 2026
78a14b0
\
AnOwlBe Jul 31, 2026
fe7ed92
small worldborder cleanup
AnOwlBe Jul 31, 2026
6e25555
Merge branch 'dev/feature' into WorldUpdates
AnOwlBe Aug 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 0 additions & 93 deletions src/main/java/ch/njol/skript/classes/data/BukkitClasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,80 +146,6 @@ protected boolean canBeInstantiated() {
}
}).cloner(BlockData::clone));

Classes.registerClass(new ClassInfo<>(World.class, "world")
.user("worlds?")
.name("World")
.description("One of the server's worlds. Worlds can be put into scripts by surrounding their name with double quotes, e.g. \"world_nether\", " +
"but this might not work reliably as <a href='#string'>text</a> uses the same syntax.")
.usage("<code>\"world_name\"</code>, e.g. \"world\"")
.examples("broadcast \"Hello!\" to the world \"world_nether\"")
.since("1.0, 2.2 (alternate syntax)")
.after("string")
.defaultExpression(new EventValueExpression<>(World.class))
.parser(new Parser<World>() {
@SuppressWarnings("null")
private final Pattern parsePattern = Pattern.compile("(?:(?:the )?world )?\"(.+)\"", Pattern.CASE_INSENSITIVE);

@Override
@Nullable
public World parse(final String s, final ParseContext context) {
// REMIND allow shortcuts '[over]world', 'nether' and '[the_]end' (server.properties: 'level-name=world') // inconsistent with 'world is "..."'
if (context == ParseContext.COMMAND || context == ParseContext.PARSE || context == ParseContext.CONFIG)
return Bukkit.getWorld(s);
final Matcher m = parsePattern.matcher(s);
if (m.matches())
return Bukkit.getWorld(m.group(1));
return null;
}

@Override
public String toString(World world, int flags) {
return world.getName();
}

@Override
public String toVariableNameString(World world) {
return world.getName();
}
}).serializer(new Serializer<>() {
@Override
public Fields serialize(World world) {
return Fields.singletonObject("name", world.getName());
}

@Override
public boolean canBeInstantiated() {
return false;
}

@Override
protected World deserialize(Fields fields) throws StreamCorruptedException {
String name = fields.getObject("name", String.class);
assert name != null;
World world = Bukkit.getWorld(name);
if (world == null)
throw new StreamCorruptedException("Missing world " + name);
return world;
}

// return w.getName();
@Override
@Nullable
public World deserialize(final String s) {
return Bukkit.getWorld(s);
}

@Override
public boolean mustSyncDeserialization() {
return true;
}
})
.property(Property.NAME,
"A world's name, as text. Cannot be changed.",
Skript.instance(),
ExpressionPropertyHandler.of(World::getName, String.class)
));

Classes.registerClass(new EnumClassInfo<>(InventoryAction.class, "inventoryaction", "inventory actions")
.user("inventory ?actions?")
.name("Inventory Action")
Expand Down Expand Up @@ -535,12 +461,6 @@ public String toVariableNameString(FireworkEffect effect) {
}
}));

Classes.registerClass(new EnumClassInfo<>(Difficulty.class, "difficulty", "difficulties")
.user("difficult(y|ies)")
.name("Difficulty")
.description("The difficulty of a <a href='#world'>world</a>.")
.since("2.3"));

Classes.registerClass(new EnumClassInfo<>(Status.class, "resourcepackstate", "resource pack states")
.user("resource ?pack ?states?")
.name("Resource Pack State")
Expand Down Expand Up @@ -609,19 +529,6 @@ public String[] getPatterns() {
"NOTE: Minecraft namespaces are supported, ex: 'minecraft:generic.attack_damage'.")
.since("2.5"));

Classes.registerClass(new EnumClassInfo<>(Environment.class, "environment", "environments")
.user("(world ?)?environments?")
.name("World Environment")
.description("Represents the environment of a world.")
.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("2.7"));

if (Skript.classExists("org.bukkit.event.player.PlayerQuitEvent$QuitReason"))
Classes.registerClass(new EnumClassInfo<>(QuitReason.class, "quitreason", "quit reasons")
.user("(quit|disconnect) ?(reason|cause)s?")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ public final class BukkitEventValues {
private static final ItemStack AIR_IS = new ItemStack(Material.AIR);

public static void register(EventValueRegistry registry) {
// === WorldEvents ===
registry.register(EventValue.simple(WorldEvent.class, World.class, WorldEvent::getWorld));

// StructureGrowEvent - a WorldEvent
registry.register(EventValue.simple(StructureGrowEvent.class, Block.class, event -> event.getLocation().getBlock()));

Expand All @@ -103,10 +102,6 @@ public static void register(EventValueRegistry registry) {
.toArray(Block[]::new))
.time(Time.FUTURE)
.build());
// WeatherEvent - not a WorldEvent (wtf ô_Ô)
registry.register(EventValue.simple(WeatherEvent.class, World.class, WeatherEvent::getWorld));
// ChunkEvents
registry.register(EventValue.simple(ChunkEvent.class, Chunk.class, ChunkEvent::getChunk));

// === BlockEvents ===
registry.register(EventValue.simple(BlockEvent.class, Block.class, BlockEvent::getBlock));
Expand Down Expand Up @@ -301,8 +296,6 @@ public PotionEffectType convert(AreaEffectCloudApplyEvent event) {
}));
// ItemSpawnEvent
registry.register(EventValue.simple(ItemSpawnEvent.class, ItemStack.class, event -> event.getEntity().getItemStack()));
// LightningStrikeEvent
registry.register(EventValue.simple(LightningStrikeEvent.class, Entity.class, LightningStrikeEvent::getLightning));
// EndermanAttackPlayerEvent
if (Skript.classExists("com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent")) {
registry.register(EventValue.simple(EndermanAttackPlayerEvent.class, Player.class, EndermanAttackPlayerEvent::getPlayer));
Expand Down Expand Up @@ -554,14 +547,7 @@ else if (hand == EquipmentSlot.OFF_HAND)
registry.register(EventValue.simple(InventoryPickupItemEvent.class, Inventory.class, InventoryPickupItemEvent::getInventory));
registry.register(EventValue.simple(InventoryPickupItemEvent.class, Item.class, InventoryPickupItemEvent::getItem));
registry.register(EventValue.simple(InventoryPickupItemEvent.class, ItemStack.class, event -> event.getItem().getItemStack()));
//PortalCreateEvent
registry.register(EventValue.simple(PortalCreateEvent.class, World.class, WorldEvent::getWorld));
registry.register(EventValue.simple(PortalCreateEvent.class, Block[].class, event -> event.getBlocks().stream()
.map(BlockState::getBlock)
.toArray(Block[]::new)));
if (Skript.methodExists(PortalCreateEvent.class, "getEntity")) { // Minecraft 1.14+
registry.register(EventValue.simple(PortalCreateEvent.class, Entity.class, PortalCreateEvent::getEntity));
}

//PlayerEditBookEvent
registry.register(EventValue.builder(PlayerEditBookEvent.class, ItemStack.class)
.getter(event -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,19 +367,6 @@ public boolean supportsOrdering() {
// OfflinePlayer - UUID
Comparators.registerComparator(OfflinePlayer.class, UUID.class, (player, uuid) -> Relation.get(player.getUniqueId().equals(uuid)));

// World - String
Comparators.registerComparator(World.class, String.class, new Comparator<World, String>() {
@Override
public Relation compare(World w, String name) {
return Relation.get(w.getName().equalsIgnoreCase(name));
}

@Override
public boolean supportsOrdering() {
return false;
}
});

// String - String
Comparators.registerComparator(String.class, String.class, new Comparator<String, String>() {
@Override
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ch/njol/skript/conditions/CondPvP.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;

import static org.skriptlang.skript.lang.script.ScriptWarning.printDeprecationWarning;

@Name("PvP")
@Description("Checks the PvP state of a world.")
@Example("PvP is enabled")
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ch/njol/skript/effects/EffPvP.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;

import static org.skriptlang.skript.lang.script.ScriptWarning.printDeprecationWarning;

@Name("PvP")
@Description("Set the PvP state for a given world.")
@Example("enable PvP #(current world only)")
Expand Down
80 changes: 0 additions & 80 deletions src/main/java/ch/njol/skript/effects/EffWorldLoad.java

This file was deleted.

54 changes: 0 additions & 54 deletions src/main/java/ch/njol/skript/events/EvtWeatherChange.java

This file was deleted.

Loading
Loading