本文整理汇总了Java中net.minecraft.inventory.ICrafting类的典型用法代码示例。如果您正苦于以下问题:Java ICrafting类的具体用法?Java ICrafting怎么用?Java ICrafting使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICrafting类属于net.minecraft.inventory包,在下文中一共展示了ICrafting类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
@Override
public void detectAndSendChanges()
{
inventory.update();
for(int i = 0; i < fields.length; i++){
int new_field = inventory.getField(i);
if(new_field != fields[i]){
fields[i] = new_field;
//send change
for(int j = 0; j < this.crafters.size(); ++j){
ICrafting icrafting = (ICrafting)this.crafters.get(j);
icrafting.sendProgressBarUpdate(this, i, new_field);
}
}
}
super.detectAndSendChanges();
}
示例2: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
@Override
public void detectAndSendChanges()
{
ent.update();
for(int i = 0; i < fields.length; i++){
int new_field = ent.getField(i);
if(new_field != fields[i]){
fields[i] = new_field;
//send change
for(int j = 0; j < this.crafters.size(); ++j){
ICrafting icrafting = (ICrafting)this.crafters.get(j);
icrafting.sendProgressBarUpdate(this, i, new_field);
}
}
}
super.detectAndSendChanges();
}
示例3: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < crafters.size(); i++) {
ICrafting icrafting = (ICrafting) crafters.get(i);
if (prevBrewTime != tile.getBrewTime())
icrafting.sendProgressBarUpdate(this, 0, tile.getBrewTime());
if (prevFuel != tile.getFuel())
icrafting.sendProgressBarUpdate(this, 1, tile.getFuel());
if (prevCurrentFuel != tile.getCurrentFuel())
icrafting.sendProgressBarUpdate(this, 2, tile.getCurrentFuel());
}
prevBrewTime = tile.getBrewTime();
prevFuel = tile.getFuel();
prevCurrentFuel = tile.getCurrentFuel();
}
示例4: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
/**
* Looks for changes made in the container, sends them to every listener.
*/
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int var1 = 0; var1 < crafters.size(); ++var1) {
ICrafting var2 = (ICrafting) crafters.get(var1);
var2.sendProgressBarUpdate(this, 0, enchantLevels[0]);
var2.sendProgressBarUpdate(this, 1, enchantLevels[1]);
var2.sendProgressBarUpdate(this, 2, enchantLevels[2]);
var2.sendProgressBarUpdate(this, 3, enchantmentSeed & -16);
var2.sendProgressBarUpdate(this, 4, field_178151_h[0]);
var2.sendProgressBarUpdate(this, 5, field_178151_h[1]);
var2.sendProgressBarUpdate(this, 6, field_178151_h[2]);
}
}
示例5: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
public void detectAndSendChanges() {
super.detectAndSendChanges();
for(int i = 0; i < this.crafters.size(); ++i) {
ICrafting craft = (ICrafting) this.crafters.get(i);
if(lastCookTime != tileEntity.machineCookTime) {
craft.sendProgressBarUpdate(this, 0, tileEntity.machineCookTime);
}
if(lastBurnTime != tileEntity.machineBurnTime) {
craft.sendProgressBarUpdate(this, 1, tileEntity.machineBurnTime);
}
if(lastItemBurnTime != tileEntity.currentBurnTime) {
craft.sendProgressBarUpdate(this, 2, tileEntity.currentBurnTime);
}
}
lastBurnTime = tileEntity.machineBurnTime;
lastCookTime = tileEntity.machineCookTime;
lastItemBurnTime = tileEntity.currentBurnTime;
}
示例6: addCraftingToCrafters
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
public void addCraftingToCrafters(final ICrafting icrafting) {
super.addCraftingToCrafters(icrafting);
icrafting.sendProgressBarUpdate((Container)this, 0, this.lastpipe_x = this.node.pipe_x);
icrafting.sendProgressBarUpdate((Container)this, 1, this.lastpipe_y = this.node.pipe_y);
icrafting.sendProgressBarUpdate((Container)this, 2, this.lastpipe_z = this.node.pipe_z);
if (this.node instanceof TileEntityTransferNodeEnergy) {
icrafting.sendProgressBarUpdate((Container)this, 3, this.lastenergycount = ((TileEntityTransferNodeEnergy)this.node).numMachines());
this.lastenergy = ((TileEntityTransferNodeEnergy)this.node).getEnergyStored(null);
for (int i = 0; i < 3; ++i) {
icrafting.sendProgressBarUpdate((Container)this, 6 + i, (int)convToShort(this.lastenergy, i));
}
}
int newliquid_type = -1;
int newliquid_amount = -1;
if (this.node instanceof TileEntityTransferNodeLiquid) {
final FluidStack t = ((TileEntityTransferNodeLiquid)this.node).getTankInfo(null)[0].fluid;
if (t != null && t.amount > 0) {
newliquid_type = FluidIDGetter.fluidLegacy.getID(t);
newliquid_amount = t.amount;
icrafting.sendProgressBarUpdate((Container)this, 4, newliquid_type);
icrafting.sendProgressBarUpdate((Container)this, 5, newliquid_amount);
}
}
}
示例7: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); ++i) {
ICrafting craft = (ICrafting) this.crafters.get(i);
if (this.lastCookTime != this.tileFurnace.furnaceCookTime) {
craft.sendProgressBarUpdate(this, 0, this.tileFurnace.furnaceCookTime);
}
if (this.lastBurnTime != this.tileFurnace.furnaceBurnTime) {
craft.sendProgressBarUpdate(this, 1, this.tileFurnace.furnaceBurnTime);
}
if (this.lastItemBurnTime != this.tileFurnace.currentBurnTime) {
craft.sendProgressBarUpdate(this, 2, this.tileFurnace.currentBurnTime);
}
}
this.lastBurnTime = this.tileFurnace.furnaceBurnTime;
this.lastCookTime = this.tileFurnace.furnaceCookTime;
this.lastItemBurnTime = this.tileFurnace.currentBurnTime;
}
示例8: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (ICrafting icrafting : this.crafters) {
if (this.progress != this.crusherInventory.getField(2)) {
icrafting.sendProgressBarUpdate(this, 2, this.crusherInventory.getField(2));
}
if (this.energy != this.crusherInventory.getField(0)) {
icrafting.sendProgressBarUpdate(this, 0, this.crusherInventory.getField(0));
}
if (this.energyCapacity != this.crusherInventory.getField(1)) {
icrafting.sendProgressBarUpdate(this, 1, this.crusherInventory.getField(1));
}
}
this.progress = this.crusherInventory.getField(2);
this.energy = this.crusherInventory.getField(0);
this.energyCapacity = this.crusherInventory.getField(1);
}
示例9: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
public void detectAndSendChanges(){
super.detectAndSendChanges();
for(int i = 0; i < this.crafters.size(); ++i){
ICrafting craft = (ICrafting) this.crafters.get(i);
if(this.lastWorkTime != this.tileExtruder.cookTime){
craft.sendProgressBarUpdate(this, 0, this.tileExtruder.cookTime);
}
if(this.lastExtrudeTime != this.tileExtruder.power){
craft.sendProgressBarUpdate(this, 1, this.tileExtruder.power);
}
}
this.lastExtrudeTime = this.tileExtruder.power;
this.lastWorkTime = this.tileExtruder.cookTime;
}
示例10: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
public void detectAndSendChanges(){
super.detectAndSendChanges();
for(int i = 0; i < this.crafters.size(); ++i){
ICrafting craft = (ICrafting) this.crafters.get(i);
if(this.lastCookTime != this.tileFurnace.furnaceCookTime){
craft.sendProgressBarUpdate(this, 0, this.tileFurnace.furnaceCookTime);
}
if(this.lastBurnTime != this.tileFurnace.furnaceBurnTime){
craft.sendProgressBarUpdate(this, 1, this.tileFurnace.furnaceBurnTime);
}
if(this.lastItemBurnTime != this.tileFurnace.currentItemBurnTime){
craft.sendProgressBarUpdate(this, 2, this.tileFurnace.currentItemBurnTime);
}
}
this.lastBurnTime = this.tileFurnace.furnaceBurnTime;
this.lastCookTime = this.tileFurnace.furnaceCookTime;
this.lastItemBurnTime = this.tileFurnace.currentItemBurnTime;
}
示例11: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void detectAndSendChanges()
{
if (crafters.isEmpty())
return;
ICrafting bCrafting;
for (int i = 0; i < inventorySlots.size(); ++i) {
ItemStack itemstack = ((Slot) inventorySlots.get(i)).getStack();
ItemStack itemstack1 = (ItemStack) inventoryItemStacks.get(i);
if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) {
itemstack1 = itemstack == null ? null : itemstack.copy();
inventoryItemStacks.set(i, itemstack1);
final NBTTagCompound nbtTagCompound = new NBTTagCompound();
nbtTagCompound.setShort("Slot", (short) i);
if (itemstack1 != null)
nbtTagCompound.setInteger("intCount", itemstack1.stackSize);
for (Object crafter : crafters)
if ((bCrafting = (ICrafting) crafter) instanceof EntityPlayerMP)
Avaritiaddons.networkWrapper.sendTo(new InfinityChestSlotSync(itemstack1, i), (EntityPlayerMP) bCrafting);
}
}
}
示例12: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
public void detectAndSendChanges() {
super.detectAndSendChanges();
if (player instanceof EntityPlayerMP) {
FissionWarfare.network.sendTo(new ClientPacketHandler("sync.energy%" + tileEntityEnergy.storage.getEnergyStored()), (EntityPlayerMP) player);
}
for (int i = 0; i < this.crafters.size(); ++i) {
ICrafting craft = (ICrafting) this.crafters.get(i);
if (this.lastProgress != tileEntityEnergy.progress) {
craft.sendProgressBarUpdate(this, 1, tileEntityEnergy.progress);
}
}
lastProgress = tileEntityEnergy.progress;
}
示例13: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int var1 = 0; var1 < this.crafters.size(); ++var1) {
ICrafting var2 = (ICrafting) this.crafters.get(var1);
if (this.curTemp != this.te.temperature)
var2.sendProgressBarUpdate(this, 0, this.te.temperature);
if (this.curEnergy != this.te.getEnergyStored(null))
var2.sendProgressBarUpdate(this, 1, this.te.getEnergyStored(null));
if (this.curMaxTemp != this.te.maxTemp)
var2.sendProgressBarUpdate(this, 2, this.te.maxTemp);
if (this.curHeating != (this.te.heating ? 1 : 0))
var2.sendProgressBarUpdate(this, 3, (this.te.heating ? 1 : 0));
if (this.te.currentAlloy != null && this.curMetalAmount != this.te.currentAlloy.outputAmount)
var2.sendProgressBarUpdate(this, 4, (int) this.te.currentAlloy.outputAmount);
}
this.curTemp = this.te.temperature;
this.curEnergy = this.te.getEnergyStored(null);
this.curMaxTemp = this.te.maxTemp;
this.curHeating = (this.te.heating ? 1 : 0);
}
示例14: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); ++i)
{
ICrafting crafting = (ICrafting)this.crafters.get(i);
if (this.lastBeeHealth != this.jar.currentBeeHealth)
{
crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth);
this.lastBeeHealth = this.jar.currentBeeHealth;
}
if (this.speciesColour != this.jar.currentBeeColour)
{
crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour);
this.speciesColour = this.jar.currentBeeColour;
}
}
}
示例15: detectAndSendChanges
import net.minecraft.inventory.ICrafting; //导入依赖的package包/类
/**
* Looks for changes made in the container, sends them to every listener.
*/
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); ++i) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.lastProgressTime != this.altar.processTime) {
icrafting.sendProgressBarUpdate(this, 0, this.altar.processTime);
}
if (this.lastPowerTime != this.altar.magic) {
icrafting.sendProgressBarUpdate(this, 1, this.altar.magic);
}
}
this.lastProgressTime = this.altar.processTime;
this.lastPowerTime = this.altar.magic;
}