mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-25 11:35:34 +01:00
build: fix misconfigured submodule NMS/NMS-v1_21_0
This commit is contained in:
parent
cb25ddd7a1
commit
fb1b3197a2
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user