List of usage examples for com.google.common.io ByteArrayDataInput readBoolean
@Override
boolean readBoolean();
From source file:org.yogpstop.qp.TileBasic.java
@Override protected void C_recievePacket(byte pattern, ByteArrayDataInput data, EntityPlayer ep) { switch (pattern) { case StC_OPENGUI_FORTUNE: this.fortuneInclude = data.readBoolean(); this.fortuneList.clear(); int fsize = data.readInt(); for (int i = 0; i < fsize; i++) { this.fortuneList.add(data.readLong()); }// w ww . j av a2s . c om ep.openGui(QuarryPlus.instance, QuarryPlus.guiIdFList, this.worldObj, this.xCoord, this.yCoord, this.zCoord); break; case StC_OPENGUI_SILKTOUCH: this.silktouchInclude = data.readBoolean(); this.silktouchList.clear(); int ssize = data.readInt(); for (int i = 0; i < ssize; i++) { this.silktouchList.add(data.readLong()); } ep.openGui(QuarryPlus.instance, QuarryPlus.guiIdSList, this.worldObj, this.xCoord, this.yCoord, this.zCoord); break; } }
From source file:ocelot.mods.qp2.TileBasic.java
@Override protected void C_recievePacket(byte pattern, ByteArrayDataInput data, EntityPlayer ep) { switch (pattern) { case StC_OPENGUI_FORTUNE: this.fortuneInclude = data.readBoolean(); this.fortuneList.clear(); int fsize = data.readInt(); for (int i = 0; i < fsize; i++) { this.fortuneList.add(data.readLong()); }/*from w w w . j av a 2 s. c o m*/ ep.openGui(QuarryPlus2.instance, QuarryPlus2.guiIdFList, this.worldObj, this.xCoord, this.yCoord, this.zCoord); break; case StC_OPENGUI_SILKTOUCH: this.silktouchInclude = data.readBoolean(); this.silktouchList.clear(); int ssize = data.readInt(); for (int i = 0; i < ssize; i++) { this.silktouchList.add(data.readLong()); } ep.openGui(QuarryPlus2.instance, QuarryPlus2.guiIdSList, this.worldObj, this.xCoord, this.yCoord, this.zCoord); break; } }
From source file:micdoodle8.mods.galacticraft.core.tile.GCCoreTileEntityCargoUnloader.java
@Override public void readPacket(ByteArrayDataInput data) { if (this.worldObj.isRemote) { this.setEnergyStored(data.readFloat()); this.disabled = data.readBoolean(); this.disableCooldown = data.readInt(); this.targetEmpty = data.readBoolean(); this.noTarget = data.readBoolean(); this.targetNoInventory = data.readBoolean(); }/*from w w w . jav a2 s . com*/ }
From source file:micdoodle8.mods.galacticraft.core.tile.GCCoreTileEntityCargoLoader.java
@Override public void readPacket(ByteArrayDataInput data) { if (this.worldObj.isRemote) { this.setEnergyStored(data.readFloat()); this.disabled = data.readBoolean(); this.disableCooldown = data.readInt(); this.targetFull = data.readBoolean(); this.outOfItems = data.readBoolean(); this.noTarget = data.readBoolean(); this.targetNoInventory = data.readBoolean(); }/*from w w w. ja v a2s . c o m*/ }
From source file:micdoodle8.mods.galacticraft.core.tile.GCCoreTileEntityOxygenCollector.java
@Override public void readPacket(ByteArrayDataInput data) { if (this.worldObj.isRemote) { this.setOxygenStored(data.readFloat()); this.setEnergyStored(data.readFloat()); this.disabled = data.readBoolean(); this.lastOxygenCollected = data.readFloat(); }//from ww w . j a va 2s .c om }
From source file:net.minecraftforge.gradle.user.patcherUser.TaskApplyBinPatches.java
private ClassPatch readPatch(JarEntry patchEntry, JarInputStream jis) throws IOException { log("\t%s", patchEntry.getName()); ByteArrayDataInput input = ByteStreams.newDataInput(ByteStreams.toByteArray(jis)); String name = input.readUTF(); String sourceClassName = input.readUTF(); String targetClassName = input.readUTF(); boolean exists = input.readBoolean(); int inputChecksum = 0; if (exists) { inputChecksum = input.readInt(); }//from w ww .j a v a 2 s . co m int patchLength = input.readInt(); byte[] patchBytes = new byte[patchLength]; input.readFully(patchBytes); return new ClassPatch(name, sourceClassName, targetClassName, exists, inputChecksum, patchBytes); }
From source file:de.bl4ckskull666.afkbukkit.AFKBukkit.java
@Override public void onPluginMessageReceived(String c, Player p, byte[] m) { if (!c.equalsIgnoreCase("BungeeCord")) return;/*from ww w . j av a2s . co m*/ ByteArrayDataInput in = ByteStreams.newDataInput(m); String sub = in.readUTF(); if (!sub.equalsIgnoreCase("AFKB")) return; String cat = in.readUTF(); if (cat.equalsIgnoreCase("Player")) { UUID uuid = UUID.fromString(in.readUTF()); boolean bol = in.readBoolean(); debugMe("Receive " + uuid.toString() + " with " + bol); AFKBukkit.checkSwitchPlayer(uuid, bol); } else if (cat.equalsIgnoreCase("Config")) { debugMe("Receive Configuration"); String conf = in.readUTF(); String val = in.readUTF().replace("__--__", " "); if (conf != null && val != null) { AFKBukkit.getPlugin().getConfig().set(conf, val); debugMe("Receive " + conf + " Configuration from Bungee and set " + val + " it."); } saveConfig(); } }
From source file:micdoodle8.mods.galacticraft.core.tile.GCCoreTileEntityFuelLoader.java
@Override public void readPacket(ByteArrayDataInput data) { if (this.worldObj.isRemote) { this.setEnergyStored(data.readFloat()); this.fuelTank.setFluid(new FluidStack(GalacticraftCore.fluidFuel, data.readInt())); this.disabled = data.readBoolean(); this.disableCooldown = data.readInt(); }/* w w w . j av a 2s . co m*/ }
From source file:unwrittenfun.minecraft.wallteleporters.handlers.PacketHandler.java
public void onLockedOrRotationPacket(ByteArrayDataInput reader, EntityPlayer player) { byte id = reader.readByte(); int cWorldId = reader.readInt(); int cX = reader.readInt(); int cY = reader.readInt(); int cZ = reader.readInt(); boolean bool = reader.readBoolean(); if (player.worldObj.provider.dimensionId == cWorldId) { TileEntity tileEntity = player.worldObj.getBlockTileEntity(cX, cY, cZ); if (tileEntity instanceof TileEntityWallTeleporter) { TileEntityWallTeleporter teleporter = ((TileEntityWallTeleporter) tileEntity); switch (id) { case 0: teleporter.multiblock.setLocked(bool); break; case 1: teleporter.multiblock.setShouldUseRotation(bool); break; }// ww w . j a v a 2 s .c o m } } }
From source file:micdoodle8.mods.galacticraft.mars.tile.GCMarsTileEntityLaunchController.java
@Override public void readPacket(ByteArrayDataInput data) { try {/*from w ww .j a v a 2 s . co m*/ if (this.worldObj.isRemote) { this.setEnergyStored(data.readFloat()); this.disabled = data.readBoolean(); this.launchPadRemovalDisabled = data.readBoolean(); this.disableCooldown = data.readInt(); this.ownerName = data.readUTF(); this.frequencyValid = data.readBoolean(); this.destFrequencyValid = data.readBoolean(); this.launchDropdownSelection = data.readInt(); this.frequency = data.readInt(); this.destFrequency = data.readInt(); this.launchSchedulingEnabled = data.readBoolean(); } } catch (Exception e) { e.printStackTrace(); } }