Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/Plugins/Old/citybuildsystem/src/de/cookie/citybuild/manager/LocationManager.java
2022-09-04 12:45:01 +02:00

37 lines
1.2 KiB
Java

//
// Decompiled by Procyon v0.5.36
//
package de.cookie.citybuild.manager;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import de.omel.api.file.FileBuilder;
public class LocationManager
{
private FileBuilder fb;
public LocationManager() {
this.fb = new FileBuilder("plugins/CityBuildSystem", "locations.yml");
}
public void setLocation(final String name, final Location location) {
this.fb.setValue(name + ".world", location.getWorld().getName());
this.fb.setValue(name + ".x", location.getX());
this.fb.setValue(name + ".y", location.getY());
this.fb.setValue(name + ".z", location.getZ());
this.fb.setValue(name + ".yaw", location.getYaw());
this.fb.setValue(name + ".pitch", location.getPitch());
this.fb.save();
}
public Location getLocation(final String name) {
return new Location(Bukkit.getWorld(this.fb.getString(name + ".world")), this.fb.getDouble(name + ".x"), this.fb.getDouble(name + ".y"), this.fb.getDouble(name + ".z"), (float)this.fb.getDouble(name + ".yaw"), (float)this.fb.getDouble(name + ".pitch"));
}
public boolean exists(final String name) {
return this.fb.getString(name) != null;
}
}