mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-02 02:11:21 +01:00
Merge branch 'Auxilor:master' into master
This commit is contained in:
commit
6d535696f3
@ -3,7 +3,7 @@ version rootProject.version
|
|||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.willfp:libreforge:3.57.2'
|
implementation 'com.willfp:libreforge:3.59.0'
|
||||||
implementation 'org.joml:joml:1.10.4'
|
implementation 'org.joml:joml:1.10.4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
6
eco-core/core-nms/v1_19_R1/build.gradle
Normal file
6
eco-core/core-nms/v1_19_R1/build.gradle
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
group 'com.willfp'
|
||||||
|
version rootProject.version
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly 'org.spigotmc:spigot:1.19-R0.1-SNAPSHOT'
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.willfp.ecoenchants.proxy.v1_19_R1;
|
||||||
|
|
||||||
|
import com.willfp.ecoenchants.enchantments.support.vanilla.VanillaEnchantmentMetadata;
|
||||||
|
import com.willfp.ecoenchants.enchantments.support.vanilla.VanillaEnchantments;
|
||||||
|
import com.willfp.ecoenchants.proxy.proxies.EcoCraftEnchantmentManagerProxy;
|
||||||
|
import com.willfp.ecoenchants.proxy.v1_19_R1.enchants.EcoCraftEnchantment;
|
||||||
|
import net.minecraft.core.IRegistry;
|
||||||
|
import net.minecraft.world.item.enchantment.Enchantment;
|
||||||
|
import org.bukkit.NamespacedKey;
|
||||||
|
import org.bukkit.craftbukkit.v1_19_R1.util.CraftNamespacedKey;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public final class EcoCraftEnchantmentManager implements EcoCraftEnchantmentManagerProxy {
|
||||||
|
@Override
|
||||||
|
public void registerNewCraftEnchantments() {
|
||||||
|
Map<org.bukkit.enchantments.Enchantment, VanillaEnchantmentMetadata> metadataMap = VanillaEnchantments.getMetadataMap();
|
||||||
|
|
||||||
|
for (Enchantment enchantment : IRegistry.W) {
|
||||||
|
NamespacedKey key = CraftNamespacedKey.fromMinecraft(IRegistry.W.b(enchantment));
|
||||||
|
VanillaEnchantmentMetadata metadata = metadataMap.get(org.bukkit.enchantments.Enchantment.getByKey(key));
|
||||||
|
new EcoCraftEnchantment(enchantment, metadata).register();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.willfp.ecoenchants.proxy.v1_19_R1;
|
||||||
|
|
||||||
|
import com.willfp.ecoenchants.proxy.proxies.OpenInventoryProxy;
|
||||||
|
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
public final class OpenInventory implements OpenInventoryProxy {
|
||||||
|
@Override
|
||||||
|
public Object getOpenInventory(@NotNull final Player player) {
|
||||||
|
return ((CraftPlayer) player).getHandle().bU;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.willfp.ecoenchants.proxy.v1_19_R1.enchants;
|
||||||
|
|
||||||
|
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||||
|
import com.willfp.ecoenchants.enchantments.support.vanilla.VanillaEnchantmentMetadata;
|
||||||
|
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
|
||||||
|
import net.minecraft.world.item.enchantment.Enchantment;
|
||||||
|
import org.bukkit.craftbukkit.v1_19_R1.enchantments.CraftEnchantment;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
public class EcoCraftEnchantment extends CraftEnchantment {
|
||||||
|
private final VanillaEnchantmentMetadata metadata;
|
||||||
|
|
||||||
|
public EcoCraftEnchantment(@NotNull final Enchantment target,
|
||||||
|
@NotNull final VanillaEnchantmentMetadata metadata) {
|
||||||
|
super(target);
|
||||||
|
this.metadata = metadata;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxLevel() {
|
||||||
|
return metadata.maxLevel() == null ? this.getHandle().a() : metadata.maxLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean conflictsWith(@NotNull final org.bukkit.enchantments.Enchantment other) {
|
||||||
|
if (other instanceof EcoEnchant) {
|
||||||
|
return other.conflictsWith(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return metadata.conflicts() == null ? super.conflictsWith(other) : metadata.conflicts().contains(other.getKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void register() {
|
||||||
|
EnchantmentUtils.register(this);
|
||||||
|
}
|
||||||
|
}
|
@ -196,7 +196,10 @@ public class EnchantDisplay extends DisplayModule {
|
|||||||
}
|
}
|
||||||
lore.addAll(requirementLore);
|
lore.addAll(requirementLore);
|
||||||
|
|
||||||
fastItemStack.setLore(lore);
|
if (!lore.isEmpty()) {
|
||||||
|
fastItemStack.setLore(lore);
|
||||||
|
}
|
||||||
|
|
||||||
if (itemStack.getType() == Material.ENCHANTED_BOOK) {
|
if (itemStack.getType() == Material.ENCHANTED_BOOK) {
|
||||||
fastItemStack.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_POTION_EFFECTS);
|
fastItemStack.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_POTION_EFFECTS);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#libreforge-updater
|
#libreforge-updater
|
||||||
#Mon Jun 06 13:29:23 BST 2022
|
#Wed Jun 08 21:06:00 BST 2022
|
||||||
version=8.79.3
|
version=8.81.0
|
||||||
plugin-name=EcoEnchants
|
plugin-name=EcoEnchants
|
||||||
|
@ -6,6 +6,7 @@ include ':eco-core:core-nms'
|
|||||||
include ':eco-core:core-nms:v1_17_R1'
|
include ':eco-core:core-nms:v1_17_R1'
|
||||||
include ':eco-core:core-nms:v1_18_R1'
|
include ':eco-core:core-nms:v1_18_R1'
|
||||||
include ':eco-core:core-nms:v1_18_R2'
|
include ':eco-core:core-nms:v1_18_R2'
|
||||||
|
include ':eco-core:core-nms:v1_19_R1'
|
||||||
include ':eco-core:core-proxy'
|
include ':eco-core:core-proxy'
|
||||||
include ':eco-core:core-plugin'
|
include ':eco-core:core-plugin'
|
||||||
include ':eco-core:core-stub'
|
include ':eco-core:core-stub'
|
||||||
|
Loading…
Reference in New Issue
Block a user