Package net.minecraftforge.fluids.FluidContainerRegistry

Examples of net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData


    if (worldObj.getTotalWorldTime() % 20 * 10 != 0)
      return;

    // Check if we have suitable items waiting in the item slot
    if (inventory.getStackInSlot(SLOT_CAN) != null) {
      FluidContainerData container = LiquidHelper.getLiquidContainer(inventory.getStackInSlot(SLOT_CAN));
      if (container != null && RecipeManager.isInput(container.fluid)) {

        inventory.setInventorySlotContents(SLOT_CAN, StackUtils.replenishByContainer(this, inventory.getStackInSlot(SLOT_CAN), container, resourceTank));
        if (inventory.getStackInSlot(SLOT_CAN).stackSize <= 0)
          inventory.setInventorySlotContents(SLOT_CAN, null);
View Full Code Here


    if(slotIndex == SLOT_RESOURCE)
      return FluidContainerRegistry.isEmptyContainer(itemstack);

    if(slotIndex == SLOT_CAN) {
      FluidContainerData container = LiquidHelper.getLiquidContainer(itemstack);
      return container != null && RecipeManager.isInput(container.fluid);
    }

    return false;
  }
View Full Code Here

    }
    return null;
  }

  public static FluidContainerData createLiquidData(String ident, FluidStack stillLiquid, ItemStack filled, ItemStack container) {
    return new FluidContainerData(new FluidStack(getOrCreateLiquid(ident), Defaults.BUCKET_VOLUME), filled, container);
  }
View Full Code Here

  public static void injectLiquidContainer(String name, int volume, ItemStack filled, ItemStack empty, ItemStack remnant, int chance) {
    FluidStack contained = getLiquid(name, volume);
    if (contained == null)
      throw new IllegalArgumentException(String.format("Attempted to inject a liquid container for the non-existent liquid '%s'.", name));

    FluidContainerData container = new FluidContainerData(contained, filled, empty);
    FluidContainerRegistry.registerFluidContainer(container);

    if (RecipeManagers.squeezerManager != null)
      if (!container.filledContainer.getItem().hasContainerItem(container.filledContainer))
        if (remnant != null)
View Full Code Here

  @Override
  public void updateServerSide() {

    // Check if we have suitable items waiting in the item slot
    if (inventory.getStackInSlot(SLOT_CAN) != null) {
      FluidContainerData container = LiquidHelper.getLiquidContainer(inventory.getStackInSlot(SLOT_CAN));

      if (container != null && resourceTank.accepts(container.fluid.getFluid())) {

        inventory.setInventorySlotContents(SLOT_CAN, StackUtils.replenishByContainer(this, inventory.getStackInSlot(SLOT_CAN), container, resourceTank));
        if (inventory.getStackInSlot(SLOT_CAN).stackSize <= 0)
          inventory.setInventorySlotContents(SLOT_CAN, null);

      }
    }

    // Can product liquid if possible
    if (inventory.getStackInSlot(SLOT_RESOURCE) != null) {
      FluidContainerData container = LiquidHelper.getEmptyContainer(inventory.getStackInSlot(SLOT_RESOURCE), productTank.getFluid());
      if (container != null) {
        inventory.setInventorySlotContents(SLOT_PRODUCT, bottleIntoContainer(inventory.getStackInSlot(SLOT_RESOURCE), inventory.getStackInSlot(SLOT_PRODUCT), container, productTank));
        if (inventory.getStackInSlot(SLOT_RESOURCE).stackSize <= 0)
          inventory.setInventorySlotContents(SLOT_RESOURCE, null);
      }
View Full Code Here

  /* ISPECIALINVENTORY */
  @Override
  public int addItem(ItemStack stack, boolean doAdd, ForgeDirection from) {
    int inventorySlot;

    FluidContainerData container = LiquidHelper.getLiquidContainer(stack);
    if (container != null && resourceTank.accepts(container.fluid.getFluid()))
      inventorySlot = SLOT_CAN;
    else if (LiquidHelper.isEmptyContainer(stack))
      inventorySlot = SLOT_RESOURCE;
    else
View Full Code Here

    if(slotIndex == SLOT_RESOURCE)
      return LiquidHelper.isEmptyContainer(itemstack);

    if(slotIndex == SLOT_CAN) {
      FluidContainerData container = LiquidHelper.getLiquidContainer(itemstack);
      return container != null && resourceTank.accepts(container.fluid.getFluid());
    }

    return false;
  }
View Full Code Here

  public void updateServerSide() {

    // Check inventory slots for fuel
    // Check if we have suitable items waiting in the item slot
    if (inventory.getStackInSlot(SLOT_CAN) != null) {
      FluidContainerData container = LiquidHelper.getLiquidContainer(inventory.getStackInSlot(SLOT_CAN));
      if (container != null)

        if (resourceTank.accepts(container.fluid.getFluid())) {
          inventory.setInventorySlotContents(SLOT_CAN, StackUtils.replenishByContainer(this, inventory.getStackInSlot(SLOT_CAN), container, resourceTank));
          if (inventory.getStackInSlot(SLOT_CAN).stackSize <= 0)
View Full Code Here

  /* ISPECIALINVENTORY */
  @Override
  public int addItem(ItemStack stack, boolean doAdd, ForgeDirection from) {

    FluidContainerData container = LiquidHelper.getLiquidContainer(stack);
    if (container == null)
      return 0;

    if (!FuelManager.generatorFuel.containsKey(container.fluid))
      return 0;
View Full Code Here

  @Override
  public void updateServerSide() {

    // Check if we have suitable water container waiting in the item slot
    if (inventory.getStackInSlot(SLOT_PRODUCT) != null) {
      FluidContainerData container = LiquidHelper.getLiquidContainer(inventory.getStackInSlot(SLOT_PRODUCT));
      if (container != null && resourceTank.accepts(container.fluid.getFluid())) {

        inventory.setInventorySlotContents(SLOT_PRODUCT, StackUtils.replenishByContainer(this, inventory.getStackInSlot(SLOT_PRODUCT), container, resourceTank));
        if (inventory.getStackInSlot(SLOT_PRODUCT).stackSize <= 0)
          inventory.setInventorySlotContents(SLOT_PRODUCT, null);
View Full Code Here

TOP

Related Classes of net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.