Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to MC 1.19.1 - 1.19.3 #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<version>1.19.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_10_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_11_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_12_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_13_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_13_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_14_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_15_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_16_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_16_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_16_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_17_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion craftbukkit_1_18_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<build>
<plugins>
Expand Down
4 changes: 2 additions & 2 deletions craftbukkit_1_18_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.10</version>
<version>3.0.11</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
63 changes: 63 additions & 0 deletions craftbukkit_1_19_R1/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>de.erethon</groupId>
<artifactId>headlib-craftbukkit_1_19_R1</artifactId>
<version>${project.parent.version}</version>
<packaging>jar</packaging>
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.11</version>
</parent>
<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.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.19.2-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.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
<dependency>
<groupId>de.erethon</groupId>
<artifactId>headlib-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
85 changes: 85 additions & 0 deletions craftbukkit_1_19_R1/src/main/java/de/erethon/headlib/v1_19_R1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Written from 2018-2022 by Daniel Saukel
*
* To the extent possible under law, the author(s) have dedicated all
* copyright and related and neighboring rights to this software
* to the public domain worldwide.
*
* This software is distributed without any warranty.
*
* You should have received a copy of the CC0 Public Domain Dedication
* along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
package de.erethon.headlib;

import de.erethon.headlib.HeadLib.InternalsProvider;
import java.util.UUID;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.Tag;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;

/**
* @author Daniel Saukel
*/
class v1_19_R1 implements InternalsProvider {

@Override
public ItemStack newPlayerHead(int amount) {
return new ItemStack(Material.PLAYER_HEAD, amount);
}

@Override
public String getTextureValue(ItemStack item) {
net.minecraft.world.item.ItemStack nmsStack = CraftItemStack.asNMSCopy(item);

CompoundTag tag = nmsStack.getTag();
if (tag == null) {
return null;
}

CompoundTag skullOwner = tag.getCompound("SkullOwner");
if (skullOwner == null) {
return null;
}
CompoundTag properties = skullOwner.getCompound("Properties");
if (properties == null) {
return null;
}
ListTag textures = properties.getList("textures", 10);
if (textures == null) {
return null;
}

for (Tag base : textures) {
if (base instanceof CompoundTag && ((CompoundTag) base).contains("Value", 8)) {
return ((CompoundTag) base).getString("Value");
}
}
return null;
}

@Override
public ItemStack setSkullOwner(ItemStack item, Object compound) {
net.minecraft.world.item.ItemStack nmsStack = CraftItemStack.asNMSCopy(item);
nmsStack.getOrCreateTag().put("SkullOwner", (Tag) compound);
return CraftItemStack.asBukkitCopy(nmsStack);
}

@Override
public CompoundTag createOwnerCompound(String id, String textureValue) {
CompoundTag skullOwner = new CompoundTag();
skullOwner.putUUID("Id", UUID.fromString(id));
CompoundTag properties = new CompoundTag();
ListTag textures = new ListTag();
CompoundTag value = new CompoundTag();
value.putString("Value", textureValue);
textures.add(value);
properties.put("textures", textures);
skullOwner.put("Properties", properties);
return skullOwner;
}

}
63 changes: 63 additions & 0 deletions craftbukkit_1_19_R2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>de.erethon</groupId>
<artifactId>headlib-craftbukkit_1_19_R2</artifactId>
<version>${project.parent.version}</version>
<packaging>jar</packaging>
<parent>
<groupId>de.erethon</groupId>
<artifactId>headlib-parent</artifactId>
<version>3.0.11</version>
</parent>
<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>
<artifactId>spigot</artifactId>
<version>1.19.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
<dependency>
<groupId>de.erethon</groupId>
<artifactId>headlib-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
Loading