/
Belyash5
/
Flu
Обзор
Документация
Войти
/
Belyash5
/
Flu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/hbm/items/ISatChip.java
36 строк
918 B
Bob
fixes, satellite memes, yummy ore gen
30 окт 2022, 22:10
30 окт 2022, 22:10
b38ad76
Код
Авторство
О чём код?
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); } }