refactor: remove some unused code, cleanup

feat/data-edit-commands
William 10 months ago
parent 4bb38f67d3
commit 35c23c7970
No known key found for this signature in database

@ -448,9 +448,8 @@ public abstract class BukkitData implements Data {
@NotNull
public static BukkitData.Statistics adapt(@NotNull Player player) {
final Map<String, Integer> generic = Maps.newHashMap();
final Map<String, Map<String, Integer>> blocks = Maps.newHashMap();
final Map<String, Map<String, Integer>> items = Maps.newHashMap();
final Map<String, Map<String, Integer>> entities = Maps.newHashMap();
final Map<String, Map<String, Integer>> blocks = Maps.newHashMap(),
items = Maps.newHashMap(), entities = Maps.newHashMap();
Registry.STATISTIC.forEach(id -> {
switch (id.getType()) {
case UNTYPED -> addStatistic(player, id, generic);
@ -585,8 +584,13 @@ public abstract class BukkitData implements Data {
return attributes.stream().filter(attribute -> attribute.name().equals(id.getKey().toString())).findFirst();
}
@SuppressWarnings("unused")
public Optional<Attribute> getAttribute(@NotNull String key) {
return getAttribute(matchAttribute(key));
final org.bukkit.attribute.Attribute attribute = matchAttribute(key);
if (attribute == null) {
return Optional.empty();
}
return getAttribute(attribute);
}
@NotNull

@ -266,10 +266,6 @@ public interface Data {
@NotNull
Map<String, Map<String, Integer>> getEntityStatistics();
record StatisticsMap(
) {
}
}
/**

Loading…
Cancel
Save