mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-29 11:59:21 +00:00
Fixed remove items not working
This commit is contained in:
@@ -23,6 +23,7 @@ public class WardrobeSettings {
|
||||
private static final String DESPAWN_DELAY_PATH = WARDROBE_PATH + ".despawn-delay";
|
||||
private static final String STATIC_LOCATION_PATH = WARDROBE_PATH + ".wardrobe-location";
|
||||
private static final String VIEWER_LOCATION_PATH = WARDROBE_PATH + ".viewer-location";
|
||||
private static final String LEAVE_LOCATION_PATH = WARDROBE_PATH + ".leave-location";
|
||||
private static final String WORLD_PATH = "world";
|
||||
private static final String X_PATH = "x";
|
||||
private static final String Y_PATH = "y";
|
||||
@@ -43,6 +44,7 @@ public class WardrobeSettings {
|
||||
private int despawnDelay;
|
||||
private Location wardrobeLocation;
|
||||
private Location viewerLocation;
|
||||
private Location leaveLocation;
|
||||
|
||||
public WardrobeSettings(final HMCCosmetics plugin) {
|
||||
this.plugin = plugin;
|
||||
@@ -66,6 +68,13 @@ public class WardrobeSettings {
|
||||
final ConfigurationSection viewerLocationSection = config.getConfigurationSection(VIEWER_LOCATION_PATH);
|
||||
if (viewerLocationSection == null) return;
|
||||
this.viewerLocation = this.loadLocation(viewerLocationSection);
|
||||
|
||||
final ConfigurationSection leaveLocationSection = config.getConfigurationSection(LEAVE_LOCATION_PATH);
|
||||
if (leaveLocationSection == null) {
|
||||
this.leaveLocation = this.viewerLocation;
|
||||
return;
|
||||
}
|
||||
this.leaveLocation = this.loadLocation(leaveLocationSection);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -123,6 +132,10 @@ public class WardrobeSettings {
|
||||
return viewerLocation;
|
||||
}
|
||||
|
||||
public Location getLeaveLocation() {
|
||||
return leaveLocation;
|
||||
}
|
||||
|
||||
public boolean inDistanceOfWardrobe(final Location wardrobeLocation, final Location playerLocation) {
|
||||
if (this.displayRadius == -1) return true;
|
||||
if (!wardrobeLocation.getWorld().equals(playerLocation.getWorld())) return false;
|
||||
|
||||
@@ -146,6 +146,7 @@ public class Wardrobe extends User {
|
||||
this.cameraLocked = false;
|
||||
this.currentLocation = null;
|
||||
this.getPlayerArmor().clear();
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> viewer.teleport(settings.getLeaveLocation()));
|
||||
|
||||
if (settings.isAlwaysDisplay()) {
|
||||
this.currentLocation = settings.getWardrobeLocation();
|
||||
|
||||
Reference in New Issue
Block a user