9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-24 00:59:18 +00:00

refactor: remove some unused code, cleanup

This commit is contained in:
William
2024-04-11 19:16:27 +01:00
parent 4bb38f67d3
commit 35c23c7970
2 changed files with 8 additions and 8 deletions

View File

@@ -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

View File

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