use java8 to build

master
InkerBot 3 months ago
parent f1545e1e8d
commit 23f1ae53b5

@ -3,7 +3,7 @@ plugins {
id 'maven-publish'
}
group 'net.william278'
group 'org.inksnow.husk'
version '1.0'
repositories {
@ -14,6 +14,12 @@ repositories {
}
dependencies {
// lombok
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
testCompileOnly 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
compileOnly 'org.jetbrains:annotations:23.0.0'
@ -22,6 +28,16 @@ dependencies {
}
publishing {
repositories {
maven {
name = 'husk-release'
url = findProperty("repository.huskrelease.url")
credentials {
username = findProperty("repository.huskrelease.username")
password = findProperty("repository.huskrelease.password")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)

@ -0,0 +1,14 @@
lombok.accessors.fluent=true
lombok.accessors.chain=true
lombok.builder.className=Builder
lombok.log.fieldName=logger
lombok.log.custom.flagUsage=error
lombok.log.apacheCommons.flagUsage=error
lombok.log.flogger.flagUsage=error
lombok.log.jbosslog.flagUsage=error
lombok.log.javaUtilLogging.flagUsage=error
lombok.log.log4j.flagUsage=error
lombok.log.log4j2.flagUsage=error
lombok.log.xslf4j.flagUsage=error

@ -1,5 +1,8 @@
package me.william278.husksync.bukkit.data;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import org.bukkit.Material;
import org.bukkit.Statistic;
import org.bukkit.World;
@ -19,38 +22,58 @@ public class DataSerializer {
*
* @deprecated Old format - Use {@link AdvancementRecordDate} instead
*/
@Value
@Deprecated
@SuppressWarnings("DeprecatedIsStillUsed")
// Suppress deprecation warnings here (still used for backwards compatibility)
public record AdvancementRecord(String advancementKey,
ArrayList<String> awardedAdvancementCriteria) implements Serializable {
public static class AdvancementRecord implements Serializable {
String advancementKey;
ArrayList<String> awardedAdvancementCriteria;
}
/**
* A record used to store data for a player's statistics
*/
public record StatisticData(HashMap<Statistic, Integer> untypedStatisticValues,
HashMap<Statistic, HashMap<Material, Integer>> blockStatisticValues,
HashMap<Statistic, HashMap<Material, Integer>> itemStatisticValues,
HashMap<Statistic, HashMap<EntityType, Integer>> entityStatisticValues) implements Serializable {
@Value
public static class StatisticData implements Serializable {
HashMap<Statistic, Integer> untypedStatisticValues;
HashMap<Statistic, HashMap<Material, Integer>> blockStatisticValues;
HashMap<Statistic, HashMap<Material, Integer>> itemStatisticValues;
HashMap<Statistic, HashMap<EntityType, Integer>> entityStatisticValues;
}
/**
* A record used to store data for native advancement synchronisation, tracking advancement date progress
*/
public record AdvancementRecordDate(String key, Map<String, Date> criteriaMap) implements Serializable {
@Value
@RequiredArgsConstructor
public static class AdvancementRecordDate implements Serializable {
String key;
Map<String, Date> criteriaMap;
public AdvancementRecordDate(String key, List<String> criteriaList) {
this(key, new HashMap<>() {{
criteriaList.forEach(s -> put(s, Date.from(Instant.EPOCH)));
}});
this(key, fromStringList(criteriaList));
}
private static Map<String, Date> fromStringList(List<String> criteriaList) {
Map<String, Date> criteriaMap = new HashMap<>();
criteriaList.forEach(s -> criteriaMap.put(s, Date.from(Instant.EPOCH)));
return criteriaMap;
}
}
/**
* A record used to store data for a player's location
*/
public record PlayerLocation(double x, double y, double z, float yaw, float pitch,
String worldName, World.Environment environment) implements Serializable {
@Value
public static class PlayerLocation implements Serializable {
double x;
double y;
double z;
float yaw;
float pitch;
String worldName;
World.Environment environment;
}
}

@ -11,6 +11,7 @@ import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
/**
@ -80,7 +81,7 @@ public class HSLConverter {
.map(o -> new DataSerializer.AdvancementRecordDate(
o.advancementKey(),
o.awardedAdvancementCriteria()
)).toList();
)).collect(Collectors.toList());
}
return (List<DataSerializer.AdvancementRecordDate>) deserialize;

Loading…
Cancel
Save