本文整理汇总了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 );
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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 });
}
}
}
示例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;
}
示例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()));
}
}
}
示例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);
}
}
示例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()));
}
}
示例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++;
}
}
示例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);
}
示例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});
}
示例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});
}
}