Skip to content

Commit

Permalink
Fixed FallingColors#541, allow MediaHolderItems to specify their cons…
Browse files Browse the repository at this point in the history
…umptionPriority.
  • Loading branch information
Talia-12 authored and Master-Bw3 committed Aug 29, 2024
1 parent b140b10 commit fa21dc8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package at.petrak.hexcasting.api.item;

import at.petrak.hexcasting.api.addldata.ADMediaHolder;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.ApiStatus;

Expand Down Expand Up @@ -59,4 +60,8 @@ default long insertMedia(ItemStack stack, long amount, boolean simulate) {
}
return inserting;
}

default int getConsumptionPriority(ItemStack stack) {
return ADMediaHolder.BATTERY_PRIORITY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public boolean canProvide() {

@Override
public int getConsumptionPriority() {
return ADMediaHolder.BATTERY_PRIORITY;
return this.mediaHolder.getConsumptionPriority(this.stack);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public boolean canProvide() {

@Override
public int getConsumptionPriority() {
return ADMediaHolder.BATTERY_PRIORITY;
return holder.getConsumptionPriority(stack);
}

@Override
Expand Down

0 comments on commit fa21dc8

Please sign in to comment.