2020-04-17 17:18:25 +02:00
|
|
|
package de.ellpeck.prettypipes.pipe.modules;
|
|
|
|
|
|
|
|
import de.ellpeck.prettypipes.items.IModule;
|
|
|
|
import de.ellpeck.prettypipes.items.ModuleItem;
|
|
|
|
import de.ellpeck.prettypipes.items.ModuleTier;
|
2021-12-02 14:44:26 +01:00
|
|
|
import de.ellpeck.prettypipes.pipe.PipeBlockEntity;
|
2021-12-02 12:31:04 +01:00
|
|
|
import net.minecraft.world.item.ItemStack;
|
2020-04-17 17:18:25 +02:00
|
|
|
|
|
|
|
public class LowPriorityModuleItem extends ModuleItem {
|
2022-06-27 13:57:06 +02:00
|
|
|
|
2020-04-17 17:18:25 +02:00
|
|
|
private final int priority;
|
|
|
|
|
|
|
|
public LowPriorityModuleItem(String name, ModuleTier tier) {
|
|
|
|
super(name);
|
|
|
|
this.priority = tier.forTier(-50, -100, -200);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-12-02 14:44:26 +01:00
|
|
|
public int getPriority(ItemStack module, PipeBlockEntity tile) {
|
2020-04-17 17:18:25 +02:00
|
|
|
return this.priority;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-12-02 14:44:26 +01:00
|
|
|
public boolean isCompatible(ItemStack module, PipeBlockEntity tile, IModule other) {
|
2020-10-27 15:36:52 +01:00
|
|
|
return !(other instanceof LowPriorityModuleItem) && !(other instanceof HighPriorityModuleItem);
|
2020-04-17 17:18:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-12-02 14:44:26 +01:00
|
|
|
public boolean hasContainer(ItemStack module, PipeBlockEntity tile) {
|
2020-04-17 17:18:25 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|