當前位置: 首頁>>代碼示例>>Java>>正文


Java IContainerListener.sendProgressBarUpdate方法代碼示例

本文整理匯總了Java中net.minecraft.inventory.IContainerListener.sendProgressBarUpdate方法的典型用法代碼示例。如果您正苦於以下問題:Java IContainerListener.sendProgressBarUpdate方法的具體用法?Java IContainerListener.sendProgressBarUpdate怎麽用?Java IContainerListener.sendProgressBarUpdate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.inventory.IContainerListener的用法示例。


在下文中一共展示了IContainerListener.sendProgressBarUpdate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void detectAndSendChanges() {
	super.detectAndSendChanges();
	if(lastindex!=index){
		pictureOutSlot.decrStackSize(64);
		lastindex=index;
	}
	if(totalPictureNum!=0&&!pictureOutSlot.getHasStack()&&index!=-1){
		String imageName = listPid.get(index);
		ItemStack itemPicture = new ItemStack(ItemLoader.itemPicture);
		NBTTagCompound nbt = new NBTTagCompound();
		nbt.setString("pid", imageName);
		itemPicture.setTagCompound(nbt);
		pictureOutSlot.putStack(itemPicture);
	}
	// System.out.println(tileEntity.getBurnTime());
	for (IContainerListener i : this.listeners) {
		i.sendProgressBarUpdate(this, 0, totalPictureNum);
		i.sendProgressBarUpdate(this, 1, index);
	}

}
 
開發者ID:PorPit,項目名稱:MineCamera,代碼行數:23,代碼來源:ContainerPictureBook.java

示例2: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void detectAndSendChanges()
{
    super.detectAndSendChanges();
    for (int i = 0; i < this.listeners.size(); i++)
    {
        IContainerListener IContainerListener = this.listeners.get(i);
        if (this.burnTime != tile.getField(1))
        {
            IContainerListener.sendProgressBarUpdate(this, 0, tile.burnTime);
        }
        if (this.totalBurnTime != tile.getField(0))
        {
            IContainerListener.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
        }
    }
    this.burnTime = tile.getField(1);
    this.totalBurnTime = tile.getField(0);
}
 
開發者ID:Rushmead,項目名稱:LotsOfGenerators,代碼行數:20,代碼來源:ContainerCoalGenerator.java

示例3: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void detectAndSendChanges()
{
    super.detectAndSendChanges();

    for (int i = 0; i < this.listeners.size(); ++i)
    {
        IContainerListener icontainerlistener = (IContainerListener)this.listeners.get(i);

        if (this.progress != this.incubator.getField(0))
        {
            icontainerlistener.sendProgressBarUpdate(this, 0, this.incubator.getField(0));
        }
        else if (this.powerRemaining != this.incubator.getField(1))
        {
            icontainerlistener.sendProgressBarUpdate(this, 1, this.incubator.getField(1));
        }
    }

    this.progress = this.incubator.getField(0);
    this.powerRemaining = this.incubator.getField(1);
}
 
開發者ID:Modding-Legacy,項目名稱:Aether-Legacy,代碼行數:23,代碼來源:ContainerIncubator.java

示例4: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void detectAndSendChanges()
{
    super.detectAndSendChanges();
    for (int i = 0; i < this.listeners.size(); i++)
    {
        IContainerListener IContainerListener = this.listeners.get(i);
        if (this.power != tile.getPowerScaled(47)) {

            IContainerListener.sendProgressBarUpdate(this, 0, (int) tile.getPowerScaled(47));
        }
        if (this.progress != tile.getProgress())
        {
            IContainerListener.sendProgressBarUpdate(this, 1, tile.getProgress());
        }
        if (this.burnTime != tile.getScaledBurnTime(13))
        {
            IContainerListener.sendProgressBarUpdate(this, 2, tile.getScaledBurnTime(13));
        }
    }
}
 
開發者ID:CyberdyneCC,項目名稱:HazardousResearch,代碼行數:22,代碼來源:ContainerBase.java

示例5: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
public void detectAndSendChanges()
{
    super.detectAndSendChanges();

    for (int i = 0; i < this.listeners.size(); ++i)
    {
        IContainerListener icontainerlistener = (IContainerListener)this.listeners.get(i);

        if (this.dualCookTime != this.alloyfurnace.getField(0))
        {
            icontainerlistener.sendProgressBarUpdate(this, 0, this.alloyfurnace.getField(0));
        }

        if (this.dualPower != this.alloyfurnace.getField(1))
        {
            icontainerlistener.sendProgressBarUpdate(this, 1, this.alloyfurnace.getField(1));
        }
    }

    this.dualCookTime = this.alloyfurnace.getField(0);
    this.dualPower = this.alloyfurnace.getField(1);
}
 
開發者ID:AshIndigo,項目名稱:Alloycraft,代碼行數:23,代碼來源:ForgeContainer.java

示例6: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void detectAndSendChanges() {
	super.detectAndSendChanges();
	// System.out.println(player.getEntityWorld().isRemote);
	for (IContainerListener i : this.listeners) {
		if (this.burnTime < this.totalBurnTime) {
			this.burnTime++;
			if (this.burnTime == this.totalBurnTime) {
				//System.out.println("success");
				if (filmOutCatch != null) {
					filmOutSlot.putStack(filmOutCatch);
					if (type == 0) {
						NBTTagCompound itemTag = new NBTTagCompound();
						filmOutCatch.writeToNBT(itemTag);
						player.getActiveItemStack().getTagCompound().setTag("filmOutSlot", itemTag);
						player.getActiveItemStack().getTagCompound().removeTag("filmOutCatch");
					}
					if (type == 1) {
						items.extractItem(3, 64, false);
					}
					filmOutCatch = null;
				}
			}
			i.sendProgressBarUpdate(this, 0, this.burnTime);
			if (type == 1 && ((EntityTripod) player.getEntityWorld()
					.getEntityByID(player.getEntityData().getInteger("usingGui"))) != null)
				((EntityTripod) player.getEntityWorld()
						.getEntityByID(player.getEntityData().getInteger("usingGui"))).setBurnTime(this.burnTime);
		}
		if (type == 1 && ((EntityTripod) player.getEntityWorld()
				.getEntityByID(player.getEntityData().getInteger("usingGui")) != null)) {
			i.sendProgressBarUpdate(this, 1, ((EntityTripod) player.getEntityWorld()
					.getEntityByID(player.getEntityData().getInteger("usingGui"))).getDelay());
		}
	}

}
 
開發者ID:PorPit,項目名稱:MineCamera,代碼行數:38,代碼來源:ContainerCamera.java

示例7: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void detectAndSendChanges() {
	super.detectAndSendChanges();
	// System.out.println(tileEntity.getBurnTime());
	for (IContainerListener i : this.listeners) {
		i.sendProgressBarUpdate(this, 0, tileEntity.getBurnTime());
	}

}
 
開發者ID:PorPit,項目名稱:MineCamera,代碼行數:10,代碼來源:ContainerPhotoProcessor.java

示例8: addListener

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void addListener(IContainerListener crafting)
{
    super.addListener(crafting);
    crafting.sendProgressBarUpdate(this, 0, tile.burnTime);
    crafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
}
 
開發者ID:Rushmead,項目名稱:LotsOfGenerators,代碼行數:8,代碼來源:ContainerCoalGenerator.java

示例9: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
public void detectAndSendChanges()
{
    super.detectAndSendChanges();
    for(int i = 0; i < this.listeners.size(); i++)
    {
        IContainerListener listener = (IContainerListener)this.listeners.get(i);

        if(this.lastCookTime != this.relicLab.cookTime)
        {
            listener.sendProgressBarUpdate(this, 0, this.relicLab.cookTime);
        }

        if(this.lastBurnTime != this.relicLab.burnTime)
        {
            listener.sendProgressBarUpdate(this, 1, this.relicLab.burnTime);
        }

        if(this.lastCurrectItemBurnTime != this.relicLab.currectItemBurnTime)
        {
            listener.sendProgressBarUpdate(this, 2, this.relicLab.currectItemBurnTime);
        }
    }

    this.lastCookTime = this.relicLab.cookTime;
    this.lastBurnTime = this.relicLab.burnTime;
    this.lastCurrectItemBurnTime = this.relicLab.currectItemBurnTime;
}
 
開發者ID:Aviv871,項目名稱:TombCraft,代碼行數:28,代碼來源:ContainerRelicLab.java

示例10: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void detectAndSendChanges() {
    super.detectAndSendChanges();

    for (IContainerListener craft : this.listeners) {
        if (this.lastMechPower != this.tileChute.power)
            craft.sendProgressBarUpdate(this, 0, this.tileChute.power);
    }
    this.lastMechPower = this.tileChute.power;
}
 
開發者ID:DaedalusGame,項目名稱:BetterWithAddons,代碼行數:11,代碼來源:ContainerChute.java

示例11: sendInfo

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void sendInfo(IContainerListener craft) {
	super.sendInfo(craft);
	craft.sendProgressBarUpdate(this, 0, this.tileRealloc.reallocCookTime);
	craft.sendProgressBarUpdate(this, 1, this.tileRealloc.lpCost);
	craft.sendProgressBarUpdate(this, 2, this.tileRealloc.xpCost);
	craft.sendProgressBarUpdate(this, 3, this.tileRealloc.nTopEnchs);
}
 
開發者ID:sblectric,項目名稱:LightningCraft,代碼行數:9,代碼來源:ContainerEnchReallocator.java

示例12: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void detectAndSendChanges()
{
    super.detectAndSendChanges();

    for (int i = 0; i < this.listeners.size(); ++i)
    {
        IContainerListener icontainerlistener = (IContainerListener)this.listeners.get(i);

        if (this.progress != this.enchanter.getField(0))
        {
            icontainerlistener.sendProgressBarUpdate(this, 0, this.enchanter.getField(0));
        }
        else if (this.powerRemaining != this.enchanter.getField(1))
        {
            icontainerlistener.sendProgressBarUpdate(this, 1, this.enchanter.getField(1));
        }
        else if (this.ticksRequired != this.enchanter.getField(2))
        {
            icontainerlistener.sendProgressBarUpdate(this, 2, this.enchanter.getField(2));
        }
    }

    this.progress = this.enchanter.getField(0);
    this.powerRemaining = this.enchanter.getField(1);
    this.ticksRequired = this.enchanter.getField(2);
}
 
開發者ID:Modding-Legacy,項目名稱:Aether-Legacy,代碼行數:28,代碼來源:ContainerEnchanter.java

示例13: detectAndSendChanges

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void detectAndSendChanges()
{
	super.detectAndSendChanges();

	boolean allFieldsHaveChanged = false;
	boolean fieldHasChanged[] = new boolean[crafter.getFieldCount()];
	if (cachedFields == null) {
		cachedFields = new int[crafter.getFieldCount()];
		allFieldsHaveChanged = true;
	}
	else if (cachedFields.length != crafter.getFieldCount()) {
		cachedFields = Arrays.copyOf(cachedFields, crafter.getFieldCount());
	}
	for (int i = 0; i < cachedFields.length; i++) {
		if (allFieldsHaveChanged || cachedFields[i] != crafter.getField(i)) {
			cachedFields[i] = crafter.getField(i);
			fieldHasChanged[i] = true;
		}
	}

	for (int i = 0; i < this.listeners.size(); ++i) {
		IContainerListener icrafting = this.listeners.get(i);
		for (int fieldID = 0; fieldID < crafter.getFieldCount(); ++fieldID) {
			if (fieldHasChanged[fieldID]) {
				icrafting.sendProgressBarUpdate(this, fieldID, cachedFields[fieldID]);
			}
		}
	}
}
 
開發者ID:BubbleTrouble14,項目名稱:ARKCraft,代碼行數:31,代碼來源:ContainerEngramCrafting.java

示例14: sendInfo

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
@Override
public void sendInfo(IContainerListener craft) {
	super.sendInfo(craft);
	craft.sendProgressBarUpdate(this, 0, this.tileFurnace.furnaceCookTime);
	craft.sendProgressBarUpdate(this, 1, this.tileFurnace.furnaceBurnTime);
	craft.sendProgressBarUpdate(this, 2, this.tileFurnace.currentBurnTime);
}
 
開發者ID:sblectric,項目名稱:LightningCraft,代碼行數:8,代碼來源:ContainerLightningFurnace.java

示例15: addCraftingToCrafters

import net.minecraft.inventory.IContainerListener; //導入方法依賴的package包/類
public void addCraftingToCrafters (IContainerListener listener)
{
    super.addListener(listener);
    listener.sendProgressBarUpdate(this, 0, this.relicLab.cookTime);
    listener.sendProgressBarUpdate(this, 1, this.relicLab.burnTime);
    listener.sendProgressBarUpdate(this, 2, this.relicLab.currectItemBurnTime);
}
 
開發者ID:Aviv871,項目名稱:TombCraft,代碼行數:8,代碼來源:ContainerRelicLab.java


注:本文中的net.minecraft.inventory.IContainerListener.sendProgressBarUpdate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。