Skip to content

Commit

Permalink
Remove outdated Malum compat for Ring of Magnetization (#4693)
Browse files Browse the repository at this point in the history
The recently released Malum v1.6 does not include a "spirit_reach" attribute, causing a crash when viewing the tooltip of Rings of Magnetization with Malum installed.
(likely fix for SammySemicolon/Malum-Mod#248 and SammySemicolon/Malum-Mod#253)

Signed-off-by: unilock <[email protected]>
  • Loading branch information
unilock authored Jun 29, 2024
1 parent 15b8b4f commit 962559f
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@
*/
package vazkii.botania.common.item.equipment.bauble;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;

import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
Expand Down Expand Up @@ -57,17 +50,6 @@ public static void onTossItem(Player player) {
}
}

@Override
public Multimap<Attribute, AttributeModifier> getEquippedAttributeModifiers(ItemStack stack) {
if (XplatAbstractions.INSTANCE.isModLoaded("malum")) {
Multimap<Attribute, AttributeModifier> attributes = HashMultimap.create();
attributes.put(BuiltInRegistries.ATTRIBUTE.get(new ResourceLocation("malum", "spirit_reach")),
new AttributeModifier(getBaubleUUID(stack), "Magnet Ring reach boost", 0.5, AttributeModifier.Operation.MULTIPLY_BASE));
return attributes;
}
return super.getEquippedAttributeModifiers(stack);
}

@Override
public void onWornTick(ItemStack stack, LivingEntity living) {
super.onWornTick(stack, living);
Expand Down

0 comments on commit 962559f

Please sign in to comment.