Search in sources :

Example 1 with SmartInventory

use of com.simibubi.create.foundation.item.SmartInventory in project Create by Creators-of-Create.

the class MechanicalPressTileEntity method applyCompactingOnBasin.

protected void applyCompactingOnBasin() {
    if (level.isClientSide)
        return;
    pressedItems.clear();
    applyBasinRecipe();
    Optional<BasinTileEntity> basin = getBasin();
    if (basin.isPresent()) {
        SmartInventory inputs = basin.get().getInputInventory();
        for (int slot = 0; slot < inputs.getSlots(); slot++) {
            ItemStack stackInSlot = inputs.getItem(slot);
            if (stackInSlot.isEmpty())
                continue;
            pressedItems.add(stackInSlot);
        }
    }
    sendData();
}
Also used : BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) SmartInventory(com.simibubi.create.foundation.item.SmartInventory) ItemStack(net.minecraft.world.item.ItemStack)

Example 2 with SmartInventory

use of com.simibubi.create.foundation.item.SmartInventory in project Create by Creators-of-Create.

the class MechanicalMixerTileEntity method renderParticles.

public void renderParticles() {
    Optional<BasinTileEntity> basin = getBasin();
    if (!basin.isPresent() || level == null)
        return;
    for (SmartInventory inv : basin.get().getInvs()) {
        for (int slot = 0; slot < inv.getSlots(); slot++) {
            ItemStack stackInSlot = inv.getItem(slot);
            if (stackInSlot.isEmpty())
                continue;
            ItemParticleOption data = new ItemParticleOption(ParticleTypes.ITEM, stackInSlot);
            spillParticle(data);
        }
    }
    for (SmartFluidTankBehaviour behaviour : basin.get().getTanks()) {
        if (behaviour == null)
            continue;
        for (TankSegment tankSegment : behaviour.getTanks()) {
            if (tankSegment.isEmpty(0))
                continue;
            spillParticle(FluidFX.getFluidParticle(tankSegment.getRenderedFluid()));
        }
    }
}
Also used : BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) SmartInventory(com.simibubi.create.foundation.item.SmartInventory) SmartFluidTankBehaviour(com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour) ItemParticleOption(net.minecraft.core.particles.ItemParticleOption) TankSegment(com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour.TankSegment) ItemStack(net.minecraft.world.item.ItemStack)

Aggregations

BasinTileEntity (com.simibubi.create.content.contraptions.processing.BasinTileEntity)2 SmartInventory (com.simibubi.create.foundation.item.SmartInventory)2 ItemStack (net.minecraft.world.item.ItemStack)2 SmartFluidTankBehaviour (com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour)1 TankSegment (com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour.TankSegment)1 ItemParticleOption (net.minecraft.core.particles.ItemParticleOption)1