Skip to content

Commit

Permalink
Improves PositionableReader loading time
Browse files Browse the repository at this point in the history
  • Loading branch information
anjoismysign committed Aug 13, 2024
1 parent 1be9688 commit c45c6ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package us.mytheria.bloblib.entities.positionable;

import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.configuration.ConfigurationSection;
import org.jetbrains.annotations.NotNull;
import us.mytheria.bloblib.exception.ConfigurationFieldException;
import us.mytheria.bloblib.utilities.SerializationLib;

import java.util.Objects;

Expand Down Expand Up @@ -99,11 +99,10 @@ public double getZ() {
};
}
String worldName = section.getString("World");
@NotNull World world = SerializationLib.deserializeWorld(worldName);
return new Locatable() {
@NotNull
public World getWorld() {
return world;
return Objects.requireNonNull(Bukkit.getWorld(worldName), "World not found: " + worldName);
}

public float getYaw() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.jetbrains.annotations.NotNull;
import us.mytheria.bloblib.api.BlobLibTranslatableAPI;
import us.mytheria.bloblib.entities.DataAssetType;
import us.mytheria.bloblib.utilities.TextColor;

import java.util.Objects;
import java.util.function.Function;
Expand All @@ -27,7 +28,7 @@ public static String PARSE(@NotNull String text,
matcher.appendReplacement(replaced, replacement);
}
matcher.appendTail(replaced);
return replaced.toString();
return TextColor.PARSE(replaced.toString());
}

public static String PARSE(@NotNull String text) {
Expand Down

0 comments on commit c45c6ea

Please sign in to comment.