Skip to content

Commit

Permalink
remove enchantment for a bit since it requires a bunch of changes
Browse files Browse the repository at this point in the history
closes #371
  • Loading branch information
Ellpeck committed Nov 4, 2024
1 parent b3701fb commit 70995f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.ellpeck.naturesaura.enchant;
/*package de.ellpeck.naturesaura.enchant;
import net.minecraft.core.Holder;
import net.minecraft.server.ReloadableServerRegistries;
Expand All @@ -8,4 +8,4 @@ public final class ModEnchantments {
public static Holder<Enchantment> AURA_MENDING;
}
}*/
9 changes: 4 additions & 5 deletions src/main/java/de/ellpeck/naturesaura/items/ItemAuraCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis;
import de.ellpeck.naturesaura.Helper;
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
import de.ellpeck.naturesaura.api.render.ITrinketItem;
import de.ellpeck.naturesaura.enchant.ModEnchantments;
import de.ellpeck.naturesaura.reg.ICustomCreativeTab;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.core.Holder;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.player.Player;
Expand Down Expand Up @@ -41,12 +38,14 @@ public void inventoryTick(ItemStack stackIn, Level levelIn, Entity entityIn, int
if (recharge != null) {
if (recharge.rechargeFromContainer(container, itemSlot, i, player.getInventory().selected == i))
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 isArmor = i >= mainSize && i < mainSize + player.getInventory().armor.size();
if ((isArmor || player.getInventory().selected == i) && Helper.rechargeAuraItem(stack, container, 1000))
break;
}
}*/
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import de.ellpeck.naturesaura.blocks.tiles.ModBlockEntities;
import de.ellpeck.naturesaura.compat.Compat;
import de.ellpeck.naturesaura.compat.patchouli.PatchouliCompat;
import de.ellpeck.naturesaura.enchant.ModEnchantments;
import de.ellpeck.naturesaura.entities.*;
import de.ellpeck.naturesaura.gen.LevelGenAncientTree;
import de.ellpeck.naturesaura.gen.LevelGenAuraBloom;
Expand Down Expand Up @@ -273,15 +272,15 @@ public static void register(RegisterEvent event) {
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(
Enchantment.definition(
HolderSet.direct(BuiltInRegistries.ITEM.holders().filter(i -> new ItemStack(i).getCapability(NaturesAuraAPI.AURA_RECHARGE_CAPABILITY) == null).toList()),
// same values as unbreaking, except for the max level
5, 1, Enchantment.dynamicCost(5, 8), Enchantment.dynamicCost(55, 8), 2, EquipmentSlotGroup.ANY)
).build(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "aura_mending")));
Helper.populateObjectHolders(ModEnchantments.class, event.getRegistry(), true);
});
});*/

event.register(Registries.ENTITY_TYPE, h -> {
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "mover_cart"), EntityType.Builder
Expand Down

1 comment on commit 70995f4

@12snooper12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this on my server with 41.4 and it solved the disconnects. Thanks for fixing, awesome mod :)

Please sign in to comment.