当前位置: 首页>>代码示例>>Java>>正文


Java IComputerAccess.queueEvent方法代码示例

本文整理汇总了Java中dan200.computercraft.api.peripheral.IComputerAccess.queueEvent方法的典型用法代码示例。如果您正苦于以下问题:Java IComputerAccess.queueEvent方法的具体用法?Java IComputerAccess.queueEvent怎么用?Java IComputerAccess.queueEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dan200.computercraft.api.peripheral.IComputerAccess的用法示例。


在下文中一共展示了IComputerAccess.queueEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendEvent

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
/**
 * Sends an event to the specified computer
 *
 * @param computer
 * @param event
 * @param additionalData
 */
void sendEvent( final IComputerAccess computer, final CCEvents event, final Object ... additionalData )
{
	// Create the arguments
	Object[] args = new Object[( additionalData == null ? 1 : 1 + additionalData.length )];

	// Set the ID
	args[0] = event.eventID;

	// Copy the rest of the data
	if( additionalData != null )
	{
		System.arraycopy( additionalData, 0, args, 1, additionalData.length );
	}

	computer.queueEvent( EssentiaProviderPeripheral.CC_EVENT_NAME, args );
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:24,代码来源:EssentiaProviderPeripheral.java

示例2: sendEvent

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
private void sendEvent(String name, Object... parms) {
    if (Loader.isModLoaded(ModIds.COMPUTERCRAFT)) {
        for (IComputerAccess computer : attachedComputers) {
            computer.queueEvent(name, parms);
        }
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:TileEntityDroneInterface.java

示例3: notifyComputers

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
/**
 * Called on a event sensor
 *
 * @param arguments
 */
@Optional.Method(modid = ModIds.COMPUTERCRAFT)
private void notifyComputers(Object... arguments) {
    for(IComputerAccess computer : attachedComputers) {
        computer.queueEvent(getType(), arguments);
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:12,代码来源:TileEntityUniversalSensor.java

示例4: updateEntity

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
@Override
public void updateEntity() {
	if (!world.isRemote) {
		if (i > 0 && this.isWriting) {
			double energy = Config.holotapeSpeed * 2;
			double extract = this.storage.extractEnergy(energy, true);
			if (extract == energy) {
				i = i - Config.holotapeSpeed;
				this.storage.extractEnergy(energy, false);
			}
		} else if (i != 0 && this.isWriting) {
			i = 0;
		} else if (i == 0 && this.isWriting) {
			for (IComputerAccess c : this.computers) {
				c.queueEvent("holotape_done", new Object[]{c.getAttachmentName(), this.inv.getStackInSlot(0).getTagCompound().getString("name")});
			}
			this.isWriting = false;
			markBlockForUpdate(pos);
		}
		this.hasH = !this.inv.getStackInSlot(0).isEmpty();
		this.isValidH = this.isValidHolotape();
		if (this.hasH) {
			if (this.isWriting) {
				TomsModUtils.setBlockStateWithCondition(world, pos, HolotapeWriter.STATE, 3);
			} else {
				if (this.isValidH) {
					TomsModUtils.setBlockStateWithCondition(world, pos, HolotapeWriter.STATE, 2);
				} else {
					TomsModUtils.setBlockStateWithCondition(world, pos, HolotapeWriter.STATE, 1);
				}
			}
		} else {
			TomsModUtils.setBlockStateWithCondition(world, pos, HolotapeWriter.STATE, 0);
		}
	}
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:37,代码来源:TileEntityHolotapeWriter.java

示例5: queueEvent

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
@Override
public void queueEvent(String event, Object[] args) {
	Object[] a = new Object[args.length + 1];
	for (int i = 0;i < args.length;i++) {
		a[i + 1] = args[i];
	}
	for (IComputerAccess c : computers) {
		a[0] = c.getAttachmentName();
		c.queueEvent(event, a);
	}
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:12,代码来源:TileEntityWirelessPeripheral.java

示例6: queueEvent

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
public void queueEvent(String event, Object[] args) {
	Object[] a = new Object[args.length + 1];
	for (int i = 0;i < args.length;i++) {
		a[i + 1] = args[i];
	}
	for (IComputerAccess c : computers) {
		a[0] = c.getAttachmentName();
		c.queueEvent(event, a);
	}
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:11,代码来源:TileEntityGPU.java

示例7: removeFromAcceptedStack

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
private void removeFromAcceptedStack(int amount) {
    acceptedStackSize -= amount;
    if (Loader.isModLoaded(Dependencies.COMPUTER_CRAFT)) {
        for (IComputerAccess computer : connectedComputers) {
            computer.queueEvent("sortChange", new Integer[] { acceptedStackSize });
        }
    }
}
 
开发者ID:Quetzi,项目名称:BluePower,代码行数:9,代码来源:TileSortron.java

示例8: onMessage

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
@Override
public IMessage onMessage(InputEventPacket message, MessageContext ctx) {
	TileEntityAntenna antenna = TileEntityAntenna.antenna_registry.get(message.uuid);
	if (antenna != null) {
		for (IComputerAccess computer : antenna.computers.keySet())
			computer.queueEvent(message.event, new Object[]{message.player, message.key, message.state});
	}
	return null;
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:10,代码来源:InputEventPacket.java

示例9: queueEvent

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
protected void queueEvent(String event, Object... args) {
    if (computers != null) {
        for (IComputerAccess computer : computers) {
            computer.queueEvent(event, ArrayUtils.add(args, 0, computer.getAttachmentName()));
        }
    }
}
 
开发者ID:theoriginalbit,项目名称:MoarPeripherals,代码行数:8,代码来源:TileInteractiveSorter.java

示例10: blockActivated

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
public void blockActivated(EntityPlayer player) {
	if (player.getHeldItem() != null) {
		for (IComputerAccess computer : computers.keySet()) {
			computer.queueEvent("oreDict", new Object[]{Util.getEntries(player.getHeldItem())});
		}
		if (Config.oreDictionaryMessage)
			ChatUtil.sendMessage(player.getDisplayName(), this, Util.getEntries(player.getHeldItem()).entrySet().toString(), 100, true);
	}
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:10,代码来源:TileEntityOreDictionary.java

示例11: computerQueueEvent

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
protected void computerQueueEvent(String event, Object... args) {
    if (computers == null || computers.isEmpty()) {
        return;
    }
    for (IComputerAccess computer : computers) {
        computer.queueEvent(event, ArrayUtils.add(args, 0, computer.getAttachmentName()));
    }
}
 
开发者ID:theoriginalbit,项目名称:MoarPeripherals,代码行数:9,代码来源:TilePlayerDetector.java

示例12: onSpeechCompletion

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
public void onSpeechCompletion(String text, String lang) {
	for (IComputerAccess computer : computers.keySet())
		if (eventTicker == 0 || (lastMessage != null && !lastMessage.equals(text))) {
			if (lang != null)
				computer.queueEvent("speechComplete", new Object[]{text, lang});
			else
				computer.queueEvent("synthComplete", new Object[]{text});
			eventSubticker = TICKER_INTERVAL;
			eventTicker++;
		}
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:12,代码来源:TileEntitySpeaker.java

示例13: setInventorySlotContents

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
@Override
public void setInventorySlotContents(int slot, ItemStack stack) {
	super.setInventorySlotContents(slot, stack);
	if (stack != null && stack.stackSize > 0 && slot == 0)
		for (IComputerAccess computer : computers)
			computer.queueEvent("itemReady", null);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:8,代码来源:TileEntityInteractiveSorter.java

示例14: onDeath

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
public void onDeath(EntityPlayer player, DamageSource source) {
	String killer = null;
	if (source instanceof EntityDamageSource) {
		Entity ent = source.getEntity();
		if (ent != null)
			killer = ent.getCommandSenderName();
	}
	for (IComputerAccess computer : computers.keySet())
		computer.queueEvent("death", new Object[] {player.getDisplayName(), killer, source.damageType});
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:11,代码来源:TileEntityChatBox.java

示例15: onResponse

import dan200.computercraft.api.peripheral.IComputerAccess; //导入方法依赖的package包/类
public void onResponse(int id, int width, int height) {
	if (huds.containsKey(id)) {
		huds.get(id).height = height;
		huds.get(id).width = width;
		for (IComputerAccess comp : computers.keySet())
			if (comp.getID() == id)
				comp.queueEvent("resolution", new Object[]{height, width});
	}
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:10,代码来源:TileEntityAntenna.java


注:本文中的dan200.computercraft.api.peripheral.IComputerAccess.queueEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。