refactor: remove some unused code, cleanup

feat/data-edit-commands
William 11 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 @NotNull
public static BukkitData.Statistics adapt(@NotNull Player player) { public static BukkitData.Statistics adapt(@NotNull Player player) {
final Map<String, Integer> generic = Maps.newHashMap(); final Map<String, Integer> generic = Maps.newHashMap();
final Map<String, Map<String, Integer>> blocks = Maps.newHashMap(); final Map<String, Map<String, Integer>> blocks = Maps.newHashMap(),
final Map<String, Map<String, Integer>> items = Maps.newHashMap(); items = Maps.newHashMap(), entities = Maps.newHashMap();
final Map<String, Map<String, Integer>> entities = Maps.newHashMap();
Registry.STATISTIC.forEach(id -> { Registry.STATISTIC.forEach(id -> {
switch (id.getType()) { switch (id.getType()) {
case UNTYPED -> addStatistic(player, id, generic); 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(); return attributes.stream().filter(attribute -> attribute.name().equals(id.getKey().toString())).findFirst();
} }
@SuppressWarnings("unused")
public Optional<Attribute> getAttribute(@NotNull String key) { 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 @NotNull

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

Loading…
Cancel
Save