Skip to content

Commit

Permalink
Fix #4485, ##4468
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Dec 17, 2023
1 parent 3836d7d commit 532cfb1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ public static boolean doesBackpackHaveItems(ItemStack stack) {
return false;
}

@Override
public boolean canEquipZeta(ItemStack stack, EquipmentSlot equipmentSlot, Entity ent) {
return equipmentSlot == EquipmentSlot.CHEST;
}

@Override
public boolean isBookEnchantableZeta(ItemStack stack, ItemStack book) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public TinyPotatoBlockItem(Block block, Properties properties) {
}

@Override
public boolean canEquipZeta(ItemStack stack, EquipmentSlot armorType, Entity entity) {
return armorType == EquipmentSlot.HEAD &&
public boolean canEquipZeta(ItemStack stack, EquipmentSlot equipmentSlot, Entity entity) {
return equipmentSlot == EquipmentSlot.HEAD &&
(entity instanceof Player player && ContributorRewardHandler.getTier(player) > 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ public boolean doesConditionApply() {
return true;
}

@Override
public boolean canEquipZeta(ItemStack stack, EquipmentSlot equipmentSlot, Entity ent) {
return equipmentSlot == EquipmentSlot.HEAD;
}

@Override
public String getArmorTextureZeta(ItemStack stack, Entity entity, EquipmentSlot slot, String type) {
return TEXTURE;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package org.violetmoon.zeta.item.ext;

import java.util.Map;
import java.util.function.Consumer;

import net.minecraft.core.BlockPos;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.Entity;
Expand All @@ -23,6 +20,9 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Map;
import java.util.function.Consumer;

@SuppressWarnings("deprecation") //forge ext
public interface IZetaItemExtensions {

Expand All @@ -42,7 +42,7 @@ default boolean doesSneakBypassUseZeta(ItemStack stack, LevelReader level, Block
return false;
}

default boolean canEquipZeta(ItemStack stack, EquipmentSlot armorType, Entity ent) {
default boolean canEquipZeta(ItemStack stack, EquipmentSlot equipmentSlot, Entity ent) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package org.violetmoon.zetaimplforge.mixin.self;

import java.util.Map;
import java.util.function.Consumer;

import net.minecraft.core.BlockPos;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.Entity;
Expand All @@ -28,6 +25,9 @@
import org.violetmoon.zeta.item.ZetaItem;
import org.violetmoon.zeta.item.ext.IZetaItemExtensions;

import java.util.Map;
import java.util.function.Consumer;

// Forge can't actually mixin to interfaces, so we fake it by just... mixing in to everyone inheriting the interface.
@Mixin({
ZetaArmorItem.class,
Expand Down Expand Up @@ -57,8 +57,8 @@ public boolean doesSneakBypassUse(ItemStack stack, LevelReader level, BlockPos p
}

@Override
public boolean canEquip(ItemStack stack, EquipmentSlot armorType, Entity entity) {
return canEquipZeta(stack, armorType, entity);
public boolean canEquip(ItemStack stack, EquipmentSlot equipmentSlot, Entity entity) {
return canEquipZeta(stack, equipmentSlot, entity);
}

@Override
Expand Down

0 comments on commit 532cfb1

Please sign in to comment.