mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-30 04:19:28 +00:00
fix: distances referencing display radius when that no longer exists in config
This commit is contained in:
@@ -13,7 +13,7 @@ public class Wardrobe {
|
||||
@Getter
|
||||
private final String id;
|
||||
@Getter @Setter
|
||||
private int distance = WardrobeSettings.getDisplayRadius();
|
||||
private int distance;
|
||||
@Getter @Setter
|
||||
private String permission;
|
||||
@Getter @Setter
|
||||
@@ -29,8 +29,8 @@ public class Wardrobe {
|
||||
public Wardrobe(@NotNull String id, @NotNull WardrobeLocation location, @Nullable String permission, int distance) {
|
||||
this.id = id;
|
||||
this.location = location;
|
||||
this.distance = distance;
|
||||
if (permission != null) this.permission = permission;
|
||||
if (distance != -1) this.distance = distance;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.util.logging.Level;
|
||||
public class WardrobeSettings {
|
||||
|
||||
private static final String DISABLE_ON_DAMAGE_PATH = "disable-on-damage";
|
||||
private static final String DISPLAY_RADIUS_PATH = "display-radius";
|
||||
private static final String PORTABLE_PATH = "portable";
|
||||
private static final String ALWAYS_DISPLAY_PATH = "always-display";
|
||||
private static final String ROTATION_SPEED_PATH = "rotation-speed";
|
||||
@@ -62,8 +61,6 @@ public class WardrobeSettings {
|
||||
@Getter
|
||||
private static boolean disableOnDamage;
|
||||
@Getter
|
||||
private static int displayRadius;
|
||||
@Getter
|
||||
private static boolean portable;
|
||||
@Getter
|
||||
private static boolean alwaysDisplay;
|
||||
@@ -115,7 +112,6 @@ public class WardrobeSettings {
|
||||
configRoot = source;
|
||||
|
||||
disableOnDamage = source.node(DISABLE_ON_DAMAGE_PATH).getBoolean();
|
||||
displayRadius = source.node(DISPLAY_RADIUS_PATH).getInt();
|
||||
portable = source.node(PORTABLE_PATH).getBoolean();
|
||||
alwaysDisplay = source.node(ALWAYS_DISPLAY_PATH).getBoolean();
|
||||
rotationSpeed = source.node(ROTATION_SPEED_PATH).getInt();
|
||||
@@ -169,7 +165,7 @@ public class WardrobeSettings {
|
||||
MessagesUtil.sendDebugMessages("Leave Location: " + leaveLocation);
|
||||
WardrobeLocation wardrobeLocation = new WardrobeLocation(npcLocation, viewerLocation, leaveLocation);
|
||||
|
||||
String permission = wardrobesNode.node(PERMISSION_PATH).getString(null);
|
||||
String permission = wardrobesNode.node(PERMISSION_PATH).getString();
|
||||
int distance = wardrobesNode.node(DISTANCE_PATH).getInt(-1);
|
||||
|
||||
Wardrobe wardrobe = new Wardrobe(id, wardrobeLocation, permission, distance);
|
||||
|
||||
Reference in New Issue
Block a user