Skip to content
Open

1.17 #41

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions namelayer-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>vg.civcraft.mc.namelayer</groupId>
<groupId>com.github.civclassic</groupId>
<artifactId>namelayer-parent</artifactId>
<version>1.0.0</version>
</parent>

<artifactId>NameLayer</artifactId>
<!-- My Mavenfu is weak, you must update in 2 places. -->
<version>2.14.1</version>
<version>2.15.0</version>

<dependencies>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<groupId>com.github.civclassic</groupId>
<artifactId>namelayer-spigot</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<groupId>com.github.civclassic</groupId>
<artifactId>namelayer-bungee</artifactId>
<version>1.0.0</version>
</dependency>
Expand Down
26 changes: 10 additions & 16 deletions namelayer-bungee/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>vg.civcraft.mc.namelayer</groupId>
<groupId>com.github.civclassic</groupId>
<artifactId>namelayer-parent</artifactId>
<version>1.0.0</version>
</parent>
Expand All @@ -15,40 +15,34 @@
<packaging>jar</packaging>

<dependencies>
<!-- <dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-spigot</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>-->

<!-- https://mvnrepository.com/artifact/net.md-5/bungeecord-protocol -->
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-protocol</artifactId>
<version>1.16-R0.4-SNAPSHOT</version>
<version>1.16-R0.4</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/net.md-5/bungeecord-api -->
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.16-R0.4-SNAPSHOT</version>
<version>1.16-R0.4</version>
<scope>provided</scope>
</dependency>
<!-- http://nexus.codecrafter47.dyndns.eu/service/rest/repository/browse/public/net/md-5/bungeecord-proxy/ -->
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-proxy</artifactId>
<version>1.16-R0.4-SNAPSHOT</version>
<version>1.17-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<!-- Hikari -->
<!-- https://mvnrepository.com/artifact/com.zaxxer/HikariCP -->
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.3.0</version>
<scope>compile</scope>
<version>4.0.3</version>
<scope>provided</scope>
</dependency>

</dependencies>

<build>
Expand Down
87 changes: 16 additions & 71 deletions namelayer-spigot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>vg.civcraft.mc.namelayer</groupId>
<groupId>com.github.civclassic</groupId>
<artifactId>namelayer-parent</artifactId>
<version>1.0.0</version>
</parent>
Expand All @@ -15,20 +15,20 @@

<dependencies>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_16_R3</artifactId>
<groupId>com.github.civclassic</groupId>
<artifactId>namelayer-nms-v1_17_R1</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.civmodcore</groupId>
<groupId>com.github.civclassic</groupId>
<artifactId>CivModCore</artifactId>
<version>1.8.2</version>
<version>1.9.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -78,66 +78,11 @@
</activation>
<dependencies>
<!-- NMS crap -->
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_8_R1</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_8_R2</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_8_R3</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_9_R1</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_9_R2</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_10_R1</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_11_R1</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_12_R1</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_13_R2</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_14_R1</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_16_R1</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>namelayer-nms-v1_16_R3</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>com.github.civclassic</groupId>
<artifactId>namelayer-nms-v1_17_R1</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
</profile>
</profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
import java.util.Map;
import java.util.TreeMap;
import java.util.UUID;
import net.minecraft.nbt.NBTTagCompound;
import org.bukkit.Bukkit;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.scheduler.BukkitTask;
import vg.civcraft.mc.civmodcore.serialization.NBTCompound;
import vg.civcraft.mc.civmodcore.util.MoreMapUtils;
import vg.civcraft.mc.civmodcore.nbt.NBTSerialization;
import vg.civcraft.mc.civmodcore.utilities.MoreMapUtils;
import vg.civcraft.mc.namelayer.listeners.AssociationListener;

public final class MojangNames {
Expand All @@ -27,7 +28,7 @@ public final class MojangNames {
private static BukkitTask SAVE_TASK;

public static void init(final NameLayerPlugin plugin) {
final Path mojangFile = plugin.getResourceFile(PROFILES_FILE).toPath();
final Path mojangFile = plugin.getDataFile(PROFILES_FILE).toPath();
// Load all the profiles that already exist
Bukkit.getScheduler().runTaskAsynchronously(
plugin, () -> load(plugin, mojangFile));
Expand All @@ -38,7 +39,7 @@ public static void init(final NameLayerPlugin plugin) {

public static void reset(final NameLayerPlugin plugin) {
if (!PROFILES.isEmpty()) {
save(plugin, plugin.getResourceFile(PROFILES_FILE).toPath());
save(plugin, plugin.getDataFile(PROFILES_FILE).toPath());
PROFILES.clear();
}
if (SAVE_TASK != null) {
Expand All @@ -51,8 +52,8 @@ private static void load(final NameLayerPlugin plugin, final Path file) {
PROFILES.clear();
try {
final byte[] data = Files.readAllBytes(file);
final NBTCompound nbt = NBTCompound.fromBytes(data);
nbt.getKeys().forEach(key -> PROFILES.put(key, nbt.getUUID(key)));
final NBTTagCompound nbt = NBTSerialization.fromBytes(data);
nbt.getKeys().forEach(key -> PROFILES.put(key, nbt.a(key)));
plugin.info("[MojangNames] Mojang profiles loaded!");
}
catch (final NoSuchFileException ignored) {}
Expand All @@ -62,9 +63,9 @@ private static void load(final NameLayerPlugin plugin, final Path file) {
}

private static void save(final NameLayerPlugin plugin, final Path file) {
final NBTCompound nbt = new NBTCompound();
PROFILES.forEach((name, uuid) -> nbt.setUUID(name, uuid)); // Ignore highlighter
final byte[] data = NBTCompound.toBytes(nbt);
final NBTTagCompound nbt = new NBTTagCompound();
PROFILES.forEach((name, uuid) -> nbt.a(name, uuid)); // Ignore highlighter
final byte[] data = NBTSerialization.toBytes(nbt);
try {
Files.write(file, data,
StandardOpenOption.CREATE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static UUID getUUID(String playerName) {
}
/**
* Gets the playername from a given server from their uuid.
* @param uuid.
* @param uuid uuid of target player
* @return Returns the PlayerName from the UUID.
*/
public static String getCurrentName(UUID uuid) {
Expand Down
Loading