- 737
- 2
Да, это моя личная рубрика. У меня в тайле блока есть такой метод:
Он добавляет тики, если в слоте 0 есть что-нибудь, обнуляет тики и изменяет содержимое слотов. Вопрос: как увеличить время работы, ведь он делает это мгновенно, в то время, как мне требуется постепенное обнуление(как в печи).
Код:
@Override
public void updateEntity() {
if (!getWorldObj().isRemote) {
ItemStack itemStack = getStackInSlot(0);
if (itemStack != null) {
for(handlingTime = 0; handlingTime < 100; ++handlingTime);
if (handlingTime == 100) {
handlingTime = 0;
decrStackSize(0, 1);
if (getStackInSlot(1) != null) {
setInventorySlotContents(1, new ItemStack(OBItems.matter, ++getStackInSlot(1).stackSize));
}
else {
setInventorySlotContents(1, new ItemStack(OBItems.matter));
markDirty();
}
}
} else {
handlingTime = 0;
}
}
}