本文整理匯總了Java中tools.data.LittleEndianAccessor.readLong方法的典型用法代碼示例。如果您正苦於以下問題:Java LittleEndianAccessor.readLong方法的具體用法?Java LittleEndianAccessor.readLong怎麽用?Java LittleEndianAccessor.readLong使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tools.data.LittleEndianAccessor
的用法示例。
在下文中一共展示了LittleEndianAccessor.readLong方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handle
import tools.data.LittleEndianAccessor; //導入方法依賴的package包/類
@PacketHandler(opcode = RecvPacketOpcode.BLACK_CUBE_RESULT)
public static void handle(MapleClient c, LittleEndianAccessor lea){
MapleCharacter chr = c.getPlayer();
if (chr == null){
c.getSession().write(CWvsContext.enableActions());
return;
}
lea.skip(4); // update tick
short choice = lea.readShort();
long uniqueId = lea.readLong(); // currently not used, may be implemented in the future.
boolean choseOld = choice == 7; // old choice = 7, new choice = 6
if(choseOld){
Equip equip = chr.getLastBlackCubedItem();
if (equip == null){
//should not happen under normal circumstances
c.getSession().write(CWvsContext.enableActions());
return;
}
equip.setPotential(equip.getOldPotential());
MapleInventoryType mit = equip.getPosition() < 0 ? MapleInventoryType.EQUIPPED : MapleInventoryType.EQUIP;
chr.forceReAddItem(equip, mit);
}
c.getSession().write(CWvsContext.enableActions());
chr.setLastBlackCubedItem(null); // to indicate user has finished cubing
}