Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Snabeldier committed Dec 18, 2024
1 parent 5f3afeb commit e4bb038
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 36 deletions.
9 changes: 1 addition & 8 deletions src/main/java/minevalley/core/api/ChatMenu.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package minevalley.core.api;

import lombok.AllArgsConstructor;
import lombok.Getter;
import minevalley.core.api.utils.ClickableMessage;

public interface ChatMenu {
Expand All @@ -25,11 +23,6 @@ public interface ChatMenu {
*/
void disable(int index);

@AllArgsConstructor
@Getter
class Option {

final String name, hover;
final ClickableMessage clickableMessage;
record Option(String name, String hover, ClickableMessage clickableMessage) {
}
}
4 changes: 3 additions & 1 deletion src/main/java/minevalley/core/api/Registrant.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public interface Registrant {
* @return this registrants name cropped to have a maximum length of 16 characters.
*/
default String getCroppedName() {
return getName().length() > 16 ? getName().substring(0, 13) + "..." : getName();
final String name = getName();
if (name.length() <= 16) return name;
return name.substring(0, 13) + "...";
}

/**
Expand Down
10 changes: 1 addition & 9 deletions src/main/java/minevalley/core/api/users/Purchase.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
package minevalley.core.api.users;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public class Purchase {

private final String code;
private final Type type;
public record Purchase(String code, Type type) {

public enum Type {
CAR_SKIN,
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/minevalley/core/api/vehicles/Vehicle.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public interface Vehicle {

int getDurability();

VehicleColor getColor();
Color getColor();

void changeColor(VehicleColor color);
void changeColor(Color color);

void createNewKey(OnlineUser user);

Expand Down Expand Up @@ -51,4 +51,7 @@ public interface Vehicle {
default boolean isLoaded() {
return getLoadedVehicle() != null;
}

record Color(String name, String hex) {
}
}
10 changes: 0 additions & 10 deletions src/main/java/minevalley/core/api/vehicles/VehicleColor.java

This file was deleted.

7 changes: 1 addition & 6 deletions src/main/java/minevalley/core/api/weather/Weather.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public class Weather {

private final Type type;
private final int temperature;
public record Weather(Type type, int temperature) {

@Getter
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
Expand Down

0 comments on commit e4bb038

Please sign in to comment.