Package net.mcft.copy.betterstorage.tile.crate

Examples of net.mcft.copy.betterstorage.tile.crate.CratePileData


  private int lastFullness = 0;
 
  public ContainerCrate(EntityPlayer player, InventoryCratePlayerView inventory) {
    super(player, inventory, 9, inventory.getSizeInventory() / 9);
    this.playerView = inventory;
    CratePileData data = inventory.data;
    fullness = data.getOccupiedSlots() * 255 / data.getCapacity();
  }
View Full Code Here


  @Override
  public void detectAndSendChanges() {
    if (playerView == null) return;
    super.detectAndSendChanges();
   
    CratePileData data = playerView.data;
    // detectAndSendChanges gets called after a crate gets broken.
    // So to prevent a division by zero, just return.
    if (data.getNumCrates() <= 0) return;
    fullness = data.getOccupiedSlots() * 255 / data.getCapacity();
    sendUpdateIfChanged(0, fullness, lastFullness);
    lastFullness = fullness;
  }
View Full Code Here

TOP

Related Classes of net.mcft.copy.betterstorage.tile.crate.CratePileData

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.