mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
37 lines
918 B
Java
37 lines
918 B
Java
package com.hbm.items;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
public interface ISatChip {
|
|
|
|
public static int getFreqS(ItemStack stack) {
|
|
if(stack != null && stack.getItem() instanceof ISatChip) {
|
|
return ((ISatChip) stack.getItem()).getFreq(stack);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
public static void setFreqS(ItemStack stack, int freq) {
|
|
if(stack != null && stack.getItem() instanceof ISatChip) {
|
|
((ISatChip) stack.getItem()).setFreq(stack, freq);
|
|
}
|
|
}
|
|
|
|
public default int getFreq(ItemStack stack) {
|
|
if(stack.stackTagCompound == null) {
|
|
stack.stackTagCompound = new NBTTagCompound();
|
|
return 0;
|
|
}
|
|
return stack.stackTagCompound.getInteger("freq");
|
|
}
|
|
|
|
public default void setFreq(ItemStack stack, int freq) {
|
|
if(stack.stackTagCompound == null) {
|
|
stack.stackTagCompound = new NBTTagCompound();
|
|
}
|
|
stack.stackTagCompound.setInteger("freq", freq);
|
|
}
|
|
}
|