build: fix misconfigured submodule NMS/NMS-v1_21_0

This commit is contained in:
Christian Koop 2024-09-06 11:20:48 +02:00
parent cb25ddd7a1
commit fb1b3197a2
No known key found for this signature in database
GPG Key ID: 6A4A09E8ED946113
6 changed files with 37 additions and 7 deletions

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.craftaro</groupId>
<artifactId>CraftaroCore-Modules</artifactId>
<version>3.3.0-SNAPSHOT</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>CraftaroCore-NMS-v1_21_0</artifactId>

View File

@ -21,6 +21,7 @@ public class NmsImplementationsImpl implements NmsImplementations {
private final NmsWorldBorder worldBorder;
private final com.craftaro.core.nms.anvil.AnvilCore anvil;
private final NBTCore nbt;
private final NmsItem item;
public NmsImplementationsImpl() {
this.entity = new NmsEntityImpl();
@ -29,6 +30,7 @@ public class NmsImplementationsImpl implements NmsImplementations {
this.worldBorder = new NmsWorldBorderImpl();
this.anvil = new AnvilCore();
this.nbt = new NBTCoreImpl();
this.item = new NmsItemImpl();
}
@Override
@ -60,4 +62,9 @@ public class NmsImplementationsImpl implements NmsImplementations {
public @NotNull NBTCore getNbt() {
return this.nbt;
}
@Override
public @NotNull NmsItem getItem() {
return this.item;
}
}

View File

@ -0,0 +1,21 @@
package com.craftaro.core.nms.v1_21_0.item;
import com.craftaro.core.nms.item.NmsItem;
import net.minecraft.util.RandomSource;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import org.bukkit.craftbukkit.v1_21_R1.CraftRegistry;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;
import java.util.Optional;
public class NmsItemImpl implements NmsItem {
private final RandomSource randomSource = RandomSource.createNewThreadLocalInstance();
@Override
public ItemStack copyAndApplyRandomEnchantment(ItemStack item, int level) {
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
EnchantmentHelper.enchantItem(this.randomSource, nmsItem, level, CraftRegistry.getMinecraftRegistry(), Optional.empty());
return CraftItemStack.asBukkitCopy(nmsItem);
}
}

View File

@ -62,6 +62,13 @@
</build>
<dependencies>
<dependency>
<version>${project.version}</version>
<artifactId>CraftaroCore-NMS-v1_21_0</artifactId>
<groupId>${project.groupId}</groupId>
<scope>compile</scope>
</dependency>
<!--suppress VulnerableLibrariesLocal -->
<dependency>
<groupId>org.spigotmc</groupId>

View File

@ -28,12 +28,6 @@
<groupId>${project.groupId}</groupId>
<scope>compile</scope>
</dependency>
<dependency>
<version>${project.version}</version>
<artifactId>CraftaroCore-NMS-v1_21_0</artifactId>
<groupId>${project.groupId}</groupId>
<scope>compile</scope>
</dependency>
<dependency>
<version>${project.version}</version>
<artifactId>CraftaroCore-NMS-v1_20_R4</artifactId>

View File

@ -27,6 +27,7 @@
<module>NMS/NMS</module>
<module>NMS/NMS-API</module>
<module>NMS/NMS-v1_21_R1</module>
<module>NMS/NMS-v1_21_0</module>
<module>NMS/NMS-v1_20_R4</module>
<module>NMS/NMS-v1_20_R3</module>
<module>NMS/NMS-v1_20_R2</module>