List of usage examples for io.netty.buffer ByteBufInputStream readShort
@Override public short readShort() throws IOException
From source file:de.sanandrew.mods.enderstuffp.network.packet.PacketBiomeChangerActions.java
License:Creative Commons License
@Override public void process(ByteBufInputStream stream, ByteBuf rawData, INetHandler handler) throws IOException { EnumAction action = EnumAction.VALUES[stream.readByte()]; World world = EnderStuffPlus.proxy.getWorld(handler); TileEntityBiomeChanger biomeChanger = (TileEntityBiomeChanger) world.getTileEntity(stream.readInt(), stream.readInt(), stream.readInt()); if (biomeChanger == null) { return;// www . j a va 2 s. c o m } switch (action) { case ACTIVATE: biomeChanger.activate(); break; case DEACTIVATE: biomeChanger.deactivate(); break; case CHANGE_BIOME: biomeChanger.setCurrRange(stream.readByte()); biomeChanger.changeBiome(); biomeChanger.setCurrRange(biomeChanger.getCurrRange() + 1); break; case REPLACE_BLOCKS: biomeChanger.replaceBlocks(stream.readBoolean()); break; case CHNG_MAX_RANGE: biomeChanger.setMaxRange(stream.readShort()); break; case CHNG_PERIM_FORM: biomeChanger.perimForm = EnumPerimForm.VALUES[stream.readByte()]; break; } }