/** * 内容を文字列にして返す。 * * @return */ public String toString() { String ls = ""; for (TargetBlock ltb : targets) { if (!ls.isEmpty()) ls += ";"; ls += ltb.toString(); } if (chain != null) { ls += "=" + chain.toString(); } return ls; }
public DestroyAllIdentificator(ByteBuf pBuf, int pTargetOrMeta, int pChainOrMeta) { this(); // Target if (pBuf.isReadable(4)) { for (int li = pBuf.readInt(); li > 0; li--) { add(pBuf.readInt(), pBuf.readByte() | pTargetOrMeta); } } // Chain if (pBuf.isReadable(4)) { int li = pBuf.readInt(); if (li > 0) { chain = new DestroyAllIdentificator(); for (; li > 0; li--) { chain.add(pBuf.readInt(), pBuf.readByte() | pChainOrMeta); } } } }
public boolean isChainBlock(Block pBlock, int pMetadata) { if (chain != null) { return chain.isTargetBlock(pBlock, pMetadata); } return false; }