feat(build): cleaned up dependencies
This commit is contained in:
parent
575224a69d
commit
2806a87cc5
21 changed files with 1045 additions and 84 deletions
|
@ -6,7 +6,7 @@
|
|||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nicko-core</artifactId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<build>
|
||||
<resources>
|
||||
|
@ -40,6 +40,14 @@
|
|||
<include>org.mariadb.jdbc</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>net.artelnatif:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.MF</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>net.wesjd.anvilgui</pattern>
|
||||
|
@ -115,14 +123,8 @@
|
|||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.18-R0.1-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
<scope>compile</scope>
|
||||
<version>1.19-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
|
|
11
core/pom.xml
11
core/pom.xml
|
@ -65,7 +65,8 @@
|
|||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.18-R0.1-SNAPSHOT</version>
|
||||
<version>1.19-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Inventory Lib -->
|
||||
<dependency>
|
||||
|
@ -79,12 +80,6 @@
|
|||
<artifactId>anvilgui</artifactId>
|
||||
<version>1.6.3-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- Apache Lang3 (LocaleUtils) -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<!-- Google Guava (GSON) -->
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
|
@ -111,13 +106,11 @@
|
|||
<artifactId>yamlconfig</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>2.14.0-rc1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-yaml</artifactId>
|
||||
|
|
33
dist/dependency-reduced-pom.xml
vendored
33
dist/dependency-reduced-pom.xml
vendored
|
@ -31,39 +31,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>specialsource-maven-plugin</artifactId>
|
||||
<version>1.2.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>remap-obf</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>remap</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<srgIn>org.spigotmc:minecraft-server:1.19.3-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
|
||||
<reverse>true</reverse>
|
||||
<remappedDependencies>org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
|
||||
<remappedArtifactAttached>true</remappedArtifactAttached>
|
||||
<remappedClassifierName>remapped-obf</remappedClassifierName>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>remap-spigot</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>remap</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
|
||||
<srgIn>org.spigotmc:minecraft-server:1.19.3-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
|
||||
<remappedDependencies>org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
35
dist/pom.xml
vendored
35
dist/pom.xml
vendored
|
@ -37,39 +37,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>specialsource-maven-plugin</artifactId>
|
||||
<version>1.2.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>remap</goal>
|
||||
</goals>
|
||||
<id>remap-obf</id>
|
||||
<configuration>
|
||||
<srgIn>org.spigotmc:minecraft-server:1.19.3-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
|
||||
<reverse>true</reverse>
|
||||
<remappedDependencies>org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
|
||||
<remappedArtifactAttached>true</remappedArtifactAttached>
|
||||
<remappedClassifierName>remapped-obf</remappedClassifierName>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>remap</goal>
|
||||
</goals>
|
||||
<id>remap-spigot</id>
|
||||
<configuration>
|
||||
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
|
||||
<srgIn>org.spigotmc:minecraft-server:1.19.3-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
|
||||
<remappedDependencies>org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
@ -79,6 +46,7 @@
|
|||
<artifactId>core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<artifactId>v1_14_R1</artifactId>
|
||||
|
@ -104,6 +72,7 @@
|
|||
<artifactId>v1_16_R3</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<artifactId>v1_17_R1</artifactId>
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -13,11 +13,13 @@
|
|||
<modules>
|
||||
<module>core</module>
|
||||
<module>dist</module>
|
||||
<!--
|
||||
<module>v1_14_R1</module>
|
||||
<module>v1_15_R1</module>
|
||||
<module>v1_16_R1</module>
|
||||
<module>v1_16_R2</module>
|
||||
<module>v1_16_R3</module>
|
||||
-->
|
||||
<module>v1_17_R1</module>
|
||||
<module>v1_18_R1</module>
|
||||
<module>v1_18_R2</module>
|
||||
|
|
28
v1_14_R1/pom.xml
Normal file
28
v1_14_R1/pom.xml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>nicko-parent</artifactId>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>v1_14_R1</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
101
v1_14_R1/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java
Normal file
101
v1_14_R1/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
package net.artelnatif.nicko.impl;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import com.mojang.authlib.properties.PropertyMap;
|
||||
import net.artelnatif.nicko.disguise.ActionResult;
|
||||
import net.artelnatif.nicko.disguise.NickoProfile;
|
||||
import net.artelnatif.nicko.mojang.MojangSkin;
|
||||
import net.minecraft.network.chat.IChatBaseComponent;
|
||||
import net.minecraft.network.protocol.game.*;
|
||||
import net.minecraft.network.syncher.DataWatcher;
|
||||
import net.minecraft.network.syncher.DataWatcherObject;
|
||||
import net.minecraft.network.syncher.DataWatcherRegistry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.server.level.EntityPlayer;
|
||||
import net.minecraft.world.level.EnumGamemode;
|
||||
import net.minecraft.world.level.World;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
public class v1_17_R1 implements Internals {
|
||||
@Override
|
||||
public void updateSelf(Player player) {
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
final ResourceKey<World> levelResourceKey = entityPlayer.getWorld().getDimensionKey();
|
||||
final CraftWorld world = entityPlayer.getWorld().getWorld();
|
||||
final PacketPlayOutRespawn respawn = new PacketPlayOutRespawn(entityPlayer.getWorld().getDimensionManager(),
|
||||
levelResourceKey, world.getSeed(),
|
||||
entityPlayer.c.getGamemode(), entityPlayer.d.c(),
|
||||
false,
|
||||
false,
|
||||
false);
|
||||
|
||||
final boolean wasFlying = player.isFlying();
|
||||
entityPlayer.b.sendPacket(respawn);
|
||||
player.setFlying(wasFlying);
|
||||
player.teleport(player.getLocation(), PlayerTeleportEvent.TeleportCause.PLUGIN);
|
||||
player.updateInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOthers(Player player) {
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
final PacketPlayOutEntityDestroy destroy = new PacketPlayOutEntityDestroy(entityPlayer.getBukkitEntity().getEntityId());
|
||||
final PacketPlayOutNamedEntitySpawn spawn = new PacketPlayOutNamedEntitySpawn(entityPlayer);
|
||||
|
||||
final DataWatcher dataWatcher = entityPlayer.getDataWatcher();
|
||||
final DataWatcherObject<Byte> displayedSkinPartDataWatcher = new DataWatcherObject<>(17, DataWatcherRegistry.a);
|
||||
dataWatcher.set(displayedSkinPartDataWatcher, (byte) 0x7f);
|
||||
final PacketPlayOutEntityMetadata entityMetadata = new PacketPlayOutEntityMetadata(entityPlayer.getBukkitEntity().getEntityId(), dataWatcher, true);
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(online -> {
|
||||
EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle();
|
||||
if (onlineEntityPlayer.getBukkitEntity().getUniqueId() != player.getUniqueId()) {
|
||||
onlineEntityPlayer.b.sendPacket(destroy);
|
||||
onlineEntityPlayer.b.sendPacket(spawn);
|
||||
}
|
||||
onlineEntityPlayer.b.sendPacket(entityMetadata);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<Void> updateProfile(Player player, NickoProfile profile, boolean skinChange, boolean reset) {
|
||||
final boolean changeOnlyName = profile.getSkin() != null && !profile.getSkin().equalsIgnoreCase(player.getName());
|
||||
final String profileName = profile.getName() == null ? player.getName() : profile.getName();
|
||||
|
||||
final CraftPlayer craftPlayer = (CraftPlayer) player;
|
||||
final EntityPlayer entityPlayer = craftPlayer.getHandle();
|
||||
final GameProfile gameProfile = new GameProfile(player.getUniqueId(), profileName);
|
||||
|
||||
if (skinChange || changeOnlyName) {
|
||||
final ActionResult<MojangSkin> skinFetch = fetchSkinTextures(profile, reset);
|
||||
if (!skinFetch.isError()) {
|
||||
final MojangSkin skin = skinFetch.getResult();
|
||||
final PropertyMap properties = gameProfile.getProperties();
|
||||
properties.removeAll("textures");
|
||||
properties.put("textures", new Property("textures", skin.value(), skin.signature()));
|
||||
updateSelf(player);
|
||||
}
|
||||
}
|
||||
|
||||
final PacketPlayOutPlayerInfo remove = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.e, entityPlayer);
|
||||
final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a);
|
||||
|
||||
add.b().clear();
|
||||
add.b().add(new PacketPlayOutPlayerInfo.PlayerInfoData(gameProfile,
|
||||
player.getPing(),
|
||||
EnumGamemode.getById(player.getGameMode().ordinal()), IChatBaseComponent.a(profileName)));
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(online -> {
|
||||
EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle();
|
||||
onlineEntityPlayer.b.sendPacket(remove);
|
||||
onlineEntityPlayer.b.sendPacket(add);
|
||||
});
|
||||
updateOthers(player);
|
||||
return new ActionResult<>();
|
||||
}
|
||||
}
|
69
v1_14_R1/v1_14_R1.iml
Normal file
69
v1_14_R1/v1_14_R1.iml
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_17">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.14.4-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="module" module-name="core" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-config:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-event:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-protocol:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:brigadier:1.0.16-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.trove4j:core:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: se.llbit:jo-nbt:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:31.0.1-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.7.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:InvUI:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R1:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R2:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R3:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R4:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R5:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R6:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R7:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R8:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R9:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R10:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R11:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R12:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jetbrains:annotations:23.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.wesjd:anvilgui:1.6.3-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mariadb.jdbc:mariadb-java-client:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.waffle:waffle-jna:3.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:5.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:5.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:2.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsixface:yamlconfig:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.14.0-rc1" level="project" />
|
||||
</component>
|
||||
</module>
|
28
v1_15_R1/pom.xml
Normal file
28
v1_15_R1/pom.xml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>nicko-parent</artifactId>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>v1_15_R1</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
101
v1_15_R1/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java
Normal file
101
v1_15_R1/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
package net.artelnatif.nicko.impl;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import com.mojang.authlib.properties.PropertyMap;
|
||||
import net.artelnatif.nicko.disguise.ActionResult;
|
||||
import net.artelnatif.nicko.disguise.NickoProfile;
|
||||
import net.artelnatif.nicko.mojang.MojangSkin;
|
||||
import net.minecraft.network.chat.IChatBaseComponent;
|
||||
import net.minecraft.network.protocol.game.*;
|
||||
import net.minecraft.network.syncher.DataWatcher;
|
||||
import net.minecraft.network.syncher.DataWatcherObject;
|
||||
import net.minecraft.network.syncher.DataWatcherRegistry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.server.level.EntityPlayer;
|
||||
import net.minecraft.world.level.EnumGamemode;
|
||||
import net.minecraft.world.level.World;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
public class v1_17_R1 implements Internals {
|
||||
@Override
|
||||
public void updateSelf(Player player) {
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
final ResourceKey<World> levelResourceKey = entityPlayer.getWorld().getDimensionKey();
|
||||
final CraftWorld world = entityPlayer.getWorld().getWorld();
|
||||
final PacketPlayOutRespawn respawn = new PacketPlayOutRespawn(entityPlayer.getWorld().getDimensionManager(),
|
||||
levelResourceKey, world.getSeed(),
|
||||
entityPlayer.c.getGamemode(), entityPlayer.d.c(),
|
||||
false,
|
||||
false,
|
||||
false);
|
||||
|
||||
final boolean wasFlying = player.isFlying();
|
||||
entityPlayer.b.sendPacket(respawn);
|
||||
player.setFlying(wasFlying);
|
||||
player.teleport(player.getLocation(), PlayerTeleportEvent.TeleportCause.PLUGIN);
|
||||
player.updateInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOthers(Player player) {
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
final PacketPlayOutEntityDestroy destroy = new PacketPlayOutEntityDestroy(entityPlayer.getBukkitEntity().getEntityId());
|
||||
final PacketPlayOutNamedEntitySpawn spawn = new PacketPlayOutNamedEntitySpawn(entityPlayer);
|
||||
|
||||
final DataWatcher dataWatcher = entityPlayer.getDataWatcher();
|
||||
final DataWatcherObject<Byte> displayedSkinPartDataWatcher = new DataWatcherObject<>(17, DataWatcherRegistry.a);
|
||||
dataWatcher.set(displayedSkinPartDataWatcher, (byte) 0x7f);
|
||||
final PacketPlayOutEntityMetadata entityMetadata = new PacketPlayOutEntityMetadata(entityPlayer.getBukkitEntity().getEntityId(), dataWatcher, true);
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(online -> {
|
||||
EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle();
|
||||
if (onlineEntityPlayer.getBukkitEntity().getUniqueId() != player.getUniqueId()) {
|
||||
onlineEntityPlayer.b.sendPacket(destroy);
|
||||
onlineEntityPlayer.b.sendPacket(spawn);
|
||||
}
|
||||
onlineEntityPlayer.b.sendPacket(entityMetadata);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<Void> updateProfile(Player player, NickoProfile profile, boolean skinChange, boolean reset) {
|
||||
final boolean changeOnlyName = profile.getSkin() != null && !profile.getSkin().equalsIgnoreCase(player.getName());
|
||||
final String profileName = profile.getName() == null ? player.getName() : profile.getName();
|
||||
|
||||
final CraftPlayer craftPlayer = (CraftPlayer) player;
|
||||
final EntityPlayer entityPlayer = craftPlayer.getHandle();
|
||||
final GameProfile gameProfile = new GameProfile(player.getUniqueId(), profileName);
|
||||
|
||||
if (skinChange || changeOnlyName) {
|
||||
final ActionResult<MojangSkin> skinFetch = fetchSkinTextures(profile, reset);
|
||||
if (!skinFetch.isError()) {
|
||||
final MojangSkin skin = skinFetch.getResult();
|
||||
final PropertyMap properties = gameProfile.getProperties();
|
||||
properties.removeAll("textures");
|
||||
properties.put("textures", new Property("textures", skin.value(), skin.signature()));
|
||||
updateSelf(player);
|
||||
}
|
||||
}
|
||||
|
||||
final PacketPlayOutPlayerInfo remove = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.e, entityPlayer);
|
||||
final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a);
|
||||
|
||||
add.b().clear();
|
||||
add.b().add(new PacketPlayOutPlayerInfo.PlayerInfoData(gameProfile,
|
||||
player.getPing(),
|
||||
EnumGamemode.getById(player.getGameMode().ordinal()), IChatBaseComponent.a(profileName)));
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(online -> {
|
||||
EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle();
|
||||
onlineEntityPlayer.b.sendPacket(remove);
|
||||
onlineEntityPlayer.b.sendPacket(add);
|
||||
});
|
||||
updateOthers(player);
|
||||
return new ActionResult<>();
|
||||
}
|
||||
}
|
69
v1_15_R1/v1_15_R1.iml
Normal file
69
v1_15_R1/v1_15_R1.iml
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_17">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.15.2-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="module" module-name="core" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-config:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-event:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-protocol:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:brigadier:1.0.16-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.trove4j:core:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: se.llbit:jo-nbt:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:31.0.1-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.7.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:InvUI:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R1:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R2:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R3:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R4:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R5:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R6:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R7:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R8:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R9:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R10:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R11:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R12:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jetbrains:annotations:23.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.wesjd:anvilgui:1.6.3-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mariadb.jdbc:mariadb-java-client:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.waffle:waffle-jna:3.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:5.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:5.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:2.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsixface:yamlconfig:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.14.0-rc1" level="project" />
|
||||
</component>
|
||||
</module>
|
28
v1_16_R1/pom.xml
Normal file
28
v1_16_R1/pom.xml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>nicko-parent</artifactId>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>v1_16_R1</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.17.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
101
v1_16_R1/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java
Normal file
101
v1_16_R1/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
package net.artelnatif.nicko.impl;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import com.mojang.authlib.properties.PropertyMap;
|
||||
import net.artelnatif.nicko.disguise.ActionResult;
|
||||
import net.artelnatif.nicko.disguise.NickoProfile;
|
||||
import net.artelnatif.nicko.mojang.MojangSkin;
|
||||
import net.minecraft.network.chat.IChatBaseComponent;
|
||||
import net.minecraft.network.protocol.game.*;
|
||||
import net.minecraft.network.syncher.DataWatcher;
|
||||
import net.minecraft.network.syncher.DataWatcherObject;
|
||||
import net.minecraft.network.syncher.DataWatcherRegistry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.server.level.EntityPlayer;
|
||||
import net.minecraft.world.level.EnumGamemode;
|
||||
import net.minecraft.world.level.World;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
public class v1_17_R1 implements Internals {
|
||||
@Override
|
||||
public void updateSelf(Player player) {
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
final ResourceKey<World> levelResourceKey = entityPlayer.getWorld().getDimensionKey();
|
||||
final CraftWorld world = entityPlayer.getWorld().getWorld();
|
||||
final PacketPlayOutRespawn respawn = new PacketPlayOutRespawn(entityPlayer.getWorld().getDimensionManager(),
|
||||
levelResourceKey, world.getSeed(),
|
||||
entityPlayer.c.getGamemode(), entityPlayer.d.c(),
|
||||
false,
|
||||
false,
|
||||
false);
|
||||
|
||||
final boolean wasFlying = player.isFlying();
|
||||
entityPlayer.b.sendPacket(respawn);
|
||||
player.setFlying(wasFlying);
|
||||
player.teleport(player.getLocation(), PlayerTeleportEvent.TeleportCause.PLUGIN);
|
||||
player.updateInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOthers(Player player) {
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
final PacketPlayOutEntityDestroy destroy = new PacketPlayOutEntityDestroy(entityPlayer.getBukkitEntity().getEntityId());
|
||||
final PacketPlayOutNamedEntitySpawn spawn = new PacketPlayOutNamedEntitySpawn(entityPlayer);
|
||||
|
||||
final DataWatcher dataWatcher = entityPlayer.getDataWatcher();
|
||||
final DataWatcherObject<Byte> displayedSkinPartDataWatcher = new DataWatcherObject<>(17, DataWatcherRegistry.a);
|
||||
dataWatcher.set(displayedSkinPartDataWatcher, (byte) 0x7f);
|
||||
final PacketPlayOutEntityMetadata entityMetadata = new PacketPlayOutEntityMetadata(entityPlayer.getBukkitEntity().getEntityId(), dataWatcher, true);
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(online -> {
|
||||
EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle();
|
||||
if (onlineEntityPlayer.getBukkitEntity().getUniqueId() != player.getUniqueId()) {
|
||||
onlineEntityPlayer.b.sendPacket(destroy);
|
||||
onlineEntityPlayer.b.sendPacket(spawn);
|
||||
}
|
||||
onlineEntityPlayer.b.sendPacket(entityMetadata);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<Void> updateProfile(Player player, NickoProfile profile, boolean skinChange, boolean reset) {
|
||||
final boolean changeOnlyName = profile.getSkin() != null && !profile.getSkin().equalsIgnoreCase(player.getName());
|
||||
final String profileName = profile.getName() == null ? player.getName() : profile.getName();
|
||||
|
||||
final CraftPlayer craftPlayer = (CraftPlayer) player;
|
||||
final EntityPlayer entityPlayer = craftPlayer.getHandle();
|
||||
final GameProfile gameProfile = new GameProfile(player.getUniqueId(), profileName);
|
||||
|
||||
if (skinChange || changeOnlyName) {
|
||||
final ActionResult<MojangSkin> skinFetch = fetchSkinTextures(profile, reset);
|
||||
if (!skinFetch.isError()) {
|
||||
final MojangSkin skin = skinFetch.getResult();
|
||||
final PropertyMap properties = gameProfile.getProperties();
|
||||
properties.removeAll("textures");
|
||||
properties.put("textures", new Property("textures", skin.value(), skin.signature()));
|
||||
updateSelf(player);
|
||||
}
|
||||
}
|
||||
|
||||
final PacketPlayOutPlayerInfo remove = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.e, entityPlayer);
|
||||
final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a);
|
||||
|
||||
add.b().clear();
|
||||
add.b().add(new PacketPlayOutPlayerInfo.PlayerInfoData(gameProfile,
|
||||
player.getPing(),
|
||||
EnumGamemode.getById(player.getGameMode().ordinal()), IChatBaseComponent.a(profileName)));
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(online -> {
|
||||
EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle();
|
||||
onlineEntityPlayer.b.sendPacket(remove);
|
||||
onlineEntityPlayer.b.sendPacket(add);
|
||||
});
|
||||
updateOthers(player);
|
||||
return new ActionResult<>();
|
||||
}
|
||||
}
|
69
v1_16_R1/v1_16_R1.iml
Normal file
69
v1_16_R1/v1_16_R1.iml
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_17">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="module" module-name="core" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-config:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-event:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-protocol:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:brigadier:1.0.16-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.trove4j:core:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: se.llbit:jo-nbt:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:31.0.1-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.7.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:InvUI:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R1:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R2:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R3:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R4:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R5:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R6:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R7:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R8:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R9:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R10:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R11:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R12:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jetbrains:annotations:23.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.wesjd:anvilgui:1.6.3-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mariadb.jdbc:mariadb-java-client:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.waffle:waffle-jna:3.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:5.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:5.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:2.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsixface:yamlconfig:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.14.0-rc1" level="project" />
|
||||
</component>
|
||||
</module>
|
28
v1_16_R2/pom.xml
Normal file
28
v1_16_R2/pom.xml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>nicko-parent</artifactId>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>v1_16_R2</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
101
v1_16_R2/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java
Normal file
101
v1_16_R2/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
package net.artelnatif.nicko.impl;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import com.mojang.authlib.properties.PropertyMap;
|
||||
import net.artelnatif.nicko.disguise.ActionResult;
|
||||
import net.artelnatif.nicko.disguise.NickoProfile;
|
||||
import net.artelnatif.nicko.mojang.MojangSkin;
|
||||
import net.minecraft.network.chat.IChatBaseComponent;
|
||||
import net.minecraft.network.protocol.game.*;
|
||||
import net.minecraft.network.syncher.DataWatcher;
|
||||
import net.minecraft.network.syncher.DataWatcherObject;
|
||||
import net.minecraft.network.syncher.DataWatcherRegistry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.server.level.EntityPlayer;
|
||||
import net.minecraft.world.level.EnumGamemode;
|
||||
import net.minecraft.world.level.World;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
public class v1_17_R1 implements Internals {
|
||||
@Override
|
||||
public void updateSelf(Player player) {
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
final ResourceKey<World> levelResourceKey = entityPlayer.getWorld().getDimensionKey();
|
||||
final CraftWorld world = entityPlayer.getWorld().getWorld();
|
||||
final PacketPlayOutRespawn respawn = new PacketPlayOutRespawn(entityPlayer.getWorld().getDimensionManager(),
|
||||
levelResourceKey, world.getSeed(),
|
||||
entityPlayer.c.getGamemode(), entityPlayer.d.c(),
|
||||
false,
|
||||
false,
|
||||
false);
|
||||
|
||||
final boolean wasFlying = player.isFlying();
|
||||
entityPlayer.b.sendPacket(respawn);
|
||||
player.setFlying(wasFlying);
|
||||
player.teleport(player.getLocation(), PlayerTeleportEvent.TeleportCause.PLUGIN);
|
||||
player.updateInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOthers(Player player) {
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
final PacketPlayOutEntityDestroy destroy = new PacketPlayOutEntityDestroy(entityPlayer.getBukkitEntity().getEntityId());
|
||||
final PacketPlayOutNamedEntitySpawn spawn = new PacketPlayOutNamedEntitySpawn(entityPlayer);
|
||||
|
||||
final DataWatcher dataWatcher = entityPlayer.getDataWatcher();
|
||||
final DataWatcherObject<Byte> displayedSkinPartDataWatcher = new DataWatcherObject<>(17, DataWatcherRegistry.a);
|
||||
dataWatcher.set(displayedSkinPartDataWatcher, (byte) 0x7f);
|
||||
final PacketPlayOutEntityMetadata entityMetadata = new PacketPlayOutEntityMetadata(entityPlayer.getBukkitEntity().getEntityId(), dataWatcher, true);
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(online -> {
|
||||
EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle();
|
||||
if (onlineEntityPlayer.getBukkitEntity().getUniqueId() != player.getUniqueId()) {
|
||||
onlineEntityPlayer.b.sendPacket(destroy);
|
||||
onlineEntityPlayer.b.sendPacket(spawn);
|
||||
}
|
||||
onlineEntityPlayer.b.sendPacket(entityMetadata);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<Void> updateProfile(Player player, NickoProfile profile, boolean skinChange, boolean reset) {
|
||||
final boolean changeOnlyName = profile.getSkin() != null && !profile.getSkin().equalsIgnoreCase(player.getName());
|
||||
final String profileName = profile.getName() == null ? player.getName() : profile.getName();
|
||||
|
||||
final CraftPlayer craftPlayer = (CraftPlayer) player;
|
||||
final EntityPlayer entityPlayer = craftPlayer.getHandle();
|
||||
final GameProfile gameProfile = new GameProfile(player.getUniqueId(), profileName);
|
||||
|
||||
if (skinChange || changeOnlyName) {
|
||||
final ActionResult<MojangSkin> skinFetch = fetchSkinTextures(profile, reset);
|
||||
if (!skinFetch.isError()) {
|
||||
final MojangSkin skin = skinFetch.getResult();
|
||||
final PropertyMap properties = gameProfile.getProperties();
|
||||
properties.removeAll("textures");
|
||||
properties.put("textures", new Property("textures", skin.value(), skin.signature()));
|
||||
updateSelf(player);
|
||||
}
|
||||
}
|
||||
|
||||
final PacketPlayOutPlayerInfo remove = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.e, entityPlayer);
|
||||
final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a);
|
||||
|
||||
add.b().clear();
|
||||
add.b().add(new PacketPlayOutPlayerInfo.PlayerInfoData(gameProfile,
|
||||
player.getPing(),
|
||||
EnumGamemode.getById(player.getGameMode().ordinal()), IChatBaseComponent.a(profileName)));
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(online -> {
|
||||
EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle();
|
||||
onlineEntityPlayer.b.sendPacket(remove);
|
||||
onlineEntityPlayer.b.sendPacket(add);
|
||||
});
|
||||
updateOthers(player);
|
||||
return new ActionResult<>();
|
||||
}
|
||||
}
|
69
v1_16_R2/v1_16_R2.iml
Normal file
69
v1_16_R2/v1_16_R2.iml
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_17">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="module" module-name="core" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-config:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-event:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-protocol:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:brigadier:1.0.16-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.trove4j:core:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: se.llbit:jo-nbt:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:31.0.1-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.7.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:InvUI:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R1:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R2:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R3:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R4:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R5:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R6:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R7:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R8:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R9:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R10:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R11:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R12:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jetbrains:annotations:23.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.wesjd:anvilgui:1.6.3-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mariadb.jdbc:mariadb-java-client:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.waffle:waffle-jna:3.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:5.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:5.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:2.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsixface:yamlconfig:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.14.0-rc1" level="project" />
|
||||
</component>
|
||||
</module>
|
28
v1_16_R3/pom.xml
Normal file
28
v1_16_R3/pom.xml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>nicko-parent</artifactId>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>v1_16_R3</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.artelnatif</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
101
v1_16_R3/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java
Normal file
101
v1_16_R3/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
package net.artelnatif.nicko.impl;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import com.mojang.authlib.properties.PropertyMap;
|
||||
import net.artelnatif.nicko.disguise.ActionResult;
|
||||
import net.artelnatif.nicko.disguise.NickoProfile;
|
||||
import net.artelnatif.nicko.mojang.MojangSkin;
|
||||
import net.minecraft.network.chat.IChatBaseComponent;
|
||||
import net.minecraft.network.protocol.game.*;
|
||||
import net.minecraft.network.syncher.DataWatcher;
|
||||
import net.minecraft.network.syncher.DataWatcherObject;
|
||||
import net.minecraft.network.syncher.DataWatcherRegistry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.server.level.EntityPlayer;
|
||||
import net.minecraft.world.level.EnumGamemode;
|
||||
import net.minecraft.world.level.World;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
public class v1_17_R1 implements Internals {
|
||||
@Override
|
||||
public void updateSelf(Player player) {
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
final ResourceKey<World> levelResourceKey = entityPlayer.getWorld().getDimensionKey();
|
||||
final CraftWorld world = entityPlayer.getWorld().getWorld();
|
||||
final PacketPlayOutRespawn respawn = new PacketPlayOutRespawn(entityPlayer.getWorld().getDimensionManager(),
|
||||
levelResourceKey, world.getSeed(),
|
||||
entityPlayer.c.getGamemode(), entityPlayer.d.c(),
|
||||
false,
|
||||
false,
|
||||
false);
|
||||
|
||||
final boolean wasFlying = player.isFlying();
|
||||
entityPlayer.b.sendPacket(respawn);
|
||||
player.setFlying(wasFlying);
|
||||
player.teleport(player.getLocation(), PlayerTeleportEvent.TeleportCause.PLUGIN);
|
||||
player.updateInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOthers(Player player) {
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
final PacketPlayOutEntityDestroy destroy = new PacketPlayOutEntityDestroy(entityPlayer.getBukkitEntity().getEntityId());
|
||||
final PacketPlayOutNamedEntitySpawn spawn = new PacketPlayOutNamedEntitySpawn(entityPlayer);
|
||||
|
||||
final DataWatcher dataWatcher = entityPlayer.getDataWatcher();
|
||||
final DataWatcherObject<Byte> displayedSkinPartDataWatcher = new DataWatcherObject<>(17, DataWatcherRegistry.a);
|
||||
dataWatcher.set(displayedSkinPartDataWatcher, (byte) 0x7f);
|
||||
final PacketPlayOutEntityMetadata entityMetadata = new PacketPlayOutEntityMetadata(entityPlayer.getBukkitEntity().getEntityId(), dataWatcher, true);
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(online -> {
|
||||
EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle();
|
||||
if (onlineEntityPlayer.getBukkitEntity().getUniqueId() != player.getUniqueId()) {
|
||||
onlineEntityPlayer.b.sendPacket(destroy);
|
||||
onlineEntityPlayer.b.sendPacket(spawn);
|
||||
}
|
||||
onlineEntityPlayer.b.sendPacket(entityMetadata);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<Void> updateProfile(Player player, NickoProfile profile, boolean skinChange, boolean reset) {
|
||||
final boolean changeOnlyName = profile.getSkin() != null && !profile.getSkin().equalsIgnoreCase(player.getName());
|
||||
final String profileName = profile.getName() == null ? player.getName() : profile.getName();
|
||||
|
||||
final CraftPlayer craftPlayer = (CraftPlayer) player;
|
||||
final EntityPlayer entityPlayer = craftPlayer.getHandle();
|
||||
final GameProfile gameProfile = new GameProfile(player.getUniqueId(), profileName);
|
||||
|
||||
if (skinChange || changeOnlyName) {
|
||||
final ActionResult<MojangSkin> skinFetch = fetchSkinTextures(profile, reset);
|
||||
if (!skinFetch.isError()) {
|
||||
final MojangSkin skin = skinFetch.getResult();
|
||||
final PropertyMap properties = gameProfile.getProperties();
|
||||
properties.removeAll("textures");
|
||||
properties.put("textures", new Property("textures", skin.value(), skin.signature()));
|
||||
updateSelf(player);
|
||||
}
|
||||
}
|
||||
|
||||
final PacketPlayOutPlayerInfo remove = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.e, entityPlayer);
|
||||
final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a);
|
||||
|
||||
add.b().clear();
|
||||
add.b().add(new PacketPlayOutPlayerInfo.PlayerInfoData(gameProfile,
|
||||
player.getPing(),
|
||||
EnumGamemode.getById(player.getGameMode().ordinal()), IChatBaseComponent.a(profileName)));
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(online -> {
|
||||
EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle();
|
||||
onlineEntityPlayer.b.sendPacket(remove);
|
||||
onlineEntityPlayer.b.sendPacket(add);
|
||||
});
|
||||
updateOthers(player);
|
||||
return new ActionResult<>();
|
||||
}
|
||||
}
|
69
v1_16_R3/v1_16_R3.iml
Normal file
69
v1_16_R3/v1_16_R3.iml
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_17">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="module" module-name="core" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-config:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-event:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-protocol:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:brigadier:1.0.16-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.trove4j:core:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: se.llbit:jo-nbt:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.72.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:31.0.1-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.7.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:InvUI:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R1:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R2:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R3:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R4:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R5:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R6:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R7:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R8:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R9:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R10:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R11:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.studiocode.invui:IA-R12:0.10.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jetbrains:annotations:23.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.wesjd:anvilgui:1.6.3-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mariadb.jdbc:mariadb-java-client:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.waffle:waffle-jna:3.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:5.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:5.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:2.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsixface:yamlconfig:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.14.0-rc1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.14.0-rc1" level="project" />
|
||||
</component>
|
||||
</module>
|
|
@ -13,6 +13,44 @@
|
|||
<artifactId>v1_19_R2</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>specialsource-maven-plugin</artifactId>
|
||||
<version>1.2.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>remap</goal>
|
||||
</goals>
|
||||
<id>remap-obf</id>
|
||||
<configuration>
|
||||
<srgIn>org.spigotmc:minecraft-server:1.19.3-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
|
||||
<reverse>true</reverse>
|
||||
<remappedDependencies>org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
|
||||
<remappedArtifactAttached>true</remappedArtifactAttached>
|
||||
<remappedClassifierName>remapped-obf</remappedClassifierName>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>remap</goal>
|
||||
</goals>
|
||||
<id>remap-spigot</id>
|
||||
<configuration>
|
||||
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
|
||||
<srgIn>org.spigotmc:minecraft-server:1.19.3-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
|
||||
<remappedDependencies>org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
|
|
Loading…
Reference in a new issue