示例#1
0
 @Override
 public Result convertChunk(AnvilChunk chunk) {
   Result result = Result.NO_CHANGES;
   for (CompoundTag tileEntity : chunk.getTileEntities()) {
     if (tileEntity.getString(TileEntityTag.ID).equalsIgnoreCase("Sign")) {
       if (convertSign(tileEntity)) {
         result = Result.CHANGED;
       }
     }
   }
   return result;
 }
示例#2
0
  private boolean convertSign(CompoundTag sign) {
    boolean changed = false;
    for (CompoundKey<String> lineName : TileEntityTag.SIGN_LINE_NAMES) {
      String line = sign.getString(lineName);

      String changedLine = convertLine(line);
      if (line.equals(changedLine)) {
        continue;
      }

      changed = true;
      sign.setString(lineName, changedLine);
    }
    return changed;
  }