Skip to content

Commit 91fcc7b

Browse files
committed
Fixed evo stone armor effects working without having full set on.
1 parent 95bf68d commit 91fcc7b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

common/src/main/java/generations/gg/generations/core/generationscore/common/compat/rei/DefaultRksShapelessDisplay.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public class DefaultRksShapelessDisplay extends DefaultRksMachineRecipeDisplay<RecipeHolder<ShapelessRksRecipe>> {
1212
public DefaultRksShapelessDisplay(RecipeHolder<ShapelessRksRecipe> rksRecipe) {
1313
super(
14-
rksRecipe.value().getRksIngredients().stream().map(a -> EntryIngredients.of().ofItemStacks(a.matchingStacks())).toList(),
14+
rksRecipe.value().getRksIngredients().stream().map(a -> EntryIngredients.ofItemStacks(a.matchingStacks())).toList(),
1515
Collections.singletonList(EntryIngredients.of(rksRecipe.value().getResultItem(BasicDisplay.registryAccess()))),
1616
Optional.of(rksRecipe),
1717
rksRecipe.value().getProcessingTime()

common/src/main/java/generations/gg/generations/core/generationscore/common/world/item/armor/ArmorTickEffect.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ interface ArmorTickEffect : ArmorEffect {
2020

2121
companion object {
2222
fun isWearingFullSet(player: LivingEntity, material: Holder<ArmorMaterial>): Boolean {
23-
for (equipmentSlot in EquipmentSlot.entries) {
24-
if (equipmentSlot.type == EquipmentSlot.Type.HAND) continue
23+
val requiredSlots = listOf(
24+
EquipmentSlot.HEAD,
25+
EquipmentSlot.CHEST,
26+
EquipmentSlot.LEGS,
27+
EquipmentSlot.FEET
28+
)
2529

26-
val equippedItemStack = player.getItemBySlot(equipmentSlot)
27-
if (equippedItemStack.item !is ArmorItem) return false
28-
if ((equippedItemStack.item as ArmorItem).material.`is`(material::`is`)) return false
30+
for (slot in requiredSlots) {
31+
val stack = player.getItemBySlot(slot)
32+
val item = stack.item as? ArmorItem ?: return false
33+
if (!item.material.`is`(material)) return false
2934
}
3035

3136
return true
32-
// var event = new ItemEvents.EquipFullArmorSet(player, material); TODO: EIther find or PR equivalent event to arch
33-
// MinecraftForge.EVENT_BUS.post(event);
34-
// return event.isCanceled();
3537
}
3638
}
3739
}

0 commit comments

Comments
 (0)