Skip to content

Commit

Permalink
Add world option to config
Browse files Browse the repository at this point in the history
  • Loading branch information
Luncaaa committed Jun 29, 2023
1 parent a827f51 commit b87abf3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import me.lucaaa.advanceddisplays.utils.ConfigAxisAngle4f;
import me.lucaaa.advanceddisplays.utils.ConfigVector3f;
import me.lucaaa.advanceddisplays.utils.DisplayType;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
Expand Down Expand Up @@ -45,10 +46,11 @@ public BaseDisplay(DisplayType type, ConfigManager configManager, Display entity
this.type = type;

ConfigurationSection locationSection = Objects.requireNonNull(this.config.getConfigurationSection("location"));
String world = locationSection.getString("world", "world");
double x = locationSection.getDouble("x");
double y = locationSection.getDouble("y");
double z = locationSection.getDouble("z");
this.location = new Location(this.display.getWorld(), x, y, z);
this.location = new Location(Bukkit.getWorld(world), x, y, z);
this.display.teleport(this.location);

this.billboard = Display.Billboard.valueOf(this.config.getString("rotationType"));
Expand Down

0 comments on commit b87abf3

Please sign in to comment.