remove enchantment for a bit since it requires a bunch of changes

closes #371
This commit is contained in:
Ell 2024-11-04 22:18:45 +01:00
parent b3701fbada
commit 70995f4388
3 changed files with 8 additions and 10 deletions

View file

@ -1,4 +1,4 @@
package de.ellpeck.naturesaura.enchant; /*package de.ellpeck.naturesaura.enchant;
import net.minecraft.core.Holder; import net.minecraft.core.Holder;
import net.minecraft.server.ReloadableServerRegistries; import net.minecraft.server.ReloadableServerRegistries;
@ -8,4 +8,4 @@ public final class ModEnchantments {
public static Holder<Enchantment> AURA_MENDING; public static Holder<Enchantment> AURA_MENDING;
} }*/

View file

@ -2,15 +2,12 @@ package de.ellpeck.naturesaura.items;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis; import com.mojang.math.Axis;
import de.ellpeck.naturesaura.Helper;
import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.NaturesAuraAPI;
import de.ellpeck.naturesaura.api.render.ITrinketItem; import de.ellpeck.naturesaura.api.render.ITrinketItem;
import de.ellpeck.naturesaura.enchant.ModEnchantments;
import de.ellpeck.naturesaura.reg.ICustomCreativeTab; import de.ellpeck.naturesaura.reg.ICustomCreativeTab;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.core.Holder;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
@ -41,12 +38,14 @@ public class ItemAuraCache extends ItemImpl implements ITrinketItem, ICustomCrea
if (recharge != null) { if (recharge != null) {
if (recharge.rechargeFromContainer(container, itemSlot, i, player.getInventory().selected == i)) if (recharge.rechargeFromContainer(container, itemSlot, i, player.getInventory().selected == i))
break; break;
} else if (stack.getEnchantmentLevel(ModEnchantments.AURA_MENDING) > 0) { }
// TODO fix enchantments, https://gist.github.com/ChampionAsh5357/d895a7b1a34341e19c80870720f9880f#the-enchantment-datapack-object
/*else if (stack.getEnchantmentLevel(ModEnchantments.AURA_MENDING) > 0) {
var mainSize = player.getInventory().items.size(); var mainSize = player.getInventory().items.size();
var isArmor = i >= mainSize && i < mainSize + player.getInventory().armor.size(); var isArmor = i >= mainSize && i < mainSize + player.getInventory().armor.size();
if ((isArmor || player.getInventory().selected == i) && Helper.rechargeAuraItem(stack, container, 1000)) if ((isArmor || player.getInventory().selected == i) && Helper.rechargeAuraItem(stack, container, 1000))
break; break;
} }*/
} }
} }

View file

@ -12,7 +12,6 @@ import de.ellpeck.naturesaura.blocks.tiles.BlockEntityImpl;
import de.ellpeck.naturesaura.blocks.tiles.ModBlockEntities; import de.ellpeck.naturesaura.blocks.tiles.ModBlockEntities;
import de.ellpeck.naturesaura.compat.Compat; import de.ellpeck.naturesaura.compat.Compat;
import de.ellpeck.naturesaura.compat.patchouli.PatchouliCompat; import de.ellpeck.naturesaura.compat.patchouli.PatchouliCompat;
import de.ellpeck.naturesaura.enchant.ModEnchantments;
import de.ellpeck.naturesaura.entities.*; import de.ellpeck.naturesaura.entities.*;
import de.ellpeck.naturesaura.gen.LevelGenAncientTree; import de.ellpeck.naturesaura.gen.LevelGenAncientTree;
import de.ellpeck.naturesaura.gen.LevelGenAuraBloom; import de.ellpeck.naturesaura.gen.LevelGenAuraBloom;
@ -273,7 +272,7 @@ public final class ModRegistry {
Helper.populateObjectHolders(ModContainers.class, event.getRegistry(), false); Helper.populateObjectHolders(ModContainers.class, event.getRegistry(), false);
}); });
event.register(Registries.ENCHANTMENT, h -> { /* event.register(Registries.ENCHANTMENT, h -> {
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "aura_mending"), Enchantment.enchantment( h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "aura_mending"), Enchantment.enchantment(
Enchantment.definition( Enchantment.definition(
HolderSet.direct(BuiltInRegistries.ITEM.holders().filter(i -> new ItemStack(i).getCapability(NaturesAuraAPI.AURA_RECHARGE_CAPABILITY) == null).toList()), HolderSet.direct(BuiltInRegistries.ITEM.holders().filter(i -> new ItemStack(i).getCapability(NaturesAuraAPI.AURA_RECHARGE_CAPABILITY) == null).toList()),
@ -281,7 +280,7 @@ public final class ModRegistry {
5, 1, Enchantment.dynamicCost(5, 8), Enchantment.dynamicCost(55, 8), 2, EquipmentSlotGroup.ANY) 5, 1, Enchantment.dynamicCost(5, 8), Enchantment.dynamicCost(55, 8), 2, EquipmentSlotGroup.ANY)
).build(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "aura_mending"))); ).build(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "aura_mending")));
Helper.populateObjectHolders(ModEnchantments.class, event.getRegistry(), true); Helper.populateObjectHolders(ModEnchantments.class, event.getRegistry(), true);
}); });*/
event.register(Registries.ENTITY_TYPE, h -> { event.register(Registries.ENTITY_TYPE, h -> {
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "mover_cart"), EntityType.Builder h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "mover_cart"), EntityType.Builder